query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
d2fd78875d60acd418cb5eb13fb06927
Retrieve a specific user's home directory $HOME/.facter
[ { "docid": "9636769c2b20b1e3113df164de30782a", "score": "0.83838916", "text": "def get_user_facter_dir(user_home, platform)\n File.join(user_home, '.facter')\n end", "title": "" } ]
[ { "docid": "a7110bed40fd74b95ca12d2808977ba7", "score": "0.8028642", "text": "def get_home_dir(host, user_name)\n home_dir = nil\n on host, puppet_resource('user', user_name) do |result|\n home_dir = result.stdout.match(/home\\s*=>\\s*'([^']+)'/m)[1]\n end\n home_dir\n end", "title...
284c33b2ca30479b297f293a75903944
rubocop:disable Metrics/ParameterLists rubocop:disable Naming/MethodParameterName
[ { "docid": "ca376fff167c318725e1e7d8dbf4a92c", "score": "0.0", "text": "def add_cell_to_matrix(matrix, key, cell, x, y, position)\n current_position = (x == position[:x] && y == position[:y])\n hsh = { x: x, y: y, value: cell }\n hsh[:marker] = marker(cell) if current_position\n matr...
[ { "docid": "b22ea521ce6dc3254e1f74daf0331724", "score": "0.66426474", "text": "def method\n end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.6525171", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0...
5b1b325828b09a20ac4fb8fa908ddcfe
Enters an action date
[ { "docid": "5eaa885819987a3e528bde056bab6a7f", "score": "0.7935647", "text": "def enter_botgarden_action_date(data_set)\n action_date = data_set[BOTGARDENCurrentLocationData::ACTION_DATE.name]\n if action_date\n logger.debug \"Entering accession date '#{action_date}'\"\n enter_simple...
[ { "docid": "05fd4c52a3d4ae4ce2fa3fc939ebaf3a", "score": "0.7616289", "text": "def enter_botgarden_action_date(data_set)\n action_date = data_set[InventoryMovement::LOCATION_DATE.name]\n if action_date\n enter_simple_date(botgarden_acton_date_input_locator, action_date)\n end\n end", "...
b710d5e4c9d7a5590a969144c7b17a7e
helper method to run a command and ensure success by default the thor run command does not exit the process when the command fails
[ { "docid": "195194cf823684e370b75ed214c6d83d", "score": "0.7718721", "text": "def run_command(command, options = {})\n status = run(command, options)\n fail \"#{command} failed\" unless status\nend", "title": "" } ]
[ { "docid": "b6e13b1a9352cd52f9e4662626083cbd", "score": "0.7985417", "text": "def run_or_fail(command)\n log(command)\n pid = Process.spawn(command)\n Process.wait(pid)\n $?.exitstatus == 0\nend", "title": "" }, { "docid": "2cbb333e89cdf344c0ee294f231814da", "score": "0.7961461", ...
6f14c620a840d8c73e2399761eabbe29
Go through the GIT commit log, to compute the elapsed working time of each committing developer, based on a few assumptions: (1) A series of commits within a 3 hour window are part of the same development session (2) A single commit (or the first commit of the session) is considered to represent 30 minutes of work time...
[ { "docid": "0d79a8d525fcd4f1d6779d17c9cd57b3", "score": "0.5278657", "text": "def process_git_log_into_time\n distribute_entries_to_authors( load_git_log_entries( path_to_git_repo ) )\n return prepare_rows_for_csv\n end", "title": "" } ]
[ { "docid": "efdd9571aa60c4218d75fd3fcc9c1d1e", "score": "0.6732483", "text": "def all_commit_times\n `git --git-dir=#{git_dir} log --all --pretty='%at'`.split(/\\n/).uniq\n end", "title": "" }, { "docid": "bccd5bba65ba37d7f17158da3b1281f4", "score": "0.6043936", "...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "836f9d0108eaf7bdbf900060b21cb2bd", "score": "0.0", "text": "def set_personel_detail\n @personel_detail = PersonelDetail.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": "d...
540083f30e01eb458e6e9da192805e06
Devise RegistrationsController has a method called build_resource This builds the User model in the new and create actions inside the controller
[ { "docid": "ef5a3e872ff540ba8b025c44162782ed", "score": "0.6308346", "text": "def build_resource(*args)\n super\n if session[:omniauthhash]\n @user.apply_omniauth(session[:omniauthhash]) #apply_omniauth is the method in User model \n @user.valid?\n end\n end", "title": "" } ]
[ { "docid": "4336849684d1a6985682da26cd34f96c", "score": "0.76666325", "text": "def build_resource(params={})\n self.resource = UserForm.new(params)\n end", "title": "" }, { "docid": "9d26fa662d9eb4c4c9656a599497d89e", "score": "0.74527735", "text": "def build_resource(hash=nil)\n...
f665d9a1b7d3da1f69abef9ab70dfd19
Add a level for a player
[ { "docid": "e40a3509ed07827d331de0fb41ee4ea3", "score": "0.7499588", "text": "def addlevel(msg, log_entry)\n player = verify_player msg\n return unless player\n player.level_log << log_entry\n msg.reply \"Congratulations! #{player.name} has ascended to level #{player.level}.\"\n player.sa...
[ { "docid": "df902b376072965bc7cae49187337bc6", "score": "0.71499956", "text": "def summons_level(level)\n set_summons\n for summon in @summons\n $game_actors[summon.id].level += level\n end\n end", "title": "" }, { "docid": "bcc6b01311686b11c7f99955243f6b4f", "score": "0.7...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "0e3a6db7405961648a37cb7f1b92ab5b", "score": "0.0", "text": "def order_params\n params.require(:order).permit(:period_id, :dish_id, :user_id, :quantity)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7498391", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958937", "text": "def strong_params\n params.require(:request).permit(param_white...
2664e8307df095e49f9ce89a91a435e7
Forward any other method call to the configuration container; if that fails, forward it to the WebDriver. The WebDriver will take care of any method resolution errors.
[ { "docid": "8006a118ee3202566777e4f9c24db978", "score": "0.5530444", "text": "def method_missing(name, *args, &block)\n if @config.respond_to?(name)\n @config.send(name, *args, *block)\n else\n Browsery.logger.debug(\"Connector(##{self.object_id})->#{name}(#{args.map { |a| a.insp...
[ { "docid": "66b2c6f41ffe654fe9e94a03dc0a1d27", "score": "0.59141976", "text": "def configure\n not_implemented(__method__)\n end", "title": "" }, { "docid": "4964185939cd142926b05c2a3a4a5c28", "score": "0.57731694", "text": "def set_environmental_configuration(*)\n ...
c58f9334494eeb011f5a139df4675c52
Checks whether the task was completed to the full. raises an exeption if the number of non training trials don't match the expected amount
[ { "docid": "2bafdb8a2750db6933a85ea0aa57d7bd", "score": "0.73193914", "text": "def taskRunIncompleteCheck(task_run,trial_count)\n\t expected = 0\n\t case task_run.task.TASK_NAME\n \t when \"Search\",\"StroopLike\"\n \t expected = 160\n \t when \"CPT\",\"CPTi\",\"ACPT\"\n \t expected = 320\...
[ { "docid": "797b3cd85eaceff2be09a3c4da49b6f9", "score": "0.6819449", "text": "def completed?\n (self.experiment_size == self.count_done_simulations)\n end", "title": "" }, { "docid": "9f6115218ac7f6c51f3f3386e5ddc1b6", "score": "0.67982066", "text": "def check_advance\n comple...
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "fb09395af6f3c57b1d9e4295d7a919d3", "score": "0.0", "text": "def course_params\n params.require(:course).permit(:started_on, :ended_on, :campus_id, :curriculum_id,\n users_attributes: [:id, :first_name, :last_name, :email, :password, :campus_id, :curriculum_id])\n end", "...
[ { "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": "...
db1e5986f6db987df9c5ac2fc6356579
Searches where the pattern of is true
[ { "docid": "9feceec7ce11c66df96f972747acd929", "score": "0.0", "text": "def index_of_wiretype_value_encoding(type_int,content)\n\t\tcontent.force_encoding('ASCII-8BIT').index([255,type_int*2].pack(\"C*\"))\n\tend", "title": "" } ]
[ { "docid": "9cb159757b7f4e35ddb7b2b694a1a955", "score": "0.6359082", "text": "def known(words)\n return words.find_all {true } #find all words for which condition is true,\n #you need to figure out this condition\n \n end", "title": "" }, { "docid": ...
8628f788cb375784056c9d00a4e80e9f
valid_rule_data_structure? returns true if rule_data is wellstructured and false if not. rule_data must be a Hash whose keys and nonEnumerable values are String. It may store Hash and Array values, but they must have a similar structure: keys and nonEnumerable values/elements must be String, including recursively.
[ { "docid": "10b16fb746de25115ab0b5e770efcd09", "score": "0.8846078", "text": "def valid_rule_data_structure?\n return false unless rule_data.is_a? Hash\n # Depth-first search\n stack = [rule_data]\n while stack.any?\n element = stack.pop\n if element.is_a? Hash\n element.eac...
[ { "docid": "6c95ca5d54d62c7aa4205c8f4654fcb1", "score": "0.67423636", "text": "def valid?(data)\n\n @data = data\n\n rule = @rule.is_a?(Proc) ? @rule.call(@data) : @rule\n\n result = if rule.kind_of?(Regexp)\n valid_pattern?(data)\n\n elsif rule.kind_of?(Validation)\n r...
1375a04c6b0427397de6ffa31d217ff3
agressive Quick access to the aggressive flag.
[ { "docid": "b08b3a1b9dae04c6e61b65a7ac5fa3a9", "score": "0.6933703", "text": "def aggressive\n return @AI_data.aggressive\n end", "title": "" } ]
[ { "docid": "258fe4c397ccfd5ce2e8d429b024c240", "score": "0.59755856", "text": "def accelerate\n end", "title": "" }, { "docid": "12143e8258c60e72b2614fd3f833c0ef", "score": "0.5881827", "text": "def optimize\r\n puts \"fast optimize\"\r\n end", "title": "" }, { "d...
696cc056803729ad621054efdff72261
This method serializes only the value of a property. This is used to create xCard or xCal documents.
[ { "docid": "5507e8bf2e409630f65efa6c6c2dc377", "score": "0.0", "text": "def xml_serialize_value(writer)\n value_type = self.value_type.downcase\n\n json_value.each do |values|\n values = [values] unless values.is_a?(Array)\n values.each do |value|\n writer.writ...
[ { "docid": "11ef7f822f77a1beab1f8771b7d37a3d", "score": "0.6682818", "text": "def serialize; @value; end", "title": "" }, { "docid": "068047de54dee65932a57c428a1e5c3e", "score": "0.6512398", "text": "def serialize(value)\n value\n end", "title": "" }, { "docid...
49926a0e51059022b19af2b300651c21
POST /posts POST /posts.json
[ { "docid": "3cab2067c6233cc60d97f2062d891801", "score": "0.0", "text": "def create\n @post = @board.posts.build(params[:post])\n @post.ip_address = request.remote_ip\n @post.post = @board.posts.find(params[:post_id]) if params[:post_id].present?\n @new_post = @post\n\n expires = Time.now ...
[ { "docid": "92c50133f120b4421970b36c5df90a46", "score": "0.7400646", "text": "def create\n @post = Post.new(post_params)\n @post.save\n render json: @post\n end", "title": "" }, { "docid": "abed7ddc94f10bcd0f62efa65c40c143", "score": "0.72498643", "text": "def create\n p...
3b73b75eba5d21ee011c4c3f768eea6d
A validation method for if the user has been set
[ { "docid": "d5bd463a40c534facc8d7b5d1b3f19e2", "score": "0.7281649", "text": "def user_set\n return true if no_user_validation\n\n unless user\n errors.add :user, 'must be authenticated and set'\n logger.warn \"User is not set. Failed user_set validation for #{inspect}\"\n end\n us...
[ { "docid": "fbc4354dd731d55f9470b25b62e8728c", "score": "0.7395194", "text": "def require_valid_user!\n return true\n end", "title": "" }, { "docid": "e7ab6921216e4dc07c953419867c193e", "score": "0.7310533", "text": "def validate_user \n errors.add(:user_id, 'user not presence...
ddf2b93d28d7179bb0912d1b7565b69b
Send the given method to the DBus service object.
[ { "docid": "0179ce315a96c239aad219175bf0c16d", "score": "0.6764288", "text": "def send_method(name)\n @object.send(name)\n rescue NoMethodError\n raise UnknownMethod, \"Method '#{name}' does not exist.\"\n end", "title": "" } ]
[ { "docid": "ad711417cdcd6961326eb8413741a297", "score": "0.6512792", "text": "def method_missing name, *args, &block\n @service.send name, *args, &block\n end", "title": "" }, { "docid": "c1a1d7ef8793fb642c4b6ce84e7b2731", "score": "0.6493537", "text": "def method_missing...
4ab11a31c5034c1e9e3d1dc5efe6de9e
Get the plan associated with a given GitHub account
[ { "docid": "2770ca1d1e8f6a3770f7ae1aed4cb9e6", "score": "0.5579852", "text": "def plan_for_account(account_id, options = T.unsafe(nil)); end", "title": "" } ]
[ { "docid": "b6d00b1f5bef0d71983ef9015bc55480", "score": "0.70873165", "text": "def plan(accountname)\n response = get_request(\"/1.0/users/#{accountname}/plan\")\n end", "title": "" }, { "docid": "54ee4423ef6cbc10ceb643e5d17225b9", "score": "0.6841292", "text": "def plan\n ...
256aad93336e49d58f32debd01a4f652
to get values from the HTML layouts delegate
[ { "docid": "b763a20352484c8015500ee7f368860a", "score": "0.0", "text": "def textViewDidBeginEditing(textView)\n handle_focus\n end", "title": "" } ]
[ { "docid": "56e4c3f1616a2ef8c455ebdca977f432", "score": "0.6399264", "text": "def getLayoutData\n @layoutData\n end", "title": "" }, { "docid": "9934ea96b46c9cb30c0d4112fcc18705", "score": "0.6294129", "text": "def html_contents\n layout_contents\n end", "title": "" ...
cf0ef880efb148091af5383d0c6580d6
Arraytranspose array.transpose > an_array Assumes that _self_ is an array of arrays and transposes the rows and columns. a = [[1,2], [3,4], [5,6]] a.transpose => [[1, 3, 5], [2, 4, 6]]
[ { "docid": "ab19ed36bbec8921185758e5a1aa58ce", "score": "0.6616723", "text": "def transpose\n end", "title": "" } ]
[ { "docid": "5d3af595740b542c6be837922ac4a092", "score": "0.8102238", "text": "def my_transpose\n new_arr = []\n\n (0...self.length).each do |row|\n new_subarray = []\n\n (0...self[0].length).each do |col|\n new_subarray << self[col][row]\n en...
805992ffafa33abc17b962f3bfb7468f
logout of d3v sessionId session id to revoke
[ { "docid": "95f0d6c1f7cf9af11e8e97b4c8ad6cc0", "score": "0.0", "text": "def logout(sessionId)\r\n\t\tif @successfulLogin\r\n\t\t\tbegin\r\n\t\t\t\t@sfPartner.logout\r\n\t\t\trescue Exception => exception\r\n\t\t\t\r\n\t\t\tend\r\n\t\tend\t\r\n\tend", "title": "" } ]
[ { "docid": "91aaf45d8dae148ea09a3085a0d69cd5", "score": "0.7546233", "text": "def logout\n session[:user_id] = session[:server_id] = nil\n end", "title": "" }, { "docid": "3bb7aa029ff19540c0867deac58f84ba", "score": "0.75339854", "text": "def logout\n session.delete(:user_id)\...
bb6842cffe021f3269aaafdcd008da0f
Can be used in the following ways: `login(username, password)` `login(email, password)` `login(user)`
[ { "docid": "ac225ab95ea8b0df6ca640099e398ce9", "score": "0.7953527", "text": "def post_login(username_or_email_or_user, password = nil)\n if password\n username_or_email = username_or_email_or_user\n post '/api/login',\n params: { username_or_email: username_or_email, password: password }...
[ { "docid": "2e2bc4e6c814ce4d1930bf2140ca5fdc", "score": "0.8088186", "text": "def login!(user, pass)\n end", "title": "" }, { "docid": "9f37f05049cda94890b8ac677baa7f00", "score": "0.80503935", "text": "def login_user\n login(params[:email], params[:password], params[:remember]...
6e108f07fac9e1248afbe343939bbe43
Adds alternative system +systemT+
[ { "docid": "e2fb25f9e8fcb9dbbd5857ed69fa5f81", "score": "0.0", "text": "def choice(configuration = {})\n # Process the argument.\n configuration.each do |k,v|\n k = k.to_sym\n unless v.is_a?(SystemT) then\n raise \"Invalid class for ...
[ { "docid": "5b808cfd9d640063c3f9f25f4255440f", "score": "0.7593671", "text": "def add_systemT(systemT)\n # puts \"add_systemT #{systemT.name} to systemI #{self.name}\"\n # Check and add the systemT.\n if !systemT.is_a?(SystemT) then\n raise AnyError, \"Inv...
080457aa6d3648825111f55210b90887
Returns a raw HTTP response for this instance. Must have a status element defined at a bare minimum.
[ { "docid": "043f888c52141c13430419641cc6c77c", "score": "0.6271029", "text": "def to_raw(raw_body=nil)\n raise \"this response has no status\" unless first_entity()\n self.headers ||= default_headers_obj()\n self.body = raw_body if raw_body\n\n if do_chunked_encoding?(@headers)\n ...
[ { "docid": "c54b37b9dd2b0c517cd3d3955d9ec62b", "score": "0.7626282", "text": "def raw_response\n Net::HTTP.get(endpoint)\n end", "title": "" }, { "docid": "05063992e4e6420bc8dfa4ed8ec3217a", "score": "0.7466475", "text": "def raw_response\n @raw_response\n end...
5e10d397ebda1b6a6442effb13c9eca6
Overriden to act like include? when comparing a given value to an array, unless the value being compared is itself an array.
[ { "docid": "9092361fdacf24d61d8d39efde928c54", "score": "0.7059012", "text": "def === (val)\n unless val.is_a?(Array)\n self.include? val\n else\n self.orig_triple_eq(val)\n end\n end", "title": "" } ]
[ { "docid": "d8525f6ed09be1ba938eab7e3298add2", "score": "0.74259317", "text": "def ==(other)\n other.is_a?(Array) ? other.include?(@value) : (@value == other)\n end", "title": "" }, { "docid": "8fb18886045948c45646e3d22749d1af", "score": "0.7155252", "text": "def include?(val...
dec8c510df940d217e24568951326e01
oringal case statement from:
[ { "docid": "1ffb24025dd55ba7d1cdbe9c3d109044", "score": "0.0", "text": "def show_single_key\n c = read_char\n\n case c\n # when \" \"\n # # logic here (e.g. move cursor, return stored value)\n # puts \"SPACE\"\n when \"\\t\"\n return :drop_off\n when \"\\r\"\n return :pick_up\n # when ...
[ { "docid": "e790a19d21550d5580db3ee0027ffb40", "score": "0.7979102", "text": "def case; end", "title": "" }, { "docid": "00fab3a6d66b0445f38ef3dd008367b5", "score": "0.7682841", "text": "def Case(keyword, value, consequent); end", "title": "" }, { "docid": "b3769ef73467dd...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "63e3d059f95039026faa9f9a19acb8cc", "score": "0.0", "text": "def broker_params\n params.require(:broker).permit(:approved, :email) \n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
6e8495c865a6181571421124b4b9cda6
POST /loose_berries POST /loose_berries.json
[ { "docid": "81bf992e537d0225621707fc1fb209dc", "score": "0.64499635", "text": "def create\n @loose_berry = LooseBerry.new(loose_berry_params)\n\n respond_to do |format|\n if @loose_berry.save\n format.html { redirect_to tenant_loose_berries_path, notice: 'Loose berry was successfully c...
[ { "docid": "a0c57a96b594e2206c034e24d60beedd", "score": "0.59191793", "text": "def create\n @bounty = Bounty.new(params[:bounty])\n\n respond_to do |format|\n if @bounty.save\n format.html { redirect_to admin_bounties_path, notice: 'Bounty was successfully created.' }\n format.j...
64b302dcd51eec99369d1cc2bfee37e2
main routine to run a complete ping test
[ { "docid": "20bde2521c73860bf5cbdd77af85a4a5", "score": "0.7071334", "text": "def run\n return unless ping_handler && formatter\n\n formatter.header(\n '# It goes PING! .. testing', options[:url],\n (limit ? \"#{limit} times - once\" : nil),\n 'every', interval, 'seconds'\n )\n ...
[ { "docid": "82374145e2cf9f6481ccb13b2a88c31b", "score": "0.74847496", "text": "def ping(t)\n \n end", "title": "" }, { "docid": "dee572fab55aa3bb5a8d316871bd5c32", "score": "0.74658835", "text": "def ping; end", "title": "" }, { "docid": "67bc1ece1a09e2695971e2e...
310a905bea7e281b7e74738a08d20459
Generates reply with src and dst reversed Maintains original packet structure, proto, etc, changes ip_id
[ { "docid": "a8a51970be3624cc26ae22712dcd72e3", "score": "0.6873937", "text": "def reply_packet(pack)\n rep = pack.dup\n rep.eth_dst, rep.eth_src = rep.eth_src, rep.eth_dst\n rep.ip_dst, rep.ip_src = rep.ip_src, rep.ip_dst\n if pack.is_udp?\n rep.udp_dst, rep.udp_src = rep.udp_src, rep.u...
[ { "docid": "b5342334c5345db943af9fe4db0f4dce", "score": "0.6642205", "text": "def generate_reverse_udp(opts={})\n combined_asm = %Q^\n cld ; Clear the direction flag.\n call start ; Call start, this pushes the address of 'api_call' onto the stack.\n #{asm...
85474ea0f6209d7870c8953210fe428f
Returns the data uri.
[ { "docid": "3c95230bd3e95f05b729a369fe6bd3d7", "score": "0.71507657", "text": "def data_uri\n \"data:#{content_type};base64,#{Rack::Utils.escape(\n Base64.encode64(to_s))}\"\n end", "title": "" } ]
[ { "docid": "ac1f43772a9709f132c45c000e871139", "score": "0.8058261", "text": "def to_data_uri; end", "title": "" }, { "docid": "f8a83e574f39d2f0659c500217bfb54e", "score": "0.7717966", "text": "def data_url\n\t\tdata.url\n\tend", "title": "" }, { "docid": "4bc6a3bfb769a76...
bee080b2654562b8822d9b74df6715dd
Add the user to these groups, or if they are already a member, update the expiry of their membership in that group.
[ { "docid": "9ffa89751c434edb58f85d1c591e1899", "score": "0.0", "text": "def add(*values)\n values.inject(self) { |res, val| res._add(val) or fail ArgumentError, \"Unknown value for add: #{val}\" }\n end", "title": "" } ]
[ { "docid": "fc687079d8765e0b4976cd91fc8b956f", "score": "0.68354905", "text": "def add_members\n @group = Group.find(params[:id])\n params.keys.each do |key|\n if key.include?('member')\n UserGroup.create(group_id: @group.id, user_id: User.find_by(email: params[key]).id, paid: false)\n...
d55660e75a281bb8f9c91e061d7a0f7b
Create Double Opt In Token Author: Puneet Date: 15/01/2018 Reviewed By:
[ { "docid": "ae3a2065141fad4a60f6451b236ffd87", "score": "0.5645", "text": "def create_double_opt_in_token\n double_opt_in_token = LocalCipher.get_sha_hashed_text(\n \"#{@manager[:id]}::#{@manager_s[:password]}::#{current_timestamp}::double_optin::#{rand}\"\n )\n db_row = ManagerV...
[ { "docid": "d79c8dc6555e8dcd63227cce8662d22e", "score": "0.6175787", "text": "def token\n generate_token(\n user_id: id,\n settings: settings,\n password_digest: password_digest,\n authorities: \"#{Digest::MD5.hexdigest(authorities.to_json)}-v3.0.0\",\n cross_shop_authorities...
1f53ab66873d1cb77fdf213e82acf6ea
NOTE! This method is called by internal thread, not Fluentd's main thread. 'chunk' is a buffer chunk that includes multiple formatted events.
[ { "docid": "45c8d3052a9878df2d4f02d8bf0b172a", "score": "0.653188", "text": "def write(chunk)\n begin\n if @use_http\n events = Array.new\n chunk.msgpack_each do |record|\n next if record.empty?\n events.push record[0]\n end\n process_http_events(eve...
[ { "docid": "6d624ac745369fdd24b9726353e536d1", "score": "0.6745609", "text": "def on_read(chunk)\n @chunk_buffer << chunk\n while frame = get_next_frame\n receive_frame(AMQ::Client::StringAdapter::Frame.decode(frame))\n end\n end", "title": "" }, { "docid":...
00d20f096cab611bddbd23fb39012fc5
Examples: ``` repeater('Hello') == "HHeelllloo" repeater("Good job!") == "GGoooodd jjoobb!!" repeater('') == '' ```
[ { "docid": "f30c30ca749101eae48d6c9b15de58fa", "score": "0.0", "text": "def repeater(str)\n double_char = ''\n\n str.chars.each { |letter| double_char << letter * 2 }\n\n double_char\nend", "title": "" } ]
[ { "docid": "75cbdb44ea03f65672bb285e450ea518", "score": "0.6882491", "text": "def string_repeater(string)\n string * 5\nend", "title": "" }, { "docid": "6bfae7bac46c910ffe335d9f2b5e8ffc", "score": "0.68448853", "text": "def repeater(string, n)\n return string * n\nend", "title"...
ef6ce57f3bc2198bd746d6bc7ef90138
GET /admins/new GET /admins/new.json
[ { "docid": "0bfbd236957c6cfe79447a31c096ede6", "score": "0.6928596", "text": "def new\n @usuario = Usuario.new\n @admin = Admin.new\n @admin.usuario = @usuario\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin }\n end\n end", "title":...
[ { "docid": "97bdfc66fec408babbf82f8bfd9030df", "score": "0.7880443", "text": "def new\n @admin = Admin.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin }\n end\n end", "title": "" }, { "docid": "97bdfc66fec408babbf82f8bfd9030...
50fe314391ec16263701c90f4d8ade20
DELETE /close_types/1 DELETE /close_types/1.json
[ { "docid": "12f8e24b25dd55e5edbbcedb21ce6ae1", "score": "0.7918617", "text": "def destroy\n @close_type = CloseType.find(params[:id])\n @close_type.destroy\n\n respond_to do |format|\n format.html { redirect_to close_types_url }\n format.json { head :no_content }\n end\n end", ...
[ { "docid": "cb3a4620b28da58b028aef09e2782c39", "score": "0.7266501", "text": "def destroy\n @dishtype.destroy\n respond_to do |format|\n format.html { redirect_to dishtypes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c8d831ac84bfb31fb...
df86675cf9e723af44b6cedfe86d3918
Store the URI of the current request in the session. We can return to this location by calling redirect_back_or_default.
[ { "docid": "2b28d7c862e76f19dba23db5b1bc319f", "score": "0.8004452", "text": "def store_location\n session[:return_to] = request.uri\n end", "title": "" } ]
[ { "docid": "13ca4ee5f3945137c63e2f5b3ee7d1a9", "score": "0.80907094", "text": "def store_location\n session[:redirect_path] = request.path\n end", "title": "" }, { "docid": "c38931a0dbaa31523924feac172e36c0", "score": "0.8023878", "text": "def store_location\n session[...
5a930652f496acdc2c144cd38390ed6c
Add a security breach warning, and redirect somewhere else (index by default)
[ { "docid": "8f8785baf0f3cf70a91645461a8d9000", "score": "0.75593805", "text": "def security_breach( action=:index )\n add_warning( \"SECURITY.BREACH\");\n redirect_to :action=>action\n end", "title": "" } ]
[ { "docid": "3b019b7d91adb6b19a877bb42f4d2a57", "score": "0.71218246", "text": "def deny_and_redirect(msg)\n flash[:error] = \"Access Denied -- #{msg}\"\n redirect_to root_url\n end", "title": "" }, { "docid": "07f8beccb493a99b98433a4e112e9b8a", "score": "0.7062564", "tex...
fd1bd8e05257daf98756429a68e2708b
GET /opinions/1 GET /opinions/1.xml
[ { "docid": "b7d778b2f8130c1e8dc42c67eb52ea77", "score": "0.64736867", "text": "def show\n @opinion = Opinion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @opinion }\n end\n end", "title": "" } ]
[ { "docid": "9a49b25b4e7a6a9bc32b036511d58168", "score": "0.70887387", "text": "def index\n @opinions = Opinion.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @opinions }\n end\n end", "title": "" }, { "docid": "5a062e46...
bc5ce743a262b44f70d0dc6b26bbe6d6
GET /events/1 or /events/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "43a32e9b14935754f5350879e1afed4b", "score": "0.73021215", "text": "def get(event_id)\n request 'get', :e_id => event_id\n end", "title": "" }, { "docid": "2d5580b43c7c18bcd8a06713fa4be0f1", "score": "0.7298398", "text": "def show\n\t\tevent_id = params[:id]\n\t\ti...
3f87ee415e4ffa382f0d4d09154fe915
Clear the stack. Returns the stack, for chaining.
[ { "docid": "0db8f6d7e6fe2316b9513b35d45f6b57", "score": "0.86626464", "text": "def clear\n @the_stack.clear\n self\n end", "title": "" } ]
[ { "docid": "018d3a38026d84aadca9dfd127ff7cdf", "score": "0.8306057", "text": "def clear\n @stack.clear\n end", "title": "" }, { "docid": "52ea6be6666f7a01c5ef6a50d0561fa0", "score": "0.80686116", "text": "def clear\n\t\t@stack.clear\n\tend", "title": "" }, { "...
70a62ebbf6e7a63eb96862a737dd0b86
Get exchage rate for usd
[ { "docid": "6a8d4f3bbcf766aec4fa48cd866064bf", "score": "0.69172704", "text": "def rates_for_usd\n rates_for 'USD'\n end", "title": "" } ]
[ { "docid": "ffc7d9e72a7d0aedc981956846167247", "score": "0.77134943", "text": "def usd_rate\n clean(Typhoeus::Request.get('https://wts.zold.io/usd_rate')).body.to_f\n end", "title": "" }, { "docid": "ee532689fb87439ed48b21a32ed43723", "score": "0.7021166", "text": "def tp_rate\r\...
d4a1edaae4d92d004632cf64501ce2e7
DELETE /users/1 DELETE /users/1.json
[ { "docid": "2bcebd1c4dfe979619e17bb44752b0ff", "score": "0.0", "text": "def destroy\n if @user == current_user\n if @user.only_admin\n redirect_to @user, notice: 'Destroy your adminstrated events or share admin rights first'\n else\n session[:user_id] = nil\n @user.dest...
[ { "docid": "be9d8ff5c0124f1d5efc98ec2baa3fc1", "score": "0.7590564", "text": "def test_delete_user\n delete '/users/2'\n data = JSON.parse last_response.body\n\n assert_equal 'Daniel', data['name'], 'Propiedad name incorrecta'\n assert_equal 'Arbelaez', data['last_name'], 'Propiedad last_nam...
fa98bd8778a37ad034d698115dc75846
DELETE /admin/challenges/1 DELETE /admin/challenges/1.json
[ { "docid": "ea7e84856ffe06551998c9f70e1567cc", "score": "0.79933786", "text": "def destroy\n @challenge.destroy\n respond_to do |format|\n format.html { redirect_to admin_challenges_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "7d9ec41cc97bd6d903082ac3c0242598", "score": "0.77765864", "text": "def destroy\n if \"admin\" != current_user.username\n raise ActionController::RoutingError.new('Not Found')\n end\n @challenge.destroy\n respond_to do |format|\n format.html { redirect_to challenges_url,...
6f18ecb2336c8ad7c41a82aa0780fbd4
Test that a given URI matches our 'path' regex.
[ { "docid": "4850e075559aeab0c82aa8e93694ab36", "score": "0.66079575", "text": "def test_path(uri)\n path = File.absolute_path(uri.path)\n\n return if path.match(PATH_REGEX) # rubocop:disable Performance/RegexpMatch # Disabled for backwards compatibility below 2.4\n\n raise Ale...
[ { "docid": "924bed2102ed763855aa8a80829f701b", "score": "0.7313798", "text": "def routes? path_str\n path_str =~ @matcher\n end", "title": "" }, { "docid": "01e18c76a68625c829a562f3d89006e4", "score": "0.72943807", "text": "def matches_path?(url, path)\n url =~ /^(?:https?:\\/\\...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "518b4fd6ab05bfdf31bf8932b6f7bb00", "score": "0.0", "text": "def set_user\n @user = User.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": "d...
6548c4e3dc882faebb314b700ee2d247
GET /participants/new GET /participants/new.json
[ { "docid": "699e394d7c2ce1c410c1931576fdc871", "score": "0.8205306", "text": "def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @participant }\n end\n end", "title": "" } ]
[ { "docid": "37b6471498bbab50f7afa18c18c248b1", "score": "0.7862853", "text": "def new\n head :status => 405\n return\n \n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.xml { render :xml => @participant }\n end\n end", "...
c0dc6619c177ac952f151f7e64491160
GET /loans GET /loans.json
[ { "docid": "315ba7ae151f435353333d2067615c57", "score": "0.62262386", "text": "def index\n respond_to do |format|\n format.html do\n @recent_objects = Loan.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)\n render '/shared/data/all/index'\n ...
[ { "docid": "a78d66e835b8f13d4f39b1c558977836", "score": "0.7539317", "text": "def index\n #@loans = Loan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @loans }\n end\n end", "title": "" }, { "docid": "98980591aec5168679b6ea6be7...
a2bfbaa0cbda25a4e8c0df06956fbf6e
++ Creates a new instance, storing the User instance for which this strategy should be used.
[ { "docid": "24157606d45a84e30bd6741aa57b34e5", "score": "0.0", "text": "def initialize(user)\n unless user.instance_of?(User) && user.swimmer\n raise ArgumentError, 'TeamBuddyLinker requires as a parameter a user instance associated to a swimmer!'\n end\n\n @user = user\n @associated_sw...
[ { "docid": "25485ea29c69961bc4d5709bfb63ad70", "score": "0.7510439", "text": "def new\n set_user_var\n @user ||= User.new\n end", "title": "" }, { "docid": "0c1c1811628d7bdeabcdd72eb04b4367", "score": "0.74584347", "text": "def instantiateUser\n @user = User.new\n end", ...
c185d6340986ddad8594869fc17fd900
array of parameter names (symbols) required for generating URL
[ { "docid": "a536c79ace4dbf03e9b04a16d31fa729", "score": "0.0", "text": "def required_parts\n @journey_route.required_parts\n end", "title": "" } ]
[ { "docid": "32fff3ced9d81eb5931a3bdcb9ab7912", "score": "0.7077206", "text": "def url_params\n \"#{function}/#{all_params.join('/')}\"\n end", "title": "" }, { "docid": "940de28f2392a4e93d9c3c11d3e6ab70", "score": "0.7056782", "text": "def get_params\n full_raw_url.scan(...
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "b23321111a36baec4f5f41661a4abcd2", "score": "0.0", "text": "def riskfactorcancerdeath_params\n params.require(:riskfactorcancerdeath).permit(:cause, :year, :share_deaths)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74968386", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6958337", "text": "def strong_params\n params.require(:request).permit(param_whit...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "34bf35a9e536f7de1ab8db232fd71917", "score": "0.0", "text": "def set_feel\n @feel = Feel.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": "d...
15ed46b3225bf90ab05aa03d1d6e4880
PATCH/PUT /beta_codes/1 PATCH/PUT /beta_codes/1.json
[ { "docid": "2a3bda71d64f2bfc106bd0713fc7a828", "score": "0.76369625", "text": "def update\n respond_to do |format|\n if @beta_code.update(beta_code_params)\n format.html { redirect_to @beta_code, notice: 'Beta code was successfully updated.' }\n format.json { render :show, status: ...
[ { "docid": "674e4de90a8a3b07d34c27b918d40982", "score": "0.7223816", "text": "def update\n @beta_code = BetaCode.find(params[:id])\n\n respond_to do |format|\n if @beta_code.update_attributes(params[:beta_code])\n flash[:notice] = 'BetaCode was successfully updated.'\n format.ht...
7503b4bb2a556975bdd9f58b0c71328c
Computes the time elapsed between two points. Returns the time in seconds.
[ { "docid": "57277b4746129213ce982335c91ee471", "score": "0.73119557", "text": "def time_between(start_point, end_point)\n return 0 unless start_point.time && end_point.time\n end_point.time - start_point.time\n end", "title": "" } ]
[ { "docid": "1571fc11038f69a14c25b51742fa18bc", "score": "0.7358205", "text": "def elapsed_seconds(start_time, end_time)\r\n end_time - start_time\r\nend", "title": "" }, { "docid": "8e4ed6e4ccaabf140da395185480f6a2", "score": "0.73002946", "text": "def elapsed_time\n if end_time ...
1f96a9ef73f87c754527f91b87d5487c
GET /screenings/1 GET /screenings/1.json
[ { "docid": "857ef72549485343fc31b84499cdedda", "score": "0.7911811", "text": "def show\n @screening = Screening.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @screening }\n end\n end", "title": "" } ]
[ { "docid": "d415b8cafb383f775d27483a5a1f3f8e", "score": "0.7365259", "text": "def show\n @screeninginfo = Screeninginfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @screeninginfo }\n end\n end", "title": "" }, { ...
3a235fd224a1873b3edff2dd7c0464db
Create a new post using the params provided from the view and redirect back to the main index page
[ { "docid": "b285dfb64a289715166d4ec9cd69c0ce", "score": "0.7584201", "text": "def create\n\t\t# binding.pry\n\t\t@post = Post.create(post_params)\n\t\tredirect_to posts_path \n\tend", "title": "" } ]
[ { "docid": "38cabaf80ee65b2abf32ae375a2d3b93", "score": "0.81346864", "text": "def create\n \n #create new post in model with defined parameters\n @post = Post.new(post_params)\n \n #if the post succsefuly saves\n if @post.save\n \n #redirect to index. Connected to /map\n ...
ce42ce6cfe27a3b7d92e65c204d1ad91
Load ~/.adrc file with custom defaults that override default options.
[ { "docid": "57620c7d7a8d7a4f3eb8fdc85627bd77", "score": "0.8281456", "text": "def merge_custom_defaults!\n dotfile = File.join(ENV[\"HOME\"], \".adrc\")\n if File.readable?(dotfile)\n load dotfile\n merge_options!(self.class.defaults)\n end\n rescue => e\n $stderr.puts \"Could not...
[ { "docid": "67024aa8bbebe966c8ad1850dcb16c52", "score": "0.6648433", "text": "def read_rc_file\n \n file = File.join( ENV['HOME'], '.app47rc') \n if File.exists? file \n config_options = YAML.load_file( file) \n @options.merge!( config_options)\n end\n\n ...
85058c017396759c9ffc7c0fb00f588b
GET /profiles/new GET /profiles/new.json
[ { "docid": "5013c0ea3cfa03eb649d25279d7e6c6e", "score": "0.72641766", "text": "def new\n puts \"y-----------------------hehhhhhere is profile ---#{@profile.inspect}\"\n \n @profile = Profile.new\n puts \"y-----------------------hehhhhhere is profile ---#{@profile.inspect}\"\n respond_to do |f...
[ { "docid": "2ca215b890be451d2761a8f962a4aedc", "score": "0.8374358", "text": "def new\n @profile = current_user.profiles.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end", "title": "" }, { "docid": "4f0c962d9d...
7a85710a48cc01abebf9547096cdb772
DELETE /units/1 DELETE /units/1.json
[ { "docid": "a4f11c4ffc148d16cdbbc2f10b50d910", "score": "0.74074525", "text": "def destroy\n @unit.destroy\n respond_to do |format|\n format.html { redirect_to units_url, notice: 'Unit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }...
[ { "docid": "2806e9fde55758490b5da11069792bcb", "score": "0.77032965", "text": "def destroy\n @data = @unit.delete(params[:id])\n render json: @data\n end", "title": "" }, { "docid": "fa940ad167dd6a6161850b76a1fb5a37", "score": "0.7685096", "text": "def destroy\n @unit.destr...
0e9580b5f59704d035b65469199fc1b6
Creates a new instance. +raw+ should be an Array of Array of String or an Array of Hash You don't typically create your own DataTable objects Cucumber will do it internally and pass them to your Step Definitions.
[ { "docid": "9fee4fc3e6de251a4352280e96b42ece", "score": "0.60178196", "text": "def initialize(raw, location)\n @cells_class = Cells\n @cell_class = Cell\n raw = ensure_array_of_array(rubify(raw))\n # Verify that it's square\n raw.transpose\n create_c...
[ { "docid": "acc3d9b82bc37aeb7bd530e2300d81a1", "score": "0.634023", "text": "def initialize(raw)\n unless raw.is_a?(Array)\n raise ArgumentError, \"OctocatalogDiff::API::V1::Diff#initialize expects Array argument (got #{raw.class})\"\n end\n\n @raw = raw\n ...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "7f8cd1ca2f602f9446ca5024eca5cb3e", "score": "0.0", "text": "def set_tipoaccidente\n @tipoaccidente = Tipoaccidente.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": "d...
f962a6e44a58c878b3e87a4509a488e5
Global time helper 2013/09/13 cinqsmile tokyo isobe article_date(datetime) => article_date(2013/09/13 17:47:28 +0900) => 05:47 PM => article_date(2013/09/13 17:47:28 +0900,false) => Fri, 13 Sep 2013 17:47:28 +0900
[ { "docid": "0daee14e79dc9fca9a6a0342e3ab3680", "score": "0.7030882", "text": "def format_article_date(datetime, short=true, format='%I:%M %p')\n return nil unless datetime\n now = Time.now\n if short\n if datetime.today?\n datetime.strftime('%I:%M %p')\n elsif now.yesterday.beg...
[ { "docid": "48ff4044a0253c7fd4856f586696f83d", "score": "0.68081933", "text": "def article_date(article)\n\t\tpublished = article.release_date\n\t\tupdated = article.updated_at\n\t\tif published >= updated\n\t\t\treturn w3c_time(published)\n\t\telse\n\t\t\treturn w3c_time(updated)\n\t\tend\n\tend", ...
ffd93235178192a1e10547a54e9b05db
The target index that has been selected.
[ { "docid": "ac223b5991629cf30400e5e214cd4982", "score": "0.72890866", "text": "def target_index\n target_idx =\n begin\n Integer(datastore['TARGET'])\n rescue TypeError, ArgumentError\n datastore['TARGET']\n end\n\n default_idx = default_target || 0\n # Use the defa...
[ { "docid": "0e6447dbb23fa8a7669af5fa628e8660", "score": "0.8498593", "text": "def target_idx\n @target_idx\n end", "title": "" }, { "docid": "8ce0d97c4ae05ea01bc5e505a5161cd6", "score": "0.7321008", "text": "def target\n if self.respond_to?(:auto_targeted_index)\n if auto...
8164e30f463d39bffc7ae158f18e63e7
Remove an object from the store
[ { "docid": "2b635b49bed2bd9cb90c60a295ca5980", "score": "0.0", "text": "def -(object)\n remove_object(object)\n self\n end", "title": "" } ]
[ { "docid": "d67586afb2353c534fcd146534bf9ced", "score": "0.7942974", "text": "def remove object\n @active_objects.delete object.identifier\n @storage.remove(object.identifier)\n end", "title": "" }, { "docid": "36953312e8977dc93fd6cea9d06137ba", "score": "0.7491215", "te...
e1951259e95aebbba7e226ede72beb1d
POST /bread_stores POST /bread_stores.json
[ { "docid": "00b328e857387c7751e6d760ee06285f", "score": "0.7128528", "text": "def create\n @bread_store = BreadStore.new(bread_store_params)\n @bread_store.bread_store_manager_id = current_bread_store_manager.id\n\n respond_to do |format|\n if @bread_store.save\n format.html { redir...
[ { "docid": "c0460d1ceb6085effb954b62a1e810e2", "score": "0.66914135", "text": "def create\n @bread = Bread.new(bread_params)\n @bread.bread_store_id = current_bread_store_manager.bread_store.id\n\n respond_to do |format|\n if @bread.save\n format.html { redirect_to @bread, notice: '...
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "437b96c85c0902f2a017c9f456311d94", "score": "0.0", "text": "def set_interest\n @interest = Interest.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": "d...
279f6712fddcbe0a5c2a75e2ba59c957
POST /sts POST /sts.json
[ { "docid": "b6eaa32eb10696458b92acec1993a8f8", "score": "0.62802655", "text": "def create\n @st = St.new(st_params)\n\n respond_to do |format|\n if @st.save\n format.html { redirect_to @st, notice: 'St was successfully created.' }\n format.json { render :show, status: :created, ...
[ { "docid": "9cf7416f3ca19053da65055e8a7b63e5", "score": "0.62554353", "text": "def create\n @sttu = Sttu.new(sttu_params)\n\n respond_to do |format|\n if @sttu.save\n format.html { redirect_to @sttu, notice: 'Sttu was successfully created.' }\n format.json { render :show, status...
67ba774ae993fcfc9003d6281ca8cdc1
GET /print_purchase_orders/1 GET /print_purchase_orders/1.json
[ { "docid": "c7cc352aa6551a536b103c272e13528b", "score": "0.76330644", "text": "def show\n @print_purchase_order = PrintPurchaseOrder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @print_purchase_order }\n end\n end", "titl...
[ { "docid": "983a7c4191f0e0d190711a1a65d49740", "score": "0.68560493", "text": "def new\n @print_purchase_order = PrintPurchaseOrder.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @print_purchase_order }\n end\n end", "title": "" }, { ...
bc15c3f0338197147b3a9e71e55b6d59
DELETE /projecttypes/1 DELETE /projecttypes/1.json
[ { "docid": "f0a57981974ad26478f63e342c2df7d4", "score": "0.7872407", "text": "def destroy\n @projecttype = Projecttype.find(params[:id])\n @projecttype.destroy\n\n respond_to do |format|\n format.html { redirect_to projecttypes_url }\n format.json { head :no_content }\n end\n end"...
[ { "docid": "cf781976f7b63a27a0986690fb80a7ed", "score": "0.7806529", "text": "def destroy\n @project_type = ProjectType.find(params[:id])\n @project_type.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_project_types_url }\n format.json { head :no_content }\n en...
120298da2a12a0c52747819045092526
Stops a service Added for the deployservice and management interface
[ { "docid": "ba25c1090bcf2aca0a58a767efd94748", "score": "0.77993643", "text": "def stop_service()\n required_set?\n \n begin\n @container.find(@domain).find(@service).shutdown()\n @container.find(@domain).find(@service).status\n rescue Exception => ex\n ...
[ { "docid": "04a4fa15ba98d13288ce5d82ad0434e4", "score": "0.798086", "text": "def stop\n @service.stop\n end", "title": "" }, { "docid": "88ff011b0e3342db1aa2a4539aec8985", "score": "0.7960624", "text": "def stop_service\n raise \"service name not set for #{self}\" unless s...
8cebe6ab19e50131fd5048d4456c777c
halt with status 206 Partial Content, responding with the given body object
[ { "docid": "b0b08802938d167605a4674a253d1fd1", "score": "0.73076504", "text": "def halt_partial_content(body, render_options = {})\n halt(206, body, render_options)\n end", "title": "" } ]
[ { "docid": "9f9a5d11704de2502520fe8197f680dd", "score": "0.6974288", "text": "def halt_ok(body, render_options = {})\n halt(200, body, render_options)\n end", "title": "" }, { "docid": "ac052bdeaeaac22d65d7d9484b3e47b2", "score": "0.67374516", "text": "def halt(status=nil, bo...
70cc2c45de2b0fb2ddcb673f339b1d69
Reload mapped class each time when cache_classes is false.
[ { "docid": "8c366fe19c900ff564d807125ad03240", "score": "0.0", "text": "def to\n return @to if @to\n klass = @klass.constantize\n @to = klass if Rails.configuration.cache_classes\n klass\n end", "title": "" } ]
[ { "docid": "5aa07fee9a3597dfaef436d6e9e4c493", "score": "0.7426809", "text": "def cache_classes; end", "title": "" }, { "docid": "fdc27566d91b45b0679b3f665d217691", "score": "0.73066896", "text": "def rails_mark_classes_for_reload\n unless Rails.application.config.cache_classes\...
27508df611b7dae65eaa9377373aad19
GET /contact_log_people/new GET /contact_log_people/new.json
[ { "docid": "bc1e225dbf27898ab53e0f2d18d38518", "score": "0.8062122", "text": "def new\n @contact_log_person = ContactLogPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contact_log_person }\n end\n end", "title": "" } ]
[ { "docid": "6579ef14f5f085499ce6c28b70a592d4", "score": "0.74509966", "text": "def new\n @contact_person = ContactPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contact_person }\n end\n end", "title": "" }, { "docid": "f24...
f5896722577884f0822195f7224dd6b3
This method allows the gridclient code to cancel the rendering of a given cell
[ { "docid": "7bae9c6624ddc142bab6b5053bbe7a85", "score": "0.7428566", "text": "def cancel_cell_rendering(column_name,cell_value,record) \n if column_name == \"unavailable\" && (!cell_value || cell_value == \"false\" || cell_value.to_s.strip == \"\")\n return true\n else\n ...
[ { "docid": "131fc795b7a98f35d653e9a9df52e212", "score": "0.8220724", "text": "def cancel_cell_rendering(column_name,cell_value,record)\n# if column_name == \"show_records\"\n# return true\n# else\n# return false\n# end\n return true\n end", "title"...
764955a64252c2048b73531991fffb14
method for displaying skills as comma separated parameters for displaying them in edit view
[ { "docid": "bb901ec137e2ca55c2d5307591c7a9cf", "score": "0.7103034", "text": "def all_skills\n self.skills.map(&:name).join(', ')\n end", "title": "" } ]
[ { "docid": "7bdc6fab804091cc433df8caffc35357", "score": "0.7202692", "text": "def skills_view(skills)\n skills.map { |skill| skill_view(skill) }\n end", "title": "" }, { "docid": "3063a41109bfab0be54a606edf26008c", "score": "0.7099862", "text": "def all_skills\n self.skills.ma...
12123971f89861760341a32e48fa3044
Parses replicate names from input file infile input file Returns array of strings
[ { "docid": "13c0d49905b28156c2e1440731a6f9ad", "score": "0.75999045", "text": "def parse_rep_names(infile)\n File.open(infile, &:readline).split[1..-1]\n end", "title": "" } ]
[ { "docid": "b597a19d74b02d93bbf7f1d403cc4cca", "score": "0.69931877", "text": "def load_names\n names = []\n\n File.open(\"map_names.txt\", 'r') do |file|\n while line = file.gets\n names.push line\n end\n end\n\n names\nend", "title": "" }, { "docid": "64de6cf64e215b33f5f0f7b...
c0f7c3fc1c30698b2a124350af2c567e
PUT /notification_logs/1 PUT /notification_logs/1.json
[ { "docid": "e27a5fe265ae67f6ab86d2ec9125f61e", "score": "0.63787204", "text": "def update\n=begin\n @notification_log = NotificationLog.find(params[:id])\n\n respond_to do |format|\n if @notification_log.update_attributes(params[:notification_log])\n format.html { redirect_to @notifica...
[ { "docid": "60c9f38bf8c1264df70ec80a5a2b16cc", "score": "0.63484186", "text": "def update\n @log = Log.find(params[:id])\n\n if @log.update(log_params)\n head :no_content\n else\n render json: @log.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "d...
eea65f8d57d89859e171a8dff60075f0
Define an option. +name+ is the option name, a unique identifier for the option that you will use internally, which should be a symbol or a string. +desc+ is a string description which will be displayed in help messages. Takes the following optional arguments: [+:long+] Specify the long form of the argument, i.e. the f...
[ { "docid": "37218ed8f007d19f5930d2a4c903444c", "score": "0.77269614", "text": "def opt(name, desc = \"\", opts = {}, &b)\n opts[:callback] ||= b if block_given?\n opts[:desc] ||= desc\n\n o = Option.create(name, desc, opts)\n\n raise ArgumentError, \"you already have an argument named '#{nam...
[ { "docid": "6d9b3906a7d520e0c9cdd727da62d9a0", "score": "0.78951484", "text": "def opt name, desc, opts = {}\n opts[:desc] = desc\n opts[:long] ||= name.to_s.gsub(/_/, '-')\n opts[:set] ||= true\n @opts[name] = opts\n end", "title": "" }, { "docid": "3dec4b6cea31a52376...
30360a4fd43a26e148f40ba1f3650320
the actions are set after the mode has been established
[ { "docid": "37a40eaa7802437a7b59d1d6e94100b9", "score": "0.0", "text": "def read_action(guard_block)\n if not @own\n return nil unless @context.instance_methods.include? @reader\n called = @context.instance_method @reader\n method_to_call = :wrap_instance_method\...
[ { "docid": "e7086879b9ad31da7a048bec0e838034", "score": "0.64773834", "text": "def set_actions\n @actions = []\n end", "title": "" }, { "docid": "b8b36fc1cfde36f9053fe0ab68d70e5b", "score": "0.64741236", "text": "def run_actions; end", "title": "" }, { "docid": "f099a...
7221b2e9b7d5a8f433440896714806b8
PUT /post307s/1 PUT /post307s/1.xml
[ { "docid": "95c1c7bc1fc90e7e7885add2da0c7fdc", "score": "0.6499046", "text": "def update\n @post307 = Post307.find(params[:id])\n\n respond_to do |format|\n if @post307.update_attributes(params[:post307])\n format.html { redirect_to(@post307, :notice => 'Post307 was successfully update...
[ { "docid": "155e371ebe8ee5e11becc1829c80675b", "score": "0.5930389", "text": "def r307(*args)\n add_rule :r307, *args\n end", "title": "" }, { "docid": "034fe7097732900b01427485572714e5", "score": "0.58818513", "text": "def destroy\n @post307 = Post307.find(params[...
2ada5808962ae6d9f2503f58289be773
Converts XML input string into a native format.
[ { "docid": "71e9d479b4b7e2b1b2d2a5ca62ba53c2", "score": "0.0", "text": "def normalize_type(data, field)\n type_name = field[:type]\n result = case data\n when Array\n data.map {|item| normalize_item(type_name, item)}\n else\n normalize_item(type_name, data)\n ...
[ { "docid": "9a82a24fe256627e0b8fa7f42d9a3ece", "score": "0.69089013", "text": "def normalize_xml_string(xml_string)\n doc = Nokogiri::XML(xml_string)\n normalize_document(doc.root)\n doc.to_s\n end", "title": "" }, { "docid": "1234340d67084f77ea9eec40283c19a5", "score": "0.6701...
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "aca5ae9555d47592d2c5bde626bf077a", "score": "0.0", "text": "def join_specific_content_to_place_params\n params.require(:join_specific_content_to_place).permit(:place_id, :specific_content_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.74768823", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.71700543", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist...
96990036b23e62d21d7967ac36523b7a
After doing separate methods for finding two and three, I realized a general version would be better.
[ { "docid": "0a6d0d791243431c3062c8ee974331c9", "score": "0.0", "text": "def find_n_that_total(all, total, n)\n all.combination(n).each do |combo|\n if combo.sum == total\n # p combo\n return combo\n end\n end\nend", "title": "" } ]
[ { "docid": "8123f4df6be32e89a0a7971843499441", "score": "0.638888", "text": "def got_three? nums\n \n nums.select.with_index {|n,i| n if nums[i] == nums[i+1] && nums[i] == nums[i+2]}.size > 0\n \nend", "title": "" }, { "docid": "a065aa78ee2251001445da851a15c626", "score": "0.62294376", ...
8e5e4c57c26a8a685eeee5c55953ba57
RFuseFS extension. Called when the filesystem is unmounted
[ { "docid": "9de931bc252812f1660a02cd646a3026", "score": "0.77987134", "text": "def unmounted();end", "title": "" } ]
[ { "docid": "a2cd3f2172fe0055909692dcbe35d89d", "score": "0.6832355", "text": "def unmount\n umount(resource[:name])\n\n # Update property hash for future queries (e.g. refresh is called)\n case get(:ensure)\n when :mounted; set(:ensure => :unmounted)\n when :ghost; set(:ensure => :absent)...
9f2193ab5b7bcbecfebdec7735a6f9c4
sets the value at a position in grid
[ { "docid": "42d3bc6e1e120c3a8a9fbe76df2f26f4", "score": "0.8546417", "text": "def []=(pos, value)\n row, col = pos\n @grid[row][col] = value\n end", "title": "" } ]
[ { "docid": "f72d0895f051cfbb77aaa82ba387edc3", "score": "0.8515576", "text": "def update_value(pos, new_val)\n row, col = pos\n @grid[row][col].value = new_val\n end", "title": "" }, { "docid": "a6b1ec618f649d6bf4cbc3545a076cac", "score": "0.8462356", "text": "def set_val(x, y...
995de192363ceac0ddde1ea26798b539
Module accessor for `cache`, defaults to `Cache::MemoryStore`
[ { "docid": "edf8ea6a653efd8518532451a6bb5aae", "score": "0.82380295", "text": "def cache\n @cache ||= ActiveSupport::Cache::MemoryStore.new\n end", "title": "" } ]
[ { "docid": "efdf49abbe1095ff4f7932d98fc194dc", "score": "0.83680403", "text": "def cache\n @@cache ||= SimpleCacheStore.instance\n end", "title": "" }, { "docid": "cb40719353384d2ce31623b395b8d8cf", "score": "0.81459266", "text": "def cache\n return @cache if defined?(@c...
556307ebb8f74029b8806ae064248589
GET /posts/1 or /posts/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "3c8f4600800ccf91f365a57dbc4d2273", "score": "0.70204055", "text": "def posts\n #Telling the method to get posts.json\n self.class.get('/posts.json')\n end", "title": "" }, { "docid": "3c8f4600800ccf91f365a57dbc4d2273", "score": "0.70204055", "text": "def posts\n ...
1f6f1c448a8a5bb7bd619c2052571b6a
extension_config do |config| config.gem 'someawesomegem config.after_initialize do run_something end end See your config/routes.rb file in this extension to define custom routes
[ { "docid": "d2e2fdbafcd73069925ebe56f2aec808", "score": "0.0", "text": "def activate\n # tab 'Content' do\n # add_item \"The47th\", \"/admin/the47th\", :after => \"Pages\"\n # end\n end", "title": "" } ]
[ { "docid": "564a69078455e69eef8a4919a2d19025", "score": "0.68977994", "text": "def custom_routes; end", "title": "" }, { "docid": "3c87778e34d128826c70fac393d1a167", "score": "0.6577525", "text": "def external_routes; end", "title": "" }, { "docid": "b49d408078aa2312dfd3d...
620931acfd1a89a00e1482378541e55f
Outputs nonarray value in the form of hash For object, use to_hash. Otherwise, just return the value
[ { "docid": "25a8636255f6e4c5e0c6eac38d3fe98c", "score": "0.0", "text": "def _to_hash(value)\n if value.is_a?(Array)\n value.compact.map { |v| _to_hash(v) }\n elsif value.is_a?(Hash)\n {}.tap do |hash|\n value.each { |k, v| hash[k] = _to_hash(v) }\n end\n elsi...
[ { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.6719518", "text": "def hash\n [value].hash\n end", "title": "" }, { "docid": "a34f3dad821ba9744bc8d807b65489ad", "score": "0.6719518", "text": "def hash\n [value].hash\n end", "title": "" }, { "doc...
8164afe1f32e644367fe26eeae195a96
This draws and streams the minimap image for the main room interface and the section_map overlay. Default constants are hardcoded for both the minimap and section_map.
[ { "docid": "274efa9279cceadfd6157bf8755f8418", "score": "0.72926265", "text": "def minimap\n\n# Color constants for minimap and section_map (both should use the same colors)\n image_border_color = '#000000'\n room_border_color = '#000000'\n current_room_fill_color = '#...
[ { "docid": "988a9a4df2dab832a449dbf08d5e9c5d", "score": "0.64837426", "text": "def worldmap\n @game = current_game\n @sections = Section.all(:order => :position)\n @section = Section.find(params[:section_id])\n\n image_width = @sections.size > 4 ? 560 : 580 #remember to change this in articl...
3beb3780a50631cf111dd8bc574a5be1
Returns an array of Column objects for the table specified by +table_name+.
[ { "docid": "6ea75a8d5f0417916663c8aa571b0430", "score": "0.73243773", "text": "def columns(table_name, _name = nil)\n stmt = @connection.columns(native_case(table_name.to_s))\n result = stmt.fetch_all || []\n stmt.drop\n\n result.each_with_object([]) do |col, cols|\n col_nam...
[ { "docid": "07f7100f8d5fa2fa5875de2446a99bda", "score": "0.7820757", "text": "def columns(table_name, _name = nil)\n return [] if table_name.blank?\n table_structure(table_name).each_with_object([]) do |col, cols|\n col_name = col[0] # SQLColumns: COLUMN_NAME\n col_defaul...
426e3386bcb2dd0ca270c85b77380011
Respond to [[rss:href]] and [[rss:href][title]]
[ { "docid": "2171dc16067474108fd98533341ca566", "score": "0.7004999", "text": "def link_rss(href, title)\n \"<rss %p %p>\" % [href, title]\n ''\n end", "title": "" } ]
[ { "docid": "00d2632590016cb710aac068a5586ce2", "score": "0.67964524", "text": "def rss_links \n\t\tdoc.xpath(\"//link[@type=\\\"application/rss+xml\\\"]\").map do |link|\n\t\t\tif link['href'] =~ /^http:\\/\\//\n\t\t\t\tlink['href']\n\t\t\telse\n\t\t\t\t\"#{@url}#{link['href']}\"\n\t\t\tend\n\t\tend\...
2532e8131880895377cd1fadcf1d2120
PUT /profiles/1 PUT /profiles/1.xml
[ { "docid": "beb77c32dd5edeaeda80f6b50844f7b5", "score": "0.0", "text": "def update\n @profile = current_user.profile \n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(p...
[ { "docid": "9f37c662639edef08da39923901bbf44", "score": "0.70891756", "text": "def update\n @profile = current_user.profiles\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redire...
453bd7f775d8a443777681fc76abb71d
POST /apis POST /apis.json
[ { "docid": "6fb64f0be3da46c78e0ad6fc92a05728", "score": "0.0", "text": "def create\n @api = Api.new(params[:api])\n @api.save\n file_join = getDisplayFile()\n file = File.new(file_join,'w')\n file.puts(@api.cleintContent)\n file.close\n respond_to do |format|\n if @api.update_a...
[ { "docid": "92008bad042579793da1bda239d95223", "score": "0.68815404", "text": "def create\n api.post('', nil, 'application/json')\n end", "title": "" }, { "docid": "112318278b501b9b531be1765dd44ae6", "score": "0.6764254", "text": "def post(api, params)\n url2json(:POST, ...
aef80ae7ed9e852890b5e23aedd1c4e5
PATCH/PUT /orders/1 PATCH/PUT /orders/1.json
[ { "docid": "f0fc78bd0057e91b1ccff1b5c4b7f51a", "score": "0.0", "text": "def update\n respond_to do |format|\n if @order.update(order_params)\n format.html { redirect_to @order, notice: 'Order was successfully updated.' }\n format.json { render :show, status: :ok, location: @order }...
[ { "docid": "5475e478e362598519f05ab929db4ab8", "score": "0.7210738", "text": "def update\n @order = Order.find(params[:id])\n @order.update_attributes(order_params)\n render :json => @order\n end", "title": "" }, { "docid": "66c979dede895693d89bd15161614588", "score": "0.703249...
e65d83253a1a86dcdc8f20c7e9f858e2
PUT /recipes/1 PUT /recipes/1.json
[ { "docid": "99de1ee51639b741650413b6ad94732a", "score": "0.66983527", "text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n ...
[ { "docid": "939213d9663059bf0d64fe1ce04983ed", "score": "0.74094033", "text": "def update\n recipe.update(recipe_params)\n render json: recipe\n end", "title": "" }, { "docid": "fa4c1560a9c3cec2334b9e549b81747a", "score": "0.7145533", "text": "def edit(id, options = ...
8fda0865aec699295858f7d7356ec371
This function gets information of a game
[ { "docid": "3fd9119d4acd6e16044a6f5a0302c7b6", "score": "0.0", "text": "def show\n \t@buyGames = BuyGame.find(params[:id])\n end", "title": "" } ]
[ { "docid": "7202a7efa1ae6050095443180a30eb91", "score": "0.7669263", "text": "def game_info(game)\n [self.game_coordinates(game), self.game_radius(game), self.game_size(game)]\n end", "title": "" }, { "docid": "6557dae37d1b1de4aa75fbfbf172a85e", "score": "0.74004376", "text": "de...