query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
2647b5eb8c67b8841ffd4942d5ac0937
|
Polls up to (maxtime) seconds checking if the society is running maxtime:: [Integer=nil] Maximum poll time in seconds
|
[
{
"docid": "26d6f47fe7d435d379c1f9b36505c241",
"score": "0.744456",
"text": "def wait_until_running(maxtime=nil)\n start_time = Time.now.to_i\n until running?\n sleep 10\n raise \"Could not thaw society\" if maxtime && Time.now.to_i - start_time > maxtime\n end\n return self\n end",
"title": ""
}
] |
[
{
"docid": "73f2b55785a3b0db0fe76d1df9b67e2b",
"score": "0.7387841",
"text": "def wait(max_time=nil, poll=2)\n elapsed = 0\n while running?\n sleep poll\n if not max_time.nil?\n elapsed += poll\n if elapsed > max_time\n raise VeritableError.new(\"Wait for analysis -- Maximum time of #{max_time} second exceeded.\")\n end\n end\n update\n end\n end",
"title": ""
},
{
"docid": "0519db0ab3678d684bcc4097eb27ed13",
"score": "0.70918685",
"text": "def wait(max_time=nil, poll=2)\n elapsed = 0\n while running?\n sleep poll\n if not max_time.nil?\n elapsed += poll\n if elapsed > max_time\n raise VeritableError.new(\"Wait for grouping -- Maximum time of #{max_time} second exceeded.\")\n end\n end\n update\n end\n end",
"title": ""
},
{
"docid": "95a086998accd5d92621e399f47eb9ea",
"score": "0.62954575",
"text": "def wait_for(wait_max: 3, step: 0.001, &block)\n stop_at = wait_max.seconds.from_now\n\n sleep step while !block.call && (@time = Time.now) < stop_at\n\n fail \"Timeout of #{wait_max} seconds exceeded!\" unless @time < stop_at\nend",
"title": ""
},
{
"docid": "729ff79c93e042dca936d8ae4b2ab9a4",
"score": "0.6269014",
"text": "def poll(seconds = 5)\n count = seconds * 100\n\n while count > 0 && !yield\n count -= 1\n sleep 0.01\n end\n\n raise 'Poll timeout.' unless yield\nend",
"title": ""
},
{
"docid": "262a489da37f403e2abd36153a28f308",
"score": "0.6261954",
"text": "def max_time\n @max_time ||= 0.2\n end",
"title": ""
},
{
"docid": "a365d849e138d23ae8b9bc00284d58c8",
"score": "0.616931",
"text": "def schedule_to_close_timeout; Float::INFINITY; end",
"title": ""
},
{
"docid": "3d1725132f984bd8ee75616d8175b748",
"score": "0.61654156",
"text": "def limited?\n\t\t\t(Time.new - last_run) < interval\n\t\tend",
"title": ""
},
{
"docid": "c1aa3072fe5f81cf020fa5f6c26f0df7",
"score": "0.61563474",
"text": "def wait(max_wait_minutes: 60)\n\t\t\t[3, 5, 7, 15, 30, [60] * (max_wait_minutes - 1)].flatten.each do |sec|\n\t\t\t\tbegin\n\t\t\t\t\tresult = yield\n\t\t\t\t\treturn result if result\n\t\t\t\t\tLog.warn{ \"Received result is not truthy: #{result}.\" }\n\t\t\t\t\tLog.warn{ \"Retry request in #{sec} seconds.\" }\n\t\t\t\t\tsleep sec\n\t\t\t\trescue Jenkins2::NotFoundError, Jenkins2::ServiceUnavailableError => e\n\t\t\t\t\tLog.warn{ \"Received error: #{e}.\" }\n\t\t\t\t\tLog.warn{ \"Retry request in #{sec} seconds.\" }\n\t\t\t\t\tsleep sec\n\t\t\t\tend\n\t\t\tend\n\t\t\tLog.error{ \"Tired of waiting (#{max_wait_minutes} minutes). Give up.\" }\n\t\t\tnil\n\t\tend",
"title": ""
},
{
"docid": "febfc85627619c5350d23cbbdf70826d",
"score": "0.61177766",
"text": "def poll\n options['poll'] || 10\n end",
"title": ""
},
{
"docid": "f1f25ddfc4472c5afbcac03a68ffc46b",
"score": "0.6029856",
"text": "def poll\n max = max_interval\n step = interval_step\n interval = min_interval\n\n while !@abort do\n message_count = 0\n message_count += receive_messages || 0\n message_count += receive_replies || 0\n message_count += receive_tweets || 0\n\n interval = message_count > 0 ? min_interval : [interval + step, max].min\n\n log.debug \"Sleeping for #{interval}s\"\n sleep interval\n end\n end",
"title": ""
},
{
"docid": "8e659386c59974df1d4afd409159d5be",
"score": "0.60047376",
"text": "def select_timeout\n if @time_events.any?\n nearest = nearest_time_event\n now = (Time.now.to_f * 1000).truncate\n if nearest.process_at < now\n 0\n else\n (nearest.process_at - now) / 1000.0\n end\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "72978f58d283adbfc8e19e2e849c84ec",
"score": "0.5974176",
"text": "def wait_true max_wait=30, interval=0.5, &block\n max_wait = 1 if max_wait <= 0\n result = nil\n timeout max_wait do\n until (result = begin; block.call; rescue; end)\n sleep interval\n end\n end\n result\n end",
"title": ""
},
{
"docid": "ee7fc1b91b60f46113d2d91571420aec",
"score": "0.59705603",
"text": "def ping_if_idle(sec = 10)\n return false if idle_time < sec\n ping\n end",
"title": ""
},
{
"docid": "b234bdfee90b7552e41d76a6ad611660",
"score": "0.59394854",
"text": "def poll(max: 0.1)\n if connected?\n if client.read_and_process_pending(max: max)\n STATE_PENDING_DATA\n else\n STATE_CONNECTED\n end\n elsif !closed?\n poll_connection_attempt\n STATE_DISCONNECTED\n end\n rescue Interrupt\n close\n raise\n rescue ComError\n Log.info \"link closed, trying to reconnect\"\n unreachable!\n unless closed?\n attempt_connection\n end\n false\n rescue Exception => e\n Log.warn \"error while polling connection, trying to reconnect\"\n Roby.log_exception_with_backtrace(e, Log, :warn)\n unreachable!\n unless closed?\n attempt_connection\n end\n false\n end",
"title": ""
},
{
"docid": "8497458c286c5adbb051c5a123b374ae",
"score": "0.592374",
"text": "def heartbeat_timeout; Float::INFINITY; end",
"title": ""
},
{
"docid": "46f67a23228fbf4761aa2faa1bb93c01",
"score": "0.5918559",
"text": "def limit\n @timeout\n end",
"title": ""
},
{
"docid": "d93bee37eddda4d2930e52dec71efff4",
"score": "0.59181356",
"text": "def max_wait_time\n @data[\"max_wait_time\"]\n end",
"title": ""
},
{
"docid": "8592590a14edda84100b86532ec3be9d",
"score": "0.5906847",
"text": "def max_time\n @max_time ||= defaults[:max_time]\n end",
"title": ""
},
{
"docid": "7a2fc2883419a5142299f13d442c3c18",
"score": "0.587523",
"text": "def max_idle_time\n @max_idle_time ||= options[:max_idle_time]\n end",
"title": ""
},
{
"docid": "1b0d6b672013a4883f714b0ab661115c",
"score": "0.5865692",
"text": "def poll(id, deploy_id)\n i = get_instance(deploy_id)\n vm = OpenNebula::VirtualMachine.new_with_id(id, OpenNebula::Client.new)\n vm.info\n cw_mon_time = vm[\"LAST_POLL\"] ? vm[\"LAST_POLL\"].to_i : Time.now.to_i\n do_cw = (Time.now.to_i - cw_mon_time) >= 360\n puts parse_poll(i, vm, do_cw, cw_mon_time)\n end",
"title": ""
},
{
"docid": "87b5d17acee180ea6be73becabc22ff9",
"score": "0.5861111",
"text": "def wait_for(condition_name, max_wait_time: Capybara.default_max_wait_time,\n polling_interval: 0.01)\n wait_until = Time.current + max_wait_time.seconds\n loop do\n break if yield\n\n raise \"Condition not met: #{condition_name}\" if Time.current > wait_until\n\n sleep(polling_interval)\n end\n end",
"title": ""
},
{
"docid": "93fef1c7132ded72039ac82e5a37235b",
"score": "0.5836018",
"text": "def tests_poll_secs\n @game_info['tests_poll_secs']\n end",
"title": ""
},
{
"docid": "8a7618959fa58fcfa25b4b4dc485da93",
"score": "0.58179027",
"text": "def while_time_remaining; end",
"title": ""
},
{
"docid": "0d8761569965b59d7c558c2a9ed60f39",
"score": "0.5776741",
"text": "def most_likely_asleep(sleep_times, guard)\n minutes_hash = most_asleep_minutes_for(sleep_times, guard)\n time, num_times = minutes_hash.max_by { |min, times| times}\nend",
"title": ""
},
{
"docid": "aeab4d1eb608d94d36c2bf1ad4c738fc",
"score": "0.5776321",
"text": "def pause_for_roundtime\n if $_api_current_rt > 0\n api_sleep $_api_current_rt + $rt_adjust\n end\nend",
"title": ""
},
{
"docid": "ea11841fe58fc31b2c40e190c7097c2b",
"score": "0.577409",
"text": "def wait(max=10)\n Timeout.timeout(max) do\n sleep(0.1) until\n @hash.length.zero? &&\n @request_queue.empty? &&\n @req_in_flight.zero?\n end\n true\n rescue Timeout::Error => _\n end",
"title": ""
},
{
"docid": "96d9e93df559c4e7cc2c7c2749cc389f",
"score": "0.5773504",
"text": "def wait_interval\n timer = @timers.first\n return 0 unless timer\n\n delay = timer.fire_time - Timers.now\n delay < 0 ? -1 : delay\n end",
"title": ""
},
{
"docid": "0461cc63f2fdd3530f308763dcead324",
"score": "0.5759387",
"text": "def time(min, max=nil)\n if max.nil? && min.respond_to?(:max)\n max = min.max\n min = min.min\n end\n \n start = Time.now\n Timeout::timeout(max) do\n while true\n yield\n if min.nil? || (Time.now - start) > min \n break\n end\n end\n end\n rescue Timeout::Error\n end",
"title": ""
},
{
"docid": "13b88dde8ab585a86dc38b56dae0a660",
"score": "0.57581186",
"text": "def timeout(max_time, interval, &job)\n input_thread = Thread.new { job.() }\n timing_thread = measure_intervals(max_time, interval, input_thread)\n [input_thread, timing_thread].each(&:join)\n end",
"title": ""
},
{
"docid": "cb2e72278bc5763d380aea6f2a354399",
"score": "0.5747878",
"text": "def poll(_) end",
"title": ""
},
{
"docid": "b3a2ea49ca1272ac0151619dfc75d3cd",
"score": "0.57282025",
"text": "def poll_max_retries\n 3\n end",
"title": ""
},
{
"docid": "25a13dc750508987d1b6eb04c6f3e362",
"score": "0.57214534",
"text": "def time_limit\n [2, problem.time_limit].min\n end",
"title": ""
},
{
"docid": "2f850b141287cfbf02df780ce9567063",
"score": "0.5705225",
"text": "def sleep_time\n 60\n end",
"title": ""
},
{
"docid": "f3f89bfb8a1826984a97ba694dac1ecd",
"score": "0.57041",
"text": "def limit ns, max_per_hour\n\t\t\[email protected] do\n\t\t\t\t@timeout[ns] = Time.now.to_i\n\t\t\t\t@limit[ns] = max_per_hour\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "3abfedc88885fc249ce1844721f3eda0",
"score": "0.56970316",
"text": "def poll_sleep\n @sleeping = true\n handle_shutdown { sleep 5 }\n @sleeping = false\n true\n end",
"title": ""
},
{
"docid": "1aad6a6fb9c9c1947dbbbce6bbdc2936",
"score": "0.5694902",
"text": "def set_max_wait_time\n q = 'Set the MAX WAIT TIME after executing the RESTART command ' \\\n '(>= 180 secs): '\n until @max_wait && @max_wait.to_i > 179\n @max_wait = Utils.qna(q.cyan, true)\n end\n end",
"title": ""
},
{
"docid": "9ff5f413835d01e5885d63ff8fda67d8",
"score": "0.56873685",
"text": "def sleep_according_to_timer_and_api_call_limit(call_hash, logger)\n\t# if meet max allowed call count during the time interval\n\t# sleep until time expires\n\tlogger.info \"end time=#{call_hash['end_time']}, call count #{call_hash['call_count']}, allowed number calls #{call_hash['allowed_call_number_during_interval']}\"\n\twhile (Time.now.to_i <= call_hash['end_time'].to_i && call_hash['call_count'] >= call_hash['allowed_call_number_during_interval'])\n\t\tsleep_sec = (call_hash['end_time'] - Time.now).to_i + 2\n\t\tlogger.info \"API call: sleep #{sleep_sec} seconds till next time interval\"\n\t\tsleep(sleep_sec)\n\tend\n\n\tif (Time.now.to_i > call_hash['end_time'].to_i)\n\t\t# set new time frame\n\t\tcall_hash[\"start_time\"] = Time.now\n\t\tcall_hash['end_time'] = call_hash['start_time'] + call_hash['time_interval_in_seconds'] # one minute apart\n\t\t#rest the esb call count\n\t\tlogger.info \"reset call count\"\n\t\tcall_hash['call_count'] = 0\n\tend\n\n\t# return changed values\n\treturn call_hash\nend",
"title": ""
},
{
"docid": "819858aac3a75a137e792c1019fdba31",
"score": "0.56761974",
"text": "def check_rate\n if not @intercom.rate_limit_details[:remaining].nil? and @intercom.rate_limit_details[:remaining] < 2\n sleep_time = @intercom.rate_limit_details[:reset_at].to_i - Time.now.to_i\n puts(\"Waiting for #{sleep_time} seconds to allow for rate limit to be reset\")\n sleep sleep_time\n end\n else\n end",
"title": ""
},
{
"docid": "3d4eb86c423010e3aefa8bfaa2ae7630",
"score": "0.56737775",
"text": "def max_reserved_time\n @max_reserved_time_s && ( @max_reserved_time_s * 1000.0 ).round\n end",
"title": ""
},
{
"docid": "c1b6b61b39ce1418b80212494d3076d6",
"score": "0.56721747",
"text": "def wait_time\n if rate_limit_remaining < 50\n [rate_limit_reset - Time.zone.now, 0.001].sort.last\n else\n 3600.0 / rate_limiting\n end\n end",
"title": ""
},
{
"docid": "8d507610e03e042003f4eafb26861de7",
"score": "0.5668002",
"text": "def timeout\n if stop_time.nil?\n nil\n else\n timeout = stop_time - current_time\n timeout < 0 ? 0 : timeout\n end\n end",
"title": ""
},
{
"docid": "38e6ddb41c7c3e42ffe08e89792584c6",
"score": "0.5666611",
"text": "def untilTimeout()\n return Timer.timeRemaining(@name)\n end",
"title": ""
},
{
"docid": "7e410f094b46245928b3651e1afa7c6d",
"score": "0.5666092",
"text": "def timelimit\n 15.minutes\n end",
"title": ""
},
{
"docid": "ba2fa06a0d29fd07bdae117aa52e5a06",
"score": "0.5663346",
"text": "def find_time_asleep\n @total_time_asleep = 0\n @wake_times.each_with_index do |wake_time, index|\n @total_time_asleep += ( wake_time - @sleep_times[index] )\n end\n end",
"title": ""
},
{
"docid": "a19994fd388c6b8a8cf440d9eccfcf39",
"score": "0.5659971",
"text": "def wait_interval\n @timers.first.time - Time.now unless empty?\n end",
"title": ""
},
{
"docid": "fe11e752c3a9684e70c5ade0fb6c898f",
"score": "0.5609438",
"text": "def check_rate\n if not @intercom.rate_limit_details[:remaining].nil? and @intercom.rate_limit_details[:remaining] < 2\n sleep_time = @intercom.rate_limit_details[:reset_at].to_i - Time.now.to_i\n puts(\"Waiting for #{sleep_time} seconds to allow for rate limit to be reset\")\n sleep sleep_time\n end\n end",
"title": ""
},
{
"docid": "9a8eb20c15b9d598c0ed6d14fc93c51b",
"score": "0.55837977",
"text": "def random_poll_interval\n now = Time.now.to_f\n\n interval = calculate_process_based_interval(now)\n\n interval = calculate_safe_enqueue_interval(now, interval) + safe_random_interval\n\n logger.info \"CRON JOB: random_poll_interval: (#{interval})\"\n\n interval\n end",
"title": ""
},
{
"docid": "b9bbc61d4ca69d7295b1c8efd5b6bad0",
"score": "0.55832857",
"text": "def time_until_hungry\n time_since_recent_action = if time_since_last_burrito < time_since_active\n time_since_last_burrito\n else\n time_since_active\n end\n\n x = greedy_time - time_since_recent_action.to_i\n x > 0 ? x : 0\n end",
"title": ""
},
{
"docid": "9232a24e6867f64c9a1ff376419a01cc",
"score": "0.5575033",
"text": "def timeout_after(time); end",
"title": ""
},
{
"docid": "8ccc122403f8acfcd77afaa69f5f3704",
"score": "0.5573522",
"text": "def max_select_wait_time; end",
"title": ""
},
{
"docid": "a76633ccfce3bc4aa2ebf7dfcf23f7ab",
"score": "0.5558147",
"text": "def process(now = Time.now, max_time=nil)\n t = collect { |d| d.process(now) }.compact.min\n t = max_time if max_time && t > max_time\n t\n end",
"title": ""
},
{
"docid": "54be431b6b366d6d84dbda33a383b0cc",
"score": "0.5543398",
"text": "def SetMaxQueryTime(max)\n assert { max.instance_of? Fixnum }\n assert { max >= 0 }\n @maxquerytime = max\n end",
"title": ""
},
{
"docid": "04e65411e66cbcc07e790ef51feaaa89",
"score": "0.5535172",
"text": "def check_idle_servers!\n\t\tmust_not_be_in_synchronize_block\n\t\[email protected] do\n\t\t\t@next_cleaning_time = Time.now - 60 * 60\n\t\t\[email protected]\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b06dacef3dbdbea19586faa9a98c2d84",
"score": "0.55306166",
"text": "def poll_monitors\n (1..MAX_POLL_COUNT).each do |count|\n if @monitors.all? {|monitor| monitor.done?}\n show_complete\n break\n end\n @monitors.each{|monitor| monitor.poll}\n @verbose && print(\"Poll #{count} of #{MAX_POLL_COUNT}: \")\n print @monitors.inject(0) {|sum, monitor| sum + monitor.servers_not_done.length}, ' '\n @verbose && print(\"servers remain\\n\")\n sleep(POLL_SLEEP_SECONDS)\n end\n\n unless @monitors.all? {|monitor| monitor.done?}\n puts \"\\nTIME OUT.\\nSpent #{MAX_POLL_COUNT * POLL_SLEEP_SECONDS} seconds waiting for the deployment\\n\" +\n \"to finish. I can't wait any longer!\"\n show_complete\n end\n end",
"title": ""
},
{
"docid": "c039c2c0c53465c36ef5fa7967adc0ef",
"score": "0.55242085",
"text": "def _timeout_in\n 1.minute\n end",
"title": ""
},
{
"docid": "6a55fa4f34de370c4ce3bf2cd3f610da",
"score": "0.55139637",
"text": "def update_timeout(time_taken)\n @semaphore.synchronize do \n new_avg = (\n ((9 * @avg_timeout) + time_taken) / 10\n )\n Rails.application.config.feedback_timeout =\n new_avg > MIN_THRESHOLD ?\n new_avg :\n MIN_THRESHOLD\n @avg_timeout = new_avg\n end\n end",
"title": ""
},
{
"docid": "3811c8ca715b8412e17c835eab5d5516",
"score": "0.55127436",
"text": "def poll queue=main_queue\n limit = max_limit - busy\n\n # 100% utilization of threads\n if limit == 0\n return Logger.warn \"Waiting for another loop - 100% utilization of workers\"\n end\n\n # Wait over 50% utilization\n if threshold = GuaranteedQueue.config[:utilization_threshold]\n if (busy.to_f / max_limit) > threshold\n return Logger.warn \"Waiting for another loop - past utilization threshold of #{threshold}.\"\n end\n end\n\n begin\n Logger.info \"Receiving up to #{limit} messages on #{queue_name(queue)} (#{busy}/#{limit} threads are busy)\"\n queue.receive_message(:limit => limit) do |message|\n handle message\n end\n rescue SignalException => e\n raise e\n rescue Exception => e\n Logger.error $!\n poll!(restart: true)\n end\n end",
"title": ""
},
{
"docid": "fc01c013af24803cec364aec55b50730",
"score": "0.5502091",
"text": "def max_timeout\n self.device.max_timeout\n end",
"title": ""
},
{
"docid": "399c3109aff2e4e1c89b4f05068371dd",
"score": "0.54991347",
"text": "def measure_intervals(max_time, interval, input_thread)\n Thread.new do\n Thread.current.abort_on_exception = true\n begin\n start = time_now\n total = interval\n\n while @running\n runtime = time_now - start\n delta = max_time - runtime\n\n if delta <= 0.0\n @running = false\n end\n\n if delta.round >= 0 && runtime >= total\n total += interval\n @interval_handler.(delta.round)\n end\n end\n ensure\n input_thread.terminate\n end\n end\n end",
"title": ""
},
{
"docid": "42cd1567918fe716733989e7c8433d65",
"score": "0.54897237",
"text": "def find_recipes_by_time\n list_recipes(Recipe.where('time < ?' , ask('Maximum number of minutes? >:')).order(:title)) # prompt user for max time, query the database and list results\n end",
"title": ""
},
{
"docid": "4dab58cf5589f665b54ad8a84af0f824",
"score": "0.54865694",
"text": "def default_timeout\n 60\n end",
"title": ""
},
{
"docid": "b4a6362d7b98bbdecf31645b77a2bac5",
"score": "0.54795957",
"text": "def time_to_discover?\n if((@request_count%10 == 0) or (Time.now > (@last_polled_time + 10.seconds)))\n @last_polled_time = Time.now\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "7d776ba3d6c0316db57a0f076ff85059",
"score": "0.5473062",
"text": "def confirm_harvest_done(harvester_id, harvester_title, waitmax)\n begin\n puts \"Info: Max wait time to harvest current profile is set to #{waitmax} seconds\"\n Timeout::timeout(waitmax.to_i) do\n harvest_request_is_done(harvester_id.to_s, harvester_title)\n end\n rescue Timeout::Error\n puts \"Warning: Harvest timed out after #{waitmax} seconds, reusing the previous harvest results.\"\n end\n end",
"title": ""
},
{
"docid": "e663055cebbecee35735b233000168a4",
"score": "0.5471086",
"text": "def implicit_wait=(seconds); end",
"title": ""
},
{
"docid": "59396bcac705d257d243915218581d65",
"score": "0.54439",
"text": "def poll_every_n_seconds(send,n=1)\n\t\t\ttimer = Timers::Group.new\n\t\t\tevery_seconds = timer.every(n) { poll(send) }\n\t\t\tloop { timer.wait } \n\t\tend",
"title": ""
},
{
"docid": "3fee9a59819fc90f0ea5fa2e87415b18",
"score": "0.54392064",
"text": "def checkTimeout_Flooding()\n\tsleep(2);\n\tputs \"time out!\";\n\n\nend",
"title": ""
},
{
"docid": "b91217e1e6b46b5a2219fad7749c72e1",
"score": "0.5435509",
"text": "def checkTimeout\n\tt = Time.now\n\tret = t.to_i\n\ttimeoutMsgs = operateMsgPool(CHECK_MESSAGE, ret.to_s)\n\ti = 0\n\twhile (i < timeoutMsgs.length)\n\t cm_cmc_msg = timeoutMsgs.at(i) \n\t cmstr = cm_cmc_msg.marshallMsg\n\t @communicator.sendCommand(CM_PORT, cm_cmc_msg.ipaddr, cmstr)\n\t i = i + 1\n\tend\n end",
"title": ""
},
{
"docid": "ae43c0b39d156d0fa72202d6b86eca52",
"score": "0.5435141",
"text": "def poll_every_n_minutes(send,n=1)\n\t\t\ttimer = Timers::Group.new\n\t\t\tevery_seconds = timer.every(60*n) { poll(send) }\n\t\t\tloop { timer.wait } \n\t\tend",
"title": ""
},
{
"docid": "83fa968a221ce238da353578b289dd9b",
"score": "0.54334587",
"text": "def max_interval\n MAX_INTERVAL\n end",
"title": ""
},
{
"docid": "6e89913744165c1a64f6888f97d2dcb4",
"score": "0.5429924",
"text": "def time_allow(get_time, min_period_time, max_period_time)\n to_time = Time.parse(get_time)\n now_time = Time.now\n return to_time - now_time < max_period_time - min_period_time && to_time - now_time > min_period_time\n end",
"title": ""
},
{
"docid": "96ea3061f02d151baca4210840627d43",
"score": "0.5429147",
"text": "def alive_longer_than(sec)\n filter {|process| process.seconds_alive > sec}\n end",
"title": ""
},
{
"docid": "76eda64b59ea1081aa54b10f57b66e50",
"score": "0.5428435",
"text": "def over_limit?\n count > max_calls\n end",
"title": ""
},
{
"docid": "f1e8ffed3ee9ae0501e639fd26f7f954",
"score": "0.5425009",
"text": "def need_tock?\n if @second == 60\n @second = 0\n tock\n end\n end",
"title": ""
},
{
"docid": "8c43ac5ab3e94ab68a2fb886589536c8",
"score": "0.54137546",
"text": "def consider_timeout\n\n do_schedule_timeout(attribute(:timeout))\n end",
"title": ""
},
{
"docid": "d842b4f67cbf3242eee535fbd8a497ab",
"score": "0.5413012",
"text": "def wait_until_frozen(maxtime=nil)\n start_time = Time.now.to_i\n until frozen?\n sleep 10\n raise \"Could not freeze society\" if maxtime && Time.now.to_i - start_time > maxtime\n end\n return self\n end",
"title": ""
},
{
"docid": "0bed48fc1cefe2e9794d0972d02f1c3c",
"score": "0.54100317",
"text": "def timeout_seconds\n return 1200\n end",
"title": ""
},
{
"docid": "a9b7c4127fb83ca3b1c599dbc725edc6",
"score": "0.5403735",
"text": "def below_limit?\n self.live_count < self::LIMIT\n end",
"title": ""
},
{
"docid": "57c383dcf6ea2e4a748398356de6b3fc",
"score": "0.5398919",
"text": "def timeout_in\n 15.minutes\n end",
"title": ""
},
{
"docid": "a35569d8d7a084105388c648236f2718",
"score": "0.5396102",
"text": "def timeout\n @timeout || Elected.timeout\n end",
"title": ""
},
{
"docid": "abc1df54843de673a5dd3742310551dd",
"score": "0.5380552",
"text": "def default_timeout\n 900\n end",
"title": ""
},
{
"docid": "b84ebd8322759915477d4f14377fd6f8",
"score": "0.5380056",
"text": "def max_silence_timeout_in_seconds\n return @max_silence_timeout_in_seconds\n end",
"title": ""
},
{
"docid": "e94b81d2099927dab9d4713c2e170fe3",
"score": "0.5379022",
"text": "def waitTillLimitReset\n timeTillReset = CLIENT.rate_limit.resets_in + 5\n @logger.info(\"API limit reached while fetching... Sleeping for #{timeTillReset} seconds 😴 brb\")\n sleep(timeTillReset)\nend",
"title": ""
},
{
"docid": "208dcfb5a7f4beafccb605e008595360",
"score": "0.5369705",
"text": "def timeout?(value)\n value.is_a? Pinglish::TooLong\n end",
"title": ""
},
{
"docid": "d404a8f16b99f53a38240c0caa2c8f7b",
"score": "0.5359204",
"text": "def wait_for_TIME_WAIT_to_clear(threshold=20)\n while true\n count = `netstat -a inet -n|grep TIME_WAIT|wc -l`.to_i\n return if count < threshold\n puts \"TIME_WAIT count: #{count}\"\n sleep 1\n end\nend",
"title": ""
},
{
"docid": "876102dd4672721e25732fb5b57fa3f3",
"score": "0.53587866",
"text": "def set_idle_threshold!(time)\n time = time.to_i\n\n if time != 0 && time < 10\n raise ArgumentError, \"time must be >= 10 minutes\"\n end\n\n if time % 5 != 0\n raise ArgumentError, \"time must be in 5 minute increments\"\n end\n\n !!self.send!(\"+XT:3013,#{time}\")\n end",
"title": ""
},
{
"docid": "bd3ec7db156e2a48cb757c3efe176fa0",
"score": "0.5357577",
"text": "def timeout_at; end",
"title": ""
},
{
"docid": "8522670768a6941b08e234369af97158",
"score": "0.53573924",
"text": "def limit_reached?\n @count >= @max\n end",
"title": ""
},
{
"docid": "9cd6bfc101e49c6ee2d66867a828cea5",
"score": "0.53486145",
"text": "def time_tolerance_seconds\n 600\n end",
"title": ""
},
{
"docid": "7045312b737d4f01ae2a747f6f5fbec0",
"score": "0.53474486",
"text": "def wait_for(&block)\n Retriable.retriable tries: 15, base_interval: 0.05, max_interval: 1.second do\n raise \"Exceeded max retries while waiting for block to pass\" unless block.call\n end\n end",
"title": ""
},
{
"docid": "c05e2bb780863e0ea305d3d6ee00febb",
"score": "0.5341585",
"text": "def worker_check_interval(interval); end",
"title": ""
},
{
"docid": "9c7ebfc45da14a60b08b7f23d8eb8f2c",
"score": "0.5333384",
"text": "def playtime_forever\r\n\t raw_app['playtime_forever']\r\n\t end",
"title": ""
},
{
"docid": "fda98ae8261b75f6dd589280eb84f55a",
"score": "0.5332619",
"text": "def max=(max)\n diff = nil\n @mutex.synchronize {\n if max <= @max\n @max = max\n else\n diff = max - @max\n @max = max\n end\n }\n if diff\n diff.times do\n\tbegin\n\t t = @queue_wait.shift\n\t t.run if t\n\trescue ThreadError\n\t retry\n\tend\n end\n end\n max\n end",
"title": ""
},
{
"docid": "fda98ae8261b75f6dd589280eb84f55a",
"score": "0.5332619",
"text": "def max=(max)\n diff = nil\n @mutex.synchronize {\n if max <= @max\n @max = max\n else\n diff = max - @max\n @max = max\n end\n }\n if diff\n diff.times do\n\tbegin\n\t t = @queue_wait.shift\n\t t.run if t\n\trescue ThreadError\n\t retry\n\tend\n end\n end\n max\n end",
"title": ""
},
{
"docid": "261cde8a3ccacbf8373f4e8bc9418785",
"score": "0.53231525",
"text": "def poll_interval\n interval_level = poll_attempts[:total]/attempts_before_next_interval\n poll_intervals[interval_level] || poll_intervals.last\n end",
"title": ""
},
{
"docid": "9662bcaf22c08d0fe73d13897521a84c",
"score": "0.53213894",
"text": "def req_limit_check block=nil\n\t\t\tif @reqs[:cnt] >= @req_limit && Time.now <= @reqs[:next_check]\n\t\t\t # limit reached, execute the optional block and sleep until next_check\n\t\t\t\tsecs = (@reqs[:next_check] - Time.now + 1).to_i\n\t\t\t\tlog? && GLogg.log_d2? && GLogg.log_d2(sprintf( #_\n\t\t\t\t\t\t'Curburger::Request#req_limit_check: Request limit ' + #_\n\t\t\t\t\t\t\"(%u per %usecs) reached.\\n Sleeping %u seconds.\", #_\n\t\t\t\t\t\t@req_limit, @req_time_range, secs)) #_\n\t\t\t\tif block\n\t\t\t\t\tblock.call\n\t\t\t\t\tsecs = (@reqs[:next_check] - Time.now + 1).to_i # recompute\n\t\t\t\t\tlog? && GLogg.log_d3? && GLogg.log_d3(sprintf( #_\n\t\t\t\t\t\t\t'Curburger::Request#req_limit_check: ' + #_\n\t\t\t\t\t\t\t'Block executed, sleeping %usecs.', secs > 0 ? secs : 0)) #_\n\t\t\t\tend\n\t\t\t\tsleep secs if secs > 0\n\t\t\tend\n\t\t\tif Time.now > @reqs[:next_check] # reset the counter\n\t\t\t\tlog? && GLogg.log_d3? && GLogg.log_d3(sprintf( #_\n\t\t\t\t\t\t'Curburger::Request#req_limit_check: Resetting counter ' + #_\n\t\t\t\t\t\t'(%u/%u requests done).', @reqs[:cnt], @req_limit)) #_\n\t\t\t\t@reqs[:cnt], @reqs[:next_check] = 0, Time.now + @req_time_range\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "9543f7557e3296c313bafa5b7b68642c",
"score": "0.53162795",
"text": "def default_timeout\n 3\n end",
"title": ""
},
{
"docid": "98b4822f491f033a2b5afb3f3a9e3739",
"score": "0.530525",
"text": "def idle_timeout; end",
"title": ""
},
{
"docid": "98b4822f491f033a2b5afb3f3a9e3739",
"score": "0.530525",
"text": "def idle_timeout; end",
"title": ""
},
{
"docid": "4469bef1444b33cf486a49356d6c9e16",
"score": "0.5301128",
"text": "def idle_time_limit\n super\n end",
"title": ""
},
{
"docid": "04c6c061eaeebdec08c5adfc2fbea701",
"score": "0.5294539",
"text": "def idle_timeout=(timeout); end",
"title": ""
}
] |
1cfb03ec7d8ad65618e5587bf96b58a5
|
List Tier1 interfaces Paginated list of all Tier1 interfaces
|
[
{
"docid": "c0da1878f65b0e010e39b19a915698d3",
"score": "0.6136207",
"text": "def list_tier1_interfaces_0_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\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 => 'Tier1InterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_interfaces_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "32dba696c767faf2adced96fda66f1b3",
"score": "0.62104803",
"text": "def list_tier1_interfaces_with_http_info(tier_1_id, locale_services_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_interfaces, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\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 => 'Tier1InterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_interfaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "6ce2dace6c29147982f4065fdc0b584b",
"score": "0.6029723",
"text": "def interfaces_list\n\t\t[\n\t\t\t{\n\t\t\t\t'uri' => '/',\n\t\t\t\t'method' => 'GET',\n\t\t\t\t'purpose' => 'REST API Structure and Capability Discovery'\n\t\t\t}\n\t\t]\n\tend",
"title": ""
},
{
"docid": "993edb26820cb252973968525c47fc54",
"score": "0.587024",
"text": "def list_tier1_service_interfaces_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\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 => 'ServiceInterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_service_interfaces\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "0ff9461816314d1415733d48c74e6e6f",
"score": "0.58110344",
"text": "def list_tier1_service_interfaces_0_with_http_info(tier_1_id, locale_service_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.list_tier1_service_interfaces_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\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 => 'ServiceInterfaceListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#list_tier1_service_interfaces_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b58046d241fac17a14ee26aca328ad7b",
"score": "0.57743907",
"text": "def index\n @interfaces = Interface.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @interfaces }\n end\n end",
"title": ""
},
{
"docid": "8712a8da39b4598871017781fe54592d",
"score": "0.5764845",
"text": "def list_tier1_interfaces(tier_1_id, locale_services_id, opts = {})\n data, _status_code, _headers = list_tier1_interfaces_with_http_info(tier_1_id, locale_services_id, opts)\n data\n end",
"title": ""
},
{
"docid": "18ce3674f5b9abfac1cf1f21c6911fce",
"score": "0.5634723",
"text": "def sorted_interfaces\n process if @interfaces.nil?\n\n sorter.sort.map { |name|\n @interfaces.find { |i| i.name == name } or puts \"ignoring interface: #{name}\"\n }.compact\n end",
"title": ""
},
{
"docid": "1e0d99632c56d8bc8336d1ead75175d2",
"score": "0.5620128",
"text": "def interfaces()\n ifaces = []\n request = Packet.create_request(COMMAND_ID_SNIFFER_INTERFACES)\n response = client.send_request(request)\n response.each(TLV_TYPE_SNIFFER_INTERFACES) { |p|\n vals = p.tlvs.map{|x| x.value }\n iface = { }\n if vals.length == 8\n # Windows\n ikeys = %W{idx name description type mtu wireless usable dhcp}\n else\n # Mettle\n ikeys = %W{idx name description usable}\n end\n ikeys.each_index { |i| iface[ikeys[i]] = vals[i] }\n ifaces << iface\n }\n return ifaces\n end",
"title": ""
},
{
"docid": "4d3c0b37ae58e88a18ab0b0c262bdaeb",
"score": "0.5585583",
"text": "def quadport_member_interfaces(interfaces)\n Array(interfaces).map do |interface|\n next unless parsed = parse_interface(interface)\n\n if parsed[:type] == \"Fo\"\n (Integer(parsed[:interface])..(Integer(parsed[:interface]) + 3)).map do |int|\n \"Te %s/%s\" % [parsed[:unit], int]\n end\n else\n interface\n end\n end.flatten.compact.uniq.sort\n end",
"title": ""
},
{
"docid": "079f5b91a8c3210aa24d7f4e6922888b",
"score": "0.5493065",
"text": "def list_tier1_interfaces_0(tier_1_id, locale_services_id, opts = {})\n data, _status_code, _headers = list_tier1_interfaces_0_with_http_info(tier_1_id, locale_services_id, opts)\n data\n end",
"title": ""
},
{
"docid": "7bfab4d2d555ee0f5b4dfa3efdd0e0e5",
"score": "0.546031",
"text": "def interfaces\n @interfaces ||= Interface.coercer(attributes[:interfaces])\n end",
"title": ""
},
{
"docid": "96b34c2192444f83d15a0c79f066628b",
"score": "0.54294336",
"text": "def interfaces\n InterfaceCollection.open\n end",
"title": ""
},
{
"docid": "746348db1293834e2b028482f7b257a7",
"score": "0.5420404",
"text": "def show\n @itens = @genero.itens.group(\"itens.id\").paginate(page: params[:page], :per_page => 30)\n end",
"title": ""
},
{
"docid": "a945b25d885ddda2ccedf8c302321970",
"score": "0.5402614",
"text": "def index\n @registry_therapy_types = Registry::TherapyType.paginate(:page => params[:page])\n end",
"title": ""
},
{
"docid": "11d3c516dcf5c7731a39ec17f9ff3106",
"score": "0.5397386",
"text": "def nonquadport_member_interfaces(interfaces)\n Array(interfaces).map do |interface|\n next unless parsed = parse_interface(interface)\n\n if parsed[:type] == \"Fo\" && switch.facts[\"quad_port_interfaces\"].include?(parsed[:interface])\n quadport_member_interfaces(interface)\n else\n interface\n end\n end.flatten.compact.uniq.sort\n end",
"title": ""
},
{
"docid": "6f0ccbf11709eb625437a0b3713e9d39",
"score": "0.5370689",
"text": "def get_adapter_ext_eth_interface_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdapterApi.get_adapter_ext_eth_interface_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/adapter/ExtEthInterfaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'AdapterExtEthInterfaceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"AdapterApi.get_adapter_ext_eth_interface_list\",\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: AdapterApi#get_adapter_ext_eth_interface_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1c5c2985d76d72e24c44a2eb5ac3f807",
"score": "0.5365228",
"text": "def index\n # Load also other informaion in order to be able to display info in the list (and not only id) \n # puts \"In index...\" \n @totalinterventions = Intervention.all.count\n @filteredinterventions = apply_scopes(Intervention.includes(:device, :intervention_type, :user, :intervention_state))\n @pagy, @interventions = pagy(@filteredinterventions,items:15)\n end",
"title": ""
},
{
"docid": "3df029c2f91904ea1176234b7b2bcf3a",
"score": "0.53324497",
"text": "def extract_interfaces(document)\n document.xpath(\"interface\").map do |interface|\n InterfaceSpecification.parse(interface, name)\n end\n end",
"title": ""
},
{
"docid": "74cfed5744758b2c8a9070def1eef3f4",
"score": "0.5282621",
"text": "def get_tier1_interface_statistics(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = get_tier1_interface_statistics_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end",
"title": ""
},
{
"docid": "06d98527a8cec48c5e6159e0626f0f11",
"score": "0.52812797",
"text": "def list_tier1_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\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 => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "6b103d645e52547f27fdd70acf6fbe1a",
"score": "0.52666056",
"text": "def index\n @interessados = Interessado.all\n @interessados = Interessado.paginate(:page => params[:page], :per_page => 20)\n end",
"title": ""
},
{
"docid": "37e183d58f5a82f9c309b7e1eb269c8e",
"score": "0.525947",
"text": "def interfaces_list\n [\n {\n 'uri' => '/catalogues',\n 'method' => 'GET',\n 'purpose' => 'REST API Structure and Capability Discovery'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'GET',\n 'purpose' => 'List all NSs or specific NS',\n 'special' => 'Use version=last to retrieve NSs last version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'POST',\n 'purpose' => 'Store a new NS'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored NS by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update NSD status'\n },\n {\n 'uri' => '/catalogues/network-services',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/network-services/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific NS by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'GET',\n 'purpose' => 'List all VNFs or specific VNF',\n 'special' => 'Use version=last to retrieve VNFs last version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'POST',\n 'purpose' => 'Store a new VNF'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored VNF by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update VNFD status'\n },\n {\n 'uri' => '/catalogues/vnfs',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/vnfs/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific VNF by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'GET',\n 'purpose' => 'List all Packages or specific Package',\n 'special' => 'Use version=last to retrieve Packages last version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new Package'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'PUT',\n 'purpose' => 'Update a stored Package by its uuid',\n 'special' => 'Use status=[inactive, active, delete] to update PD status'\n },\n {\n 'uri' => '/catalogues/packages',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package specified by vendor, name, version'\n },\n {\n 'uri' => '/catalogues/packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Delete a specific Package by its uuid'\n },\n {\n 'uri' => '/catalogues/packages/{id}/status',\n 'method' => 'PUT',\n 'purpose' => 'Updates the status of a Package {\"status\": \"active\" / \"inactive\"} as valid json payloads'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'GET',\n 'purpose' => 'List all son-packages or specific son-package'\n },\n {\n 'uri' => '/catalogues/son-packages',\n 'method' => 'POST',\n 'purpose' => 'Store a new son-package'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'GET',\n 'purpose' => 'List a specific son-package by its uuid'\n },\n {\n 'uri' => '/catalogues/son-packages/{id}',\n 'method' => 'DELETE',\n 'purpose' => 'Remove a son-package'\n }\n ]\n end",
"title": ""
},
{
"docid": "39997c9f954af6678a3aa5eb2e34f88e",
"score": "0.52572775",
"text": "def read_tier1_interface(tier_1_id, locale_services_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts)\n data\n end",
"title": ""
},
{
"docid": "48bdfca1dac11fdb8071f3cf310b207b",
"score": "0.52141774",
"text": "def list_tier1_0_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0 ...'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi.list_tier1_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s'\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\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 => 'Tier1ListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysTier1GatewaysApi#list_tier1_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ff30fc8b2fc6ece15640673e05dc5482",
"score": "0.5209988",
"text": "def list_tier1(opts = {})\n data, _status_code, _headers = list_tier1_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "d7fde76ad6ced13fc737deee6c87a096",
"score": "0.5204993",
"text": "def read_network_interfaces\n end",
"title": ""
},
{
"docid": "b01438f3fe411c574eaeb5bdad8e9429",
"score": "0.52022177",
"text": "def get_adapter_host_eth_interface_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdapterApi.get_adapter_host_eth_interface_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/adapter/HostEthInterfaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'AdapterHostEthInterfaceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"AdapterApi.get_adapter_host_eth_interface_list\",\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: AdapterApi#get_adapter_host_eth_interface_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4acde35da458b274438db1970cd33885",
"score": "0.51539737",
"text": "def get_interfaces(data)\n\n interfaces = Array.new\n @interface = Interface.new\n\n data.each{|value|\n values = get_values(value)\n\n if values.nil?\n next\n end\n\n # New interface\n unless values.nil? || values.interface.eql?(\"\")\n\n unless @interface.empty?\n interfaces << @interface\n end\n\n @interface = Interface.new\n\n 2.times {\n puts \"\"\n }\n puts \"-----------------------\"\n\n @interface.name = values.interface.gsub(/[^a-zA-Z0-9]/,'')\n\n puts \"Interface: #{@interface.name}\"\n\n # In the same line of new Interface, probably a method is defined\n unless values.method.eql?(\"\")\n @method = MethodDef.new\n @method.name = values.method\n @method.output = values.output\n @method.description = values.description\n puts \" Method: #{@method.name} -> #{@method.description} : #{@method.output}\"\n end\n\n unless values.parameter.nil? || values.parameter.eql?(\"\")\n puts \" Parameter: #{values.parameter}\"\n @method.add_parameter values.parameter\n end\n else # Same interface\n # New method\n unless values.method.eql?(\"\")\n @interface.add_method(@method)\n @method = MethodDef.new\n @method.name = values.method\n @method.output = values.output\n @method.description = values.description\n puts \" Method: #{@method.name} -> #{@method.description} : #{@method.output}\"\n end\n # Get parameter for current method\n unless values.parameter.nil? || values.parameter.eql?(\"\")\n puts \" Parameter: #{values.parameter}\"\n @method.add_parameter values.parameter\n end\n end\n }\n @interface << @method\n interfaces << @interface\n interfaces\n end",
"title": ""
},
{
"docid": "d81eada2d387e14d89f030d2d0ac6721",
"score": "0.51529515",
"text": "def read_tier1_interface_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_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 => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "894af7f9bbd8e6a0415eaf7978e9b102",
"score": "0.51333106",
"text": "def read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'locale_services_id' is set\n if @api_client.config.client_side_validation && locale_services_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_services_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-services-id}/interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-services-id' + '}', locale_services_id.to_s).sub('{' + 'interface-id' + '}', interface_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 => 'Tier1Interface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "43c27cfbe4e78c5ebfd93fca8f3f8075",
"score": "0.5121907",
"text": "def ingress_interface\n list = config_get('itd_service', 'ingress_interface', @get_args)\n rlist = []\n list.each do |intf, next_hop|\n intf.gsub!('Eth', 'ethernet ')\n intf.gsub!('Po', 'port-channel ')\n intf.gsub!('Vlan', 'vlan ')\n next_hop = '' if next_hop.nil?\n rlist << [intf, next_hop]\n end\n rlist\n end",
"title": ""
},
{
"docid": "971f6a470a9037e33e907695031c692c",
"score": "0.5110201",
"text": "def included_interfaces; end",
"title": ""
},
{
"docid": "73871b855ed71396a7781bd9da710998",
"score": "0.5109114",
"text": "def index\n @intermediaries = Intermediary.page(params[:page])\n end",
"title": ""
},
{
"docid": "c7a9ff59faa4d9ca6706bdf3891731ab",
"score": "0.5095941",
"text": "def list_tier1_service_interfaces(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_service_interfaces_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end",
"title": ""
},
{
"docid": "b8d64420b72f115068fafbd62a988fb0",
"score": "0.5095914",
"text": "def itineraries\n if object.next_trip \n (object.itineraries + object.next_trip.itineraries).map{ |x| ItinerarySerializer.new(x) }\n else \n (object.itineraries).map{ |x| ItinerarySerializer.new(x) }\n end\n end",
"title": ""
},
{
"docid": "9cf2e083a3d42a67e157104034b31a9e",
"score": "0.5080341",
"text": "def read_tier1_interface_0(tier_1_id, locale_services_id, interface_id, opts = {})\n data, _status_code, _headers = read_tier1_interface_0_with_http_info(tier_1_id, locale_services_id, interface_id, opts)\n data\n end",
"title": ""
},
{
"docid": "24c7bca35e5d90cc6852c9cd5b3464bb",
"score": "0.5077738",
"text": "def get_tier1_interface_statistics_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/interfaces/{interface-id}/statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_tier1_interface_statistics\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "d7e1485c820375f5bb3cc51c53aafd6c",
"score": "0.5066507",
"text": "def each_interface(&block)\n\t\tget_interfaces().each(&block)\n\tend",
"title": ""
},
{
"docid": "067dec111a5311a92074fade009da9cc",
"score": "0.5066377",
"text": "def provide_navigation_by_all_headings\n # Interface method\n end",
"title": ""
},
{
"docid": "5701e3f043c72fb75b84f48ab95c3545",
"score": "0.5059181",
"text": "def get_interfaces\n @list = %x(/usr/sbin/networksetup -listallnetworkservices).split(\"\\n\").drop(1)\n end",
"title": ""
},
{
"docid": "64ecdb4ef7f7009b324442a57d269a3c",
"score": "0.50305164",
"text": "def list_scans\n Item.scoped.each {|i|\n puts i.name\n i.scans.each {|x| puts \"\\t#{x}\"}\n puts \"\"\n }\n end",
"title": ""
},
{
"docid": "64ecdb4ef7f7009b324442a57d269a3c",
"score": "0.50305164",
"text": "def list_scans\n Item.scoped.each {|i|\n puts i.name\n i.scans.each {|x| puts \"\\t#{x}\"}\n puts \"\"\n }\n end",
"title": ""
},
{
"docid": "e44a85e4e61fd5d9fb60605de4bb66de",
"score": "0.50262356",
"text": "def index\n @infractors = Infractor.all\n end",
"title": ""
},
{
"docid": "23d7fd26a2c6290783cbf6281e60fd54",
"score": "0.50189126",
"text": "def interfaces\n Vedeu::Interfaces.registered\n end",
"title": ""
},
{
"docid": "83726817a71f57063bc5a3508f5e0699",
"score": "0.5017998",
"text": "def index\n @iniciadores = Iniciador.paginate(page: params[:page], per_page:10).all.order(:razon_social)\n end",
"title": ""
},
{
"docid": "ffcec2b0e7118e1c1c07c8014b913166",
"score": "0.5009475",
"text": "def pager_items\n pager_container.as\n end",
"title": ""
},
{
"docid": "e29db1ebbfe226593c735ab6baa6d9fe",
"score": "0.5007629",
"text": "def list_tier1_service_interfaces_0(tier_1_id, locale_service_id, opts = {})\n data, _status_code, _headers = list_tier1_service_interfaces_0_with_http_info(tier_1_id, locale_service_id, opts)\n data\n end",
"title": ""
},
{
"docid": "de71a0a36c0a39df7ab29ee55ef6838e",
"score": "0.4996228",
"text": "def index\n @airports = paginate_model Airport.order(:code)\n end",
"title": ""
},
{
"docid": "a98ffc2a250b4b25346b7b6fc3984d15",
"score": "0.49940145",
"text": "def index\n @travel = Travel.find(params[:travel_id])\n @itineraries = Itinerary.order(\"updated_at DESC\").page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @itineraries }\n end\n end",
"title": ""
},
{
"docid": "333351bb83c7783746cc5fdb635a54dc",
"score": "0.49794862",
"text": "def index\n @ipranedge_interfaces = IpranedgeInterface.where(IpranedgeInterface.arel_table[:created_at].gt(IpranedgeInterface.maximum(:created_at).to_date)).order(\"status DESC\").paginate(:page => params[:page], :per_page => 200)\n @ipranedge_interfaces_all = IpranedgeInterface.all\n\n respond_to do |format|\n format.html\n format.xls\n format.pdf do\n render :pdf => \"Reporte Interfaces de IPRAN Edge - \" + IpranedgeInterface.last.created_at.strftime(\"%d/%m/%Y %H:%M:%S\"),\n :layout => 'pdf.html',\n :margin => {:top => 10, :bottom => 10, :left => 10, :right => 10},\n :orientation => 'landscape', # default , Landscape,\n :background => true,\n :encoding => \"UTF-8\", :type=>\"application/pdf\",\n :javascript_delay => 10000,\n #:disposition => \"attachment\",\n :viewport_size => \"1280x1024\",\n :page_size => \"A4\",\n :footer => { :right => 'Page [page] of [topage]',:font_size => 7 }\n end\n end\n end",
"title": ""
},
{
"docid": "60507762e816df4940d66f8d48bf0616",
"score": "0.49612457",
"text": "def index\n @relatorios = Relatorio.all.page(params[:page]).per(15)\n end",
"title": ""
},
{
"docid": "d473604328feb0a0c012937b23e9e359",
"score": "0.49568576",
"text": "def index\n @cachenetflix_interfaces = CachenetflixInterface.where(CachenetflixInterface.arel_table[:created_at]\n .gt(CachenetflixInterface.maximum(:created_at).to_date))\n .order(\"status DESC\")\n end",
"title": ""
},
{
"docid": "ff034a2bffe01b2216af628f5fdf758c",
"score": "0.49498895",
"text": "def get_interfaces\n\t\trequest = Packet.create_request('stdapi_net_config_get_interfaces')\n\t\tifaces = []\n\n\t\tresponse = client.send_request(request)\n\n\t\tresponse.each(TLV_TYPE_NETWORK_INTERFACE) { |iface|\n\t\t\tifaces << Interface.new(\n\t\t\t\t\tiface.get_tlv_value(TLV_TYPE_IP),\n\t\t\t\t\tiface.get_tlv_value(TLV_TYPE_NETMASK),\n\t\t\t\t\tiface.get_tlv_value(TLV_TYPE_MAC_ADDRESS),\n\t\t\t\t\tiface.get_tlv_value(TLV_TYPE_MAC_NAME))\n\t\t}\n\n\t\treturn ifaces\n\tend",
"title": ""
},
{
"docid": "efe31f8a2e6a886ce91bdd01553b777e",
"score": "0.4947531",
"text": "def get_tier1_interface_statistics_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics_0\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics_0, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi.get_tier1_interface_statistics_0, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/interfaces/{interface-id}/statistics'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'edge_path'] = opts[:'edge_path'] if !opts[:'edge_path'].nil?\n query_params[:'enforcement_point_path'] = opts[:'enforcement_point_path'] if !opts[:'enforcement_point_path'].nil?\n query_params[:'include_mark_for_delete_objects'] = opts[:'include_mark_for_delete_objects'] if !opts[:'include_mark_for_delete_objects'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\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 => 'PolicyInterfaceStatistics')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesStatisticsApi#get_tier1_interface_statistics_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5c65ad0587c8db42fe1ae9261493050b",
"score": "0.49445003",
"text": "def index\n @scan_protocols = current_account.scan_protocols.all\n end",
"title": ""
},
{
"docid": "fa481a96de6c82588043335c2b076890",
"score": "0.49425998",
"text": "def index\n @forklifts = ForkliftService.search(nil).order(created_at: :desc).paginate(:page=>params[:page])#all\n #@forklifts = @forklifts.paginate(:page=>params[:page])\n end",
"title": ""
},
{
"docid": "1ccc97835bfcfbe374df6ba20e4ac0da",
"score": "0.49345767",
"text": "def getInterfaces()\n # this actually resolves to the output of ifconfig, which we can then\n # scan for connections\n ifconfigOut = `ifconfig`\n\n @interfaces = Array.new\n\n arr = ifconfigOut.scan(/inet addr:([0-9]+.[0-9]+.[0-9]+.[0-9]+)/)\n arr.each { |ip| \n newIp = ip[0]\n if newIp !~ /127.0.0.1/\n @interfaces.push(newIp)\n end\n }\n end",
"title": ""
},
{
"docid": "9bc2e46fd476cf485416ec70bd98b134",
"score": "0.49305797",
"text": "def get_tier1_interface_statistics_0(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = get_tier1_interface_statistics_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end",
"title": ""
},
{
"docid": "d9b211aa4ea78f5b6ac8d25a6bd75674",
"score": "0.4929694",
"text": "def index\n @instalers = Instaler.all\n end",
"title": ""
},
{
"docid": "744590103d729c6df3624da3880794c9",
"score": "0.49262822",
"text": "def index\n @itineraires = Itineraire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @itineraires }\n end\n end",
"title": ""
},
{
"docid": "2d7df50cfc7c1946ac392139482f4ea6",
"score": "0.492459",
"text": "def get_virtualization_vmware_virtual_network_interface_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VirtualizationApi.get_virtualization_vmware_virtual_network_interface_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/virtualization/VmwareVirtualNetworkInterfaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'VirtualizationVmwareVirtualNetworkInterfaceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"VirtualizationApi.get_virtualization_vmware_virtual_network_interface_list\",\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: VirtualizationApi#get_virtualization_vmware_virtual_network_interface_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "e69cde32bd29da2e0cd07e4314c0fdd6",
"score": "0.49233377",
"text": "def each_packet_with_interface\n sections.each do |section|\n section.interfaces.each do |itf|\n itf.packets.each { |xpb| yield xpb, itf }\n end\n end\n end",
"title": ""
},
{
"docid": "dc944a55ea2b6f14082d7af6e6b4ead9",
"score": "0.49206161",
"text": "def extract_itineraries\n return [] unless @response && @response[:plan] && @response[:plan][:itineraries]\n @response[:plan][:itineraries].map {|i| OTPItinerary.new(i)}\n end",
"title": ""
},
{
"docid": "e3722b66aef8edb69448c9e3cd598863",
"score": "0.49205863",
"text": "def index\n @equipment_implements = EquipmentImplement.all\n end",
"title": ""
},
{
"docid": "a22b4e885ade2bfeedec1f2ef8291967",
"score": "0.4912868",
"text": "def index\n @iscrivitis = Iscriviti.all\n end",
"title": ""
},
{
"docid": "90b9ece6fbbe4b6708a58d1cf254d332",
"score": "0.4912198",
"text": "def enumerator\n Enumerator.new do |yielder|\n response = get_initial_response\n\n loop do\n items = response.records\n\n # If there are no records, we're done\n break if items.empty?\n\n # Otherwise, iterate through the records...\n items.each { |item| yielder << item }\n\n # ...and fetch the next page\n @params ||= {}\n @params[:page] ||= 1\n @params[:page] += 1\n\n response = @service.list(**@params)\n end\n end.lazy\n end",
"title": ""
},
{
"docid": "addb233a646bbf15fa0eb36d02ce8281",
"score": "0.49034905",
"text": "def get_adapter_host_iscsi_interface_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdapterApi.get_adapter_host_iscsi_interface_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/adapter/HostIscsiInterfaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'AdapterHostIscsiInterfaceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"AdapterApi.get_adapter_host_iscsi_interface_list\",\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: AdapterApi#get_adapter_host_iscsi_interface_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "8e9d3d90f2cc5556ec7183eb258cf635",
"score": "0.4896534",
"text": "def provide_navigation_by_all_skippers\n # Interface method\n end",
"title": ""
},
{
"docid": "2ae5c6126437f0dddfb8b0c0624cdf6e",
"score": "0.4895362",
"text": "def index\n @instarters = Instarter.all\n end",
"title": ""
},
{
"docid": "b6f2a10edc8b2ba35ea77af1f9414e56",
"score": "0.48941278",
"text": "def index\n @iphs = Iph.paginate(:page => params[:page], :per_page => 10).order('created_at desc')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @iphs }\n end\n end",
"title": ""
},
{
"docid": "73ef0d5a1ce11868f173c3d5a37d5efb",
"score": "0.48863435",
"text": "def index\n @iceriks = Icerik.all\n end",
"title": ""
},
{
"docid": "da209aa1573cc8dda7aa41aac3b8059d",
"score": "0.4883803",
"text": "def index\n @cabinet_infrastructure_types = InfrastructureType.all\n end",
"title": ""
},
{
"docid": "061c10cac80139f3aae729ba44b6cc72",
"score": "0.48836058",
"text": "def index\n @descriptor_genericos = DescriptorGenerico.paginate(:per_page => 20, :page =>params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @descriptor_genericos }\n end\n end",
"title": ""
},
{
"docid": "1f37d008060f15277c0340fe586347a5",
"score": "0.48804417",
"text": "def network_interfaces\n sans = san_network_ports\n n = clusters.map{|x| x.vlan}.sort\n if has_mgmt? then\n n << 4000\n end\n app = n.map{|x| \"vlan#{x}\"}\n app.concat(sans)\n end",
"title": ""
},
{
"docid": "e20d1e984d15cf4a3324734c6bbbe6e4",
"score": "0.4880383",
"text": "def index\n @infrastructures = Infrastructure.all\n end",
"title": ""
},
{
"docid": "1223dedb424fc572c9c05051fa8edfe4",
"score": "0.4875874",
"text": "def index\n @tender_methods = TenderMethod.scopied.page(params[:page]).per(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tender_methods }\n end\n end",
"title": ""
},
{
"docid": "4d320b391d912338c466000ed002295f",
"score": "0.48687494",
"text": "def get_virtualization_vmware_physical_network_interface_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VirtualizationApi.get_virtualization_vmware_physical_network_interface_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/virtualization/VmwarePhysicalNetworkInterfaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'VirtualizationVmwarePhysicalNetworkInterfaceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"VirtualizationApi.get_virtualization_vmware_physical_network_interface_list\",\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: VirtualizationApi#get_virtualization_vmware_physical_network_interface_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "8cd7fbb2fa6faf09cb20c10fe00d442d",
"score": "0.48562858",
"text": "def all_invoices\n @gateway.get_invoices.invoices\n end",
"title": ""
},
{
"docid": "dcb84092b212dc5e858fbdee6cdd5cf1",
"score": "0.48528746",
"text": "def index\n @admin_itineraries= City.find(session[:current_city_id]).discover.itineraries.page(params[:page]).per(10)\n end",
"title": ""
},
{
"docid": "4d1ce802997ca85cde661cdcb3c9fc06",
"score": "0.48470947",
"text": "def index\n @isbns = Isbn.all.includes(:book).page params[:page]\n end",
"title": ""
},
{
"docid": "45f255b6c123d9b308e0cc8de1cdf27d",
"score": "0.48468423",
"text": "def index\n @itineraries = Itinerary.all\n end",
"title": ""
},
{
"docid": "45f255b6c123d9b308e0cc8de1cdf27d",
"score": "0.48468423",
"text": "def index\n @itineraries = Itinerary.all\n end",
"title": ""
},
{
"docid": "7e632d9ab0f0f435599bf073af6b975b",
"score": "0.4844981",
"text": "def extended_interfaces; end",
"title": ""
},
{
"docid": "80e4a3eebf7148bf842e405d0493f142",
"score": "0.48386365",
"text": "def getInterfaces profile_name\n interfaces=[]\n eval(\"TCD::Profiles::#{profile_name.to_s}\").rolloverDay.each_key {|k| interfaces << k.to_sym }\n interfaces\n end",
"title": ""
},
{
"docid": "daf41606245d06452ad905c35a6bc688",
"score": "0.4838554",
"text": "def read_tier1_service_interface_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0 ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface_0\"\n end\n # resource path\n local_var_path = '/global-infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_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 => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface_0\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7e69434cd2ef62a7dd1ebdd32eee877d",
"score": "0.4837454",
"text": "def index\n @item_tiers = ItemTier.all\n end",
"title": ""
},
{
"docid": "0893c5361c652d8e238ca12f4e328d3f",
"score": "0.4835739",
"text": "def one_nics_get\n one_item.info if one_item.instance_of?(OpenNebula::VirtualMachine)\n one_item.retrieve_xmlelements('TEMPLATE/NIC')\n end",
"title": ""
},
{
"docid": "3a7513ba65e890e5c9531b00cfd1795e",
"score": "0.4831061",
"text": "def index\n @iines = Iine.all\n end",
"title": ""
},
{
"docid": "ee7a121ce398212886ee677d5f832fe0",
"score": "0.48307523",
"text": "def interfaces(direction, collections)\n mode = case direction\n when :input then true\n when :output then false\n else\n raise Bud::CompileError, \"unrecognized interface type #{direction}\"\n end\n collections.each do |tab|\n t_provides << [tab.to_s, mode]\n end \n end",
"title": ""
},
{
"docid": "b0bb5b9c02e7e9ecfc3c084b914fef4e",
"score": "0.48281717",
"text": "def index \n hq_vlans = HqVlan.all(:order => :name)\n @objects = hq_vlans.paginate :page => params[:page], :per_page => 20\n respond_to do |format|\n format.html { render :template => 'reflected/index' }\n format.xml { render :xml => @objects }\n end\n end",
"title": ""
},
{
"docid": "943e99d26869292045022533e7d6f0fb",
"score": "0.48218286",
"text": "def get_adapter_host_fc_interface_list_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AdapterApi.get_adapter_host_fc_interface_list ...'\n end\n allowable_values = [\"allpages\", \"none\"]\n if @api_client.config.client_side_validation && opts[:'inlinecount'] && !allowable_values.include?(opts[:'inlinecount'])\n fail ArgumentError, \"invalid value for \\\"inlinecount\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/api/v1/adapter/HostFcInterfaces'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n query_params[:'$select'] = opts[:'select'] if !opts[:'select'].nil?\n query_params[:'$expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n query_params[:'$apply'] = opts[:'apply'] if !opts[:'apply'].nil?\n query_params[:'$count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'$inlinecount'] = opts[:'inlinecount'] if !opts[:'inlinecount'].nil?\n query_params[:'at'] = opts[:'at'] if !opts[:'at'].nil?\n query_params[:'tags'] = opts[:'tags'] if !opts[:'tags'].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/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'AdapterHostFcInterfaceResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"AdapterApi.get_adapter_host_fc_interface_list\",\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: AdapterApi#get_adapter_host_fc_interface_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "7078477244518594c03caf7e03869059",
"score": "0.48188275",
"text": "def index\n @ips = @user.ips.find(:all, :include => [:topics, :posts]).paginate(:page => params[:page], :per_page => per_page)\n end",
"title": ""
},
{
"docid": "c70af10382904484f48534004a7a0c6c",
"score": "0.48187935",
"text": "def read_tier1_service_interface_with_http_info(tier_1_id, locale_service_id, interface_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface ...'\n end\n # verify the required parameter 'tier_1_id' is set\n if @api_client.config.client_side_validation && tier_1_id.nil?\n fail ArgumentError, \"Missing the required parameter 'tier_1_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'locale_service_id' is set\n if @api_client.config.client_side_validation && locale_service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'locale_service_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # verify the required parameter 'interface_id' is set\n if @api_client.config.client_side_validation && interface_id.nil?\n fail ArgumentError, \"Missing the required parameter 'interface_id' when calling PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi.read_tier1_service_interface\"\n end\n # resource path\n local_var_path = '/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/service-interfaces/{interface-id}'.sub('{' + 'tier-1-id' + '}', tier_1_id.to_s).sub('{' + 'locale-service-id' + '}', locale_service_id.to_s).sub('{' + 'interface-id' + '}', interface_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 => 'ServiceInterface')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PolicyNetworkingConnectivityTier1GatewaysInterfacesInterfacesApi#read_tier1_service_interface\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "f75c1f8e410d29491af69680df3fdedd",
"score": "0.48178253",
"text": "def index\n @ingressos = Ingresso.all\n end",
"title": ""
},
{
"docid": "2eba14f02f3be68a9534f26668188117",
"score": "0.48173884",
"text": "def index\n @network_invitations = current_organization.network_invitations\n @networks = current_organization.networks.paginate(:page => params[:page], :order => \"name\")\n end",
"title": ""
},
{
"docid": "f60fa64fb9b4eabfc70adb415550c6b3",
"score": "0.4812628",
"text": "def interface_decls; end",
"title": ""
},
{
"docid": "cad9b40d6a3a23c3f14b9cd14f70890e",
"score": "0.48105237",
"text": "def adapters\n adapters_by_type.values.flatten\n end",
"title": ""
},
{
"docid": "063479c296ec4722cb619c6d005bb2f1",
"score": "0.48074898",
"text": "def interfaces\n [\n 'LocalLB.Monitor',\n 'LocalLB.NodeAddressV2',\n 'LocalLB.Pool',\n 'LocalLB.VirtualServer',\n 'Management.DeviceGroup',\n 'System.ConfigSync',\n 'System.Failover',\n 'System.Inet'\n ]\n end",
"title": ""
},
{
"docid": "4f8b6c302c9b191e45dbbf6ab911e0d9",
"score": "0.48046598",
"text": "def get_tier1_interface_arp_table_csv_0(tier_1_id, locale_service_id, interface_id, opts = {})\n data, _status_code, _headers = get_tier1_interface_arp_table_csv_0_with_http_info(tier_1_id, locale_service_id, interface_id, opts)\n data\n end",
"title": ""
},
{
"docid": "2904c28200a2f277fcabf25bb4d02878",
"score": "0.4804375",
"text": "def index\n @inscripcions = Inscripcion.all\n end",
"title": ""
}
] |
78fd6dc49bc6686b5e2ef4e3395c440e
|
PATCH/PUT /rank_comments/1 PATCH/PUT /rank_comments/1.json
|
[
{
"docid": "bbd4324b40afa56e7c3070ecbd0dd6d0",
"score": "0.7325645",
"text": "def update\n respond_to do |format|\n if @rank_comment.update(rank_comment_params)\n format.html { redirect_to @rank_comment, notice: 'Rank comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @rank_comment }\n else\n format.html { render :edit }\n format.json { render json: @rank_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "8e39c81746b7a598c24e5e34f302ceae",
"score": "0.66893446",
"text": "def update\n @comment = Comment.find(params[:comment_id])\n @comment.update(comment_params)\n render json: @comment\n end",
"title": ""
},
{
"docid": "99d72b1455026940514746bc963101a1",
"score": "0.66673285",
"text": "def update\n json_update_and_sanitize(comment, comment_params, Comment)\n end",
"title": ""
},
{
"docid": "9c37db48a15c9c774e1ad22e8e548eb5",
"score": "0.65968615",
"text": "def set_rank_comment\n @rank_comment = RankComment.find(params[:id])\n end",
"title": ""
},
{
"docid": "5ed2b1ff2e1fc15558d2dbf5e36b9dd6",
"score": "0.6571869",
"text": "def update\n user = User.find_by({token: env['HTTP_TOKEN']})\n comment = user.comments.find(params[:id])\n comment.update(comment_params)\n render json: comment\n end",
"title": ""
},
{
"docid": "3f1715db0915a51df292ee43154f7127",
"score": "0.64379764",
"text": "def update\n\n if @comment.update(comment_params)\n render json: @comment, status: :ok\n else\n render json: @comment.errors, status: :unprocessable_entity\n\n end\n\n\n end",
"title": ""
},
{
"docid": "44f877671aebac143d889a9b961e2e16",
"score": "0.6437894",
"text": "def update\n @rank = Rank.find(params[:id])\n\n respond_to do |format|\n if @rank.update_attributes(rank_params)\n format.html { redirect_to @rank, :notice => 'Rank was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @rank.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8364474f5bbb6fec568c49eb905a96b",
"score": "0.64100766",
"text": "def update\n @plan_id = comment_params[:plan_id]\n comments = Comment.where(plan_id: @plan_id)\n @reviewer_comments = comments.reviewer_comments.order('created_at DESC')\n @owner_comments = comments.owner_comments.order('created_at DESC')\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to comments_path, notice: 'comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c4a0e5f73a7811640eaadee75d249e7",
"score": "0.6377995",
"text": "def update\n @comment = Comment.find(params[:id])\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.json { render :json => @comment }\n else\n format.json { render :json => @comment.errors, :status => :unprocessable_entity}\n end\n end\n #respond_with(@post,@post.comments.update(params[:id],params[:comment]))\n end",
"title": ""
},
{
"docid": "13c18f04d2bf8c94357823a570cea0c6",
"score": "0.6368759",
"text": "def update\n comment = Comment.find(params[:id])\n if comment.update(params_comment)\n render json: comment, status: 200\n else\n render json: comment.errors, status: 422\n end\n\n end",
"title": ""
},
{
"docid": "b11e07388cc86d2c4875fe459b0a01d4",
"score": "0.63593274",
"text": "def update\n if @comment.update(comment_params)\n render json: @comment, status: :ok\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ecdb2bd73acb37d4ed60918192ac1173",
"score": "0.63425577",
"text": "def update_pull_request_comment(repo, comment_id, body, options = {})\n options.merge! :body => body\n patch(\"#{Repository.path repo}/pulls/comments/#{comment_id}\", options)\n end",
"title": ""
},
{
"docid": "077d9f03f6f109f2090c0d6c837798f4",
"score": "0.63318354",
"text": "def update_comments\n post = Post.find_by_id(params[:id])\n if !post.nil?\n @comments = post.comments.order(\"rank DESC\")\n else\n @comments = []\n end\n render :layout => \"update_comments\"\n end",
"title": ""
},
{
"docid": "163e61c933c285928da02e1f0c7dd286",
"score": "0.63307524",
"text": "def update\n if @comment.update(comment_params)\n render json: @comment, serializer: CommentSerializer\n else\n render_error :unprocessable_entity, @comment.errors\n end\n end",
"title": ""
},
{
"docid": "b6d38ed376a27af5f53706c4dda056e3",
"score": "0.631858",
"text": "def update\n if @comment.update(comment_params)\n head :no_content\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b6d38ed376a27af5f53706c4dda056e3",
"score": "0.631858",
"text": "def update\n if @comment.update(comment_params)\n head :no_content\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "83f62cb6ce47ba97c5474cafb3936e66",
"score": "0.63001204",
"text": "def update\n respond_to do |format|\n if @rank.update(rank_params)\n format.html { redirect_to @rank, notice: 'Rank was successfully updated.' }\n format.json { render :show, status: :ok, location: @rank }\n else\n format.html { render :edit }\n format.json { render json: @rank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ff4baec218eac4ebdc007b1bb3dc316e",
"score": "0.6274634",
"text": "def update\n @comment = Comment.find(params[:id])\n authorize @comment\n if @comment.update(comment_params)\n render 'api/v1/comments/show', status: :success\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "6d5aec30d19815e6517982fbf98ddce9",
"score": "0.6234727",
"text": "def update\n respond_to do |format|\n if @comment10.update(comment10_params)\n format.html { redirect_to @comment10, notice: 'Comment10 was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment10 }\n else\n format.html { render :edit }\n format.json { render json: @comment10.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04a78b0906c48e0181396ccdd3cc5752",
"score": "0.6232926",
"text": "def update\n #respond_to do |format|\n if @comment.update(comment_params)\n render json: @comment.as_json(except: [:updated_at]), status: :ok\n else\n # format.html { render :edit }\n render json: @comment.errors, status: :unprocessable_entity\n # end\n end\n end",
"title": ""
},
{
"docid": "306b75128006faf1ca295ed9b76a5597",
"score": "0.6232064",
"text": "def update\n if @comment.update_attributes(comment_params)\n render json: @comment, status: :ok\n else\n render json: {error: \"Not found\"}, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "7cc9f630819a3fdb3698c5c1a014f0e0",
"score": "0.62212443",
"text": "def update\n #if @user && @user.posts.include(@post)\n @comment.update(comment_params)\n json_response(@comment)\n end",
"title": ""
},
{
"docid": "829071224154ac500e687dbed84f7d11",
"score": "0.6216535",
"text": "def update\n respond_to do |format|\n if @rcomment.update(rcomment_params)\n format.html { redirect_to @rcomment, notice: 'Rcomment was successfully updated.' }\n format.json { render :show, status: :ok, location: @rcomment }\n else\n format.html { render :edit }\n format.json { render json: @rcomment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c1baa6ee220564e5addd247e80d64bab",
"score": "0.61981857",
"text": "def update\n @comment = Comment.find(params[:id])\n @comment.user_id = params[:user_id]\n @comment.announcement_id = params[:announcement_id]\n @comment.description = params[:description]\n @comment.save\n render json:@comment\n end",
"title": ""
},
{
"docid": "f2ce65a21f909da50f33a78435f93925",
"score": "0.61826134",
"text": "def update\n @profile = Profile.where(:name => params[:profile_name]).first!\n @repository = @profile.repositories.where(:name => params[:repo_name]).\n first!\n @issue = @repository.issues.where(:number => params[:issue_number]).\n first!\n @comment = Comment.find(params[:comment_id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8382f2939759fc7ddf28e9296ac51af",
"score": "0.617898",
"text": "def update\n respond_to do |format|\n if @api_v1_answer_comment.update(api_v1_answer_comment_params)\n format.html { redirect_to @api_v1_answer_comment, notice: 'Answer comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_answer_comment }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_answer_comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6601fa2138ac1d24a0aac751d5947fa1",
"score": "0.6174098",
"text": "def update\n @fbcomment = Fbcomment.find(params[:id])\n\n if @fbcomment.update(fbcomment_params) #private section#\n head :no_content\n else\n render json: @fbcomment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c1cbb5e52a89c7808f451650439d964a",
"score": "0.6163279",
"text": "def update_pull_request_comment(project_id_or_key, repository_id_or_name, pull_request_number, comment_id, content)\n patch(\"projects/#{project_id_or_key}/git/repositories/#{repository_id_or_name}/pullRequests/#{pull_request_number}/comments/#{comment_id}\", content: content)\n end",
"title": ""
},
{
"docid": "8a81c86d35d170518627bdd6ed5fe4ba",
"score": "0.61574984",
"text": "def update\n respond_to do |format|\n if @rank.update(rank_params)\n format.html { redirect_to @rank, notice: 'Звание было успешно обновлено.' }\n format.json { render :show, status: :ok, location: @rank }\n else\n format.html { render :edit }\n format.json { render json: @rank.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16ba26ec11aaa5525178ac302ba87e80",
"score": "0.61540776",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to project_sprint_user_story_comments_path, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94973868218bde13215657a4524aeb33",
"score": "0.61537564",
"text": "def update\n @comment = Comment.find(params[:id])\n if @comment.update(comment_params)\n render json: {status: \"success\", data: {comment: @comment}}, status: :ok\n else\n render json: @comment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f1279fcd8473840c0bdc4bb42f624899",
"score": "0.6139513",
"text": "def update\n if @comment.update(comment_params)\n render json: {status: 'Comment was successfully updated.'}, status: :201\n else\n render json: { message: \"Error. Error. Please try again.\"}, status: 400\n end\n end",
"title": ""
},
{
"docid": "278cd7e1c9ddd8cbbbc92a987dd35c8b",
"score": "0.6138644",
"text": "def update\n @comment_node = CommentNode.find(params[:id])\n\n respond_to do |format|\n if @comment_node.update_attributes(params[:comment_node])\n format.html { redirect_to @comment_node, :notice => 'Comment node was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @comment_node.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20a10f6a19ad05e9ab1bf76fdd102209",
"score": "0.61365145",
"text": "def update\n @rank = @rank_class.find(params[:id])\n\n respond_to do |format|\n if @rank.update_attributes(params[:rank])\n format.html { redirect_to(send(\"#{@rank_path}s_path\"), :notice => 'Rank was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rank.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "206e9da5021d6f7c4936581620a66474",
"score": "0.6133996",
"text": "def update_review_comment(repo, comment_id, body, options = {})\n opts = options.dup\n opts[:body] = body\n patch \"#{Repository.path repo}/pulls/comments/#{comment_id}\", opts\n end",
"title": ""
},
{
"docid": "e8c4129d9b168ae007b2f9ca45e2e7d1",
"score": "0.6132525",
"text": "def update\n\n if @comment.update(comment_params)\n\n render json: @comment,status: :ok\n\n else\n\n render json: {error: true,errors: @comment.errors},status: :unprocessable_entity\n\n end\n\n \t\tend",
"title": ""
},
{
"docid": "566f7dd43d817a21c0a3106846460750",
"score": "0.61188143",
"text": "def update!(**args)\n @replies = args[:replies] if args.key?(:replies)\n @root_comment = args[:root_comment] if args.key?(:root_comment)\n end",
"title": ""
},
{
"docid": "17d546284a70edfdd57ff2944dcfdaa1",
"score": "0.61002463",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17d546284a70edfdd57ff2944dcfdaa1",
"score": "0.61002463",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17d546284a70edfdd57ff2944dcfdaa1",
"score": "0.61002463",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b5b54c27e39c2622bb8c952b4faf158",
"score": "0.6098095",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_back(fallback_location: root_path, notice: t('comment.update_msg')) }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json {\n render json: @comment.errors, status: :unprocessable_entity\n }\n end\n end\n end",
"title": ""
},
{
"docid": "054f1ddedbf8396c650d78303b6d9868",
"score": "0.60923105",
"text": "def update\n @group_comment = GroupComment.find(params[:id])\n\n if @group_comment.update(group_comment_params)\n head :no_content\n else\n render json: @group_comment.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "18ee0ceffc34b2529849678a83a0ee7e",
"score": "0.6089719",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :json => {:comment => @comment, :status => 200} }\n else\n format.html { render :edit }\n format.json { render :json => {:comment => @comment, :status => 400 } }\n end\n end\n end",
"title": ""
},
{
"docid": "5cca4ecdcbc68a75151a23417bde55bc",
"score": "0.60767627",
"text": "def update\n authorize [:api, :v1, @requesting_object]\n ticket = ServiceTicket.where(\n client_key: params['avatar_key'],\n id: params['id']\n ).first\n if params['comment_text']\n ticket.comments << Comment.new(author: params['avatar_name'],\n text: params['comment_text'])\n end\n ticket.update(status: params['status']) if params['status']\n render json: { message: 'OK' }, status: :ok\n end",
"title": ""
},
{
"docid": "ea0f3aa9dd1eafd900072e485a321cac",
"score": "0.6070041",
"text": "def update\n\t respond_to do |format|\n\t if @comment.update(comment_params)\n\t format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n\t format.json { head :no_content }\n\t else\n\t format.html { render action: 'comment' }\n\t format.json { render json: @comment.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ac2078864a1b447dc2a97dd1698b67ea",
"score": "0.6058296",
"text": "def update\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2a3e6bc7dc7e8db91675298e83443701",
"score": "0.60546947",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @issue_path, notice: 'Comment is sucesfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb552bc5608a7a921045af773cc75f94",
"score": "0.60513216",
"text": "def update\n @comment.update(comment_params)\n end",
"title": ""
},
{
"docid": "f5d2de952db54da10cfd69de42e498d9",
"score": "0.6049649",
"text": "def update\n respond_to do |format|\n if @comment5.update(comment5_params)\n format.html { redirect_to @comment5, notice: 'Comment5 was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment5 }\n else\n format.html { render :edit }\n format.json { render json: @comment5.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f222a2da07298c3209bed5bd5613097",
"score": "0.60489804",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.xml { head :ok }\n format.json { head :ok } \n else\n format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n format.json { render :json => @comment.errors, :status => :unprocessable_entity } \n end\n end\n end",
"title": ""
},
{
"docid": "f3a4b73412426d0e6ee987334245eb66",
"score": "0.6045259",
"text": "def update\n @comment_vote = CommentVote.find(params[:id])\n\n respond_to do |format|\n if @comment_vote.update_attributes(params[:comment_vote])\n temp_id = 0\n Comment.find(:all).each do |temp_comment|\n if temp_comment.id == @comment_vote.comment_id\n temp_id = temp_comment.post_id\n end\n end\n Post.find(:all).each do |post|\n if post.id == temp_id\n post.update_attribute('modified_date', Date.current )\n post.update_attribute('modified_time', Time.now )\n end\n end\n format.html { redirect_to @comment_vote, notice: 'Comment vote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment_vote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "182e1ff3dc5de132732ca93a3ac6cb8c",
"score": "0.6043884",
"text": "def update\n respond_to do |format|\n if @commentestab.update(commentestab_params)\n format.html { redirect_to @commentestab, notice: 'Commentestab was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @commentestab.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "328769bb7c4e6ab0e468e054093443f1",
"score": "0.6039072",
"text": "def update\n @comment = @complaint.comments.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to([@comment.complaint, @comment], :notice => 'Su comentario ha sido actualizado.') }\n format.json { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19f1d1ed0d531623f0a05f068b1846ee",
"score": "0.6035728",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment.submission }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f47e84fa414d1e83a1aa654e29b0d4b",
"score": "0.60207933",
"text": "def update\n respond_to do |format|\n if @comment_complaint.update(comment_complaint_params)\n format.html { redirect_to @comment_complaint, notice: 'Comment complaint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comment_complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf9edc6c00638ac27346108ad71f8c32",
"score": "0.6019965",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6ad51e58ea9f4a079e5aee807a31cf8",
"score": "0.60098386",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, :notice => 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a6ad51e58ea9f4a079e5aee807a31cf8",
"score": "0.60098386",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, :notice => 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3125564e3a0d17bfc400b2f17574a957",
"score": "0.60056454",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to admin_comments_url, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6d1f43d76744f9c5b566f683ed814fc",
"score": "0.60039765",
"text": "def update\n respond_to do |format|\n if @comment8.update(comment8_params)\n format.html { redirect_to @comment8, notice: 'Comment8 was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment8 }\n else\n format.html { render :edit }\n format.json { render json: @comment8.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0aaef04582941e1b257f1f5c892f1343",
"score": "0.60026413",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, :notice => 'Comment was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0aaef04582941e1b257f1f5c892f1343",
"score": "0.60026413",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, :notice => 'Comment was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "08e84be51ff8b0c43a762cf514541c77",
"score": "0.5994072",
"text": "def update\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment.generic_item, :notice => t('notice.successfully_updated') }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @comment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d671e078cc228ef343528525f1575e89",
"score": "0.59915924",
"text": "def update \n commentable = find_commentable_object\n @comment = Comment.find(params[:id])\n \n respond_with do |format|\n if @comment.update_attributes(params[:comment])\n @comment.pending_for_moderation\n @comment_updated = @comment\n @comment = Comment.new\n \n flash.now[:notice] = 'Comment was successfully updated.'\n else\n flash.now[:alert] = 'Comment was not successfully updated.'\n end\n end\n \n # respond_to do |format|\n # if @comment.update_attributes(params[:comment])\n # format.html { redirect_to(@post, :notice => 'Comment was successfully updated.') }\n # format.xml { head :ok }\n # else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @comment.errors, :status => :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "1bdb997bce265d7f95c1a729e8104be0",
"score": "0.59913874",
"text": "def update\n @comment = current_user.comments.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d6a61f3186174209e44862cb0ae05d7",
"score": "0.5989779",
"text": "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29d9cb80398922018151ca63b55c0c0b",
"score": "0.5988756",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1f33b87e30d1e5a560bd5a12db6306f",
"score": "0.5982941",
"text": "def update\n @review = Review.find(params[:id])\n @review.update(review_params)\n render json: @review\n end",
"title": ""
},
{
"docid": "cf7181dfaa382bef9f86f6cc04386b74",
"score": "0.598214",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, \tºlocation: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c02c8f9f4eddbd3fe3389e6921840076",
"score": "0.5979263",
"text": "def update\n respond_to do |format|\n if @comment.update(comment_params)\n# @comment.delete_empty_notes\n @comment.set_flag(params[:flag])\n format.html { redirect_to homework_comments_url(), notice: 'Comment was successfully updated.' }\n format.js {render :index}\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74031b3367ba1cdad85689fbff7a6264",
"score": "0.59788173",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74031b3367ba1cdad85689fbff7a6264",
"score": "0.59788173",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74031b3367ba1cdad85689fbff7a6264",
"score": "0.59788173",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74031b3367ba1cdad85689fbff7a6264",
"score": "0.59788173",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74031b3367ba1cdad85689fbff7a6264",
"score": "0.59788173",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74031b3367ba1cdad85689fbff7a6264",
"score": "0.59788173",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74031b3367ba1cdad85689fbff7a6264",
"score": "0.59788173",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74031b3367ba1cdad85689fbff7a6264",
"score": "0.59788173",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74031b3367ba1cdad85689fbff7a6264",
"score": "0.59788173",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "497b83451d7ea20cedde3bcf50c2810f",
"score": "0.5977711",
"text": "def update\n respond_to do |format|\n if @comment3.update(comment3_params)\n format.html { redirect_to @comment3, notice: 'Comment3 was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment3 }\n else\n format.html { render :edit }\n format.json { render json: @comment3.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "622580a234a0310643809fea5bd035d4",
"score": "0.5977351",
"text": "def update\n @comment.update_attributes(params[:comment])\n respond_with(@comment, location: redirect_to_index)\n end",
"title": ""
},
{
"docid": "ba14901bd512d0e898fe54f0e68c5d1a",
"score": "0.5976595",
"text": "def update\n authorize(comment)\n if comment.update(comment_params)\n render json: { message: \"Feedback successfully updated!\", error: false}\n else\n render json: { message: \"Sorry, feedback could was not updated. Please try again.\", error: true }\n end\n end",
"title": ""
},
{
"docid": "7dc8f25e41e37c9cd47591ed415ede4b",
"score": "0.5973301",
"text": "def update\n isadmin\n respond_to do |format|\n if @comment.update(comment_params)\n format.html { redirect_to @comment, notice: 'Comment was successfully updated.' }\n format.json { render :show, status: :ok, location: @comment }\n else\n format.html { render :edit }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "10af3727f6f4c3463ca2cbfeef7d9cb7",
"score": "0.59666556",
"text": "def update\n @comment1 = Comment1.find(params[:id])\n\n respond_to do |format|\n if @comment1.update_attributes(params[:comment1])\n format.html { redirect_to @comment1, notice: 'Comment1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment1.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0b7cbbea32fee1c5e71f54b594593ea2",
"score": "0.5962428",
"text": "def update\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n if @comment.update_attributes(params[:comment])\n format.html { redirect_to post_path(@comment.post), notice: 'Comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
aa73c3eb9ec749ad6fa4edf667b865ac
|
Checks to see if this vendor is restricted by locations
|
[
{
"docid": "3dc3d01d2160f83e04fc9171528d44f4",
"score": "0.66865057",
"text": "def uses_locations?\n @use_locations\n end",
"title": ""
}
] |
[
{
"docid": "a2016ba174f164ec6511cf57c112c470",
"score": "0.7439772",
"text": "def current_user_can_see_all_locations?\n current_user_admin? || current_user_agent?\n end",
"title": ""
},
{
"docid": "d3bae48eeeb05d1d922055b746c0a73b",
"score": "0.74190444",
"text": "def precise_location_accessible?\n @permissions.include? 'DEVICE_PRECISE_LOCATION'\n end",
"title": ""
},
{
"docid": "15d3912c4464b8336b8e4df0c4e22362",
"score": "0.7336094",
"text": "def current_user_can_modify_locations?\n current_user_admin? || current_user_agent?\n end",
"title": ""
},
{
"docid": "08ac3bec7a33a6b54565d566da87105f",
"score": "0.72981024",
"text": "def coarse_location_accessible?\n @permissions.include? 'DEVICE_COARSE_LOCATION'\n end",
"title": ""
},
{
"docid": "ca7b3a86c6c0b227811b3bfda6a7dbe8",
"score": "0.71106553",
"text": "def require_locations?\n @require_locations && !@location\n end",
"title": ""
},
{
"docid": "bb6f5dbd61dc8e0ece2208c89049e2e9",
"score": "0.7047821",
"text": "def geographically_restricted?\n (areas.loaded? ? areas.any? : areas.count > 0) ||\n (places.loaded? ? places.any? : places.count > 0)\n end",
"title": ""
},
{
"docid": "ba8ae4e3dc89e5defdd1a440804c661f",
"score": "0.6907755",
"text": "def limited_access_location?(loc_code)\n limited = false\n holding_location = Locations::HoldingLocation.find_by(code: loc_code)\n unless holding_location.nil? \n limited = holding_location.always_requestable\n limited = true if holding_location.label.match(/Reference/)\n end\n limited\n end",
"title": ""
},
{
"docid": "ae6248d5ac4581d8aee5db0495f5bc25",
"score": "0.66675",
"text": "def unavailable?\n return if shadowed?\n unavailable = UNAVAILABLE_LOCATIONS\n unavailable += %w(IN-PROCESS) unless home_location.sc_ivy?\n match?(current_location.code, unavailable)\n end",
"title": ""
},
{
"docid": "81e242747b49c968faf0908845955dc7",
"score": "0.666557",
"text": "def make_restricted_by_locations\n @use_locations = true\n self\n end",
"title": ""
},
{
"docid": "a1bf2772f69a17c65d20c7e55aeda5dd",
"score": "0.66573",
"text": "def location?\n return self.location != Locationised::NOWHERE && self.lng && self.lat\n end",
"title": ""
},
{
"docid": "a415ce9d04e86691b1e36fb8843ab43a",
"score": "0.6649255",
"text": "def known_region_required?\n validatible_location? && country && country.regions.any?\n end",
"title": ""
},
{
"docid": "3a48c0b9567318fe9396853291301fc6",
"score": "0.66020703",
"text": "def valid_location\n if self.location\n valid_locations = List.get_list_items('Locations').sort\n unless valid_locations.include?(location)\n errors.add(:location, \"Location not included in list: #{valid_locations.to_sentence}.\")\n end\n end\n end",
"title": ""
},
{
"docid": "5b6f13787fcafc2649dca4da3e00a65f",
"score": "0.6541579",
"text": "def in_nonrequestable_location?\n (Settings.nonrequestable_locations[library] || Settings.nonrequestable_locations.default).include?(home_location)\n end",
"title": ""
},
{
"docid": "64bcd0dd3e2add6441ed80643c206a48",
"score": "0.65245277",
"text": "def is_safe_location?(location)\n not @unsafe_locations.include?(location)\n end",
"title": ""
},
{
"docid": "5665650b6ab778f6ab794089435fafc9",
"score": "0.6485234",
"text": "def partner_holding?\n Requests::Config[:recap_partner_locations].keys.include? self[\"location_code\"]\n end",
"title": ""
},
{
"docid": "f7c196e2a5bb07c17464fe051464ac06",
"score": "0.64136606",
"text": "def has_vendors_or_locations?\n !roles.empty?\n end",
"title": ""
},
{
"docid": "63e0d099f54f814795452ecb38a9208f",
"score": "0.6411573",
"text": "def expected_location_name?\n current_choosen_location.nil? && location && product\n end",
"title": ""
},
{
"docid": "d0732d7bdb1f450c32350add15d9c031",
"score": "0.6400931",
"text": "def region_filter\n if !current_user.is_admin?\n render 'shared/forbidden'\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "1800d738caaaafe9a27b67841d1e6499",
"score": "0.63629806",
"text": "def has_locations?\n [email protected]?\n end",
"title": ""
},
{
"docid": "37f43fb8dea5532fffc12863877819af",
"score": "0.63628983",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? && !request.fullpath.include?('admin/sign_in')\n end",
"title": ""
},
{
"docid": "e8b3aedf067c42f6b4ccf23af36eb219",
"score": "0.6358785",
"text": "def requires_locations\n if current_trial_id && current_arm_id\n # cached so people can do this in their actions: @selected_locations ||= SelectedLocation.find(...)\n @selected_locations ||= SelectedLocation.find(:all, :params => {:JSESSIONID => java_session_id, :trial_id => current_trial_id, :arm_id => current_arm_id})\n return !@selected_locations.empty?\n else\n no_locations\n end\n end",
"title": ""
},
{
"docid": "1fc3dde2e9a4a75bb8d60f1ed33d8fe9",
"score": "0.6299595",
"text": "def check_location_presence\n self.errors[:location_id] = \"Choose the locations(s)\" unless policy_locations.present?\n end",
"title": ""
},
{
"docid": "fc3f904d699b9ca9e4955e3abac15649",
"score": "0.62776035",
"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": "970fdffb529263f81e75fa23ac37a256",
"score": "0.62768877",
"text": "def authorized?\n allowed_by_env? && underlying_current_educator.present? && underlying_current_educator.can_set_districtwide_access?\n end",
"title": ""
},
{
"docid": "2385c237b162a6041865b460859ea65d",
"score": "0.6260619",
"text": "def location_information?\n [:site, :building, :room, :freezer, :shelf, :box, :box_position].detect { |l| self.send(l).present? }\n end",
"title": ""
},
{
"docid": "26e24ce8a9fd3a7615bcc65f92fcc279",
"score": "0.62549615",
"text": "def check_user\n unless current_user.locations.include? @location\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "3372238e784b65a7e51d3b1ed4669360",
"score": "0.6252385",
"text": "def storable_location?\n\t\t\t request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n\t\t end",
"title": ""
},
{
"docid": "d058bfbe8e4a45bc19c251b588315d0b",
"score": "0.62201416",
"text": "def restricted_by_location?(file_name = nil)\n any_file_location = @file[file_name]&.location&.any?\n any_object_location = @obj_lvl.location&.any?\n\n any_file_location || any_object_location\n end",
"title": ""
},
{
"docid": "199f2e6d730981f70b503110a5a31966",
"score": "0.62150663",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "775a4dcc6a461e83722435828be93426",
"score": "0.62144136",
"text": "def location_is_active_in_system\n all_active_locations = Location.active.to_a.map{|u| u.id}\n unless all_active_locations.include?(self.location_id)\n errors.add(:location_id, \"is not an active location in the system\")\n end\n end",
"title": ""
},
{
"docid": "e2861a8241a8dad4fb88a09ae7a83b7a",
"score": "0.61980903",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? && !signed_in?\n end",
"title": ""
},
{
"docid": "a4f9556bbeb355f0d40c9614f1fd93e2",
"score": "0.61910474",
"text": "def user_located?\n self.shows_user_location? && self.userLocation.location ? true : false\n end",
"title": ""
},
{
"docid": "1811d71f0ec9f7945923af03baca04b0",
"score": "0.61803967",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "1811d71f0ec9f7945923af03baca04b0",
"score": "0.61803967",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "1811d71f0ec9f7945923af03baca04b0",
"score": "0.61803967",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "1811d71f0ec9f7945923af03baca04b0",
"score": "0.61803967",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "aa3d4c7a59254447de4afc2874554dcc",
"score": "0.61677176",
"text": "def requestable?\n requestable = false\n\n LibraryItem.requestable_locations.each do |location_prefix|\n available = self.send(\"available_at_#{location_prefix}?\")\n requestable = !available.nil? &&available ? true : false\n break if requestable\n end\n requestable\n end",
"title": ""
},
{
"docid": "910cc166bf0b179efbffd11c2902aed7",
"score": "0.61508614",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "d03bf2c92a9f5816eff912f52355d51f",
"score": "0.61467856",
"text": "def checkLocationPT(user)\n \n user.location == 'Portugal'\n end",
"title": ""
},
{
"docid": "3c581cdacfa39bdfc56aae02793deda0",
"score": "0.61454475",
"text": "def place_in_locations?(place)\n if place.present?\n political_location = Place.political_division(place).join('/').downcase\n locations.any? { |location| location.path.include?(political_location) }\n else\n false\n end\n end",
"title": ""
},
{
"docid": "dfc5118ee0901abc4ef646a60bdd487b",
"score": "0.6119216",
"text": "def storable_location?\n request.get? &&\n is_navigational_format? &&\n !devise_controller? &&\n request.fullpath != signed_in_root_path(devise_key_for_store_location) && # for return on creating new account\n !request.xhr?\n end",
"title": ""
},
{
"docid": "0266a08cdc3e54616464ecf4ed7a9c01",
"score": "0.61183894",
"text": "def storable_location?\r\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \r\n end",
"title": ""
},
{
"docid": "6756598594b6a8582e4eb1f51c93ed90",
"score": "0.61181915",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "6756598594b6a8582e4eb1f51c93ed90",
"score": "0.61181915",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "6756598594b6a8582e4eb1f51c93ed90",
"score": "0.61181915",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "6756598594b6a8582e4eb1f51c93ed90",
"score": "0.61181915",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "6756598594b6a8582e4eb1f51c93ed90",
"score": "0.61181915",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "60de5f9f420cffd77ca6213b1fb8ba30",
"score": "0.61130923",
"text": "def validatible_location?\n\t\t!([Birth].include?(location_type) || no_street)\n\tend",
"title": ""
},
{
"docid": "8f0e2f0f6f933a3ba0e20cd50c8db11a",
"score": "0.61047095",
"text": "def piece_location_valid?(coords)\n end",
"title": ""
},
{
"docid": "5167446c953eefd4d5ccbc67675d08a0",
"score": "0.6104487",
"text": "def find_location\n @location = @car.location || @car.build_location\n authorize @location\n end",
"title": ""
},
{
"docid": "2a90c87b3890f52964a4583666b1836f",
"score": "0.6099404",
"text": "def validate_location\n unless Pin.find(params[:id]).is_near? current_user\n flash[:notice] = \"Sorry, but this pin isn't located in your area!\"\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "b66e824e6834fe6587563af534b1c54c",
"score": "0.60673416",
"text": "def geo_resource?\n true\n end",
"title": ""
},
{
"docid": "a4d3d7a583d4002391c936fb551d3ee9",
"score": "0.6064904",
"text": "def is_allowed?( addr )\n\t\treturn self.include?( addr, section: 'allow' )\n\tend",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "3438bcf14a2c4929c3a17359c057d856",
"score": "0.60642654",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "0b69d6dc01844b783385ea078f228e64",
"score": "0.605836",
"text": "def geo_resource?\n false\n end",
"title": ""
},
{
"docid": "0b69d6dc01844b783385ea078f228e64",
"score": "0.605836",
"text": "def geo_resource?\n false\n end",
"title": ""
},
{
"docid": "addd05bc4102d42ee6b3e13785ff6249",
"score": "0.6051905",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? &&\n !request.xhr?\n end",
"title": ""
},
{
"docid": "981c194258cb9a89cb8b9c556d6deebb",
"score": "0.60517037",
"text": "def check_location\n if request.path != edit_user_registration_path && current_user && current_user.location.nil?\n flash[:alert] = 'Please set your location to get notifications when other users post a ride near you.'\n redirect_to edit_user_registration_path\n end\n end",
"title": ""
},
{
"docid": "838ba75cd1568f42bbb666d0ba2743d3",
"score": "0.60440636",
"text": "def can_see?(person)\n @location.distance_to(person.location) <= view_dist\n end",
"title": ""
},
{
"docid": "3882d30afb7aff2a1e4eaaab2f1754d8",
"score": "0.6041743",
"text": "def check_location\n if lat > 90 || lat < -90 || lng > 180 || lng < -180\n raise \"Incorrect coordinates\"\n end\n end",
"title": ""
},
{
"docid": "9c97f21b5ab45ea0a909e718867003ac",
"score": "0.6028117",
"text": "def storable_location?\n request.get? && !devise_controller? && !request.xhr?\n end",
"title": ""
},
{
"docid": "d3bd35142dfce9c1ed656bd7cf19020a",
"score": "0.6010941",
"text": "def available?\n restrictions.all? {|restriction| restriction.permitted?(:country)}\n end",
"title": ""
},
{
"docid": "cb636e640211b8bae1d80932a95bc1fc",
"score": "0.6007716",
"text": "def discoverable?\n !has?(:shadowed_location_facet, 'UNDISCOVERABLE')\n end",
"title": ""
},
{
"docid": "f1ee5941237a6698b878682cdb13c9fe",
"score": "0.6004043",
"text": "def contains\n json_response([inside: custom_pip?(@area, geo_jsonify(@location))])\n end",
"title": ""
},
{
"docid": "ad29d69c59e46dbc95120a12a0753dd6",
"score": "0.6001872",
"text": "def loc?\n term_config.url_config.template.starts_with? 'http://id.loc.gov/authorities/'\n end",
"title": ""
},
{
"docid": "f883798bf878f01fefd3cf79a8611032",
"score": "0.59982866",
"text": "def used_locations\n self.locations.select &:in_use?\n end",
"title": ""
},
{
"docid": "f3a2831731d7548fcec17a0c03fd901a",
"score": "0.59955204",
"text": "def check_location_for_ownership(location)\n\t\t@activity ||= location.activity\n\t\tif @activity.user_id == session[:user_id] and session[:user_id] != nil\n\t\t\treturn true\n\t\telsif session[:user_id] == nil\n\t\t\tflash[:notice] = \"You must be logged in to do that.\"\n\t\t\treturn false\n\t\telse\n\t\t\tflash[:notice] = \"You do not have permission to modify that activity's locations\"\n\t\t\treturn false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8f6114cb8f4d15449026c2e1a449767a",
"score": "0.5993334",
"text": "def check_final\n %w[Monroeville Downtown].include?(@driver.location(nil))\n end",
"title": ""
},
{
"docid": "b729324de36ec1d2c1d4caed68466d58",
"score": "0.59839237",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "b729324de36ec1d2c1d4caed68466d58",
"score": "0.59839237",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "b729324de36ec1d2c1d4caed68466d58",
"score": "0.59839237",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "b729324de36ec1d2c1d4caed68466d58",
"score": "0.59839237",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "b729324de36ec1d2c1d4caed68466d58",
"score": "0.59839237",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "b729324de36ec1d2c1d4caed68466d58",
"score": "0.59839237",
"text": "def storable_location?\n request.get? && is_navigational_format? && !devise_controller? && !request.xhr? \n end",
"title": ""
},
{
"docid": "bb8b1256b838661929cb0756c9cbfee3",
"score": "0.5976489",
"text": "def has_offsite_holdings?\n return false unless self[:location_facet].present?\n\n # string regexp against the location field\n self[:location_facet].each do |location_facet|\n return true if location_facet =~ /^Offsite/\n return true if location_facet =~ /ReCAP/i\n # (this should not really happen)\n return true if location_facet =~ /scsb/i\n end\n\n # No offsite location found\n false\n end",
"title": ""
},
{
"docid": "ae8d0a3a2c85fd08d7a1e5b2d36c2a77",
"score": "0.59735984",
"text": "def etas_restricted?\n temp_location == ETAS_TEMPORARY_LOCATION_CODE\n end",
"title": ""
},
{
"docid": "5fe017f0ccd256b386717a2f4c72d784",
"score": "0.5972241",
"text": "def find_location!\n @location = @car.location!\n authorize @location\n end",
"title": ""
},
{
"docid": "f4455fb4afd5917bd9b70b0d6a75ccec",
"score": "0.5963831",
"text": "def custom_region_required?\n !region_id && country && country.regions.empty?\n end",
"title": ""
},
{
"docid": "61449285946124d6962ea31b6c975b43",
"score": "0.59601545",
"text": "def valid?\n valid_mapping? # apply to any request for a wind user\n end",
"title": ""
},
{
"docid": "63e8168038cfb9bbb4c49eb4b23624f7",
"score": "0.5952236",
"text": "def known_region_required?\n return false if country == nil\n country.regions.count != 0\n end",
"title": ""
},
{
"docid": "ac010d86b374b58f714de7eac6922f9e",
"score": "0.5937639",
"text": "def allows?\n !(realignable_countries - restricted_countries).empty?\n end",
"title": ""
},
{
"docid": "68ee3c44a13adfd7a7ab6eea020e4bb2",
"score": "0.5926742",
"text": "def placed?\n !location.nil?\n end",
"title": ""
},
{
"docid": "178c4f160298c838d401fc6bba9d66ab",
"score": "0.5924643",
"text": "def valid_place?(coords)\n if coords[0].to_i.to_s == coords[0] && coords[1].to_i.to_s == coords[1] && robot.compass.member?(coords[2])\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "0df75bf86c36c5871ab4f5177a0b935b",
"score": "0.5902591",
"text": "def shows_user_location?\n self.showsUserLocation\n end",
"title": ""
},
{
"docid": "e7959848154c2977bbdb08fa5176d600",
"score": "0.59019786",
"text": "def can_view?(loc_group)\n return false unless loc_group\n self.is_superuser? || permission_list.include?(loc_group.view_permission) && self.is_active?(loc_group.department)\n end",
"title": ""
},
{
"docid": "709bc9c11240614ce2b4c0c3ad6d78d7",
"score": "0.5900588",
"text": "def hide_location?\n try(:show_location) == false\n end",
"title": ""
},
{
"docid": "297f714447bb4c121e8b7d8e7407da00",
"score": "0.5894335",
"text": "def is_admin_of_city? \n return true if user.present? && user.admin? && @record.city == user.city \n #return true if current_admin_check? \n end",
"title": ""
},
{
"docid": "b2ff1592dba023d6a3cd18dc69bc8bce",
"score": "0.5888821",
"text": "def has_location?\n \t!address.blank?\n end",
"title": ""
},
{
"docid": "f5a22c190832fa2b9f89923d2fb992d6",
"score": "0.5871066",
"text": "def has_locations?\n if trial_summary\n trial_summary.has_locations\n else\n false\n end\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "57c8680dfe3d938f5d2e8a364de81dba",
"score": "0.0",
"text": "def set_pokemon\n @pokemon = Pokemon.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 [email protected]?(: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": ""
}
] |
6938f6d365c166233f3298c426174543
|
Returns hash with all tagged commits as keys (SHA1) and versions as values.
|
[
{
"docid": "2ce56de1b403d303fd1b0a5cc7179dfc",
"score": "0.6586111",
"text": "def tagged_commits_mapping\n @commits ||= github_api_authenticated_get(\"/repos/#{repository_slug}/tags\").each_with_object({}) do |x, memo|\n memo[x.fetch('commit').fetch('sha')] = Gem::Version.new(x.fetch('name'))\n end\nend",
"title": ""
}
] |
[
{
"docid": "9e565febc5fcbcf0197a0c50afe33f2e",
"score": "0.7529599",
"text": "def commit_hashes\n log.map {|entry| entry['version']}\n end",
"title": ""
},
{
"docid": "9e565febc5fcbcf0197a0c50afe33f2e",
"score": "0.7529599",
"text": "def commit_hashes\n log.map {|entry| entry['version']}\n end",
"title": ""
},
{
"docid": "fe143589e13a5f85b7beed2bc82cf567",
"score": "0.64286125",
"text": "def sha\n event['head_commit']['id'] if event['head_commit']\n end",
"title": ""
},
{
"docid": "a77d401d7b41664bdd145aac30656c18",
"score": "0.63818586",
"text": "def sha\n event['head_commit']['id']\n end",
"title": ""
},
{
"docid": "df6d40339cb0ccd484885677f9a8f7b3",
"score": "0.62911993",
"text": "def sha\n @gcommit.sha\n end",
"title": ""
},
{
"docid": "a7750c413a78b3b213f5aaee19da4574",
"score": "0.6266693",
"text": "def versions\n self.git.commits\n end",
"title": ""
},
{
"docid": "1ffb521e879819c9440c0f06aebe1e12",
"score": "0.615543",
"text": "def get_latest_commit_hash()\n hash = %x[git log -1 --pretty=format:%h]\n\n hash\nend",
"title": ""
},
{
"docid": "58afecb47f9e964773e2ad69745473eb",
"score": "0.6150429",
"text": "def commits\n @commits ||= git_log.split(/^\\n?>>> /).collect do |group|\n files = group.split(\"\\n\")\n # The name is the commit message\n name = files.shift\n # What's left is the list of files\n files.collect! do |file|\n # Collect the ones that were added or modified\n file.sub(/[AM]\\t/, '') if file =~ /[AM]\\t/\n end\n # Get rid of the nils\n files.compact!\n # We don't want any files that have been deleted\n files.delete_if { |file| !File.exists?(file) }\n # Exclude files matching .gitupignore\n if File.exists?(@ignore_file)\n @ignores = File.readlines(@ignore_file).collect { |line| line.strip }\n @ignores.each do |ignore|\n files.delete_if { |file| file.match(ignore) }\n end\n end\n # Make the hash for the commit\n { :name => name, :files => files } unless name.nil? || files.nil? || files.empty?\n end.compact\n end",
"title": ""
},
{
"docid": "64157ec10d457d55eb945d0f9c13f728",
"score": "0.6130321",
"text": "def digests\n @map.map { |sha1, path| sha1 }\n end",
"title": ""
},
{
"docid": "10caddec2a57e0e71efe92dfbd4bbee8",
"score": "0.6121725",
"text": "def commit_metadata\n git_mappings = {\n commit: '%H',\n author_name: '%an',\n author_email: '%ae',\n commiter_name: '%cn',\n commiter_email: '%ce',\n subject: '%s',\n body: '%b',\n committer_date_unix: '%ct'\n }\n\n git_command = \"git log -1 --format=format:'%{var}' #{commit_sha}\"\n result = {}\n git_mappings.each do |attr, var|\n result[attr] = Testributor.command(\n git_command.gsub(/%{var}/, var),\n log_output: false)[:output]\n end\n\n result[:sha_history] = Testributor.command(\n \"git log -#{SHA_HISTORY_LIMIT} --format=format:'%H'\",\n log_output: false)[:output].split(\"\\n\")\n\n result\n end",
"title": ""
},
{
"docid": "e86377c5a1d357df5b5310a1fe73d0c5",
"score": "0.6113214",
"text": "def commits_for_branch branch_name, keys\n array_output_of(\"git log #{branch_name} --format='%h|%s|%ae' --topo-order --reverse\").map do |commit|\n sha, message, author = commit.split('|')\n next if message == 'Initial commit'\n filenames = committed_files sha\n {\n author: author,\n message: message,\n file_name: filenames,\n file_content: content_of(file: filenames[0], for_sha: sha)\n }.select { |key, _| keys.include? key }\n end.compact\nend",
"title": ""
},
{
"docid": "8e22cdcc3452bd8f36754a6ff020a69e",
"score": "0.61052114",
"text": "def hash\n super +\n @build.hash +\n @full_version.hash +\n @major.hash +\n @minor.hash +\n @revision.hash\n end",
"title": ""
},
{
"docid": "99ad46168d559c8b508da6725cc33174",
"score": "0.604629",
"text": "def checkout_hash\n digest(\"#{PROTOCOL_VERSION}\\000#{repo_type}\\000#{url}\\000#{tag}\")\n end",
"title": ""
},
{
"docid": "82b4a4b5523a212aa642241d5ea935f9",
"score": "0.6024014",
"text": "def to_hash\n @to_hash ||= {\n release: Util::NonNilHashBuilder.build do |h|\n h.add(:commit_hash, commit_hash)\n h.add(:created_at, created_at)\n h.add(:version, version)\n end\n }\n end",
"title": ""
},
{
"docid": "2ee52b46a0237e9871109acdc7dc24ef",
"score": "0.60131997",
"text": "def commits_dict\n return @commits_dict if @commits_dict\n\n @commits_dict = {}\n Black::Git\n .execute(@path, %w(rev-list HEAD --reverse))\n .each_line\n .with_index{ |a, i| @commits_dict[i] = a.chomp }\n\n @commits_dict\n end",
"title": ""
},
{
"docid": "88b2594d31f0c95256fa6022f2797642",
"score": "0.59931934",
"text": "def sha_detail(commit)\n { commit: commit[0] }\n end",
"title": ""
},
{
"docid": "f7f233130ee43d1888d222039ca19b85",
"score": "0.5954761",
"text": "def git_sha; end",
"title": ""
},
{
"docid": "f7f233130ee43d1888d222039ca19b85",
"score": "0.5954761",
"text": "def git_sha; end",
"title": ""
},
{
"docid": "4818a48165c5d14e152dd17fe67e6572",
"score": "0.59028935",
"text": "def tag_entries\n repo.tags.map do |tag|\n {\n :name => tag.name,\n :sha => tag.target.oid,\n :author_time => tag.target.author[:time],\n :commit_time => tag.target.committer[:time],\n :tag_message => tag.annotation && tag.annotation.message,\n :commit_message => tag.target.message,\n }\n end\n end",
"title": ""
},
{
"docid": "ab673e6f2929ee6f35a0256b256d5011",
"score": "0.5888645",
"text": "def associate_commits(sha1s)\n # We force release_id to be NULL because rev-list in svn yields some\n # repeated commits in several releases.\n Commit.where(sha1: sha1s, release_id: nil).update_all(release_id: id)\n end",
"title": ""
},
{
"docid": "320d1b9c84e12fb37ae43be253eff234",
"score": "0.5884264",
"text": "def commit_info(sha)\n return nil unless commit?(sha)\n\n command = 'git log '\\\n \"--format=format:'%h%n%ct%n%ar%n%an%n%s%n%b%n' -n 1 #{sha}\"\n output = command_stdout(command)\n split = output.split(\"\\n\")\n date = Date.strptime(split[1], '%s')\n {\n sha: split[0],\n date: date,\n date_relative: split[2],\n author: split[3],\n subject: split[4],\n body: split[5]\n }\n end",
"title": ""
},
{
"docid": "1d613fc33de1a54bf46093f0455c8099",
"score": "0.58540374",
"text": "def hash\n \"#{size}--#{path}--#{repo.root}--#{revision} 2> /dev/null\".hash\n end",
"title": ""
},
{
"docid": "e4718dd165a5118b7b8de8dba33ef623",
"score": "0.5842651",
"text": "def repo_committers\n committers = `git shortlog -sn`.split(/\\n/)\n @repo_committers = committers.values_at(0..2)\n end",
"title": ""
},
{
"docid": "87665a8f622f9302c52686dd77756585",
"score": "0.5841555",
"text": "def to_h\n { 'version' => tag.name,\n 'date' => tag.date,\n 'message' => tag.message,\n 'author' => tag.author,\n 'revision' => tag.revision,\n 'changes' => changes.map{|change| change.to_h}\n }\n end",
"title": ""
},
{
"docid": "d957c03f6fccf5f22e6489184c29983f",
"score": "0.58283883",
"text": "def sha1\n currwd = Dir.pwd\n Dir.chdir(@isis_release)\n res = Git.git(\"log -n1\").split\n Dir.chdir(currwd)\n return res[1]\n end",
"title": ""
},
{
"docid": "dba93decb79bb62e05f8674168fb33c7",
"score": "0.58264035",
"text": "def hash_hash(h)\n require 'digest/sha1'\n str = recursive_flatten(h).sort.join\n Digest::SHA1.hexdigest(str)\n end",
"title": ""
},
{
"docid": "dba93decb79bb62e05f8674168fb33c7",
"score": "0.58264035",
"text": "def hash_hash(h)\n require 'digest/sha1'\n str = recursive_flatten(h).sort.join\n Digest::SHA1.hexdigest(str)\n end",
"title": ""
},
{
"docid": "50fde84730bab83101236815f2d95060",
"score": "0.581566",
"text": "def latest_sha1\n @cached_sha1 || begin\n source = master\n source = ('http://' + source) unless source.include?('://')\n source.gsub!(/\\/?$/, \"/#{repo}/.git/deploy/deploy\")\n tag = open(source) { |raw| PSON.load(raw)['tag'] }\n @cached_sha1 = resolve_tag(tag) || tag\n end\n end",
"title": ""
},
{
"docid": "6e6820ee235ee08b12e5be067e20ed8f",
"score": "0.58103955",
"text": "def log\n # great idea or greatest idea?\n delimiter = '!@#%^&*'\n history = `git log --graph --pretty=format:'#{delimiter} %h #{delimiter} %s #{delimiter} %cr #{delimiter} %an' --abbrev-commit`\n\n # iterate over history lines\n commits = []\n lines = history.split \"\\n\"\n lines.each_with_index do |line, i|\n # get information from individual commits\n commit = line.split(delimiter).map { |s| s.strip }\n commits.push({\n :id => commit[1],\n :message => commit[2],\n :timestamp => commit[3],\n :author => commit[4]\n })\n end\n\n return commits\n end",
"title": ""
},
{
"docid": "00cabc63443379606fde1c41335c5bee",
"score": "0.5797357",
"text": "def hash\n Digest::SHA1.hexdigest to_s\n end",
"title": ""
},
{
"docid": "f2f23b147158a2ac2e74ba61299e2b09",
"score": "0.5794891",
"text": "def hash\n super +\n @version.hash\n end",
"title": ""
},
{
"docid": "f2f23b147158a2ac2e74ba61299e2b09",
"score": "0.5794891",
"text": "def hash\n super +\n @version.hash\n end",
"title": ""
},
{
"docid": "87e39fdd0853387f8c02d1310f2da918",
"score": "0.5793119",
"text": "def sha1_hash\n @sha1_hash ||= Digest::SHA1.hexdigest content\n end",
"title": ""
},
{
"docid": "c4aa71f42b47788a4abb061de072f4c1",
"score": "0.5777834",
"text": "def to_ary\n [@commit, @hash, @branch, @date, @user, @summary]\n end",
"title": ""
},
{
"docid": "f694d90601a7c467ea4a2b3b9c724e7e",
"score": "0.5772137",
"text": "def commit_summaries_from_hashes commit_hashes\n repo = get_repo()\n commits = commit_hashes.map {|hash| repo.lookup(hash)}\n commits.sort! {|a,b| a.time <=> b.time }\n\n author_max_len = commits.map {|commit| commit.author[:name].length }.max\n\n commits.map do |commit|\n message_first_line = commit.message[/.*/]\n\n \"#{commit.oid[0,7]} #{commit.author[:name].ljust(author_max_len)} #{message_first_line}\"\n end\nend",
"title": ""
},
{
"docid": "7f2ad290a70c1ecd02fa2c1d093087e8",
"score": "0.5765708",
"text": "def sha\n git_repo.sha\n end",
"title": ""
},
{
"docid": "aefc36ccc6fb5e3d9bcfa534d3d24d76",
"score": "0.57609403",
"text": "def git_attributes\n {\n name: \"full_name\",\n homepage: \"homepage\",\n last_commit: \"pushed_at\",\n forks_count: \"forks_count\",\n stargazers_count: \"stargazers_count\",\n watchers_count: \"subscribers_count\",\n open_issues_count: \"open_issues_count\",\n }\n end",
"title": ""
},
{
"docid": "e73f96adbd10be6709c2e3aaed433bfe",
"score": "0.57387996",
"text": "def refs_hash\n # Initialize only when first call\n if @refs_hash.nil?\n @refs_hash = Hash.new { |h, k| h[k] = [] }\n\n @raw.refs.each do |r|\n @refs_hash[r.commit.id] << r\n end\n end\n\n @refs_hash\n end",
"title": ""
},
{
"docid": "8299fa04c1fcf1208721b7b997f17f0d",
"score": "0.573625",
"text": "def keys\n head.commit.tree.contents.map{|blob| blob.name }\n end",
"title": ""
},
{
"docid": "6716380b27a47749f5cb11cc70410350",
"score": "0.572076",
"text": "def all_ids_with_sha1(recursive = true, which = nil)\n ids = {}\n \n ag_branch = @repo.branches['_ag']\n if ag_branch\n walker = Rugged::Walker.new(@repo)\n walker.push(ag_branch.target)\n walker.each do |commit|\n commit.tree.walk(:postorder) do |path, obj|\n next unless obj[:type] == :blob\n if which\n next if path != which + '/'\n end\n id = obj[:name]\n next unless id =~ /^[a-z]{2}\\d{4}$/\n ids[id] ||= commit.oid\n end\n break unless recursive\n end\n end\n \n return ids\n end",
"title": ""
},
{
"docid": "d8240d0e3dc03fc3812ce2d71997063d",
"score": "0.5718409",
"text": "def sha1_hash\n return @sha1_hash\n end",
"title": ""
},
{
"docid": "3d4256de90e31c08299620f50f9cb3fc",
"score": "0.57138",
"text": "def sha commit_message\n output_of \"git reflog --grep-reflog='commit: #{commit_message.strip}' --format='%H'\"\nend",
"title": ""
},
{
"docid": "aeb4c0d7b4d128264b0db03e38552bc4",
"score": "0.57091206",
"text": "def hash\n binary_components.hash\n end",
"title": ""
},
{
"docid": "759eadddf7f1c7370e22cea5a4226ba4",
"score": "0.5706813",
"text": "def refs_hash\n # Initialize only when first call\n if @refs_hash.nil?\n @refs_hash = Hash.new { |h, k| h[k] = [] }\n\n grit.refs.each do |r|\n @refs_hash[r.commit.id] << r\n end\n end\n @refs_hash\n end",
"title": ""
},
{
"docid": "759eadddf7f1c7370e22cea5a4226ba4",
"score": "0.57060814",
"text": "def refs_hash\n # Initialize only when first call\n if @refs_hash.nil?\n @refs_hash = Hash.new { |h, k| h[k] = [] }\n\n grit.refs.each do |r|\n @refs_hash[r.commit.id] << r\n end\n end\n @refs_hash\n end",
"title": ""
},
{
"docid": "1968580201d59d4356125d1e43dc91a1",
"score": "0.57059085",
"text": "def getVersionFromGit\n versions = []\n `git tag -l`.each_line do |line|\n versions.push $1 if line =~ /^v(\\d+.\\d+.\\d+)/\n end\n versions.last\nend",
"title": ""
},
{
"docid": "59de3d3cb6ab4a631270a3bfb4854690",
"score": "0.5696982",
"text": "def index_signature\n require 'digest'\n\n Digest::SHA256.new.hexdigest(@gems.keys.sort.join(',')).to_s\n end",
"title": ""
},
{
"docid": "371e2459bee1a876539dc40be0ddad52",
"score": "0.56849355",
"text": "def tag_entries\n ref_fields(TAG_ENTRIES_FIELDS, 'refs/tags').map do |values|\n {\n :sha => values[1],\n :name => values[2].sub(%r{\\Arefs/tags/}, ''),\n :author_time => Time.rfc2822(values[3]),\n :commit_time => Time.rfc2822(values[4]),\n :tag_message => values[0] == 'tag' ? values[5] : nil,\n :commit_message => values[0] == 'tag' ? values[6] : values[5],\n }\n end\n end",
"title": ""
},
{
"docid": "7771f8172d5e6972c7c97e1620722f94",
"score": "0.5684513",
"text": "def sha1\n repo.git.exec(\"rev-parse\",\"--verify\",@path).chomp\n end",
"title": ""
},
{
"docid": "dee291a7d7de18780c2e1b6be9832a2f",
"score": "0.56809366",
"text": "def index_signature\n require 'digest'\n\n Digest::SHA256.new.hexdigest(@gems.keys.sort.join(',')).to_s\n end",
"title": ""
},
{
"docid": "eaf6fa4a20a500b9975e64c27c67f6b1",
"score": "0.56619525",
"text": "def hash\n digest.hash\n end",
"title": ""
},
{
"docid": "facb655315dc7d486d458f41e78697b2",
"score": "0.5641142",
"text": "def hash\n\t\t\t\treturn Digest::SHA1.hexdigest \"#{@group}#{@name}#{@version}\"\n\t\t\tend",
"title": ""
},
{
"docid": "d2d9ea6faf8ec4b451153a183da17645",
"score": "0.5634733",
"text": "def repo_commits(repo)\n Git.repo_hash[repo].commits\n end",
"title": ""
},
{
"docid": "d2d9ea6faf8ec4b451153a183da17645",
"score": "0.5634733",
"text": "def repo_commits(repo)\n Git.repo_hash[repo].commits\n end",
"title": ""
},
{
"docid": "791afc040be8f73f47e98a809eac73cf",
"score": "0.5629087",
"text": "def head_sha\n @g.object('HEAD').sha\n end",
"title": ""
},
{
"docid": "0c9d3ea32d19c2e8f3a66bb719f1391e",
"score": "0.5622382",
"text": "def hash_committers(committers)\n byid = {}\n bymail = {}\n committers.each do |hsh|\n byid[hsh[ID]] = hsh\n hsh[MAIL].each do |addr| # Committers can have multiple emails\n (bymail[addr] ||= []) << hsh\n end\n end\n return byid, bymail\n end",
"title": ""
},
{
"docid": "7981933917d8814a96201b3f1d5256f7",
"score": "0.56110466",
"text": "def sha1\n @sha1\n end",
"title": ""
},
{
"docid": "07eba503e1707d7a15ec41f50ac25f85",
"score": "0.5608756",
"text": "def sha1(build, launcher, listener)\n result = run(\"git rev-parse HEAD\", build, launcher, listener)\n if result[:exit_code] == 0\n sha1 = result[:out].strip\n listener.debug(\"Current commit SHA1: #{sha1}\")\n return sha1\n else\n listener.error(\"Failed to retrieve commit SHA1: stdout: #{result[:out]} stderr: #{result[:err]}\")\n return nil\n end\n end",
"title": ""
},
{
"docid": "81e86dc1abe7c97d871d66b5150097e7",
"score": "0.5607551",
"text": "def _tags\n history.reject { |commit| commit.tags.empty? }\n .map { |commit| commit.tags.map { |tag| [tag, commit.id] } }\n .each_with_object([]) { |commit, tags| tags.push(*commit) }\n end",
"title": ""
},
{
"docid": "4fe1cab7d6e075946a209ee1e096a444",
"score": "0.5607287",
"text": "def git_sha\n Pkg::Util.in_project_root do\n %x{#{GIT} rev-parse HEAD}.strip\n end\n end",
"title": ""
},
{
"docid": "ddb66dc0e86553c64ed14235455d6876",
"score": "0.5601239",
"text": "def all_commits_bfs(repo)\n seen = [].to_set\n \n repo.heads.each do |head| \n $headnm=head.name if DEBUG\n seen.merge(ancestors(head.commit, seen)) \n end\n\n repo.tags.each do |head| \n $headnm=head.name if DEBUG\n seen.merge(ancestors(head.commit, seen)) \n end\n\n repo.remotes.each do |head| \n $headnm=head.name if DEBUG\n seen.merge(ancestors(head.commit, seen)) \n end\n\n seen\nend",
"title": ""
},
{
"docid": "ba1e3fe21204376e9c93d49911859b17",
"score": "0.56008255",
"text": "def get_sha1(ref)\n `git rev-parse #{ref}`.chomp\n end",
"title": ""
},
{
"docid": "ba1e3fe21204376e9c93d49911859b17",
"score": "0.56008255",
"text": "def get_sha1(ref)\n `git rev-parse #{ref}`.chomp\n end",
"title": ""
},
{
"docid": "95e2f433ba72b3fea68c873fe1ef2994",
"score": "0.56001735",
"text": "def to_hash\n {\n sha: sha,\n sources: sources\n }\n end",
"title": ""
},
{
"docid": "ed53aadfecdc570258a7a0a3f5a3294f",
"score": "0.5595884",
"text": "def digest\n @digest ||= Digest::SHA1.new.update(version.to_s)\n @digest.dup\n end",
"title": ""
},
{
"docid": "6aa04165ab68c912436a3b0133cf9c29",
"score": "0.5584525",
"text": "def shas_by_file\n result = {}\n files = files_by_tree(@git.gtree('HEAD'))\n files.each do |file|\n result[file] = file_sha(file)\n end\n result\n end",
"title": ""
},
{
"docid": "746ab6a8217641defacc0db332a42b36",
"score": "0.5573457",
"text": "def git_sha\n %x{git rev-parse HEAD}.strip\nend",
"title": ""
},
{
"docid": "24898cbf29a84655586beab283c21cb6",
"score": "0.5560452",
"text": "def git_hash_object(path)\n require 'mixlib/shellout'\n begin\n Mixlib::ShellOut.new(\"git hash-object #{path}\").run_command.stdout.chomp\n rescue\n ''\n end\nend",
"title": ""
},
{
"docid": "69fe2ff04e3338d4157ba5b451ffe9d9",
"score": "0.55497295",
"text": "def archive_sha256_tree_hash\n data[:archive_sha256_tree_hash]\n end",
"title": ""
},
{
"docid": "e25178e9359f3cfaf560c4344f8a5f2b",
"score": "0.5545444",
"text": "def git_revisions_output\n \"0aef1f56d5b3b546457e996450fd9ceca379f0a8\n8038f1b17c3749540650aaab3f4e5e846cfc3b47\n4d7e4859b2ed8a7e4f73e3540e7879c00cba9783\"\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.5537339",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.5537339",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "0adb4f01edc84375a1afc11774d382ec",
"score": "0.55306345",
"text": "def git_sha\n `git rev-parse HEAD`.strip\n end",
"title": ""
},
{
"docid": "3057775c72e06013943270e05b5940d3",
"score": "0.5526714",
"text": "def hex_digests\n # output hexdigests\n digests = {}\n @digest_accumulator.each_pair do |k, v|\n digests[k] = v.hexdigest\n end\n digests\n end",
"title": ""
},
{
"docid": "9b8ee074130b0642eec566064bbf4611",
"score": "0.5502682",
"text": "def repository_hash\n digest(\"#{::RightScraper::PROTOCOL_VERSION}\\000#{repo_type}\\000#{url}\")\n end",
"title": ""
},
{
"docid": "895e9b4573b5c6be2d2b4d1d0d78e095",
"score": "0.54978126",
"text": "def git_sha=(_arg0); end",
"title": ""
},
{
"docid": "f2a2aa7625bac339e3fa2343c66b5d5e",
"score": "0.5484828",
"text": "def archive_sha256_tree_hash\n data.archive_sha256_tree_hash\n end",
"title": ""
},
{
"docid": "4639f479fb84319f19030a096a013e83",
"score": "0.548302",
"text": "def committed_files sha\n array_output_of \"git diff-tree --no-commit-id --name-only -r #{sha}\"\nend",
"title": ""
},
{
"docid": "c95b21f9f9d4dd3975a8fb3a92748e7b",
"score": "0.5478303",
"text": "def merge_commits\n @merge_commits ||= Open3.popen3(*%w[\n git rev-list --pretty=oneline --topo-order --min-parents=2 --max-parents=2 --parents\n ],\n \"#{last_release}..#{end_object}\"\n ) do |stdin, stdout, stderr|\n stdout.each_line.collect do |line|\n line.chomp!\n # intentionally limited to the simple case of two parents\n if %r{\\A(#{SHA_PAT}) (#{SHA_PAT}) (#{SHA_PAT}) (.*)}.match(line)\n [$1, {\n :trunk_parent => $2,\n :branch_parent => $3,\n :log => $4,\n }]\n else\n raise \"could not parse '#{line}'\"\n end\n end.compact.to_h\n end\nend",
"title": ""
},
{
"docid": "34cdbc669fe5f15d9c4ff577deae9ce0",
"score": "0.54780006",
"text": "def digest\n OpenSSL::Digest::SHA1.hexdigest(attributes.values.join(\":\"))\n end",
"title": ""
},
{
"docid": "793a86dd5ccd267a363fc697bd85f8db",
"score": "0.5477152",
"text": "def diff_initial(commit_sha)\n data = commit_information(commit_sha)\n value = {\n total: {\n insertions: 0,\n deletions: 0,\n lines: 0,\n files: data.length\n },\n files: {}\n }\n data.each do |d|\n item = d.split(\"\\t\")\n insertions = item[0].to_i\n value[:total][:insertions] += insertions\n value[:total][:lines] += insertions\n value[:files][item[2]] = {\n insertions: insertions,\n deletions: 0,\n lines_added: [\"0..#{item[0]}\"]\n }\n end\n value\n end",
"title": ""
},
{
"docid": "2ee121a628e730d01c763ca67e762ea9",
"score": "0.54675066",
"text": "def sha256_tree_hash\n data.sha256_tree_hash\n end",
"title": ""
},
{
"docid": "591e6b17363dd41043a0033dec7d99d2",
"score": "0.54628694",
"text": "def hashed\n Digest::SHA256.hexdigest(to_hash.to_json)\n end",
"title": ""
},
{
"docid": "57e0763d2f6256039a3f2ce45f30fd5c",
"score": "0.5462177",
"text": "def sha\n\t\treturn OpenSSL::Digest::Digest.new('sha1',self).to_s\n\tend",
"title": ""
},
{
"docid": "b95804d97890e65e03588cf5ee66a692",
"score": "0.5459097",
"text": "def get_head_hash(user, repository)\n get_hash_by_name(user, repository, 'HEAD')\n end",
"title": ""
},
{
"docid": "45b480255cd241cc3f34f35031498ca4",
"score": "0.5455383",
"text": "def master_commit_sha\n @g.branches[:master].blank? ? head_sha : @g.branches[:master].gcommit.sha\n end",
"title": ""
},
{
"docid": "cf40c90274c18007cb4d7ae3b0b708b8",
"score": "0.5454566",
"text": "def get_commit_hash(label)\n hash = `git rev-parse #{label} 2> /dev/null`\n if $?.to_i == 0\n hash\n else\n nil\n end\nend",
"title": ""
},
{
"docid": "79d5a39aa71eca8b6f99624e2af29a86",
"score": "0.5453186",
"text": "def GetCommitInfo(hash)\n info = `git log -n 1 --format='%ae%n%s' #{hash}`.split(\"\\n\")\n if info.length != 2\n puts(\"Badly-formatted commit with hash #{hash}\")\n exit(127)\n end\n return info[0], info[1]\nend",
"title": ""
},
{
"docid": "e9797145b1f55d284e1e778cdf3d536b",
"score": "0.5453076",
"text": "def digest\n Digest::MD5.new.update(@args.keys.map(&:to_s).sort.concat(@args.values.map(&:to_s).sort).join).hexdigest\n end",
"title": ""
},
{
"docid": "ddbb94ceb684a6c63493caf8ac224366",
"score": "0.5450746",
"text": "def hash\n parts.to_s.hash\n end",
"title": ""
},
{
"docid": "56dc655f0488056f17eab192f94ed6c5",
"score": "0.5446887",
"text": "def to_tags\n {\n 'Content-Type' => 'text/plain',\n 'App-Name' => 'Gitstamp',\n 'Git-Commit' => self.id.to_s,\n 'Git-Commit-Link' => self.link&.to_s,\n 'Git-Author' => self.author&.to_s,\n 'Git-Committer' => self.committer&.to_s,\n 'Git-Committer-Date' => self.committer_date&.strftime(\"%Y-%m-%dT%H:%M:%S%:z\"),\n }.delete_if { |k, v| v.nil? }\n end",
"title": ""
},
{
"docid": "5ed84d2c098ed5a5f4148bf11168d108",
"score": "0.5446838",
"text": "def hmac_sha1_signature\n hmac_digest_signature(OpenSSL::Digest::SHA1)\n end",
"title": ""
},
{
"docid": "9929598ec6bf8d166ea362cab6e258bd",
"score": "0.54452884",
"text": "def sha_repo; end",
"title": ""
},
{
"docid": "fca195d99ba454ee5b586d37eb4a7a6f",
"score": "0.54367256",
"text": "def sha1_body_hash\n digest_body_hash(OpenSSL::Digest::SHA1)\n end",
"title": ""
},
{
"docid": "f072ce49d656cca5151146bd4f07e6f3",
"score": "0.542942",
"text": "def head_sha\n open\n @git.object('HEAD').sha\n end",
"title": ""
},
{
"docid": "f072ce49d656cca5151146bd4f07e6f3",
"score": "0.542942",
"text": "def head_sha\n open\n @git.object('HEAD').sha\n end",
"title": ""
},
{
"docid": "b8ffd231cd1d040b4dee244b6f98d784",
"score": "0.54207534",
"text": "def latest_commit\r\n log = ex(\"git log -n 1\")\r\n\r\n ec = Encoding::Converter.new(\"utf-8\", Encoding.find(\"locale\"))\r\n\r\n ret = {}\r\n ret[:Commit] = ec.convert(log).scan(/^commit *(.*)$/)[0][0]\r\n ret[:Date] = Time.parse(ec.convert(log).scan(/^Date: *(.*)$/)[0][0])\r\n ret[:Author] = ec.convert(log).scan(/^Author: *(.*)$/)[0][0]\r\n\r\n ret\r\n end",
"title": ""
},
{
"docid": "cc05888dc7f804023a77fb761b5ea093",
"score": "0.54190695",
"text": "def sha1\n @sha1 ||= digest(path, :sha1)\n end",
"title": ""
},
{
"docid": "413be3d6e718325a0dadb95df670e192",
"score": "0.5417844",
"text": "def to_hash\n {\n :name => repository.name,\n :status => status,\n :sha1 => (current_build && current_build.sha1),\n :compare => (current_build && current_build.compare)\n }\n end",
"title": ""
},
{
"docid": "176c1e67821a647950416b507d1da180",
"score": "0.541548",
"text": "def to_hash\n {\n 'git' => @git,\n 'ref' => @ref\n }\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "70bd31778f231ccb898d4499c508ff37",
"score": "0.0",
"text": "def set_fdisk\n @fdisk = Fdisk.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60310465",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.60152966",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.5920606",
"text": "def setup_actions\n domain = @apps.domain\n path_user = '/a/feeds/'+domain+'/user/2.0'\n path_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n path_email_list = '/a/feeds/'+domain+'/emailList/2.0'\n path_group = '/a/feeds/group/2.0/'+domain\n\n @apps.register_action(:domain_login, {:method => 'POST', :path => '/accounts/ClientLogin' })\n @apps.register_action(:user_create, { :method => 'POST', :path => path_user })\n @apps.register_action(:user_retrieve, { :method => 'GET', :path => path_user+'/' })\n @apps.register_action(:user_retrieve_all, { :method => 'GET', :path => path_user })\n @apps.register_action(:user_update, { :method => 'PUT', :path => path_user +'/' })\n @apps.register_action(:user_delete, { :method => 'DELETE', :path => path_user +'/' })\n @apps.register_action(:nickname_create, { :method => 'POST', :path =>path_nickname })\n @apps.register_action(:nickname_retrieve, { :method => 'GET', :path =>path_nickname+'/' })\n @apps.register_action(:nickname_retrieve_all_for_user, { :method => 'GET', :path =>path_nickname+'?username=' })\n @apps.register_action(:nickname_retrieve_all_in_domain, { :method => 'GET', :path =>path_nickname })\n @apps.register_action(:nickname_delete, { :method => 'DELETE', :path =>path_nickname+'/' })\n @apps.register_action(:group_create, { :method => 'POST', :path => path_group })\n @apps.register_action(:group_update, { :method => 'PUT', :path => path_group })\n @apps.register_action(:group_retrieve, { :method => 'GET', :path => path_group })\n @apps.register_action(:group_delete, { :method => 'DELETE', :path => path_group })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>'' })\n end",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5912896",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5912896",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.5898134",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5887081",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.5876557",
"text": "def define_action_helpers\n if action == :save\n if super(:create_or_update)\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a80b33627067efa06c6204bee0f5890e",
"score": "0.5860066",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.5807812",
"text": "def setup_actions\n domain = @apps.domain\n path_base = '/a/feeds/emailsettings/2.0/'+domain+'/'\n\n @apps.register_action(:create_label, {:method => 'POST', :path => path_base })\n @apps.register_action(:create_filter, { :method => 'POST', :path => path_base })\n @apps.register_action(:create_send_as, { :method => 'POST', :path => path_base })\n @apps.register_action(:update_webclip, { :method => 'PUT', :path => path_base })\n @apps.register_action(:update_forward, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_pop, { :method => 'PUT', :path => path_base })\n @apps.register_action(:set_imap, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_vacation, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_signature, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_language, { :method => 'PUT', :path =>path_base })\n @apps.register_action(:set_general, { :method => 'PUT', :path =>path_base })\n\n # special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n @apps.register_action(:next, {:method => 'GET', :path =>nil })\n end",
"title": ""
},
{
"docid": "33ff963edc7c4c98d1b90e341e7c5d61",
"score": "0.57404715",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57310694",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.5715928",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5701527",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.569245",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.5669733",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.56503016",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5648064",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5636733",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5623887",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56089544",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.559635",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5595486",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.55868655",
"text": "def api_action!(*args)\n type = self.class.name.split(\"::\").last.downcase\n run_callbacks_for([\"before_#{type}\", :before], *args)\n result = nil\n begin\n result = yield if block_given?\n run_callbacks_for([\"after_#{type}\", :after], *args)\n result\n rescue => err\n run_callbacks_for([\"failed_#{type}\", :failed], *(args + [err]))\n raise\n end\n end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55584484",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55584484",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.5507632",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.55033326",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5466339",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.54640555",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.54472816",
"text": "def testCase_001\n test_case_title # fw3_actions.rb\n setup # fw3_global_methods.rb\n \n get_page_url # fw3_actions.rb\n validate_page_title # fw3_actions.rb\n validate_page_link_set # fw3_actions.rb\n \n teardown # fw3_global_methods.rb\nend",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.54455507",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.54398936",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.5415934",
"text": "def testCase_001\n testTitle # fw2_actions.rb\n setup # fw2_global_methods.rb\n get_page_url # fw2_actions.rb\n validate_title # fw2_actions.rb\n teardown # fw2_global_methods.rb\nend",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.54",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394463",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394463",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5391065",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5388469",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5376582",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5355932",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5348422",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53466004",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53451854",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5343858",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5339292",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.532725",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53038853",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.52850133",
"text": "def setup!\n adding_handlers do\n check_arity\n apply_casting\n check_validation\n end\n end",
"title": ""
},
{
"docid": "1e1e48767a7ac23eb33df770784fec61",
"score": "0.52815986",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.5257178",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.5257024",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.5248709",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5244428",
"text": "def action_awareness\n if action_aware?\n if [email protected]?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5239302",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.5230717",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52270764",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.5222752",
"text": "def setup_actions(domain)\n\t\t\tpath_user = '/a/feeds/'+domain+'/user/2.0'\n\t\t\tpath_nickname = '/a/feeds/'+domain+'/nickname/2.0'\n\t\t\tpath_group = '/a/feeds/group/2.0/'+domain # path for Google groups\n\n\t\t\taction = Hash.new\n\t\t\taction[:domain_login] = {:method => 'POST', :path => '/accounts/ClientLogin' }\n\t\t\taction[:user_create] = { :method => 'POST', :path => path_user }\n\t\t\taction[:user_retrieve] = { :method => 'GET', :path => path_user+'/' }\n\t\t\taction[:user_retrieve_all] = { :method => 'GET', :path => path_user } \n\t\t\taction[:user_update] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_rename] = { :method => 'PUT', :path => path_user +'/' }\n\t\t\taction[:user_delete] = { :method => 'DELETE', :path => path_user +'/' }\n\t\t\taction[:nickname_create] = { :method => 'POST', :path =>path_nickname }\n\t\t\taction[:nickname_retrieve] = { :method => 'GET', :path =>path_nickname+'/' }\n\t\t\taction[:nickname_retrieve_all_for_user] = { :method => 'GET', :path =>path_nickname+'?username=' }\n\t\t\taction[:nickname_retrieve_all_in_domain] = { :method => 'GET', :path =>path_nickname }\n\t\t\taction[:nickname_delete] = { :method => 'DELETE', :path =>path_nickname+'/' }\n\t\t\taction[:group_create] = { :method => 'POST', :path =>path_group }\n\t\t\taction[:group_update] = { :method => 'PUT', :path =>path_group+'/' }\n\t\t\taction[:group_delete] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:groups_retrieve] = { :method => 'GET', :path =>path_group+'?member=' }\n\t\t\taction[:all_groups_retrieve] = { :method => 'GET', :path =>path_group }\n\t\t\taction[:membership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:membership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:membership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_members_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:ownership_add] = { :method => 'POST', :path =>path_group+'/' }\n\t\t\taction[:ownership_remove] = { :method => 'DELETE', :path =>path_group+'/' }\n\t\t\taction[:ownership_confirm] = { :method => 'GET', :path =>path_group+'/' }\n\t\t\taction[:all_owners_retrieve] = { :method => 'GET', :path =>path_group+'/' }\n\t\n\t\t\t# special action \"next\" for linked feed results. :path will be affected with URL received in a link tag.\n\t\t\taction[:next] = {:method => 'GET', :path =>nil }\n\t\t\treturn action \t\n\t\tend",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.5222485",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.52205867",
"text": "def process_params\n set_params_authable if process_params_authable?\n set_params_ownerable if process_params_ownerable?\n set_params_sub_action\n end",
"title": ""
},
{
"docid": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.52127427",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.52127236",
"text": "def proceed_with(action, *arguments)\n self.class.decouplings.each do |decoupler|\n decoupler.run_on(self, action, *arguments)\n end\n end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.520801",
"text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.5204501",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "2aba2d3187e01346918a6557230603c7",
"score": "0.5204178",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.52039874",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.52032334",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5198697",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51944995",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51944995",
"text": "def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"title": ""
},
{
"docid": "7fca702f2da4dbdc9b39e5107a2ab87d",
"score": "0.51913106",
"text": "def add_transition_callbacks\n %w(before after).each {|type| owner_class.define_callbacks(\"#{type}_transition_#{attribute}\") }\n end",
"title": ""
},
{
"docid": "063b82c93b47d702ef6bddadb6f0c76e",
"score": "0.5178707",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51781213",
"text": "def setup( *args )\n\t\t\tself.class.setupMethods.each {|sblock|\n\t\t\t\tself.send( sblock )\n\t\t\t}\n\t\tend",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5163576",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5152934",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.5142308",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.51392764",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51391184",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51387095",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.51351416",
"text": "def setup\n make_notification_owner\n load_superusers\n admin_sets.each do |as|\n @logger.debug \"Attempting to make admin set for #{as}\"\n make_admin_set_from_config(as)\n end\n load_workflows\n everyone_can_deposit_everywhere\n give_superusers_superpowers\n end",
"title": ""
},
{
"docid": "f2ac709e70364fce188bb24e414340ea",
"score": "0.5115222",
"text": "def setup_defaults\n add_help\n @handler = Cliqr::Util.forward_to_help_handler if @handler.nil? && help? && actions?\n @actions.each(&:setup_defaults)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.51131564",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.51114494",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.51055247",
"text": "def perform_action(action, item)\n if action == :approve\n approve(item.fullid)\n elsif action == :remove\n remove(item.fullid)\n elsif action == :alert\n #perform_alert() check condition alert params and proceed\n else\n #something isn't cool, pass or error \n end\nend",
"title": ""
},
{
"docid": "f04fd745d027fc758dac7a4ca6440871",
"score": "0.5102995",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.50979155",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50949734",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "076c761e1e84b581a65903c7c253aa62",
"score": "0.5091706",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
e780beb8cb4490c4e9e7fb24a8f5c50e
|
Sets the attribute session_options
|
[
{
"docid": "c230bd1d7a826af6db9a354b3e2a1ff2",
"score": "0.7768559",
"text": "def session_options=(_arg0); end",
"title": ""
}
] |
[
{
"docid": "ad127269b0fd815751e139053b39e230",
"score": "0.7953743",
"text": "def session_options\n @session_options ||= {}\n end",
"title": ""
},
{
"docid": "75ceb44e8f01390829831168d086f498",
"score": "0.7758569",
"text": "def session_options; end",
"title": ""
},
{
"docid": "dbeb05fe29aa42d7a4f844a576b289d9",
"score": "0.7725395",
"text": "def options_with_session(options={})\n options.merge(session: @session)\n end",
"title": ""
},
{
"docid": "c12775c8d09a18d5f970343e707fe514",
"score": "0.7172672",
"text": "def set_session(sid, session, options)\n raise '#set_session not implemented.'\n end",
"title": ""
},
{
"docid": "3743ef8be233fadf9a14971dca7ef260",
"score": "0.71461695",
"text": "def set_session(env, sid, session, options)\n raise '#set_session not implemented.'\n end",
"title": ""
},
{
"docid": "94fb13dc8d90fb8b1625e3c39e2f4f04",
"score": "0.70538485",
"text": "def set_session(env, sid, session_data, options)\n session_data = super\n session_data.delete(:timestamp)\n marshal(session_data, options)\n end",
"title": ""
},
{
"docid": "3ca2ffa5209f2dfcb6e02efd1bd65dea",
"score": "0.69799",
"text": "def options(*args)\n reset! unless integration_session\n integration_session.__send__(:process, :options, *args).tap do\n copy_session_variables!\n end\n end",
"title": ""
},
{
"docid": "e0ad1c1b880e1fbcb1a90184531d1f5a",
"score": "0.6956915",
"text": "def options\n @req.roda_class.opts[:sessions]\n end",
"title": ""
},
{
"docid": "1e8a98f35ab9b43957d0b6da15981452",
"score": "0.692237",
"text": "def set_session(env, sid, session, options)\n nil\n end",
"title": ""
},
{
"docid": "eecc5144f20de8d2c322a9a98383163b",
"score": "0.684835",
"text": "def options(*args)\n integration_session.__send__(:process, :options, *args).tap do\n copy_session_variables!\n end\n end",
"title": ""
},
{
"docid": "f18bdcff30a7eac084f767d06488adb3",
"score": "0.68480563",
"text": "def set_session(_, sid, session, options)\n merged = options.to_hash.merge!(@options) {|_, old, _| old}\n key = key_from(sid, merged)\n if session\n @client.put(key, Aerospike::Bin.new(merged[:bin], session), expiration: merged[:expire_after])\n else\n @client.delete(key)\n end\n sid\n end",
"title": ""
},
{
"docid": "a021ade1bab9c49cbe2dff0a7274cf8b",
"score": "0.68330556",
"text": "def set_session_options!\n @env['rack.session.options'] = {} unless @env['rack.session.options']\n @env['rack.session.options'][:domain] = if @options[:use_subdomain]\n @options[:default_domain] ? @options[:default_domain] : unlocalized_host\n else\n @request.host\n end\n end",
"title": ""
},
{
"docid": "03360f9462495cd64c7d1cf7f1d9f881",
"score": "0.67664236",
"text": "def session_options\n session_persistence_enabled? && component_session[:options] || {}\n end",
"title": ""
},
{
"docid": "90eb09d5e019482faceaa09a7b5d20e0",
"score": "0.67139894",
"text": "def update_session_options(hash)\n if session_persistence_enabled?\n component_session.deep_merge!(:options => hash)\n else\n logger.debug \"Netzke warning: No session persistence enabled for component '#{global_id}'\"\n end\n end",
"title": ""
},
{
"docid": "0649fd24eb7079a8f628cad4dc90d424",
"score": "0.6636854",
"text": "def set_session\n \n end",
"title": ""
},
{
"docid": "146e0f29bc29effc2753ba32f55808b7",
"score": "0.6611112",
"text": "def set_session\n \n end",
"title": ""
},
{
"docid": "1dff8d9f8a912f30c3b14b9bdf83a82b",
"score": "0.6554579",
"text": "def set_session\n\tend",
"title": ""
},
{
"docid": "9b372bccdfd4a337e48721528341b8ad",
"score": "0.65327233",
"text": "def set_options(options); end",
"title": ""
},
{
"docid": "9645a99e9754438e1fcd1a0dee84cd07",
"score": "0.6474478",
"text": "def set_session(session)\n @session = session\n end",
"title": ""
},
{
"docid": "ec8edc290bcdcf9b77462a69fe1b4adc",
"score": "0.64215875",
"text": "def set_session_enabled_state(opts)\n opts = check_params(opts,[:session_states])\n super(opts)\n end",
"title": ""
},
{
"docid": "f5c9ecb6802fb2668b5d76178c4c4a43",
"score": "0.63694125",
"text": "def session_override\n persistence_options.try { |opts| opts[:session] } || Threaded.session_override\n end",
"title": ""
},
{
"docid": "24fba10d34f50503d2a2616f9e003134",
"score": "0.63582635",
"text": "def session=(session)\n @session = session\n self\n end",
"title": ""
},
{
"docid": "16e170a652007d503d9f419a7e1a5ec4",
"score": "0.6347244",
"text": "def set_options(options)\n @options = options\n self\n end",
"title": ""
},
{
"docid": "e1f4f55822cbbc51badc67de94af8d4e",
"score": "0.6344576",
"text": "def options=(opts)\n @@options = opts\n end",
"title": ""
},
{
"docid": "5f4524ee18908459e3ba62bcddb8f7e6",
"score": "0.632572",
"text": "def session=(session)\n @session = session\n self\n end",
"title": ""
},
{
"docid": "2409bbb64b78b546200f010f6f94806d",
"score": "0.63208157",
"text": "def session=(session)\n @session = session\n end",
"title": ""
},
{
"docid": "d255df1a06e82e3155412a9ac494a9f2",
"score": "0.6314452",
"text": "def options=(options)\n @options ||= {}\n @options = @options.merge! options\n end",
"title": ""
},
{
"docid": "24c4a5440847d4e8e181eb9692d957d5",
"score": "0.63057095",
"text": "def options=(value)\n @@options = value\n end",
"title": ""
},
{
"docid": "24c4a5440847d4e8e181eb9692d957d5",
"score": "0.63057095",
"text": "def options=(value)\n @@options = value\n end",
"title": ""
},
{
"docid": "60930116f3929c1bda6e392d323b9f6b",
"score": "0.6273214",
"text": "def add_options(options)\n options.keys.each do |key| \n raise GoogleAnalyticsParameterNotFoundError, \"Parameter '#{key}'\" unless GA_PARAMS[key]\n end\n \n @sessionopts.merge!(options)\n self\n end",
"title": ""
},
{
"docid": "c975f1a24c3d1d78e54e5a5af752659f",
"score": "0.623175",
"text": "def options_for_request(attributes)\n fail AuthenticationError unless attributes[:session]\n {\n session: attributes[:session]\n }\n end",
"title": ""
},
{
"docid": "ba47e1eee7fd94b21c9fc519224e99c6",
"score": "0.6231705",
"text": "def ssl_options=(options); end",
"title": ""
},
{
"docid": "62c422801b95570be71fd8edd6d4cf83",
"score": "0.6197487",
"text": "def session=(hash)\n data = {\n 'session_data' => session_manipulation_config.encoder.encode(hash)\n }\n driver_method_fallback(:put, session_manipulation_config.path, data)\n end",
"title": ""
},
{
"docid": "617ed64d02b95c218ec6e346f928503a",
"score": "0.6186803",
"text": "def configure_session\n validate_winrm_options!\n resolve_session_options\n resolve_target_nodes\n session_from_list\n end",
"title": ""
},
{
"docid": "0b66bdb1a622a722c7c5f36273477114",
"score": "0.61655384",
"text": "def options=(value)\n @@options.merge!(value)\n end",
"title": ""
},
{
"docid": "0481fe4559b5af9fa9765448cdf6a699",
"score": "0.61583346",
"text": "def set_puma_options(options)\n @puma_options = options\n end",
"title": ""
},
{
"docid": "0481fe4559b5af9fa9765448cdf6a699",
"score": "0.61583346",
"text": "def set_puma_options(options)\n @puma_options = options\n end",
"title": ""
},
{
"docid": "3665f0695a6d60a8aa658806f8b8478f",
"score": "0.6123076",
"text": "def _run_options(options)\n options.merge(request_ip: request.ip, session: session, current_user: current_user)\n end",
"title": ""
},
{
"docid": "d3c8837d7adc6ddced85b5f9e7305d2f",
"score": "0.611805",
"text": "def set_options\n @options = Option.get_options\n end",
"title": ""
},
{
"docid": "56ec99c541fee7ce6a4b4e8423596a7b",
"score": "0.60993093",
"text": "def initialize session\n FRONTEND_SESSION_FIELDS.each { |field|\n instance_eval %Q{ @#{field} = session.#{field} }\n }\n # deep copy for settings\n @settings = session.settings.dup\n @session = session\n end",
"title": ""
},
{
"docid": "337c897010811309ead69a1f7009f190",
"score": "0.60846967",
"text": "def set_options(options)\n options_inst = Utils.splitOptions(options)\n setOptions(options_inst)\n end",
"title": ""
},
{
"docid": "337c897010811309ead69a1f7009f190",
"score": "0.60846967",
"text": "def set_options(options)\n options_inst = Utils.splitOptions(options)\n setOptions(options_inst)\n end",
"title": ""
},
{
"docid": "253e84014402827432be50b46e34c059",
"score": "0.6072407",
"text": "def initialize name, options = {}\n super # will set all instance vars using options hash\n @cache = cache\n @cache.configure_with :type => :memory\n raise \"SessionCache must be initialized with a :session option\" if !session\n session[cache_key] = @cache\n end",
"title": ""
},
{
"docid": "87e5102c4acf936c5b7c89f526c1d1b3",
"score": "0.60677665",
"text": "def set_session_override(value)\n session[:mobylette_override] = value\n end",
"title": ""
},
{
"docid": "14e90966cdd023eb968c608e2472d07b",
"score": "0.606266",
"text": "def _set_sessions(value)\n @_sessions = value\n include ActionController::Session if value\n end",
"title": ""
},
{
"docid": "1f569cf6d317f56c642de08f48f7252b",
"score": "0.6057186",
"text": "def options=(options)\n options.each do |k,v|\n instance_variable_set(:\"@#{k}\",v)\n end\n end",
"title": ""
},
{
"docid": "f641095254521d467a7c67ee7d2ed37c",
"score": "0.6043512",
"text": "def set_session_data(env, sid, session, options = {})\n return false if session.empty?\n packed_session = pack_data(session)\n handle_error(env) do\n save_opts = update_opts(env, sid, packed_session, options)\n @config.dynamo_db_client.update_item(save_opts)\n sid\n end\n end",
"title": ""
},
{
"docid": "cf55ec3ac26303e596e5ccf2638d34a5",
"score": "0.6041771",
"text": "def rack_session=(_); end",
"title": ""
},
{
"docid": "74e70ba763d0f534dd57f1e030af6223",
"score": "0.603878",
"text": "def enable_sessions; end",
"title": ""
},
{
"docid": "b98e9e207480a3672883b0ba3967f5af",
"score": "0.6026224",
"text": "def initialize(session, options={})\n # This is just some optimization since this is called over and over and over\n if self.use_rack_session\n super # MUST call super for Rack sessions\n return true\n elsif self.use_cgi_session\n find_or_create_session(session.session_id)\n else\n version ||= Rails.version.split('.')\n if version[0].to_i == 2 && version[1].to_i < 3\n find_or_create_session(session.session_id)\n self.use_cgi_session = true\n else\n super # MUST call super for Rack sessions\n self.use_rack_session = true\n end\n end\n end",
"title": ""
},
{
"docid": "b8acbce6e4389f0ecb562164f0c8923a",
"score": "0.60226387",
"text": "def options=(options)\n if options.respond_to? :deep_symbolize_keys\n options = options.deep_symbolize_keys\n end\n write_attribute(:options, options)\n end",
"title": ""
},
{
"docid": "6c6c9858382505783f503eadc564de20",
"score": "0.6019056",
"text": "def options=(opts)\n\t\t\[email protected]!(opts)\n\t\tend",
"title": ""
},
{
"docid": "38b6eb136d321243730b3e8c0887e073",
"score": "0.6017832",
"text": "def set_session_enabled_state(opts)\n opts = check_params(opts,[:states])\n super(opts)\n end",
"title": ""
},
{
"docid": "2dd7e9d9c00c5bcee1ba34c8aec588ff",
"score": "0.5994764",
"text": "def set_Session(value)\n set_input(\"Session\", value)\n end",
"title": ""
},
{
"docid": "90cd9a80eb75ad6ee15c9deb82dafd40",
"score": "0.5990517",
"text": "def setup_sessions(builder)\n if sessions.kind_of?(Hash) && sessions[:use]\n builder.use sessions[:use], sessions[:config] || {}\n else\n super\n end\n end",
"title": ""
},
{
"docid": "da7ddc85ce467d13b2669d1b1dad9ae1",
"score": "0.5987181",
"text": "def set_session(env, sid, data, options)\n if @data != data || @sid != sid\n ::File.write path(sid), Serializer.dump( [ data, get_expiry(options) ] )\n end\n sid\n end",
"title": ""
},
{
"docid": "db48683f1a85b48280f793b371dbd1ea",
"score": "0.5957118",
"text": "def session=(key, val)\n res = super(key, val)\n Thread.current[:session] = res\n end",
"title": ""
},
{
"docid": "9a2bab1713bafa499ce650425c734f81",
"score": "0.5955706",
"text": "def set(**options)\n log \"Adding options: #{options}\"\n @options.merge! options\n end",
"title": ""
},
{
"docid": "461b792c4ddf548e9e427a0a7be766a2",
"score": "0.59467524",
"text": "def set(options)\n @options.merge!(options)\n self\n end",
"title": ""
},
{
"docid": "610360262c7e2659baf014b228eb8d1f",
"score": "0.59335124",
"text": "def initialize(session, option = nil)\n session_id = session.session_id\n unless @session = @@session_class.get(session_id)\n unless session.new_session\n raise CGI::Session::NoSession, 'uninitialized session'\n end\n @session = @@session_class.new(:session_id => session_id)\n \n # session saving can be lazy again, because of improved component implementation\n # therefore next line gets commented out:\n # @session.save\n\n # clean up old sessions\n @@session_class.all(:updated_at.lt => -1.days.from_now).destroy!\n end\n end",
"title": ""
},
{
"docid": "900222b53c2bb9f2e4e36a985ef31351",
"score": "0.5905234",
"text": "def initialize(session, options = {})\n # The session_key option is required.\n if options['session_key'].blank?\n raise ArgumentError, 'A session_key is required to write a cookie containing the session data. Use config.action_controller.session = { :session_key => \"_myapp_session\", :secret => \"some secret phrase\" } in config/environment.rb'\n end\n\n # The secret option is required.\n ensure_secret_secure(options['secret'])\n\n # Keep the session and its secret on hand so we can read and write cookies.\n @session, @secret = session, options['secret']\n\n # Message digest defaults to SHA1.\n @digest = options['digest'] || 'SHA1'\n\n # Default cookie options derived from session settings.\n @cookie_options = {\n 'name' => options['session_key'],\n 'path' => options['session_path'],\n 'domain' => options['session_domain'],\n 'expires' => options['session_expires'],\n 'secure' => options['session_secure']\n }\n\n # Set no_hidden and no_cookies since the session id is unused and we\n # set our own data cookie.\n options['no_hidden'] = true\n options['no_cookies'] = true\n end",
"title": ""
},
{
"docid": "3dfbe4fb5114e86d69c4390c1411f555",
"score": "0.59048325",
"text": "def set_config! options\n\t\t\t@@options = {}\n\t\t\toptions.each do |k,v|\n\t\t\t\t@@options[k.to_sym] = v\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "269e6792836995deb26c22907489c4d3",
"score": "0.5874775",
"text": "def session_id\n @options[:session_id]\n end",
"title": ""
},
{
"docid": "987b466d569c951026d3deb5d491f4a0",
"score": "0.5868987",
"text": "def options=(options)\n @options = Config.new(options)\n end",
"title": ""
},
{
"docid": "91996efc1af602975649e19e9226928c",
"score": "0.58634144",
"text": "def set_session_domain\n ::ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update(:session_domain => \"#{@request.subdomains.first}.#{@request.domain}\")\n end",
"title": ""
},
{
"docid": "13f34b5b27987338e61d8f6eed8e7e8c",
"score": "0.58590084",
"text": "def set_session_context\n @session_context = @app.build_session_context\n end",
"title": ""
},
{
"docid": "5cf2a1114e9e76a39113a4e980b8bd5a",
"score": "0.5857999",
"text": "def set_session_setting(key, value)\n if session[:settings].nil?\n session[:settings] = {}\n end\n\n session[:settings][key.to_sym] = value\n end",
"title": ""
},
{
"docid": "1adb6d9a45bc9ec46e119d3aa2d21bd5",
"score": "0.5839257",
"text": "def set_options(**opts)\n opts.each{|var, opt| self.instance_variable_set \"@#{var}\".to_sym, opt }\n end",
"title": ""
},
{
"docid": "b886521f36dca942fe379d632b874be1",
"score": "0.58319235",
"text": "def set_options(options)\n @options = {\n :handler => nil, # Autodetect\n :port => 9000\n }.update(options)\n \n self.port = @options[:port]\n self.handler = @options[:handler] \n end",
"title": ""
},
{
"docid": "974e7f635c296007a588b1d6f5211328",
"score": "0.58315563",
"text": "def set_option(options)\n @options.merge! options\n end",
"title": ""
},
{
"docid": "7f97293025b1702fa0e517806e78912e",
"score": "0.58291894",
"text": "def settings_session_timeout_in_minutes=(value)\n @settings_session_timeout_in_minutes = value\n end",
"title": ""
},
{
"docid": "d6538d8dcb9faeacccb9aad52d21d808",
"score": "0.57978463",
"text": "def extra_options=(options)\n @options = options\n end",
"title": ""
},
{
"docid": "be97fb30a42df46c9d57377ed09194ec",
"score": "0.57943696",
"text": "def initialize(session, options = {})\n id = session.session_id\n unless check_id(id)\n raise ArgumentError, \"session_id '%s' is invalid\" % id\n \t end\n @cache = options['cache'] || MemCache.new('localhost')\n \t @session_key = \"session:#{id}\"\n \t @hash = {}\n end",
"title": ""
},
{
"docid": "d5c1ead370350c195a900c1c3c82a468",
"score": "0.5789425",
"text": "def set_session(session, client: nil)\n sessions[client] = session\n end",
"title": ""
},
{
"docid": "6b9ea8ff85824155b27d8f0e10a58603",
"score": "0.5776792",
"text": "def options= opts\n @options = opts.is_a?(Hash) ? OpenStruct.new(opts) : opts.dup\n end",
"title": ""
},
{
"docid": "58ff2caec17df04a3dd6d006f1d96570",
"score": "0.577652",
"text": "def set_session\n @session = current_session || Session.new\n end",
"title": ""
},
{
"docid": "353d1944dc1027534f41f382d665594c",
"score": "0.5763062",
"text": "def set_options(options)\n\n # Set defaults and merge in the user supplied ones.\n @options = {\n :port => 6667,\n :user => 'ircbase',\n :realname => 'IRCBase v0.1'\n }\n @options.merge! options\n\n # Do some post-processing.\n @options[:port] = @options[:port].to_i\n\n end",
"title": ""
},
{
"docid": "b1799e01d02dae62be89c3dbbd24f8ce",
"score": "0.57594717",
"text": "def setup\n @env = { ActionController::Session::AbstractStore::ENV_SESSION_KEY => '123456', ActionController::Session::AbstractStore::ENV_SESSION_OPTIONS_KEY => ActionController::Session::AbstractStore::DEFAULT_OPTIONS}\n end",
"title": ""
},
{
"docid": "c724b47c136ebc848bded8efc7ee1fed",
"score": "0.57526505",
"text": "def set_session(session_id, name, value)\n @session[session_id][name] = value\n end",
"title": ""
},
{
"docid": "648144a4c42e6a66991dec3d7fb6245c",
"score": "0.5750866",
"text": "def auth_session=(value)\n @children['auth-session'][:value] = value\n end",
"title": ""
},
{
"docid": "588432be5f38f01741e63b08dd56cf29",
"score": "0.57439566",
"text": "def set_session(env, sid, session, options)\n key = cache_key(sid)\n if session\n if env[PREVIOUS_SESSION] != session\n # try our write_cas call\n if cas = @cache.write_cas(key, session, env[CAS_ID],\n expires_in: options[:expire_after])\n # write worked, update our cas and our session clone\n env[CAS_ID] = cas\n env[PREVIOUS_SESSION] = session.clone\n else\n # TODO - if we see this happen a lot (or even at all) we could do\n # something like fetching from memcached again to get a new cas and\n # use that cas to write. we'd then have to be able to diff our\n # changes to the session and apply them to a potentially different\n # session, not a simple task. for now we can wait to see if it's an\n # issue or not before diving down that rabbit hole.\n whine \"couldn't write session #{key} with cas=#{env[CAS_ID]}\"\n\n # if we get a falsey value then our CAS_ID is no good so zero it out\n env[CAS_ID] = 0\n end\n else\n Rails.logger.debug \"session #{sid} unchanged, not writing\"\n end\n else\n unless @cache.delete_cas(key, env[CAS_ID])\n whine \"couldn't delete session #{key} with cas=#{env[CAS_ID]}\" unless env[CAS_ID].blank?\n env[CAS_ID] = 0\n end\n end\n sid\n end",
"title": ""
},
{
"docid": "be854269b49e11c02f09085a887ba475",
"score": "0.5743106",
"text": "def session=(*args)\n if current_subdomain\n request.session[current_subdomain_symbol] ||= {}\n request.session[current_subdomain_symbol] = args\n else\n request.session = args\n end\n end",
"title": ""
},
{
"docid": "b3f65f1b2569f7420df2abd3aa7e1f63",
"score": "0.5741509",
"text": "def session=( new_session )\n\t\tnew_session.namespace = self.session_namespace if new_session.respond_to?( :namespace )\n\t\t@session = new_session\n\tend",
"title": ""
},
{
"docid": "04604dd5668b7a41d36118cdf9d9b6f3",
"score": "0.5730293",
"text": "def set_session\n session[:show_valid_only] = true if session[:show_valid_only].nil?\n end",
"title": ""
},
{
"docid": "f5fa1b43c309f953535c0a1880c9f76f",
"score": "0.5726387",
"text": "def setup_options(options = {})\n @options = options\n end",
"title": ""
},
{
"docid": "f5fa1b43c309f953535c0a1880c9f76f",
"score": "0.5726387",
"text": "def setup_options(options = {})\n @options = options\n end",
"title": ""
},
{
"docid": "3725efec984530bdeddf746dd61ae537",
"score": "0.572464",
"text": "def session_id=(value)\n @session_id = value\n end",
"title": ""
},
{
"docid": "c54cdb645405cbb8d3ec45f515f731ad",
"score": "0.5723735",
"text": "def set(options); end",
"title": ""
},
{
"docid": "c54cdb645405cbb8d3ec45f515f731ad",
"score": "0.5723735",
"text": "def set(options); end",
"title": ""
},
{
"docid": "4f721c09bee6d18028ab7b4a270d0cb5",
"score": "0.57230574",
"text": "def active_session=(mod)\n\t\tdriver.active_session = mod\n\tend",
"title": ""
},
{
"docid": "4f721c09bee6d18028ab7b4a270d0cb5",
"score": "0.57230574",
"text": "def active_session=(mod)\n\t\tdriver.active_session = mod\n\tend",
"title": ""
},
{
"docid": "4f721c09bee6d18028ab7b4a270d0cb5",
"score": "0.57230574",
"text": "def active_session=(mod)\n\t\tdriver.active_session = mod\n\tend",
"title": ""
},
{
"docid": "2e71d3c16cfc1320ec0823919cb22991",
"score": "0.57128155",
"text": "def set(options)\n parse_options options\n end",
"title": ""
},
{
"docid": "2e71d3c16cfc1320ec0823919cb22991",
"score": "0.57128155",
"text": "def set(options)\n parse_options options\n end",
"title": ""
},
{
"docid": "fdbd45695a2ffc7863008f89729e21c4",
"score": "0.5711723",
"text": "def options=(options)\n if options.nil?\n fail ArgumentError, 'invalid value for \"options\", options cannot be nil.'\n end\n @options = options\n end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.57110476",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.57110476",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.57110476",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.57110476",
"text": "def options=(_); end",
"title": ""
},
{
"docid": "22c7e65c4f95dc44a544718133198363",
"score": "0.57110476",
"text": "def options=(_); end",
"title": ""
}
] |
dc63669d2ed0c8a56d1eebce5b2a8953
|
TODO: Refine this list to get the most useful quotes
|
[
{
"docid": "781c223618e1ce67f89f8ed40a73e501",
"score": "0.0",
"text": "def quote_bag\n QuoteBag.new quotes\n end",
"title": ""
}
] |
[
{
"docid": "72162247e69da47019dbc1df1b5b615d",
"score": "0.7813891",
"text": "def quotes; end",
"title": ""
},
{
"docid": "8a17314603fce87d8d470eee09e2cd64",
"score": "0.7415617",
"text": "def quotes\n end",
"title": ""
},
{
"docid": "02b2c07c7787fedb38ab6b29c6fb93dc",
"score": "0.73273915",
"text": "def quotes\n fetch('community.quotes')\n end",
"title": ""
},
{
"docid": "205ab1be5547145a3b48d76702764906",
"score": "0.71966726",
"text": "def quote\n fetch('the_office.quotes')\n end",
"title": ""
},
{
"docid": "2fd0af13fdc74395af5d4143a40317dd",
"score": "0.70918524",
"text": "def quote\n fetch('dumb_and_dumber.quotes')\n end",
"title": ""
},
{
"docid": "8cbc7e540f0e570b7e5f3da0fc988ca4",
"score": "0.708035",
"text": "def quote\n fetch('brooklyn_nine_nine.quotes')\n end",
"title": ""
},
{
"docid": "29477acd0382f26e0d6951aa493ffb73",
"score": "0.7079124",
"text": "def quote\n fetch('ghostbusters.quotes')\n end",
"title": ""
},
{
"docid": "ae0cc4dfbf8c2e4821c216727dd5a6cc",
"score": "0.70506006",
"text": "def quote\n fetch('final_space.quotes')\n end",
"title": ""
},
{
"docid": "5b33a80827ce6777c191e35b2a468175",
"score": "0.69843054",
"text": "def quote\n fetch('rick_and_morty.quotes')\n end",
"title": ""
},
{
"docid": "1ca4dde55f160b17017f4ce5c42ce010",
"score": "0.69408983",
"text": "def marvin_quote; end",
"title": ""
},
{
"docid": "a37b6d48eeac6918c220bf834922f58a",
"score": "0.6875846",
"text": "def quote\n fetch('stargate.quotes')\n end",
"title": ""
},
{
"docid": "216598c6b20de614a504e70260c56b3d",
"score": "0.6873879",
"text": "def quote\n fetch('harry_potter.quotes')\n end",
"title": ""
},
{
"docid": "7873f7c71c62ad8c2475536647b51712",
"score": "0.6870673",
"text": "def quote\n fetch('princess_bride.quotes')\n end",
"title": ""
},
{
"docid": "a00ff9a841e90b55c9beba225dafcfd8",
"score": "0.6835458",
"text": "def quote\n fetch('v_for_vendetta.quotes')\n end",
"title": ""
},
{
"docid": "7fac01f8fbbcd9a47e8364e57e22ae2e",
"score": "0.6832146",
"text": "def quotes\n @@quotes and return @@quotes\n\n # Hash with quotes for all (according to Tapeinos) known languages.\n quotes = {\n de: ['„', '“'],\n fr: ['«', '»']\n }\n\n # Default quotes to use. Format [opening, closing].\n default = ['“', '”']\n\n # Actually selects the correct quotes and falls back if needed.\n @@quotes = (quotes[I18n.locale] || default)\n end",
"title": ""
},
{
"docid": "73d52d48811e6879c607b3f7683511bd",
"score": "0.68144846",
"text": "def quote\n fetch('simpsons.quotes')\n end",
"title": ""
},
{
"docid": "29326d0a31adde41a738c3768ea77645",
"score": "0.67833537",
"text": "def quote_names\n @feed_quote_map.values \n end",
"title": ""
},
{
"docid": "c0e81446aaeee46ebf197d5f8fff9f9b",
"score": "0.67812914",
"text": "def quote\n quote_of_the_day[0...second_to_last_index(quote_of_the_day, \"~\")].gsub(/(\\A[^a-zA-z0-9\"']*|\\s*\\z)/, \"\")\n end",
"title": ""
},
{
"docid": "60e7a894c84295542aa9671c2df7a1ef",
"score": "0.67612064",
"text": "def king_richard_iii_quote; end",
"title": ""
},
{
"docid": "ce41591eb2afc34ab66739513377ff15",
"score": "0.6643808",
"text": "def quote\n fetch('new_girl.quotes')\n end",
"title": ""
},
{
"docid": "6ea2afbca694cea818af95fe2e60fff4",
"score": "0.6628546",
"text": "def parse_smart_quotes; end",
"title": ""
},
{
"docid": "21efbb2db5e3d88b94ba3272f069524e",
"score": "0.6627788",
"text": "def quote\n fetch('hey_arnold.quotes')\n end",
"title": ""
},
{
"docid": "672144338e35a8351d27175e66f9e04b",
"score": "0.65692866",
"text": "def quote\n fetch('heroes_of_the_storm.quotes')\n end",
"title": ""
},
{
"docid": "965693b9b29b03478b6b831e7a128d87",
"score": "0.6539963",
"text": "def quoted_string; end",
"title": ""
},
{
"docid": "95ae9fb94712327b38a52b9d7ff89953",
"score": "0.64846855",
"text": "def as_you_like_it_quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "2858941c804209e2a4602e0fed183acf",
"score": "0.64499474",
"text": "def quote; end",
"title": ""
},
{
"docid": "6ed0037f55bb3361b5b6921550a8b723",
"score": "0.6432423",
"text": "def quote\n @quote ||= quote_hash\n end",
"title": ""
},
{
"docid": "5f1184cb90e694d03b57ed7ad00c0c9b",
"score": "0.6403994",
"text": "def romeo_and_juliet_quote; end",
"title": ""
},
{
"docid": "0e3dba93b57267a0ef11bdbc815d6bfe",
"score": "0.64030296",
"text": "def get_quote_info(quotes = '')\n\tret = Hash.new\n\tYahooFinance::get_quotes(YahooFinance::StandardQuote, quotes) do |qt|\n\t\tret[qt.symbol] = qt\n\tend\n\treturn ret\nend",
"title": ""
},
{
"docid": "669b57bc7ff5d023de5d5123e3f9a786",
"score": "0.63964236",
"text": "def possible_quote_strings(commodity: nil)\n raise \"No commodity given\" if commodity.nil?\n # We get all quotes in USD\n [\"#{commodity}=X\", \"USD#{commodity}=X\", \"#{commodity}\"]\n end",
"title": ""
},
{
"docid": "b90b39c6378725a65ce491b6e8e92106",
"score": "0.635508",
"text": "def my_quote\n\tend",
"title": ""
},
{
"docid": "5d24d703e5deda22868461c7d521b3a0",
"score": "0.6322338",
"text": "def read_quotes\n tmp_quotes = []\n f = File.open(QUOTE_FILE, 'r')\n f.each_line do |line|\n tmp_quotes << line\n end\n f.close\n return tmp_quotes\n end",
"title": ""
},
{
"docid": "e066f8716750780f433b341ebefb932a",
"score": "0.6250881",
"text": "def random_quote\r\n print Scraper.quotes(self.url).sample\r\n end",
"title": ""
},
{
"docid": "2f32b7cbf0dca9fdacf23c8b8ffcff8e",
"score": "0.6186163",
"text": "def quote\n fetch('games.street_fighter.quotes')\n end",
"title": ""
},
{
"docid": "96f240cd03a7bd38ed0f15739cff89ac",
"score": "0.6167446",
"text": "def range_single_quotes\n [ range(:single_quotes) ]\n end",
"title": ""
},
{
"docid": "788777f49c821d6697e02db010dc10dd",
"score": "0.61601615",
"text": "def parse_quotes_tableful\n change_endpoint(:tableful)\n result = []\n table = browser.table\n update_action_log(:table, !table.nil? && table.respond_to?(:trs))\n table = table.trs[1...-1]\n update_action_log(:trs, !table.nil? && !table.empty?)\n\n page = 1\n loop do\n table.each_with_index do |tr, i|\n next if i.odd?\n quote, author = table[i].text.split(' Author: ')\n result.push({\n text: quote,\n author: author,\n tags: table[i + 1].text.split[1..-1]\n })\n end\n page += 1\n browser.goto(base_url + ENDPOINTS[:tableful] + \"/page/#{page}\")\n break if browser.text.include?('No quotes found')\n end\n result\n end",
"title": ""
},
{
"docid": "4e13adb4bf516d27b57e2fb3708af7bc",
"score": "0.6159345",
"text": "def quote\n fetch('cowboy_bebop.quote')\n end",
"title": ""
},
{
"docid": "185ceab85007bd7dc8dab1579ce0e2ed",
"score": "0.611868",
"text": "def quote\n fetch('movie.quote')\n end",
"title": ""
},
{
"docid": "6b113a6ab0edb921406ea0b174a4c64b",
"score": "0.6100064",
"text": "def quotes\n body.scan(/^> /).collect { |q| q.sub(/^(> *)*/, '') }\n end",
"title": ""
},
{
"docid": "1de6fcd281d8a813a25598c016823720",
"score": "0.6093826",
"text": "def quotations\n response = self.class.get('/quotations', OPTIONS)\n\n if response.success?\n parse_quotations(response)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "7ca08eb10a2f2b1ce4253777c19faba9",
"score": "0.6064865",
"text": "def quotelist( *args )\n\t\t\treturn args.flatten.collect {|part| part =~ /\\s/ ? part.inspect : part}\n\t\tend",
"title": ""
},
{
"docid": "a62f6b161f608397b0cbe12bfd877831",
"score": "0.605469",
"text": "def random_quote\n quote = @db.get_first_value(\"SELECT quote FROM quotes ORDER BY RANDOM() LIMIT 1;\")\n return quote\n end",
"title": ""
},
{
"docid": "04e09542d2a48c78e87c8cffcd98280c",
"score": "0.6050263",
"text": "def quote\n %q[(?:\"|')?]\n end",
"title": ""
}
] |
c0cf1c6aa6900cde05fe5d132795f76a
|
Loads configurations from yaml
|
[
{
"docid": "5580abbf2dd50ae4cde768cf9df38a15",
"score": "0.0",
"text": "def load()\n\n # Get the project root directory\n @root_dir = locate_root\n\n if File.file? File.join(@root_dir, SETTINGS_FILE)\n settings = YAML.load_file File.join(@root_dir, SETTINGS_FILE)\n @targets = settings[:targets]\n @src = settings[:src]\n @notify = settings[:notify]\n else\n puts \"No settings file found, creating one now\"\n # Settings file doesn't exist\n # Create it\n @targets = {}\n @active_target = nil\n @src = './src'\n @notify = true\n\n dump_settings\n end\n\n # Set the default target\n @targets.values.each do |target|\n # Check if this one is active\n if target.active == true\n # Set it if there is no default target set yet\n if @active_target == nil\n @active_target = target\n else\n puts \"Two active targets set. Using #{@active_target.print}\"\n end\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "0d6b678af2a27f10c776961810efdaf1",
"score": "0.76481",
"text": "def load_config_from_yaml(path)\n config = load_config(path)\n\n # validate loaded yaml data\n validate_config config\n\n config.each do |key, value|\n Mihari.config.send(\"#{key.downcase}=\".to_sym, value)\n end\n end",
"title": ""
},
{
"docid": "75168b5263e46571f2bdbfcfcaba1fc7",
"score": "0.7542113",
"text": "def config_for_yaml(opts = {})\n path = opts[:yaml] || fixture('app_config.yml')\n config_for({ yaml: path }.merge(opts))\n end",
"title": ""
},
{
"docid": "0c9e0b2f5ad2a9fb6bc6c0f41ef802cf",
"score": "0.7477651",
"text": "def load_yaml\n if has_file? \"#{name}.yml\"\n YAML.load_file(path / \"#{name}.yml\").apply_to self\n end\n end",
"title": ""
},
{
"docid": "b7ba218cd3e5034ac5593e0781c3c238",
"score": "0.7469179",
"text": "def load_config\n YAML::load_file(File.join(__dir__, '../config/config.yml'))\n end",
"title": ""
},
{
"docid": "5332f1f0436627769bf915d8cbcdbbaf",
"score": "0.7425483",
"text": "def yaml\n parse_yaml_string(yaml_string(config_file), config_file)\n end",
"title": ""
},
{
"docid": "5f5c44bd508de1071f940cf9571128b9",
"score": "0.7386945",
"text": "def load_config(config_file)\n YAML.load(File.open(config_file))\nend",
"title": ""
},
{
"docid": "5220fb53d19d8c06092c3bd113507845",
"score": "0.73682445",
"text": "def load_config_file\n require 'yaml'\n YAML.load_file(@path)\n rescue Errno::ENOENT\n return\n end",
"title": ""
},
{
"docid": "64f2042977e9ebfb8561d5622c8679f8",
"score": "0.7356608",
"text": "def load_yaml(filename); end",
"title": ""
},
{
"docid": "c6773b36c089b296878c14a978f7758b",
"score": "0.73071355",
"text": "def load\n config_files.each do |file|\n config = YAML::load(File.open(file))\n @config.merge! config\n end\n end",
"title": ""
},
{
"docid": "12282d34023df8d5f1d9db403b4d14ab",
"score": "0.7254759",
"text": "def load_config\n config_data = File.read(app_config_file)\n YAML.load(config_data) || {}\n end",
"title": ""
},
{
"docid": "3a5bb942669e91dbb53ced87f0f54210",
"score": "0.7199802",
"text": "def load_config( filename )\n\n fullname = \"#{Rails.application.root}/config/#{filename}\"\n begin\n config_erb = ERB.new( IO.read( fullname ) ).result( binding )\n rescue StandardError => ex\n raise( \"#{filename} could not be parsed with ERB. \\n#{ex.inspect}\" )\n end\n\n begin\n yml = YAML.load( config_erb )\n rescue Psych::SyntaxError => ex\n raise \"#{filename} could not be parsed as YAML. \\nError #{ex.message}\"\n end\n\n config = yml.symbolize_keys\n @configuration = config[ Rails.env.to_sym ].symbolize_keys || {}\n end",
"title": ""
},
{
"docid": "5737f069e3c673a3136c56883e8520cf",
"score": "0.71974534",
"text": "def loadyaml(filename) YAML.load_file(filename) end",
"title": ""
},
{
"docid": "5cc3cf4012b7a0520a9db001cfd74a83",
"score": "0.71327925",
"text": "def config\n\tYAML.load(File.open(\"config.yaml\"))\nend",
"title": ""
},
{
"docid": "60f7621b1ab2a07b41d8458af0530473",
"score": "0.71273273",
"text": "def load_config(filename)\n yml = YAML.load_file(filename)\n yml.each do |key, value| \n next if key == 'Templates'\n\n if key == 'PackageDirs'\n # PackageDirs.register value\n elsif key == 'AppDirs' \n # ApplicationDirMatcher.register value\n else\n app_matcher.register value\n end \n end\n end",
"title": ""
},
{
"docid": "42c804d08ea8617380de32c783476f4f",
"score": "0.70620537",
"text": "def load_yaml(base=ENV['PWD'], env=\"active\")\n env = \"dev\" if env == \"active\" and not File.exist? \"#{base}/opt/active\"\n @data = ::YAML.load_file(\"#{base}/opt/#{env}/config.yaml\")\n end",
"title": ""
},
{
"docid": "e6deaa36c78df0ee60a436abd09f6785",
"score": "0.70516527",
"text": "def config_for name\n yaml = SpaceScrape.root.join 'config', \"#{ name }.yml\"\n\n unless yaml.exist?\n raise \"Could not load configuration. No such file - #{ yaml }\"\n end\n\n erb = ERB.new(yaml.read).result\n erbd_yaml = YAML.load erb\n\n erbd_yaml[SpaceScrape.environment.to_s] || {}\n rescue YAML::SyntaxError => e\n raise \"YAML syntax error occurred while parsing #{ yaml }. \" \\\n \"Please note that YAML must be consistently indented using spaces. Tabs are not allowed. \" \\\n \"Error: #{ e.message }\"\n end",
"title": ""
},
{
"docid": "f497d24bffca0301cda36e5a3538c630",
"score": "0.70113575",
"text": "def yml_config\n return @yml_config if @yml_config\n\n require 'yaml'\n data = File.open(options[:config_path]).read\n\n require 'erb'\n data = ERB.new(data).result(binding)\n\n @yml_config ||= YAML.load(data)\n end",
"title": ""
},
{
"docid": "84d9a4131581e4c8e91dfe4f84d61e00",
"score": "0.7005364",
"text": "def load_yaml(path, environment = nil)\n env = environment ? environment.to_s : env_name\n\n contents = File.read(path)\n if contents.empty?\n raise Mongoid::Errors::EmptyConfigFile.new(path)\n end\n\n # These are the classes that can be used in a Mongoid\n # configuration file in addition to standard YAML types.\n permitted_classes = [\n # Symbols occur as values for read preference, for example.\n Symbol,\n # BSON::Binary occur as keyId values for FLE (more precisely,\n # the keyIds are UUIDs).\n BSON::Binary,\n ]\n\n result = ERB.new(contents).result\n data = if RUBY_VERSION < '2.6'\n YAML.safe_load(result, permitted_classes, [], true)\n else\n YAML.safe_load(result, permitted_classes: permitted_classes, aliases: true)\n end\n\n unless data.is_a?(Hash)\n raise Mongoid::Errors::InvalidConfigFile.new(path)\n end\n\n data[env]\n end",
"title": ""
},
{
"docid": "be7c5652ef607ca74e2294f7aa56177a",
"score": "0.7004519",
"text": "def yaml_config\n IceNine.deep_freeze(YAML.load_file(config_file)) if config_file.file?\n end",
"title": ""
},
{
"docid": "3cfb9b15129732bc0e5b34d501ee85a8",
"score": "0.6994817",
"text": "def load_config name\r\n path = File.join(DeployConfig, name + \".yml\")\r\n return YAML::load(File.open(path))\r\n end",
"title": ""
},
{
"docid": "3a6b6dbbf518c6263e0bf7e8c43ab171",
"score": "0.6993336",
"text": "def load_config(file)\n @config = YAML.load_file(file)\n end",
"title": ""
},
{
"docid": "a390373e356540b5889ae368fa06d4de",
"score": "0.69868565",
"text": "def config_from_yaml(file)\n build_data = Pkg::Util::Serialization.load_yaml(file)\n config_from_hash(build_data)\n end",
"title": ""
},
{
"docid": "16b3347cd0ceb225bf8230c08fbc96fc",
"score": "0.6975594",
"text": "def yaml_config\n IceNine.deep_freeze(YAML.load_file(config_file)) if config_file.file?\n end",
"title": ""
},
{
"docid": "75709e12b1f6ba20b40ce6e77737032f",
"score": "0.695842",
"text": "def load_database_yaml; end",
"title": ""
},
{
"docid": "75709e12b1f6ba20b40ce6e77737032f",
"score": "0.695842",
"text": "def load_database_yaml; end",
"title": ""
},
{
"docid": "e81b6ea82c5c256780c48717f594de89",
"score": "0.6949819",
"text": "def load_yaml(yaml_file)\n @options = YAML.load_file(yaml_file)\n end",
"title": ""
},
{
"docid": "1faf1ae35e315688421543382cce5c38",
"score": "0.69318646",
"text": "def load_from_yaml(file)\n document_lines = File.readlines(file)\n\n headers = document_lines.enum_for(:each_with_index).\n find_all { |line, _| line =~ /^---/ }\n if headers.empty? || headers.first[1] != 0\n headers.unshift [\"--- name:default\", -1]\n end\n\n options = headers.map do |line, line_number|\n line_options = Hash.new\n line = line.chomp\n line.split(/\\s+/)[1..-1].each do |opt|\n if opt =~ /^(\\w+):(.*)$/\n line_options[$1] = $2\n else\n raise ArgumentError, \"#{file}:#{line_number}: wrong format #{opt}, expected option_name:value, where 'value' has no spaces\"\n end\n end\n line_options['merge'] = (line_options['merge'] == 'true')\n line_options['chain'] = (line_options['chain'] || '').split(',')\n [line_options, line_number]\n end\n options[0][0]['name'] ||= 'default'\n\n options.each do |line_options, line_number|\n if !line_options['name']\n raise ArgumentError, \"#{file}:#{line_number}: missing a 'name' option\"\n end\n end\n\n sections = []\n options.each_cons(2) do |(_, line0), (_, line1)|\n sections << document_lines[line0 + 1, line1 - line0 - 1]\n end\n sections << document_lines[options[-1][1] + 1, document_lines.size - options[-1][1] - 1]\n\n changed_sections = []\n @conf_options = options\n\n sections.each_with_index do |doc, idx|\n doc = doc.join(\"\")\n doc = evaluate_dynamic_content(file, doc)\n\n result = YAML.load(StringIO.new(doc))\n\n conf_options = options[idx].first\n name = conf_options.delete('name')\n changed = in_context(\"while loading section #{name} of #{file}\") do\n add(name, result || Hash.new, conf_options)\n end\n\n if changed\n changed_sections << name\n end\n end\n\t if !changed_sections.empty?\n\t \t@merged_conf.clear\n\t end\n changed_sections\n rescue Exception => e\n raise e, \"error loading #{file}: #{e.message}\", e.backtrace\n end",
"title": ""
},
{
"docid": "b19516e1228e294002b5a70c74ec8e2b",
"score": "0.6907095",
"text": "def load_yml(filename); end",
"title": ""
},
{
"docid": "ecc186b45fd295e2b4efe64575785b56",
"score": "0.69065464",
"text": "def configure_by_yaml(path=nil)\n unless path\n # Display file explorer\n path = Qt::FileDialog.getOpenFileName(self, \"Open configuration file\", \".\", \"YAML Files (*.yml *.yaml)\")\n end\n\n begin \n # Load configuration from YAML\n hash = YAML.load(open(path))\n \n # Sanity checks:\n error = nil\n \n if hash.keys.max > @container_hash.keys.max\n error = \"Higher position value in file than #containers available.\"\n elsif hash.size > @container_hash.size\n error = \"More config items in file than containers available.\"\n end\n \n if error\n msg_box = Qt::MessageBox.new\n msg_box.set_text(\"Problem with YAML import:\")\n msg_box.set_informative_text(error)\n msg_box.exec\n return\n end\n \n # Disconnect, update configuration and connect for each container\n hash.each do |pos, config|\n container = @container_hash[pos]\n container.disconnect\n container.configure_by_obj(config)\n container.connect if config\n end\n rescue Exception => e\n Vizkit.error \"A problem occured while trying to open '#{path}': \\n#{e.message}\"\n Vizkit.error e.backtrace.inspect \n end\n end",
"title": ""
},
{
"docid": "088a358acbbb7662d4724d4fe03b4694",
"score": "0.6893458",
"text": "def load config_file\n YAML.load_file(config_file).each do |parameter,value|\n instance_variable_set( \"@#{parameter}\", value )\n end\n end",
"title": ""
},
{
"docid": "6dc47947e2fb4d05cce2dc726f245fbf",
"score": "0.6870431",
"text": "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend",
"title": ""
},
{
"docid": "6dc47947e2fb4d05cce2dc726f245fbf",
"score": "0.6870431",
"text": "def yaml_load filename\n yaml_string = File.read filename\n\n YAML::load yaml_string\nend",
"title": ""
},
{
"docid": "019f54c515fe7e27514224c7eace7ebf",
"score": "0.6858658",
"text": "def load_yaml(filename)\n\t\tpath = File.realpath(filename)\n\t\tdata = YAML.load_file(path)\n\t\tload_hash(data)\n\tend",
"title": ""
},
{
"docid": "da1a8c9a148a4fe572d66c8c76c8e6ff",
"score": "0.6854509",
"text": "def load_config\n create_yolo_dir\n unless File.exist?(yaml_path)\n @formatter.config_created(yaml_path)\n FileUtils.cp_r(File.dirname(__FILE__) + \"/config.yml\", yaml_path)\n end\n end",
"title": ""
},
{
"docid": "6029e3bf2c2711dcad7f4f73f1c197b2",
"score": "0.6845397",
"text": "def yaml\n @yaml ||= YAML.load_file path\n rescue StandardError\n {}\n end",
"title": ""
},
{
"docid": "5be22ac531c7241e1cb5ac0cfa2f470c",
"score": "0.68337923",
"text": "def configure_with(path_to_yaml_file)\n if path_to_yaml_file\n begin\n config = YAML.load(IO.read(path_to_yaml_file))\n rescue Errno::ENOENT\n @log.warn(\n \"YAML configuration file couldn\\'t be found at \" \\\n \"#{path_to_yaml_file}. Using defaults.\")\n return @config\n rescue Psych::SyntaxError\n @log.warn(\n 'YAML configuration file contains invalid syntax. Using defaults.')\n return @config\n end\n else\n config = {}\n end\n\n configure(config)\n end",
"title": ""
},
{
"docid": "6aa3a81ed636ba662fe577eb15e9e8c9",
"score": "0.6829713",
"text": "def load_settings\n attributes = YAML.load_file(\"defaults.yml\")\n begin\n custom_attributes = YAML.load_file(\"config.yml\")\n attributes = simple_deep_merge(attributes, custom_attributes)\n rescue\n end\n attributes\nend",
"title": ""
},
{
"docid": "a67310c0870fb559a25ec629908a1b87",
"score": "0.68031317",
"text": "def load_config\n config_file = File.join(Dir.home, \".assemblotron\")\n if File.exists? config_file\n @log.debug \"config file found at #{config_file}\"\n config = YAML::load_file(config_file)\n if config.nil?\n @log.warn \"config file malformed or empty\"\n return\n end\n @config = config.deep_symbolize\n end\n end",
"title": ""
},
{
"docid": "49d710bb53407c03408a4d30185d5b6f",
"score": "0.6796896",
"text": "def parse_yaml(filename)\n @config_file = filename\n begin\n @configuration = YAML::load_file(filename)\n rescue => ex\n STDERR.puts \"Couldn't find config file #{filename}\"\n STDERR.puts ex\n STDERR.puts ex.backtrace\n exit(1)\n end\n end",
"title": ""
},
{
"docid": "15b0615799422b6d4250767e0b7a4147",
"score": "0.6771925",
"text": "def config_load(config); end",
"title": ""
},
{
"docid": "c6645da65ced1baada9be113ccdef849",
"score": "0.67704225",
"text": "def load_config_file( filename )\n\n begin\n config_erb = ERB.new( IO.read( filename ) ).result( binding )\n rescue StandardError => ex\n raise( \"#{filename} could not be parsed with ERB. \\n#{ex.inspect}\" )\n end\n\n begin\n yml = YAML.load( config_erb )\n rescue Psych::SyntaxError => ex\n raise \"#{filename} could not be parsed as YAML. \\nError #{ex.message}\"\n end\n\n config = yml.symbolize_keys\n return config.symbolize_keys || {}\n end",
"title": ""
},
{
"docid": "1284f07990eb4d291a89ef3406cb59b3",
"score": "0.676799",
"text": "def load_config(config_file)\n begin\n $test_config=YAML::load(YAML::load_file(config_file))\n rescue Exception => e\n puts \"Error: #{e} while loading the configuration file, please specify valid yaml file\"\n end\n end",
"title": ""
},
{
"docid": "ad58a2214610480ac308c62e2364c5d1",
"score": "0.67656165",
"text": "def load_config\n input_file_paths =\n YAML.load_file('config/input_file_paths.yml')\n input_file_paths['input_file_paths'].each do |_, input_file_path|\n start input_file_path\n end\n end",
"title": ""
},
{
"docid": "5897a9e1c63f04634c55067e1f468754",
"score": "0.6761582",
"text": "def fetch_config\n Rails.logger.debug \"Loading #{@file}::#{@env}\" if Object.const_defined?('Rails') && Rails.logger.present?\n YAML::load_file(@file)[@env.to_s]\n end",
"title": ""
},
{
"docid": "d33c49470c2c57e6868d55c0e00d22e1",
"score": "0.6759009",
"text": "def read_config_file\n config_path = File.expand_path(File.dirname(__FILE__)+\"/../../\")\n YAML.load_file(\"#{config_path}/config/#{@type}/config.yaml\")\n end",
"title": ""
},
{
"docid": "42846fd924b4616b44a330f7d80026f8",
"score": "0.6737769",
"text": "def load_config!\n return unless options.empty?\n\n data = ::YAML.load_file(File.open(\"#{directory.path}/supernova.yml\", \"r\"))\n load_paths.push(*data.fetch(\"load_paths\", []))\n\n load_paths.map! do |path|\n File.absolute_path(path, directory.path)\n end\n\n @options = data\n end",
"title": ""
},
{
"docid": "f98359a3622304038ee9cad57ee296f2",
"score": "0.67341775",
"text": "def load_config(file_path)\n file = File.read(File.expand_path(file_path, __FILE__))\n yaml = YAML.load(file)\n \n # set new options\n options.keys.each do |option|\n set_option(option, yaml[option]) if !yaml[option].nil?\n end\n \n # set new settings\n settings.keys.each do |setting|\n set(setting, yaml[setting]) if !yaml[setting].nil?\n end\n end",
"title": ""
},
{
"docid": "b597b83f5a2543179b0a3774b3ab9aae",
"score": "0.67263126",
"text": "def read_config!\n @config = YAML.load_file(CONFIG_FILE)\n end",
"title": ""
},
{
"docid": "cd0c7880e5e120ecd78d378a21b09ff5",
"score": "0.6722399",
"text": "def load_configuration\n @config = {\n :start_date => Date.today - 1,\n :data_dir => default_data_dir\n }\n\n if File.exist?(config_file)\n @config = YAML.load_file(config_file)\n end\n\n @config\n end",
"title": ""
},
{
"docid": "b01555990b08971118b2834da400490d",
"score": "0.6718017",
"text": "def from_yaml(text)\n if config = YAML.load(text)\n return config\n end\n end",
"title": ""
},
{
"docid": "83465203becb97018f1eae0ddddddad9",
"score": "0.67174363",
"text": "def load\n $LOG.debug \"Config::load\"\n\n filepath = cfgFilePath(\"pdconfig.yml\")\n if(!File.exists?( filepath )) # TODO: This needs to be moved into KtCfg.\n $LOG.debug \"Config file does not exist. Returning default config obj.\"\n return @cfg\n end\n\n @cfg = read(\"pdconfig.yml\")\n end",
"title": ""
},
{
"docid": "79334c38ba7fe9052957d1f079de864e",
"score": "0.6708482",
"text": "def parse_config \n path = \"#{Rails.root}/config/mebla.yml\"\n return unless File.exists?(path)\n \n conf = YAML::load(ERB.new(IO.read(path)).result)[Rails.env]\n \n conf.each do |key,value|\n self.send(\"#{key}=\", value) if self.respond_to?(\"#{key}=\")\n end unless conf.nil?\n end",
"title": ""
},
{
"docid": "b0336521f2f86eadb990251a015d9842",
"score": "0.6683421",
"text": "def load_yaml(path)\n YAML.load_file File.expand_path(\"../#{path}\", File.dirname(__FILE__))\n end",
"title": ""
},
{
"docid": "759f3cfe3767b092e799339a0165dab6",
"score": "0.6682013",
"text": "def data\n YAML::load_file(files[:config])\n end",
"title": ""
},
{
"docid": "3139700a2241063bb553cf86d0f3bec5",
"score": "0.6668757",
"text": "def load\n unless File.exist?(config_file)\n fail \"YAML file #{config_file} does not exist. Try 'bento-qemu init'.\"\n end\n @config = YAML.load_file(config_file)\n end",
"title": ""
},
{
"docid": "084b309835ea42db6f8fb60af87191a8",
"score": "0.66423553",
"text": "def configure\n load_all_configs \n end",
"title": ""
},
{
"docid": "be12bfc92aec704ac38f1a5bccf68fb6",
"score": "0.66338086",
"text": "def load_file(path)\n @configuration_data = YAML.load_file(path)[CONFIGURATION_KEY]\n end",
"title": ""
},
{
"docid": "91396265bf47bf283429f4d82f258792",
"score": "0.6625674",
"text": "def load\n if File.file?(@file_name)\n File.open(@file_name, 'r') do |file|\n YAML::load(file)\n end\n else\n default\n end\n end",
"title": ""
},
{
"docid": "37881eb823d8ea5917faf2d80a43d15d",
"score": "0.6613442",
"text": "def config\n @config ||= YAML.load_file(@config_file_path)\n end",
"title": ""
},
{
"docid": "4498d5ef9c3196312b70d2613eee55e0",
"score": "0.660258",
"text": "def load_settings\n @settings = YAML::load(File.new(config_file, 'r'))\n end",
"title": ""
},
{
"docid": "342c40e6783a31dca9ce5122daf522ba",
"score": "0.660225",
"text": "def load_config\n cfg = File.open(CONFIG) { |yf| YAML::load( yf ) } if File.exists?(CONFIG)\n # => Ensure loaded data is a hash. ie: YAML load was OK\n if cfg.class != Hash\n raise \"ERROR: Configuration - invalid format or parsing error.\"\n else\n if cfg['login'].nil?\n raise \"ERROR: Configuration: login not defined.\"\n end\n end\n\n return cfg\nend",
"title": ""
},
{
"docid": "a13711a724e33b8f52103334d25726db",
"score": "0.6600326",
"text": "def load_config(config_file)\n @config = YAML.load_file config_file\n @config = Hashie::Mash.new(@config) if @config\n\n Booru.import_config @config.booru\n end",
"title": ""
},
{
"docid": "e231136b3cecc3051f5b32e369ac7353",
"score": "0.65948915",
"text": "def load_yaml_files\n @room_list = YAML.load_file(__dir__ + '/rooms.yml')\n @weapon_list = YAML.load_file(__dir__ + '/weapons.yml')\n @enemy_list = YAML.load_file(__dir__ + '/enemy.yml')\n @high_score_list = YAML.load_file(__dir__ + '/high_score.yml')\n end",
"title": ""
},
{
"docid": "09f4266e6a1d25a29c61c685a1e34a62",
"score": "0.65847296",
"text": "def load\n yaml = YAML.load_file(@file_path)\n yaml.each {|k, v| interpolate_setting(yaml, v)}\n settings = OpenStruct.new\n add_hash(settings, yaml)\n\n @lock.synchronize do\n @yaml = yaml\n @settings = settings\n end\n rescue\n puts \"Failed to load file: #{@file_path}\\n#{$!}\"\n end",
"title": ""
},
{
"docid": "00b93f915a56ce179e8d886a3632208d",
"score": "0.65830225",
"text": "def load_config_file\n \tproject_name = ENV['PROJECT_NAME']\n \tconfig_file_path = \"#{@configs_folder_path}#{project_name}.yaml\"\n\tif !File.exists?(config_file_path)\n log_message(\"No '#{project_name}.yaml' file found in configs directory.\")\n exit\n end\n @config = YAML.load_file(config_file_path)\n end",
"title": ""
},
{
"docid": "95aa9ae20e2b0bb23998b6e5025e92c1",
"score": "0.6580224",
"text": "def from_config\n config ||= YAML::load(File.open((File.join(File.dirname(__FILE__), 'config.yml'))))\nend",
"title": ""
},
{
"docid": "d4172d2f49478a496de53fc1368b2236",
"score": "0.65781766",
"text": "def load()\n\n checkFileExists()\n loadConfigs()\n checkConfigs() \n end",
"title": ""
},
{
"docid": "efbcc8e65bbe475ad2a3812b11d1dec2",
"score": "0.65653086",
"text": "def read_configuration\n\t\t@config = YAML.load_file(\"config.yml\")\n\t\treturn @config\n\tend",
"title": ""
},
{
"docid": "020e11d92038f426b6bf54be3a8b94cb",
"score": "0.65548545",
"text": "def yaml(*files, **options, &block) = read(*files, parse: :yaml, ext: ['.yml', '.yaml'], **options, &block)",
"title": ""
},
{
"docid": "64578383682afc4ad3d224112e0b91a1",
"score": "0.6553689",
"text": "def from_yaml\n YAML.load(self)\n end",
"title": ""
},
{
"docid": "155a7808196c89fb3aba5246d5ecaea3",
"score": "0.654203",
"text": "def load_yaml(path) # Path must be in /data\n # path must be a yaml file path\n YAML.load_file(File.join(__dir__, \"../data/#{path}.yml\"))\n # YAML keys will be allways strings (never symbols)\n # Returns hash of values (strings)\nend",
"title": ""
},
{
"docid": "7fd63fd96e200b02244eb9bf96f68e61",
"score": "0.6537126",
"text": "def parse_config\n %w(/etc/steel/steel.yml steel.yml).each do |cfg|\n if File.exist?(cfg)\n begin\n y = YAML.load_file(cfg)\n rescue Psych::SyntaxError => e\n error \"[#{e.class}] Failed to parse '#{cfg}'!!\"\n error e.message\n exit 1\n end\n # Merge the contents of the config into @config.\n config.merge!(y)\n end\n end\n end",
"title": ""
},
{
"docid": "9e7523476dfa069a692dabde76405ad5",
"score": "0.6536896",
"text": "def load_from_yaml(file, cache_dir: nil)\n sections = self.class.load_raw_sections_from_file(file)\n\n changed_sections = []\n sections.each do |conf_options, doc|\n doc = doc.join(\"\")\n doc = evaluate_dynamic_content(file, doc)\n\n if cache_dir\n cache_id, cached_yaml = read_yaml_from_cache(cache_dir, doc)\n end\n unless cached_yaml\n loaded_yaml = YAML.load(StringIO.new(doc)) || Hash.new\n end\n\n begin\n result = normalize_conf(cached_yaml || loaded_yaml || Hash.new)\n rescue ConversionFailed => e\n raise e, \"while loading section #{conf_options[:name] || 'default'} #{e.message}\", e.backtrace\n end\n\n if cache_id && !cached_yaml\n save_yaml_to_cache(cache_dir, cache_id, loaded_yaml)\n end\n\n name = conf_options.delete(:name)\n chain = conf(conf_options.delete(:chain), true)\n result = Orocos::TaskConfigurations.merge_conf(result, chain, true)\n changed = in_context(\"while loading section #{name} of #{file}\") do\n add(name, result, normalize: false, **conf_options)\n end\n\n if changed\n changed_sections << name\n end\n end\n\t if !changed_sections.empty?\n\t \t@merged_conf.clear\n\t end\n changed_sections\n rescue Exception => e\n raise e, \"error loading #{file}: #{e.message}\", e.backtrace\n end",
"title": ""
},
{
"docid": "30a5651603b42a566cad98587eb13a92",
"score": "0.6534237",
"text": "def load!(filename)\n config_file = File.open(filename).read\n config = YAML.load(config_file)\n raise ConfigError(\"unable to load config file #{filename}\") unless config\n @_config = config\n end",
"title": ""
},
{
"docid": "90aa6285741e0e3afe45e5600bc71745",
"score": "0.6533297",
"text": "def load_app_config\n user_configs = read_yaml_file(USER_CONFIGS)\n environment_configs = Maybe(ENV).or_else({})\n\n # Order: user, env\n config_order = [user_configs, environment_configs]\n\n configs = config_order.inject { |a, b| a.merge(b) }\n OpenStruct.new(configs.symbolize_keys)\n end",
"title": ""
},
{
"docid": "a1c798d33f1ce9f4d64c7619ad0ed3e7",
"score": "0.6516622",
"text": "def load_yml(yml_file)\n if File.exist?(yml_file)\n yml_cfg = OpenStruct.new(YAML.load_file(yml_file))\n yml_cfg.jira_properties.each do |k, v|\n instance_variable_set(\"@#{k}\", v)\n end\n else\n raise StandardError, \"unable to find yml config file\"\n end\n end",
"title": ""
},
{
"docid": "c3dba280ebaa92d736cb1351de150605",
"score": "0.65159875",
"text": "def load_yaml(args = {})\n file = File.read(args[:file] || CMUX_YAML)\n yaml = YAML.load(file)\n args[:key] ? yaml[args[:key]] : yaml\n rescue Psych::SyntaxError\n message = \"Make sure you've written #{file} in YAML Simple Mapping.\" \\\n ' Please check README.'\n raise message.red\n end",
"title": ""
},
{
"docid": "7cb0eeaf7b5867f8f5280c68cb233d88",
"score": "0.6515305",
"text": "def load_config(configfile)\n config = YAML.load_file(configfile)\n config.each { |key, value|\n instance_variable_set(\"@#{key}\", value) \n }\n end",
"title": ""
},
{
"docid": "8a3e74227a7662a9ff74bcf71aab948b",
"score": "0.650672",
"text": "def load_config_file\n raise \"No config file set\" if config_file.nil?\n raise \"File #{config_file} does not exist\" unless File.file?(config_file)\n @config = YAML.load_file(config_file)\n @config_file_loaded = true\n @config.each { |k, v| send(\"#{k}=\", v) }\n end",
"title": ""
},
{
"docid": "2da669c89afa09d25d368a2fb70729b9",
"score": "0.64867795",
"text": "def load_config(config_file_path)\n @config_file_path = config_file_path || default_config_file_path\n @ingest_types = {}\n parsed_yaml['ingest_types'].each do |ingest_type, options|\n add_ingest_type_config(ingest_type, options)\n end\n end",
"title": ""
},
{
"docid": "28c0927189f6bcb863bd9d919e426279",
"score": "0.6469494",
"text": "def config\n @config ||= YAML.load File.read(@config_file)\n end",
"title": ""
},
{
"docid": "ffac29b75f60bae5b1c9412d9ba6d4e8",
"score": "0.6462893",
"text": "def load_configuration\n config = options[\"config\"]\n return unless config\n\n Mihari.load_config_from_yaml config\n Database.connect\n end",
"title": ""
},
{
"docid": "07486820e924bb79eb19377c175f4449",
"score": "0.64613426",
"text": "def load_config!\n cfg_data = begin\n YAML.load(File.open(CONFIG_DIR + GLOBAL_CONFIG))\n rescue Errno::ENOENT\n Hash.new\n end\n __load_config(DEFAULTS.merge(cfg_data))\n end",
"title": ""
},
{
"docid": "3f2150dad900ea1c971b91be90f18ad9",
"score": "0.64548934",
"text": "def load_config\n file = root+CONFIG_FILE_NAME\n @config = file.file? ? YAML.load_file(file) : { :shared_directories => [], :core_modules => [] }\n end",
"title": ""
},
{
"docid": "4313414630a15c8922bc718c5f5e5de5",
"score": "0.64528745",
"text": "def load_config\n conf = YAML.load_file(File.expand_path('../config.yml', File.dirname(__FILE__)))\n\n unless %w[basedir master filesync_cert filesync_cert_key filesync_ca_cert].all? { |s| conf.key?(s) && !conf[s].nil? }\n Pem.log_error('Missing required settings in config.yml', @logger)\n raise\n end\n\n conf['envdir'] = \"#{conf['basedir']}/environments\"\n conf['mod_dir'] = \"#{conf['basedir']}/modules\"\n\n return conf\n rescue StandardError\n err = 'Missing config file, or required configuration values - check config.yml'\n Pem.log_error(err, @logger)\n raise(err)\n end",
"title": ""
},
{
"docid": "d9902b05083c5a6450373efe49bb56c0",
"score": "0.64427096",
"text": "def load_config\n if @configfile.nil?\n loader = R10K::Deployment::Config::Loader.new\n @configfile = loader.search\n if @configfile.nil?\n raise ConfigError, \"No configuration file given, no config file found in current directory, and no global config present\"\n end\n end\n begin\n @config = ::YAML.load_file(@configfile)\n apply_config_settings\n rescue => e\n raise ConfigError, \"Couldn't load config file: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "ad6defef8fa34d2e6aae55c828285cac",
"score": "0.6441971",
"text": "def load_yml_config(project)\r\n @saf_env = ENV[\"SAF_ENV\"] || \"default\"\r\n puts(\"SAF_ENV = #{@saf_env}\")\r\n\r\n env_yml_path = File.join(SAF::PROJECTS, project, SAF::PROJECT_ENV_YAML)\r\n\r\n unless File.exist?(env_yml_path) then\r\n # TODO: File not found error class\r\n raise \"#{msg_prefix} > Could not find #{env_yml_path}\"\r\n end\r\n\r\n all_yml_config = YAML.load(File.read(env_yml_path))\r\n # Throw an error if they specified an illegal install key.\r\n unless all_yml_config.key?(@saf_env) then\r\n raise ArgumentError.new(\"#{caller.first}\\n\"\\\r\n \"SAF env #{@saf_env} not found in project \"\\\r\n \"#{project}.\")\r\n end\r\n @yml_config = all_yml_config[@saf_env]\r\n end",
"title": ""
},
{
"docid": "df9e8ad35576cbe84d99cf04630e4c32",
"score": "0.64395094",
"text": "def load(filename, dontValidateDirs = false)\n rc = true\n if File.exists?(filename)\n File.open(filename){ |fh|\n yaml = YAML::load(fh)\n return handleYaml(yaml, dontValidateDirs)\n }\n else\n $logger.info \"Loading config file failed: file '#{filename}' doesn't exist.\"\n end\n rc\n end",
"title": ""
},
{
"docid": "145babda1bb345c09d3bce1d830ee0cc",
"score": "0.6436103",
"text": "def load_yml\n cfg_file=\"#{::Rails.root}/config/mcommunity.yml\"\n\n begin\n mcommunity_erb = ERB.new(IO.read(cfg_file)).result(binding)\n rescue StandardError, SyntaxError => e\n raise(\"#{cfg_file} could not be parsed with ERB. \\n#{e.inspect}\")\n end\n\n begin\n mcommunity_yml = YAML::load(mcommunity_erb)\n rescue => e\n raise(\"#{cfg_file} was found, but could not be parsed.\\n#{e.inspect}\")\n end\n\n if mcommunity_yml.nil? || !mcommunity_yml.is_a?(Hash)\n raise(\"#{cfg_file} was found, but was blank or malformed.\\n\")\n end\n\n begin\n raise \"The #{::Rails.env} environment settings were not found in #{cfg_file}\" unless mcommunity_yml[::Rails.env]\n mcommunity_cfg = mcommunity_yml[::Rails.env].symbolize_keys\n end\n\n mcommunity_cfg\nend",
"title": ""
},
{
"docid": "98c2d124a75c787f7cdba4afbebae5cb",
"score": "0.64355826",
"text": "def load_config\n if @configfile.nil?\n loader = R10K::Deployment::Config::Loader.new\n @configfile = loader.search\n if @configfile.nil?\n raise ConfigError, \"No configuration file given, no config file found in parent directory, and no global config present\"\n end\n end\n begin\n @config = YAML.load_file(@configfile)\n apply_config_settings\n rescue => e\n raise ConfigError, \"Couldn't load config file: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "093946d5fb35b560674aeabd52f44849",
"score": "0.64333415",
"text": "def config\n\t\t\t@config ||= begin\n\t\t\t\tfile = File.join(self.location, \"config.yaml\")\n\t\t\t\tif File.exists?(file)\n\t\t\t\t\tYAML::load_file(file)\n\t\t\t\telse\n\t\t\t\t\t{}\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "d144c7dcc2c5b3dc6dccecc07465e289",
"score": "0.6428243",
"text": "def read_config_files\n load_config_files\n end",
"title": ""
},
{
"docid": "18f3aa4bda15326b916d0560127ec996",
"score": "0.6425478",
"text": "def read_config_file(config_file_path)\r\n raise HarvesterConfigFileNotFound, \"Config file must exist.\" unless File.exists? config_file_path\r\n YAML.load_file(config_file_path)\r\n end",
"title": ""
},
{
"docid": "8dee134432952c00648dd267e6aefe0b",
"score": "0.641823",
"text": "def yaml_load(filename)\n\t\tbegin\n\t\t YAML::load(File.read filename)\n\t\trescue\n\t\t\tputs \"Unable to read from file '#{ filename }'.\"\n\t\t\tnil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3280d9b98a772e69538ad2441e2d0583",
"score": "0.64125055",
"text": "def load config\n \n # TODO better place for this?\n if config['log4r_config']\n ycfg = Log4r::YamlConfigurator\n # ycfg['foo'] = bar # replaces instances of #{foo} in the YAML with bar\n ycfg.load_yaml_string(YAML.dump(config))\n end\n \n # gah - log4r expects strings, so only convert to symbols here\n config.keys_to_symbols!\n \n # load all scrapers, and mix all shared fields into them\n config[:scrapers].each_pair do |group, included|\n \n shared_setup = {}\n scraper_setups = {}\n \n # load setups\n included.each_pair do |key, value|\n target = if is_scraper?(key)\n logger.info \"Loading scraper #{group}::#{key}\"\n scraper_setups\n else\n shared_setup\n end\n\n target[key] = value\n end\n \n # create each scraper when whole setup is present\n scrapers[group] = setup_scrapers(scraper_setups, shared_setup);\n end if config[:scrapers]\n end",
"title": ""
},
{
"docid": "02d65a814e9acaf3bbf6d88a06fbb037",
"score": "0.64123714",
"text": "def yaml_load(file)\n\t\tYAML.load_file(file.to_s)\n\tend",
"title": ""
},
{
"docid": "51136c65511ac4aa013cbc8bcf5716ba",
"score": "0.6408639",
"text": "def load_module_yaml(file_name)\n\t\tFile.open(file_name) { |file| YAML.load(file) }\n\tend",
"title": ""
},
{
"docid": "58b94f9de774d4bd4f1b2b2320fe5fd7",
"score": "0.6407512",
"text": "def load\n @models = []\n\n # \n files = \n if File.directory?(config_path) \n files_in_dir = []\n Dir[config_path + \"/*.yml\"].each do |file|\n files_in_dir << file\n end\n files_in_dir\n elsif File.file?(config_path)\n [config_path]\n else\n nil\n end\n\n return nil if files.nil?\n\n # \n @models = files.inject(@models) do |models, file|\n begin\n yaml = YAML.load_file(file)\n rescue => ex\n logger.debug \"failed in reading yaml (#{file})\"\n next\n end\n if yaml.nil?\n logger.debug \"failed in reading yaml (#{file})\"\n next\n end\n models + yaml2models(yaml)\n end.extend(ArrayMethods)\n end",
"title": ""
},
{
"docid": "09a5804d70de700a8913b466efca0810",
"score": "0.64027774",
"text": "def load_yaml_file file\r\n load_yaml \"parse_file\", file\r\n end",
"title": ""
},
{
"docid": "f5ae4acd28eb90c56e6e8a7821ac8ea7",
"score": "0.6390135",
"text": "def take_yaml(yml)\n @data = YAML.load(yml)\n end",
"title": ""
},
{
"docid": "f5ae4acd28eb90c56e6e8a7821ac8ea7",
"score": "0.6390135",
"text": "def take_yaml(yml)\n @data = YAML.load(yml)\n end",
"title": ""
}
] |
ba582504daeeda4c731a8823efcba555
|
Adds a custom discount to the cart Permissions Needed: SHOPPING_CARTS_ADMIN
|
[
{
"docid": "31f68af94066cddc2da118c48064e360",
"score": "0.6344277",
"text": "def add_custom_discount(id, opts = {})\n add_custom_discount_with_http_info(id, opts)\n return nil\n end",
"title": ""
}
] |
[
{
"docid": "eb560b657a75b2bd383727b5fe4b30fc",
"score": "0.73074657",
"text": "def discount_for cart\n discount_for_fixed(cart) / 100.0\n end",
"title": ""
},
{
"docid": "6fb438d4c18bd542fee5b8ddadbc920b",
"score": "0.7117887",
"text": "def discount\n discount = self[:discount_code].present? ? (self[:subtotal] * 0.1).round(2) : 0\n self[:discount] = discount\n discount\n end",
"title": ""
},
{
"docid": "132d18995ef55cdba70236e01c688825",
"score": "0.6971406",
"text": "def cart_can_create_discount_coupons\n\t\tset_cart unless self.cart\n\t\tself.errors.add(:cart, \"you cannot create discount coupons on this cart\") unless cart.can_create_discount_coupons? \n\tend",
"title": ""
},
{
"docid": "92b790a1303db6d2d6edf69a3ed71ca0",
"score": "0.6857207",
"text": "def apply_discount\n if @discount \n @total = total - (total * (@discount/100.00))\n \"After the discount, the total comes to $#{total.to_i}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "544d9b7524ef5b9889a05de301b7001a",
"score": "0.6826143",
"text": "def apply_discount\n # if the cash register was not initialized with an employee discount\n if discount == 0\n \"There is no discount to apply.\"\n else\n # the cash register was initialized with an employee discount\n # applies the discount to the total price\n # returns success message with updated total\n @total *= (100 - discount).to_f / 100\n \"After the discount, the total comes to $#{total.to_i}.\"\n end\n end",
"title": ""
},
{
"docid": "f3ccdb469a296c919beb819ec97ba100",
"score": "0.6824553",
"text": "def apply_discount\n if discount > 0\n self.total = (total * (100 - discount))/100\n \"After the discount, the total comes to $#{self.total}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "c38247741f526f96716073dbcf5d9565",
"score": "0.6811358",
"text": "def apply_discount\n if discount == 0\n \"There is no discount to apply.\"\n else\n self.total = (total - (total * (discount.to_f/100))).to_i\n \"After the discount, the total comes to $#{self.total}.\"\n end\n end",
"title": ""
},
{
"docid": "3ec58517e83d168aa357447db283273a",
"score": "0.6803806",
"text": "def apply_discount\n if self.discount > 0\n discountIn100 = self.discount / 100\n self.total -= self.total * discountIn100\n p \"After the discount, the total comes to $#{self.total.to_i}.\"\n else\n p \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "4740301abef3978f709945f85f026764",
"score": "0.6801366",
"text": "def apply_discount\n if discount != 0\n self.total = (total * ((100.0 - discount.to_f)/100)).to_i\n \"After the discount, the total comes to $#{self.total}.\"\n \n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "a54fd78a71d815ce4be532785a84c165",
"score": "0.67945075",
"text": "def apply_discount\n if(@discount)\n self.total = @total * ((100.to_f - @discount) / 100 ) \n \"After the discount, the total comes to $#{\"%g\" % (\"%.2f\" % self.total)}.\"\n else \n self.total = @total\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "84f2e2c3a3efce0fe520e32abf6fac7f",
"score": "0.67629886",
"text": "def apply_discount\n total_f = @total.to_f \n discount_f = @discount.to_f\n new_total_f = total_f * ((100.0 - discount_f)/100.0)\n @total = new_total_f.to_i\n @@all_total << @total\n if @discount != 0\n \"After the discount, the total comes to $#{@total}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "0bcd20d3826e2726394786ab852d0aba",
"score": "0.6729608",
"text": "def apply_discount\n if discount == 0\n \"There is no discount to apply.\"\n else\n self.total = self.total * (100 - self.discount) / 100.0\n \"After the discount, the total comes to $#{self.total.to_i}.\"\n end\n end",
"title": ""
},
{
"docid": "5ed9cead16c9a797a121e9fd08b17140",
"score": "0.6726978",
"text": "def apply_discount\n if @discount > 0\n @total -= @total * @discount/100\n \"After the discount, the total comes to $#{@total}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "323cdbcd83e4f9277398bc5547a4de1c",
"score": "0.67239517",
"text": "def apply_discount\n if discount != 0\n self.total = (total * ((100.0 - discount.to_f)/100)).to_i\n \"After the discount, the total comes to $#{self.total}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "324fecba58e98fe9e598dc826b3e730c",
"score": "0.671572",
"text": "def apply_discount()\n if discount != 0\n self.total = (total * ((100.0 - discount.to_f)/100)).to_i\n \"After the discount, the total comes to $#{self.total}.\"\n else\n \"There is no discount to apply.\"\n\n end\n end",
"title": ""
},
{
"docid": "7765034e7f49f953e180a06d8dd6790a",
"score": "0.6714821",
"text": "def apply_discount\n if discount != 0\n self.total = (total * ((100.0 - discount.to_f) / 100)).to_i\n \"After the discount, the total comes to $#{self.total}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "6ab9e871f89d7c12a6e585a7f73ab8a2",
"score": "0.6708911",
"text": "def apply_discount \n if discount != 0 \n float_discount = discount.to_f / 100\n \n #binding.pry\n discounted_amount = self.total * float_discount\n self.total = self.total - discounted_amount\n\n \"After the discount, the total comes to $#{self.total.to_i}.\"\n\n else \n \"There is no discount to apply.\"\n \n end\n \n end",
"title": ""
},
{
"docid": "2e1d64731e18308a6a8f421e99f321b5",
"score": "0.67041075",
"text": "def apply_discount\n if discount != 0\n @total = (total - (total*discount)/100)\n \"After the discount, the total comes to $#@total.\"\n else \n \"There is no discount to apply.\"\n end \n end",
"title": ""
},
{
"docid": "fff5300ae8a8b700538b1663b4799e71",
"score": "0.6688296",
"text": "def apply_discount\n if discount != 0\n self.total = (total * ((100.0 - discount.to_f)/100)).to_i\n\n \"After the discount, the total comes to $#{self.total}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "4a60ac7399f86b12ef477ddf7245091e",
"score": "0.66751564",
"text": "def discount=(value)\n @discount = value\n end",
"title": ""
},
{
"docid": "b26476e73aafefb362476b1d44ab837f",
"score": "0.6663703",
"text": "def apply_discount\n if @discount == 0\n \"There is no discount to apply.\"\n else\n @total = (@total.to_f - (@total * (@discount.to_f / 100))).to_i\n \"After the discount, the total comes to $#{@total}.\"\n end\n end",
"title": ""
},
{
"docid": "a4887909efbff7a66d19a4e20d5e9a7b",
"score": "0.66496795",
"text": "def apply_discount\n if discount != 0\n self.total = (total * ((100.0 - discount.to_f)/100)).to_i\n #binding.pry\n \"After the discount, the total comes to $#{self.total}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "ff309a02c0081b7656d4332e14f396e7",
"score": "0.6636365",
"text": "def apply_discount\n if self.discount === nil\n \"There is no discount to apply.\"\n else\n self.total = (self.total * (1 - self.discount/100.to_f)).to_i\n \"After the discount, the total comes to $#{self.total}.\"\n end\n end",
"title": ""
},
{
"docid": "d62d452a2d2cd5804a12c9532f168d72",
"score": "0.6621957",
"text": "def apply_discount\n if @discount == 0\n \"There is no discount to apply.\"\n else\n @total = @total - @total * 0.01 * @discount\n temp = @total\n \"After the discount, the total comes to $#{@total.to_i}.\"\n end\n end",
"title": ""
},
{
"docid": "3ae99ac4aa26697971d5f2c0c952f2ee",
"score": "0.66006804",
"text": "def apply_discount\n discount_amount = (self.total * (self.discount * 0.01))\n if discount_amount == 0\n \"There is no discount to apply.\"\n else\n self.total -= discount_amount\n \"After the discount, the total comes to $#{self.total.round(0)}.\"\n end\n end",
"title": ""
},
{
"docid": "6d825aea854e3928877dbf571e473b68",
"score": "0.659834",
"text": "def apply_discount\n if @discount != 0 \n discount_percent = @discount/100.round(2)\n @total -= @total*discount_percent\n after_discount = @total.round\n \"After the discount, the total comes to $#{after_discount}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "8c9f6b1ccf22f3dfd22364fbcf2d6637",
"score": "0.6597769",
"text": "def apply_discount\n if (self.discount > 0)\n self.total = ( self.total *= (100 - self.discount)/100 )\n self.total % 100 == 0 ? self.total = self.total.to_i : self.total = self.total.round(2)\n \"After the discount, the total comes to $#{self.total}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "9e787d88e02a8ad391ce8bbdebb41ba3",
"score": "0.6594305",
"text": "def discounted_cart(cart_id)\n discount_service.calculate_discount(cart_detail_with_product(cart_id))\n end",
"title": ""
},
{
"docid": "308503b793875acf93734c0add202675",
"score": "0.65899354",
"text": "def apply_discount\n if @discount == nil\n \"There is no discount to apply.\"\n else\n @total -= (@discount.to_i * 0.01 * total).round\n \"After the discount, the total comes to $#{@total}.\"\n end\n end",
"title": ""
},
{
"docid": "e664cc7d4e40ce8cb0f9a7be507a2bac",
"score": "0.65898514",
"text": "def discount_amount\n return 0 if discount.nil? || discount <= 0\n subtotal * ( discount / 100 )\n end",
"title": ""
},
{
"docid": "6f0c8768a53a0651c042132c789285cd",
"score": "0.6581287",
"text": "def apply_discount\n if discount != 0\n @total -= (@total * (@discount / 100.0)).to_i\n \"After the discount, the total comes to $#{@total}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "80691d327eb89dc6955e37cd7469d7d0",
"score": "0.65696234",
"text": "def discount\n format_amount(raw_discount)\n end",
"title": ""
},
{
"docid": "d0ca4f994e5825337012d631415b52ed",
"score": "0.65484965",
"text": "def calculate_discount\n @percentage_discount = Discount.calculate_percentage_discount(@discountable_amount, @user.role)\n @gross_discount = Discount.calculate_gross_bill_discount(@total_amount)\n @discount = @percentage_discount + @gross_discount\n end",
"title": ""
},
{
"docid": "458314337564b05585068dec83144534",
"score": "0.6534591",
"text": "def apply_discount\n if discount_code\n @discount = Discount.valid.find_by_code(discount_code)\n @invalid = true if @discount and @discount.minimum_order and (self.subtotal < @discount.minimum_order.to_f)\n elsif self.discount_id.present?\n @discount = self.discount\n end\n\n if @discount and not @invalid\n if @discount.discount_type == 'percent'\n self.subtotal = self.subtotal * (1 - @discount.discount/100.0)\n elsif @discount.discount_type == 'dollar'\n self.subtotal = self.subtotal - @discount.discount.to_f\n end\n\n self.discount_id = @discount.id\n self.grant_free_shipping = true if @discount.free_shipping\n unless just_a_quote\n @discount.increment_uses\n @discount.updated_at = Time.now\n @discount.save\n end\n end\n\n self.subtotal = 0 if subtotal < 0\n end",
"title": ""
},
{
"docid": "b3d08ac3502f274227971facb14c72fa",
"score": "0.6518631",
"text": "def apply_discount\n if @discount == 0\n return \"There is no discount to apply.\"\n else\n cart_total = self.total\n discount_amount = 100 - @discount\n @total = cart_total * discount_amount/100\n return \"After the discount, the total comes to $#{total}.\" #did not need to include the @ when referring to the instance variable total \n end \n end",
"title": ""
},
{
"docid": "99483dc95618b0f23f0ecde540119a96",
"score": "0.6514183",
"text": "def apply_discount\n if subscription_discount_id_changed?\n subscription_plan.discount = discount\n self.amount = subscription_plan.amount\n end\n end",
"title": ""
},
{
"docid": "a93d127bc9910447a80d7b92c143022f",
"score": "0.6502011",
"text": "def discount\n @discount ||= pre_discount_total - total\n end",
"title": ""
},
{
"docid": "fba73f75ef656242991458a0d1df1325",
"score": "0.64812756",
"text": "def apply_discount\n if discount != 0\n @total *= (100.0 - discount) / 100.0\n return \"After the discount, the total comes to $#{@total.to_i}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "968932094a7216e7d7cb5b12f6c6ab36",
"score": "0.64736104",
"text": "def apply_discount\n if discount == 0\n \"There is no discount to apply.\"\n else\n self.total -= ((total * discount)/100)\n \"After the discount, the total comes to $#{self.total}.\"\n end\nend",
"title": ""
},
{
"docid": "2cd4acb24a226f421ae0dd440758b140",
"score": "0.64656454",
"text": "def fixed_discount\n discount\n end",
"title": ""
},
{
"docid": "3fd493ec4454780be8f7087c13540ce8",
"score": "0.6457977",
"text": "def discount_for_fixed cart\n return 0 unless applies_to? cart\n\n rl = lines_for_products(cart, required_products)\n al = lines_for_products(cart, associated_products)\n ol = cart.line_items - al - rl\n\n value = 0\n value += apply_to_total cart, rl, al, ol\n value += apply_to_shipping cart, rl, al, ol\n value += apply_all_required cart, rl, al, ol\n value += apply_all_associated cart, rl, al, ol\n value += apply_max_required cart, rl, al, ol\n value += apply_max_associated cart, rl, al, ol\n value += apply_max_equal_lesser_required cart, rl, al, ol\n value += apply_max_equal_lesser_associated cart, rl, al, ol\n value += apply_max_equal_lesser_other cart, rl, al, ol\n\n end",
"title": ""
},
{
"docid": "8f85775b944f3cf52dbc79aa7a6eef52",
"score": "0.64473677",
"text": "def apply_discount\n if discount != 0\n @total *= (100.0 - discount) / 100.0\n return \"After the discount, the total comes to $#{@total.to_i}.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "d47c63add0dc1532720c6c6e6ff6d16b",
"score": "0.6447175",
"text": "def apply_discount\n @total = @total - ((@discount / 100.00) * @total)\n if @discount > 0\n message = \"After the discount, the total comes to $#{@total.to_i}.\"\n else \n message = \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "43555cc4ace50566071df3c3a5ec6d8d",
"score": "0.6443051",
"text": "def apply_discount\n if subscription_discount_id_changed?\n subscription_plan.discount = discount\n self.amount = subscription_plan.amount\n end\n end",
"title": ""
},
{
"docid": "168c9588e3f2f6b901c12578f1a60ced",
"score": "0.6433355",
"text": "def apply\n @cart = current_cart\n @order = Order.new(params[:order])\n @discounts = Discount.new(:discount_code => params[:discount][:discount_code])\n @discount = @discounts.discount_code.to_s\n\n unless Discount.find_by_discount_code(@discount).nil?\n @cart.discount_price\n session[:discount] = 'true'\n \n \n redirect_to new_order_path, notice: 'Valid discount code.'\n else\n redirect_to new_order_path, alert: 'Invalid discount code'\n end \n end",
"title": ""
},
{
"docid": "ee3a6be09c8a059200c6a02a852a2028",
"score": "0.64283603",
"text": "def discount\n @discounts.sum { |d| d.calculate @items, @price }\n end",
"title": ""
},
{
"docid": "5b0b73e7c9f29d75147d6c4705f1a0c1",
"score": "0.6424998",
"text": "def calculated_discount\n action = '%s_discount' % discount_strategy\n (respond_to? action) ? __send__(action) : order.zero\n end",
"title": ""
},
{
"docid": "75286f905a606d4e624f1e4d7f6e40e5",
"score": "0.6418132",
"text": "def calculate_discount_price(cart, total_amount)\n tdiscount = 0\n if self.is_valid and checked_for_dates and checked_for_order_price(total_amount) \n if self.discount_type.name == \"Percent off a product\" or self.discount_type.name == \"Dollar amount off a product\" \n cart.cart_items.each do |item|\n if item[:item_type] == \"Sku\"\n if quantity_of_item_is_valid(item) and product_is_valid(item) and checked_for_span(cart, item)\n item[:count].times do\n tdiscount += self.discount_value if self.discount_type.name == \"Dollar amount off a product\" \n tdiscount += self.discount_value * item[:price] / 100 if self.discount_type.name == \"Percent off a product\"\n end \n end \n end \n end \n elsif self.discount_type.name == \"Percent off entire order\" or self.discount_type.name == \"Dollar amount off an entire order\" \n if checked_all_conditions_on_each_item_of_entire_cart(cart)\n tdiscount = self.discount_value * total_amount / 100 if self.discount_type.name == \"Percent off entire order\"\n tdiscount = self.discount_value if self.discount_type.name == \"Dollar amount off an entire order\" \n end \n end\n end \n return tdiscount < 0 ? 0 : tdiscount\n end",
"title": ""
},
{
"docid": "8a6d30eaee40d7a64ef71993e92d4f71",
"score": "0.6408213",
"text": "def apply_coupon_discount\n reset_coupon_items\n if !coupon.blank? && coupon_conditions_met?\n if coupon.product?\n cart_items.where(:item_num.in => coupon.products).each do |item|\n item.calculate_coupon_discount(coupon)\n end\n elsif coupon.group?\n coupon.children.select {|c| coupon_conditions_met?(c)}.each do |child|\n cart_items.where(:item_num.in => child.products).each do |item|\n item.calculate_coupon_discount(child)\n end\n end\n elsif coupon.order?\n # === if order level coupon is a line item:\n # order_discount = coupon.percent? ? (0.01 * coupon.discount_value * sub_total(coupon.products_excluded + [Coupon::COUPON_ITEM_NUM])).round(2) : coupon.discount_value\n # cart_items << CartItem.new(:name => coupon.name, :item_num => Coupon::COUPON_ITEM_NUM, :msrp => -(order_discount), :price => -(order_discount), :coupon_price => true,\n # :quantity => 1, :currency => current_currency, :small_image => nil, :added_at => Time.now, :product_id => nil, :weight => 0, :tax_exempt => false, :handling_price => 0, :volume => 0)\n\n # === if order level discount is distributed:\n cart_items.where(:item_num.nin => coupon.products_excluded).each do |item|\n item.calculate_coupon_discount(coupon)\n end\n elsif coupon.highest_priced_product?\n item = cart_items.where(:item_num.nin => coupon.products_excluded).order_by(:price.desc).first\n item.calculate_coupon_discount(coupon) if item\n end\n end\n save\n end",
"title": ""
},
{
"docid": "5df6614a53ced7b71ddc8438235ffce4",
"score": "0.6405022",
"text": "def discount_amount\n agreed_price * discount_factor\n end",
"title": ""
},
{
"docid": "9d992b4b471381a9befe7b4059dbc7a1",
"score": "0.6395117",
"text": "def total_discount\n discount\n end",
"title": ""
},
{
"docid": "224adb3f4fe8ff73b73b36c0cb41945c",
"score": "0.63899046",
"text": "def apply_discount\n if discount != 0 \n @total -= total * discount / 100\n return \"After the discount, the total comes to $#{@total}.\"\n else\n return \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "7cc65c88e54aaf824e456573924d4ead",
"score": "0.6387239",
"text": "def apply_discount(amount)\n amount - discount\n end",
"title": ""
},
{
"docid": "87ed6fd5522af80f7eeebd004fcec2e0",
"score": "0.63760924",
"text": "def apply_discount\n discounted_total = (@total * ((100.0 - @discount.to_f)/100)).to_i\n if discounted_total == @total\n \"There is no discount to apply.\"\n else\n @total = discounted_total\n \"After the discount, the total comes to $#{discounted_total.to_i}.\"\n end\n end",
"title": ""
},
{
"docid": "03b7a9c7ba11b9750566bcb504d1db82",
"score": "0.63723916",
"text": "def apply_discount\n create_into_float = @discount/100.0\n times_by_hundred = @total * create_into_float\n result = @total - times_by_hundred.to_i\n if @discount != 0\n @total = result\n \"After the discount, the total comes to $800.\"\n else\n \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "83bf3e079e4af2a63381b8515dde3840",
"score": "0.6367039",
"text": "def apply_discount\n self.total -= (self.total * (self.discount.to_f / 100)).to_i\n if self.discount == 0\n return \"There is no discount to apply.\"\n else\n return \"After the discount, the total comes to $#{self.total.to_i}.\"\n end\n\n end",
"title": ""
},
{
"docid": "d45d7fe68ce4fda38cbbd79988cc5297",
"score": "0.6362196",
"text": "def apply_discount\n if discount\n self.total = self.total - self.total*self.discount/100\n result = \"After the discount, the total comes to $#{self.total}.\"\n else\n result = \"There is no discount to apply.\"\n end\n return result\n end",
"title": ""
},
{
"docid": "036eecb14e245371d665bb946b26530d",
"score": "0.6336515",
"text": "def apply_discount\n if discount == 0\n return \"There is no discount to apply.\"\n else\n @total -= ((@total * @discount) / 100)\n return \"After the discount, the total comes to $#{@total}.\"\n end\n end",
"title": ""
},
{
"docid": "a5faad063e0bfb245f40c82c5a0296c5",
"score": "0.63358074",
"text": "def discount_subtotal\n discount_value * quantity\n end",
"title": ""
},
{
"docid": "51d2007224bb31c6e3be284065f48aef",
"score": "0.63000375",
"text": "def discount\n Discount.new(amount: discount_size.to_i)\n end",
"title": ""
},
{
"docid": "42180cbab10174bd8f80a608af33d22c",
"score": "0.6288006",
"text": "def discount_price\n sell_price * (1 - discount)\n end",
"title": ""
},
{
"docid": "28066390056e40a0996ae9c487d3cee5",
"score": "0.62683046",
"text": "def apply_discount\n if discount != 0\n percent_off = (100 - @discount.to_f) / 100\n self.total = (@total * percent_off).to_i\n \"After the discount, the total comes to $#{@total}.\"\n else \n p \"There is no discount to apply.\"\n end\nend",
"title": ""
},
{
"docid": "17b0a10debf4c27bd5a936eaa28f0191",
"score": "0.62648976",
"text": "def total_price_with_discount\n total_price_with_taxes - coupon_discount\n end",
"title": ""
},
{
"docid": "6892efe4d069a3f7c92ac735b1c1f5a2",
"score": "0.6229057",
"text": "def apply_discount\n if @discount == 20\n @total=@total-(@total*discount/100)\n return \"After the discount, the total comes to $#{@total}.\"\n else\n return \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "843b52d2fd17a91e73752695d28a6942",
"score": "0.62064624",
"text": "def apply_coupons(cart, coupons)\n return cart if coupons.count < 1\n # create a copy of cart to manipulate\n discounted_cart = cart.dup\n coupons.each do |coupon|\n key = coupon[:item]\n coupon_count = coupon[:num]\n coupon_value = coupon[:cost] / coupon[:num]\n discounted_name = \"#{key} W/COUPON\"\n # if coupon applies to item in cart and there are enough items to qualify\n if discounted_cart.key?(key) && discounted_cart[key][:count] >= coupon_count\n discounted_cart[key][:count] -= coupon_count\n if discounted_cart.key?(discounted_name)\n discounted_cart[discounted_name][:count] += coupon_count\n else\n discounted_cart[discounted_name] = {:price => coupon_value, :clearance => discounted_cart[key][:clearance], :count => coupon_count}\n end\n end\n end\n discounted_cart\nend",
"title": ""
},
{
"docid": "666fd827a9e107f9db12f4479ccf15ea",
"score": "0.6175491",
"text": "def after_discount_price\n price_with_taxes * (100 - discount) / 100\n end",
"title": ""
},
{
"docid": "6de77322e8ecc7d55b6003cddc53e25a",
"score": "0.617403",
"text": "def create\n ##ensure that the cart item is new\n \n check_for_create(@auth_shopping_discount)\n @auth_shopping_discount = add_owner_and_signed_in_resource(@auth_shopping_discount)\n \n @auth_shopping_discount.save\n\n respond_with @auth_shopping_discount\n end",
"title": ""
},
{
"docid": "ff7dde817ac250c5d93e011e6aabd016",
"score": "0.6172975",
"text": "def apply_discount\n if self.discount != nil\n self.total = (self.total - (self.total * (self.discount.to_f / 100))).to_i\n return \"After the discount, the total comes to $#{self.total}.\"\n else\n return \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "e08c241571095c4a0a392f4f791b9bc1",
"score": "0.616882",
"text": "def discount_amount_from_cart\n\t\t\t$tracer.trace(__method__)\n\t\t\treturn ToolTag.new(table.className(\"subtotals\").tbody.find.tr.className(\"discount\"), __method__)\n\t\tend",
"title": ""
},
{
"docid": "566ef138d81aa216279c79171ff778d5",
"score": "0.6155501",
"text": "def discount\n 0\n end",
"title": ""
},
{
"docid": "2ef31aeb95f32a4fa01b362c2085e0fb",
"score": "0.61445403",
"text": "def create\n @discount = Discount.new(params[:discount])\n @cart = current_cart\n respond_to do |format|\n if @discount.save\n format.html { redirect_to @discount, notice: 'Discount was successfully created.' }\n format.json { render json: @discount, status: :created, location: @discount }\n else\n format.html { render action: \"new\" }\n format.json { render json: @discount.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7ed2ef11a452a7bcb6b0caa552d774eb",
"score": "0.6143024",
"text": "def discount_percent\n discount\n end",
"title": ""
},
{
"docid": "e6a6f415e662ac8004fe11e9553d3de1",
"score": "0.6137492",
"text": "def apply_discount # this instant method is going to be the part where discount will be applied if it applicable\n if discount != 0 # we use the conditional statement if to see if the discount \"is not\" equal to 0 ( but using the not equal sign != - this negates it being equal) - hench if there is a discount it will be a number other than 0 and then we will go ahead and apply this - but if it is equal to 0 we will continue with the else statement\n self.total = (total * ((100.0 - discount.to_f)/100)).to_i # using the self method to bring in our current total of our instance and setting this equal the discount being taken off - we will times our title by this (100.0 - discount.to_f)/100) which is just defining the percentage taken, by pulling in the discount method and setting it to a float number. - then after this discount is made and times by total we set the number back to an integer by using to_i( simply cause this whats the test asks for )\n \"After the discount, the total comes to $#{self.total}.\" # this string will then be printed bring in the new discounted total from above\n else # if discount is = to 0 then we do this...\n \"There is no discount to apply.\" # print this string\n end # end of conditional statements\n end",
"title": ""
},
{
"docid": "d1f57432684d88c37e2042b412286034",
"score": "0.61331975",
"text": "def apply_discount\n if discount > 0 #self. retrieves, no need for @\n to_take_off = (total * discount)/100 #to_take_off local not instance, only in this method\n self.total -= to_take_off\n return \"After the discount, the total comes to $#{total}.\"\n else\n return \"There is no discount to apply.\"\n end\n end",
"title": ""
},
{
"docid": "42d4cd9b4db658bc580dc0286d3e24cc",
"score": "0.6127019",
"text": "def apply_discount(percentage)\r\n @discount = percentage.to_f \r\n #the function to_f sets any invalid variable to 0. If not 0 apply discount\r\n if @discount != 0\r\n @price = @price - (@price * (@discount/100))\r\n end\r\n end",
"title": ""
},
{
"docid": "5de9fded2b44a0646bb795380d749752",
"score": "0.61247694",
"text": "def add_discount_to_subtotal(options)\n subtotal = options.fetch(:subtotal)\n discount = options.fetch(:discount)\n\n options.merge(subtotal: subtotal + discount, discount: 0)\n end",
"title": ""
},
{
"docid": "170a40263b572252465553e55bc68360",
"score": "0.611984",
"text": "def visible_customer_discount\n discount = 0.0\n if recommended_retail_price && recommended_retail_price > price\n discount = (recommended_retail_price - price) / recommended_retail_price\n end\n discount\n end",
"title": ""
},
{
"docid": "e88e5c0e0bfa6536363b9bbf08901556",
"score": "0.6101663",
"text": "def discount\n return @discount\n end",
"title": ""
},
{
"docid": "7c441cf3d0878b61784b22fea4df677d",
"score": "0.6099932",
"text": "def discount(rate)\n rate * (1 - self.discount_percentage.to_f / 100)\n end",
"title": ""
},
{
"docid": "fd7da5f6d1c4ef979779da4b648c6e34",
"score": "0.60893077",
"text": "def price_with_discount\n @price * 0.90\n end",
"title": ""
},
{
"docid": "b80ec20109d1972654bf040b8ced69cd",
"score": "0.6083816",
"text": "def set_fixed_item_discount(purchase, quantity, discount, source)\n for_purchase(purchase, :fixed_discount, false, quantity, discount, source)\n end",
"title": ""
},
{
"docid": "4039aa2a7fb95698ce20f439e8c3a789",
"score": "0.6077513",
"text": "def discount\n voucher ? voucher.apply(gross_total) : 0\n end",
"title": ""
},
{
"docid": "f66ae8f251b569c0aeffd3d23807b59a",
"score": "0.60726273",
"text": "def calculate_discount_money\n self.discount_money = self.money * self.discount\n end",
"title": ""
},
{
"docid": "e81d5534a852edd84175d1494c49e591",
"score": "0.6067736",
"text": "def show_discount_amount\n price = self.user_subscription.subscription.plan_price\n discount = 0.00\n\n #if self.coupon.present? && Coupon.is_valid?(self.coupon.coupon_code)\n if self.coupon.present?\n coupon_amount = self.coupon.discount_rate\n discount = ((coupon_amount / 100.00) * price).round(2)\n discount = discount.to_s + \" (\" + self.coupon.coupon_code + \")\"\n end\n\n discount.to_s\n end",
"title": ""
},
{
"docid": "6e80684d4913b4bbcbee375af2614566",
"score": "0.6062662",
"text": "def add_item(item, price, quantity = 1)\n @total += price * quantity\n quantity.times do\n @@items << item\n @items << item\n end\n @last_transaction = price * quantity\n def items\n @items\n end\n\n # def self.total\n # @@total\n # end\n\n #apply the optional discount to the @total .\n #subtract discount from total\n def apply_discount\n if @discount\n percent = @discount.to_f / 100\n @total -= @total * percent\n \"After the discount, the total comes to $#{@total.to_i}.\"\n else\n \"There is no discount to apply.\"\n end\n end\nend",
"title": ""
},
{
"docid": "ae5701d16b585eaf8db4f357947ff812",
"score": "0.605481",
"text": "def apply_customer_discounts\n return if customer.nil?\n customer.discounts.each do |discount|\n discountables.create(:discount => discount)\n end\n end",
"title": ""
},
{
"docid": "c463a97efa7b6ac1f87f70fd79175469",
"score": "0.60537326",
"text": "def discount_for(quantity)\n @discounts.inject(0) do |mem, discount|\n mem + discount.calculate_for(quantity)\n end\n end",
"title": ""
},
{
"docid": "d3adea257d9d7b17c835772269528afb",
"score": "0.6052796",
"text": "def coupon_total_discount(total)\n if discount.eq?('percent')\n percent_value = amount.to_f /100\n total - (total * percent_value)\n else\n total = total - amount\n (total < 0) ? 0 : total\n end\n end",
"title": ""
},
{
"docid": "9fefa299078946ba46323805f265ae22",
"score": "0.60525995",
"text": "def discount\n if discount = params[:discount]\n if i_id = params[:item]\n item = @basket.items.find { |it| it.id.to_s == i_id }\n item_discount( item , discount )\n else\n @basket.items.each do |it|\n item_discount( it , discount )\n end\n end\n @basket.save!\n else\n flash[:error] = \"No discount given\"\n end\n redirect_to office.edit_basket_path(@basket)\n end",
"title": ""
},
{
"docid": "aa9930fdc0a25b5a3f691ec8465aa3d6",
"score": "0.6041389",
"text": "def discount=(new_discount)\n @discount = [@full_price, new_discount].min\n end",
"title": ""
},
{
"docid": "4fadbbc45cc4ac7281ae58602115501b",
"score": "0.60362",
"text": "def apply_coupons(cart, coupons)\n coupons.each do |cpn|\n #set variable equal to the name of the discounted item for cleaner code\n discounted_item = cpn[:item]\n #if the item exists in the cart...\n if cart[discounted_item] != nil\n #if the cart has the minimum count of items for a coupon to be valid...\n if cart[discounted_item][:count] >= cpn[:num]\n #calculate the discounted price for the item\n new_price = cpn[:cost] / cpn[:num]\n #calculate the number of items remaining at full price\n remaining_full_price = cart[discounted_item][:count] % cpn[:num] #3%2 = 1\n #calculate the number of items that will have the discounted price applied\n coupon_applied = cart[discounted_item][:count] - remaining_full_price\n #maintain the clearance status\n clearance = cart[discounted_item][:clearance]\n #create new discounted item\n cart[\"#{discounted_item} W/COUPON\"] = {:price => new_price, :clearance => clearance, :count => coupon_applied}\n #change the previous cart number to the number remaining\n cart[discounted_item][:count] = remaining_full_price\n #else, the cart doesn't have the minimum number of items required to qualify for the coupon\n #OR the item doesn't exist in the cart\n else\n #donothing\n end\n end\n end\n cart\n end",
"title": ""
},
{
"docid": "0e4b40deb91105fe44db8a9b92a5bcd3",
"score": "0.60351926",
"text": "def percentage_discount\n order.sub_total * (discount_amount / 100.0)\n end",
"title": ""
},
{
"docid": "32c7ce80951d2de9461742625f02d53a",
"score": "0.60308117",
"text": "def discount_total\n total_cost(apply_discount: false) - total_cost(apply_discount: true)\n end",
"title": ""
},
{
"docid": "e866e635683dec3ca5fd1295612775c9",
"score": "0.6004994",
"text": "def set_discounted_price\n if self.amount.presence and self.discount_percentage.presence\n percentage = 1 - (self.discount_percentage.to_f / 100)\n self.discounted_price = (self.amount * percentage).round unless self.discounted_price.presence\n end\n end",
"title": ""
},
{
"docid": "0cb14b51b262ad56f156bc5a1bd77ab2",
"score": "0.60034406",
"text": "def subtotal_without_discount\n sell_price * quantity\n end",
"title": ""
},
{
"docid": "1be4084e8d02a8e8a29194cc489b9edc",
"score": "0.60006166",
"text": "def calculate_discount_for(total)\n if self.discount_percentage.present? && self.discount_percentage != 0.0\n (total / 100) * self.discount_percentage.round(2)\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "55a1b8fd29bf7bd3ef9b2417334d2eea",
"score": "0.5999686",
"text": "def set_discount\n @discount = Discount.find(params[:id])\n end",
"title": ""
},
{
"docid": "55a1b8fd29bf7bd3ef9b2417334d2eea",
"score": "0.5999686",
"text": "def set_discount\n @discount = Discount.find(params[:id])\n end",
"title": ""
},
{
"docid": "55a1b8fd29bf7bd3ef9b2417334d2eea",
"score": "0.5999686",
"text": "def set_discount\n @discount = Discount.find(params[:id])\n end",
"title": ""
},
{
"docid": "55a1b8fd29bf7bd3ef9b2417334d2eea",
"score": "0.5999686",
"text": "def set_discount\n @discount = Discount.find(params[:id])\n end",
"title": ""
}
] |
93be804a1439cb1be4efe2b2dc3513d7
|
Get the default value of the custom field. ==== Returns Returns the default value.
|
[
{
"docid": "ab33a22831d99c02ddfe4295e815eabd",
"score": "0.78113127",
"text": "def getDefaultValue\n\t\t\t\n\t\t\t\t\treturn @defaultValue\n\t\t\t\n\t\t\t\tend",
"title": ""
}
] |
[
{
"docid": "ac3e203b71a958cdb721bd6641995f6d",
"score": "0.7803364",
"text": "def default_value\n return @default_value\n end",
"title": ""
},
{
"docid": "ac3e203b71a958cdb721bd6641995f6d",
"score": "0.7803364",
"text": "def default_value\n return @default_value\n end",
"title": ""
},
{
"docid": "3aecf758ebf50510d830224de4c7ecd4",
"score": "0.75611925",
"text": "def default_value\n @default_value\n end",
"title": ""
},
{
"docid": "1f2a19df70b044dd43a3b04d48f872ee",
"score": "0.75399846",
"text": "def default_value\n @properties[\"defaultValue\"]\n end",
"title": ""
},
{
"docid": "28746fe30882634045695c5a3ee2fe41",
"score": "0.7452317",
"text": "def default_value\n field_descriptor_proto.default_value\n end",
"title": ""
},
{
"docid": "2de732aedd7997041419580d7e1af256",
"score": "0.74414706",
"text": "def value\n self[\"default\"]\n end",
"title": ""
},
{
"docid": "fbb6eb0ce13076db87dc7fbf5b424520",
"score": "0.74152875",
"text": "def default_value\n @default_value\n end",
"title": ""
},
{
"docid": "b26baf5f385a0d0ec73e2385b29548d9",
"score": "0.7269787",
"text": "def get_field(field, default = nil)\n value = fields[field]\n value = default if !default.nil? && (value.nil? || (value.respond_to?(:empty?) && value.empty?))\n value\n end",
"title": ""
},
{
"docid": "59b0855ef5bc08bffa3dc628b4084ccb",
"score": "0.7245524",
"text": "def default_value\n options[:default_value]\n end",
"title": ""
},
{
"docid": "c26dfb3995997bafff72d37cdb2425b5",
"score": "0.71818805",
"text": "def default\n return @default\n end",
"title": ""
},
{
"docid": "c26dfb3995997bafff72d37cdb2425b5",
"score": "0.71818805",
"text": "def default\n return @default\n end",
"title": ""
},
{
"docid": "3394ea7042d59d49ed2ca51ef9cb7738",
"score": "0.7174312",
"text": "def get_default_value\n return @payload.get_path(\"default_value\"){\"\"} \n end",
"title": ""
},
{
"docid": "bef4cabfb3d76d64c3e08b4bff38bc7d",
"score": "0.7118067",
"text": "def default\n def_val = @data.fetch(:dflt_value)\n\n if def_val && (match = def_val.match(/\\A'(.*)'\\Z/))\n return match[1]\n end\n\n return nil if @data.fetch(:dflt_value).to_s.empty?\n def_val\n end",
"title": ""
},
{
"docid": "b5404a56f91ddf88ec0e5a6c4750ee7d",
"score": "0.7064411",
"text": "def default_value\n if field_identifier == \"contactpersoon.email1\"\n return \"[email protected]\"\n elsif field_identifier == \"contactpersoon.naam\"\n return \"Naamloos\"\n elsif field_identifier == \"contactpersoon.voornaam\"\n return \"Voornaam\"\n elsif field_identifier == \"contactpersoon.achternaam\"\n return \"Achternaam\"\n elsif field_identifier == \"veel_tekst\"\n return \"tekst\"\n else\n # raise ERRR\n return \"\"\n end\n end",
"title": ""
},
{
"docid": "c343633b90170f0afa9fb0c738514efa",
"score": "0.70284045",
"text": "def default_value(field)\n return [] if field.array\n return unless field.required\n\n val = DEFAULTS[field.type]\n return val.call(field) if val.respond_to?(:call)\n\n val\n end",
"title": ""
},
{
"docid": "f6322cbf13f0f40d95df91afb851fdd4",
"score": "0.7016069",
"text": "def value\n if @value.nil?\n @default\n else\n @value\n end\n end",
"title": ""
},
{
"docid": "d84135d68c3d5492266b6893fb7b8b50",
"score": "0.7000724",
"text": "def init_default(field)\n\t\tnil\n\t\tif @elements[field.intern][:options][:default_value].class.eql? Symbol\n\t\t return send(@elements[field.intern][:options][:default_value])\n\t\telse #if @elements[field.intern][:options][:default_value].class.eql? String\n\t\t return @elements[field.intern][:options][:default_value]\n\t\tend\n\n\n\t end",
"title": ""
},
{
"docid": "c9e33fee4cfc1b629e4d68707c512780",
"score": "0.6988752",
"text": "def default_value\n return options[:default_value] if options[:default_value]\n case type\n when :checkbox\n 1\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "963813045c8e9ed3266199757dba7709",
"score": "0.6946136",
"text": "def value\n if value?\n @value\n else\n @default\n end\n end",
"title": ""
},
{
"docid": "7c44c7bfb0ddbd58cdbdb6dd6d0d48c7",
"score": "0.6924137",
"text": "def default_value(value); value; end",
"title": ""
},
{
"docid": "0e9c124d9e2d6b82e9d60e057f86319a",
"score": "0.69035196",
"text": "def uhook_default_value(name = nil, options = {})\n return settings[current_context][name][:options][:default_value]\n end",
"title": ""
},
{
"docid": "9ff6864e800dbf68d4d62e5d69bae357",
"score": "0.6896171",
"text": "def default_value\n @value || recommended_value\n end",
"title": ""
},
{
"docid": "c025844d204235f15421643d0234339c",
"score": "0.689333",
"text": "def default\n return nil if (type == :datetime || type == :date) && @data[:Default].to_s.strip.empty?\n return nil if (type == :int || type == :bigint) && @data[:Default].to_s.strip.empty?\n return nil unless @data[:Default]\n @data.fetch(:Default)\n end",
"title": ""
},
{
"docid": "096c26f6698c54bb87eadd061329baf4",
"score": "0.68883634",
"text": "def default_value\n property_values.detect { |pv| pv.default }\n end",
"title": ""
},
{
"docid": "598244aba5623b2da3cc101343746fdf",
"score": "0.6884438",
"text": "def default(name)\n @data['Value'][name]['default']\n end",
"title": ""
},
{
"docid": "67ca1563097f051afce11c75da1b3dc3",
"score": "0.68659896",
"text": "def default_value\n default_db_value ? default_db_value.to_s : \"null\"\n end",
"title": ""
},
{
"docid": "b9e7afdc0bd9d8744b0ff6748a401d2b",
"score": "0.6861432",
"text": "def value\n value = @instance.send(attribute_name)\n value ||= @options[:default]\n value\n end",
"title": ""
},
{
"docid": "c61f5f39fefc6966437039624cc66d05",
"score": "0.68057567",
"text": "def default\n default_value.dup\n end",
"title": ""
},
{
"docid": "dc7183228ce612cc9f8c98e9f8e9ab8a",
"score": "0.6772775",
"text": "def default(field, value)\n @defaults[field] = value\n end",
"title": ""
},
{
"docid": "a9c9654b415c9eb6c8c1122ae418378c",
"score": "0.67702323",
"text": "def default_value\n return nil if is_value\n return 0 if is_short\n return false if is_long\n\n nil\n end",
"title": ""
},
{
"docid": "97c2754c031af76283f5efcd55651d38",
"score": "0.67700875",
"text": "def extract_value_from_default(default); end",
"title": ""
},
{
"docid": "826bd082ce9c80631e415c094bdbb618",
"score": "0.6767024",
"text": "def get_field_value(field, value )\n if value.nil? && field['default']\n format_field( field, field['default'] )\n else\n format_field( field, value )\n end\n end",
"title": ""
},
{
"docid": "25b67eea990320f0423fafa684ca4f6a",
"score": "0.6730594",
"text": "def default\n @default\n end",
"title": ""
},
{
"docid": "90fbfadb22f5adcabb4ef3d970821929",
"score": "0.6721795",
"text": "def default_value(value_)\n @field._set_default_value(value_)\n end",
"title": ""
},
{
"docid": "997680fab3a3ec110a167b6a00d0f39e",
"score": "0.6718943",
"text": "def get_value(name, defaultValue = nil)\n\t\tend",
"title": ""
},
{
"docid": "76da4ceab8dd0af711cb8dbac7355ecd",
"score": "0.67116547",
"text": "def default_for( field, value )\r\n f = @fields.find {|f| f.name == field}\r\n raise FieldError, \"unknown field '#{field}'\" if f.nil?\r\n f.default = value\r\n end",
"title": ""
},
{
"docid": "29f4aef781894cbfc9219119508bb62b",
"score": "0.66490126",
"text": "def default_value\n self[:value] ||= {}\n self[:value][:default_value] = self[:value][:default_value].to_i unless self[:value][:default_value].to_s.empty?\n self[:value][:default_value]\n end",
"title": ""
},
{
"docid": "e46a9a07011a8d7a087821df2ca87c78",
"score": "0.66312677",
"text": "def default_value\n if @default.kind_of? Proc\n @default.call\n else\n @default.dup\n end\n end",
"title": ""
},
{
"docid": "b44cc0dd1e5c145bb0de91b5ac3af0f3",
"score": "0.66126686",
"text": "def default_value; end",
"title": ""
},
{
"docid": "b44cc0dd1e5c145bb0de91b5ac3af0f3",
"score": "0.66126686",
"text": "def default_value; end",
"title": ""
},
{
"docid": "b44cc0dd1e5c145bb0de91b5ac3af0f3",
"score": "0.66126686",
"text": "def default_value; end",
"title": ""
},
{
"docid": "b44cc0dd1e5c145bb0de91b5ac3af0f3",
"score": "0.66126686",
"text": "def default_value; end",
"title": ""
},
{
"docid": "b271e0e8081609cffb7ffa6b019cfae5",
"score": "0.65522367",
"text": "def current_value\n return custom_value if dirty?\n\n default_value\n end",
"title": ""
},
{
"docid": "47c1dee6697c6d824907a9e268efcdb1",
"score": "0.65482605",
"text": "def get_default_value(property)\n verify_if_root_template_is_set!\n self['properties'][property.to_s]['default']\n end",
"title": ""
},
{
"docid": "7d449e76a4d0c030081ae0356be87c1e",
"score": "0.6530897",
"text": "def default\n @default ||= @column.default\n end",
"title": ""
},
{
"docid": "1476c49d69e2d8428bdec27d27e9b89f",
"score": "0.6516537",
"text": "def default_value\n case java_field.type\n when Java::int.java_class, Java::float.java_class, Java::double.java_class\n 0\n when Java::boolean.java_class\n false\n end\n end",
"title": ""
},
{
"docid": "fde8771f026d3e2520c24dfa3dbaa9b9",
"score": "0.65109366",
"text": "def default_value_for_type\n if @field.message?\n nil\n elsif @field.enum?\n \":#{@field.enum.values.first.name}\"\n else\n case @field.type\n when 1, 2, 3, 4, 5, 6, 7, 13, 15, 16, 17, 18 then \"0\" # floating point or integer\n when 9, 12 then \"\\\"\\\"\"\n when 8 then \"false\"\n end\n end\n end",
"title": ""
},
{
"docid": "9b30c5ad955dfb059b48ca8b51efb779",
"score": "0.6491485",
"text": "def default_value(model)\n call_proc_or_symbol(default, model)\n end",
"title": ""
},
{
"docid": "ee78e96543ef5d5b4472829d1b63566d",
"score": "0.64843553",
"text": "def default\n UNSET_VALUE\n end",
"title": ""
},
{
"docid": "20ced3feee4152a1b25f2755eb67d69c",
"score": "0.64786017",
"text": "def default\n return false if (self.type == \"datetime\" or self.type == \"date\") and @args[:data][:Default].to_s.strip.length <= 0\n return false if (self.type == \"int\" or self.type == \"bigint\") and @args[:data][:Default].to_s.strip.length <= 0\n return false if !@args[:data][:Default]\n return @args[:data][:Default]\n end",
"title": ""
},
{
"docid": "3d3e39a6a3762eea34db567d2ebb0f2c",
"score": "0.64773005",
"text": "def default_value\n self[:value] ||= {}\n self[:value][:default_value].to_i\n end",
"title": ""
},
{
"docid": "064db40434d3118fcf11f794e1fc7dcb",
"score": "0.6444506",
"text": "def default_value\n args.fetch(:default, nil)\n end",
"title": ""
},
{
"docid": "da56384fa455f62216429b5ac10d8713",
"score": "0.6443492",
"text": "def default_value(key)\n self.respond_to?(key) ? send(key) : ''\n end",
"title": ""
},
{
"docid": "7018034d683e0da8a09a23480b1e2cf9",
"score": "0.64247847",
"text": "def default(attribute, default_value) \n if attribute == ''\n return default_value\n else\n return attribute\n end\n end",
"title": ""
},
{
"docid": "4ca4bea030b6fa8b145a422c41a86714",
"score": "0.64144784",
"text": "def report_field_default(config)\n FieldDefaults.calculate_default(@report, config.default, config.type)\n end",
"title": ""
},
{
"docid": "a8231e396d842dee75e0e949560a7dbb",
"score": "0.64094347",
"text": "def get_current_default_edit_value\n return if self.default_edit_value.nil?\n return self.default_edit_value.call if self.default_edit_value.is_a? Proc\n self.default_edit_value\n end",
"title": ""
},
{
"docid": "1ca7830bfdb9d7ef1c67f9397ef69748",
"score": "0.6404996",
"text": "def default_search_field\n field = nil\n field ||= search_fields.values.select { |field| field.default == true }.first\n field ||= search_fields.values.first\n\n field\n end",
"title": ""
},
{
"docid": "9fece8a2ca1aeb5abb91246616ffbcda",
"score": "0.638714",
"text": "def GetDefaultValue(variable)\n Ops.get(@DEFAULT_SETTINGS, variable, \"\")\n end",
"title": ""
},
{
"docid": "5526aeb9c764214c6ed165ef7e7b3ce8",
"score": "0.63795495",
"text": "def make_default_value(instance, value)\n value\n end",
"title": ""
},
{
"docid": "e8085543a757e9bf424ac070cb856f68",
"score": "0.63766277",
"text": "def extract_value_from_default(default)\n case default\n # Quoted types\n when /\\Anow\\(\\)\\z/m\n nil\n # Boolean types\n when \"true\".freeze, \"false\".freeze\n default\n # Object identifier types\n when \"''\"\n ''\n when /\\A-?\\d+\\z/\n $1\n else\n # Anything else is blank, some user type, or some function\n # and we can't know the value of that, so return nil.\n nil\n end\n end",
"title": ""
},
{
"docid": "dd28efe5883b4d5c305f1329da446bd9",
"score": "0.6371236",
"text": "def default_value_if_blank(value, default)\n # Stolen from: http://api.rubyonrails.org/classes/Object.html#method-i-blank-3F\n empty = value.respond_to?(:empty?) ? !!value.empty? : !value\n if empty\n return default\n else\n return value\n end\n end",
"title": ""
},
{
"docid": "897249ed7adf6fa63670b0f09430b114",
"score": "0.6335214",
"text": "def default_option\n @attributes[:default_option]\n end",
"title": ""
},
{
"docid": "4668393d60f43d659cc55f8b1428a04c",
"score": "0.6323723",
"text": "def default_value(value, default_value)\n is_set?(value) ? value : default_value\n end",
"title": ""
},
{
"docid": "a253390ada77a757725d4fb0358b3b8a",
"score": "0.6316782",
"text": "def default_value\n self[:value] ||= {}\n self[:value][:default_value] ||= 'empty'\n self[:value][:default_value]\n end",
"title": ""
},
{
"docid": "a253390ada77a757725d4fb0358b3b8a",
"score": "0.6316782",
"text": "def default_value\n self[:value] ||= {}\n self[:value][:default_value] ||= 'empty'\n self[:value][:default_value]\n end",
"title": ""
},
{
"docid": "a253390ada77a757725d4fb0358b3b8a",
"score": "0.6316782",
"text": "def default_value\n self[:value] ||= {}\n self[:value][:default_value] ||= 'empty'\n self[:value][:default_value]\n end",
"title": ""
},
{
"docid": "26c656c0de99f2ff169eb80d71f7f357",
"score": "0.62956446",
"text": "def get_integer_value(name, defaultValue)\n\t\tend",
"title": ""
},
{
"docid": "b7198d61a033e4642b77e93483e24e28",
"score": "0.6292712",
"text": "def default_value=(value)\n @default_value = value\n end",
"title": ""
},
{
"docid": "b7198d61a033e4642b77e93483e24e28",
"score": "0.6292712",
"text": "def default_value=(value)\n @default_value = value\n end",
"title": ""
},
{
"docid": "19755392a3f7ca3c4190f988aad6712a",
"score": "0.62890583",
"text": "def get_default(name)\n key_name = if name.is_a?(Symbol) then name else name.to_s end\n @default[key_name][:default] if @default[key_name]\n end",
"title": ""
},
{
"docid": "03df2116c1d2f36eb51feb5978cb9e8e",
"score": "0.628763",
"text": "def default_autofill\n default ? default.to_s : ''\n end",
"title": ""
},
{
"docid": "49eea67129c06a1a2818a24f5d82659b",
"score": "0.6284773",
"text": "def default_from(xml)\n xml.attributes['default']&.value\n end",
"title": ""
},
{
"docid": "0a67d95dffb2f9ab5e241a585d9384db",
"score": "0.62821263",
"text": "def default\n get!('default')\n end",
"title": ""
},
{
"docid": "9bb918cdeec24934b413a507a9a8f677",
"score": "0.6267492",
"text": "def default\n @@default\n end",
"title": ""
},
{
"docid": "68ca2cb0cddcebcd26bdad8dd7f30944",
"score": "0.62593955",
"text": "def default_attribute\n default_attr = self.attributes.values.first # first element value\n self.attributes.each do |key, attr|\n default_attr = attr if attr.default?\n end\n return default_attr\n end",
"title": ""
},
{
"docid": "aeed1d0f69c0b11c15bdbcbbf8fffe7c",
"score": "0.6227741",
"text": "def derive_value( tx, default_value, user_field )\n\t\t\tusrdata = tx[user_field] \n\t\t\tpval = usrdata ? usrdata : default_value # overwrite with user value\n\t\t\tpval = nil if usrdata == \"empty\" # nil if wanted\n return pval\n end",
"title": ""
},
{
"docid": "b6fdcbbef26e0540c85ee213ee636429",
"score": "0.6224255",
"text": "def default\n def_val = @args[:data][:dflt_value]\n if def_val.to_s.slice(0..0) == \"'\"\n def_val = def_val.to_s.slice(0)\n end\n \n if def_val.to_s.slice(-1..-1) == \"'\"\n def_val = def_val.to_s.slice(0, def_val.length - 1)\n end\n \n return false if @args[:data][:dflt_value].to_s.length == 0\n return def_val\n end",
"title": ""
},
{
"docid": "498af195044faa9cfef1d3f0479c1126",
"score": "0.62158436",
"text": "def default_value\n self[:value] ||= {}\n self[:value][:default_value] ||= ''\n end",
"title": ""
},
{
"docid": "146b54e8a3edf557be2962c2c6a03e78",
"score": "0.620288",
"text": "def default_value(default = definition[:default])\n case default\n when Symbol\n Alchemy.t(default, scope: :default_content_texts)\n else\n default\n end\n end",
"title": ""
},
{
"docid": "c612032f6f9af2e1faa47d06a2f7d774",
"score": "0.6195819",
"text": "def default\n if @default.nil?\n nil\n elsif @default.is_a?(Numeric) || @default.is_a?(Symbol) || @default.is_a?(TrueClass) || @default.is_a?(FalseClass)\n @default\n else\n @default.dup rescue @default\n end\n end",
"title": ""
},
{
"docid": "7115c59f4dde43568ca44e57b88e04ff",
"score": "0.61882025",
"text": "def default\n @options[:default]\n end",
"title": ""
},
{
"docid": "c992f298aeeda03a7faeb427d930f342",
"score": "0.61821705",
"text": "def custom_value\n @custom_value\n end",
"title": ""
},
{
"docid": "212fea0c06965aa49e10db8c6bcf0c21",
"score": "0.61783427",
"text": "def default_value\n default = definition[:default]\n case default\n when Symbol\n Alchemy.t(default, scope: :default_ingredient_texts)\n else\n default\n end\n end",
"title": ""
},
{
"docid": "dc2f63869e0435d4d0cf960a2c2bf67c",
"score": "0.61653316",
"text": "def generate_metadata_default_value(field, host_genome_name)\n if field.base_type == Metadatum::STRING_TYPE\n if field.options.present?\n options = JSON.parse(field.options)\n return options[Random.new.rand(options.length)]\n end\n\n return \"Example \" + field.display_name\n end\n\n if field.base_type == Metadatum::NUMBER_TYPE\n return Random.new.rand(100)\n end\n\n if field.base_type == Metadatum::DATE_TYPE\n return Time.zone.today.strftime(host_genome_name == \"Human\" ? \"%Y-%m\" : \"%Y-%m-%d\")\n end\n end",
"title": ""
},
{
"docid": "7105d3b7d195d1b109487db829367ae2",
"score": "0.6160518",
"text": "def default(field, **opts)\n check_tl(\"achiever.defaults.#{field}\", opts)\n end",
"title": ""
},
{
"docid": "8c454cd0382215bf054f7c8ceda09e1d",
"score": "0.61548144",
"text": "def default\n options[:default]\n end",
"title": ""
},
{
"docid": "26e32d9eb571e368b4d4752ce117e89c",
"score": "0.6149658",
"text": "def default_value(group = nil)\n @group_defaults.include?(group) ? @group_defaults[group] : type_cast(@default)\n end",
"title": ""
},
{
"docid": "1067d7cb3009452367f41c633621b3f6",
"score": "0.61002994",
"text": "def extract_value_from_default(default)\n case default\n # Quoted types\n when /\\A[(B]?'(.*)'.*::\"?([\\w. ]+)\"?(?:\\[\\])?\\z/m\n # The default 'now'::date is CURRENT_DATE\n if $1 == \"now\" && $2 == \"date\"\n nil\n else\n $1.gsub(\"''\", \"'\")\n end\n # Boolean types\n when \"true\", \"false\"\n default\n # Numeric types\n when /\\A\\(?(-?\\d+(\\.\\d*)?)\\)?(::bigint)?\\z/\n $1\n # Object identifier types\n when /\\A-?\\d+\\z/\n $1\n else\n # Anything else is blank, some user type, or some function\n # and we can't know the value of that, so return nil.\n nil\n end\n end",
"title": ""
},
{
"docid": "e899a76496f670c2c0daa96635a4d057",
"score": "0.60907626",
"text": "def extract_value_from_default(default)\n case default\n # Quoted types\n when /\\A[\\(B]?'(.*)'.*::\"?([\\w. ]+)\"?(?:\\[\\])?\\z/m\n # The default 'now'::date is CURRENT_DATE\n if $1 == \"now\".freeze && $2 == \"date\".freeze\n nil\n else\n $1.gsub(\"''\".freeze, \"'\".freeze)\n end\n # Boolean types\n when \"true\".freeze, \"false\".freeze\n default\n # Numeric types\n when /\\A\\(?(-?\\d+(\\.\\d*)?)\\)?(::bigint)?\\z/\n $1\n # Object identifier types\n when /\\A-?\\d+\\z/\n $1\n else\n # Anything else is blank, some user type, or some function\n # and we can't know the value of that, so return nil.\n nil\n end\n end",
"title": ""
},
{
"docid": "f7db32c2f5b824d1e33eba7bf59607c9",
"score": "0.60885453",
"text": "def default\n self.class.default\n end",
"title": ""
},
{
"docid": "f7db32c2f5b824d1e33eba7bf59607c9",
"score": "0.60885453",
"text": "def default\n self.class.default\n end",
"title": ""
},
{
"docid": "49b701caf3e11e400c99274a81bdc675",
"score": "0.60882086",
"text": "def default!\n self.value=(default)\n end",
"title": ""
},
{
"docid": "2d20dff564193b9018920ccf757fe40c",
"score": "0.60872066",
"text": "def _value\n @value || sensible_default()\n end",
"title": ""
},
{
"docid": "f4db4d1086afab434ed4b4999b5c46dc",
"score": "0.6068101",
"text": "def default_db_value\n class_name.columns_hash[@column.to_s].default\n end",
"title": ""
},
{
"docid": "f980787c3efa25cfa60a9df266c066ae",
"score": "0.6059736",
"text": "def default(key)\n @defaults[key.to_s]\n end",
"title": ""
},
{
"docid": "405add7742b069a6a9ebb40207f0b190",
"score": "0.6055531",
"text": "def default_value(name, default)\n instance_variable_name = \"@#{name}\"\n define_method(name) do\n self.instance_variable_get(instance_variable_name) ||\n self.instance_variable_set(instance_variable_name, default)\n end\n end",
"title": ""
},
{
"docid": "e3b5b9a900af50c8dad337116c8659f9",
"score": "0.60505426",
"text": "def default(column)\n column_named(column).default || nil\n end",
"title": ""
},
{
"docid": "7c26d23335fd0d088fb32235b893c914",
"score": "0.60466754",
"text": "def default\n @params[:default]\n end",
"title": ""
},
{
"docid": "679a59ae8cab4c6282635b96e11b313b",
"score": "0.604663",
"text": "def default_sort_field\n field = nil\n field ||= sort_fields.values.select { |field| field.default == true }.first\n field ||= sort_fields.values.first\n\n field\n end",
"title": ""
},
{
"docid": "857480430e45f777d34bc6b0017748b8",
"score": "0.60460687",
"text": "def default_value_noninteractive\n default_value\n end",
"title": ""
}
] |
1da44a386bc59fef717d860314405944
|
PATCH/PUT /compras/1 PATCH/PUT /compras/1.json
|
[
{
"docid": "baf7f1aea52eb05f53acf3207dd7e4f2",
"score": "0.0",
"text": "def update\n\n end",
"title": ""
}
] |
[
{
"docid": "3eeada2a66f5b60ca71aca81ef05eab7",
"score": "0.6567724",
"text": "def update\n @composante = Composante.find(params[:id])\n\n respond_to do |format|\n if @composante.update_attributes(params[:composante])\n format.html { redirect_to @composante, notice: 'Composante was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @composante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e11f77065fb6b089833b0bef56868e1",
"score": "0.65610003",
"text": "def update\n @compra = Compra.find(params[:id])\n\n respond_to do |format|\n if @compra.update_attributes(params[:compra])\n format.html { redirect_to @compra, notice: 'Compra atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1b9a3a7058c20d808a954cf3842ec3f",
"score": "0.6513807",
"text": "def update\n respond_to do |format|\n if @compra.update(compra_params)\n format.html { redirect_to @compra, notice: \"Compra ID #{@compra.id } foi atualizada com sucesso.\" }\n format.json { render :show, status: :ok, location: @compra }\n else\n format.html { render :edit }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6501048",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "fa16209f5ac39ae638cdf45c17fd5f18",
"score": "0.6501048",
"text": "def rest_patch(path, options = {}, api_ver = @api_version)\n rest_api(:patch, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "af9aedd4f428a2c26c3fd57798526020",
"score": "0.6458011",
"text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end",
"title": ""
},
{
"docid": "76d77bbd089dcb34a175af2becd872d6",
"score": "0.6456989",
"text": "def update\n @compra = Compra.find(params[:id])\n\n respond_to do |format|\n if @compra.update_attributes(params[:compra])\n format.html { redirect_to @compra, :notice => 'Compra was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @compra.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "113eae47f4660f4ca9a83d579932f32a",
"score": "0.642954",
"text": "def update\n respond_to do |format|\n if @compra.update(compra_params)\n format.html { redirect_to @compra, notice: 'Ciclo modificado exitosamente..' }\n format.json { render :show, status: :ok, location: @compra }\n else\n format.html { render :edit }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7f7c16b9e14f1352bb07fd27f83679a7",
"score": "0.6427068",
"text": "def patch(path, params: {}, headers: {})\n request_json :patch, path, params, headers\n end",
"title": ""
},
{
"docid": "d5eaea298e64625a71a15a970f3b75ed",
"score": "0.64140654",
"text": "def patch *args\n make_request :patch, *args\n end",
"title": ""
},
{
"docid": "8b26385e4d73544d6f1485bd4f629919",
"score": "0.6412342",
"text": "def update\n @compra = Compra.find(params[:id])\n\n respond_to do |format|\n if @compra.update_attributes(params[:compra])\n format.html { redirect_to @compra, notice: 'Compra was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23938c68ef9abf0f7f952b2be1a5b0e8",
"score": "0.6369752",
"text": "def update\n @pelicula = Pelicula.find(params[:id])\n @pelicula.update(update_params)\n render json: @pelicula, status: :ok\n end",
"title": ""
},
{
"docid": "8cf5582be869fc5b155331c1d0f7a490",
"score": "0.6305883",
"text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a1fcbdae3046e2102f533f681b61c66",
"score": "0.63004786",
"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.patch(\n url, {contact: {name: \"Josh\", email: \"[email protected]\"}} )\nend",
"title": ""
},
{
"docid": "b9ef5fdb20b4511ab1e54e1efe9b5626",
"score": "0.6298965",
"text": "def update\n respond_to do |format|\n if @servico_cruzeiro.update(servico_cruzeiro_params)\n format.html { redirect_to @servico_cruzeiro, notice: 'Cruzeiro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_cruzeiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9803f30a1a145d8070b77f81da5380a0",
"score": "0.6293569",
"text": "def update\n respond_to do |format|\n if @compito.update(compito_params)\n format.html { redirect_to @compito, notice: 'Compito was successfully updated.' }\n format.json { render :show, status: :ok, location: @compito }\n else\n format.html { render :edit }\n format.json { render json: @compito.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a328f120626f4d14b8eb0cf083182589",
"score": "0.62831146",
"text": "def update\n respond_to do |format|\n if @compra.update(compra_params)\n format.html { redirect_to @compra, notice: 'Ha comprado puntos exitosamente.' }\n format.json { render :show, status: :ok, location: @compra }\n else\n format.html { render :edit }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f751821dc454ae51959b03b838bf8941",
"score": "0.62814355",
"text": "def update\n @registro_compra = RegistroCompra.find(params[:id])\n\n respond_to do |format|\n if @registro_compra.update_attributes(params[:registro_compra])\n format.html { redirect_to @registro_compra, notice: 'Se ha modificado satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registro_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b3be1f8b5b5fcd9333953d40fab8fb38",
"score": "0.6268898",
"text": "def update\n @detalle_compra = DetalleCompra.find(params[:id])\n\n respond_to do |format|\n if @detalle_compra.update_attributes(params[:detalle_compra])\n format.html { redirect_to @detalle_compra, notice: 'Detalle compra was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @detalle_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e1d1d8767ff916d3b3b1578ce2b4903",
"score": "0.6263771",
"text": "def update\n respond_to do |format|\n if @compra.update(compra_params)\n format.html { redirect_to @compra, notice: 'Compra atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @compra }\n else\n format.html { render :edit }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf63ca6298156736dc3c695cfe8dae1d",
"score": "0.62616354",
"text": "def update\n respond_to do |format|\n if @servico.update(servico_params)\n format.html { redirect_to admin_pessoa_servicos_path(@pessoa), notice: 'Serviço foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n get_dependencies\n format.html { render action: 'edit' }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e0604d6bfba0ff394d9f70859a50062",
"score": "0.62518543",
"text": "def update\n @compartido = Compartido.find(params[:id])\n\n respond_to do |format|\n if @compartido.update_attributes(params[:compartido])\n format.html { redirect_to @compartido, notice: 'Compartido was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compartido.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c1a09a9d20ee815b5c9f998eda70b44",
"score": "0.62442195",
"text": "def patch(path, params = {}, options = {})\n options[:content_type] ||= :json\n options[:Authorization] = \"simple-token #{self.access_token}\"\n RestClient.patch(request_url(path), params.to_json, options)\n end",
"title": ""
},
{
"docid": "08e1eee08b034371ba61f3462a3d4714",
"score": "0.6243958",
"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": "3490ff4af115453bb52696d2741d5b66",
"score": "0.62282485",
"text": "def update\n respond_to do |format|\n if @compra_venta_especial.update(compra_venta_especial_params)\n format.html { redirect_to @compra_venta_especial, notice: 'Compra venta especial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @compra_venta_especial.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5c35da5b503a7bd631f620081fbce3c",
"score": "0.6223051",
"text": "def update\n respond_to do |format|\n if @compra.update(compra_params)\n format.html { redirect_to @compra, notice: 'Compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @compra }\n else\n format.html { render :edit }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc2237a9f60a8558ac428c883b0d3d6c",
"score": "0.62226784",
"text": "def update\n respond_to do |format|\n if @com_compra.update(com_compra_params)\n format.html { redirect_to @com_compra, notice: 'Compra actualizado correctamente.' }\n format.json { render :show, status: :ok, location: @com_compra }\n else\n format.html { render :edit }\n format.json { render json: @com_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4060e7b669efb41617787caa900ddbc",
"score": "0.6221833",
"text": "def update\n @caixa = Caixa.find(params[:id])\n\n respond_to do |format|\n if @caixa.update_attributes(params[:caixa])\n format.html { redirect_to @caixa, notice: 'Caixa was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7e480ceba34688b87655bb97e8ed1d15",
"score": "0.6206605",
"text": "def update\n @receipe = Receipe.find(params[:id])\n\n if @receipe.update(receipe_params)\n head :no_content\n else\n render json: @receipe.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e01036e4cfe953d9b0b40f87b89379c9",
"score": "0.62036794",
"text": "def update\n respond_to do |format|\n if @objeto.update(campo_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Campo was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba8ef0c784b53dc4a1c12ee8846dc5db",
"score": "0.6203066",
"text": "def update \n @complaint = Complaint.find(params[:id])\n\n respond_to do |format|\n if @complaint.update_attributes(params[:complaint])\n format.html { redirect_to @complaint, notice: 'Complaint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7925d3579246d0529dd30782d249980f",
"score": "0.6199059",
"text": "def update\n @corte_modelos = CorteModelo.all\n @modelos = Modelo.all\n @compras = Compra.all\n respond_to do |format|\n if @corte.update(corte_params)\n format.html { redirect_to @corte, notice: 'Corte was successfully updated.' }\n format.json { render :show, status: :ok, location: @corte }\n else\n format.html { render :edit }\n format.json { render json: @corte.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de0aa94c8c14738bd86ef9f639c9edeb",
"score": "0.6197892",
"text": "def update\n respond_to do |format|\n if @detalle_compra.update(detalle_compra_params)\n format.html { redirect_to @compra, notice: 'Detalle compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @detalle_compra }\n else\n format.html { render :edit }\n format.json { render json: @detalle_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1643d1af8b29408d5973180380c0d354",
"score": "0.6192454",
"text": "def update\n respond_to do |format|\n if @conta.update(conta_params)\n format.html { redirect_to contas_path, notice: \"Conta #{@conta.nome} Atualizada com Sucesso! \"}\n format.json { render :show, status: :ok, location: @conta }\n else\n format.html { render :edit }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd9a9b9826da23886be7a8a95dbec963",
"score": "0.6186704",
"text": "def update\n respond_to do |format|\n if @compra.update(compra_params)\n format.html { redirect_to @compra, notice: \"Compra was successfully updated.\" }\n format.json { render :show, status: :ok, location: @compra }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1caef5dcc3f2a47497b45d689f4eb02a",
"score": "0.61825496",
"text": "def update\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.find(params[:id])\n\n respond_to do |format|\n if @contato.update_attributes(params[:contato])\n format.html { redirect_to @contato, notice: 'Contato atualizado com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1199911e0288c4bc1d958bcad8d02bb8",
"score": "0.61762667",
"text": "def update\n respond_to do |format|\n if @conteo.update(conteo_params)\n format.html { redirect_to @conteo, notice: 'Conteo was successfully updated.' }\n format.json { render :show, status: :ok, location: @conteo }\n else\n format.html { render :edit }\n format.json { render json: @conteo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e6e79705e292c4bfae75020345b7518",
"score": "0.6175613",
"text": "def update\n respond_to do |format|\n if @objeto.update(etapa_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Etapa was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "618b5784cc58ddee8139d7e3e02cb7cd",
"score": "0.61669165",
"text": "def update\n @taco = Taco.find(params[:id])\n\n if @taco.update(taco_params)\n head :no_content\n else\n render json: @taco.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "686c4018bc74e99e8458d2dbe68e7920",
"score": "0.6160268",
"text": "def patch(path, options={}, authenticate=true, raw=false, version=api_version, force_urlencoded=false)\n request(:patch, path, options, authenticate, raw, version, force_urlencoded)\n end",
"title": ""
},
{
"docid": "627d8af0f27cc36007e3999687325514",
"score": "0.61565614",
"text": "def update\n respond_to do |format|\n if @compra_produto.update(compra_produto_params)\n format.html { redirect_to @compra_produto, notice: 'Compra produto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @compra_produto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.61558473",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "b4cc3ee2207b39abaf779a6078bbaf3a",
"score": "0.61558473",
"text": "def patch\n PATCH\n end",
"title": ""
},
{
"docid": "b4fbe2bb4554c75214ec612a847f458e",
"score": "0.6151218",
"text": "def update_tenant_circle(args = {}) \n id = args['id']\n temp_path = \"/tenantcircles.json/{circleId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantcircleId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "87c7679c0610d26bac615ab8169d256e",
"score": "0.6145326",
"text": "def update\n @colaborador = Colaborador.find(params[:id])\n\n respond_to do |format|\n if @colaborador.update_attributes(params[:colaborador])\n format.html { redirect_to @colaborador, notice: 'Colaborador was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @colaborador.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c5497f059ab1d7457ffc834ecb8f6a2",
"score": "0.61414737",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "2beb9c36d1483cf9f9f858e4023cd4f0",
"score": "0.6134703",
"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.6134703",
"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": "8f954e6f9170610153d2dd85a700ed3b",
"score": "0.6131192",
"text": "def update\n respond_to do |format|\n if @compra.update(compra_params)\n @itens = ItensCompra.where(compra_id: params[:id])\n @itens.each do |item| \n qtde = params[(\"quantidade_\" + item.id.to_s).to_sym]\n valor = params[(\"valor_\" + item.id.to_s).to_sym]\n ativo = params[(\"remover_\" + item.id.to_s).to_sym].nil? ? \"true\" : \"false\"\n\n item.update(quantidade: qtde, valor: valor, ativo: ativo)\n end\n format.html { redirect_to @compra, notice: 'Compra alterada com sucesso.' }\n format.json { render :show, status: :ok, location: @compra }\n else\n format.html { render :edit }\n format.json { render json: @compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "769d86257383708d09a54ad486babaee",
"score": "0.6126907",
"text": "def update\n @cotacao = Cotacao.find(params[:id])\n\n respond_to do |format|\n if @cotacao.update_attributes(params[:cotacao])\n format.html { redirect_to [:admin, @cotacao], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cotacao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "caf41179c4cbff0602c1a281c336832a",
"score": "0.61250085",
"text": "def update\n respond_to do |format|\n if @comarca.update(comarca_params)\n format.html { redirect_to @comarca, notice: 'Comarca foi atualizado(a) com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @comarca.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78129e2a60d24ca047134c3a44d6fed4",
"score": "0.61220086",
"text": "def update\n respond_to do |format|\n if @celula.update(celula_params)\n format.html { redirect_to @celula, notice: 'Celula was successfully updated.' }\n format.json { render :show, status: :ok, location: @celula }\n else\n format.html { render :edit }\n format.json { render json: @celula.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1023b64b94212ae456406014604bbf9e",
"score": "0.61211187",
"text": "def update\n respond_to do |format|\n if @asistencia_compra.update(asistencia_compra_params)\n format.html { redirect_to @asistencia_compra, notice: 'Asistencia compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @asistencia_compra }\n else\n format.html { render :edit }\n format.json { render json: @asistencia_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af2de3ee0e2e4161c2d399b01545b5e3",
"score": "0.6113839",
"text": "def update\n respond_to do |format|\n if @pago_compra.update(pago_compra_params)\n format.html { redirect_to @pago_compra, notice: 'Pago compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @pago_compra }\n else\n format.html { render :edit }\n format.json { render json: @pago_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "69b74d9c88a403ec8672f03383edc627",
"score": "0.61137474",
"text": "def update\n @item_compra = ItemCompra.find(params[:id])\n\n respond_to do |format|\n if @item_compra.update_attributes(params[:item_compra])\n format.html { redirect_to @item_compra, notice: 'Item Atualizado com Sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0e80b89e9a061c5b126724678ab88561",
"score": "0.6110213",
"text": "def update\n @resposta = Resposta.find(params[:id])\n\n respond_to do |format|\n if @resposta.update_attributes(params[:resposta])\n format.html { redirect_to @resposta, notice: 'Resposta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resposta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fa4095d013435c483c98dcf834e0b9f",
"score": "0.6102981",
"text": "def update\n @objeto = Objeto.find(params[:id])\n\n respond_to do |format|\n if @objeto.update_attributes(params[:objeto])\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1372856b45a7a924dc31b72a27db0324",
"score": "0.6102366",
"text": "def patch(path, params: {}, body: {})\n request(:patch, path, params: params, body: body)\n end",
"title": ""
},
{
"docid": "d61be1bf6b772dac7b77d69e032d8431",
"score": "0.6100415",
"text": "def update\n @corte = Corte.find(params[:id])\n\n respond_to do |format|\n if @corte.update_attributes(params[:corte])\n format.html { redirect_to @corte, notice: 'Corte was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @corte.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9939d104cc69ee0603b44e21eac25e30",
"score": "0.6098197",
"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": "dbb28b78ebd14a35895337cf6eecee2a",
"score": "0.6097158",
"text": "def patch(path, data = nil)\n request(:patch, path, data)\n end",
"title": ""
},
{
"docid": "b852338b5c18fd44cbfc6d870d7961e7",
"score": "0.6095066",
"text": "def update\n respond_to do |format|\n if @productos_json.update(productos_json_params)\n format.html { redirect_to @productos_json, notice: 'Productos json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @productos_json.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89dd52c322f8d15d49640912238f7373",
"score": "0.6093771",
"text": "def update\n respond_to do |format|\n if @conexao.update(conexao_params)\n format.html { redirect_to @conexao, notice: 'Conexao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @conexao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.6091208",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "6d567c3abf606f6ee286055ccca24e73",
"score": "0.6083857",
"text": "def update\n respond_to do |format|\n if @cat_compra_cancelada.update(cat_compra_cancelada_params)\n format.json { head :no_content}\n format.js\n else\n format.json { render json: @cat_compra_cancelada.errors, status: :unprocessable_entity }\n format.js { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "182b47703ed3d635eb3509780b5b19ab",
"score": "0.60784316",
"text": "def update\n @complaint = Complaint.find(params[:id])\n\n respond_to do |format|\n if @complaint.update_attributes(params[:complaint])\n format.html { redirect_to @complaint, notice: 'Complaint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bd76a24a644f6b72838892241b0bd36",
"score": "0.6076045",
"text": "def update\n @telefono = Telefono.find(params[:id])\n\n respond_to do |format|\n if @telefono.update_attributes(params[:telefono])\n format.html { redirect_to @telefono, notice: 'Telefono was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @telefono.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "208b93c209ff41715f0ccefa1503beee",
"score": "0.60716933",
"text": "def update\n @registrocompra = Registrocompra.find(params[:id])\n\n respond_to do |format|\n if @registrocompra.update_attributes(params[:registrocompra])\n format.html { redirect_to @registrocompra, notice: 'Registrocompra was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registrocompra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9d77e2c47861f36636dfcd4c24bc489",
"score": "0.6070912",
"text": "def update\n @clientetipo = Clientetipo.find(params[:id])\n\n respond_to do |format|\n if @clientetipo.update_attributes(params[:clientetipo])\n format.html { redirect_to @clientetipo, notice: 'Clientetipo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clientetipo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "68594e3ea384090b8cec310539fbc090",
"score": "0.6069483",
"text": "def update\n respond_to do |format|\n if @tipo_de_compra.update(tipo_de_compra_params)\n addlog(\"Tipo de compra atualizado\")\n format.html { redirect_to @tipo_de_compra, notice: 'Tipo de compra atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @tipo_de_compra }\n else\n format.html { render :edit }\n format.json { render json: @tipo_de_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "496a9bce087ac13d329597eadb62b8d1",
"score": "0.60686636",
"text": "def update\n respond_to do |format|\n if @compromisso.update(compromisso_params)\n format.html { redirect_to @compromisso, notice: 'Agendamento editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @compromisso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2af8331d60117a3cc1cda026da55c304",
"score": "0.60683334",
"text": "def update\n @computador = Computador.find(params[:id])\n\n respond_to do |format|\n if @computador.update_attributes(params[:computador])\n format.html { redirect_to @computador, :notice => 'Computador foi salvo com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @computador.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e410b08331dc40fde29f992ebdd48d61",
"score": "0.60640293",
"text": "def update\n respond_to do |format|\n if @servico_passeio.update(servico_passeio_params)\n format.html { redirect_to @servico_passeio, notice: 'Passeio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_passeio.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc431d5a79ffb0b2435578f410761241",
"score": "0.6063838",
"text": "def update\n respond_to do |format|\n if @modelo.update(modelo_params)\n format.html { redirect_to @modelo, notice: 'El modelo se ha actualizado' }\n #format.json { render :show, status: :ok, location: @modelo }\n format.json { respond_with_bip(@user) }\n else\n format.html { render :edit }\n #format.json { render json: @modelo.errors, status: :unprocessable_entity }\n format.json { respond_with_bip(@user) }\n end\n end\n end",
"title": ""
},
{
"docid": "1326bf4a921a2c1a7718ad3815ab546a",
"score": "0.6063074",
"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": "ebe48352101340eb805cda552d11515f",
"score": "0.60629016",
"text": "def update\n respond_to do |format|\n if @carrito_de_compra.update(carrito_de_compra_params)\n format.html { redirect_to @carrito_de_compra, notice: 'Carrito de compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @carrito_de_compra }\n else\n format.html { render :edit }\n format.json { render json: @carrito_de_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0beb3ad24a05a1093a454c50cb50c201",
"score": "0.60608387",
"text": "def update\n respond_to do |format|\n if @complaint.update(complaint_params)\n format.html { redirect_to @complaint, notice: \"Complaint was successfully updated.\" }\n format.json { render :show, status: :ok, location: @complaint }\n end\n end\n end",
"title": ""
},
{
"docid": "9d91fe8ffe79c0ce9f854a7339dc24d6",
"score": "0.606031",
"text": "def update\n #response.headers['Content-Type'] = 'application/json'\n\n if Usuario.exists?(params[:id])\n usuario = Usuario.find(params[:id])\n n_param = JSON.parse(request.body.read)\n\n #request.request_parameters\n if n_param[\"id\"]\n render json: {\"error\": \"id no es modificable\"}, status: 400\n elsif n_param.size > 1\n render json: {\"error\": \"La modificación ha fallado, solo puedes ingresar un parametro para modificar\"}, status: 500\n elsif usuario.update(usuario_params) && n_param.size == 1\n if [\"usuario\", \"nombre\", \"apellido\", \"twitter\"].include?(n_param.keys[0])\n render json: usuario, status: 200\n else\n render json: {\"error\": \"La modificación ha fallado, el atributo entregado no es válido\"}, status: 500\n end\n else\n render json: {\"error\": \"La modificación ha fallado\"}, status: 500\n end\n else\n render json: {\"error\": \"Usuario no encontrado\"}, status: 404\n end\n end",
"title": ""
},
{
"docid": "ff5b557acb5b43e5f35cd12653dc85b1",
"score": "0.605868",
"text": "def patch(path, data = {}, headers = {})\n exec_request(:patch, path, data, headers)\n end",
"title": ""
},
{
"docid": "41f03218cf39f68ceada3731c776d7e5",
"score": "0.605786",
"text": "def update\n respond_to do |format|\n if @detalle_compra.update(detalle_compra_params)\n format.html { redirect_to @detalle_compra, notice: 'Detalle compra was successfully updated.' }\n format.json { render :show, status: :ok, location: @detalle_compra }\n else\n format.html { render :edit }\n format.json { render json: @detalle_compra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0fde10e061a7291d10352f8ad9a34082",
"score": "0.6055274",
"text": "def update\n @pec_complaint = PecComplaint.find(params[:id])\n #abort params[:pec_complaint][:pec_complaint_files_attributes]['0'][:id].inspect\n\n respond_to do |format|\n if @pec_complaint.update_attributes(params[:pec_complaint])\n format.html { redirect_to @pec_complaint, notice: 'Pec complaint was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pec_complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.6053464",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "c50c05783bf596d6fc6943b05611c96e",
"score": "0.60528916",
"text": "def update\n @cargo = Cargo.find(params[:id])\n\n respond_to do |format|\n if @cargo.update_attributes(params[:cargo])\n format.html { redirect_to cargos_path, notice: 'Cargo atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cargo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bae0f686c05a01d9320a7cce21fab5e",
"score": "0.6050332",
"text": "def update\n respond_to do |format|\n if @pessoa.update(pessoa_params)\n format.html { redirect_to admin_pessoas_path, notice: 'Pessoa foi atualizada com sucesso.' }\n format.json { head :no_content }\n else\n get_dependencies\n format.html { render action: 'edit' }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e8cfdce5b0eeeba4fc38e063721573ed",
"score": "0.60459334",
"text": "def update\n @jogo = Jogo.find(params[:id])\n \n respond_to do |format|\n if (@jogo.update_attributes(params[:jogo]))\n \n # format.json { render :json => { :success => true, :jogo_id => @jogo.id, :perguntas => new_perguntas, :respostas => new_respostas }, :status => :created, :location => @jogo }\n\n format.html { redirect_to @jogo, :notice => 'Jogo was successfully updated.' }\n else\n render :edit\n end\n end\n end",
"title": ""
},
{
"docid": "95a2dc125d4707aad8498b9d305377e8",
"score": "0.60428005",
"text": "def update\n @sujet = Sujet.find(params[:id])\n\n respond_to do |format|\n if @sujet.update_attributes(params[:sujet])\n format.html { redirect_to @sujet, notice: 'Sujet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @sujet.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "768a6012c7d5ff856dec69d115bfafcc",
"score": "0.6039861",
"text": "def update\n @conta = Conta.find(params[:id])\n\n respond_to do |format|\n if @conta.update_attributes(params[:conta])\n format.html { redirect_to @conta, notice: 'Conta was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2932a12ebe4e0c923876edbedef37c08",
"score": "0.6034243",
"text": "def update\n #cancan @comentario = Comentario.find(params[:id])\n\n\n respond_to do |format|\n if @comentario.update_attributes(params[:comentario])\n format.html { redirect_to @comentario, notice: 'O comentário foi alterado com sucesso' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comentario.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b119e51db0ec07a9ac62437251af7f3d",
"score": "0.6034126",
"text": "def update\n @cotacoes = Cotacao.find(params[:id])\n\n respond_to do |format|\n if @cotacoes.update_attributes(params[:contato])\n format.html { redirect_to [:admin, @cotacoes], notice: 'Contato was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cotacoes.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4c9f7759ff2705ffd6f6fd604a431a1",
"score": "0.6033073",
"text": "def update\n respond_to do |format|\n if @pacote.update(pacote_params)\n format.html { redirect_to @pacote, notice: 'Pacote was successfully updated.' }\n format.json { render :show, status: :ok, location: @pacote }\n else\n format.html { render :edit }\n format.json { render json: @pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4c9f7759ff2705ffd6f6fd604a431a1",
"score": "0.6033073",
"text": "def update\n respond_to do |format|\n if @pacote.update(pacote_params)\n format.html { redirect_to @pacote, notice: 'Pacote was successfully updated.' }\n format.json { render :show, status: :ok, location: @pacote }\n else\n format.html { render :edit }\n format.json { render json: @pacote.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a805b76a2139747496ad0b5f97ca621",
"score": "0.60308594",
"text": "def update\n contact=Contact.find_by_id params[:id]\n if contact!= nil\n contact.apellido=params[:apellido] ? params[:apellido]: contact.apellido\n contact.email=params[:email]\n contact.nombre=params[:nombre] ? params[:nombre]: contact.nombre\n contact.puesto=params[:puesto] ? params[:puesto]: contact.puesto\n contact.telefono=params[:telefono] ? params[:telefono]: contact.telefono\n contact.clients_id=params[:clients_id] ? params[:clients_id]: contact.clients_id\n if contact.valid? && Client.exists?(contact.clients_id)\n if contact.save\n render(json: contact, status: 201 , location: contact)\n end\n end \n else \n render(json: contact.errors, status: 422)\n end\n end",
"title": ""
},
{
"docid": "83963efc5d9c3c86fbe7d7bc1886943e",
"score": "0.60293835",
"text": "def update\n respond_to do |format|\n if @objeto.update(carga_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Carga was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8030b6a3a618d66537d0f1f7e1a4175e",
"score": "0.6027561",
"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": "ba59683735b81bcde641fa7eb15984dd",
"score": "0.60260826",
"text": "def update\n @comune = Comune.find(params[:id])\n\n respond_to do |format|\n if @comune.update_attributes(params[:comune])\n format.html { redirect_to @comune, notice: 'Comune was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @comune.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abad6198dbc7d9746425adfa8e9fdd96",
"score": "0.6023228",
"text": "def update\n authorize! :update, Dependencia\n respond_to do |format|\n if @dependencia.update(dependencia_params)\n log(\"Se ha editado la dependencia #{@lt}\", 1)\n format.html { redirect_to dependencias_path, notice: 'Los datos de la dependencia fueron actualizados exitosamente.' }\n format.json { render :show, status: :ok, location: @dependencia }\n else\n format.html { render :edit }\n format.json { render json: @dependencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "609c4c0d3a0599b42557371f1a7f8c29",
"score": "0.6023187",
"text": "def update\n respond_to do |format|\n if @caixaano.update(caixaano_params)\n format.html { redirect_to @caixaano, notice: 'Caixaano was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @caixaano.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f69bdd9a9a88e6705db438c1bc347967",
"score": "0.6021318",
"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": "e1fe50073947592255d0b230d3ef7522",
"score": "0.60182",
"text": "def update\n respond_to do |format|\n if @controle_de_obra.update(controle_de_obra_params)\n format.html { redirect_to @controle_de_obra, notice: 'Controle de obra was successfully updated.' }\n format.json { render :show, status: :ok, location: @controle_de_obra }\n else\n format.html { render :edit }\n format.json { render json: @controle_de_obra.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67987b36f9d627752ee5cdb5bcd6f7a3",
"score": "0.6017448",
"text": "def patch(body: nil, path: nil, headers: nil, id: nil)\n post(body: body, path: path, headers: headers, http_method: :patch, id: id)\n end",
"title": ""
},
{
"docid": "d6dfdaf8803d1f46bbfffd837544bd65",
"score": "0.60127664",
"text": "def update\n respond_to do |format|\n if @tipo_concurso.update(tipo_de_concurso_params)\n format.html { redirect_to @tipo_concurso, notice: 'Tipo de concurso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipo_concurso.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
7e544e8567d73c5efd75f3619e4f9c10
|
Gets the rectanlge for the 'master' location
|
[
{
"docid": "0fa724d57a7e77ff1360b7a94646d27b",
"score": "0.0",
"text": "def get_active_rect\n x = screen[:width_in_pixels] * 0.5\n y = screen[:height_in_pixels] * 0.5 \n \n x,y = center_on(x,y,active_client_width,active_client_height)\n \n return x,y,active_client_width,active_client_height\n end",
"title": ""
}
] |
[
{
"docid": "b3ae024877989758c452ee03850b6f51",
"score": "0.646086",
"text": "def master\n @master\n end",
"title": ""
},
{
"docid": "639288d16fff431d3510baddd8fd2037",
"score": "0.6245357",
"text": "def master_uri\n call('getMasterUri', caller_id)\n end",
"title": ""
},
{
"docid": "4903927876d84c74daac1eaf76a58c0d",
"score": "0.6142982",
"text": "def current_master\n master = @lock.synchronize { @master }\n address_for(master)\n end",
"title": ""
},
{
"docid": "e5d388fe5c3e15fbbc8dbc0c2ec48147",
"score": "0.6138294",
"text": "def master\n @config[:master]\n end",
"title": ""
},
{
"docid": "ee92a0a8923f49d5ba7796efb1bdcfb4",
"score": "0.60530216",
"text": "def get_master(master_basename, cfg)\n File.join(File.expand_path('../../config', __FILE__), cfg['griding']['master'])\n end",
"title": ""
},
{
"docid": "f0b1787ffe5e2f6a57815f9b876bca67",
"score": "0.60025805",
"text": "def location\n rg.location\n end",
"title": ""
},
{
"docid": "5aa40b44af4813252bb9e240730b1941",
"score": "0.584676",
"text": "def full_location; end",
"title": ""
},
{
"docid": "87b348931b0c53943af4369ead84d484",
"score": "0.5813765",
"text": "def master\n options[:master_nodename]\n end",
"title": ""
},
{
"docid": "51e9cb783545e329561b8bd5acb1fe6d",
"score": "0.58093953",
"text": "def region\n root.region? ? root : nil\n end",
"title": ""
},
{
"docid": "6ed577f98f83eb00b46af0621d0ed7f0",
"score": "0.57559466",
"text": "def app_master\n @app_master\n end",
"title": ""
},
{
"docid": "fb7ba2b663492a2cb5ab09639019ca85",
"score": "0.5725562",
"text": "def master\n Settings.admin_master\n end",
"title": ""
},
{
"docid": "59110f51e7574c7a49055e01d8e456ad",
"score": "0.5707584",
"text": "def rect\n w = get_window\n w.rect\n end",
"title": ""
},
{
"docid": "452b2d3de5d63e20b0e391994794148d",
"score": "0.5705875",
"text": "def master\n super || variants_including_master.where(is_master: true).first\n end",
"title": ""
},
{
"docid": "d659ddfd714e446fa81eb51ae5f130a1",
"score": "0.57048076",
"text": "def master\n @master || (raise Errors::InvalidDatabase.new(nil))\n end",
"title": ""
},
{
"docid": "d659ddfd714e446fa81eb51ae5f130a1",
"score": "0.57048076",
"text": "def master\n @master || (raise Errors::InvalidDatabase.new(nil))\n end",
"title": ""
},
{
"docid": "62c6177cf1ed4f9a2312a928665f0e99",
"score": "0.56816506",
"text": "def get_area()\n @space.get_area()\n end",
"title": ""
},
{
"docid": "5341fa6d96a6544009a94fc635c5aa4f",
"score": "0.56768286",
"text": "def location\n @loc\n end",
"title": ""
},
{
"docid": "3355dd7400a4523c228fbc26ae1cf06e",
"score": "0.5655917",
"text": "def location\r\n @game.locations[@current_location]\r\n end",
"title": ""
},
{
"docid": "a79a9303c6e6d69b0d9b00c965799de7",
"score": "0.5653579",
"text": "def locations\n body_element = hpricot_doc.at(@content_css_selector)\n master_extractor = Extractors::Master.new(body_element)\n master_extractor.locations\n end",
"title": ""
},
{
"docid": "0a9b647c1915e7dbf6de6d13408549b7",
"score": "0.56371874",
"text": "def find_current_master\n hosts.find(&:master?)\n end",
"title": ""
},
{
"docid": "31ed654ca26a7c67f95f49a6d46fa9ac",
"score": "0.56371707",
"text": "def base_location\n read(TupleSpace::BaseLocationTuple.any).location\n end",
"title": ""
},
{
"docid": "37298245c0bbfb4ed677c826cb0695f4",
"score": "0.5630875",
"text": "def show_master\n end",
"title": ""
},
{
"docid": "37298245c0bbfb4ed677c826cb0695f4",
"score": "0.5630875",
"text": "def show_master\n end",
"title": ""
},
{
"docid": "37298245c0bbfb4ed677c826cb0695f4",
"score": "0.5630875",
"text": "def show_master\n end",
"title": ""
},
{
"docid": "d3481d29e35b2b4b19411982b1626e02",
"score": "0.5625287",
"text": "def location\n fetch('tolkien.lord_of_the_rings.locations')\n end",
"title": ""
},
{
"docid": "8707cf776e4919834e0e753cb5aeb6c7",
"score": "0.56203526",
"text": "def position\n robot_location\n end",
"title": ""
},
{
"docid": "0fb68ad34f500d7b47cfa064bc3c2c1f",
"score": "0.561887",
"text": "def rect\n @bridge.window_rect\n end",
"title": ""
},
{
"docid": "c8c49f8ab0c65b0fbe2e6963443cf71b",
"score": "0.56117016",
"text": "def master\n Master.instance\n end",
"title": ""
},
{
"docid": "ef18a346b22ed9900b9f3f7f3fa4354b",
"score": "0.5603514",
"text": "def master\n find_host_with_role :master\n end",
"title": ""
},
{
"docid": "075ed4c03fde68e9b16b75ee829126c4",
"score": "0.5580958",
"text": "def location\n return @location\n end",
"title": ""
},
{
"docid": "075ed4c03fde68e9b16b75ee829126c4",
"score": "0.5580958",
"text": "def location\n return @location\n end",
"title": ""
},
{
"docid": "075ed4c03fde68e9b16b75ee829126c4",
"score": "0.5580958",
"text": "def location\n return @location\n end",
"title": ""
},
{
"docid": "075ed4c03fde68e9b16b75ee829126c4",
"score": "0.5580958",
"text": "def location\n return @location\n end",
"title": ""
},
{
"docid": "075ed4c03fde68e9b16b75ee829126c4",
"score": "0.5580958",
"text": "def location\n return @location\n end",
"title": ""
},
{
"docid": "075ed4c03fde68e9b16b75ee829126c4",
"score": "0.5580958",
"text": "def location\n return @location\n end",
"title": ""
},
{
"docid": "075ed4c03fde68e9b16b75ee829126c4",
"score": "0.5580958",
"text": "def location\n return @location\n end",
"title": ""
},
{
"docid": "075ed4c03fde68e9b16b75ee829126c4",
"score": "0.5580958",
"text": "def location\n return @location\n end",
"title": ""
},
{
"docid": "1f9f624f6437d57a31797f18a7e7610f",
"score": "0.55747664",
"text": "def find_hbase_master(cm, cl)\n find_host_with_any_role(cm, cl, 'HM(A)', 'HM(S)', 'HM(-)')\n end",
"title": ""
},
{
"docid": "e5d9a55549d049f3abf75b3f35e1d1dc",
"score": "0.5574078",
"text": "def current_master\n return servers[@current_master_index] if @current_master_index\n return nil unless current_server\n @current_master_index = find_server_index(current_server)\n servers[@current_master_index] if @current_master_index\n end",
"title": ""
},
{
"docid": "c85b83f592e712227cd529015e7f4b9d",
"score": "0.5568802",
"text": "def starting_location\n @grid.find('@')\n end",
"title": ""
},
{
"docid": "1ad287bc83c6d75bf2a4efdf45b44aba",
"score": "0.55656016",
"text": "def current_location\n self.hardware_locations.last\n end",
"title": ""
},
{
"docid": "68c6983ffba5453c5cc4a8528e9e3d1e",
"score": "0.55479944",
"text": "def master?\n @wrapt.master?\n end",
"title": ""
},
{
"docid": "202dd58469643157d1b68f35aefcd999",
"score": "0.5545921",
"text": "def pbGetCurrentRegion(defaultRegion=-1)\n mappos = ($game_map) ? pbGetMetadata($game_map.map_id,MetadataMapPosition) : nil\n return (mappos) ? mappos[0] : defaultRegion\nend",
"title": ""
},
{
"docid": "a3b6e1fd4ff13bcb5342174a92cc66c4",
"score": "0.553211",
"text": "def location\n locations.first\n end",
"title": ""
},
{
"docid": "a0c5f0cf755147419fdde381994324b1",
"score": "0.55309296",
"text": "def current_world\n @registry.current_world\n end",
"title": ""
},
{
"docid": "b54e66af4a14f6201144517c31ccacfb",
"score": "0.55194366",
"text": "def master\n super || variants_including_master.with_deleted.where(:is_master => true).first\n end",
"title": ""
},
{
"docid": "d2b8a16fbd231ca8ccac9c9ad5e80a9e",
"score": "0.5500818",
"text": "def get_location()\n return get_string(\"getLocation\", [])\n end",
"title": ""
},
{
"docid": "1e878c9be20b5001a0d21e76e96388c3",
"score": "0.54944456",
"text": "def current_world; end",
"title": ""
},
{
"docid": "1e878c9be20b5001a0d21e76e96388c3",
"score": "0.54944456",
"text": "def current_world; end",
"title": ""
},
{
"docid": "cbc5ab18a754846c713c8ff27a0811bb",
"score": "0.5489535",
"text": "def location\n fetch('one_piece.locations')\n end",
"title": ""
},
{
"docid": "f165f6847ad75e7c8f166ecba2752bca",
"score": "0.5483591",
"text": "def master\n super || variants_including_master.with_deleted.find_by(is_master: true)\n end",
"title": ""
},
{
"docid": "6add625ea7e615cf1d929a7095f55156",
"score": "0.5453326",
"text": "def current_location\n @current_location\n end",
"title": ""
},
{
"docid": "84e74e2e230fc4193092b41c9a5ab638",
"score": "0.54513925",
"text": "def show_master\n end",
"title": ""
},
{
"docid": "84e74e2e230fc4193092b41c9a5ab638",
"score": "0.54513925",
"text": "def show_master\n end",
"title": ""
},
{
"docid": "84e74e2e230fc4193092b41c9a5ab638",
"score": "0.54513925",
"text": "def show_master\n end",
"title": ""
},
{
"docid": "84e74e2e230fc4193092b41c9a5ab638",
"score": "0.54513925",
"text": "def show_master\n end",
"title": ""
},
{
"docid": "d20b982c5c4ef28050eb351d3501840b",
"score": "0.54496783",
"text": "def ball_entry_zone\n Rectangle[@position, Point[width, 20]]\n end",
"title": ""
},
{
"docid": "85ba24cd4ed19d42875df2c8ea581c01",
"score": "0.54468125",
"text": "def current_master\n info = fetch_info\n return unless info[:role] == 'slave'\n Node.new(:host => info[:master_host], :port => info[:master_port].to_i)\n end",
"title": ""
},
{
"docid": "e3834fd91bd049b144eec6b6fd21dfba",
"score": "0.5442022",
"text": "def location\n string_command \"getLocation\"\n end",
"title": ""
},
{
"docid": "df3973c8179239c6a83668af5071c4ec",
"score": "0.54417306",
"text": "def location\n return self[:location_asserted] if self[:location_asserted]\n # TODO: stub\n return 'east' if self[:display_name] =~ /nagios__server/\n return 'east' if self[:display_name] =~ /mysql__master/\n return 'west' if self[:display_name] =~ /nagios__client/\n return 'east' if self[:display_name] =~ /ganglia server/\n return 'west' if self[:display_name] =~ /ganglia monitor/\n\n case self[:direction]\n when 'output' then 'north'\n when 'input' then 'south'\n end\n end",
"title": ""
},
{
"docid": "6844b71c2f86351b764d4c06ed39e5b9",
"score": "0.5440637",
"text": "def location\n\t\t@location\n\tend",
"title": ""
},
{
"docid": "a28e4ce105eac7a0fc63556990b4c72a",
"score": "0.54360807",
"text": "def location\n return nil if reference?\n ensure_full_data!\n @gapi.location\n end",
"title": ""
},
{
"docid": "29603de0e9c8fcbf4b1abb71c5e2dc9d",
"score": "0.5423115",
"text": "def position\n\t\t\[email protected]\n\t\tend",
"title": ""
},
{
"docid": "ba963ce2e2ffa832393b691cef7a622d",
"score": "0.54215664",
"text": "def get_primary_meep_master\n config = PuppetX::Puppetlabs::Meep::Config.new(closure_scope)\n config.list_nodes(:primary_master).first\n end",
"title": ""
},
{
"docid": "d121ee979c0ae2aa94c6eb5785e86544",
"score": "0.54200315",
"text": "def master\n self.bond_master || self.bridge_master\n end",
"title": ""
},
{
"docid": "2fdd4e5e66626c15f6f7ea07541f88b7",
"score": "0.54157627",
"text": "def location\n self\n end",
"title": ""
},
{
"docid": "5e25d257434288b38b7acb5113f5b446",
"score": "0.5410761",
"text": "def hbase_master(cm, cl)\n find_hbase_master(cm, cl)[:hostname]\n end",
"title": ""
},
{
"docid": "05fd2683c687a3e263904e2df39c23cc",
"score": "0.54102266",
"text": "def location\n if (identity = identities.detect { |i| i.respond_to?(:location) && !i.location.blank? })\n return identity.location\n end\n end",
"title": ""
},
{
"docid": "55f78d98951822a593980d76ca70c1f2",
"score": "0.54075444",
"text": "def master_class\n @master_class\n end",
"title": ""
},
{
"docid": "633b057f0089cda2f207d9d14372322a",
"score": "0.54058754",
"text": "def subwindows_position\n x = @command_window.right_corner\n y = @command_window.y\n width = Graphics.width - x - @dominations_window.width\n height = Graphics.height - y\n Rect.new(x, y, width, height)\n end",
"title": ""
},
{
"docid": "d8ec9f31c5b9c5a01f60ed0a33f182a3",
"score": "0.54021865",
"text": "def get_mksysb_location(mksysb_name)\n execute_cmd(\"lsnim -l #{mksysb_name} | awk '{if ($1 ~ /location/) print $3}'\").chomp\n end",
"title": ""
},
{
"docid": "bd5120820c49f9623c5acf8eb9368fd6",
"score": "0.54005283",
"text": "def master\n doc = db_command(:ismaster => 1)\n is_master = doc['ismaster']\n raise \"Error retrieving master database: #{doc.inspect}\" unless ok?(doc) && is_master.kind_of?(Numeric)\n case is_master.to_i\n when 1\n \"#@host:#@port\"\n else\n doc['remote']\n end\n end",
"title": ""
},
{
"docid": "f11f597c2d1906c049e96535cf56265a",
"score": "0.53972685",
"text": "def location\n fetch('games.zelda.locations')\n end",
"title": ""
},
{
"docid": "93716562747e24319b33c0724a5745df",
"score": "0.53913814",
"text": "def master_class\n self.class.master_class\n end",
"title": ""
},
{
"docid": "3ff1852bf8708634846418ff6e036ab5",
"score": "0.5385674",
"text": "def getStandByPosition()\n ## もし、架空の待機場所などを与える場合、ここに追加。\n return @base.position ;\n end",
"title": ""
},
{
"docid": "513240899313a7d24c8fa09ab86a1de0",
"score": "0.5385304",
"text": "def base_location\n my_location = self.location\n my_location.nil? ? '-' : my_location.name\n end",
"title": ""
},
{
"docid": "de62cb844c4cc39f6ada2bfec69b4041",
"score": "0.538448",
"text": "def master_class\n @master_class\n end",
"title": ""
},
{
"docid": "de62cb844c4cc39f6ada2bfec69b4041",
"score": "0.538448",
"text": "def master_class\n @master_class\n end",
"title": ""
},
{
"docid": "c9dea4574c863dd449b86bd63e237fad",
"score": "0.5382691",
"text": "def get_master_ref(papers)\n github_client.refs(papers).select { |r| r[:ref] == \"refs/heads/master\" }.first.object.sha\n end",
"title": ""
},
{
"docid": "da100479f619df02bd6ac9939a3ad986",
"score": "0.5381635",
"text": "def spawn_location\n getSpawnLocation\n end",
"title": ""
},
{
"docid": "c9dea4574c863dd449b86bd63e237fad",
"score": "0.5380354",
"text": "def get_master_ref(papers)\n github_client.refs(papers).select { |r| r[:ref] == \"refs/heads/master\" }.first.object.sha\n end",
"title": ""
},
{
"docid": "b98d9cbd625ce92e7da8bf4e8f46ae5c",
"score": "0.5376601",
"text": "def context_info()\n return @root_position.branch_info\n end",
"title": ""
},
{
"docid": "15ff10b2d519ae2c3b025937cbcda042",
"score": "0.5365527",
"text": "def get_branch_id\n current_server_guid\n end",
"title": ""
},
{
"docid": "a454ce530f08c9fb559df7e2254f878c",
"score": "0.5356807",
"text": "def current_location\n\t\tcurrent_workflow_status.status_name\n\tend",
"title": ""
},
{
"docid": "981167713db33e791208013ac165b075",
"score": "0.53566664",
"text": "def location\n @location\n end",
"title": ""
},
{
"docid": "981167713db33e791208013ac165b075",
"score": "0.53566664",
"text": "def location\n @location\n end",
"title": ""
},
{
"docid": "981167713db33e791208013ac165b075",
"score": "0.53566664",
"text": "def location\n @location\n end",
"title": ""
},
{
"docid": "02df1286ac37461c3a5dcf4caee9dfbf",
"score": "0.53534836",
"text": "def calc_geo_rect\n \t deg_radius = (@radius / MILES_PER_ARC_DEGREE).ceil\n\n \t west_long = (@center_long - deg_radius).floor\n \t east_long = (@center_long + deg_radius).ceil\n\n \t south_lat = (@center_lat - deg_radius).floor\n \t north_lat = (@center_lat + deg_radius).ceil\n\n \t [west_long, east_long, south_lat, north_lat]\n end",
"title": ""
},
{
"docid": "3af8839dfeabfd931b20aa85e079d30f",
"score": "0.53449166",
"text": "def connected_master_ids\n begin\n znodes = @zk.children(MASTER_ROOT)\n ids = znodes.map { |znode| @zk.get(File.join(MASTER_ROOT, znode)).first }\n rescue\n return nil\n end\n # the master root could exist but still have no children, so return nil\n znodes.empty? ? nil : ids\n end",
"title": ""
},
{
"docid": "4c03bc04638e251a33b737517a7dfe90",
"score": "0.53423446",
"text": "def location\n ensure_full_data!\n @gapi[\"location\"]\n end",
"title": ""
},
{
"docid": "4c03bc04638e251a33b737517a7dfe90",
"score": "0.53423446",
"text": "def location\n ensure_full_data!\n @gapi[\"location\"]\n end",
"title": ""
},
{
"docid": "4c03bc04638e251a33b737517a7dfe90",
"score": "0.53423446",
"text": "def location\n ensure_full_data!\n @gapi[\"location\"]\n end",
"title": ""
},
{
"docid": "4c03bc04638e251a33b737517a7dfe90",
"score": "0.53423446",
"text": "def location\n ensure_full_data!\n @gapi[\"location\"]\n end",
"title": ""
},
{
"docid": "4c03bc04638e251a33b737517a7dfe90",
"score": "0.53423446",
"text": "def location\n ensure_full_data!\n @gapi[\"location\"]\n end",
"title": ""
},
{
"docid": "47e7628d311f0930a2936e7c60656aae",
"score": "0.53386825",
"text": "def top_left_region_y\n central_region_y - 6\n end",
"title": ""
},
{
"docid": "2701b90d0346a5d438d3605c9f7b4757",
"score": "0.53304213",
"text": "def location\n [@x, @y, @floor]\n end",
"title": ""
},
{
"docid": "e82741a267ad7fe45f9948a3e025c94e",
"score": "0.53301734",
"text": "def location\n fetch('room.locations')\n end",
"title": ""
},
{
"docid": "7669d7a10337dd34d2b434a3edee7eca",
"score": "0.5329621",
"text": "def master=(value)\n @master = value\n end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.5329513",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.5329513",
"text": "def loc; end",
"title": ""
},
{
"docid": "b3d7c178b277afaefb1b9648335941e7",
"score": "0.5329513",
"text": "def loc; end",
"title": ""
}
] |
bad0804f9c5bc5b0a249dbfb5b385a33
|
Create our application's ESPs
|
[
{
"docid": "a37af024bb697324a2260b02aee12ae8",
"score": "0.0",
"text": "def processors(db_connection, tracker)\n [\n EventSourceryTodoApp::Projections::CompletedTodos::Projector.new(\n tracker: tracker,\n db_connection: db_connection,\n ),\n EventSourceryTodoApp::Projections::OutstandingTodos::Projector.new(\n tracker: tracker,\n db_connection: db_connection,\n ),\n EventSourceryTodoApp::Projections::ScheduledTodos::Projector.new(\n tracker: tracker,\n db_connection: db_connection,\n ),\n EventSourceryTodoApp::Reactors::TodoCompletedNotifier.new(\n tracker: tracker,\n db_connection: db_connection,\n )\n ]\nend",
"title": ""
}
] |
[
{
"docid": "c5180eb1132cf1517d095e4dbb9f32ac",
"score": "0.6475459",
"text": "def new\n puts \"Creating new blank Praxis app under #{app_name}\"\n create_root_files\n create_config\n create_app\n create_design\n create_spec\n create_docs\n end",
"title": ""
},
{
"docid": "da94a973ecc01fff15df0d80ae6d53ff",
"score": "0.5946585",
"text": "def setup_appengine_application(app, is_new_app)\n initialize_scaling_info_for_app(app)\n uac = UserAppClient.new(@userappserver_private_ip, @@secret)\n app_data = uac.get_app_data(app)\n loop {\n Djinn.log_info(\"Waiting for app data to have instance info for app named #{app}: #{app_data}\")\n\n app_data = uac.get_app_data(app)\n if app_data[0..4] != \"Error\"\n break\n end\n Kernel.sleep(5)\n }\n\n my_public = my_node.public_ip\n my_private = my_node.private_ip\n app_language = app_data.scan(/language:(\\w+)/).flatten.to_s\n \n if is_new_app and @app_info_map[app].nil?\n @app_info_map[app] = {}\n @app_info_map[app]['language'] = app_language\n end\n\n shadow = get_shadow\n shadow_ip = shadow.private_ip\n ssh_key = shadow.ssh_key\n app_dir = \"/var/apps/#{app}/app\"\n app_path = \"/opt/appscale/apps/#{app}.tar.gz\"\n FileUtils.mkdir_p(app_dir)\n \n # First, make sure we can download the app, and if we can't, throw up a\n # dummy app letting the user know there was a problem.\n if !copy_app_to_local(app)\n place_error_app(app, \"ERROR: Failed to copy app: #{app}\")\n app_language = \"python27\"\n end\n\n # Next, make sure their app has an app.yaml or appengine-web.xml in it,\n # since the following code assumes it is present. If it is not there\n # (which can happen if the scp fails on a large app), throw up a dummy\n # app.\n if !HelperFunctions.app_has_config_file?(app_path)\n place_error_app(app, \"ERROR: No app.yaml or appengine-web.xml for app \" +\n app)\n app_language = \"python27\"\n end\n\n HelperFunctions.setup_app(app)\n\n if is_new_app\n maybe_start_taskqueue_worker(app)\n end\n\n if is_new_app\n if @app_info_map[app]['nginx'].nil?\n @app_info_map[app]['nginx'] = find_lowest_free_port(Nginx::START_PORT)\n @app_info_map[app]['haproxy'] = find_lowest_free_port(\n HAProxy::START_PORT)\n @app_info_map[app]['nginx_https'] = Nginx.get_ssl_port_for_app(\n @app_info_map[app]['nginx'])\n end\n\n @app_info_map[app]['appengine'] = []\n end\n\n # Only take a new port for this application if there's no data about\n # this app. Use the existing port if there is info about it.\n nginx_port = @app_info_map[app]['nginx']\n https_port = @app_info_map[app]['nginx_https']\n proxy_port = @app_info_map[app]['haproxy']\n\n port_file = \"/etc/appscale/port-#{app}.txt\"\n if my_node.is_login?\n HelperFunctions.write_file(port_file, \"#{@app_info_map[app]['nginx']}\")\n Djinn.log_debug(\"App #{app} will be using nginx port #{nginx_port}, \" +\n \"https port #{https_port}, and haproxy port #{proxy_port}\")\n\n @nodes.each { |node|\n if node.private_ip != my_node.private_ip\n HelperFunctions.scp_file(port_file, port_file, node.private_ip,\n node.ssh_key)\n end\n }\n else\n loop {\n if File.exists?(port_file)\n Djinn.log_debug(\"Got port file for app #{app}\")\n break\n else\n Djinn.log_debug(\"Waiting for port file for app #{app}\")\n Kernel.sleep(5)\n end\n }\n end\n\n # TODO(cgb): Make sure we don't add the same cron lines in twice for the same\n # app, and only start xmpp if it isn't already started\n if my_node.is_shadow?\n CronHelper.update_cron(my_public, nginx_port, app_language, app)\n start_xmpp_for_app(app, nginx_port, app_language)\n end\n\n # We only need a new full proxy config file for new apps, on the machine\n # that runs the login service (but not in a one node deploy, where we don't\n # do a full proxy config).\n login_ip = get_login.private_ip\n if my_node.is_login?\n begin\n static_handlers = HelperFunctions.parse_static_data(app)\n Djinn.log_run(\"chmod -R +r #{HelperFunctions.get_cache_path(app)}\")\n rescue Exception => e\n # This specific exception may be a json parse error\n error_msg = \"ERROR: Unable to parse app.yaml file for #{app}.\" + \\\n \" Exception of #{e.class} with message #{e.message}\" \n place_error_app(app, error_msg)\n static_handlers = []\n end\n\n Nginx.write_fullproxy_app_config(app, nginx_port, https_port, my_public,\n my_private, proxy_port, static_handlers, login_ip)\n\n loop {\n Kernel.sleep(5)\n success = uac.add_instance(app, my_public, nginx_port)\n Djinn.log_debug(\"Add instance returned #{success}\")\n if success\n # tell ZK that we are hosting the app in case we die, so that\n # other nodes can update the UserAppServer on its behalf\n ZKInterface.add_app_instance(app, my_public, nginx_port)\n break\n end\n }\n end\n\n if my_node.is_appengine?\n # send a warmup request to the app to get it loaded - can shave a\n # number of seconds off the initial request if it's java or go\n # go provides a default warmup route\n # TODO: if the user specifies a warmup route, call it instead of /\n warmup_url = \"/\"\n\n app_manager = AppManagerClient.new(my_node.private_ip)\n # TODO(cgb): What happens if the user updates their env vars between app\n # deploys?\n if is_new_app\n @num_appengines.times { |index|\n appengine_port = find_lowest_free_port(STARTING_APPENGINE_PORT)\n Djinn.log_info(\"Starting #{app_language} app #{app} on \" +\n \"#{HelperFunctions.local_ip}:#{appengine_port}\")\n\n xmpp_ip = get_login.public_ip\n\n pid = app_manager.start_app(app, appengine_port,\n get_load_balancer_ip(), app_language, xmpp_ip,\n [Djinn.get_nearest_db_ip()], HelperFunctions.get_app_env_vars(app))\n\n if pid == -1\n place_error_app(app, \"ERROR: Unable to start application \" + \\\n \"#{app}. Please check the application logs.\")\n end\n\n # Tell the AppController at the login node (which runs HAProxy) that a\n # new AppServer is running.\n acc = AppControllerClient.new(get_login.private_ip, @@secret)\n loop {\n result = acc.add_appserver_to_haproxy(app, my_node.private_ip,\n appengine_port)\n if result == NOT_READY\n Djinn.log_info(\"Login node is not yet ready for AppServers to \" +\n \"be added - trying again momentarily.\")\n Kernel.sleep(5)\n else\n Djinn.log_info(\"Successfully informed login node about new \" +\n \"AppServer for #{app} on port #{appengine_port}.\")\n break\n end\n }\n }\n else\n Djinn.log_info(\"Restarting AppServers hosting old version of #{app}\")\n result = app_manager.restart_app_instances_for_app(app)\n end\n\n if is_new_app\n # now doing this at the real end so that the tools will\n # wait for the app to actually be running before returning\n done_uploading(app, app_path, @@secret)\n end\n end\n\n APPS_LOCK.synchronize {\n if @app_names.include?(\"none\")\n @apps_loaded = @apps_loaded - [\"none\"]\n @app_names = @app_names - [\"none\"]\n end\n\n if is_new_app\n @apps_loaded << app\n else\n @apps_to_restart.delete(app)\n end\n }\n end",
"title": ""
},
{
"docid": "ca0f49ee9f4aa01433a903c38e8e53e1",
"score": "0.58718187",
"text": "def create_app_root\n puts \"Create app root named #{name}\"\n end",
"title": ""
},
{
"docid": "8f95e7a016ecdfb94bb81a1a79d5f94d",
"score": "0.5835658",
"text": "def create_app()\n app = OpenShift::TestApplication.new(self)\n\n $logger.info(\"Created new application #{app.name} for account #{@name}\")\n\n @apps << app\n app\n end",
"title": ""
},
{
"docid": "26dfc4adfb4c32ff2c20b2aa30032453",
"score": "0.5810857",
"text": "def create_app(name, url)\n JSON.parse((@cloudvox_api[\"/applications/create.json\"].post :call_flow => {:name => name}, :agi => {:url => url}).body)\n end",
"title": ""
},
{
"docid": "83399f0f9de376bd46d1ceeafa7c7b80",
"score": "0.5796392",
"text": "def create(options)\n API::request(:post, 'escrow_service_applications', options)\n end",
"title": ""
},
{
"docid": "8047b42db62c6e41a28dde569f408a0b",
"score": "0.57055223",
"text": "def create\n megam_rest.post_appdefn(to_hash)\n end",
"title": ""
},
{
"docid": "af9f005002036c55b9e071abfa3472b3",
"score": "0.5594119",
"text": "def generate()\n app_yaml = <<CONFIG\napplication: #{@app_name}\nversion: 1\nruntime: python27\napi_version: 1\nthreadsafe: true\n\nhandlers:\n- url: /.*\n script: #{@app_name}.application\nCONFIG\n\n script = <<SCRIPT\nimport webapp2\nclass MainPage(webapp2.RequestHandler):\n def get(self):\n self.response.out.write('<html><body>')\n self.response.out.write(\"\"\"<p>Your application failed to start</p>\"\"\")\n self.response.out.write(\"\"\"<p>#{@error_msg}</p>\"\"\")\n self.response.out.write(\"\"\"<p>If this is an AppScale issue please report it on <a href=\"https://github.com/AppScale/appscale/issues\">http://github.com/AppScale/appscale/issues</a></p>\"\"\")\n self.response.out.write('</body></html>')\n\napplication = webapp2.WSGIApplication([\n ('/', MainPage),\n], debug=True)\n\nSCRIPT\n\n HelperFunctions.write_file(\"#{@dir_path}app.yaml\", app_yaml)\n HelperFunctions.write_file(\"#{@dir_path}#{@app_name}.py\", script)\n\n app_tar = \"/opt/appscale/apps/#{@app_name}.tar.gz\"\n Djinn.log_run(\"rm #{app_tar}\")\n Dir.chdir(@dir_path) do\n Djinn.log_run(\"tar zcvf #{app_tar} app.yaml #{@app_name}.py\")\n end\n\n return true\n end",
"title": ""
},
{
"docid": "62da29c70c79391bb1a3bb5f4a03bd06",
"score": "0.5585385",
"text": "def create\n # Avoid double provisioning: previous url would be \"/provision/new?apps[]=vtiger&organization_id=1\"\n session.delete('previous_url')\n\n @organization = current_user.organizations.to_a.find { |o| o.id && o.id.to_s == params[:organization_id].to_s }\n authorize! :manage_app_instances, @organization\n\n app_instances = []\n params[:apps].each do |product_name|\n app_instance = @organization.app_instances.create(product: product_name)\n app_instances << app_instance\n MnoEnterprise::EventLogger.info('app_add', current_user.id, 'App added', app_instance)\n end\n\n render json: app_instances.map(&:attributes).to_json, status: :created\n end",
"title": ""
},
{
"docid": "b653740e834cf86114a303b1585f31f3",
"score": "0.55586046",
"text": "def create_app app_name, dev_name, dev_email\n data[:app_name] = app_name\n data[:dev_name] = dev_name\n data[:dev_email] = dev_email\n end",
"title": ""
},
{
"docid": "4900e020b63868a2fd7def92aaf820c4",
"score": "0.55501544",
"text": "def create_app\n prompt = TTY::Prompt.new\n\n # get services and service providers\n service_names = DshsData.instance.get_all_service_names\n service_provider_names = DshsData.instance.service_providers.keys\n\n # client name?\n user_name = prompt.ask(\"What is your name?\")\n\n # which service?\n user_service = prompt.select(\"Which service are you making an appointment for?\", service_names, cycle: true)\n service_length = DshsData.instance.get_service_by_name.duration\n\n # which service provider? only allow user to select from service providers that offer the specified service\n possible_service_providers = []\n service_provider_names.each do |sp|\n if DshsData.instance.service_providers[sp]['services'].include? user_service\n possible_service_providers << sp\n end\n end\n\n user_sp = prompt.select(\"Which service provider are you making an appointment with?\", possible_service_providers, cycle: true)\n\n # determine whether this appointment is recurring or one-off\n recurring_or_one_off = prompt.select(\"Is this a recurring (weekly) appointment? Or a one-off appointment?\", ['recurring', 'one-off'], cycle: true)\n if recurring_or_one_off == 'recurring'\n is_recurring = true\n else\n is_recurring = false\n end\n\n # what date and time? check for conflicts while doing so\n conflict_exists = true\n while conflict_exists do\n base_date = prompt.ask(\"Appointment date (MM/DD/YYYY):\")\n break if base_date == 'q'\n # which day of the week did they specify?\n base_day = Date.strptime(base_date, \"%m/%d/%Y\").cwday\n case base_day\n when 1\n user_day = 'monday'\n when 2\n user_day = 'tuesday'\n when 3\n user_day = 'wednesday'\n when 4\n user_day = 'thursday'\n when 5\n user_day = 'friday'\n when 6\n user_day = 'saturday'\n when 7\n user_day = 'sunday'\n else\n puts base_day\n puts 'invalid day'\n end\n\n # convert date to number of days since epoch\n user_date = Date.strptime(base_date, \"%m/%d/%Y\").to_time.to_i / (60 * 60 * 24)\n\n base_time = prompt.ask(\"Appointment start time (ex: 10am or 2pm):\")\n # the following code converts user_time to an index where each hour of the day is represented by a number between 0-23\n user_time = base_time.tr('apm', '').to_i() - 1\n am_or_pm = base_time.tr('0-9', '')\n if am_or_pm == 'pm' && user_time != 11\n user_time += 12\n elsif am_or_pm == 'am' && user_time == 11\n user_time += 12\n end\n\n # check for conflicts in service_provider's availability blocks\n should_continue = false\n base_availability_override = false\n DshsData.instance.availability_blocks.each do |av|\n if (!is_recurring && av['date'] == user_date && av['service_provider_name'] == user_sp) || (is_recurring && convert_date_to_day(av['date']) == user_day)\n if user_time >= av['start_time'] && user_time < av['end_time']\n if av['is_available'] && !is_recurring\n # the override flag is set to denote that availability blocks take\n # precedence over base availability - this is used when checking\n # for conflicts in the service_provider's base availability\n base_availability_override = true\n break\n elsif av['is_available'] && is_recurring\n next\n else\n puts 'The service provider you requested is not available at this time.'.red\n puts 'Please choose a different date/time or \\'q\\' to quit.'.red\n should_continue = true\n break\n end\n end\n end\n end\n # should_continue happens if the time requested has conflicts\n # this line ends the current iteration of the loop and asks for a new date/time\n next if should_continue\n\n # check for conflicts in service_provider's base availability\n if !DshsData.instance.service_providers[user_sp]['availability'][user_day][user_time] && !base_availability_override\n puts 'The service provider you requested is not available at this time.'.red\n puts 'Please choose a different date/time or \\'q\\' to quit.'.red\n next\n end\n\n # check for conflicts in service_provider's appointments on specified day\n should_continue = false\n DshsData.instance.appointments.each do |app|\n if (!is_recurring && app['date'] == user_date && app['service_provider_name'] == user_sp) || (is_recurring && convert_date_to_day(app['date']) == user_day)\n if user_time >= app['start_time'] && user_time < (app['start_time'] + DshsData.instance.get_service_by_name(app['service_name']).duration)\n puts 'The service provider you requested already has an appointment at this time.'.red\n puts 'Please choose a different date/time or \\'q\\' to quit.'.red\n should_continue = true\n break\n end\n end\n end\n # should_continue happens if the time requested has conflicts\n # this line ends the current iteration of the loop and asks for a new date/time\n next if should_continue\n\n conflict_exists = false\n end\n\n # if no conflicts, add to appointments array\n if !conflict_exists\n if is_recurring\n # change service provider's base availability for a recurring appointment\n for index in user_time..(user_time + service_length - 1)\n DshsData.instance.service_providers[user_sp]['availability'][user_day][index] = false\n end\n end\n\n DshsData.instance.create_appointment(user_date, user_time, user_service, user_sp, user_name)\n end\nend",
"title": ""
},
{
"docid": "ecea03b64b604ea5c933b66550489bd9",
"score": "0.55496",
"text": "def generate_app(os, type = nil, template = nil, sfdx = nil)\n UI.crash!('Error: Cannot generate app without type or template.') unless(type or template)\n\n system('rm -rf tmp*/')\n system('rm -rf Android/app/build/')\n generate_command = \"./SalesforceMobileSDK-Package/test/test_force.js --os=#{os}\"\n if type\n UI.header \"Generating #{type} App\"\n generate_command.concat(\" --apptype=#{type}\")\n\n if type.start_with?('hybrid')\n generate_command.concat(' --no-plugin-update')\n end\n else\n UI.header 'Generating App from Template'\n generate_command.concat(\" --templaterepouri=#{template}\")\n end\n\n if sfdx\n generate_command.concat(' --use-sfdx')\n end\n \n result = silence_output(true) { system(generate_command) }\n UI.user_error!('Test app was not successfully created.') unless(result)\nend",
"title": ""
},
{
"docid": "56c5a1a0418bb6228fe2e1f734932c0a",
"score": "0.55231893",
"text": "def run\n ngen_auth\n @validate = Validator.new\n stack = EcoSystem.new\n @instanceparameters = stack.yaml_reader(config[:yaml])\n stack.validate = @validate\n config[:action] = 'create'\n stack.options = config\n stack.supress_output ='1'\n stack.instanceparameters = @instanceparameters\n inst_result = stack.opt_parse\n ho_hum\n \n inst_result.each do |server|\n config[:inst] = server['server']['display_name']\n instance = {}\n # puts chef_attrs = server['server']['userdata'].at(0)['chef']\n chef_attrs = server['server']['userdata'].at(0)['chef'] if !server['server']['userdata'].at(0)['chef'].nil?\n chef_attrs.each do |attr, value|\n instance[attr] = value\n end\n chef_node_configuration(instance)\n config[:chef_node_name] = config[:inst]\n inst_details = AttrFinder.new(server)\n inst_details.options = config\n inst_details.validate = @validate\n inst_details.function = 'server' \n inst = InstanceClient.new\n inst.validate = @validate\n inst.options = config\n inst.supress_output ='1'\n inst.instanceparameters = @instanceparameters\n ssh_host = inst.list_instance_ip(inst_details.compartment, inst_details.instance).at(1)\n bootstrap_for_linux_node(ssh_host).run\n node_attributes(ssh_host, 'IaaS')\n end\n end",
"title": ""
},
{
"docid": "7cc6b38516731ea9ff39cd90649f5d8a",
"score": "0.55183446",
"text": "def create_server_xml_vars\n @client_id = \"${cloud.services.#{@service_name}.connection.clientId}\"\n @client_secret = \"${cloud.services.#{@service_name}.connection.secret}\"\n @auth_url = \"${cloud.services.#{@service_name}.connection.authorizationEndpointUrl}\"\n @token_url = \"${cloud.services.#{@service_name}.connection.tokenEndpointUrl}\"\n @scope = \"${cloud.services.#{@service_name}.connection.serverSupportedScope}\"\n @issuer_identifier = \"${cloud.services.#{@service_name}.connection.issuerIdentifier}\"\n #YD 11102016 start - add PingFederate attributes\n puts '-----> Creating openidConnectClient configuration in server.xml for PingFederate'\n @grantType = \"${cloud.services.#{@service_name}.connection.grantType}\"\n @jwkEndpointUrl = \"${cloud.services.#{@service_name}.connection.jwkEndpointUrl}\"\n @signatureAlgorithm = \"${cloud.services.#{@service_name}.connection.signatureAlgorithm}\"\n @userIdentityToCreateSubject = \"${cloud.services.#{@service_name}.connection.userIdentityToCreateSubject}\"\n #YD 11102016 end - add PingFederate attributes\n parsed_vcap_app_data = JSON.parse(ENV['VCAP_APPLICATION'])\n @logger.debug(\"parsed_vcap_app_data is #{parsed_vcap_app_data}\")\n @host = parsed_vcap_app_data['uris'][0]\n end",
"title": ""
},
{
"docid": "8cc4137d1aadb2304062472b9c0e6dcd",
"score": "0.55148935",
"text": "def new_app(opts)\n api.app_new(\n applet: opts[:applet_dxid],\n name: AppSeries.construct_dxname(user.username, opts[:name], opts[:scope]),\n title: \"#{opts[:title]} \",\n summary: \" \",\n description: \"#{opts[:readme]} \",\n version: \"r#{opts[:revision]}-#{SecureRandom.hex(3)}\",\n resources: opts[:asset_dxids],\n details: { ordered_assets: opts[:asset_dxids] },\n openSource: false,\n billTo: bill_to,\n access: opts[:internet_access] ? { network: [\"*\"] } : {},\n )[\"id\"]\n end",
"title": ""
},
{
"docid": "03a17d9e087a8f34186dd15a98af18ee",
"score": "0.54883176",
"text": "def new\n\t\t@application = Application.new\t\t\n\tend",
"title": ""
},
{
"docid": "57290d52524d2397c53a7b64eb80a284",
"score": "0.5484438",
"text": "def create_app_object(appname)\n app = OpenStruct.new\n appsettings = JSON.parse(File.read(appname))\n appsettings[\"appvariables\"].each { |k,v| app.public_send(\"#{k}=\", v) }\n injectfunctions($defaultshortcuts[\"tabshash\"],appsettings[\"tabshash\"]).each { |k,v| app.public_send(\"#{k}=\", v) }\n injectfunctions($defaultshortcuts[\"fileshash\"],appsettings[\"fileshash\"]).each { |k,v| app.public_send(\"#{k}=\", v) }\n injectfunctions($defaultshortcuts[\"viewshash\"],appsettings[\"viewshash\"]).each { |k,v| app.public_send(\"#{k}=\", v) }\n return app\nend",
"title": ""
},
{
"docid": "cb485073c7917d0af9331fdef765d0f3",
"score": "0.5443805",
"text": "def create_apps_in_states(create_date: Time.current)\n\n NUM_APPS_IN_STATE.each_pair do |state, number|\n create_shf_apps_in_state(number, state, create_date: create_date)\n end\n\n end",
"title": ""
},
{
"docid": "54d9c66d9dcdb4886748b8c670470ce7",
"score": "0.543073",
"text": "def setup_files\n create_application_rb\n create_production_rb\n end",
"title": ""
},
{
"docid": "412926222e03ef709f1aab07217089bd",
"score": "0.5427184",
"text": "def create_new_app\n rake 'install --trace'\n FileUtils.rm_rf(rails_app)\n sh \"relevance_rails new #{rails_app} --database=#{database} --relevance-dev\"\n end",
"title": ""
},
{
"docid": "3f4ed780f48372a0462fec1a7ff60223",
"score": "0.5414175",
"text": "def create\n megam_rest.post_appreq(to_hash)\n end",
"title": ""
},
{
"docid": "45e12c98982932e855d844c3e06af5e7",
"score": "0.5414174",
"text": "def create(name=nil, options={})\n\t\toptions[:name] = name if name\n\t\txml(post('/apps', :app => options)).elements[\"//app/name\"].text\n\tend",
"title": ""
},
{
"docid": "acacd0d0171d5c1a5acd6558035921f9",
"score": "0.538538",
"text": "def create_shf_apps_in_state(num, state, create_date: Time.current)\n shf_apps = []\n\n num.times do\n shf_apps << create(:shf_application, state: state, created_at: create_date,\n updated_at: create_date)\n end\n\n shf_apps\n end",
"title": ""
},
{
"docid": "bfb985c2f1f160a0a8bccc13f3b76256",
"score": "0.53830844",
"text": "def configure_ks_pxe_client(options)\n options['ip'] = single_install_ip(options)\n tftp_pxe_file = options['mac'].gsub(/:/,\"\")\n tftp_pxe_file = tftp_pxe_file.upcase\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxelinux\"\n test_file = options['tftpdir']+\"/\"+tftp_pxe_file\n tmp_file = \"/tmp/pxecfg\"\n if File.symlink?(test_file)\n message = \"Information:\\tRemoving old PXE boot file \"+test_file\n command = \"rm #{test_file}\"\n execute_command(options,message,command)\n end\n pxelinux_file = \"pxelinux.0\"\n message = \"Information:\\tCreating PXE boot file for \"+options['name']+\" with MAC address \"+options['mac']\n command = \"cd #{options['tftpdir']} ; ln -s #{pxelinux_file} #{tftp_pxe_file}\"\n execute_command(options,message,command)\n if options['service'].to_s.match(/live/)\n iso_dir = options['tftpdir']+\"/\"+options['service']\n message = \"Information:\\tDetermining install ISO location\"\n command = \"ls #{iso_dir}/*.iso\"\n iso_file = execute_command(options,message,command) \n iso_file = iso_file.chomp\n install_iso = File.basename(iso_file)\n end\n if options['biostype'].to_s.match(/efi/)\n shim_efi_file = \"/usr/lib/shim/shimx64.efi\"\n if !File.exist?(shim_efi_file)\n install_package(options,\"shim\")\n end\n shim_grub_file = options['tftpdir']+\"/shimx64.efi\"\n net_efi_file = \"/usr/lib/grub/x86_64-efi/monolithic/grubnetx64.efi\"\n if !File.exist?(net_efi_file)\n install_package(options,\"grub-efi-amd64-bin\")\n end\n net_grub_file = options['tftpdir']+\"/grubx64.efi\"\n check_dir_exists(options,options['tftpdir'])\n check_dir_owner(options,options['tftpdir'],options['uid'])\n if !File.exist?(shim_efi_file)\n install_package(options,\"shim-signed\")\n end\n if !File.exist?(net_efi_file)\n install_package(options,\"grub-efi-amd64-signed\")\n end\n if !File.exist?(shim_grub_file)\n message = \"Information:\\tCopying #{shim_efi_file} to #{shim_grub_file}\"\n command = \"cp #{shim_efi_file} #{shim_grub_file}\"\n execute_command(options,message,command)\n check_file_owner(options,shim_grub_file,options['uid'])\n end\n if !File.exist?(net_grub_file)\n message = \"Information:\\tCopying #{net_efi_file} to #{net_grub_file}\"\n command = \"cp #{net_efi_file} #{net_grub_file}\"\n execute_command(options,message,command)\n check_file_owner(options,net_grub_file,options['uid'])\n end\n tmp_cfg_octs = options['ip'].split(\".\")\n pxe_cfg_octs = [] \n tmp_cfg_octs.each do |octet|\n hextet = octet.convert_base(10, 16)\n if hextet.length < 2\n hextet = \"0\"+hextet\n end\n pxe_cfg_octs.push(hextet.upcase) \n end\n pxe_cfg_txt = pxe_cfg_octs.join\n pxe_cfg_file = \"grub.cfg-\"+pxe_cfg_txt\n pxe_cfg_dir = options['tftpdir']+\"/grub\"\n check_dir_exists(options,pxe_cfg_dir)\n check_dir_owner(options,pxe_cfg_dir,options['uid'])\n pxe_cfg_file = pxe_cfg_dir+\"/\"+pxe_cfg_file\n else\n pxe_cfg_dir = options['tftpdir']+\"/pxelinux.cfg\"\n pxe_cfg_file = options['mac'].gsub(/:/,\"-\")\n pxe_cfg_file = \"01-\"+pxe_cfg_file\n pxe_cfg_file = pxe_cfg_file.downcase\n pxe_cfg_file = pxe_cfg_dir+\"/\"+pxe_cfg_file\n end\n if options['service'].to_s.match(/sles/)\n vmlinuz_file = \"/\"+options['service']+\"/boot/#{options['arch']}/loader/linux\"\n else\n if options['service'].to_s.match(/live/)\n vmlinuz_file = \"/\"+options['service']+\"/casper/vmlinuz\"\n else\n vmlinuz_file = \"/\"+options['service']+\"/images/pxeboot/vmlinuz\"\n end\n end\n if options['service'].to_s.match(/ubuntu/)\n if options['service'].to_s.match(/live/)\n initrd_file = \"/\"+options['service']+\"/casper/initrd\"\n else\n if options['service'].to_s.match(/x86_64/)\n initrd_file = \"/\"+options['service']+\"/images/pxeboot/netboot/ubuntu-installer/amd64/initrd.gz\"\n linux_file = \"/\"+options['service']+\"/images/pxeboot/netboot/ubuntu-installer/amd64/linux\"\n else\n initrd_file = \"/\"+options['service']+\"/images/pxeboot/netboot/ubuntu-installer/i386/initrd.gz\"\n end\n end\n ldlinux_link = options['tftpdir']+\"/ldlinux.c32\"\n if not File.exist?(ldlinux_link) and not File.symlink?(ldlinux_link)\n ldlinux_file = options['service']+\"/images/pxeboot/netboot/ldlinux.c32\"\n message = \"Information:\\tCreating symlink for ldlinux.c32\"\n command = \"ln -s #{ldlinux_file} #{ldlinux_link}\"\n execute_command(options,message,command)\n end\n else\n if options['service'].to_s.match(/sles/)\n initrd_file = \"/\"+options['service']+\"/boot/#{options['arch']}/loader/initrd\"\n else\n initrd_file = \"/\"+options['service']+\"/images/pxeboot/initrd.img\"\n end\n end\n if options['host-os-name'].to_s.match(/Darwin/)\n vmlinuz_file = vmlinuz_file.gsub(/^\\//,\"\")\n initrd_file = initrd_file.gsub(/^\\//,\"\")\n end\n if options['service'].to_s.match(/packer/)\n host_info = options['vmgateway']+\":\"+options['httpport']\n else\n host_info = options['hostip']\n end\n #ks_url = \"http://\"+host_info+\"/clients/\"+options['service']+\"/\"+options['name']+\"/\"+options['name']+\".cfg\"\n #autoyast_url = \"http://\"+host_info+\"/clients/\"+options['service']+\"/\"+options['name']+\"/\"+options['name']+\".xml\"\n base_url = \"http://\"+options['hostip']+\"/\"+options['name']\n if options['service'].to_s.match(/live/)\n iso_url = \"http://\"+options['hostip']+\"/\"+options['service']+\"/\"+install_iso\n end\n ks_url = \"http://\"+options['hostip']+\"/\"+options['name']+\"/\"+options['name']+\".cfg\"\n autoyast_url = \"http://\"+options['hostip']+\"/\"+options['name']+\"/\"+options['name']+\".xml\"\n install_url = \"http://\"+host_info+\"/\"+options['service']\n file = File.open(tmp_file,\"w\")\n if options['biostype'].to_s.match(/efi/)\n menuentry = \"menuentry \\\"\"+options['name']+\"\\\" {\\n\"\n file.write(menuentry)\n else\n if options['serial'] == true\n file.write(\"serial 0 115200\\n\")\n file.write(\"prompt 0\\n\")\n end\n file.write(\"DEFAULT LINUX\\n\")\n file.write(\"LABEL LINUX\\n\")\n file.write(\" KERNEL #{vmlinuz_file}\\n\")\n if options['service'].to_s.match(/live/)\n file.write(\" INITRD #{initrd_file}\\n\")\n end\n end\n if options['service'].to_s.match(/ubuntu/)\n options['ip'] = options['q_struct']['ip'].value\n install_domain = options['q_struct']['domain'].value\n install_nic = options['q_struct']['nic'].value\n options['vmgateway'] = options['q_struct']['gateway'].value\n options['netmask'] = options['q_struct']['netmask'].value\n options['vmnetwork'] = options['q_struct']['network_address'].value\n disable_dhcp = options['q_struct']['disable_dhcp'].value\n if disable_dhcp.match(/true/)\n if options['biostype'].to_s.match(/efi/)\n if options['service'].to_s.match(/live/)\n linux_file = \"/\"+options['service'].to_s+\"/casper/vmlinuz\"\n initrd_file = \"/\"+options['service'].to_s+\"/casper/initrd\"\n if options['biosdevnames'] == true\n append_string = \" linux #{linux_file} net.ifnames=0 biosdevname=0 root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url} autoinstall ds=nocloud-net;s=#{base_url}/\"\n else\n append_string = \" linux #{linux_file} root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url} autoinstall ds=nocloud-net;s=#{base_url}/\"\n end\n initrd_string = \" initrd #{initrd_file}\"\n else\n if options['biosdevnames'] == true\n append_string = \" linux #{linux_file} --- auto=true priority=critical preseed/url=#{ks_url} console-keymaps-at/keymap=us locale=en_US hostname=#{options['name']} domain=#{install_domain} interface=#{install_nic} grub-installer/bootdev=#{options['rootdisk']} netcfg/get_ipaddress=#{options['ip']} netcfg/get_netmask=#{options['netmask']} netcfg/get_gateway=#{options['vmgateway']} netcfg/get_nameservers=#{options['nameserver']} netcfg/disable_dhcp=true initrd=#{initrd_file} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" linux #{linux_file} --- auto=true priority=critical preseed/url=#{ks_url} console-keymaps-at/keymap=us locale=en_US hostname=#{options['name']} domain=#{install_domain} interface=#{install_nic} grub-installer/bootdev=#{options['rootdisk']} netcfg/get_ipaddress=#{options['ip']} netcfg/get_netmask=#{options['netmask']} netcfg/get_gateway=#{options['vmgateway']} netcfg/get_nameservers=#{options['nameserver']} netcfg/disable_dhcp=true initrd=#{initrd_file}\"\n end\n initrd_string = \" initrd #{initrd_file}\"\n end\n else\n if options['service'].to_s.match(/live/)\n if options['biosdevnames'] == true\n append_string = \" APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url} autoinstall ds=nocloud-net;s=#{base_url}/ net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url} autoinstall ds=nocloud-net;s=#{base_url}/\"\n end\n else\n if options['biosdevnames'] == true\n append_string = \" APPEND auto=true priority=critical preseed/url=#{ks_url} console-keymaps-at/keymap=us locale=en_US hostname=#{options['name']} domain=#{install_domain} interface=#{install_nic} grub-installer/bootdev=#{options['rootdisk']} netcfg/get_ipaddress=#{options['ip']} netcfg/get_netmask=#{options['netmask']} netcfg/get_gateway=#{options['vmgateway']} netcfg/get_nameservers=#{options['nameserver']} netcfg/disable_dhcp=true initrd=#{initrd_file} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND auto=true priority=critical preseed/url=#{ks_url} console-keymaps-at/keymap=us locale=en_US hostname=#{options['name']} domain=#{install_domain} interface=#{install_nic} grub-installer/bootdev=#{options['rootdisk']} netcfg/get_ipaddress=#{options['ip']} netcfg/get_netmask=#{options['netmask']} netcfg/get_gateway=#{options['vmgateway']} netcfg/get_nameservers=#{options['nameserver']} netcfg/disable_dhcp=true initrd=#{initrd_file}\"\n end\n end\n end\n else\n append_string = \" APPEND \"\n end\n else\n if options['service'].to_s.match(/sles/)\n if options['biosdevnames'] == true\n append_string = \" APPEND initrd=#{initrd_file} install=#{install_url} autoyast=#{autoyast_url} language=#{options['language']} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND initrd=#{initrd_file} install=#{install_url} autoyast=#{autoyast_url} language=#{options['language']}\"\n end\n else\n if options['service'].to_s.match(/fedora_2[0-3]/)\n if options['biosdevnames'] == true\n append_string = \" APPEND initrd=#{initrd_file} ks=#{ks_url} ip=#{options['ip']} netmask=#{options['netmask']} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND initrd=#{initrd_file} ks=#{ks_url} ip=#{options['ip']} netmask=#{options['netmask']}\"\n end\n else\n if options['service'].to_s.match(/live/)\n if options['biosdevnames'] == true\n append_string = \" APPEND net.ifnames=0 biosdevname=0 root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url}\"\n else\n append_string = \" APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=#{iso_url}\"\n end\n else \n if options['biosdevnames'] == true\n append_string = \" APPEND initrd=#{initrd_file} ks=#{ks_url} ksdevice=bootif ip=#{options['ip']} netmask=#{options['netmask']} net.ifnames=0 biosdevname=0\"\n else\n append_string = \" APPEND initrd=#{initrd_file} ks=#{ks_url} ksdevice=bootif ip=#{options['ip']} netmask=#{options['netmask']}\"\n end\n end\n end\n end\n end\n if options['text'] == true\n if options['service'].to_s.match(/sles/)\n append_string = append_string+\" textmode=1\"\n else\n append_string = append_string+\" text\"\n end\n end\n if options['serial'] == true\n append_string = append_string+\" serial console=ttyS0\"\n end\n append_string = append_string+\"\\n\"\n file.write(append_string)\n if options['biostype'].to_s.match(/efi/)\n initrd_string = initrd_string+\"\\n\"\n file.write(initrd_string)\n file.write(\"}\\n\")\n end\n file.flush\n file.close\n if options['biostype'].to_s.match(/efi/)\n grub_file = pxe_cfg_dir+\"/grub.cfg\"\n if File.exist?(grub_file)\n File.delete(grub_file)\n end\n FileUtils.touch(grub_file)\n grub_file = File.open(grub_file, \"w\")\n file_list = Dir.entries(pxe_cfg_dir)\n file_list.each do |file_name|\n if file_name.match(/cfg\\-/) and !file_name.match(/#{options['name'].to_s}/)\n temp_file = pxe_cfg_dir+\"/\"+file_name\n temp_array = File.readlines(temp_file)\n temp_array.each do |temp_line|\n grub_file.write(temp_line)\n end\n end\n end\n menuentry = \"menuentry \\\"\"+options['name']+\"\\\" {\\n\"\n grub_file.write(menuentry)\n grub_file.write(append_string)\n grub_file.write(initrd_string)\n grub_file.write(\"}\\n\")\n grub_file.flush\n grub_file.close\n grub_file = pxe_cfg_dir+\"/grub.cfg\"\n FileUtils.touch(grub_file)\n print_contents_of_file(options,\"\",grub_file)\n end\n message = \"Information:\\tCreating PXE configuration file \"+pxe_cfg_file\n command = \"cp #{tmp_file} #{pxe_cfg_file} ; rm #{tmp_file}\"\n execute_command(options,message,command)\n print_contents_of_file(options,\"\",pxe_cfg_file)\n return\nend",
"title": ""
},
{
"docid": "fd17f6be70cf8c9a64cb884c2f952734",
"score": "0.5364471",
"text": "def create(name=nil, options={})\n\t\tparams = {}\n\t\tparams['app[name]'] = name if name\n\t\txml(post('/apps', params)).elements[\"//app/name\"].text\n\tend",
"title": ""
},
{
"docid": "a7b95e53f2642b04520ba537d21f706c",
"score": "0.53512853",
"text": "def generate_python()\n app_yaml = <<CONFIG\napplication: #{@app_name}\nversion: 1\nruntime: python27\napi_version: 1\nthreadsafe: true\n\nhandlers:\n- url: /.*\n script: #{@app_name}.application\nCONFIG\n\n script = <<SCRIPT\nimport webapp2\nclass MainPage(webapp2.RequestHandler):\n def get(self):\n self.response.out.write('<html><body>')\n self.response.out.write(\"\"\"<p>Your application failed to start</p>\"\"\")\n self.response.out.write(\"\"\"<p>#{@error_msg}</p>\"\"\")\n self.response.out.write(\"\"\"<p>If this is an AppScale issue please report it on <a href=\"https://github.com/AppScale/appscale/issues\">http://github.com/AppScale/appscale/issues</a></p>\"\"\")\n self.response.out.write('</body></html>')\n\napplication = webapp2.WSGIApplication([\n ('/', MainPage),\n], debug=True)\n\nSCRIPT\n\n HelperFunctions.write_file(\"#{@dir_path}app.yaml\", app_yaml)\n HelperFunctions.write_file(\"#{@dir_path}#{@app_name}.py\", script)\n\n app_tar = \"/opt/appscale/apps/#{@app_name}.tar.gz\"\n Djinn.log_run(\"rm #{app_tar}\")\n Dir.chdir(@dir_path) do\n Djinn.log_run(\"tar zcvf #{app_tar} app.yaml #{@app_name}.py\")\n end\n\n return true\n end",
"title": ""
},
{
"docid": "fe2bc451aa35f0efe85b8b8cee5bd0ea",
"score": "0.5346762",
"text": "def setup_application\n Souffle::Daemon.change_privilege\n Souffle::Config[:server] = true if Souffle::Config[:daemonize]\n @app = Souffle::Server.new\n end",
"title": ""
},
{
"docid": "21af4b565cbfd7bfa8e0e56b5d893bb0",
"score": "0.5321448",
"text": "def create_instances\n min_count = max_count = @bs.number_of_nodes\n puts \"\\nCreating #{max_count} on-demand instance(s)\"\n options = {\n 'ClientToken' => generate_token,\n 'KeyName' => Chef::Config[:knife][:aws_ssh_key_id],\n 'InstanceType' => @bs.flavor,\n 'SubnetId' => @bs[:novpc] ? nil : @bs.subnet_id,\n 'Placement.AvailabilityZone' => @bs.mixins.az.data,\n 'SecurityGroupId' => @bs.mixins.sg.data\n }\n options['EbsOptimized'] = !! @bs[:ebs_optimized]\n\n ## REVIEW\n if ami.root_device_type == \"ebs\"\n ami_map = ami.block_device_mapping.first\n block_device_mapping = {\n 'DeviceName' => ami_map['deviceName'],\n 'Ebs.VolumeSize' => ami_map['volumeSize'].to_s,\n 'Ebs.DeleteOnTermination' => ami_map['deleteOnTermination']\n }\n options['BlockDeviceMapping'] = [block_device_mapping]\n end\n\n ## Optionally only include mapped devices\n ## This way we get all of the ephemeral drives, some unmapped however\n if @bs.mixins.volume.data[:ephemeral_available]\n ephmap = @bs.mixins.volume.data.ephemeral_available.each_with_index.map do |d,i|\n {\n 'VirtualName' => \"ephemeral#{i}\",\n 'DeviceName' => d\n }\n end\n options['BlockDeviceMapping'].concat( ephmap )\n end\n\n if (max_count == 1) and @bs[:private_ip_address]\n options['PrivateIpAddress'] = @bs.private_ip_address\n puts \"Assigning IP ADDRESS : #{options['PrivateIpAddress']}\"\n end\n\n if Chef::Config[:knife][:aws_user_data]\n begin\n options['UserData']= File.read(Chef::Config[:knife][:aws_user_data])\n rescue\n ui.warn(\"Cannot read #{Chef::Config[:knife][:aws_user_data]}:\"\\\n \" #{$!.inspect}. Ignoring option.\")\n end\n end\n\n # -----------------------------------------------------------------\n tries = 5\n print_table(options, 'Launch Config')\n begin\n puts \"\\nSending request...\"\n response = connection.run_instances(@bs.image, min_count,\n max_count, options)\n ui.msg(response.inspect)\n rescue Exception => e\n ui.warn(\"#{e.message}\\nException creating instances\")\n if (tries -= 1) <= 0\n ui.warn(\"\\n\\nMax tries reached. Exiting.\\n\\n\")\n exit 1\n else\n ui.msg(\"Trying again.\\n\")\n retry\n end\n end\n # now we have our servers\n instances = response.body['instancesSet']\n # select only instances that have instanceId key and collect those ids\n # into an array\n @bs[:instance_ids] =\n instances.select {|i| i.has_key?('instanceId')}.collect do |i|\n i['instanceId']\n end\n\n puts \"\\nNumber of instances started: #{@bs.instance_ids.size}\\n\"\n sleep 10\n puts \"Getting servers..\"\n # collect an array of servers retrieved based on the instance ids we\n # obtained above\n @bs[:servers] = @bs.instance_ids.collect do |id|\n begin\n server = connection.servers.get(id)\n rescue Exception => e\n sleep 7\n retry\n end\n raise Ec2Error.new(\"server #{id} was nil\") if server.nil?\n server\n end\n end",
"title": ""
},
{
"docid": "32f605fd9b1321c57724a4da470ae777",
"score": "0.5316729",
"text": "def configure_vs_pxe_client(client_name,client_mac,service_name)\n tftp_pxe_file = client_mac.gsub(/:/,\"\")\n tftp_pxe_file = tftp_pxe_file.upcase\n tftp_boot_file = \"boot.cfg.01\"+tftp_pxe_file\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxelinux\"\n test_file = $tftp_dir+\"/\"+tftp_pxe_file\n if !File.exists?(test_file)\n pxelinux_file = service_name+\"/usr/share/syslinux/pxelinux.0\"\n message = \"Creating:\\tPXE boot file for \"+client_name+\" with MAC address \"+client_mac\n command = \"cd #{$tftp_dir} ; ln -s #{pxelinux_file} #{tftp_pxe_file}\"\n execute_command(message,command)\n end\n pxe_cfg_dir = $tftp_dir+\"/pxelinux.cfg\"\n pxe_cfg_file = client_mac.gsub(/:/,\"-\")\n pxe_cfg_file = \"01-\"+pxe_cfg_file\n pxe_cfg_file = pxe_cfg_file.downcase\n pxe_cfg_file = pxe_cfg_dir+\"/\"+pxe_cfg_file\n ks_url = \"http://\"+$default_host+\"/\"+service_name+\"/\"+client_name+\".cfg\"\n mboot_file = \"/\"+service_name+\"/mboot.c32\"\n if $verbose_mode == 1\n puts \"Creating:\\tMenu config file \"+pxe_cfg_file\n end\n file = File.open(pxe_cfg_file,\"w\")\n if $serial_mode == 1\n file.write(\"serial 0 115200\\n\")\n end\n file.write(\"DEFAULT ESX\\n\")\n file.write(\"LABEL ESX\\n\")\n file.write(\"KERNEL #{mboot_file}\\n\")\n if $text_mode == 1\n if $serial_mode == 1\n file.write(\"APPEND -c #{tftp_boot_file} text gdbPort=none logPort=none tty2Port=com1 ks=#{ks_url} +++\\n\")\n else\n file.write(\"APPEND -c #{tftp_boot_file} text ks=#{ks_url} +++\\n\")\n end\n else\n file.write(\"APPEND -c #{tftp_boot_file} ks=#{ks_url} +++\\n\")\n end\n file.write(\"IPAPPEND 1\\n\")\n file.close\n if $verbose_mode == 1\n puts \"Created:\\tPXE menu file \"+pxe_cfg_file+\":\"\n system(\"cat #{pxe_cfg_file}\")\n end\n tftp_boot_file=$tftp_dir+\"/\"+tftp_boot_file\n esx_boot_file=$tftp_dir+\"/\"+service_name+\"/boot.cfg\"\n if $verbose_mode == 1\n puts \"Creating:\\tBoot config file \"+tftp_boot_file\n end\n copy=[]\n file=IO.readlines(esx_boot_file)\n file.each do |line|\n line=line.gsub(/\\//,\"\")\n if $text_mode == 1\n if line.match(/^kernelopt/)\n if !line.match(/text/)\n line = line.chomp+\" text\\n\"\n end\n end\n end\n if $serial_mode == 1\n if line.match(/^kernelopt/)\n if !line.match(/nofb/)\n line = line.chomp+\" nofb com1_baud=115200 com1_Port=0x3f8 tty2Port=com1 gdbPort=none logPort=none\\n\"\n end\n end\n end\n if line.match(/^title/)\n copy.push(line)\n copy.push(\"prefix=#{service_name}\\n\")\n else\n copy.push(line)\n end\n end\n File.open(tftp_boot_file,\"w\") {|file_data| file_data.puts copy}\n if $verbose_mode == 1\n puts \"Created:\\tBoot config file \"+tftp_boot_file+\":\"\n system(\"cat #{tftp_boot_file}\")\n end\n return\nend",
"title": ""
},
{
"docid": "6d7df8690b7a8d242303cb3c87734434",
"score": "0.53049445",
"text": "def create_resource(env)\n env[:ui].info(\"Creating machine\")\n\n config = env[:machine].provider_config\n vra = env[:vra]\n\n EntitledItemsCollection.fetch(env[:vra])\n .find_by_id(config.catalog_item_id)\n .request(cpus: config.cpus,\n memory: config.memory,\n requested_for: config.requested_for,\n subtenant_id: config.subtenant_id,\n lease_days: config.lease_days) { |req|\n config.extra_entries.types.each do |type|\n config.extra_entries.of_type(type).each do |k,v|\n req.set_parameter(k, type, v)\n end\n end\n }\n .join\n .machine\n end",
"title": ""
},
{
"docid": "e603e631b737e97a70bc7198616cdeda",
"score": "0.5298151",
"text": "def create_app(opts)\n app = nil\n scope = select_scope(opts[:scope])\n\n assets = Asset.accessible_by_user(user).\n where(\n state: Asset::STATE_CLOSED,\n uid: opts[:ordered_assets],\n )\n\n App.transaction do\n app_series = create_app_series(opts[:name], scope)\n release = opts.fetch(:release, UBUNTU_16)\n revision = app_series.latest_revision_app.try(:revision).to_i + 1\n\n applet_dxid = new_applet(\n opts.slice(\n :input_spec,\n :output_spec,\n :code,\n :instance_type,\n :packages,\n :internet_access,\n ),\n release,\n )\n\n app_dxid = new_app(\n opts.slice(\n :name,\n :title,\n :internet_access,\n :readme,\n ).merge(\n applet_dxid: applet_dxid,\n asset_dxids: assets.map(&:dxid),\n revision: revision,\n scope: scope,\n ),\n )\n\n api.project_remove_objects(project, [applet_dxid])\n\n app = App.create!(\n dxid: app_dxid,\n version: nil,\n revision: revision,\n title: opts[:title],\n readme: opts[:readme],\n entity_type: opts[:entity_type] || App::TYPE_REGULAR,\n user: user,\n scope: scope,\n app_series: app_series,\n input_spec: opts[:input_spec],\n output_spec: opts[:output_spec],\n internet_access: opts[:internet_access],\n instance_type: opts[:instance_type],\n ordered_assets: opts[:ordered_assets],\n packages: opts[:packages],\n code: opts[:code].strip,\n assets: assets,\n release: release,\n )\n\n app_series.update!(latest_revision_app: app)\n app_series.update!(latest_version_app: app) if Space.valid_scope?(scope)\n app_series.update!(deleted: false) if app_series.deleted?\n\n Event::AppCreated.create_for(app, user)\n end\n\n app\n end",
"title": ""
},
{
"docid": "39c8ba4581e2267fb75b1fc6e5162b8f",
"score": "0.52810794",
"text": "def service_create(name, display_name, executable_on_host,startup=2)\n\t\tif session_has_services_depend?\n\t\t\tmeterpreter_service_create(name, display_name, executable_on_host,startup)\n\t\telse\n\t\t\tshell_service_create(name, display_name, executable_on_host,startup)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5c936c5b54bcf71ba60e0e4d603beaa8",
"score": "0.5277262",
"text": "def setup_app_files\n cp HANAMI_TEMPLATES.join('config/hanami-vite.json'), config.config_path\n inject_line_after root.join('config/environment.rb'), 'environment :development do', ' middleware.use(ViteRuby::DevServerProxy, ssl_verify_none: true) if ViteRuby.run_proxy?'\n inject_line_after_last root.join('apps/web/application.rb'), 'include Web::Assets::Helpers', ' include ViteHanami::TagHelpers'\n inject_line_after root.join('apps/web/application.rb'), 'configure :development do', <<-CSP\n # Allow @vite/client to hot reload changes in development\n security.content_security_policy(\n security.content_security_policy\n .sub('script-src', \"script-src 'unsafe-eval'\")\n .sub('connect-src', \"connect-src ws://\\#{ ViteRuby.config.host_with_port }\")\n )\n CSP\n append root.join('Rakefile'), <<~RAKE\n require 'vite_hanami'\n ViteRuby.install_tasks\n RAKE\n end",
"title": ""
},
{
"docid": "b5b44dd4a2d791f6180d97748242560b",
"score": "0.52767295",
"text": "def setupApp(pia_url, app_key, app_secret)\n token = getToken(pia_url, app_key, app_secret)\n { \"url\" => pia_url,\n \"app_key\" => app_key,\n \"app_secret\" => app_secret,\n \"token\" => token }\nend",
"title": ""
},
{
"docid": "25935c7182edce902265f714133c70d4",
"score": "0.52687997",
"text": "def create\n Feature.bgp_enable if platform == :nexus\n router_bgp\n wait_for_process_initialized\n end",
"title": ""
},
{
"docid": "e402d029eb4023c226d659ac178a5cfa",
"score": "0.52612597",
"text": "def configure_vs_pxe_client(options)\n tftp_pxe_file = options['mac'].gsub(/:/,\"\")\n tftp_pxe_file = tftp_pxe_file.upcase\n tftp_boot_file = \"boot.cfg.01\"+tftp_pxe_file\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxelinux\"\n test_file = options['tftpdir']+\"/\"+tftp_pxe_file\n if options['verbose'] == true\n handle_output(options,\"Information:\\tChecking vSphere TFTP directory\")\n end\n check_dir_exists(options,options['tftpdir'])\n check_dir_owner(options,options['tftpdir'],options['uid'])\n if !File.exist?(test_file)\n message = \"Information:\\tCreating PXE boot file for \"+options['name']+\" with MAC address \"+options['mac']\n if options['biostype'].to_s.match(/efi/)\n efi_boot_file = options['service'].to_s+\"/efi/boot/bootx64.efi\"\n command = \"cd #{options['tftpdir']} ; ln -s #{efi_boot_file} #{tftp_pxe_file}\"\n else\n pxelinux_file = options['service']+\"/usr/share/syslinux/pxelinux.0\"\n command = \"cd #{options['tftpdir']} ; ln -s #{pxelinux_file} #{tftp_pxe_file}\"\n end\n execute_command(options,message,command)\n end\n pxe_cfg_dir = options['tftpdir']+\"/pxelinux.cfg\"\n if options['verbose'] == true\n handle_output(options,\"Information:\\tChecking vSphere PXE configuration directory\")\n end\n check_dir_exists(options,pxe_cfg_dir)\n check_dir_owner(options,pxe_cfg_dir,options['uid'])\n ks_url = \"http://\"+options['hostip']+\"/\"+options['name']+\"/\"+options['name']+\".cfg\"\n #ks_url = \"http://\"+options['hostip']+\"/clients/\"+options['service']+\"/\"+options['name']+\"/\"+options['name']+\".cfg\"\n mboot_file = options['service']+\"/mboot.c32\"\n if options['biostype'].to_s.match(/efi/)\n pxe_cfg_dir = options['tftpdir'].to_s+\"/\"+options['mac'].gsub(/:/,\"-\")\n check_dir_exists(options,pxe_cfg_dir)\n check_dir_owner(options,pxe_cfg_dir,options['uid'])\n else\n pxe_cfg_file1 = options['mac'].to_s.gsub(/:/,\"-\")\n pxe_cfg_file1 = \"01-\"+pxe_cfg_file1\n pxe_cfg_file1 = pxe_cfg_file1.downcase\n pxe_cfg_file1 = pxe_cfg_dir+\"/\"+pxe_cfg_file1\n pxe_cfg_file2 = options['mac'].split(\":\")[0..3].join+\"-\"+options['mac'].split(\":\")[4..5].join+\"-0000-0000-\"+options['mac'].gsub(/\\:/,\"\")\n pxe_cfg_file2 = pxe_cfg_file2.downcase\n pxe_cfg_file2 = pxe_cfg_dir+\"/\"+pxe_cfg_file2\n for pxe_cfg_file in [ pxe_cfg_file1, pxe_cfg_file2 ]\n verbose_output(options,\"Information:\\tCreating Menu config file #{pxe_cfg_file}\")\n file = File.open(pxe_cfg_file,\"w\")\n if options['serial'] == true\n file.write(\"serial 0 115200\\n\")\n end\n file.write(\"DEFAULT ESX\\n\")\n file.write(\"LABEL ESX\\n\")\n file.write(\"KERNEL #{mboot_file}\\n\")\n if options['text'] == true\n if options['serial'] == true\n file.write(\"APPEND -c #{tftp_boot_file} text gdbPort=none logPort=none tty2Port=com1 ks=#{ks_url} +++\\n\")\n else\n file.write(\"APPEND -c #{tftp_boot_file} text ks=#{ks_url} +++\\n\")\n end\n else\n file.write(\"APPEND -c #{tftp_boot_file} ks=#{ks_url} +++\\n\")\n end\n file.write(\"IPAPPEND 1\\n\")\n file.close\n print_contents_of_file(options,\"\",pxe_cfg_file)\n end\n end\n if options['biostype'].to_s.match(/efi/)\n tftp_boot_file = options['tftpdir'].to_s+\"/01-\"+options['mac'].to_s.gsub(/:/,\"-\").downcase+\"/boot.cfg\"\n else\n tftp_boot_file = options['tftpdir'].to_s+\"/\"+options['service'].to_s+\"/\"+tftp_boot_file\n end\n esx_boot_file = options['tftpdir'].to_s+\"/\"+options['service'].to_s+\"/boot.cfg\"\n if options['verbose'] == true\n handle_output(options,\"Creating:\\tBoot config file #{tftp_boot_file}\")\n end\n copy=[]\n file=IO.readlines(esx_boot_file)\n file.each do |line|\n line=line.gsub(/\\//,\"\")\n if options['text'] == true\n if line.match(/^kernelopt/)\n if not line.match(/text/)\n line = line.chomp+\" text\\n\"\n end\n end\n end\n if line.match(/^kernelopt/)\n line = \"kernelopt=ks=#{ks_url}\\n\"\n end\n if options['serial'] == true\n if line.match(/^kernelopt/)\n if not line.match(/nofb/)\n line = line.chomp+\" nofb com1_baud=115200 com1_Port=0x3f8 tty2Port=com1 gdbPort=none logPort=none\\n\"\n end\n end\n end\n if line.match(/^title/)\n copy.push(line)\n copy.push(\"prefix=#{options['service']}\\n\")\n else\n if !line.match(/^prefix/)\n copy.push(line)\n end\n end\n end\n tftp_boot_file_dir = File.dirname(tftp_boot_file)\n if options['verbose'] == true\n handle_output(options,\"Information:\\tChecking vSphere TFTP boot file directory\")\n end\n check_dir_exists(options,tftp_boot_file_dir)\n check_dir_owner(options,options['tftpdir'],options['uid'])\n check_dir_owner(options,tftp_boot_file_dir,options['uid'])\n File.open(tftp_boot_file,\"w\") {|file_data| file_data.puts copy}\n check_file_owner(options,tftp_boot_file,options['uid'])\n print_contents_of_file(options,\"\",tftp_boot_file)\n return\nend",
"title": ""
},
{
"docid": "ff561c08750be7a71b2100dfb5e83e59",
"score": "0.5231254",
"text": "def create\n @app = App.new(app_params)\n IO.popen([\"mail\", \"-s\", \"New Application request\", \"[email protected]\"], \"w\") {|f|\n f.puts @app.name;\n f.puts @app.email;\n f.puts @app.phone;\n f.puts @app.date;\n f.puts @app.employment;\n f.puts @app.currently;\n f.puts @app.looking_for;\n f.puts @app.experience;\n f.puts @app.ideas;\n f.puts @app.linkedin;\n f.puts @app.heard_from;\n f.close_write;\n }\n\n gb = Gibbon::API.new\n \n name_array = app_params[:name].split\n first_name = app_params[:name]\n last_name = \"\"\n if name_array.length > 1 && name_array[0].length > 0 && name_array[1].length > 0\n first_name = name_array[0]\n last_name = name_array[1]\n end\n puts \"subscribing new user to list\"\n \n gb.lists.subscribe({:id => \"75aba6bef3\", :email => {:email => app_params[:email]}, :merge_vars => {:FNAME => first_name, :LNAME => last_name}, :double_optin => true})\n\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to root_path, notice: \"A lovely application! We'll be in touch soon!\" }\n format.json { render :show, status: :created, location: @app }\n else\n format.html { render :new }\n format.json { render json: @app.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "223be27d53af8a81afa3e0b885dcf8cc",
"score": "0.5231246",
"text": "def new_sixjo_rack_app (next_app, options={})\n\n App.new(next_app, @routes, @helpers, @configures, options)\n end",
"title": ""
},
{
"docid": "e14a19f1a8bca76b6d4973815db25648",
"score": "0.522922",
"text": "def create\n @helocapp = Helocapp.new(params[:helocapp])\n\n respond_to do |format|\n if @helocapp.save\n flash[:notice] = 'HELOC Application was successfully sent.'\n\t\t\n\t\t#send email\n\t\tEmailer.deliver_helocapp_email(@helocapp)\n\t\t\n format.html { redirect_to(@helocapp) }\n format.xml { render :xml => @helocapp, :status => :created, :location => @helocapp }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @helocapp.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bce1051828db164430f2cc256e5a969",
"score": "0.5215942",
"text": "def faye_app(options = {})\n\t\t\t# set up the Faye logger\n\t\t\tFaye.logger = Logger.new(STDOUT)\n\t\t\tFaye.logger.level = Logger::WARN\n\t\t\t\n\t\t\tfe = FayeExtension.new(config)\n\t\t\toptions = {mount: '/faye', timeout: 25, extensions: [fe]}.merge(options)\n\t\t\tFaye::RackAdapter.new(options)\n\t\tend",
"title": ""
},
{
"docid": "72ba1b20acdb46c3aa8d0a8dbbe831ff",
"score": "0.5195325",
"text": "def exec(name)\n create_resource(name, type: 'application', binary_path: name)\n\n e_uid = SecureRandom.uuid\n\n e_name = \"#{self.name}_application_#{name}_created_#{e_uid}\"\n\n resource_group_name = \"#{self.id}_application\"\n\n def_event e_name do |state|\n state.find_all { |v| v[:hrn] == name && v[:membership] && v[:membership].include?(resource_group_name)}.size >= self.members.uniq.size\n end\n\n on_event e_name do\n resources[type: 'application', name: name].state = :running\n end\n end",
"title": ""
},
{
"docid": "761f2f27246fba8abc1e5845d7b92643",
"score": "0.51940405",
"text": "def generate_java()\n Djinn.log_run(\"cp -r /root/appscale/AppServer_Java/error_app/* #{@dir_path}\")\n app_xml =<<CONFIG\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<appengine-web-app xmlns=\"http://appengine.google.com/ns/1.0\">\n <application>#{@app_name}</application>\n <version>badversion</version>\n <threadsafe>true</threadsafe>\n\n</appengine-web-app>\nCONFIG\n \n HelperFunctions.write_file(\"#{@dir_path}/war/WEB-INF/appengine-web.xml\",\n app_xml)\n app_tar = \"/opt/appscale/apps/#{@app_name}.tar.gz\"\n Djinn.log_run(\"rm #{app_tar}\")\n Dir.chdir(@dir_path) do\n Djinn.log_run(\"tar zcvf #{app_tar} ./*\")\n end\n\n return true\n end",
"title": ""
},
{
"docid": "916ef4b79140f773acb050a81788a34f",
"score": "0.51924324",
"text": "def configure_xb_pxe_client(client_name,client_ip,client_mac,client_arch,service_name,publisher_host)\n os_version = service_name.split(/_/)[1..2].join(\".\")\n tftp_pxe_file = client_mac.gsub(/:/,\"\")\n tftp_pxe_file = tftp_pxe_file.upcase\n tmp_file = \"/tmp/pxecfg\"\n if service_name.match(/openbsd/)\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxeboot\"\n test_file = $tftp_dir+\"/\"+tftp_pxe_file\n pxeboot_file = service_name+\"/\"+os_version+\"/\"+client_arch.gsub(/x86_64/,\"amd64\")+\"/pxeboot\"\n else\n tftp_pxe_file = \"01\"+tftp_pxe_file+\".pxelinux\"\n test_file = $tftp_dir+\"/\"+tftp_pxe_file\n pxeboot_file = service_name+\"/isolinux/pxelinux.0\"\n end\n if File.symlink?(test_file)\n message = \"Removing:\\tOld PXE boot file \"+test_file\n command = \"rm #{test_file}\"\n execute_command(message,command)\n end\n message = \"Creating:\\tPXE boot file for \"+client_name+\" with MAC address \"+client_mac\n command = \"cd #{$tftp_dir} ; ln -s #{pxeboot_file} #{tftp_pxe_file}\"\n execute_command(message,command)\n if service_name.match(/coreos/)\n ldlinux_file = $tftp_dir+\"/\"+service_name+\"/isolinux/ldlinux.c32\"\n ldlinux_link = $tftp_dir+\"/ldlinux.c32\"\n if !File.exist?(ldlinux_link)\n message = \"Copying:\\tFile #{ldlinux_file} #{ldlinux_link}\"\n command = \"cp #{ldlinux_file} #{ldlinux_link}\"\n execute_command(message,command)\n end\n client_dir = $client_base_dir+\"/\"+service_name+\"/\"+client_name\n client_file = client_dir+\"/\"+client_name+\".yml\"\n client_url = \"http://\"+publisher_host+\"/clients/\"+service_name+\"/\"+client_name+\"/\"+client_name+\".yml\"\n pxe_cfg_dir = $tftp_dir+\"/pxelinux.cfg\"\n pxe_cfg_file = client_mac.gsub(/:/,\"-\")\n pxe_cfg_file = \"01-\"+pxe_cfg_file\n pxe_cfg_file = pxe_cfg_file.downcase\n pxe_cfg_file = pxe_cfg_dir+\"/\"+pxe_cfg_file\n vmlinuz_file = \"/\"+service_name+\"/coreos/vmlinuz\"\n initrd_file = \"/\"+service_name+\"/coreos/cpio.gz\"\n file = File.open(tmp_file,\"w\")\n file.write(\"default coreos\\n\")\n file.write(\"prompt 1\\n\")\n file.write(\"timeout 3\\n\")\n file.write(\"label coreos\\n\")\n file.write(\" menu default\\n\")\n file.write(\" kernel #{vmlinuz_file}\\n\")\n file.write(\" append initrd=#{initrd_file} cloud-config-url=#{client_url}\\n\")\n file.close\n message = \"Creating:\\tPXE configuration file \"+pxe_cfg_file\n command = \"cp #{tmp_file} #{pxe_cfg_file} ; rm #{tmp_file}\"\n execute_command(message,command)\n print_contents_of_file(pxe_cfg_file)\n end\n return\nend",
"title": ""
},
{
"docid": "d948cc60d6e4a25e199e03f6f0d64562",
"score": "0.5177401",
"text": "def create_enterprise(name)\n\tabq = Abiquo.new(AbiServer,AbiUser,AbiPass)\n\t# Define enterprise\n\tenterprise = Abiquo::Enterprise.new(name)\n\n\t# Create enterprise API\n\tenterprise.create\n\tenterprise.persist_enterprise\n\n\t# Assign datacenter 1 to enterprise\n\tenterprise.allow_datacenter(IdDatacenter)\n\n\t# Instanciate roles object to look for the roles links\n\troles = Abiquo::Roles.new\n\n\t# Define user\n\tuser = Abiquo::User.new(\tenterprise.name+\"_user\", 'xabiquo','user_name',\n\t\t\t\t\t\t\t\t'user_surname','[email protected]',\n\t\t\t\t\t\t\t\tenterprise.link, \n\t\t\t\t\t\t\t\troles.get_link_by_name('USER') )\n\t# Create user\n\tuser.create\n\n\t# Define admin\n\tadmin = Abiquo::User.new(\tenterprise.name+\"_admin\", 'xabiquo','admin_name',\n\t\t\t\t\t\t\t\t'admin_surname','[email protected]',\n\t\t\t\t\t\t\t\tenterprise.link, \n\t\t\t\t\t\t\t\troles.get_link_by_name('ENTERPRISE_ADMIN') )\t\t\t\t\t\t\n\t# Create admin\n\tadmin.create\n\n\tvdc = Abiquo::VirtualDatacenter.new(enterprise.link,IdDatacenter)\n\n\tenterprise.assign_ip(vdc.attach_publicIP)\nend",
"title": ""
},
{
"docid": "75bc05910ff7677972311df24e207988",
"score": "0.5173326",
"text": "def create\n\n service= params[:connector][:service]\n\n case service\n when 'Scanner'\n Scanner.connect(params[:connector])\n when 'Converter'\n Converter.connect(params[:connector])\n sleep(0.5) ##just to avoid to much going on in parallel, should not be needed, just better\n Converter.run_conversion(Page.for_batch_conversion)\n when 'Hardware'\n Hardware.connect(params[:connector])\n sleep(0.5)\n Hardware.blink_ok_status_led\n Hardware.watch_scanner_button_on\n when 'TouchSwitch'\n TouchSwitch.connect(params[:connector])\n else\n raise \"Create Connection with unkown service: #{service}\"\n end\n\n push_app_status\n head :ok\n end",
"title": ""
},
{
"docid": "54d40ee593014b2f68f4ba71babebc35",
"score": "0.51701856",
"text": "def spAdd\n provider_name = $prompt.ask('Provider Name:')\n provider_phone = $prompt.ask('Provider Phone Number:')\n $all_sp.push(ServiceProvider.new(provider_name, provider_phone, [], {}, []))\n successPrint()\n end",
"title": ""
},
{
"docid": "0fe557f7a0995a84cf25c7ca343e755c",
"score": "0.51693887",
"text": "def create\n create_checkpoints\n create_config_base\n generate_deploy_files\n generate_hiera_template\n end",
"title": ""
},
{
"docid": "92b9fd78be841e09760859ab4b8751ea",
"score": "0.51678807",
"text": "def create\r\n @icons_app.each do |k,v|\r\n v.create\r\n end\r\n # local variables\r\n \r\n refresh_settings\r\n \r\n #splitter position\r\n gfxgui_settings = @app_settings['guigfx']\r\n \r\n # window size\r\n ww = gfxgui_settings[:ww_mainwin]\r\n hh = gfxgui_settings[:hh_mainwin]\r\n \r\n # continue to insert item into giochi menu\r\n FXMenuSeparator.new(@giochimenu)\r\n FXMenuCommand.new(@giochimenu, \"Opzioni\").connect(SEL_COMMAND, method(:mnu_cuperativa_options))\r\n FXMenuSeparator.new(@giochimenu)\r\n FXMenuCommand.new(@giochimenu, \"&Esci\").connect(SEL_COMMAND, method(:onCmdQuit))\r\n \r\n # Reposition window to specified x, y, w and h\r\n position(0, 0, ww, hh)\r\n \r\n # Create the main window and canvas\r\n super \r\n # Show the main window\r\n show(PLACEMENT_SCREEN)\r\n \r\n # default game or last selected\r\n game_type = @app_settings[\"curr_game\"]\r\n #p @supported_game_map\r\n # initialize only an enabled game. An enabled game is a supported game.\r\n # Game disabled are not in the @supported_game_map. This to avoid to build poperties and\r\n # custom widgets\r\n if @supported_game_map[game_type]\r\n if @supported_game_map[game_type][:enabled]\r\n initialize_current_gfx(game_type)\r\n end\r\n else\r\n # default game is not supported, initialize the first enable game\r\n @log.debug(\"Default game not enabled, look for the first enabled one\")\r\n @supported_game_map.each do |k, game_info_h|\r\n game_type = k\r\n if game_info_h[:enabled]\r\n initialize_current_gfx(game_type)\r\n break\r\n end\r\n end\r\n end\r\n log_sometext(\"Benvenuta/o nella Cuperativa versione #{VER_PRG_STR}\\n\")\r\n @log.info(\"TheApp Create OK\") \r\n end",
"title": ""
},
{
"docid": "9d4603cfba8ff86f8be238086789897e",
"score": "0.51676667",
"text": "def createApplicationDefinition(args)\n app_uri = args[0]\n app_name = args[1]\n\n properties = args[2]\n blockApp = s(:block, nil)\n block_index = 1\n\n properties[:options].each do |k,v|\n if k != \"properties\"\n begin\n # attributes\n next if [\"uri\", \"name\"].include?(k)\n if k == \"version\"\n v_values = v.split(\".\")\n sexp = version(v_values)\n else \n sexp = attr_assgn(k, v)\n end\n blockApp[block_index] = sexp\n block_index += 1\n rescue\n next\n end\n else\n # properties\n v.each do |prop,prop_v|\n options = s(:hash, nil)\n h_i = 1\n prop_v[:options].each do |opt,opt_v|\n options[h_i] = s(:lit, opt.to_sym)\n v = nil\n is_sym_value = (opt == \"dynamic\" or opt == \"type\")\n is_int_value = (opt == \"order\")\n need_bool_sexp = (opt == \"dynamic\")\n need_lit_sexp = (opt == \"type\" or opt == \"order\")\n v = opt_v.to_sym if is_sym_value\n v = opt_v.to_i if is_int_value\n options[h_i + 1] = s(v) if need_bool_sexp\n options[h_i + 1] = s(:lit, v) if need_lit_sexp\n h_i += 2\n end\n #options = s(:block, options)\n mnemonic = s_str(prop_v[:mnemonic])\n description = s_str(prop_v[:description].to_s)\n blockApp[block_index] = defProperty(prop, description, mnemonic, options)\n block_index += 1\n end\n end\n end\n\n # measurements\n unless properties[:measures].nil?\n properties[:measures].each do |ms, fields|\n blockMetrics = s(:block, nil)\n bMetrics_index = 1\n fields.each do |name, type|\n blockMetrics[bMetrics_index] = defMetric(name, type) \n bMetrics_index += 1\n end\n blockApp[block_index] = defMeasurement(ms, blockMetrics)\n block_index += 1\n end\n end\n \n return defApplication(app_uri, app_name, blockApp)\n end",
"title": ""
},
{
"docid": "611fc5de248975b2b337b737210b2329",
"score": "0.5160455",
"text": "def appFX\n appEM.app\nend",
"title": ""
},
{
"docid": "e0c29e0ff7c84d3a49d8fa9f1b99d80c",
"score": "0.5158034",
"text": "def cfs_kit_launch_app(screen, app)\n\n\n if (app == \"UPDATE_TUTORIAL\")\n # An exception will report any errors \n if cfs_kit_create_tutorial_screen\n prompt (\"Successfuly created tutorial screen file #{tutorial_scr_file}\\nusing #{tutorial_def_file}\")\n end\n elsif (app == \"PROTO_APPP\")\n #TODO - Investigate generic text table editor or tutorial screen\n\t Cosmos.run_process(\"ruby lib/OskCfeFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/cfs_kit/file_server/cfe_es_syslog.dat'\")\n\t #Cosmos.run_process(\"ruby lib/OskTxtFileViewer -f '/mnt/hgfs/OpenSatKit/cosmos/test.json'\")\n #require 'osk_tbl_editor'\n #Cosmos.run_process(\"ruby lib/OskTblEditor\")\n\t #require 'cfs_fcx_cmdgen'\n #Cosmos.run_process(\"ruby lib/CfsFcxCmdGen\")\n #Cosmos.run_process(\"ruby tools/ConfigEditor\")\n #Cosmos::OskTblEditor.run\n #Cosmos.run_cosmos_tool('ConfigEditor')\n\n elsif (app == \"TUTORIAL\")\n cfs_kit_launch_tutorial_screen\n end\n\nend",
"title": ""
},
{
"docid": "cd47b0203ebee8615854d497a55e5cd6",
"score": "0.5153041",
"text": "def create_server\n\n end",
"title": ""
},
{
"docid": "eea42063e6e63bfdbc973c2ae9af2397",
"score": "0.51457846",
"text": "def initialize\n @applications = []\n @current_config = Eye::Config.new\n\n Celluloid::logger = Eye::Logger.new('celluloid')\n Eye::SystemResources.setup\n\n info \"starting #{Eye::ABOUT} (#{$$})\"\n end",
"title": ""
},
{
"docid": "74c6ec57dfffbb248253cbf6ce508415",
"score": "0.5139678",
"text": "def create\n megam_rest.post_marketplaceapp(to_hash)\n end",
"title": ""
},
{
"docid": "74c6ec57dfffbb248253cbf6ce508415",
"score": "0.5139678",
"text": "def create\n megam_rest.post_marketplaceapp(to_hash)\n end",
"title": ""
},
{
"docid": "23f0c539ea56f78f7430fd98d3f1ad3a",
"score": "0.51177275",
"text": "def provision\n FileUtils.rm_f('.env')\n FileUtils.ln_s(\"#{compose_dir}/#{Ros.env}.env\", '.env')\n # return unless gem_version_check\n # TODO: make build its own rake task and method\n if options.build\n services.each_pair do |name, config|\n next if config&.enabled.eql? false\n compose(\"build #{name}\")\n end\n return\n end\n if options.initialize\n compose(\"up wait\")\n services.each do |name, config|\n next if config&.enabled.eql? false\n prefix = config.ros ? 'app:' : ''\n compose(\"run --rm #{name} rails #{prefix}ros:db:reset:seed\")\n end\n end\n compose_options = options.daemon ? '-d' : ''\n compose(\"up #{compose_options}\")\n if options.initialize\n %x(cat ros/services/iam/tmp/#{Settings.platform.environment.partition_name}/postman/222_222_222-Admin_2.json)\n end\n end",
"title": ""
},
{
"docid": "4f2c62ccd21b6dbb999aedfd44ffe243",
"score": "0.51160574",
"text": "def create_manifests_node\n Bebox::Provision.add_node_to_step_manifests(self.project_root, self)\n end",
"title": ""
},
{
"docid": "cd98eddde5699b9bb058b98190b44fb7",
"score": "0.511398",
"text": "def app; @app; end",
"title": ""
},
{
"docid": "38ea7e173ef4e39d445a88214f5eac3d",
"score": "0.5108183",
"text": "def start app, &block\n # run available process types\n app[\"ps\"].each do |type,ps|\n ps[\"scale\"].times do |index|\n host = GV::Valley::Runner.random_service \n app[\"ps\"][type][\"containers\"] << host.start(app[\"name\"], type, index, &block)\n end\n end\n end",
"title": ""
},
{
"docid": "487d31eac82910913437cc50ffd58d2b",
"score": "0.51042205",
"text": "def initialize(app); end",
"title": ""
},
{
"docid": "7cac69b567fb2500a623ab5b707a3bab",
"score": "0.5103461",
"text": "def run\n # Change the working directory to the directory of this script.\n Dir.chdir(File.dirname(__FILE__)) \n\n # if LIST_TECHNIQUES is true, just output available evasion techniques.\n if datastore['LIST_TECHNIQUES'] == true\n print_available_techniques()\n else\n payload = datastore['PAYLOAD']\n payload_options = datastore['PAYLOAD_OPTIONS']\n output_directory = datastore['OUTPUT_DIRECTORY']\n executable_name = datastore['EXECUTABLE_NAME']\n evasion_stack = datastore['EVASION_STACK']\n msfvenom_path = datastore['MSFVENOM_PATH']\n\n if payload == nil\n print_error(\"PAYLOAD must be set.\")\n return \n end\n if output_directory == nil \n print_error(\"OUTPUT_DIRECTORY must be set.\")\n return\n end\n if executable_name == nil \n print_error(\"EXECUTABLE_NAME must be set.\") \n return\n end\n if msfvenom_path == \"\"\n # Guess at path to msfvenom\n msfvenom_path = Dir.pwd[0..(Dir.pwd.index(\"pro\")+3)]+\"msf3/msfvenom\"\n print_status(\"MSFVENOM_PATH not specified. Hoping msfvenom can be found at \"+msfvenom_path+\".\")\n end\n\n binary_generated = generate_binary(msfvenom_path, payload, payload_options)\n if binary_generated\n print_status(\"Payload binary generated successfully.\")\n print_status(\"Generating evasive source from generated binary.\")\n\n generate_evasive_source(evasion_stack)\n\n executable_generated = generate_executable(output_directory+\"/\"+executable_name)\n\n if executable_generated\n print_status(\"Executable successfully generated.\")\n else\n print_error(\"Unable to generate executable.\")\n end\n else\n print_error(\"Payload generation with msfvenom failed.\")\n end\n\n print_status(\"Cleaning up temporary files.\")\n\n if File.exist?('tmp/bin'+self.uuid+'.c')\n File.delete('tmp/bin'+self.uuid+'.c')\n end\n if File.exist?('tmp/evasive'+self.uuid+'.c')\n File.delete('tmp/evasive'+self.uuid+'.c')\n end\n\n end\n end",
"title": ""
},
{
"docid": "57135211c485a622ed3a1ec91d3d046c",
"score": "0.5098636",
"text": "def create_vapp_from_template(vdc, vapp_name, vapp_description, vapp_templateid, poweron=false)\n builder = Nokogiri::XML::Builder.new do |xml|\n xml.InstantiateVAppTemplateParams(\n \"xmlns\" => \"http://www.vmware.com/vcloud/v1.5\",\n \"xmlns:xsi\" => \"http://www.w3.org/2001/XMLSchema-instance\",\n \"xmlns:ovf\" => \"http://schemas.dmtf.org/ovf/envelope/1\",\n \"name\" => vapp_name,\n \"deploy\" => \"true\",\n \"powerOn\" => poweron) {\n xml.Description vapp_description\n xml.Source(\"href\" => \"#{@api_url}/vAppTemplate/#{vapp_templateid}\")\n }\n end\n\n params = {\n \"method\" => :post,\n \"command\" => \"/vdc/#{vdc}/action/instantiateVAppTemplate\"\n }\n\n response, headers = send_request(params, builder.to_xml, \"application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml\")\n\n vapp_id = headers[:location].gsub(\"#{@api_url}/vApp/vapp-\", \"\")\n\n task = response.css(\"VApp Task[operationName='vdcInstantiateVapp']\").first\n task_id = task[\"href\"].gsub(\"#{@api_url}/task/\", \"\")\n\n { :vapp_id => vapp_id, :task_id => task_id }\n end",
"title": ""
},
{
"docid": "d0a058ecda8b54588eb6efe67e8d3a2a",
"score": "0.5097313",
"text": "def export\n\t\tapp = self.app || File.basename( self.engine.directory )\n\t\tuser = self.user || app\n\n\t\tunless @servicedir.exist?\n\t\t\tsay \"Creating #{@servicedir}...\"\n\t\t\[email protected]\n\t\tend\n\n\t engine.each_process do |name, process|\n\t\t\tsay \"Setting up %s-%s service directories...\" % [ app, name ]\n\t\t\tcount = engine.formation[ name ]\n\t\t\tsay \" concurrency = #{count}\"\n\t\t\tnext unless count >= 1\n\n\t\t\t# Create a numbered service dir for each instance if there are\n\t\t\t# more than one\n\t\t\tif count != 1\n\t\t\t\t1.upto( count ) do |i|\n\t\t\t\t\tself.write_servicedir( app, name, i, process, true )\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tself.write_servicedir( app, name, 1, process )\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "c15dfedd7107cb6b4fa66c5c93dbcf6f",
"score": "0.50707656",
"text": "def app; end",
"title": ""
},
{
"docid": "f33ad91d0bdece25a00a176d9c412e2f",
"score": "0.50690675",
"text": "def startApplication(name)\n ctxt = @applications[name]\n raise OEDLIllegalArgumentException.new(:group, :name) unless ctxt\n ctxt.startApplication(self)\n \n# raise \"SHOULDN'T #{ctxt}\"\n# debug(\"Starting application '\", name, \"'\")\n# if (ctxt == nil)\n# raise \"Unknown application '#{name}' (#{@applications.keys.join(', ')})\"\n# end\n#\n# # With OMLv2 the collection server can be started as soon as EC is running\n# # Thus we comment this line and start the OML Server in the main nodehandler.rb file\n# #OmlApp.startCollectionServer\n#\n# app = ctxt[:app]\n# bindings = ctxt[:bindings]\n# env = ctxt[:env]\n# appDef = app.appDefinition\n# procName = \"app:#{name}\"\n# cmd = [procName, 'env', '-i']\n# if (env != nil)\n# env.each {|name, value|\n# cmd << \"#{name}=#{value}\"\n# }\n# end\n#\n# cmd << appDef.path\n# pdef = appDef.properties\n# # check if bindings contain unknown parameters\n# if (bindings != nil)\n# if (diff = bindings.keys - pdef.keys) != []\n# raise \"Unknown parameters '#{diff.join(', ')}'\" \\\n# + \" not in '#{pdef.keys.join(', ')}'.\"\n# end\n# cmd = appDef.getCommandLineArgs(procName, bindings, self, cmd)\n# end\n# send(:exec, *cmd)\n end",
"title": ""
},
{
"docid": "9443338315f8b427a8d8527957c6f61f",
"score": "0.50650173",
"text": "def setup_create\n\t\traise NotImplementedError, \"machine_create is not implemented\"\n\tend",
"title": ""
},
{
"docid": "a0507810ccc90bb93425b916ae83826e",
"score": "0.5061037",
"text": "def create_application_id(application_name)\n applicaiton_id = VaultDriver.generate_uid\n applicaiton_create_uri = URI(@url + \"auth/#{application_name}/map/app-id/#{applicaiton_id}\")\n req = Net::HTTP::Post.new(applicaiton_create_uri)\n req['X-Vault-Token'] = @token\n res = Net::HTTP.start(applicaiton_create_uri.hostname, applicaiton_create_uri.port) do |http|\n req.body = { 'value' => 'root', 'display_name' => application_name.to_s }.to_json\n http.request(req)\n end\n [applicaiton_id, res.code.to_i]\n end",
"title": ""
},
{
"docid": "fcabfa32c7a2e9f287e026dcfc4769a6",
"score": "0.50427276",
"text": "def app_mgmt_launch_app(screen, app)\r\n\r\n if (app == \"Eclipse\")\r\n\t\tspawn(\"sudo #{Cosmos::USERPATH}/../eclipse/eclipse/eclipse\")\r\n elsif (app == \"AppGen\")\r\n\t\tspawn(\"java -jar #{CFS_KIT_GEN_APP_DIR}/CreateApp.jar\")\r\n elsif (app == \"APP_SUMMARY\")\r\n display(\"CFS_KIT APP_SUMMARY_SCREEN\",50,50)\r\n else\r\n prompt(\"Error in screen definition file. Undefined commmand sent to app_mgmt_launch_app()\")\r\n end\r\n\r\nend",
"title": ""
},
{
"docid": "a03013f9d912488b61d3181910ee76ec",
"score": "0.5038226",
"text": "def create_appliction_set(application_name, keys)\n results = {}\n code = unlock_vault(keys)\n return code, nil if code > 399\n code = init_application(application_name)\n return code, nil if code > 399\n results[:app_id], code = create_application_id application_name\n return code, results if code > 399\n results[:user_id], code = create_user(application_name, results[:app_id])\n return code, results if code > 399\n results[:user_data], code = create_user_token(results[:user_id], results[:app_id], application_name)\n return code, results if code > 399\n [200, results]\n end",
"title": ""
},
{
"docid": "bcb33e14b22b05793c97e972358f0b88",
"score": "0.50371665",
"text": "def initialize\n @applications = []\n @current_config = Eye::Config.new\n\n Celluloid::logger = Eye::Logger.new('celluloid')\n Eye::SystemResources.cache\n\n info \"starting #{Eye::ABOUT} (#{$$})\"\n end",
"title": ""
},
{
"docid": "12599ad2b73d2258178308d97a14a7d6",
"score": "0.50361305",
"text": "def create(args = nil)\n # Connects to the xmpp-client that is used for sending xmpp-messages\n @send_client = connect(@@send_client_info)\n \n # Connect to xmpp-client that is used for receiving messages that are then turn into http-requests\n @receive_client = connect(@@receive_client_info)\n runMessageReceiver\n \n # Ensures that xmpp-server has node: home/host/<host>/<node_account>/contexts\n XmppHelper::createContextGeneralNode\n\n end",
"title": ""
},
{
"docid": "5c2b74c5fce3262ffdb2b4b850e8d97e",
"score": "0.50316054",
"text": "def create_new_application_for_offering(offering, student, appl)\r\n\t\tappl_for_offering = ApplicationForOffering.new\r\n\t\tappl_for_offering.offering_id = offering.id\r\n\t\tappl_for_offering.person_id = student.id\r\n\t\tappl_for_offering.project_title = appl.PROJECT_TITLE\r\n\t\tif appl.PROJECT_DESCRIPTION.nil?\r\n\t\t\tappl_for_offering.project_description = appl.PROJECT_TITLE\r\n\t\telse\r\n\t\t\tappl_for_offering.project_description = appl.PROJECT_DESCRIPTION\r\n\t\tend\r\n\t\tappl_for_offering.hours_per_week = appl.HOURS\r\n\t\tappl_for_offering.special_notes = appl.COMMENT\r\n\t\tappl_for_offering.attended_info_session = (appl.InfoSession ? appl.InfoSession.abs : nil)\r\n#\t\tputs \" App for offering - offering id: #{appl_for_offering.offering_id.to_s} from student id: #{appl_for_offering.person_id.to_s}\"\r\n\t\t\r\n\t\t# Add in the how did you find out text\r\n\t\thear_string = []\r\n\t\tif appl.Find_out_email != 0\r\n\t\t\thear_string << \" Found out by Email\"\r\n\t\tend\r\n\t\tif appl.Find_out_advisor_staff != 0\r\n\t\t\thear_string << \" Found out from Advisor Staff\"\r\n\t\tend\r\n\t\tif appl.Find_out_faculty != 0\r\n\t\t\thear_string << \" Found out from Faculty\"\r\n\t\tend\r\n\t\tif appl.Find_out_otherstudents != 0\r\n\t\t\thear_string << \" Found out from Other Students\"\r\n\t\tend\r\n\t\tif appl.Find_out_web != 0\r\n\t\t\thear_string << \" Found out from the Web\"\r\n\t\tend\r\n\t\tif appl.Find_out_other != nil\r\n\t\t\thear_string << appl.Find_out_other.to_s\r\n\t\tend\r\n\t\tappl_for_offering.how_did_you_hear = hear_string.join(\"; \")\r\n#\t\tputs \" Heard from: \" + appl_for_offering.how_did_you_hear\r\n\t\t\r\n\t\tappl_for_offering.save! # Save the application\r\n\t\t\r\n\t\t# Add in application_awards entries\r\n\t\tquarters_req = [appl.Q1_REQ, appl.Q2_REQ, appl.Q3_REQ]\r\n\t\tquarters_req.each do |quarter_req|\r\n\t\t\tunless quarter_req.nil?\r\n\t\t\t\tclean_quarter = quarter_req.downcase.gsub(/\\s/,'') # Removes any spaces\r\n\t\t\t\tif clean_quarter =~ /^[asw][ipu][0-9][0-9]$/\r\n\t\t\t\t\t# Change the year to the full year\r\n\t\t\t\t\tyear_abbr = clean_quarter[2,2]\r\n\t\t\t\t\tyear = case year_abbr.to_i\r\n\t\t\t\t\t\twhen 0..10 then \"20\" + year_abbr\r\n\t\t\t\t\t\telse \"19\" + year_abbr\r\n\t\t\t\t\tend\r\n\t\t\t\t\t# Figure out the quarter code\r\n\t\t\t\t\tquarter = case clean_quarter[0,2]\r\n\t\t\t\t\t\twhen \"wi\" then 1\r\n\t\t\t\t\t\twhen \"sp\" then 2\r\n\t\t\t\t\t\twhen \"su\" then 3\r\n\t\t\t\t\t\telse 4\r\n\t\t\t\t\tend\r\n\t\t\t\t\tquarter_id = Quarter.find_easily(quarter,year).id\r\n#\t\t\t\t\tputs \" Quarter requested: #{quarter.to_s} - #{year.to_s} - Quarter ID: #{quarter_id} \"\r\n\t\t\t\t\t\r\n\t\t\t\t\tappl_award = ApplicationAward.new\r\n\t\t\t\t\tappl_award.application_for_offering_id = appl_for_offering.id\r\n\t\t\t\t\tappl_award.requested_quarter_id = quarter_id\r\n\t\t\t\t\tappl_award.amount_requested_notes = \"This quarter should not have an amount. The total requested is in the last record.\"\r\n\t\t\t\t\tappl_award.amount_awarded_notes = \"On file with the Dean's Office\"\r\n\t\t\t\t\tappl_award.amount_approved_notes = \"On file with the Dean's Office\"\r\n\t\t\t\t\tappl_award.amount_disbersed_notes = \"On file with the Jodene\"\r\n\t\t\t\t\tappl_award.save!\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\t\tunless appl.AMOUNT_REQ.nil?\r\n\t\t\t# Make a NOTE about what this is doing\r\n\t\t\t# Puts in the amount Requested into the first Application Award entry or makes one if no quarters requested was listed\r\n\t\t\tappl_award = ApplicationAward.find(:first, :conditions => {:application_for_offering_id => appl_for_offering.id});\r\n\t\t\tunless appl_award.nil?\r\n\t\t\t\tappl_award.amount_requested = appl.AMOUNT_REQ.to_i\r\n\t\t\t\tappl_award.amount_requested_notes = \"This is the total amount requested over all quarters.\"\r\n#\t\t\t\tputs \" Appended amount requested: #{appl_award.amount_requested}\"\r\n\t\t\telse\r\n\t\t\t\tappl_award = ApplicationAward.new\r\n\t\t\t\tappl_award.application_for_offering_id = appl_for_offering.id\r\n\t\t\t\tappl_award.requested_quarter_id = offering.quarter_offered_id\r\n\t\t\t\tappl_award.amount_requested = appl.AMOUNT_REQ.to_i\r\n\t\t\t\tappl_award.amount_requested_notes = \"This is the total amount requested, the quarter is the same as the offering becuase there was no requested quarter information.\"\r\n#\t\t\t\tputs \" Created amount requested: #{appl_award.amount_requested}\"\r\n\t\t\t\tappl_award.amount_awarded_notes = \"On file with the Dean's Office\"\r\n\t\t\t\tappl_award.amount_approved_notes = \"On file with the Dean's Office\"\r\n\t\t\t\tappl_award.amount_disbersed_notes = \"On file with the Jodene\"\r\n\t\t\tend\r\n\t\t\tappl_award.save!\r\n\t\tend\r\n\t\t\r\n\t\t# !!!!!!!!!!!!!!!! Incomplete or Late needs to be handled here !!!!!!!!!!!!!!!!\r\n\t\t\r\n\t\t# Add in note about the number of prior quarters spent researching\r\n\t\tif appl.QUARTER_OF_RESEARCH.to_i > 0\r\n\t\t\tappl_for_offering.notes << Note.create(:note => \"Number of quarters of research prior to this application: #{appl.QUARTER_OF_RESEARCH.to_s}\",:creator_name => \"Migration Controller\")\r\n\t\tend\r\n\t\t\r\n\t\treturn appl_for_offering\r\n\t\t\r\n\tend",
"title": ""
},
{
"docid": "c9260b47a02128768a2d22b97e797bf1",
"score": "0.50304127",
"text": "def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to(@app, :notice => 'App was successfully created.') }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c9260b47a02128768a2d22b97e797bf1",
"score": "0.50304127",
"text": "def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n format.html { redirect_to(@app, :notice => 'App was successfully created.') }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "83622a97fcec8a2746e0c55cf3f17929",
"score": "0.5022959",
"text": "def start_app\nend",
"title": ""
},
{
"docid": "9dbbd1b2ce92183180b70c1c2099ae33",
"score": "0.5019527",
"text": "def create\n @app = App.new(params[:app])\n\n respond_to do |format|\n if @app.save\n flash[:notice] = 'App was successfully created.'\n format.html { redirect_to(app_path(@app)) }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6dde925d7f76ae40757520ead1b76049",
"score": "0.5016252",
"text": "def create\n @visaapp = Visaapp.new(params[:visaapp])\n\n respond_to do |format|\n if @visaapp.save\n\t\t\n flash[:notice] = 'Visa Card application has been successfully submitted to the Credit Union.'\n\t\t#send email\n\t\tEmailer.deliver_visaapp_email(@visaapp)\n format.html { redirect_to(@visaapp) }\n format.xml { render :xml => @visaapp, :status => :created, :location => @visaapp }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @visaapp.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "935f9b6233f983d042d1e9c6521ee32d",
"score": "0.5014344",
"text": "def ship_app\n\t`make --directory #{config.shipit_makefile_path} #{config.shipit_command}`\n end",
"title": ""
},
{
"docid": "7b6d5e899a6922bc45324e7f1626f43a",
"score": "0.50127906",
"text": "def main\n\n operations.make\n \n operations.each {|op|\n new_experimental_plt = op.output(OUTPUT).collection\n note = op.input(NOTE).val.to_s\n if note != '' || note != nil || note != ' '\n note_entered = true\n key = 'Note'\n Item.find(new_experimental_plt.id).associate key.to_sym, note\n end\n show {\n title \"New Experimental Plate Created\"\n separator\n note \"Output Item: <b>#{new_experimental_plt}</b>\"\n bullet \"Output Object Type: <b>#{new_experimental_plt.object_type.name}</b>\"\n (note_entered) ? (bullet \"Note: <b>#{note}</b>\") : nil\n }\n }\n \n return {}\n \n end",
"title": ""
},
{
"docid": "2022935598390f0091cb81b01ae2bc22",
"score": "0.50101274",
"text": "def create_openstack_instances(nodes, credentials, thread_pool_size)\n #defaults\n threads_pool = Util::ThreadPool.new(thread_pool_size)\n key = credentials[:os_ssh_key] || 'ankus'\n groups = credentials[:os_sec_groups] || %w(ankus)\n flavor_id = credentials[:os_flavor]\n image_id = credentials[:os_image_ref]\n os = create_openstack_connection\n conn = os.create_connection\n ssh_key = File.expand_path('~/.ssh') + \"/#{key}\"\n ssh_user = credentials[:os_ssh_user]\n server_objects = {} # hash to store server object to tag mapping { tag => server_obj }\n\n begin\n unless os.valid_connection?(conn)\n @log.error 'Failed establishing connection to openstack, check your credentials'\n else\n @log.debug \"Sucessfully authnticated with openstack\"\n end\n rescue Excon::Errors::Timeout\n @log.error 'Cannot establish connection to openstack. Reason: ' + \"#{$!.message} (#{$!.class})\"\n @log.error 'Please check the url is reachable'\n exit 1\n end\n\n # Create key pairs and security groups\n os.create_kp_sg!(conn, key, groups)\n\n @log.info 'Creating servers with roles: ' + \"#{nodes.keys.join(',')}\".blue + ' ...'\n begin\n nodes.each do |tag, _|\n server_objects[tag] = os.create_server!(\n conn,\n tag,\n key,\n flavor_id,\n image_id,\n groups\n )\n end\n rescue Excon::Errors::BadRequest\n raise \"Failed creating instances, reason: #{$!.message} (#{$!.class})\"\n end\n\n # wait for servers to get created (:state => running)\n @log.info 'Waiting for cloud instances to get created ...'\n os.wait_for_servers(server_objects.values)\n\n # attach floating ip's to instances\n @log.info 'Attaching floating ip(s) to instances'\n nodes.each do |tag, _|\n os.associate_address!(conn, server_objects[tag])\n end\n\n # build the return string\n nodes.each do |tag, node_info|\n # fill in nodes hash with public and private dns\n node_info[:fqdn] = server_objects[tag].public_ip_address\n node_info[:private_ip] = server_objects[tag].private_ip_address\n end\n if @mock\n # pretend doing some work while mocking\n nodes.each do |tag, info|\n threads_pool.schedule do\n if info[:config][:volumes] > 0\n @log.debug \"Preparing attached volumes on instance #{server_objects[tag].public_ip_address}\" if @debug\n sleep 5\n else\n @log.debug \"Waiting for instance to become ssh'able #{server_objects[tag].public_ip_address} \" +\n \"with ssh_user: #{ssh_user} and ssh_key: #{ssh_key}\" if @debug\n end\n end\n end\n threads_pool.shutdown\n else\n # partition and format attached disks using thread pool\n nodes.each do |tag, info|\n threads_pool.schedule do\n if info[:config][:volumes] > 0\n @log.debug \"Formatting attached volumes on instance #{server_objects[tag].public_ip_address}\" if @debug\n os.attach_volumes!(server_objects[tag], info[:config][:volumes], info[:config][:volume_size])\n #build partition script\n partition_script = gen_partition_script(info[:config][:volumes], info[:config][:volume_mount_prefix], true)\n tempfile = Tempfile.new('partition')\n tempfile.write(partition_script)\n tempfile.close\n # wait for the server to be ssh'able\n Util::SshUtils.wait_for_ssh(server_objects[tag].public_ip_address, ssh_user, ssh_key)\n # upload and execute the partition script on the remote machine\n Util::SshUtils.upload!(\n tempfile.path,\n '/tmp',\n server_objects[tag].public_ip_address,\n ssh_user,\n ssh_key,\n @log,\n 22,\n )\n output = Util::SshUtils.execute_ssh!(\n \"chmod +x /tmp/#{File.basename(tempfile.path)} /tmp/#{File.basename(tempfile.path)} tee /var/log/bootstrap_volumes.log\",\n server_objects[tag].public_ip_address,\n ssh_user,\n ssh_key,\n @log,\n 22,\n true, # execute using sudo\n true # long running job\n )\n tempfile.unlink # delete the tempfile\n if @debug\n @log.debug \"Stdout on #{server_objects[tag].public_ip_address}\"\n puts \"\\r#{output[server_objects[tag].public_ip_address][0]}\"\n @log.debug \"Stderr on #{server_objects[tag].public_ip_address}\"\n puts \"\\r#{output[server_objects[tag].public_ip_address][1]}\"\n @log.debug \"Exit code from #{server_objects[tag].public_ip_address}: #{output[server_objects[tag].public_ip_address][2]}\"\n end\n else\n # if not waiting for mounting volumes, wait for instances to become sshable\n @log.debug \"Waiting for instance '#{server_objects[tag].public_ip_address}' to become ssh'albe using \" +\n \"username: '#{ssh_user}' and key: '#{ssh_key}'\" if @debug\n Util::SshUtils.wait_for_ssh(server_objects[tag].public_ip_address, ssh_user, ssh_key)\n end\n end\n end\n threads_pool.shutdown\n @log.debug 'Finished creating and attaching volumes' if @debug\n end\n nodes\n end",
"title": ""
},
{
"docid": "cdf3d33a95ac2a41e09c85d00b2f498e",
"score": "0.5009484",
"text": "def create_esb_server (config, hostname, ip1, ip2)\n config.vm.define hostname do |esb|\n esb.vm.provider \"virtualbox\" do |provider|\n provider.customize [\"modifyvm\", :id, \"--memory\", 2048]\n end\n\n esb.vm.network \"private_network\", ip: ip1\n esb.vm.host_name = hostname\n\n esb.vm.network \"private_network\", ip: ip2\n end\nend",
"title": ""
},
{
"docid": "d6596f124f4b99991b798fc275d88c14",
"score": "0.500846",
"text": "def create_instance(credentials, image_id, opts)\n new_vapp = nil\n vapp_opts = {} #assemble options to pass to Fog::Terremark::Real.instantiate_vapp_template\n terremark_hwp = hardware_profiles(credentials, {:name => 'default'}).first #sanity check values against default\n name = opts[:name]\n if not name\n name = \"inst#{Time.now.to_i}\"\n end\n if name.length > USER_NAME_MAX\n raise \"Parameter name must be #{USER_NAME_MAX} characters or less\"\n end\n unless ( (terremark_hwp.include?(:cpu, opts[:hwp_cpu].to_i)) &&\n (terremark_hwp.include?(:memory, opts[:hwp_memory].to_i)) ) then\n raise Deltacloud::Exceptions::ValidationFailure.new(\n StandardError.new(\"Error with cpu and/or memory values. you said cpu->#{opts[:hwp_cpu]} and mem->#{opts[:hwp_memory]}\")\n )\n end\n vapp_opts['cpus'] = opts[:hwp_cpu]\n vapp_opts['memory'] = opts[:hwp_memory]\n safely do\n terremark_client = new_client(credentials)\n#######\n#FIXME# what happens if there is an issue getting the new vapp id? (eg even though created succesfully)\n#######\n vapp_id = terremark_client.instantiate_vapp_template(name, image_id, vapp_opts).body['href'].split('/').last\n new_vapp = terremark_client.get_vapp(vapp_id)\n return convert_instance(new_vapp, terremark_client, credentials.user) #return an Instance object\n end\n end",
"title": ""
},
{
"docid": "f5a2c480c3dae80f9413ea6e9190abe5",
"score": "0.500266",
"text": "def new_project(name)\n path = File.expand_path(name)\n if Dir.exist?(path)\n say \"#{path} already exists. Please choose a directory name that doesn't already exist.\".red\n exit\n end\n\n @gz_info = new_global_zone\n @gz_info.serialize(path)\n\n say \"You have now configured your SmartOS virtual infrastructure. Inspect it, then run \"\\\n \"'smartos up' to build it!\".green\n end",
"title": ""
},
{
"docid": "75545aae36f97aa1e9a9cc61faca6094",
"score": "0.5002304",
"text": "def app(create=false)\r\n @app_integration_instance = nil if create\r\n @app_integration_instance ||= new_session do |sess|\r\n sess.host! \"www.example.com\"\r\n end\r\nend",
"title": ""
},
{
"docid": "e3486b552bce263848ebfdaf26ce2ec4",
"score": "0.5000349",
"text": "def create\n @app = Mms::App.new(params[:mms_app])\n\n respond_to do |format|\n if @app.save\n flash[:notice] = '新建组件成功!'\n format.html { redirect_to(@app) }\n format.xml { render :xml => @app, :status => :created, :location => @app }\n else\n flash[:notice] = '新建组件失败!'\n format.html { render :action => \"new\" }\n format.xml { render :xml => @app.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b6ab229cb158523425a2285aeb42860",
"score": "0.49992922",
"text": "def setup\n\n setup_path\n save_application_details\n add_jvm_args\n rename_server_instance\n\n \"/bin/sh ./#{SETUP_ENV_SCRIPT}\"\n end",
"title": ""
},
{
"docid": "5ef3cb3c5352bd5cb7e3e53aba21f027",
"score": "0.49956518",
"text": "def create\n @app_instance = AppInstance.new(app_instance_params)\n\n respond_to do |format|\n if @app_instance.save\n format.html { redirect_to @app_instance, notice: 'App instance was successfully created.' }\n format.json { render action: 'show', status: :created, location: @app_instance }\n else\n format.html { render action: 'new' }\n format.json { render json: @app_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fce8e6b9c24d84d32573f5af2c32997a",
"score": "0.49940082",
"text": "def generate_RunScript\n file_list = Array.new\n\n\n # Get Verilog File list fro Project File\n add_opt = nil\n case @Mode\n when \"ICE\"\n printf \"@I:Open orj file .. #{@PRJ}\\n\"\n open(\"#{@PRJ}\").each do |line|\n if /^add_file\\s+-verilog\\s+\\\"(.*)\\\"/ =~ line\n file_list << $1\n end\n end\n @TopModule = \"EVA_TOP\"\n add_opt = \"--disenable_auto_reflect\"\n add_modify_inst = \"chiptop,chiptop.chip,chiptop.chip.socket,port_iobuf\"\n if @ICEVer == nil\n printf(\"@E:Not Found ICE Version\\n\")\n exit\n end\n when \"Device\"\n printf \"@I:Open orj file .. #{@Library}\\n\"\n open(\"#{@Library}\").each do |line|\n if /`include\\s+\\\"(.*)\\\"/ =~ line\n file_list << $1\n end\n end\n @ICEVer = nil\n add_modify_inst = \"socket,port*_iobuf\"\n end\n\n # make directory\n dir_name = @ProductName + \"_\" + @DevVer\n Common.make_dir(dir_name)\n dir_name = dir_name + \"/\" + @Mode\n Common.make_dir(dir_name)\n\n # Generate List File\n file = dir_name + \"/\" + @ProductName + \"_\" + @DevVer + \".list\"\n printf \"@I:generate VerilogList File .. #{file}\\n\" \n f = open(\"#{file}\",\"w\")\n file_list.each do |verilog|\n f.printf \"#{verilog}\\n\"\n end\n f.close\n\n # Genrate Startup Run-Script\n file = dir_name + \"/run_Startup.sh\"\n printf \"@I:generate #{file}\\n\"\n f = open(\"#{file}\",\"w\")\n \n f.print <<EOB\n#!/bin/sh\n#############################################################\n#\n# FICE 2.0 Trial Environment using #{@ProductName}\n#\n#############################################################\n\n## BASE SETTING #################\n\nFICE=/home/m0001/rl0003/product/div-micom-ice/data/proj/RL78/Common/FICE/trunk\nFMAKE=${FICE}/bin/FMake.rb\n\nRUBY=/home/product/div-micom-ice/data/proj/RL78/Common/local/ruby/bin/ruby\n\n#################################\n\nVERILOG_LIST=./#{@ProductName}_#{@DevVer}.list\nTOP_MODULE=#{@TopModule}\nPRODUCT=#{@ProductName}\nDEV_VER=#{@DevVer}\nICE_VER=#{@ICEVer}\nADD_MODIDY_INST=#{add_modify_inst}\n\n${RUBY} ${FMAKE} --startup ${VERILOG_LIST} --top_module ${TOP_MODULE} --product ${PRODUCT} --dev_ver ${DEV_VER} --ice_ver ${ICE_VER} --add_modify_inst ${ADD_MODIDY_INST} #{add_opt} --verbose\n\nEOB\n f.close\n File.chmod(0744,\"#{file}\")\n\n # Genrate Startup Run-Script\n file = dir_name + \"/run_Analyze.sh\"\n printf \"@I:generate #{file}\\n\"\n f = open(\"#{file}\",\"w\")\n f.print <<EOB\n#!/bin/sh\n#############################################################\n#\n# FICE 2.0 Trial Environment using G1C\n# - Analyze Mode\n#\n#############################################################\n\n## BASE SETTING #################\n\nFICE=/home/m0001/rl0003/product/div-micom-ice/data/proj/RL78/Common/FICE/trunk\nFMAKE=${FICE}/bin/FMake.rb\n\nRUBY=/home/product/div-micom-ice/data/proj/RL78/Common/local/ruby/bin/ruby\n\n#################################\n\nCONF=./#{@ProductName}.conf\n\n${RUBY} ${FMAKE} --analyze ${CONF} --verbose\n\nEOB\n f.close\n File.chmod(0744,\"#{file}\")\n\n\n # Genrate Run-Script\n file = dir_name + \"/run.sh\"\n @ShellFiles << [dir_name,File.basename(file)]\n printf \"@I:generate #{file}\\n\"\n f = open(\"#{file}\",\"w\")\n f.print <<EOB\n#!/bin/sh\n#############################################################\n#\n# FICE 2.0 Trial Environment using G1C\n# - Startup/Analyze Mode\n#\n#############################################################\n\n./run_Startup.sh > startup.log\n./run_Analyze.sh > analyze.log\n\nEOB\n f.close\n File.chmod(0744,\"#{file}\")\n\n\n printf \"\\nFinished Successfully\\n\"\n\n end",
"title": ""
},
{
"docid": "f9d017ee01a2a99aab3b0eff16c5592f",
"score": "0.49920604",
"text": "def create!(name: nil, primary_language: nil, version: nil, sku: nil, bundle_id: nil, bundle_id_suffix: nil, company_name: nil, platform: nil, platforms: nil, itunes_connect_users: nil)\n puts(\"The `version` parameter is deprecated. Use `ensure_version!` method instead\") if version\n client.create_application!(name: name,\n primary_language: primary_language,\n sku: sku,\n bundle_id: bundle_id,\n bundle_id_suffix: bundle_id_suffix,\n company_name: company_name,\n platform: platform,\n platforms: platforms,\n itunes_connect_users: itunes_connect_users)\n end",
"title": ""
},
{
"docid": "7c749474c6367cdd853dd3b9d52eb152",
"score": "0.49913272",
"text": "def call(env)\n env['crossbeams.appname'] = @appname\n env['crossbeams.banner'] = @template if @template\n @app.call(env)\n end",
"title": ""
},
{
"docid": "4e1dbcb0da91d5f2a4ed641d4658b7b4",
"score": "0.49832484",
"text": "def setup\n\n setup_path\n save_application_details\n add_jvm_args\n rename_server_instance\n\n \"/bin/bash ./#{SETUP_ENV_SCRIPT}\"\n end",
"title": ""
},
{
"docid": "192fc2b46b8f85bcf9f1d818c0d06870",
"score": "0.4982146",
"text": "def create(gear, quota_blocks=nil, quota_files=nil, sshkey_required=false, initial_deployment_dir_required=true)\n app = gear.application\n result = nil\n (1..10).each do |i|\n args = build_base_gear_args(gear, quota_blocks, quota_files, sshkey_required)\n\n # set the secret token for new gear creations\n # log an error if the application does not have its secret_token set\n if app.secret_token.present?\n args['--with-secret-token'] = app.secret_token\n else\n Rails.logger.error \"The application #{app.name} (#{app._id.to_s}) does not have its secret token set\"\n end\n\n args['--with-initial-deployment-dir'] = initial_deployment_dir_required\n\n mcoll_reply = execute_direct(@@C_CONTROLLER, 'app-create', args)\n\n begin\n result = parse_result(mcoll_reply, gear)\n rescue OpenShift::OOException => ooex\n # destroy the gear in case of failures\n # the UID will be unreserved up as part of rollback\n destroy(gear, true)\n\n # raise the exception if this is the last retry\n raise ooex if i == 10\n\n result = ooex.resultIO\n if result != nil && result.exitcode == 129 && has_uid_or_gid?(gear.uid) # Code to indicate uid already taken\n gear.uid = reserve_uid\n app.save!\n else\n raise ooex\n end\n else\n break\n end\n end\n result\n end",
"title": ""
}
] |
569cad785c2be1251ac9aad26d1c2783
|
GET /t_odos/1 or /t_odos/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "a9f95d6224e58027497fd887406a9ccb",
"score": "0.6401195",
"text": "def show\n @os = Os.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @os }\n end\n end",
"title": ""
},
{
"docid": "3b3333ff09797eecee6dfe5447cd6102",
"score": "0.63960445",
"text": "def show\n @os = Os.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @os }\n end\n end",
"title": ""
},
{
"docid": "62c7dfbf133fc985cbd9487d02e3e2e0",
"score": "0.6218247",
"text": "def index\n @t_odos = TOdo.all\n end",
"title": ""
},
{
"docid": "442b6d8b8eb5bc7114161302de6ff61b",
"score": "0.62152743",
"text": "def os\n params = { command: 'server_os', id: server_id }\n get('/json.php', params)\n end",
"title": ""
},
{
"docid": "5c71ad2e63efc9e3fdf546475e5d569d",
"score": "0.6185868",
"text": "def show\n @otu = Otu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @otu }\n end\n end",
"title": ""
},
{
"docid": "f25640a48176e269392fb4196a8c32ed",
"score": "0.61437976",
"text": "def index\n screen_name(\"Admin-Indice-OTs\")\n @ots = Ot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ots }\n end\n end",
"title": ""
},
{
"docid": "769b4c42a6162250b9626b1feb979b7a",
"score": "0.60930824",
"text": "def call_omdb_api(options)\n search_params = case\n when options[:title] then { s: options[:title] }.to_query\n when options[:id] then { i: options[:id], plot: \"full\"}.to_query\n end\n\n request_url = \"http://www.omdbapi.com/?\" + search_params\n JSON(HTTParty.get request_url)\n end",
"title": ""
},
{
"docid": "05651cb178c38962d269afde1aa2b937",
"score": "0.60836834",
"text": "def index\n @oss = apply_scopes(Os).order(\"#{sort_column} #{sort_direction}\").page(params[:page]).per(NUMERO_POR_PAGINA)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @oss }\n end\n end",
"title": ""
},
{
"docid": "ab34bb34c40148fe27e4a9839982a080",
"score": "0.60651964",
"text": "def show\n @ordo = Ordo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ordo }\n end\n end",
"title": ""
},
{
"docid": "542411bbb5f75c07454bae3a052b07b3",
"score": "0.6017454",
"text": "def index\n screen_name(\"Admin-Indice-Tipos-OT\")\n @ot_types = OtType.order(\"name ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ot_types }\n end\n end",
"title": ""
},
{
"docid": "59654649ed22f204d11edc056ef91067",
"score": "0.600663",
"text": "def show\n screen_name(\"Admin-Mostrar-OT\")\n @ot = Ot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ot }\n end\n end",
"title": ""
},
{
"docid": "66ccbf17c31a1d47d3a12a1560789c8d",
"score": "0.59877354",
"text": "def get_aos_version(args = {}) \n get(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "9d8da5209ff0e26298b2d9496f3845dd",
"score": "0.59422034",
"text": "def list_active_aos_versions(args = {}) \n get(\"/aosversions.json/\", args)\nend",
"title": ""
},
{
"docid": "c25aabf91532b47eda4117fb7d2fcaaf",
"score": "0.59402096",
"text": "def listing(options={})\n path = \"\"\n options= {:query =>options}\n OodleResponse.from_xml(get(path, options))\n end",
"title": ""
},
{
"docid": "1a3fb7a040f2a4a5b56131cad155974b",
"score": "0.5930655",
"text": "def index\n @oss = apply_scopes(Os).order(\"#{sort_column} #{sort_direction}\").page(params[:page]).per(NUMERO_POR_PAGINA)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @oss }\n end\n end",
"title": ""
},
{
"docid": "c0c6f996a481af45d1dcad0c3fba20ed",
"score": "0.5918383",
"text": "def show\n @estado_odt = EstadoOdt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estado_odt }\n end\n end",
"title": ""
},
{
"docid": "4a96bad2424136bffb535a5ee4349b7f",
"score": "0.5888829",
"text": "def index\n @osoby = Osoba.all\n\n respond_to do |format|\n format.html # index.html.erb\n #format.json { render json: @osoby }\n end\n end",
"title": ""
},
{
"docid": "a0d00727f73767719634e0984b0bd956",
"score": "0.58813655",
"text": "def index\n @ovos = Ovo.all\n end",
"title": ""
},
{
"docid": "a9f3a84b85295d8e5be8a876b78b264f",
"score": "0.58713216",
"text": "def get_ontology\n if params[:oid]\n @ontology = @bioportal.get_ontology(params[:oid])\n @terms = @ontology.get_terms\n end\n render :partial => \"/bioportals/get_ontology\"\n end",
"title": ""
},
{
"docid": "b859d68a9f70bc3bab94d6a9eb63380a",
"score": "0.5807544",
"text": "def index\n @ots = Ot.all\n end",
"title": ""
},
{
"docid": "569f7f427db9c40a299de12f3f6cc81d",
"score": "0.5785842",
"text": "def request_api\n response = Excon.get(\n \"https://opentdb.com/api.php?amount=10&category=9&difficulty=easy&type=multiple\",\n\n )\n return nil if response.status != 200\n puts response\n JSON.parse(response.body)\n end",
"title": ""
},
{
"docid": "f835dd603ce08f39a89a1350066b11a9",
"score": "0.57711065",
"text": "def index\n @orgaos = Orgao.all\n\n render json: @orgaos\n end",
"title": ""
},
{
"docid": "b4d9911175cfd15c62f20e114b182bcc",
"score": "0.57700425",
"text": "def show\n screen_name(\"Admin-Mostrar-Tipo-OT\")\n @ot_type = OtType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ot_type }\n end\n end",
"title": ""
},
{
"docid": "48678a40619570b54c7fb58fadd50eef",
"score": "0.57480043",
"text": "def index\n @onerooms = Oneroom.all\n end",
"title": ""
},
{
"docid": "ea873a65c9a5c97527c7cf9ee65970bc",
"score": "0.5728749",
"text": "def index\n @otros = Otro.all\n end",
"title": ""
},
{
"docid": "c271cb733ae66ff5aad0f33384b825b0",
"score": "0.5709441",
"text": "def list_all_aos_versions(args = {}) \n get(\"/aosversions.json/all\", args)\nend",
"title": ""
},
{
"docid": "ac7c3712d4f581d4f9203a60fdbdd8f9",
"score": "0.5701784",
"text": "def show\n @historial_odc = HistorialOdc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @historial_odc }\n end\n end",
"title": ""
},
{
"docid": "95957d33eda763e0f5181c54beb1f890",
"score": "0.5687215",
"text": "def index\n \t@episodios = Episodio.where(serie_id: params[:serie_id],ativo: true)\n render json: @episodios\n end",
"title": ""
},
{
"docid": "77ca93965377fab90fad2eccf9c2a1eb",
"score": "0.56850684",
"text": "def get_test_ost\n\n service_response = ClientManagement::GetTestOst.new(params).perform\n\n render_api_response(service_response)\n\n end",
"title": ""
},
{
"docid": "6cf528cf2ccfaf4991a41a086af8c054",
"score": "0.56837153",
"text": "def index\n respond_to do |format|\n format.html do\n @recent_objects = Otu.recent_from_project_id(sessions_current_project_id).order(updated_at: :desc).limit(10)\n render '/shared/data/all/index'\n end\n format.json {\n @otus = ::Queries::Otu::Filter.new(params).all\n .page(params[:page])\n .per(params[:per])\n .eager_load(:taxon_name)\n .order('taxon_names.cached, otus.name')\n }\n end\n end",
"title": ""
},
{
"docid": "3b5adfe08829e59e715ca74a02718905",
"score": "0.56760347",
"text": "def show\n @osoba = Osoba.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @osoba }\n end\n end",
"title": ""
},
{
"docid": "417802dd8b7d3cd34db8b3040694804a",
"score": "0.56620705",
"text": "def show\n @vehicle_odometer = VehicleOdometer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle_odometer }\n end\n end",
"title": ""
},
{
"docid": "a52de2803f1b6d4d80c583b25ebf5263",
"score": "0.5661259",
"text": "def show\n @orgao = Orgao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orgao }\n end\n end",
"title": ""
},
{
"docid": "a52de2803f1b6d4d80c583b25ebf5263",
"score": "0.5661259",
"text": "def show\n @orgao = Orgao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orgao }\n end\n end",
"title": ""
},
{
"docid": "242a8851ec201f380d6a25d65d57c2e5",
"score": "0.5660573",
"text": "def find\n\t\texpose Tos.find(@oauth_token, params[:id])\n\tend",
"title": ""
},
{
"docid": "ee400d964ed6a7dc3cb23adefcb4a984",
"score": "0.56604224",
"text": "def index\n @ocars = Ocar.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ocars }\n end\n end",
"title": ""
},
{
"docid": "75c7b46edbe27eae6d8d7e1de17f980d",
"score": "0.5639973",
"text": "def route1\n json_data = params[:key]\n object = Oj.load json_data, mode: :object\n end",
"title": ""
},
{
"docid": "c0df37ecea18aa36a2e40ac4910c334c",
"score": "0.563908",
"text": "def index\n @ojdts = Ojdt.all\n end",
"title": ""
},
{
"docid": "2bd701239310033b2b2708c267f89e09",
"score": "0.5635449",
"text": "def api_get action, params={}, version=\"1\"\n get \"/api/v#{version}/#{action}\", params\n JSON.parse(response.body) rescue {}\n end",
"title": ""
},
{
"docid": "d702fe7f494505054df3aa044f48759c",
"score": "0.5618988",
"text": "def destroy\n @ot = Ot.find(params[:id])\n @ot.destroy\n\n respond_to do |format|\n format.html { redirect_to ots_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "35069dfc2998205fc6b6588b3244bd98",
"score": "0.5617928",
"text": "def index\n @ofertas = Oferta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ofertas }\n end\n end",
"title": ""
},
{
"docid": "6650a4e6fdd7fc6462157a497da230d8",
"score": "0.5615579",
"text": "def show\n @loteo = Loteo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @loteo }\n end\n end",
"title": ""
},
{
"docid": "9607b3b58f5ebeeac857bc2a21f9d8db",
"score": "0.56135744",
"text": "def index\n @tipos_eventos = TipoEvento.por_colegio(colegio.id).order(\"cuaderno_control DESC\", \"descripcion\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tipos_eventos }\n end\n end",
"title": ""
},
{
"docid": "d8c923a2fcff51d07bbc2ebc2f850f5c",
"score": "0.5598541",
"text": "def index\n @okrs = Okr.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @okrs }\n # end\n end",
"title": ""
},
{
"docid": "ee2887b76d88796fc19d9deeb06da539",
"score": "0.55925155",
"text": "def show\n @soon = Soon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soon }\n end\n end",
"title": ""
},
{
"docid": "cef849748b5112250f4c4175c233d6d2",
"score": "0.55838",
"text": "def show\n @eventos2 = Eventos2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @eventos2 }\n end\n end",
"title": ""
},
{
"docid": "8083d17d825e9fa61dad2888519ddbaa",
"score": "0.55791986",
"text": "def index\n @pedidos = @producto.pedidos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pedidos }\n end\n end",
"title": ""
},
{
"docid": "9ae0338d4622c60befacb27bda3aab50",
"score": "0.5574061",
"text": "def index\n if params[:cooperativa_id]\n @cotacaos = Cotacao.where(:status_id => Status.find_by_descricao('Ativo'), :cooperativa_id => Cooperativa.find(params[:cooperativa_id]))\n else\n @cotacaos = Cotacao.where(:status_id => Status.find_by_descricao('Ativo'))\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cotacaos }\n end\n end",
"title": ""
},
{
"docid": "d57a0cc880435c37e76beda8a8d5bfa4",
"score": "0.55678844",
"text": "def index\n @osmotics = Osmotic.all\n end",
"title": ""
},
{
"docid": "6c3053d0348cb224f3a49043427727f7",
"score": "0.555183",
"text": "def index\n if (! (@device_id = params[:device_id]).nil?)\n @oids = Oid.where(:device_id=>@device_id.to_i).load\n return \n end\n @oids = Oid.all\n end",
"title": ""
},
{
"docid": "3b5386579c0fd825f017ffca8d19c901",
"score": "0.5550513",
"text": "def get_os_catalog_by_moid_with_http_info(moid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: OsApi.get_os_catalog_by_moid ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling OsApi.get_os_catalog_by_moid\"\n end\n # resource path\n local_var_path = '/api/v1/os/Catalogs/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.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', 'text/csv', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'])\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] || 'OsCatalog'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"OsApi.get_os_catalog_by_moid\",\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: OsApi#get_os_catalog_by_moid\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c6ad26641305917927efd2ded9fff2fd",
"score": "0.5542991",
"text": "def realizar_get\r\n @retorno = self.class.get('/todos')\r\n end",
"title": ""
},
{
"docid": "dfa964d6bd435c89e1119ac75ef31a52",
"score": "0.55390453",
"text": "def get_commandomodes_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CommandoModesApi.get_commandomodes ...'\n end\n # resource path\n local_var_path = '/commandomodes'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'CommandoModeListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"CommandoModesApi.get_commandomodes\",\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: CommandoModesApi#get_commandomodes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "49305a5ca44f06133098002c19fdac4a",
"score": "0.55291045",
"text": "def index\n \t@todones = ToDone.order(\"created_at DESC\").each\n respond_to do |format|\n \tformat.html do\n \t\trespond_with @todones\n \tend\n \tformat.json do\n \t\trender json: @todones.as_json\n \tend\n end\n end",
"title": ""
},
{
"docid": "cd8ec4aa79a42602837b8612f4ce45b7",
"score": "0.552386",
"text": "def index\n @vods = Vod.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @vods }\n end\n end",
"title": ""
},
{
"docid": "8fe2d6ec8a1d47ca8c318cf923eb35b7",
"score": "0.5520059",
"text": "def orders\n client.get \"orders\"\n end",
"title": ""
},
{
"docid": "6604d3d04a1d40c4f7525a38c9ba936e",
"score": "0.55116975",
"text": "def show\n @odontologia2 = Odontologia2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @odontologia2 }\n end\n end",
"title": ""
},
{
"docid": "53ed5c6120283d7dd4ebb220e9f6e361",
"score": "0.5510552",
"text": "def get_details\n # set var response to the reuslt of the API request using a URL built with variable from\n #the initialize method above and the OMDB key from .env\n response = RestClient::Request.execute( method: :get, url: 'http://www.omdbapi.com/?t=' + @show + '&type=' + @type + '&plot=full&apikey=' + ENV['OMDB_API_KEY'])\n # use the JSON parser to parse the data delivered into ver response\n JSON.parse(response)\n end",
"title": ""
},
{
"docid": "19268051f9eb9120976dc2f342d52dc6",
"score": "0.55086505",
"text": "def index\n @ordem_servicos = OrdemServico.all\n @ordem_servicos = @ordem_servicos.order(created_at: :desc)\n @ordem_servicos = @ordem_servicos.page params['page']\n end",
"title": ""
},
{
"docid": "a31ec6a5bdc133eb964dab33516825bf",
"score": "0.55078804",
"text": "def show\n template_filename = \"./order.odt\"\n output_filename = \"./order_out.odt\"\n\n @order = Order.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @order }\n format.odt do\n puts \"in odt\"\n generate_odt(@order, template_filename, output_filename)\n send_file(output_filename, :disposition => 'inline', :type => :odt)\n end\n format.pdf do\n output_pdf_filename = \"./order_out.pdf\"\n generate_odt(@order, template_filename, output_filename)\n openoffice_converter = OpenofficeConverter.new\n openoffice_converter.odt_to_pdf(output_filename, output_pdf_filename)\n send_file(output_pdf_filename, :disposition => 'inline', :type => :pdf)\n end\n end\n end",
"title": ""
},
{
"docid": "51619ada17f07889af622984eda132f8",
"score": "0.55074114",
"text": "def index\n respond_to do |format|\n format.html do\n @recent_objects = OtuRelationship.where(project_id: sessions_current_project_id)\n .order(updated_at: :desc)\n .limit(10)\n render '/shared/data/all/index'\n end\n format.json {\n @otu_relationships = OtuRelationship.where(project_id: sessions_current_project_id)\n .page(params[:page])\n .per(params[:per])\n }\n end\n end",
"title": ""
},
{
"docid": "7f3727ac45ea5c892a6527101dd0d2ee",
"score": "0.55036396",
"text": "def get_tos\n perform(DeviantArt::Data::TOS, :get, '/api/v1/oauth2/data/tos')\n end",
"title": ""
},
{
"docid": "c019514688050937d9bd66c9eae292a7",
"score": "0.55026066",
"text": "def index\n @clientes = Cliente.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clientes }\n end\n end",
"title": ""
},
{
"docid": "83b9c3cfff24c2c0aa88ae2ee1f091da",
"score": "0.5500903",
"text": "def show\n @ocar = Ocar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ocar }\n end\n end",
"title": ""
},
{
"docid": "3ca5c127db7892f146f35175f6e00293",
"score": "0.54888093",
"text": "def show\n @okr = Okr.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @okr }\n end\n end",
"title": ""
},
{
"docid": "8b74711ab0768b1ffe166ea19ba7f83b",
"score": "0.5485778",
"text": "def index\n if params[:pedido_producto]\n @pedido = Pedido.find(params[:pedido_id])\n authorize! :read, @pedido\n @pedido.productos.reload\n render json: @pedido.productos.con_precio\n\n elsif params[:negocio_producto]\n @negocio = Negocio.find(params[:negocio_id])\n # Actualizar colección de productos\n authorize! :read, @negocio\n @negocio.productos.reload\n render json: @negocio.productos.con_precio\n else\n authorize! :read, @producto\n render json: @productos\n end\n end",
"title": ""
},
{
"docid": "26e73637b7c182d3e5c460c19f140005",
"score": "0.5484715",
"text": "def index\n @roofs = Roof.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @roofs }\n end\n end",
"title": ""
},
{
"docid": "c4fbe26cc24a00e0c0073f9fb9aa5728",
"score": "0.5482218",
"text": "def index\n Obelisk.paginates_per 10\n @places = Obelisk.without_nodes.order('updated_at DESC').page params[:page]\n respond_with(@places)\n end",
"title": ""
},
{
"docid": "e53fc0513d183039d1a4677e2020feb6",
"score": "0.54758745",
"text": "def index\n @oids = Oid.all\n end",
"title": ""
},
{
"docid": "f45b5ddf9eba3fcee9160db7b4a30b7c",
"score": "0.54733986",
"text": "def opsgenie_fetch_json(url, params, req_type)\n uri = URI(url)\n https = Net::HTTP.new(uri.host, uri.port)\n https.use_ssl = true\n header = {\n \"Content-Type\" => \"application/json\",\n \"Authorization\" => \"GenieKey #{@opsgenie_apikey}\"\n }\n begin\n if req_type == 'post'\n res = https.post(uri.path, params, initheader = header)\n else\n uri.query = params.to_json\n res = https.get(uri.path, initheader = header)\n end\n if res.is_a?(Net::HTTPSuccess)\n return JSON.parse(res.body)\n else\n puts res\n return false\n end\n rescue => e\n puts \"#{e}: #{uri.host}, #{uri.port}\"\n return false\n end\nend",
"title": ""
},
{
"docid": "a9d1b6e5de0412f6ce902104e7e99536",
"score": "0.54648507",
"text": "def show\n render json: @orgao\n end",
"title": ""
},
{
"docid": "768617e88da34965829d86d15ac28d51",
"score": "0.5463932",
"text": "def index\n @os = Os\n @os = @os.abertas if params.key?(:abertas)\n @os = @os.fechadas if params.key?(:fechadas)\n @os = @os.por_responsavel(current_user) if params.key?(:minhas)\n @os = @os.por_responsavel(params[:responsavel]) if params.key?(:responsavel)\n @os_q = @os.includes(:pessoa, :classificacao).order(created_at: :asc).ransack(params[:os_q])\n @os = @os_q.result.page params[:page]\n respond_to do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "719f324fd7e76ace60f0d241da747193",
"score": "0.54635876",
"text": "def get_aos_version_by_name(args = {}) \n get(\"/aosversions.json/version/#{args[:aosVersionName]}\", args)\nend",
"title": ""
},
{
"docid": "0141192f2cbb6b3c50d04721995ce8b6",
"score": "0.5462924",
"text": "def show\n @dop = Dop.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dop }\n end\n end",
"title": ""
},
{
"docid": "2b73e1f83d4e8e2feba0ca6ab485e8df",
"score": "0.54548836",
"text": "def osint(query)\n params = {\n query: query,\n }.compact\n\n _get(\"/enrichment/osint\", params) { |json| json }\n end",
"title": ""
},
{
"docid": "6891640be28cd84de1d7b4a61d6f1425",
"score": "0.54468554",
"text": "def show\n @rodeo = Rodeo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rodeo }\n end\n end",
"title": ""
},
{
"docid": "d5e9d1c61179e92aec7f2868e02db061",
"score": "0.54402494",
"text": "def index\n @ocs = Oc.all\n end",
"title": ""
},
{
"docid": "3f4bb714be92e490cf63780b38150d30",
"score": "0.54389095",
"text": "def index\r\n @orids = Orid.where(public:true).order(:created_at=>'desc')\r\n end",
"title": ""
},
{
"docid": "b7360fefe02c11ef521321d88d0e449b",
"score": "0.542553",
"text": "def show\n @outro = Outro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @outro }\n end\n end",
"title": ""
},
{
"docid": "d0a4c6494494beb4271074cf293266c5",
"score": "0.54158485",
"text": "def get_ao(token)\n get_json \"/#{@account}/#{@application}/get_ao.json?token=#{token}\"\n end",
"title": ""
},
{
"docid": "cbcaa213e1b3659ea16194f5f9a5fdeb",
"score": "0.5415752",
"text": "def show\n @ortho_source = OrthoSource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ortho_source }\n end\n end",
"title": ""
},
{
"docid": "287cebb0c1131412d21c8a1630bd9d16",
"score": "0.5407783",
"text": "def show\n @odpowiedz = Odpowiedz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @odpowiedz }\n end\n end",
"title": ""
},
{
"docid": "129dd75da2410a0b478796a42fcad2f1",
"score": "0.5407633",
"text": "def set_od\n @od = Od.find(params[:id])\n end",
"title": ""
},
{
"docid": "c0c4e0ff7fdd510f5c61b1ce7417afff",
"score": "0.54041046",
"text": "def set_ot\n @ot = Ot.find(params[:id])\n end",
"title": ""
},
{
"docid": "a452af31d042ebc766b4bd22cb49d242",
"score": "0.5403766",
"text": "def index\n @torneos = Torneo.all\n render json: @torneos, status: :ok\n end",
"title": ""
},
{
"docid": "614c82f09aecf6f40de63facb9f8e87b",
"score": "0.5403517",
"text": "def index\n @orcamentos = Orcamento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orcamentos }\n end\n end",
"title": ""
},
{
"docid": "171f802c107b535ac5165c163440c5f0",
"score": "0.54002494",
"text": "def index\n @ozs = Oz.all\n end",
"title": ""
},
{
"docid": "fcfdc08e3fa4db2bfdca33d3308b844e",
"score": "0.53997695",
"text": "def opciones\n @sitio = Sitio.find(params[:id])\n respond_to do |format|\n format.html # opciones.html.erb\n format.xml { render :xml => @sitio }\n end\n end",
"title": ""
},
{
"docid": "fcfdc08e3fa4db2bfdca33d3308b844e",
"score": "0.53997695",
"text": "def opciones\n @sitio = Sitio.find(params[:id])\n respond_to do |format|\n format.html # opciones.html.erb\n format.xml { render :xml => @sitio }\n end\n end",
"title": ""
},
{
"docid": "d4ff527585d9d6d44d5cce630b10bd99",
"score": "0.5398262",
"text": "def annoj_get\n case params[:annoj_action]\n when \"syndicate\"\n @response = syndicate(params[:id])\n when \"describe\"\n @response = describe(params[\"id\"])\n end\n render :json => @response, :layout => false\n end",
"title": ""
},
{
"docid": "03669196a7b0ff47a7581777310c2ec9",
"score": "0.5396287",
"text": "def index\n @loceods = Loceod.all\n end",
"title": ""
},
{
"docid": "c3d15ffb25781f10d1ace5be130dad58",
"score": "0.5392473",
"text": "def index\n @volumes = OpenStack::Nova::Volume::Volume.all\n @servers = OpenStack::Nova::Compute::Server.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @volumes }\n end\n end",
"title": ""
},
{
"docid": "3b60ccff7c575897ee480ec69ac29813",
"score": "0.53904676",
"text": "def index\n screen_name(\"Admin-Indice-Estados-OT\")\n @ot_states = OtState.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ot_states }\n end\n end",
"title": ""
},
{
"docid": "9f4d795bea3caa1662761963db900c4f",
"score": "0.5389458",
"text": "def index\n @oders = Oder.all\n end",
"title": ""
},
{
"docid": "59a7177f4f1db683334609fe2ebb17a4",
"score": "0.53877187",
"text": "def index\n @getopis = Getopi.all\n end",
"title": ""
},
{
"docid": "862e745c656ca9fb3b2f1bb2c003858f",
"score": "0.5382099",
"text": "def index\n @orden_servicios = OrdenServicio.all\n end",
"title": ""
},
{
"docid": "bda4f58eb51b218d1d1c656f54c35121",
"score": "0.538127",
"text": "def index\n @keditos = Kedito.all\n\n render json: @keditos\n end",
"title": ""
},
{
"docid": "fbe6b4b9c83ffcb92a5ccd5486979c58",
"score": "0.53744537",
"text": "def route7\n json_data = params[:key]\n object = Oj.load json_data\n object = Oj.load json_data, mode: :object\n end",
"title": ""
},
{
"docid": "969da00db1f0674675ef81c22286a238",
"score": "0.5373352",
"text": "def show\n @observacao_vocacionado = ObservacaoVocacionado.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @observacao_vocacionado }\n end\n end",
"title": ""
},
{
"docid": "e7bc664f8559b27b18ce38eb538e20ff",
"score": "0.53726393",
"text": "def index\n if params[:status] and params[:status] != \"pendiente\"\n @pagos = Pago.where(\"estado <> 'pendiente'\")\n else\n @pagos = Pago.where(\"estado = 'pendiente'\")\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pagos }\n end\n end",
"title": ""
},
{
"docid": "c1f851f3b64c50f755bbf236d33320cb",
"score": "0.5371951",
"text": "def index\n @ocupacions = Ocupacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ocupacions }\n end\n end",
"title": ""
}
] |
a6e38d21089c9194778bab2a527e8b9e
|
Gets the tokenEncryptionKeyId property value. Specifies the keyId of a public key from the keyCredentials collection. When configured, Azure AD issues tokens for this application encrypted using the key specified by this property. The application code that receives the encrypted token must use the matching private key to decrypt the token before it can be used for the signedin user.
|
[
{
"docid": "fca1e9aef3af8c2f853f9584ba13e825",
"score": "0.7209305",
"text": "def token_encryption_key_id\n return @token_encryption_key_id\n end",
"title": ""
}
] |
[
{
"docid": "a98bbb3a91bb5f2b92162e9d2acd375b",
"score": "0.67102814",
"text": "def token_encryption_key_id=(value)\n @token_encryption_key_id = value\n end",
"title": ""
},
{
"docid": "45e449fcfa18d5bc5d14e25d6030c170",
"score": "0.5918154",
"text": "def kms_key_id\n data[:kms_key_id]\n end",
"title": ""
},
{
"docid": "45e449fcfa18d5bc5d14e25d6030c170",
"score": "0.5918154",
"text": "def kms_key_id\n data[:kms_key_id]\n end",
"title": ""
},
{
"docid": "45e449fcfa18d5bc5d14e25d6030c170",
"score": "0.5918154",
"text": "def kms_key_id\n data[:kms_key_id]\n end",
"title": ""
},
{
"docid": "45e449fcfa18d5bc5d14e25d6030c170",
"score": "0.5918154",
"text": "def kms_key_id\n data[:kms_key_id]\n end",
"title": ""
},
{
"docid": "45e449fcfa18d5bc5d14e25d6030c170",
"score": "0.5918154",
"text": "def kms_key_id\n data[:kms_key_id]\n end",
"title": ""
},
{
"docid": "45e449fcfa18d5bc5d14e25d6030c170",
"score": "0.5918154",
"text": "def kms_key_id\n data[:kms_key_id]\n end",
"title": ""
},
{
"docid": "7433bdb1e76df9492fdb60d261960d06",
"score": "0.56729406",
"text": "def kms_key_id\n @cluster.kms_key_id\n end",
"title": ""
},
{
"docid": "31bd5e29f141f66528a2f82f80c6b185",
"score": "0.5657548",
"text": "def token_credential_key\n @token_credential_key\n end",
"title": ""
},
{
"docid": "667e8407a5eed93c6e8c27bda040b41e",
"score": "0.56331104",
"text": "def key_id\n @auto_token.key_id\n end",
"title": ""
},
{
"docid": "8cd9ad1297ed314040e7dcc0d138a3c4",
"score": "0.5466126",
"text": "def data_encryption_key_id\n data[:data_encryption_key_id]\n end",
"title": ""
},
{
"docid": "5cb1aaa3fc594654c9c8cbbbbd56228a",
"score": "0.5431156",
"text": "def encrypted_identifier\n crypt = ActiveSupport::MessageEncryptor.new(Rails.application.secrets.secret_key_base)\n crypt.encrypt_and_sign(self.id)\n end",
"title": ""
},
{
"docid": "092f8588eda165fa68bbb9bb4b30b95e",
"score": "0.53944176",
"text": "def key_id\n return @key_id\n end",
"title": ""
},
{
"docid": "3bddd1038b32bb35a0ea39e5684afe33",
"score": "0.52574587",
"text": "def ssekms_key_id\n data[:ssekms_key_id]\n end",
"title": ""
},
{
"docid": "303dc7f1e248d0fc04617257b31e827e",
"score": "0.52503794",
"text": "def key_id\n return @key_id\n end",
"title": ""
},
{
"docid": "303dc7f1e248d0fc04617257b31e827e",
"score": "0.52503794",
"text": "def key_id\n return @key_id\n end",
"title": ""
},
{
"docid": "5f73c1732259c07f2103ac654f1992d6",
"score": "0.5242645",
"text": "def decryption_key\n return @decryption_key\n end",
"title": ""
},
{
"docid": "741c4eaa23f21b02954a7d08183551a4",
"score": "0.52182144",
"text": "def key_code\n @@config[:key_code]\n end",
"title": ""
},
{
"docid": "aed89563e26622c25b5fd5b26b7a45c6",
"score": "0.51974475",
"text": "def omniauth_id_token_key(provider_name)\n ::OmniAuth::Strategies::OpenIDConnect.get_session_key(provider_name, ::OmniAuth::Strategies::OpenIDConnect::SESSION_TYPE_ID_TOKEN)\n end",
"title": ""
},
{
"docid": "60192a978eba04feb7814beca47cdd1b",
"score": "0.5169452",
"text": "def key\n store.send(:encrypted_file).key if store.encrypted?\n rescue ActiveSupport::EncryptedFile::MissingKeyError\n nil\n end",
"title": ""
},
{
"docid": "c5143236c4ddba0aeb6a5180000e6c71",
"score": "0.5165271",
"text": "def _encrypted_store_sync_key\n unless new_record?\n # Obtain a lock without overriding attribute values for this\n # instance. Here `record` will be an updated version of this instance.\n record = self.class.unscoped { self.class.lock.find(id) }\n\n if record && record.encryption_key_id\n self.encryption_key_id = record.encryption_key_id\n end\n end\n end",
"title": ""
},
{
"docid": "857c8abb092c06b066ac91f3a92a02a0",
"score": "0.5162463",
"text": "def token_signer token\n begin\n # see if maybe it's a JWT\n token = JWT token\n fingerprint = token.header['kid']\n rescue ArgumentError\n fingerprint = token['key']\n end\n\n key, id = keystore.get_by_fingerprint fingerprint\n if key && key.token_valid?(token)\n return id\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "3dd7b41079c80c4c2d028f3798070411",
"score": "0.51480573",
"text": "def _crypto_key(token)\n return _from_hex(token) * (32 / TOKEN_LENGTH)\nend",
"title": ""
},
{
"docid": "095c4f77352ba36650c6909aa22c3427",
"score": "0.51215345",
"text": "def get_key(id)\n @encrypter.get_key(id)\n end",
"title": ""
},
{
"docid": "a42f89a014466181411360ae1cb008c9",
"score": "0.51049966",
"text": "def encrypted_invitation_token\n self.invitation_token\n end",
"title": ""
},
{
"docid": "91b16dd082a46a482bdc5254aeb35e8a",
"score": "0.50907975",
"text": "def access_key_id\n @protocol.get_access_key_id\n end",
"title": ""
},
{
"docid": "d5d7b6cd7c0a4e2f0f0e7d4051ac8696",
"score": "0.5062275",
"text": "def cipher_key\n begin\n Rails.configuration.unsakini_crypto_key\n rescue Exception => e\n raise 'Encryption key is not set! Please run `rails g unsakini:config` before you proceed.'\n end\n end",
"title": ""
},
{
"docid": "cb83b5628de52a001bca7d3f6fc36fc2",
"score": "0.5052155",
"text": "def key\n # We can't wait until the record is first saved to have a key for it\n self[:key] ||= self.class.generate_unique_secure_token(length: MINIMUM_TOKEN_LENGTH)\n end",
"title": ""
},
{
"docid": "15a29435bb77a1745ac99084987033de",
"score": "0.50406235",
"text": "def encryption_iv\n return nil unless use_iv?\n instance_variable_get( \"@#{self.class.encryption_iv_column}\".to_sym )\n end",
"title": ""
},
{
"docid": "803026a3fe55cfa73702a17db0bf15e6",
"score": "0.50191724",
"text": "def key_encrypting_key\n ENV['KEY_ENCRYPTING_KEY']\n end",
"title": ""
},
{
"docid": "17079aa2dc57cc384ceb64bccf7b2634",
"score": "0.5018134",
"text": "def keyid\n string_property(:rnp_key_get_keyid)\n end",
"title": ""
},
{
"docid": "6a59cba998e532dfef0953ef52b83b30",
"score": "0.5015638",
"text": "def encryption_key\n Rails.application.secrets[:encryption_key]\n end",
"title": ""
},
{
"docid": "52224792efc52e4012b878470cbb8af1",
"score": "0.4987923",
"text": "def encryption_key; end",
"title": ""
},
{
"docid": "329488496e888c3aabe0ee7d8b4fe0f2",
"score": "0.49787974",
"text": "def encryption_key\n @secret.slice(16, 16)\n end",
"title": ""
},
{
"docid": "c606f8e0ccabe6b1a11f93a8f7f062ed",
"score": "0.49642792",
"text": "def key_bytes\n KEYBYTES\n end",
"title": ""
},
{
"docid": "436bd0590d28c4d4a2feba9252872e14",
"score": "0.49422786",
"text": "def kid_id\n rsa_id_private_key.to_jwk[:kid]\n end",
"title": ""
},
{
"docid": "b95e5b138c606453d4fc1d4c0c5217c1",
"score": "0.493175",
"text": "def authentication_keys\n @authentication_keys ||= [mapping.to.token_authentication_key]\n end",
"title": ""
},
{
"docid": "f67df941ddbebec7d21ad8057bd1045c",
"score": "0.49163112",
"text": "def keyid\n return file_or_nil(\"keyid\", \"@keyid\").to_i\n end",
"title": ""
},
{
"docid": "7c49bbb677268bf121ac697340ef8313",
"score": "0.49128467",
"text": "def client_key\n @client_key ||= hmac(salted_password, CLIENT_KEY)\n end",
"title": ""
},
{
"docid": "91e6b4026f5d4175954d782c53709534",
"score": "0.4882279",
"text": "def access_key_id\n credentials['access_key']\n end",
"title": ""
},
{
"docid": "9aa49cae2db3bc45b6a26a3ca8130838",
"score": "0.48813358",
"text": "def key_credentials\n return @key_credentials\n end",
"title": ""
},
{
"docid": "9aa49cae2db3bc45b6a26a3ca8130838",
"score": "0.48813358",
"text": "def key_credentials\n return @key_credentials\n end",
"title": ""
},
{
"docid": "230805eb8a48516dc0a0a401d0528016",
"score": "0.48791987",
"text": "def vpp_token_id\n return @vpp_token_id\n end",
"title": ""
},
{
"docid": "a548a2968a92157c3dedd6c74ecd0a88",
"score": "0.48707676",
"text": "def custom_key_identifier\n return @custom_key_identifier\n end",
"title": ""
},
{
"docid": "4c5509a0f4440c994905e2d7a5e17ba3",
"score": "0.48471862",
"text": "def private_key\n @key\n end",
"title": ""
},
{
"docid": "1262aba633c12b1cb1372db7eb87512e",
"score": "0.48426938",
"text": "def ssekms_key_id; end",
"title": ""
},
{
"docid": "bf3a99d237634dd941f5c97ffd1e93fb",
"score": "0.48405597",
"text": "def key_len\n if ActiveSupport::MessageEncryptor.respond_to? :key_len\n ActiveSupport::MessageEncryptor.key_len\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "67b0fb511fa1f5f927d89387d8b6102f",
"score": "0.4834179",
"text": "def client_key\n @client_key ||= hmac(salted_password, CLIENT_KEY)\n end",
"title": ""
},
{
"docid": "0c59d67641176564fdce87f8fbc5d6fc",
"score": "0.4828667",
"text": "def access_key_id\n obtain_credentials\n @access_key_id\n end",
"title": ""
},
{
"docid": "ec4902f6e22b295fa19401c4c41d7bd5",
"score": "0.4823227",
"text": "def kms_key\n @gapi.kms_key_name\n end",
"title": ""
},
{
"docid": "530ceed80875f2324c7a395c75551a9b",
"score": "0.47997037",
"text": "def key\n raise Error, \"Could not retrieve session key.\" unless @key\n return @key\n end",
"title": ""
},
{
"docid": "2b7b0f4ca58241c303de36b5b8256b37",
"score": "0.47931582",
"text": "def authorized_key\n @authorized_key\n end",
"title": ""
},
{
"docid": "c500e9bba9bb6a237ff86c589babb1f5",
"score": "0.47909424",
"text": "def encryption_key\n key.gsub(/^[[:blank:]]+/, '')\n end",
"title": ""
},
{
"docid": "a70bff99b9801e1f44a132cc135d8726",
"score": "0.47829056",
"text": "def encrypted_keys\n @encrypted_keys ||= encrypted_attributes.keys\n end",
"title": ""
},
{
"docid": "0579c87f781badfa9258b11a14c47170",
"score": "0.4782131",
"text": "def get_key_id(resource)\n key_file_exists =\n (::File.exist?(resource.path)) || false\n if key_file_exists\n # If key file exists, fetch the key ID from it.\n file = ::File.open(resource.path)\n [key_file_exists, ::JSON.parse(file.read)['private_key_id']]\n elsif !resource.key_id.nil?\n [key_file_exists, resource.key_id]\n end\n end",
"title": ""
},
{
"docid": "6e3b5590c013fd3f61585298f92eb115",
"score": "0.4776143",
"text": "def access_key_id\n @s3.client.config.credentials.access_key_id\n end",
"title": ""
},
{
"docid": "6e3b5590c013fd3f61585298f92eb115",
"score": "0.4776143",
"text": "def access_key_id\n @s3.client.config.credentials.access_key_id\n end",
"title": ""
},
{
"docid": "58894db08f16e5ff01e25972c6777098",
"score": "0.47732398",
"text": "def key_bytes\n self.class.key_bytes\n end",
"title": ""
},
{
"docid": "e8f8dfe86b99b2a4df19bb7fa6278147",
"score": "0.47718546",
"text": "def key\n @key ||= determine_key\n end",
"title": ""
},
{
"docid": "6df0b64da6da86bd2092af4635b94ae2",
"score": "0.47554412",
"text": "def key_ids\n return @key_ids\n end",
"title": ""
},
{
"docid": "dce09549716be72929dbedede696c11d",
"score": "0.4743041",
"text": "def encrypted_challenge_id\n ActiveSupport::MessageEncryptor\n .new(text_captcha_encryption_key)\n .encrypt_and_sign(challenge_id.to_s)\n end",
"title": ""
},
{
"docid": "c9b4714ff0519825a10e7db68af44d24",
"score": "0.47251412",
"text": "def key_id=(value)\n @key_id = value\n end",
"title": ""
},
{
"docid": "ce49c7e2f98270b42b95127f36158554",
"score": "0.47087243",
"text": "def id_token\n Keypair.jwt_encode(payload)\n end",
"title": ""
},
{
"docid": "7fe87c358c2b9776a39b1eb17edf452d",
"score": "0.46968824",
"text": "def encrypted_key\n @rsa.private_encrypt generate_key\n end",
"title": ""
},
{
"docid": "e67354c234275ba7a24075d9731774af",
"score": "0.4687466",
"text": "def key_bytes\n self.class.key_bytes\n end",
"title": ""
},
{
"docid": "5fa4220c35525657872806d4fe7d71c1",
"score": "0.46685946",
"text": "def private_key\n return self.authentication.private_key\n end",
"title": ""
},
{
"docid": "5fa4220c35525657872806d4fe7d71c1",
"score": "0.46685946",
"text": "def private_key\n return self.authentication.private_key\n end",
"title": ""
},
{
"docid": "3e2a303eba02305bc4ddc7d28318a10d",
"score": "0.46684662",
"text": "def token_key\n Digest::MD5.hexdigest(\"smth-unique-#{model.class.to_s.downcase}-#{model.id}-key\")\n end",
"title": ""
},
{
"docid": "4bde42101da430a42aef0fe0f1018fe7",
"score": "0.4664502",
"text": "def client_credential_key\n @client_credential_key\n end",
"title": ""
},
{
"docid": "ebc7e3869b383a810430911fa190f50b",
"score": "0.46473765",
"text": "def auth_key\n @previous_resolver.auth_key\n end",
"title": ""
},
{
"docid": "7ad46928f7ced7f997921c681f6fd65d",
"score": "0.464395",
"text": "def stored_id_token\n session[self.class.get_session_key(name, SESSION_TYPE_ID_TOKEN)]\n end",
"title": ""
},
{
"docid": "b97c7645767d2c859eee61fece86accd",
"score": "0.46289554",
"text": "def encryption_key_sha256\n return nil unless @gapi.customer_encryption\n Base64.decode64 @gapi.customer_encryption.key_sha256\n end",
"title": ""
},
{
"docid": "a561c72e73d7e545a7f1290560dcbc02",
"score": "0.4603283",
"text": "def token_id\n @hook.params[\"token_id\"]\n end",
"title": ""
},
{
"docid": "79006381d6f90a9b220560209924f6e6",
"score": "0.4601165",
"text": "def vpp_token_apple_id\n return @vpp_token_apple_id\n end",
"title": ""
},
{
"docid": "982cbf579f5ab05d8b67b57c42fa95c6",
"score": "0.45994774",
"text": "def client_id\n @key\n end",
"title": ""
},
{
"docid": "01cd40c6e82f824f720db6fdfff1fc0c",
"score": "0.45596853",
"text": "def identifier(key)\n return self.identity_metadata.get_identifier_value(key)\n end",
"title": ""
},
{
"docid": "43839c20352df0e53d88e1148452f5a1",
"score": "0.45547915",
"text": "def get_keys\n @encrypter.get_keys\n end",
"title": ""
},
{
"docid": "92edb322564eade79bab07f2a4b87dad",
"score": "0.455235",
"text": "def get_access_key_id\n @config.access_key_id\n end",
"title": ""
},
{
"docid": "8cd32cf1ebb6fb037968e2a5cd242345",
"score": "0.45444775",
"text": "def encryptor\n Thread.current[encryptor_key] || @encryptor || DefaultEncryptor\n end",
"title": ""
},
{
"docid": "d63a9dfa7cecdccf45f47671b32fa6b3",
"score": "0.45374963",
"text": "def client_key\n sslsock.sslctx.key if sslsock\n end",
"title": ""
},
{
"docid": "54c6229514338ff57140b42a257fa3da",
"score": "0.45367905",
"text": "def key_id=(value)\n @key_id = value\n end",
"title": ""
},
{
"docid": "54c6229514338ff57140b42a257fa3da",
"score": "0.45367905",
"text": "def key_id=(value)\n @key_id = value\n end",
"title": ""
},
{
"docid": "88d179e76ef728b20bd31aa75b3327c5",
"score": "0.4533569",
"text": "def active_sftp_host_key_id\n @attributes[:active_sftp_host_key_id]\n end",
"title": ""
},
{
"docid": "1a15b50ad58fbb546bd0753562ed537f",
"score": "0.45313954",
"text": "def session_key\n @session_key ||= ::Rails.application.config.session_options[:key]\n end",
"title": ""
},
{
"docid": "4a2e34ded1d73a5006f54834c06cc35a",
"score": "0.45024398",
"text": "def get_key(id)\n key_vault_collection.find(_id: id).first\n end",
"title": ""
},
{
"docid": "e165744ebf83477c706a8763f4603947",
"score": "0.448892",
"text": "def keys\n RubyKongAuth::KeyAuth.all consumer_id: self.id\n end",
"title": ""
},
{
"docid": "a6fbc9842842055dc88fbe76eff696c4",
"score": "0.44861507",
"text": "def jwt_kid\n sha256 = Digest::SHA256.new\n sha256.update(private_key.public_key.to_der)\n payload = StringIO.new(sha256.digest).read(30)\n Base32.encode(payload).split('').each_slice(4).each_with_object([]) do |slice, mem|\n mem << slice.join\n mem\n end.join(':')\n end",
"title": ""
},
{
"docid": "a9d6b0e5280169532c7cd3fff7c2a5cb",
"score": "0.4482965",
"text": "def key_credential\n return @key_credential\n end",
"title": ""
},
{
"docid": "b7f3cad400a5b64bdb15d434913eccc9",
"score": "0.4478811",
"text": "def key\n @key ||= generate_key\n end",
"title": ""
},
{
"docid": "289a78d5d6e81571f6e22cec6fd5c8c6",
"score": "0.4476454",
"text": "def encrypted_token\n raw = \"Username=#{@username}&ApiKey=#{@api_key}&GenDT=#{Time.now.utc.iso8601}\"\n @encryptor.encrypt(raw)\n end",
"title": ""
},
{
"docid": "d311b3066a100eab6cfd9b61d0d6dc29",
"score": "0.44738898",
"text": "def get_crypto_key_hex\n return @crypto_key if ! @crypto_key\n @crypto_key.unpack(\"H*\")\n end",
"title": ""
},
{
"docid": "d311b3066a100eab6cfd9b61d0d6dc29",
"score": "0.44738898",
"text": "def get_crypto_key_hex\n return @crypto_key if ! @crypto_key\n @crypto_key.unpack(\"H*\")\n end",
"title": ""
},
{
"docid": "d311b3066a100eab6cfd9b61d0d6dc29",
"score": "0.44738898",
"text": "def get_crypto_key_hex\n return @crypto_key if ! @crypto_key\n @crypto_key.unpack(\"H*\")\n end",
"title": ""
},
{
"docid": "acfd21c9eaa913d68ed5940d6e9bcb02",
"score": "0.44588372",
"text": "def hmac_key\n @config[:hmac_key]\n end",
"title": ""
},
{
"docid": "deb9d3f0fa93fc1003f059ab42cb06de",
"score": "0.4454748",
"text": "def private_key\n @private_key\n end",
"title": ""
},
{
"docid": "a66091793fbd70dda690f5d5d561409b",
"score": "0.44526222",
"text": "def public_key\n rpc(action: :account_key)[:key]\n end",
"title": ""
},
{
"docid": "b2cb24da8512b7c02ea0e9ebd8cf8d59",
"score": "0.44477654",
"text": "def mac_encryption_key\n upload_key[0,4]\n end",
"title": ""
},
{
"docid": "510bae33e624284ec8ca64dedf6e9461",
"score": "0.44438648",
"text": "def cipher_key=(cipher_key)\n @cipher_key = cipher_key\n end",
"title": ""
},
{
"docid": "1404da46c70d70fe106696c7fe0d61f4",
"score": "0.44407558",
"text": "def get_channel_access_token_key_ids_jwt(jwt)\n payload = URI.encode_www_form(\n client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',\n client_assertion: jwt\n )\n endpoint_path = \"/oauth2/v2.1/tokens/kid?#{payload}\"\n\n headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }\n get(oauth_endpoint, endpoint_path, headers)\n end",
"title": ""
},
{
"docid": "de8b6c96449662d79045464c2448e57a",
"score": "0.4434421",
"text": "def private_key\n Cproton.pn_messenger_get_private_key(@impl)\n end",
"title": ""
}
] |
5d36bc33edef60c98df7f0892620d00d
|
TODO: support double quoted identifiers
|
[
{
"docid": "16d75915b84d17186b08d9a06d76f700",
"score": "0.0",
"text": "def initialize()\n end",
"title": ""
}
] |
[
{
"docid": "fbbe036840c9d4ce25a59ac74b34a4e5",
"score": "0.7458709",
"text": "def identifier(str); end",
"title": ""
},
{
"docid": "ba5bacc93e1ca52d4e3407102f241a80",
"score": "0.7259434",
"text": "def quoted_identifier(name)\n \"\\\"#{name.to_s.gsub('\"', '\"\"')}\\\"\"\n end",
"title": ""
},
{
"docid": "80b223311f1a95b53495a44ba50aefa2",
"score": "0.72428626",
"text": "def quote_identifier( identifier )\n \"\\\"#{identifier}\\\"\"\n end",
"title": ""
},
{
"docid": "f200118d44ceef079e6debec87b004e8",
"score": "0.70833695",
"text": "def escape_identifier( str )\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "1e89adbd7c9d4457ad0404f782f92d3f",
"score": "0.7001927",
"text": "def quote_identifier(ident)\n return \"`\" + ident.gsub(/`/, \"``\") + \"`\"\nend",
"title": ""
},
{
"docid": "3f0796053d91938daa671ae09c11456f",
"score": "0.6902843",
"text": "def quoted_identifier(name)\n \"[#{name}]\"\n end",
"title": ""
},
{
"docid": "bf349fc120e2933f34e8d78b1767d14c",
"score": "0.66167843",
"text": "def identifier_string\n fullname\n end",
"title": ""
},
{
"docid": "aeec662faf8623b64beeff6e16841e1e",
"score": "0.65815693",
"text": "def all_identifiers; end",
"title": ""
},
{
"docid": "ac2b18718620e5ba020d9ec08a369462",
"score": "0.6527042",
"text": "def quotename!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 27)\n\n type = QUOTENAME\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 371:12: '\\\\'(?:[^\\\\']|\\\\'\\\\')*\\\\''\n match(\"'(?:[^']|'')*'\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 27)\n\n end",
"title": ""
},
{
"docid": "c07a276ebd5e94fdb1791608e09c4ad0",
"score": "0.64586407",
"text": "def quote_ident(*several_variants)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "f037ff8b64a1eda0635b4adeb778b908",
"score": "0.6456631",
"text": "def quote_identifier(name)\n return name if name.is_a?(LiteralString)\n name = name.value if name.is_a?(SQL::Identifier)\n name = input_identifier(name)\n name = quoted_identifier(name) if quote_identifiers?\n name\n end",
"title": ""
},
{
"docid": "6a50b5024b9cdd2ea0a8930f9086282d",
"score": "0.63784605",
"text": "def quoted_identifier_append(sql, name)\n sql << BACKTICK << name.to_s << BACKTICK\n end",
"title": ""
},
{
"docid": "6a50b5024b9cdd2ea0a8930f9086282d",
"score": "0.63784605",
"text": "def quoted_identifier_append(sql, name)\n sql << BACKTICK << name.to_s << BACKTICK\n end",
"title": ""
},
{
"docid": "010ca8d855a0afb61e98aa770d07ad03",
"score": "0.6362943",
"text": "def eval_identifier(ss)\n ss.scan(/\\w+/).to_s\n end",
"title": ""
},
{
"docid": "394e76635cc9c01c26b3f8b50249c538",
"score": "0.6359214",
"text": "def escape_ident(str); end",
"title": ""
},
{
"docid": "9027e7e799654af1360b2b98a46a3960",
"score": "0.6358672",
"text": "def quoted_identifier(v)\n \"[#{v}]\"\n end",
"title": ""
},
{
"docid": "aafe6bad0fde3cf9c4327d51f41a40f8",
"score": "0.6356283",
"text": "def name_as_identifier\n id.to_s + '_' + name.downcase.gsub(/\\s/,'_')\n end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "e60d4ccbe632ddcdbc46696acb58278b",
"score": "0.6330075",
"text": "def identifier; end",
"title": ""
},
{
"docid": "ae3b2bee22168507279df871e156d6ec",
"score": "0.6317087",
"text": "def parse_interp_ident; end",
"title": ""
},
{
"docid": "92b935b8c01164336b5a3eebbd2f5d6f",
"score": "0.631448",
"text": "def quoted_name\n \"'#{name}'\"\n end",
"title": ""
},
{
"docid": "23ce85f09c5ea6c7090d6dcb763be477",
"score": "0.6311182",
"text": "def old_identifier; end",
"title": ""
},
{
"docid": "23ce85f09c5ea6c7090d6dcb763be477",
"score": "0.6311182",
"text": "def old_identifier; end",
"title": ""
},
{
"docid": "25e0c32d588fb114585764b36566e2a3",
"score": "0.63042295",
"text": "def quote_identifier(identifier)\n identifier.gsub(/([^\\.]+)/, \"#{self.quote_string}\\\\1#{self.quote_string}\")\n end",
"title": ""
},
{
"docid": "b93a61f4000d82f326d305a9dc4e3944",
"score": "0.63030225",
"text": "def identifier_string\n title\n end",
"title": ""
},
{
"docid": "fd96c9c957f53abc75647d1d8aae5151",
"score": "0.62950444",
"text": "def quoted_identifier_append(sql, name)\n sql << '\"' << name.to_s.gsub('\"', '\"\"') << '\"'\n end",
"title": ""
},
{
"docid": "8fa87ca601826b29a23c49fd7cd518d2",
"score": "0.6290981",
"text": "def quote_ident(str)\n self.class.quote_ident(str)\n end",
"title": ""
},
{
"docid": "5d1824fea6f02a4e6fc2d35915533b1f",
"score": "0.62855166",
"text": "def use_extended_identifier?\r\n true\r\n end",
"title": ""
},
{
"docid": "1f1221350a220a9116013f328c255d32",
"score": "0.6276765",
"text": "def StringLiteral(parts, quote); end",
"title": ""
},
{
"docid": "b74ee15032c0a8712b66e14b1ad3255d",
"score": "0.6238592",
"text": "def double_quote; self.quote('\"'); end",
"title": ""
},
{
"docid": "00b09d3d5f6489204426a77fdee8d3af",
"score": "0.62223285",
"text": "def doublequoted_string!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n\n \n # - - - - main rule block - - - -\n # at line 185:5: '\\\"' (~ ( '\\\"' ) )* '\\\"'\n match( 0x22 )\n # at line 185:9: (~ ( '\\\"' ) )*\n while true # decision 19\n alt_19 = 2\n look_19_0 = @input.peek( 1 )\n\n if ( look_19_0.between?( 0x0, 0x21 ) || look_19_0.between?( 0x23, 0xffff ) )\n alt_19 = 1\n\n end\n case alt_19\n when 1\n # at line 185:11: ~ ( '\\\"' )\n if @input.peek( 1 ).between?( 0x0, 0x21 ) || @input.peek( 1 ).between?( 0x23, 0xff )\n @input.consume\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 19\n end\n end # loop for decision 19\n match( 0x22 )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n\n end",
"title": ""
},
{
"docid": "dc80d3f2bcd394481e6c06bb8c60996c",
"score": "0.6206419",
"text": "def quote(string); end",
"title": ""
},
{
"docid": "30e538d2b6c187ef84fecc748d77545e",
"score": "0.62031347",
"text": "def quoted_string(str); end",
"title": ""
},
{
"docid": "7a62ba102a9bbc22535d24ac6b62a73a",
"score": "0.6198146",
"text": "def quoted_identifier_append(sql, name)\n sql << '[' << name.to_s.gsub(/\\]/, ']]') << ']'\n end",
"title": ""
},
{
"docid": "b6ba7f97af156736d76e15d547ecae06",
"score": "0.61957663",
"text": "def test_a_name_id_shy\n expected = %Q|<h1><a name=\"a--\" id=\"a--\">-</a>-<!-- RDLabel: \"­­\" --></h1>| +\n \"\\n\" +\n %Q|<h1><a name=\"a--_2\" id=\"a--_2\">-</a>-<!-- RDLabel: \"­­\" --></h1>|\n expected = HTree.parse(expected)\n actual = HTree.parse(parse_rd(\"= --\\n= --\"))\n assert_equal(expected, actual)\n end",
"title": ""
},
{
"docid": "5a30636af065cfb453c911b593f2aeae",
"score": "0.61867946",
"text": "def quotePrefix; end",
"title": ""
},
{
"docid": "4b5a49033f61bb748f64066c550e7747",
"score": "0.61406124",
"text": "def friendly_identifier(skip_first_part = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "d6b8be603a1cf320cf26cc60db0f0d34",
"score": "0.61281073",
"text": "def quote_identifiers_default\n true\n end",
"title": ""
},
{
"docid": "d6b8be603a1cf320cf26cc60db0f0d34",
"score": "0.61281073",
"text": "def quote_identifiers_default\n true\n end",
"title": ""
},
{
"docid": "56250e60b8078b977f35f4b77a4ba238",
"score": "0.61210126",
"text": "def subidentifier_string\n person.fullname if person\n end",
"title": ""
},
{
"docid": "8f3db194b1dec94d28f56f1564de57d3",
"score": "0.61209303",
"text": "def quote_identifier(identifier)\n quote_string = self.quote_string\n identifier.gsub(/([^\\.]+)/, \"#{quote_string}\\\\1#{quote_string}\")\n end",
"title": ""
},
{
"docid": "ca1f1b6e948b9eea3ebf35c1bb3818ad",
"score": "0.61201406",
"text": "def ident; name; end",
"title": ""
},
{
"docid": "589637c9e87d894d6ba2ee0bc7978896",
"score": "0.61194927",
"text": "def DynaSymbol(parts, quote); end",
"title": ""
},
{
"docid": "325a16de94bd64e9c298e34ee8349b9b",
"score": "0.61177486",
"text": "def doublequoted_string!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 12 )\n\n \n # - - - - main rule block - - - -\n # at line 128:4: '\\\"' (~ ( '\\\"' ) )* '\\\"'\n match( 0x22 )\n # at line 128:8: (~ ( '\\\"' ) )*\n while true # decision 3\n alt_3 = 2\n look_3_0 = @input.peek( 1 )\n\n if ( look_3_0.between?( 0x0, 0x21 ) || look_3_0.between?( 0x23, 0xffff ) )\n alt_3 = 1\n\n end\n case alt_3\n when 1\n # at line 128:10: ~ ( '\\\"' )\n if @input.peek( 1 ).between?( 0x0, 0x21 ) || @input.peek( 1 ).between?( 0x23, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 3\n end\n end # loop for decision 3\n match( 0x22 )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 12 )\n\n end",
"title": ""
},
{
"docid": "6a1163f52c03b501c972ab9202b99e52",
"score": "0.6104436",
"text": "def name_with_id\n text_and_id( :name )\n end",
"title": ""
},
{
"docid": "7e78c3d54b819fb0c31662e7583948d8",
"score": "0.6103129",
"text": "def quoted_definition_string\n \"'%s'\" % \\\n definition_string \\\n .gsub('\\\\') { '\\\\\\\\' } \\\n .gsub(\"'\") { \"\\\\'\" }\n end",
"title": ""
},
{
"docid": "7e78c3d54b819fb0c31662e7583948d8",
"score": "0.6103129",
"text": "def quoted_definition_string\n \"'%s'\" % \\\n definition_string \\\n .gsub('\\\\') { '\\\\\\\\' } \\\n .gsub(\"'\") { \"\\\\'\" }\n end",
"title": ""
},
{
"docid": "4f086cd79dbfbc1705f0778bb4aaf812",
"score": "0.60958475",
"text": "def to_quoted_equivalent; end",
"title": ""
},
{
"docid": "a8aeb5a088a1a3746cb9e9da5936a2e5",
"score": "0.6083638",
"text": "def ole_sym(symbol)\r\n symbol.to_s.camelize.gsub(/Id/, 'ID')\r\n end",
"title": ""
},
{
"docid": "8d1d4556798ff31ba5a8fb443c0cb772",
"score": "0.60803354",
"text": "def parse_quoted\n scan(/(\\\\\"|[^\"])*/).gsub(/\\\\(.)/, '\\1')\n end",
"title": ""
},
{
"docid": "b7d20ceff8b69e28d4a46acfdf3fc23f",
"score": "0.60791165",
"text": "def identifier(*args)\n args.empty? ? @identifier ||= name.downcase.sub!(/.*:/, '') : @identifier = args.first\n end",
"title": ""
},
{
"docid": "6e0bc5def77314625f2b238ffe003fe7",
"score": "0.60179573",
"text": "def quoted_identifier_append(sql, c)\n sql << '`' << c.to_s.gsub('`', '``') << '`'\n end",
"title": ""
},
{
"docid": "6e0bc5def77314625f2b238ffe003fe7",
"score": "0.60179573",
"text": "def quoted_identifier_append(sql, c)\n sql << '`' << c.to_s.gsub('`', '``') << '`'\n end",
"title": ""
},
{
"docid": "96fdce63802b776736fcbca4de4a7d11",
"score": "0.60145074",
"text": "def get_name\n expected(:identifier) unless alpha?(@look)\n @value = many(:alnum?)\n @token = @keyword_names.include?(@value) ? :keyword : :identifier\n @value\n end",
"title": ""
},
{
"docid": "9cc6c43dfc35d23f05fce0bc0053a604",
"score": "0.6011249",
"text": "def identifier\n \"\"\n end",
"title": ""
},
{
"docid": "96248787400d9bc26986e1695c7a3c86",
"score": "0.6002969",
"text": "def escape_name(name)\n escape_keyword name.to_s.gsub('_', '__').to_sym \n end",
"title": ""
},
{
"docid": "dc5fc3b42098011c65fb7d7ad0eb4fe1",
"score": "0.5998262",
"text": "def unquoted_string(str); end",
"title": ""
},
{
"docid": "abc86ae7dead04c4c58a5900483bbdf6",
"score": "0.5997375",
"text": "def escape_keyword(name)\n return ('_'+name.to_s).to_sym if CKeywords.include? name\n name\n end",
"title": ""
},
{
"docid": "6ce4f5805d84c45b1a2b212d3225f27b",
"score": "0.5995542",
"text": "def identifier=(value); end",
"title": ""
},
{
"docid": "23ec4eb01203afb431c7b0b1155d2937",
"score": "0.59877133",
"text": "def quoted_string\n regexp(/' .*? '/x) |\n regexp(/\" .*? \"/x)\n end",
"title": ""
},
{
"docid": "29ae58dfa565ddaeb5859dd5e5b43ff8",
"score": "0.59839594",
"text": "def identifier(str)\n return \"id-#{str}\" if str =~ /^\\d/\n str\n end",
"title": ""
},
{
"docid": "492aa5c6ec3838f250e75b301162a118",
"score": "0.5976971",
"text": "def to_identifier(raw_identifier)\r\n raw_identifier.to_s\r\n end",
"title": ""
},
{
"docid": "92b235dc54a62b325a8a8c171ff8894b",
"score": "0.59518105",
"text": "def test_curly_in_attribute_value\n source = %q{\np id=\"{{hello world}}\"= hello_world\n}\n\n assert_html '<p id=\"{{hello world}}\">Hello World from @env</p>', source\n end",
"title": ""
},
{
"docid": "d86b7cf0974ae8b0c2186e64fc0810ac",
"score": "0.5948833",
"text": "def on_ident(value); end",
"title": ""
},
{
"docid": "79ab88acf5ea05346f84917cf2652939",
"score": "0.59452593",
"text": "def jee2_named_id_from(ta_short_code, indicator_short_code)\n ta_short_code.strip!\n ta_short_code.downcase!\n \"jee2_ind_#{ta_short_code}#{indicator_short_code}\"\nend",
"title": ""
},
{
"docid": "6c24f08d96513e179575103499588b5e",
"score": "0.5927542",
"text": "def quote(str); end",
"title": ""
},
{
"docid": "6c24f08d96513e179575103499588b5e",
"score": "0.5927542",
"text": "def quote(str); end",
"title": ""
},
{
"docid": "58d23a730239bd96daf866ba3feddbf5",
"score": "0.5927313",
"text": "def quote_token(str); end",
"title": ""
},
{
"docid": "b6e4430b0b42da6a95730bbf5ddb183b",
"score": "0.59127015",
"text": "def parse_id; end",
"title": ""
},
{
"docid": "32b7e46c90ac046be5dc679b3b709f3f",
"score": "0.59036386",
"text": "def test_a_name_id_number\n expected = %Q|<h1><a name=\"a123\" id=\"a123\">123</a><!-- RDLabel: \"123\" --></h1>| +\n \"\\n\" +\n %Q|<h1><a name=\"a123_2\" id=\"a123_2\">123</a><!-- RDLabel: \"123\" --></h1>|\n expected = HTree.parse(expected)\n actual = HTree.parse(parse_rd(\"= 123\\n= 123\"))\n assert_equal(expected, actual)\n end",
"title": ""
},
{
"docid": "6056a71c442319475a4008ee3ddca7eb",
"score": "0.59025556",
"text": "def c99ext_identifier(name)\n name.gsub(/^([0-9])/, '_\\1').gsub(/[^a-zA-Z0-9_]/, '_')\n end",
"title": ""
},
{
"docid": "6056a71c442319475a4008ee3ddca7eb",
"score": "0.59025556",
"text": "def c99ext_identifier(name)\n name.gsub(/^([0-9])/, '_\\1').gsub(/[^a-zA-Z0-9_]/, '_')\n end",
"title": ""
},
{
"docid": "86eec9661f2787bfbe8186d3fd2991d0",
"score": "0.589711",
"text": "def tokenIdentifier()\n\n\t\tregexDic = {\"Spaces\": /\\A(\\s)+/,\n\t\t\t\t\t \"reserved\": /\\Abegin\\b | \\Aend\\b | \\Aint\\b | \\Abool\\b | \\Abits\\b | \\Ainput\\b | \\Aoutput\\b | \\Aoutputln\\b | \\Aif\\b |\n\t\t\t\t\t \\Aelse\\b | \\Afor\\b | \\Aforbits\\b | \\Aas\\b | \\Afrom\\b | \\Agoing\\b | \\Ahigher\\b | \\Alower\\b | \\Arepeat\\b |\n\t\t\t\t\t \\Awhile\\b | \\Ado\\b/x,\n\t\t\t\t\t \"boolean\": /\\Atrue\\b | \\Afalse\\b/x,\n\t\t\t\t\t \"identifier\": /\\A[a-zA-Z][a-zA-Z0-9_]*/,\n\t\t\t\t\t \"bit array\": /\\A0b[01]+/,\n\t\t\t\t\t \"integer\": /\\A(\\d)+/,\n\t\t\t\t\t \"string\": /\\A\"(\\\\.|[^\\\\\\\"\\n])*\"/,\n\t\t\t\t\t \"left bracket\": /\\A\\[/,\n\t\t\t\t\t \"right bracket\": /\\A\\]/,\n\t\t\t\t\t \"not bits\": /\\A\\~/,\n\t\t\t\t\t \"dollar\": /\\A\\$/,\n\t\t\t\t\t \"at\": /\\A\\@/,\n\t\t\t\t\t \"minus\": /\\A\\-/,\n\t\t\t\t\t \"product\": /\\A\\*/,\n\t\t\t\t\t \"division\": /\\A\\//,\n\t\t\t\t\t \"module\": /\\A\\%/,\n\t\t\t\t\t \"plus\": /\\A\\+/,\n\t\t\t\t\t \"left displacement\": /\\A\\<\\</,\n\t\t\t\t\t \"right displacement\": /\\A\\>\\>/,\n\t\t\t\t\t \"less or equal than\": /\\A\\<\\=/,\n\t\t\t\t\t \"more or equal than\": /\\A\\>\\=/,\n\t\t\t\t\t \"less than\": /\\A\\</,\n\t\t\t\t\t \"more than\": /\\A\\>/,\n\t\t\t\t\t \"equals\": /\\A\\=\\=/,\n\t\t\t\t\t \"not equal\": /\\A\\!\\=/,\n\t\t\t\t\t \"not\": /\\A\\!/,\n\t\t\t\t\t \"assign\": /\\A\\=/,\n\t\t\t\t\t \"and\": /\\A\\&\\&/,\n\t\t\t\t\t \"or\": /\\A\\|\\|/,\n\t\t\t\t\t \"and bits\": /\\A\\&/,\n\t\t\t\t\t \"xor bits\": /\\A\\^/,\n\t\t\t\t\t \"or bits\": /\\A\\|/,\n\t\t\t\t\t \"semicolon\": /\\A\\;/,\n\t\t\t\t\t \"comma\": /\\A\\,/,\n\t\t\t\t\t \"left parenthesis\": /\\A\\(/,\n\t\t\t\t\t \"right parenthesis\": /\\A\\)/ \n\t\t\t\t\t }\n\n\t\tregexDic.each do |key, regex|\n\t\t\tif (@str =~ regex)\n\t\t\t\tkeyStr = key.to_s\n\n\t\t\t\tif (keyStr == \"identifier\" || keyStr == \"bit array\" || keyStr == \"integer\" || keyStr == \"string\" || keyStr == \"boolean\")\n\t\t\t\t\t@hasValue = true\n\t\t\t\t\treturn keyStr.gsub(' ','').upcase\n\n\t\t\t\telsif (keyStr ==\"reserved\")\n\t\t\t\t\treturn @str.gsub(' ','').upcase\n\n\t\t\t\tend\n\n\t\t\t\treturn keyStr.gsub(' ','').upcase\n\t\t\tend\n\t\tend\n\n\t\treturn \"error\"\n\tend",
"title": ""
},
{
"docid": "2acc77f3e0314a70424ee64a25c5f104",
"score": "0.58906734",
"text": "def identifier\n \"#{schema}#{term}\"\n end",
"title": ""
},
{
"docid": "1e58335f05abf0e2d730b96ed1e73e46",
"score": "0.5888754",
"text": "def output_identifier(v)\n v = 'untitled' if v == ''\n v.to_s.downcase.to_sym\n end",
"title": ""
},
{
"docid": "68986a66f348d7fc022e1f570755ce39",
"score": "0.5875844",
"text": "def test_symbols_quoted_id\n @user.status = :active\n assert_equal \"'active'\", @user.status.quoted_id\n end",
"title": ""
},
{
"docid": "68986a66f348d7fc022e1f570755ce39",
"score": "0.5875844",
"text": "def test_symbols_quoted_id\n @user.status = :active\n assert_equal \"'active'\", @user.status.quoted_id\n end",
"title": ""
},
{
"docid": "68986a66f348d7fc022e1f570755ce39",
"score": "0.5875844",
"text": "def test_symbols_quoted_id\n @user.status = :active\n assert_equal \"'active'\", @user.status.quoted_id\n end",
"title": ""
},
{
"docid": "5e0cb110a1617b4e47a9721cd744e46d",
"score": "0.5875577",
"text": "def output_identifier(v)\n v = 'untitled' if v == ''\n (i = identifier_output_method) ? v.to_s.send(i).to_sym : v.to_sym\n end",
"title": ""
}
] |
a2cc16ca31f0b3a549d2a3fe5757df16
|
Public: Ensures the questionable path is prefixed with the base directory and prepends the questionable path with the base directory if false. base_directory the directory with which to prefix the questionable path questionable_path the path we're unsure about, and want prefixed Returns the sanitized path. source://jekyll4.2.2/lib/jekyll.rb:174
|
[
{
"docid": "8875c9d808010913177e400e2b9fe1ee",
"score": "0.77860844",
"text": "def sanitized_path(base_directory, questionable_path); end",
"title": ""
}
] |
[
{
"docid": "fa1701f10a6fd14806dee32553202c3c",
"score": "0.79840904",
"text": "def sanitized_path(base_directory, questionable_path)\n return base_directory if base_directory.eql?(questionable_path)\n\n clean_path = File.expand_path(questionable_path, \"/\")\n clean_path = clean_path.sub(/\\A\\w\\:\\//, '/')\n\n if clean_path.start_with?(base_directory.sub(/\\A\\w\\:\\//, '/'))\n clean_path\n else\n File.join(base_directory, clean_path)\n end\n end",
"title": ""
},
{
"docid": "794ff3b1cb53a67b5328133455d20d47",
"score": "0.59016216",
"text": "def rewrite_base_path(path) # :nodoc:\n if path !~ %r(^/)\n File.join('/', dir, path)\n else\n path\n end\n end",
"title": ""
},
{
"docid": "2ad4c31a8822495276335e6ae2fc5023",
"score": "0.58103377",
"text": "def normalisedDir(baseDir)\n return baseDir.end_with?(\"/\") ? baseDir : baseDir + \"/\"\n end",
"title": ""
},
{
"docid": "93d8b9ca58d3c793f9e81b2c55fdd768",
"score": "0.5576241",
"text": "def get_base\n # See if we need to extend the base_dir\n if @config['base']\n extended_base = File.expand_path(File.join(@real_base, @config['base']))\n if File.directory? extended_base\n @base_dir = extended_base\n else\n puts \"Your base directory doesn't exist: #{extended_base}\"\n exit 1\n end\n end\n end",
"title": ""
},
{
"docid": "436d069bd63d1590ac70e15b8dda0562",
"score": "0.55578595",
"text": "def base_relative_dir\n \t\[email protected](/^\\//,\"\")\n \tend",
"title": ""
},
{
"docid": "716102231f9c4e73bce406e7001b0fcd",
"score": "0.5542532",
"text": "def cleaned_relative_path\n @cleaned_relative_path ||=\n relative_path[0..-extname.length - 1]\n .sub(collection.relative_directory, \"\")\n .gsub(%r!\\.*\\z!, \"\")\n end",
"title": ""
},
{
"docid": "c54fdb01d0f27af4d7652aca0f0a6e0b",
"score": "0.55390394",
"text": "def fix_dir(dir)\n (dir.nil? || dir.empty?) && '/' || dir\n end",
"title": ""
},
{
"docid": "d37636f6ce64fdb1b21f737db9db5ffe",
"score": "0.5505417",
"text": "def resolve_relative_path(path, base_path)\n p = Pathname(base_path)\n p = p.dirname unless p.extname.empty?\n p += path\n\n p.cleanpath.to_s\n end",
"title": ""
},
{
"docid": "e30aed677bd3aa6de83678a2e2300aaa",
"score": "0.5504489",
"text": "def relative_path path, base\n (root? path) && (offset = descends_from? path, base) ? (path.slice offset, path.length) : path\n end",
"title": ""
},
{
"docid": "de90315cbe939c2d20b16c512ccf21f4",
"score": "0.54792297",
"text": "def relative_directory\n @relative_directory ||= \"_#{label}\"\n end",
"title": ""
},
{
"docid": "c7d775e58f0b79033aa9a4488ec21274",
"score": "0.54763705",
"text": "def safe_dir\n options[:root_dir] / name.to_s\n end",
"title": ""
},
{
"docid": "a5888bd4c8cddf922805497e1ac7f613",
"score": "0.5464764",
"text": "def ensure_leading_slash(path); end",
"title": ""
},
{
"docid": "f3d09cf5fa6c7452f41838d709320d4d",
"score": "0.5453435",
"text": "def cleaned_relative_path; end",
"title": ""
},
{
"docid": "f3d09cf5fa6c7452f41838d709320d4d",
"score": "0.5453435",
"text": "def cleaned_relative_path; end",
"title": ""
},
{
"docid": "016b557f46a1e96aa50e6ce6c79756f6",
"score": "0.5425899",
"text": "def relative_directory; end",
"title": ""
},
{
"docid": "d1fb8f77dd84ef3df9dd06766a5aff65",
"score": "0.5423487",
"text": "def base_dir\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "4b5da10177cc7030fce536d5aa3dc190",
"score": "0.5408549",
"text": "def relative_directory\n return '' unless @directory_root\n @path - @directory_root - name\n end",
"title": ""
},
{
"docid": "a7a4bbaab0559dbdf31f66e558099450",
"score": "0.5404036",
"text": "def base?\n @base ||= path.compact.empty?\n end",
"title": ""
},
{
"docid": "23fe83a241e9a524595b6752ad3baf25",
"score": "0.5352223",
"text": "def derive_slug_and_path\n if home?\n self.slug = \"\"\n elsif slug? && !persisted?\n self.slug = add_suffix_if_taken(slug, path_base)\n elsif !slug?\n self.slug = add_suffix_if_taken(slug_base, path_base)\n end\n self.path = tidy_slashes([path_base, slug].map(&:presence).compact.join(\"/\"))\n end",
"title": ""
},
{
"docid": "ae03c841f938dbae4506a0a894cffee3",
"score": "0.5312223",
"text": "def base_dir_for_path_parameters; end",
"title": ""
},
{
"docid": "fa3984789695aa5e7cb14f99aa3774f8",
"score": "0.5307997",
"text": "def path_relative_to_upload_dir\n upload_dir = Gitlab::BackgroundMigration::PrepareUntrackedUploads::RELATIVE_UPLOAD_DIR\n base = %r{\\A#{Regexp.escape(upload_dir)}/}\n @path_relative_to_upload_dir ||= path.sub(base, '')\n end",
"title": ""
},
{
"docid": "9e413f901fb8bd7c589936c9b5c43af6",
"score": "0.52848715",
"text": "def base_directory\n @base_directory\n end",
"title": ""
},
{
"docid": "4772ecd8a9e8cc42360392b2d3d6cf99",
"score": "0.5279731",
"text": "def normalize_url(path)\n @known_pairs ||= {}\n @public_directories_regex ||= Regexp.new(Bones.public_directories.join('|'))\n \n if v = @known_pairs[path]\n return v\n else\n value = case\n when path =~ /^(\\w{3,}:\\/\\/|mailto)/\n # don't do anything to this type of URL\n return path\n when path =~ @public_directories_regex\n path\n when File.directory?('pages' / path)\n path\n else\n # don't add .html if there's already an extension\n path =~ /\\..+/ ? path : path + '.html'\n end\n \n @known_pairs[path] = options.base / value\n end \n end",
"title": ""
},
{
"docid": "a7a56525d53c759b79729ba025e99967",
"score": "0.5264387",
"text": "def sanitize_file_path(filename, base_path)\n # Resolve absolute path.\n path = File.expand_path(\"#{base_path}/#{filename}\")\n logger.info(\"Resolving file download: #{filename}\\n => #{base_path}/#{filename}\\n => #{path}\") unless logger.nil?\n\n # Deny ./../etc/passwd and friends.\n # File must exist, be readable, and not be a directory, pipe, etc.\n #logger.info \"tests: regexp #{path =~ /^#{File.expand_path(base_path)}/}\"\n #logger.info \"tests: readable #{File.readable?(path)}\"\n #logger.info \"tests: file #{File.file?(path)}\"\n raise MissingFile, \"couldn't read #{filename}\" unless\n path =~ /^#{File.expand_path(base_path)}/ and\n File.readable?(path) and\n File.file?(path)\n\n return path\n end",
"title": ""
},
{
"docid": "0db69f0cfda1a82c4309d8c3c28409f9",
"score": "0.525187",
"text": "def base_dir_for_path_parameters\n @base_dir_for_path_parameters ||=\n if File.basename(loaded_path).start_with?('.rubocop') &&\n loaded_path != File.join(Dir.home, ConfigLoader::DOTFILE)\n File.expand_path(File.dirname(loaded_path))\n else\n Dir.pwd\n end\n end",
"title": ""
},
{
"docid": "0db69f0cfda1a82c4309d8c3c28409f9",
"score": "0.525187",
"text": "def base_dir_for_path_parameters\n @base_dir_for_path_parameters ||=\n if File.basename(loaded_path).start_with?('.rubocop') &&\n loaded_path != File.join(Dir.home, ConfigLoader::DOTFILE)\n File.expand_path(File.dirname(loaded_path))\n else\n Dir.pwd\n end\n end",
"title": ""
},
{
"docid": "bdcde4960873dfcf763fdd454baac320",
"score": "0.5233132",
"text": "def skip_clean? path\n true\n end",
"title": ""
},
{
"docid": "2087f26a7163e126ed11c5244728d741",
"score": "0.52307117",
"text": "def chop_path(path, base='.')\n full_base = File.expand_path(base)\n full_path = File.expand_path(path)\n if full_path == full_base\n '.'\n elsif full_path.start_with?(full_base)\n full_path[full_base.size+1..-1]\n else\n full_path\n end\n end",
"title": ""
},
{
"docid": "85efd4108fd7826b510f907418e40f6b",
"score": "0.52014273",
"text": "def skip_clean? path\n to_check = path.relative_path_from(prefix).to_s\n self.class.skip_clean_paths.include? to_check\n end",
"title": ""
},
{
"docid": "42ccc8b1b29225ef6be5e1f7e96fa662",
"score": "0.51937914",
"text": "def sanitize_path path\n require 'pathname'\n dot = Pathname.new('.').expand_path\n\n path.reject do |item|\n path = Pathname.new(item).expand_path\n is_reject = nil\n relative = nil\n begin\n relative = path.relative_path_from(dot).to_s\n rescue ArgumentError\n # On Windows, sometimes crosses different drive letters.\n is_reject = true\n else\n is_reject = relative.start_with? '..'\n end\n is_reject\n end\n end",
"title": ""
},
{
"docid": "b8e95fa2d1a55102d8a23e3ac61857b7",
"score": "0.5170832",
"text": "def clean_path_to(file, options = {})\n # Allow individual calls to this method to specify additional custom load paths to consider\n if options[:load_paths]\n Array(options[:load_paths]).each do |root|\n if File.exist?(\"#{root}/#{file}\")\n return Pathname.new(\"#{root}/#{file}\")\n end\n end\n end\n if File.exist?(file)\n if Pathname.new(file).absolute?\n Pathname.new(file)\n else\n Pathname.new(\"#{Pathname.pwd}/#{file}\")\n end\n # Is it a relative reference within a list file?\n elsif @last_opened_list_dir && File.exist?(\"#{@last_opened_list_dir}/#{file}\")\n Pathname.new(\"#{@last_opened_list_dir}/#{file}\")\n # Is it a relative reference to the current base directory?\n elsif File.exist?(\"#{base_directory}/#{file}\")\n Pathname.new(\"#{base_directory}/#{file}\")\n # Is it a path relative to Origen.root?\n elsif File.exist?(\"#{Origen.root}/#{file}\")\n Pathname.new(\"#{Origen.root}/#{file}\")\n # Is it a path relative to the current directory?\n elsif current_directory && File.exist?(\"#{current_directory}/#{file}\")\n Pathname.new(\"#{current_directory}/#{file}\")\n # Is it a path relative to the current plugin's Origen.root?\n elsif Origen.app.plugins.current && File.exist?(\"#{Origen.app.plugins.current.root}/#{file}\")\n Pathname.new(\"#{Origen.app.plugins.current.root}/#{file}\")\n elsif options[:default_dir]\n m = all_matches(file, options)\n if m\n Pathname.new(m)\n else\n if options[:allow_missing]\n nil\n else\n fail \"Can't find: #{file}\"\n end\n end\n else\n if options[:allow_missing]\n nil\n else\n fail \"Can't find: #{file}\"\n end\n end\n end",
"title": ""
},
{
"docid": "1ece53771d996c30e3a4f91314285dd0",
"score": "0.5165078",
"text": "def rewrite_path # :nodoc:\n if uri.path[0] != ?/\n prepend_path File.join('/', options[:dir].to_s)\n end\n end",
"title": ""
},
{
"docid": "8353d60066d45557542c251672a48575",
"score": "0.5164222",
"text": "def destination(base_directory); end",
"title": ""
},
{
"docid": "8fd9702dd027ca7e74e0dd697f1aa9bf",
"score": "0.5155712",
"text": "def base_dir(dir_name)\n File.expand_path(dir_name)\n end",
"title": ""
},
{
"docid": "e4a89eca29f4aba56fbc8f2ba982cb09",
"score": "0.51284605",
"text": "def basedir\n \"tyrant\"\n end",
"title": ""
},
{
"docid": "ce375ab558f49c342b1a9c7fc3cd848f",
"score": "0.5127128",
"text": "def clean_path(directory)\n directory.gsub(/\\/\\//, '/')\n end",
"title": ""
},
{
"docid": "848401dbac76c3c180ae0285c285e7b0",
"score": "0.5117037",
"text": "def do_stupid_prepend!\n #rewrite file paths in works\n works.each do |w|\n\n # w[:files].map!{|rel_path| File.join(@base_path, rel_path)}\n end\n\n #rewrite file paths in works in collections\n collections.each do |c|\n c[:works] && c[:works].each do |w|\n w[:files].map!{|rel_path| File.join(@base_path, rel_path)}\n end\n end\n end",
"title": ""
},
{
"docid": "a4d19b915cf386f40eadc02b037627b7",
"score": "0.5112076",
"text": "def base_dir; end",
"title": ""
},
{
"docid": "a4d19b915cf386f40eadc02b037627b7",
"score": "0.5112076",
"text": "def base_dir; end",
"title": ""
},
{
"docid": "a4d19b915cf386f40eadc02b037627b7",
"score": "0.5112076",
"text": "def base_dir; end",
"title": ""
},
{
"docid": "a4d19b915cf386f40eadc02b037627b7",
"score": "0.5112076",
"text": "def base_dir; end",
"title": ""
},
{
"docid": "a4d19b915cf386f40eadc02b037627b7",
"score": "0.5112076",
"text": "def base_dir; end",
"title": ""
},
{
"docid": "a4d19b915cf386f40eadc02b037627b7",
"score": "0.5112076",
"text": "def base_dir; end",
"title": ""
},
{
"docid": "a4d19b915cf386f40eadc02b037627b7",
"score": "0.5112076",
"text": "def base_dir; end",
"title": ""
},
{
"docid": "df9817d72bdb8e6e95ff13fa8ad67b6c",
"score": "0.5090804",
"text": "def enclosed_directory\n \".\"\nend",
"title": ""
},
{
"docid": "ced5eeb1d3c954298b9aa25b2d58146d",
"score": "0.50890994",
"text": "def relative!\n super\n replace '' if self == '.'\n end",
"title": ""
},
{
"docid": "aa189bde9f7efd73baabe0ace2703914",
"score": "0.5072704",
"text": "def base_path\n @base_path ||= Dir.pwd\n end",
"title": ""
},
{
"docid": "c65010afc5d6e3c92a9bf378e37f75e8",
"score": "0.50257283",
"text": "def format_directory(dir)\n format_dir = dir.strip\n format_dir = \"/#{format_dir}\" unless format_dir.start_with?('/')\n format_dir\nend",
"title": ""
},
{
"docid": "76c7b3ebaef1fa1b1c37617dde4de9a3",
"score": "0.50182533",
"text": "def relativize_paths(paths)\n return paths unless relativize_paths?\n paths.map do |path|\n path.gsub(%r{^#{@directory}/}, '')\n end\n end",
"title": ""
},
{
"docid": "0ce5ed13b166824644e4ec298f3ff2b3",
"score": "0.501088",
"text": "def proper_base_url(relative_url)\n p(\"-- evaluating the proper base url to use based on config settings: \" + relative_url)\n if (ENV['qa.base.url'] != nil and ENV['qa.base.url'] != \"\")\n p(\"-- using ENV - URL: \" + ENV['qa.base.url'])\n proper_base = (ENV['qa.base.url'] + relative_url)\n else\n p(\"-- using env.yaml file URL: \" + @base_url)\n proper_base = (@base_url + relative_url)\n end\n end",
"title": ""
},
{
"docid": "81784e4c2b5a57b823179f9bc774e221",
"score": "0.50105166",
"text": "def base_dir\n options.fetch('base_dir', '')\n end",
"title": ""
},
{
"docid": "e3f88a33eac5539bd388e287c6eacfff",
"score": "0.5004602",
"text": "def containing_directory\n path.dirname\n end",
"title": ""
},
{
"docid": "4496a90ae17e2931c191bdff6964bf06",
"score": "0.49943691",
"text": "def merge_path(base, rel)\n\n # RFC2396, Section 5.2, 5)\n # RFC2396, Section 5.2, 6)\n base_path = split_path(base)\n rel_path = split_path(rel)\n\n # RFC2396, Section 5.2, 6), a)\n base_path << '' if base_path.last == '..'\n while i = base_path.index('..')\n base_path.slice!(i - 1, 2)\n end\n\n if (first = rel_path.first) and first.empty?\n base_path.clear\n rel_path.shift\n end\n\n # RFC2396, Section 5.2, 6), c)\n # RFC2396, Section 5.2, 6), d)\n rel_path.push('') if rel_path.last == '.' || rel_path.last == '..'\n rel_path.delete('.')\n\n # RFC2396, Section 5.2, 6), e)\n tmp = []\n rel_path.each do |x|\n if x == '..' &&\n !(tmp.empty? || tmp.last == '..')\n tmp.pop\n else\n tmp << x\n end\n end\n\n add_trailer_slash = !tmp.empty?\n if base_path.empty?\n base_path = [''] # keep '/' for root directory\n elsif add_trailer_slash\n base_path.pop\n end\n while x = tmp.shift\n if x == '..'\n # RFC2396, Section 4\n # a .. or . in an absolute path has no special meaning\n base_path.pop if base_path.size > 1\n else\n # if x == '..'\n # valid absolute (but abnormal) path \"/../...\"\n # else\n # valid absolute path\n # end\n base_path << x\n tmp.each {|t| base_path << t}\n add_trailer_slash = false\n break\n end\n end\n base_path.push('') if add_trailer_slash\n\n return base_path.join('/')\n end",
"title": ""
},
{
"docid": "166b0b23be1489440f8d94a36b6bc79e",
"score": "0.4984812",
"text": "def relativize_path(path)\n path.to_s.gsub(/^\\/?#{Regexp.escape(root_path.to_s)}\\/?/, '')\n end",
"title": ""
},
{
"docid": "cb6c70da8082079f95336230f335a8e7",
"score": "0.4982007",
"text": "def corresponding_primary_content_type_base_dir\n # OPTIMIZE: Can we replace this method with #corresponding_content_type_base_dir_in_other_repo ?\n File.expand_path(\n config_setting(:relative_path_to_primary_content_type),\n config_base_dir(:content_type_dir)\n ) + '/'\n end",
"title": ""
},
{
"docid": "02c0effe82b047d0c1357150905ba08c",
"score": "0.49772856",
"text": "def base_path path=nil\n if path\n @base_path = path\n end\n @base_path || default_base_path\n end",
"title": ""
},
{
"docid": "a4dfd69078bac27b71ebaa83824da7ad",
"score": "0.4973958",
"text": "def qualify_path(path, root = @app_dir)\n \"$PWD/#{Pathname.new(path).relative_path_from(Pathname.new(root))}\"\n end",
"title": ""
},
{
"docid": "40038a8a439e62f192be0683dcc07fe7",
"score": "0.4970358",
"text": "def directory(_mapped_locale, _is_default)\n ''\n end",
"title": ""
},
{
"docid": "be171535c67178cbcf60833462fbe618",
"score": "0.49690393",
"text": "def set_realpath\n return super if Node.source.eql?(:node) || persisted?\n\n # binding.pry\n path_n = Pathname.new(path)\n path_n.mkdir unless path_n.exist?\n super\n end",
"title": ""
},
{
"docid": "4732ba4c995be724ce5a38714ae43473",
"score": "0.49660677",
"text": "def relative_path\n @relative_path ||= File.join(*[@dir, @name].map(&:to_s).reject(&:empty?)).delete_prefix(\"/\")\n end",
"title": ""
},
{
"docid": "50df435d23fe1ab4e6fe35724e401709",
"score": "0.49647048",
"text": "def dummy_path\n rel_path = ENV['DUMMY_APP_PATH'] || 'spec/dummy'\n if @current_path.to_s.include?(rel_path)\n @current_path\n else\n @current_path = File.expand_path(rel_path)\n end\n end",
"title": ""
},
{
"docid": "3e7085efa18d9b7853530a012007b542",
"score": "0.4957238",
"text": "def basedir\n return nil if !file\n File.dirname File.absolute_path @file\n end",
"title": ""
},
{
"docid": "920cf223a955390af354569b9d39c421",
"score": "0.49484116",
"text": "def skip_clean? path\n return true if path.extname == '.la' and self.class.skip_clean_paths.include? :la\n to_check = path.relative_path_from(prefix).to_s\n self.class.skip_clean_paths.include? to_check\n end",
"title": ""
},
{
"docid": "83da730fbb0d5d42b583ad312568ce15",
"score": "0.49435577",
"text": "def output_base_valid?\n if File.exists?(@options.output_base)\n if !File.directory?(@options.output_base)\n @stderr.puts(\"Final output location, #{@options.output_base}, exists and is not a directory\")\n return false\n elsif !File.writable?(@options.output_base)\n @stderr.puts(\"Final output location, #{@options.output_base}, is not writable\")\n return false\n end\n else\n Dir.mkdir(@options.output_base)\n end\n return true\nend",
"title": ""
},
{
"docid": "65d7c0b531fe758282d187619543425b",
"score": "0.49426162",
"text": "def prepare\n FileUtils.mkdir_p(@base_dir)\n end",
"title": ""
},
{
"docid": "8dda48ac1c34d692e6ea527297bdcc18",
"score": "0.4941775",
"text": "def directory_path\n @directory_path ||= url_file_path.sub /([^\\/]*)\\z/, ''\n end",
"title": ""
},
{
"docid": "e6998f74f8dc9b5ebfc4321981db7199",
"score": "0.49416155",
"text": "def prefixed_working_directory\n # We fall back to \"*\", which means certificates and profiles\n # from all teams that use this bucket would be installed. This is not ideal, but\n # unless the user provides a `team_id`, we can't know which one to use\n # This only happens if `readonly` is activated, and no `team_id` was provided\n @_folder_prefix ||= currently_used_team_id\n if @_folder_prefix.nil?\n # We use a `@_folder_prefix` variable, to keep state between multiple calls of this\n # method, as the value won't change. This way the warning is only printed once\n UI.important(\"Looks like you run `match` in `readonly` mode, and didn't provide a `team_id`. This will still work, however it is recommended to provide a `team_id` in your Appfile or Matchfile\")\n @_folder_prefix = \"*\"\n end\n return File.join(working_directory, @_folder_prefix)\n end",
"title": ""
},
{
"docid": "e6998f74f8dc9b5ebfc4321981db7199",
"score": "0.49416155",
"text": "def prefixed_working_directory\n # We fall back to \"*\", which means certificates and profiles\n # from all teams that use this bucket would be installed. This is not ideal, but\n # unless the user provides a `team_id`, we can't know which one to use\n # This only happens if `readonly` is activated, and no `team_id` was provided\n @_folder_prefix ||= currently_used_team_id\n if @_folder_prefix.nil?\n # We use a `@_folder_prefix` variable, to keep state between multiple calls of this\n # method, as the value won't change. This way the warning is only printed once\n UI.important(\"Looks like you run `match` in `readonly` mode, and didn't provide a `team_id`. This will still work, however it is recommended to provide a `team_id` in your Appfile or Matchfile\")\n @_folder_prefix = \"*\"\n end\n return File.join(working_directory, @_folder_prefix)\n end",
"title": ""
},
{
"docid": "86aeac8639474d5bbe945b031a9b475a",
"score": "0.49223763",
"text": "def base_dir=(_arg0); end",
"title": ""
},
{
"docid": "86aeac8639474d5bbe945b031a9b475a",
"score": "0.49223763",
"text": "def base_dir=(_arg0); end",
"title": ""
},
{
"docid": "86aeac8639474d5bbe945b031a9b475a",
"score": "0.49223763",
"text": "def base_dir=(_arg0); end",
"title": ""
},
{
"docid": "86aeac8639474d5bbe945b031a9b475a",
"score": "0.49223763",
"text": "def base_dir=(_arg0); end",
"title": ""
},
{
"docid": "86aeac8639474d5bbe945b031a9b475a",
"score": "0.49223763",
"text": "def base_dir=(_arg0); end",
"title": ""
},
{
"docid": "86aeac8639474d5bbe945b031a9b475a",
"score": "0.49223763",
"text": "def base_dir=(_arg0); end",
"title": ""
},
{
"docid": "86aeac8639474d5bbe945b031a9b475a",
"score": "0.49223763",
"text": "def base_dir=(_arg0); end",
"title": ""
},
{
"docid": "86aeac8639474d5bbe945b031a9b475a",
"score": "0.49223763",
"text": "def base_dir=(_arg0); end",
"title": ""
},
{
"docid": "db53069596585bc40c10a80709a80c62",
"score": "0.49090725",
"text": "def relativize(base_uri)\n if self.to_s.start_with?(base_uri.to_s) && %w(# ?).include?(self.to_s[base_uri.to_s.length, 1]) ||\n base_uri.to_s.end_with?(\"/\", \"#\") &&\n self.to_s.start_with?(base_uri.to_s)\n return RDF::URI(self.to_s[base_uri.to_s.length..-1])\n else\n # Create a list of parents, for which this IRI may be relative.\n u = RDF::URI(base_uri)\n iri_set = u.to_s.end_with?('/') ? [u.to_s] : []\n iri_set << u.to_s while (u = u.parent)\n iri_set.each_with_index do |bb, index|\n next unless self.to_s.start_with?(bb)\n rel = \"../\" * index + self.to_s[bb.length..-1]\n return rel.empty? ? \"./\" : rel\n end\n end\n self\n end",
"title": ""
},
{
"docid": "c6af88d000c408ae4756b3beb8f9ecf7",
"score": "0.49036393",
"text": "def base_path\n Dir.pwd + \"/\"\n end",
"title": ""
},
{
"docid": "7d6f1291bb391f5daa7b7fb559f979df",
"score": "0.4901523",
"text": "def sanitize_path(path); end",
"title": ""
},
{
"docid": "f82763021316271023ba8df00ee16ca6",
"score": "0.48943934",
"text": "def fully_qualified_dir_path?(path)\n path[0, 1] == '/'\n end",
"title": ""
},
{
"docid": "03dde0303a6ef2caa2af21e4170ea23e",
"score": "0.489138",
"text": "def homify f = ''\n if f.length == 0 then @homedir\n else \"#{@homedir}/#{f}\" end\n end",
"title": ""
},
{
"docid": "64589fc463943777a6c0d0e301ce3267",
"score": "0.4890961",
"text": "def base_path\n @base_path ||= server_path(File.expand_path(Dir.pwd))\n end",
"title": ""
},
{
"docid": "fde0fd42a1e65e1d1098ac94cdf8abca",
"score": "0.48893297",
"text": "def basepath; end",
"title": ""
},
{
"docid": "5ee7346092791d26db468e4e39ba4f6e",
"score": "0.4886433",
"text": "def categories_from_path(special_dir)\n if relative_path.start_with?(special_dir)\n superdirs = []\n else\n superdirs = relative_path.sub(Document.superdirs_regex(special_dir), \"\")\n superdirs = superdirs.split(File::SEPARATOR)\n superdirs.reject! { |c| c.empty? || c == special_dir || c == basename }\n end\n\n merge_data!({ \"categories\" => superdirs }, :source => \"file path\")\n end",
"title": ""
},
{
"docid": "359a81ff5c3cd8361866c34198261c05",
"score": "0.48845753",
"text": "def shorten2(path)\n p = get(path)\n home = Pa.home2\n\n return p if home.empty?\n\n ret = relative_to2(p, home)\n\n if ret == p\n p\n else\n ret == \".\" ? \"\" : ret\n File.join(\"~\", ret)\n end\n end",
"title": ""
},
{
"docid": "4a34e02824735634e97308ba8f4f1a3a",
"score": "0.4877752",
"text": "def normalized_path(file); end",
"title": ""
},
{
"docid": "49a53b505609a940a4784a5c41d96fcf",
"score": "0.4877417",
"text": "def url_safe_name\n name == '/' ? \"root-dir--#{file_type}\" : \"#{name}--#{file_type}\"\n end",
"title": ""
},
{
"docid": "5341ecd64267f4b14895cc955cd74143",
"score": "0.48676667",
"text": "def base_dir\n return Gem.dir unless loaded_from\n @base_dir ||= if default_gem? then\n File.dirname File.dirname File.dirname loaded_from\n else\n File.dirname File.dirname loaded_from\n end\n end",
"title": ""
},
{
"docid": "fd564a65fd139957c813f462edb49944",
"score": "0.4866351",
"text": "def preprocess_path(path, internal_pwd)\n path = '' unless path\n path.strip!\n\n path = unless File.exists? path\n begin\n instance_eval(path)\n rescue NameError, SyntaxError\n end\n end || path\n\n File.expand_path(path)\n end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.48655474",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "01d6de83134d435e717996fd3d7d5c38",
"score": "0.48655474",
"text": "def normalize_path(path); end",
"title": ""
},
{
"docid": "1901954a041a57f2c535b40a294f4157",
"score": "0.48654494",
"text": "def remove_extra_slashes\n self.home = StringConstructor.sanitized_filepath self.home\n end",
"title": ""
},
{
"docid": "680911e435372af89f178e74d41d44c7",
"score": "0.4857247",
"text": "def clean_path(file_path)\n if File.directory?(file_path)\n file_path = File.expand_path(file_path)\n end\n\n file_path\n end",
"title": ""
},
{
"docid": "ef85e9b1fd1bc5a8be16228082c5ca6f",
"score": "0.48529413",
"text": "def path_without_name_and_ref(path)\n Jekyll.sanitized_path theme.root, path.split(\"/\").drop(1).join(\"/\")\n end",
"title": ""
},
{
"docid": "20d43f3911924611df0ca9e94d68bea2",
"score": "0.4842108",
"text": "def GetProjectDirectoryRelativeBaseDirectory(projectRelativePath)\n return FormatXmlPath(StripFilenameFromPath(projectRelativePath))\n end",
"title": ""
}
] |
26a5d8d6d288c7718825d84af1c13852
|
def to_miles(km_value) km_value / 1.6093 end
|
[
{
"docid": "2b74f30099f907300e60d63d904736ec",
"score": "0.0",
"text": "def average_speed_in_kph\n total_distance_in_km / total_time_in_seconds * 3600\n end",
"title": ""
}
] |
[
{
"docid": "7540fb9fb68bf51bd4fdc82137301228",
"score": "0.93424696",
"text": "def to_miles(km); end",
"title": ""
},
{
"docid": "c7cc64f38d7b95aac088c8286df0a351",
"score": "0.9261874",
"text": "def to_miles(km)\n km * km_in_mi\n end",
"title": ""
},
{
"docid": "1b9995a447484f3ad64050c98482550b",
"score": "0.91536003",
"text": "def to_miles(km)\n km * km_in_mi\n end",
"title": ""
},
{
"docid": "2aea45ce6ec37d1ad33c22be0785e3ce",
"score": "0.8561106",
"text": "def miles_to_kilometers(miles)\n miles * 1.6\nend",
"title": ""
},
{
"docid": "2aea45ce6ec37d1ad33c22be0785e3ce",
"score": "0.8561106",
"text": "def miles_to_kilometers(miles)\n miles * 1.6\nend",
"title": ""
},
{
"docid": "988427d7e9a0f72bc07bc056c5050df5",
"score": "0.85174954",
"text": "def kilo_to_miles(kilo)\n kilo * 0.62137\n end",
"title": ""
},
{
"docid": "35b60c4a24938cff0e813025494876c1",
"score": "0.8401408",
"text": "def to_miles\n\t\t@distance / @converter\n\tend",
"title": ""
},
{
"docid": "6de3d7f416d1338121d4f0a614d26d2b",
"score": "0.8391015",
"text": "def to_nautical_miles(km); end",
"title": ""
},
{
"docid": "ce7278938133a28ffa498b65ec45ce7e",
"score": "0.8110916",
"text": "def to_miles(km)\n Geocoder.log(:warn, \"DEPRECATION WARNING: Geocoder::Calculations.to_miles is deprecated and will be removed in Geocoder 1.5.0. Please multiply by KM_IN_MI instead.\")\n km * KM_IN_MI\n end",
"title": ""
},
{
"docid": "58fe89a2a4a9b29847be4a7b897bd7b7",
"score": "0.79642564",
"text": "def distance_in_miles\n distance * 0.00062137\n end",
"title": ""
},
{
"docid": "32c118667c1efa18104f48da3c5f35dd",
"score": "0.7920769",
"text": "def distance_miles\n @distance_meters.to_f / 1609.35\n end",
"title": ""
},
{
"docid": "525ed4dfa4084ca31e5b31afe46ac435",
"score": "0.7658282",
"text": "def miles_to_kilometres(miles) # defines the class (this of it as a method on this case) with a parameter of miles\n kilometers = miles * 1.63 # this is the formula for the conversion of miles -> km\n #you can put anything in brackets and \n #use (\"number\").to_f /// (\"number\").to_s /// (\"number\").to_i \n return \"%.2f km\" % kilometers\nend",
"title": ""
},
{
"docid": "99073768a9f25eb368f902cd385a51bf",
"score": "0.76341486",
"text": "def convert_km\n (distance * 1.61).round(2)\n end",
"title": ""
},
{
"docid": "5ec15f01ecd45556300249b0b70fc4c9",
"score": "0.7615596",
"text": "def to_kilometers(mi)\n mi * mi_in_km\n end",
"title": ""
},
{
"docid": "8b150cab764cfa94f3f0ccce99898373",
"score": "0.7559249",
"text": "def delta_miles \n Rmiles * distance\n end",
"title": ""
},
{
"docid": "afcc1c4d539f360c5364c3893a9bc191",
"score": "0.75152045",
"text": "def kilometer_to_meter(value)\n value * 1000.0\n end",
"title": ""
},
{
"docid": "55d5d114592be9df166ad927be8f3c9b",
"score": "0.7505577",
"text": "def miles\n \tcase self.u\n \twhen \"miles\", \"mile\" then\n \t\tself.d\n \twhen \"meters\", \"meter\" then\n \t\tself.d / 1609.344\n \twhen \"kilometers\", \"kilometer\" then\n \t\tself.d * 0.621371\n \twhen \"yards\", \"yard\" then\n \t\tself.d * 0.000568182\n \telse\n \t\tnil\n \tend\n end",
"title": ""
},
{
"docid": "1f18a87c70d47025d8c0967fedc5d118",
"score": "0.7504182",
"text": "def convert_units\n # 1 mile = 1.6093 km\n # 1 km = 0.6214 miles\n if self.kilometers.present?\n self.miles = self.kilometers / 1.6093\n elsif self.miles.present?\n self.kilometers = self.miles * 1.6093\n end\n end",
"title": ""
},
{
"docid": "57dc2aad5b29d60accada5a5f1593d0f",
"score": "0.74367183",
"text": "def distance_to_mi\n case @unit\n when 'mi' then distance.to_f\n when 'km' then distance.to_f * 0.621371192\n end\n end",
"title": ""
},
{
"docid": "fe858871b98a4bbe681213eb0e6f17a8",
"score": "0.7428285",
"text": "def to_kilometers(mi); end",
"title": ""
},
{
"docid": "f6121278e040405f496fe7adbe416637",
"score": "0.73930293",
"text": "def mi_in_km\n 1.0 / KM_IN_MI\n end",
"title": ""
},
{
"docid": "d2a9e8d48fa7348797b6a8aa40be46d4",
"score": "0.73858666",
"text": "def to_km\n self / 100000.0\n end",
"title": ""
},
{
"docid": "b9025b8f50f95bf963b240762bf50129",
"score": "0.7380497",
"text": "def distance_in_kms\n (self[:distance_in_miles].to_f * 1.60934).round(3)\n end",
"title": ""
},
{
"docid": "522228636137bd8f7afb30eb9584bcc2",
"score": "0.7324039",
"text": "def mi_in_km; end",
"title": ""
},
{
"docid": "969f14a2699059f90a2b954f81bae48a",
"score": "0.7259993",
"text": "def km_in_mi\n 0.621371192\n end",
"title": ""
},
{
"docid": "969f14a2699059f90a2b954f81bae48a",
"score": "0.7259993",
"text": "def km_in_mi\n 0.621371192\n end",
"title": ""
},
{
"docid": "7af05d8e8da9398b7bd0837ae5d2bedd",
"score": "0.72567666",
"text": "def to_nautical_miles(km)\n Geocoder.log(:warn, \"DEPRECATION WARNING: Geocoder::Calculations.to_nautical_miles is deprecated and will be removed in Geocoder 1.5.0. Please multiply by KM_IN_NM instead.\")\n km * KM_IN_NM\n end",
"title": ""
},
{
"docid": "fd75fd996aab341793392806fd8eaa10",
"score": "0.72335684",
"text": "def to_kilometers\n\t\t@distance * 1.609344\n\tend",
"title": ""
},
{
"docid": "8684a28f6f3a22798012bc922a776e35",
"score": "0.7170349",
"text": "def to_mile\n end",
"title": ""
},
{
"docid": "12bde789d3445ce457da9e82e5b76fdc",
"score": "0.7156955",
"text": "def to_kilometers(unit)\n case unit\n when 'kilometers'\n self\n\n when 'miles'\n self * 1.60934\n\n when 'meters'\n self * 0.001\n\n when 'yards'\n self * 0.0009144\n\n when 'feet'\n self * 0.0003048\n\n when 'inches'\n self * 2.54e-5\n\n when 'centimeters'\n self * 1e-5\n\n when 'millimeters'\n self * 1e-6\n\n end\n end",
"title": ""
},
{
"docid": "bcd1962a955f5fc69f3b9736625fbb64",
"score": "0.7135685",
"text": "def update_miles(km)\n return unless @miles\n difference = Data::Vector.km_to_m(km.to_f) - @miles\n # only clear miles if the stored miles is off be more then 1 unit\n # then the conversion of kilometers\n @miles = nil unless difference.abs <= 1.0\n end",
"title": ""
},
{
"docid": "eb6c8c278d6c6515459bb80f1315648d",
"score": "0.7103459",
"text": "def meters(inch)\n inch*0.025400\n\nend",
"title": ""
},
{
"docid": "9bc3f3a166108ae9f94664a21fe2bb1c",
"score": "0.70966095",
"text": "def convert_to_m(height_inches)\n height_inches * 0.0254\nend",
"title": ""
},
{
"docid": "b5c91b6706888a0cb3f0c6e19ae569f5",
"score": "0.7045167",
"text": "def km_in_mi; end",
"title": ""
},
{
"docid": "40a54c3d6c5ea32ca62f716ba65491e1",
"score": "0.700439",
"text": "def to_kilometers(mi)\n Geocoder.log(:warn, \"DEPRECATION WARNING: Geocoder::Calculations.to_kilometers is deprecated and will be removed in Geocoder 1.5.0. Please multiply by MI_IN_KM instead.\")\n mi * mi_in_km\n end",
"title": ""
},
{
"docid": "6708e746e2489499b6f4fc7126d31088",
"score": "0.696987",
"text": "def to_cm (inch_value)\r\n\tinch_value * 2.54\r\nend",
"title": ""
},
{
"docid": "92e8835677a114255ab09189b9021419",
"score": "0.6951398",
"text": "def get_miles\n @miles\n end",
"title": ""
},
{
"docid": "92e8835677a114255ab09189b9021419",
"score": "0.6951398",
"text": "def get_miles\n @miles\n end",
"title": ""
},
{
"docid": "8dfc05989929fbf8b82ebf7bf7cef6ef",
"score": "0.69397694",
"text": "def distance_in_m\n (distance.round(1) * 1000).round(0)\n end",
"title": ""
},
{
"docid": "1ff93108ae74b3c24b617331dcd5d281",
"score": "0.6920416",
"text": "def meter_to_kilometer(value)\n value / 1000.0\n end",
"title": ""
},
{
"docid": "d58ae5142641866362abe8d3a714a3cf",
"score": "0.6876754",
"text": "def converter(mpg)\n # this converts mpg (miles per gallon)\n # to kpl (kilometers per liter)\n km_per_mi = 1.609344\n l_per_gal = 4.54609188\n (mpg.to_f * km_per_mi / l_per_gal).round(2)\nend",
"title": ""
},
{
"docid": "98016305f2bf355640ff6bff3fd407ab",
"score": "0.6876495",
"text": "def to_km\n end",
"title": ""
},
{
"docid": "4cca57f25c1c9998b28c32e79b176da6",
"score": "0.687306",
"text": "def convert_to_inches(meters)\n meters * 39.37 if meters.is_a?(Numeric)\nend",
"title": ""
},
{
"docid": "2e77fba690e360a3c10e9beb9ff62424",
"score": "0.6836556",
"text": "def miles_driven\n return @trips.map(&:miles_driven).inject(0, :+).round(0)\n end",
"title": ""
},
{
"docid": "aebc8682c09d6228f76851dc105c3e08",
"score": "0.6835229",
"text": "def miles\n parsed_activity.css('#statsDistance .mainText').text.to_f\n end",
"title": ""
},
{
"docid": "28cbe308b8613272b849e36a2805ecd0",
"score": "0.6762167",
"text": "def convert_km_to_au(distance_in_km)\n return distance_in_km / 150_000_000\nend",
"title": ""
},
{
"docid": "8321553601459922633b86b5e1f4783b",
"score": "0.67576265",
"text": "def mph (miles, hours)\n\tmiles.to_f / hours.to_f\nend",
"title": ""
},
{
"docid": "907437bcb6ae1fab9a9850154238971e",
"score": "0.67506844",
"text": "def distance_in_miles(geopoint, lng = nil)\n distance_in_km(geopoint, lng) * 0.621371\n end",
"title": ""
},
{
"docid": "b82fa0a950a96d269f6ae95a345cc2c6",
"score": "0.6750642",
"text": "def km_in_mi\n KM_IN_MI\n end",
"title": ""
},
{
"docid": "4414a4802e442665f2ce50311b4ad9ae",
"score": "0.6744954",
"text": "def convert_in_to_cm(inches)\n in_to_cm = 2.54\n inches * in_to_cm\nend",
"title": ""
},
{
"docid": "deaddaad49aaabe2b6ed08471413c247",
"score": "0.6732339",
"text": "def gas_mileage(liters, km)\n puts \"#{km / liters} kms per liter of gas.\"\n end",
"title": ""
},
{
"docid": "deaddaad49aaabe2b6ed08471413c247",
"score": "0.6732339",
"text": "def gas_mileage(liters, km)\n puts \"#{km / liters} kms per liter of gas.\"\n end",
"title": ""
},
{
"docid": "c4081afcb73fdd6f306dfcd10addd3cd",
"score": "0.67174065",
"text": "def mm(inVal)\r\n return inVal/2.54\r\nend",
"title": ""
},
{
"docid": "f77b3c916c1f4e123ff52444da7ec9c1",
"score": "0.6704771",
"text": "def to_cm(inches)\r\n return inches * 2.54\r\nend",
"title": ""
},
{
"docid": "73dc3d5b11469ad7df29bddfa1447dbc",
"score": "0.669883",
"text": "def mi_in_km\n Geocoder.log(:warn, \"DEPRECATION WARNING: Geocoder::Calculations.mi_in_km is deprecated and will be removed in Geocoder 1.5.0. Please use 1.0 / KM_IN_MI instead.\")\n 1.0 / KM_IN_MI\n end",
"title": ""
},
{
"docid": "d91bfe78cce6dc0aaa72b22af5584f9e",
"score": "0.6696632",
"text": "def inches_to_cm(inches)\r\n inches * 2.54\r\nend",
"title": ""
},
{
"docid": "a0d8cda435263e2e1384c29148b58cd7",
"score": "0.6689305",
"text": "def distance_in_miles(geopoint,lng = nil)\n distance_in_km(geopoint, lng) * 0.621371\n end",
"title": ""
},
{
"docid": "e49b3352241dac13a71b1a7d9203784c",
"score": "0.66877514",
"text": "def inches_to_cm(inches)\n return inches * 2.54\nend",
"title": ""
},
{
"docid": "ec5b29a44398fa3743fe32b5b349b55c",
"score": "0.6677644",
"text": "def test_class_meters_to_kilometers\n assert_equal(0.0003, M9t::Distance.meters_to_kilometers(0.3))\n end",
"title": ""
},
{
"docid": "bb88c4641962baf26628de1fc44674c8",
"score": "0.66725",
"text": "def miles num\n if num >= 1000\n mil num\n k = num%1000\n validate k\n end\n end",
"title": ""
},
{
"docid": "5c4206745349e530501bc4c7cf939ac7",
"score": "0.6641506",
"text": "def distance_in_meters\n self.distance * 1609.34\n end",
"title": ""
},
{
"docid": "a34bc2c674d0cc4328d11f5d27ab1a8d",
"score": "0.6634531",
"text": "def mileage_calc (liters_consumed, miles_driven)\n liter_per_gallon = 0.264179\n mileage = (miles_driven / (liters_consumed * liter_per_gallon)).round(2)\nend",
"title": ""
},
{
"docid": "c3050c0ba93bf7bc4be6eb9a51dadd7d",
"score": "0.6620467",
"text": "def miles_driven=(data)\n @miles_driven = data.to_f\n end",
"title": ""
},
{
"docid": "1d8222b130f13785554fe9bef739770e",
"score": "0.661907",
"text": "def convert_inches_to_cm(measurement_inches, conversion_factor)\n measurement_inches * conversion_factor\nend",
"title": ""
},
{
"docid": "eaadb6b8a0eceda241a0a583559c4d6d",
"score": "0.66094214",
"text": "def to_mile(**options) = convert_to('mile', **options)",
"title": ""
},
{
"docid": "ebf3237dfa8767f7041cc9706a5dd60a",
"score": "0.6597328",
"text": "def to_mi\n self.to_ft / 5280.0\n end",
"title": ""
},
{
"docid": "81cdaff07b218d607bd8e1a55df055ad",
"score": "0.65584666",
"text": "def inches_to_mm(inches)\n (inches * 25.4).to_f.round_with_precision(2)\n end",
"title": ""
},
{
"docid": "8656a1b648a7b20548d2087242bba23f",
"score": "0.6551552",
"text": "def depreciated_value_mile\n current_value * (1 - mileage * DEPR_PER_MILE)\n end",
"title": ""
},
{
"docid": "51f2b166713ac31a3ac1855cd1b4a739",
"score": "0.652599",
"text": "def convert_ft_per_min_to_m_per_sec(value)\n value = (value.to_f * 0.00508).round(2)\n return value\n end",
"title": ""
},
{
"docid": "701841f56f4d20c3f3f67308973fd674",
"score": "0.6524497",
"text": "def display_distance_in_mile\n puts \"Total jarak yang ditempuh adalah #{(self.total_dist/1000/1.60934).floor(3)} mile\"\n end",
"title": ""
},
{
"docid": "0c8c41e68e1c8d72519a199fee8f5b18",
"score": "0.65090513",
"text": "def inches_to_cm(height_inches)\n height_inches * 2.54\nend",
"title": ""
},
{
"docid": "972008f2ea20881e16bf980c2aed4c0e",
"score": "0.6484615",
"text": "def to_metric(value)\n\t\tgo = (value/1000000000).floor\n\t\tmo = ((value - go*1000000000)/1000000).floor\n\t\tko = ((value - go*1000000000 - mo*1000000)/1000).floor\n\t\to = (value - go*1000000000 - mo*1000000 - ko*1000).floor\n\n\t\treturn(\"#{go}..#{mo}.g\") if (go != 0)\n\t\treturn(\"#{mo}...#{ko}.m\") if (mo != 0)\n\t\treturn(\"#{ko}...#{o}).k\") if (ko != 0)\n\t\treturn(o)\n\tend",
"title": ""
},
{
"docid": "62976ae05dac35667171a2fbdacaf492",
"score": "0.64840776",
"text": "def calculate_zoom_level(miles)\n result = case miles\n when 0..39 then 19\n when 40..77 then 18\n when 78..154 then 17\n when 155..307 then 16\n when 308..614 then 15\n when 615..1227 then 14\n when 1228..2453 then 13\n when 2454..4910 then 12\n when 4911..9809 then 11\n when 9810..19618 then 10\n when 19619..39235 then 9\n when 39235..78469 then 8\n when 78470..156938 then 7\n when 156939..313876 then 6\n when 313877..627751 then 5\n when 627752..1255501 then 4\n when 1255502..2511001 then 3\n when 2511002..5022001 then 2\n when 5022002..10044001 then 1\n when 10044002..10000000000000 then 0\n end\n end",
"title": ""
},
{
"docid": "af6d1377d8c1d75b1b62aa300f6514df",
"score": "0.6469109",
"text": "def unitize(value)\n if celsius?\n celsius = (value.to_f / 10.0 - 32) * 5/9\n (celsius / 5).round(1) * 5\n else\n value.to_f / 10.0\n end\n end",
"title": ""
},
{
"docid": "c950cf02c333258a9d0a551ba261a7a3",
"score": "0.6465414",
"text": "def update_kilometers(m)\n return unless @kilometers\n difference = Data::Vector.m_to_km(m.to_f) - @kilometers\n # only clear kilometers if the stored kilometers is off be more then 1 unit\n # then the conversion of miles\n @kilometers = nil unless difference.abs <= 1.0\n end",
"title": ""
},
{
"docid": "0cf4db8a0962a4447771da452d65b100",
"score": "0.644738",
"text": "def feet_to_inches(num)\n result = num * 12.00\n return result\nend",
"title": ""
},
{
"docid": "139ef7d3bfe6b703aa591819bacf74ff",
"score": "0.6442338",
"text": "def inches_to_cm(height_inches)\n height_cm = height_inches * 2.54\nend",
"title": ""
},
{
"docid": "a0de32440b605665bbff0ad2797341c3",
"score": "0.6439682",
"text": "def km_per_degree_lat(lat)\n (90.0 - lat) * (111.0 / 90.0)\nend",
"title": ""
},
{
"docid": "d624e6c557d1291e38ff780b1db74c07",
"score": "0.64388245",
"text": "def km(dist)\n \"#{dist}km\"\n end",
"title": ""
},
{
"docid": "7adef3ed1c7afe2686c68bc0df99bfc2",
"score": "0.6382127",
"text": "def inches_of_hg_to_mb(inches)\n inches * 33.8637526\n end",
"title": ""
},
{
"docid": "a4c7f627d02154686f86fb0b3dec519d",
"score": "0.63733214",
"text": "def in_user_distance_units(val)\n if current_user.pilot.preferences.distance_unit == UNITS[:miles]\n return val / UNITS[:conversions][:distance][\"miles_to_km\"]\n end\n val\n end",
"title": ""
},
{
"docid": "1d4ac07758130f7b1aeb12fe7aa2efee",
"score": "0.63373667",
"text": "def nm_in_km; end",
"title": ""
},
{
"docid": "8a46b3109b58330ae209006e46ca3f00",
"score": "0.63197863",
"text": "def units_per_longitude_degree(lat, units)\n miles_per_longitude_degree = (LATITUDE_DEGREES * Math.cos(lat * PI_DIV_RAD)).abs\n units == :miles ? miles_per_longitude_degree : miles_per_longitude_degree * KMS_PER_MILE\n end",
"title": ""
},
{
"docid": "8a46b3109b58330ae209006e46ca3f00",
"score": "0.63197863",
"text": "def units_per_longitude_degree(lat, units)\n miles_per_longitude_degree = (LATITUDE_DEGREES * Math.cos(lat * PI_DIV_RAD)).abs\n units == :miles ? miles_per_longitude_degree : miles_per_longitude_degree * KMS_PER_MILE\n end",
"title": ""
},
{
"docid": "091744b5373b172676895d0adaacda0a",
"score": "0.62924457",
"text": "def to_inches(from)\n if(from == \"ft\")\n self * 12.0\n\n elsif(from == \"yd\")\n self * 36.0\n\n elsif(from == \"mi\")\n self * 12.0 * 5280\n\n elsif(from == \"cm\")\n self / 2.54\n\n elsif(from == \"in\")\n self * 1.0\n\n end\n end",
"title": ""
},
{
"docid": "aa98296f119486bb1c2e1c86ae5aec63",
"score": "0.62879485",
"text": "def miles_between(distant_object)\n distance = ActiveRecord::Base.connection.execute(\"SELECT ST_Distance(geog_point, '#{distant_object.geog_point}') / 1609.34 from #{self.class.table_name} where id = #{self.id}\") if self.has_attribute?(:geog_point)\n return distance.values[0][0].to_f if distance\n end",
"title": ""
},
{
"docid": "1255f6cbcb263287a4870afee9de1def",
"score": "0.62829256",
"text": "def miles_to(location: nil)\n location ||= @default_location.first\n Geocoder::Calculations.distance_between(self.coordinates, location.coordinates)\n rescue\n \"Limit reached\"\n end",
"title": ""
},
{
"docid": "70cacf6ec47975ab233145b62f97535f",
"score": "0.6273271",
"text": "def total_miles()\n sum = 0\n routes().each {|route| sum += route.distance}\n return sum\n end",
"title": ""
},
{
"docid": "eeaf54311a383193d599262d4c2a1203",
"score": "0.62729657",
"text": "def total_dist_km \n @total_distance/1000\n end",
"title": ""
},
{
"docid": "8a7b8e18975d086093993d6ec2bc8655",
"score": "0.62627035",
"text": "def unit\n case @unit\n when 'mi' then 'Miles'\n when 'km' then 'Kilometers'\n end\n end",
"title": ""
},
{
"docid": "308ebb0317899d081ff0eb878f35494e",
"score": "0.6242487",
"text": "def inchToMM(measurement)\n return (measurement.to_d * 25.4) #millimeters per inch\n end",
"title": ""
},
{
"docid": "663a157c0282b1ef91477cbc594d4efa",
"score": "0.6239316",
"text": "def to_square_mile(**options) = convert_to('square-mile', **options)",
"title": ""
},
{
"docid": "f2a0a9308127d9518fa9f6dfa55c61f1",
"score": "0.6234565",
"text": "def feet_to_cm(feet)\n total_inches = feet_to_inches(feet) \n centimeters = inches_to_centimeters(total_inches) \n return centimeters\nend",
"title": ""
},
{
"docid": "e94afe4ebb907f91a93f5fa93d489332",
"score": "0.62332493",
"text": "def get_cm(inches)\n inches * 2.54\n end",
"title": ""
},
{
"docid": "a9513a854474179882b6345f1cc959b6",
"score": "0.6227173",
"text": "def roundToPlaces(value, places, units)\r\n if units == \"mm\"\r\n value = value.to_mm\r\n end\r\n places = places.to_i\r\n returnVal = ((value * (10 ** places)).round.to_f / (10 ** places))\r\n return returnVal\r\nend",
"title": ""
},
{
"docid": "3691b34e025a9d8327705acf4b2528c0",
"score": "0.6219132",
"text": "def ft_inch_to_m(i_height)\n arr = i_height.split(\"'\")\n feet = arr[0].to_f\n inches = arr[1].to_f\n height = ((feet / 3.281) + (inches / 39.37))\n return height\nend",
"title": ""
},
{
"docid": "7c6aaab41897fdde0e0a12b96f4a1ef1",
"score": "0.6215415",
"text": "def to_cubic_mile(**options) = convert_to('cubic-mile', **options)",
"title": ""
},
{
"docid": "22cff6705fcc4033ee07004962233c34",
"score": "0.62152433",
"text": "def seconds_per_km\n METERS_PER_KILOMETER / @meters_per_second.to_f\n end",
"title": ""
},
{
"docid": "9760ec9e5835f53d1a08943d2c618857",
"score": "0.6204356",
"text": "def feet_to_inches(num)\n num*12\nend",
"title": ""
},
{
"docid": "d720d502705753bdda43519b8c6bd2d9",
"score": "0.6194695",
"text": "def mm_per_mil\n circumference_mm / (mils_per_turn - 1)\n end",
"title": ""
},
{
"docid": "1699cc37f403b92be90eadec0aa0a1a8",
"score": "0.6184701",
"text": "def lat_degrees_per_km\n 1 / 111.195\n end",
"title": ""
}
] |
f45462ce6d83ab7960db65f902029dd3
|
Override CanCan's find it won't properly search by zoned date
|
[
{
"docid": "74958bca1c816b9ac3d70e21e1fab7f2",
"score": "0.0",
"text": "def init_price_policy\n @start_date = parse_usa_date(params[:id] || params[:start_date])\n\n @price_policy = @product\n .price_policies\n .for_date(@start_date)\n .first\n end",
"title": ""
}
] |
[
{
"docid": "b0b447eddb9161a7bf299c018c788d69",
"score": "0.5195559",
"text": "def can_find_using_where_clause_and_be_sorted\n Movie.where('release_date > 2002').order('release_date desc')\nend",
"title": ""
},
{
"docid": "6262cc28abfed3242648d90f6392d8f9",
"score": "0.51442635",
"text": "def before_find\n end",
"title": ""
},
{
"docid": "978e8e0c2d8851ea930023cf28791a11",
"score": "0.5115514",
"text": "def search_by_date\n date_fields = params.dup.keep_if do |key, value|\n [\"created_at\", \"updated_at\"].include?(key.underscore)\n end\n date_fields.each do |field, value|\n if value == \"today\"\n target_date = Time.zone.now\n elsif value == \"yesterday\"\n target_date = 1.day.ago\n end\n @resources = @resources.where(\"#{field.underscore} >= ? AND #{field.underscore} <= ?\", target_date.beginning_of_day, target_date.end_of_day)\n end\n end",
"title": ""
},
{
"docid": "28f262cfc9a84270ea5a9f24820b5057",
"score": "0.51125664",
"text": "def foreign_date_index\n ( @parent.respond_to?(@plural) ? ( @to.nil? || @from > @to ? @parent.send(@plural).where(\"DATE(created_at) >= ?\", @from ) : @parent.send(@plural).where(\"DATE(created_at) >= ? AND DATE(created_at) <= ?\", @from, @to ) ) : @parent.send(@singular) )\n end",
"title": ""
},
{
"docid": "8fd1a27f741427314d0b784c35f9e615",
"score": "0.5057445",
"text": "def method_missing(method, *args)\n if method.to_s.index('find_by_') == 0\n model_class.send(method, *args).to_activerecord_proxies\n else\n super\n end\n end",
"title": ""
},
{
"docid": "08bc64cd1c4f9d4e97a7c7dbc2d0aefd",
"score": "0.5028745",
"text": "def method_missing(method_name, *args)\n if method_name.to_s =~ COLLECTION_METHOD_NAMES_PATTERN\n args[0] ||= :created_at\n klass_name = self.class.class_name_for_method_name(method_name)\n begin\n klass = klass_name.constantize\n return klass.in_date_range(starting, ending, args[0]) # Post.in_date_range(start_time, end_time, :created_at)\n rescue NoMethodError\n raise NoMethodError, \"expected #{klass_name} to have a named scoped of 'in_date_range'\"\n rescue NameError\n raise NameError, \"called #{method_name} on an ActiveTime object, but could not find a #{klass_name} class\"\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "087d045817005e9e4a50ff5e72c24488",
"score": "0.502511",
"text": "def is_editable?\n self.created_on >= DateTime.now - EDITABLE_PERIOD\n end",
"title": ""
},
{
"docid": "40372bf04fd161680cc8cfde27b9ef49",
"score": "0.5007289",
"text": "def find(conditions)\r\n match(conditions) && self || super\r\n end",
"title": ""
},
{
"docid": "d58531fbc65b766011d0092fe7d3aefc",
"score": "0.49963784",
"text": "def editable?\n # return (self.created_on >= DateTime.now - EDITABLE_PERIOD)\n # the commented out code makes unit tests work\n \n if (self.created_on.nil?)\n return false\n else\n return (self.created_on >= DateTime.now - EDITABLE_PERIOD)\n end\n end",
"title": ""
},
{
"docid": "1540142cd84240b315e5f4d4a7708f05",
"score": "0.49942577",
"text": "def find(conditions)\n match(conditions) && self || super\n end",
"title": ""
},
{
"docid": "7629ff7fa7aec56f0945bdcc0de5a1c6",
"score": "0.49028897",
"text": "def where\n [find]\n end",
"title": ""
},
{
"docid": "65b0007cfa14bb41bfc3ddb87457135c",
"score": "0.48841414",
"text": "def conditions\n self.sentinel.dup.conditions({:now => self.created_at})\n end",
"title": ""
},
{
"docid": "0c2863dd818b76a8a0efae0a4545e12c",
"score": "0.48510677",
"text": "def find(*args)\n # create an array where the spatial query conditions\n # will be stored\n @sql_where = Array.new\n prepare_for_find(args)\n # if the client passed in spatial query options,\n # then limit the scope of further queries to results\n # that match the spatial query\n unless @sql_where.blank?\n with_scope(:find => { :conditions => @sql_where.join(\" AND \") } ) do\n super(*args)\n end\n # if no spatial query options were specified, then\n # perform a normal find\n else\n super(*args)\n end\n end",
"title": ""
},
{
"docid": "2b73362ad7bf778f2544b81bd088251b",
"score": "0.48303178",
"text": "def set_and_authorize_due_date\n @due_date = policy_scope(base_object).find(params[:id])\n authorize @due_date\n end",
"title": ""
},
{
"docid": "ad6e45b3608cb34c65f95fdd22290390",
"score": "0.48251405",
"text": "def find(*args) #:nodoc:\n options = args.grep(Hash).first\n \n if options && options.delete(:with_revisions)\n with_exclusive_scope do\n super(*args)\n end\n else\n super(*args)\n end\n end",
"title": ""
},
{
"docid": "843dee3ca431a3af5a0b482bd3de99aa",
"score": "0.4817489",
"text": "def index\n from_date = DATE_FORMAT.match(params[:from_date]) ? params[:from_date].to_time : Time.now\n to_date = DATE_FORMAT.match(params[:to_date]) ? \" AND date_on < '#{params[:to_date].to_time.strftime('%Y-%m-%d')}'\" : \"\"\n @date_schedules = current_user.requested_date_schedules.all(:conditions =>[\"(dater_status != 'deleted' and dater_status != 'accepted' #{view_condition}) AND (date_on > '#{from_date.strftime('%Y-%m-%d').to_s}' #{to_date.to_s})\"], :include =>[:user]).paginate(:per_page => 10, :page => params[:page]) #and proposed_date_on >= '#{Date.today.strftime(\"%Y-%m-%d \")+Time.now.strftime(\"%H:%M\")}'\n respond_to do |format|\n format.xml { render :xml => @date_schedules }\n format.json { render :json => @date_schedules }\n end\n end",
"title": ""
},
{
"docid": "429b8dd9b1dc128330aefc4c6f911eb3",
"score": "0.48097828",
"text": "def method_missing(method, *args, &block)\n if(method.to_s.start_with?('find_by'))\n key = method.to_s.sub('find_by_', '').to_sym\n self.filter(key => args.first.to_s).first\n else\n super\n end\n end",
"title": ""
},
{
"docid": "4696b6a6b9cd5d039fba29129b5a8834",
"score": "0.48081094",
"text": "def active_for_authentication?\n super && (admin? || (effective_start_date.present? && effective_start_date.to_time.to_i <= Time.now.to_i && effective_end_date.present? && Time.now.to_i <= effective_end_date.to_time.to_i ))\n end",
"title": ""
},
{
"docid": "aa36f65dfca49a34c3b2eb01b6df120a",
"score": "0.47889015",
"text": "def where(options = {})\n super(prepare_options(options))\n end",
"title": ""
},
{
"docid": "e639bb8947f98e8cf44c503cac797528",
"score": "0.47762224",
"text": "def filter_by_now\n return @spots unless @params[:now]\n @spots.now\n end",
"title": ""
},
{
"docid": "bfc3f6051d6b4fee9292af45dd36623f",
"score": "0.4768702",
"text": "def find_account\n if @account\n @account\n elsif params[:account_id]\n @account = Account.find(params[:account_id])\n Time.zone = @account.time_zone\n @account\n else\n @account = false\n end\n end",
"title": ""
},
{
"docid": "b50d720bd99989406ff99614ded3e0a4",
"score": "0.47509316",
"text": "def can_find_using_where_clause_and_be_sorted\n # For this test return all movies released after 2002 and ordered by \n # release date descending\n Movie.where(\"release_date > 2002\").order(release_date: :desc) \n # uses .where operator, note that release_date > 2002 is written as a string statement. To order the results in descending order by release date, we use the .order operator and pass into brackets what we want to order it by followed by : and then :desc (would be :asc for ascending))\nend",
"title": ""
},
{
"docid": "82fd050e62c0d886a6ea05d1fd461971",
"score": "0.4747212",
"text": "def find_all(*args, &evaluator)\n unless @_model_cache_control\n super\n else\n if @model_cache.nil? || @_model_cache_control[:expires_at].past?\n result = super(*args)\n sort_by = @_model_cache_control[:sort_by] and result.sort_by!(&sort_by)\n @model_cache = Hash[result.map{|record| record.readonly! ; record.freeze ; [record.id.to_s, record] }]\n end\n evaluator ? @model_cache.values.each(&evaluator) : @model_cache.values\n end\n end",
"title": ""
},
{
"docid": "4df7aeeb00e18ced61f99a7b1951f53d",
"score": "0.47468954",
"text": "def find(*args)\n prepare_for_find_or_count(:find, args)\n super(*args)\n end",
"title": ""
},
{
"docid": "811661ee8267fb1b790a7cc80d29c323",
"score": "0.47261935",
"text": "def active?\n limit_date >= Date.current \n end",
"title": ""
},
{
"docid": "312a43db81c00b7efc74d3b5082235e2",
"score": "0.47238243",
"text": "def has_date?; end",
"title": ""
},
{
"docid": "312a43db81c00b7efc74d3b5082235e2",
"score": "0.47238243",
"text": "def has_date?; end",
"title": ""
},
{
"docid": "3d648c3b41347d829770b18905dd2079",
"score": "0.47218746",
"text": "def method_missing(meth, *args, &block)\n if meth.to_s =~ /^find_by_(.+)$/\n run_find_by_method(Regexp.last_match[1], *args)\n else\n super \n end\n end",
"title": ""
},
{
"docid": "46bf2105dd4a319a6f8383c5c3e3a37a",
"score": "0.47183368",
"text": "def find_record_by(model)\n raise_must_override\n end",
"title": ""
},
{
"docid": "9c743efefdc4376fcb49a350938b85b4",
"score": "0.47028553",
"text": "def created_at\n super\n end",
"title": ""
},
{
"docid": "9c743efefdc4376fcb49a350938b85b4",
"score": "0.47028553",
"text": "def created_at\n super\n end",
"title": ""
},
{
"docid": "9c743efefdc4376fcb49a350938b85b4",
"score": "0.47028553",
"text": "def created_at\n super\n end",
"title": ""
},
{
"docid": "9c743efefdc4376fcb49a350938b85b4",
"score": "0.47028553",
"text": "def created_at\n super\n end",
"title": ""
},
{
"docid": "9c743efefdc4376fcb49a350938b85b4",
"score": "0.47028553",
"text": "def created_at\n super\n end",
"title": ""
},
{
"docid": "e9b0ee3cf2ae9552e9e2f1da163fd5ca",
"score": "0.47010767",
"text": "def member?(date = RacingAssociation.current.today)\n member_to.present? && member_from.present? && member_from.to_date <= date.to_date && member_to.to_date >= date.to_date\n end",
"title": ""
},
{
"docid": "b28713563142a536602dfb9356e04699",
"score": "0.46984294",
"text": "def local_date_index\n ( @to.nil? || @from > @to ? @resource.where(\"DATE(created_at) >= ?\", @from ) : @resource.where(\"DATE(created_at) >= ? AND DATE(created_at) <= ?\", @from, @to ) )\n end",
"title": ""
},
{
"docid": "5e4be15c76d9badbd1a2ecdd08b6676a",
"score": "0.4691536",
"text": "def for_edit(user)\n Announcement\n .active\n .where(\"(starts_at is null or starts_at < :now)\", :now => DateTime.now)\n .order('created_at desc')\n end",
"title": ""
},
{
"docid": "5902f31b453ef60339b1f19df1877829",
"score": "0.46831354",
"text": "def filter_by_time \n\t\t#filtered_by_time logic moved to index in order to avoid duplicated code\n\tend",
"title": ""
},
{
"docid": "d6441468d31e528653d80112179addcf",
"score": "0.46774688",
"text": "def find_by_date(date)\n date_string = date.utc.strftime(\"%x\")\n self.each do |log|\n if log.created_at.utc.strftime(\"%x\") == date_string\n return log\n end #if\n end #each\n end",
"title": ""
},
{
"docid": "1abb560c02db1aefa9b1eb57c77fbd9e",
"score": "0.46592835",
"text": "def find_by_status\n\n end",
"title": ""
},
{
"docid": "ca15b98f8fcf9f0628b107972da2c9a0",
"score": "0.46580622",
"text": "def index\n @events = Event.all\n\n # Filter events based on in_time_zone date\n @date = DateTime.new(2016, 11, 29, 17, 30)\n @events_filtered = Event.get_after_date(@date)\n end",
"title": ""
},
{
"docid": "350169f4f4161e1001ba17fb5924184d",
"score": "0.4641624",
"text": "def query_date attr\n query_by_range attr, Time.current, Time.current\n end",
"title": ""
},
{
"docid": "ecca20041115c0588d1c5c3e7cf6d885",
"score": "0.46384808",
"text": "def find_with_model_cacher(*args)\nlogger.debug \"CachedModel.find #{args.to_json}\"\n args[0] = args.first.to_i if args.first =~ /\\A\\d+\\Z/\n # Only handle simple find requests. If the request was more complicated,\n # let the base class handle it, but store the retrieved records in the\n # local cache in case we need them later.\n if args.length != 1 or not Fixnum === args.first then\n # Rails requires multiple levels of indirection to look up a record\n # First call super\n records = find_without_model_cacher(*args)\n # Then, if it was a :all, just return\n return records if args.first == :all\n return records if RAILS_ENV == 'test'\n case records\n when Array then\nlogger.debug \"CachedModel.find STORE\"\n records.each { |r| r.cache_store }\n end\n return records\n end\n\n return find_without_model_cacher(*args)\n end",
"title": ""
},
{
"docid": "1651809da38fd9cf6de921c92de81163",
"score": "0.4632942",
"text": "def find_record\n if record\n self.new_session = false\n return record\n end\n \n find_with.each do |find_method|\n if send(\"valid_#{find_method}?\")\n self.new_session = false\n \n if record.class.column_names.include?(\"last_request_at\") && (record.last_request_at.blank? || last_request_at_threshold.ago >= record.last_request_at)\n record.last_request_at = Time.now\n record.save_without_session_maintenance(false)\n end\n \n return record\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e1011746a28b7cfed37196d9787db29d",
"score": "0.46197924",
"text": "def show\n render json: Availability.where(available_day:params[:date])\n # Availability.where(available_day:'2017-12-19')\n end",
"title": ""
},
{
"docid": "ea003cb94b34f1a777927c3170041da2",
"score": "0.46196812",
"text": "def find_by(*args)\n if_authorized execute.reorder(nil).find_by(*args)\n end",
"title": ""
},
{
"docid": "6c6707b47e95bcb362d875298c044eba",
"score": "0.46135604",
"text": "def find(params={})\n \n end",
"title": ""
},
{
"docid": "f1748ab2bbb7019826c35f1432532495",
"score": "0.4613537",
"text": "def created_on(date)\n\t\t\tday = date.to_datetime\n\t\t\twhere(:start => (day.beginning_of_day..day.end_of_day))\n\t\tend",
"title": ""
},
{
"docid": "f9abf7338c86fb0cdd6bdf4efd1d8913",
"score": "0.46128196",
"text": "def find\n @scope.where(\"#{find_by} LIKE ?\", \"%#{@params['find']}%\")\n end",
"title": ""
},
{
"docid": "286e8b3151076b5cc350caa7d2dc4ff9",
"score": "0.46010813",
"text": "def find *arguments\n self.class.find *arguments\n end",
"title": ""
},
{
"docid": "6c23c314123f728650f2c056736324cb",
"score": "0.4588776",
"text": "def find(*args)\n find_by,options = build_options(args)\n return self.model.find(find_by,options)\n end",
"title": ""
},
{
"docid": "1b90dca3746cde97063653c73f2a905b",
"score": "0.45832312",
"text": "def before?(date_or_time); end",
"title": ""
},
{
"docid": "1b90dca3746cde97063653c73f2a905b",
"score": "0.45832312",
"text": "def before?(date_or_time); end",
"title": ""
},
{
"docid": "40afdd2971600fcc2e776a52cbd84923",
"score": "0.45814764",
"text": "def filter_by_date_label\n end",
"title": ""
},
{
"docid": "2c0e0b5accc531747a39c45bb623af44",
"score": "0.45765454",
"text": "def list_by_date\n datestring = \"#{params[:year]}-#{params[:month]}\"\n datestring << \"-#{params[:day]}\" if params[:day]\n list :conditions => ['created_at LIKE ?', datestring + '%']\n end",
"title": ""
},
{
"docid": "1be631689a8f819191c67f553557f138",
"score": "0.4574141",
"text": "def find\n\n end",
"title": ""
},
{
"docid": "1be631689a8f819191c67f553557f138",
"score": "0.4574141",
"text": "def find\n\n end",
"title": ""
},
{
"docid": "5422958360b64a8b03185b0c2d19d709",
"score": "0.45735747",
"text": "def schedule_at(date)\n schedules.special.each do |schedule|\n puts \"Comparing #{schedule.inspect} and #{date.inspect}\"\n if schedule.start_at.to_date <= date && date <= schedule.end_at.to_date\n return schedule\n end\n end\n return default_schedule\n end",
"title": ""
},
{
"docid": "26ff16a7528b437f7b662b46ab356bd2",
"score": "0.45717862",
"text": "def includes?(date)\n !@base_date.nil? && date == @base_date\n end",
"title": ""
},
{
"docid": "2222bfddf29bc389016e66fe289b0fea",
"score": "0.45676017",
"text": "def member?(date = Time.zone.today)\n member_to.present? && member_from.present? && member_from.to_date <= date.to_date && member_to.to_date >= date.to_date\n end",
"title": ""
},
{
"docid": "b8074b3c1aa502dc57e9fdfd674148d5",
"score": "0.45618635",
"text": "def date\n in_date = DateTime.strptime(params[:in_date], \"%m-%d-%Y\").beginning_of_day.utc\n out_date = DateTime.strptime(params[:out_date], \"%m-%d-%Y\").end_of_day.utc\n \n @projects = Project.on_dates(in_date, out_date).accessible_by(current_ability, :read)\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { \n render json: @projects.to_json(\n :include => {:timecards => { :include => {:user => { :only => [:first_name, :last_name, :wage] }}}}\n ) \n }\n end\n end",
"title": ""
},
{
"docid": "c79c1c74955070d586fcc33b5e0df23b",
"score": "0.45614383",
"text": "def acts_like_date?; end",
"title": ""
},
{
"docid": "c79c1c74955070d586fcc33b5e0df23b",
"score": "0.45614383",
"text": "def acts_like_date?; end",
"title": ""
},
{
"docid": "7ea2b9bb9ce835723d1ebbed582a171c",
"score": "0.45586377",
"text": "def advanced_search_params\n params.permit(:created_at)\n end",
"title": ""
},
{
"docid": "c5b70cc7b13a8238e6bc48d1d3e8352b",
"score": "0.45564935",
"text": "def active_for_authentication?\n super && archived_at.nil?\nend",
"title": ""
},
{
"docid": "838fc2a5d447bdb8b30167717d2f1f1a",
"score": "0.45536536",
"text": "def find; raise NotImplementedError\n end",
"title": ""
},
{
"docid": "cacd14cd4b81cd5848a92109684551b5",
"score": "0.45528257",
"text": "def apply_filters(scope)\n scope\n .where(\"due_date #{params[:completed] ? '<=' : '>'} ?\", Time.zone.now)\n .order(due_date: params[:due_date] ? :desc : :asc)\n end",
"title": ""
},
{
"docid": "ec5cd434fac8cf3dcb2416ccbac54127",
"score": "0.45515352",
"text": "def includes?(date)\n true\n end",
"title": ""
},
{
"docid": "477051114883df10809becc7c8c96668",
"score": "0.4545229",
"text": "def after_find\n self.cache_record unless self.class.cache_records\n end",
"title": ""
},
{
"docid": "c23445d4cf4bdc41aa40ca8bc4a662db",
"score": "0.45371568",
"text": "def created_to(date)\n scope.where('users.created_at <= ?', date.to_date.end_of_day)\n end",
"title": ""
},
{
"docid": "d8df282f77c167319bcb82650acf299b",
"score": "0.45344487",
"text": "def member?(date = Date.today)\n date = Date.new(date.year, date.month, date.day) if date.is_a? Time\n !self.member_to.nil? && !self.member_from.nil? && (self.member_from <= date && self.member_to >= date)\n end",
"title": ""
},
{
"docid": "d8df282f77c167319bcb82650acf299b",
"score": "0.45344487",
"text": "def member?(date = Date.today)\n date = Date.new(date.year, date.month, date.day) if date.is_a? Time\n !self.member_to.nil? && !self.member_from.nil? && (self.member_from <= date && self.member_to >= date)\n end",
"title": ""
},
{
"docid": "f02c0af22bae04bddc8e381af33f3c79",
"score": "0.4527124",
"text": "def past_due?\n # binding.pry \n self.created_at < self.updated_at\n end",
"title": ""
},
{
"docid": "7b907158e90daa197ec5cc4b10fe70c5",
"score": "0.452428",
"text": "def index\n @shows = Show.where('time BETWEEN ? and ?', Time.zone.now - 1.hour, Time.zone.now + 1.day)\n @is_admin = current_user&.is_admin\n end",
"title": ""
},
{
"docid": "38d793c441b518aa6618decf5ecfc76d",
"score": "0.45188665",
"text": "def find_with_destroyed *args\n unscoped.find(*args)\n end",
"title": ""
},
{
"docid": "572b2eab076c3827d80d132a0476fd77",
"score": "0.4517668",
"text": "def scope\n # it looks up Board in database, searches for all the records that are between date_from and date_to, where is Active Record\n Board.where('created_at BETWEEN ? AND ?', @date_from, @date_to)\n end",
"title": ""
},
{
"docid": "33ca2d30cf8489d69c1140b75e262cc7",
"score": "0.45153564",
"text": "def allowed_filterables\n %i[created_at updated_at organization_id name email].freeze\n end",
"title": ""
},
{
"docid": "3f615884eca2fae1d411f63efabd9a6d",
"score": "0.45148906",
"text": "def show\n @post = Post.where(created_at: 30.days.ago..Time.now).find(params[:id])\nend",
"title": ""
},
{
"docid": "06249a83e47efe3eb066dbbabdefb970",
"score": "0.45121187",
"text": "def time\n super.in_time_zone(place.city.time_zone) if super && place.try(:city).try(:time_zone)\n end",
"title": ""
},
{
"docid": "5ca811644fbd17933e184de1672357d6",
"score": "0.45101705",
"text": "def find(*args)\n scoping { @model.find(*args) }\n end",
"title": ""
},
{
"docid": "a50d68bf6a8733c8d6a3e974ec462089",
"score": "0.4508452",
"text": "def find_billable(date = Date.today)\n find(\n :all,\n :include => :subscription_plan,\n :conditions => ['subscription_plans.rate_cents > 0 AND paid_through <= ? AND (expire_on IS NULL or expire_on < paid_through)', date.to_date]\n )\n end",
"title": ""
},
{
"docid": "29a10357f9c9087caf7b40d2fc908dac",
"score": "0.4507632",
"text": "def editable?\n created_at > 15.minutes.ago\n end",
"title": ""
},
{
"docid": "b7ef22412539de282eb9cb8da232aba6",
"score": "0.45005953",
"text": "def method_missing(method_id, *arguments)\n if match = /find_(all_by|by)_([_a-zA-Z]\\w*)/.match(method_id.to_s)\n finder = determine_finder(match)\n\n facets = extract_attribute_names_from_match(match)\n super unless all_attributes_exists?(facets)\n\n # Overrride facets to use appropriate attribute name for current locale\n facets.collect! {|attr_name| respond_to?(:translated_attribute_names) && translated_attribute_names.include?(attr_name.intern) ? translated_attribute_name(attr_name) : attr_name}\n\n attributes = construct_attributes_from_arguments(facets, arguments)\n\n case extra_options = arguments[facets.size]\n when nil\n options = {:conditions => attributes}\n set_readonly_option!(options)\n ActiveSupport::Deprecation.silence { send(finder, options) }\n when Hash\n finder_options = extra_options.merge(:conditions => attributes)\n validate_find_options(finder_options)\n set_readonly_option!(finder_options)\n\n if extra_options[:conditions]\n with_scope(:find => { :conditions => extra_options[:conditions] }) do\n ActiveSupport::Deprecation.silence { send(finder, finder_options) }\n end\n else\n ActiveSupport::Deprecation.silence { send(finder, finder_options) }\n end\n\n else\n raise ArgumentError, \"Unrecognized arguments for #{method_id}: #{extra_options.inspect}\"\n end\n elsif match = /find_or_(initialize|create)_by_([_a-zA-Z]\\w*)/.match(method_id.to_s)\n instantiator = determine_instantiator(match)\n facets = extract_attribute_names_from_match(match)\n super unless all_attributes_exists?(facets)\n\n if arguments[0].is_a?(Hash)\n attributes = arguments[0].with_indifferent_access\n find_attributes = attributes.slice(*facets)\n else\n find_attributes = attributes = construct_attributes_from_arguments(facets, arguments)\n end\n options = { :conditions => find_attributes }\n set_readonly_option!(options)\n\n find_initial(options) || send(instantiator, attributes)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "5a850ab975f997928115774acd94c107",
"score": "0.44985119",
"text": "def check_date\n #\n # Use .end_of_day to check if the day has officialy gone, providing that the task has default hour of 0:00:00\n #\n if self.due_date.end_of_day.past?\n self.archived = true\n end\n end",
"title": ""
},
{
"docid": "172324d6162db2887c066f8baf0d5e88",
"score": "0.44966912",
"text": "def has_absolute_start_date?\n false\n end",
"title": ""
},
{
"docid": "6688161024bdd568dde8c1c4596bf2a2",
"score": "0.44867936",
"text": "def show\n @posts = @profile_page.posts.includes(:profiles, :pages)\n @posts = @posts.where(\"date(scheduled_at) = ?\", Date.parse(params[:date]).to_time.utc.to_date) if params[:date]\n render 'posts/index'\n end",
"title": ""
},
{
"docid": "e67f87589f5c13a09c225742abc5e94f",
"score": "0.44805473",
"text": "def visible_for? user\n self.created_at.to_i >= self.discussion.user_invited_at(user).to_i\n end",
"title": ""
},
{
"docid": "25bccfb83105e5156b713c180fea0245",
"score": "0.44791922",
"text": "def events_for_date_range(start_d, end_d, find_options = {})\n self.where(:end_at.gte => start_d).and(:start_at.lt => end_d).order_by([:start_at, :asc])\n \n end",
"title": ""
},
{
"docid": "5ef363f7919af989e0694aeff40a577e",
"score": "0.44746712",
"text": "def filter_on_order_date?\n @date_type == \"Order Date\"\n end",
"title": ""
},
{
"docid": "7d6b602d3583c98db4259047ecacbdf7",
"score": "0.44718453",
"text": "def date_filter\n match.merge!(effective_date: effective_date) unless effective_date.empty?\n end",
"title": ""
},
{
"docid": "dcb57e55516998f5ae27873ccf1b078c",
"score": "0.44704112",
"text": "def show\n called_at = Time.now\n if(params[:called_at].present?)\n called_at = Date.parse(params[:called_at])\n end\n dates = called_at.beginning_of_day..called_at.end_of_day\n # TODO: find a better way. Right now, if there is no call, it fetches all (SLOW)\n @internal = Internal.includes(:calls).where(internals: {id: params[:id]}, calls: { called_at: dates }).order(\"calls.called_at DESC\").first || Internal.find(params[:id])\n end",
"title": ""
},
{
"docid": "baff5c22ea32c7887cb8404e5278d50b",
"score": "0.44698527",
"text": "def find_only_destroyed *args\n destroyed.find(*args)\n end",
"title": ""
},
{
"docid": "e86b567418bdb05797454ee055f68b88",
"score": "0.44689262",
"text": "def filter_by_date(scoped, from = nil, to = nil)\n updated_scope = from ? scoped.where('activities.created_at >= ?', Time.at(from.to_i)) : scoped\n to ? updated_scope.where('activities.created_at <= ?', Time.at(to.to_i)) : updated_scope\n end",
"title": ""
},
{
"docid": "e471e0d8031b2b5c4c0023e164b643bc",
"score": "0.4467739",
"text": "def search_date\n DateTime.now.new_offset(0) - number_of_hours.hour\n end",
"title": ""
},
{
"docid": "be6cf5953192df1ba6c718606c80ab80",
"score": "0.446569",
"text": "def index \n @caisses = Caisse.all\n\n @selected_date = Date.today\n# This will look for records on the given date between 00:00:00 and 23:59:59\n @caiss_journaliers = Caisse.where(:created_at => @selected_date.beginning_of_day..@selected_date.end_of_day)\n end",
"title": ""
},
{
"docid": "40f234a2055295cfd18e6667774d48a3",
"score": "0.4464436",
"text": "def filter_by_dates(list)\n format_date_params\n\n list = list.created_after(params[:after]) if params[:after]\n list = list.created_before(params[:before]) if params[:before]\n list\n end",
"title": ""
},
{
"docid": "060c5338a857ef0dc8d9e127c6070849",
"score": "0.44623542",
"text": "def find\n guard!\n resource\n end",
"title": ""
},
{
"docid": "e865dfa0bfbb00d18f822504465e84a1",
"score": "0.44613877",
"text": "def bookable?(date)\n date < booking_date_limit\n end",
"title": ""
},
{
"docid": "e084075314571bba68e71d86276af38c",
"score": "0.44608656",
"text": "def find(*args)\n with_default_scope.find(*args)\n end",
"title": ""
},
{
"docid": "611272bad3cc4aea4d6ece6ba681a07e",
"score": "0.4459487",
"text": "def method_missing(name, *args)\n if name =~ /^find_by_(.+)/ && self.fields.has_key?($1)\n method = <<-METHOD\n def #{name}(#{$1})\n where(:#{$1} => #{$1}).first\n end\n METHOD\n instance_eval method, __FILE__, __LINE__\n\n send name, *args\n else\n super\n end\n end",
"title": ""
},
{
"docid": "04b7008dca4378fb753942aec01f6955",
"score": "0.4455168",
"text": "def find_to_do\n @dates_to_do\n end",
"title": ""
}
] |
81f7df523fb9c92da81c25b8f5abb4cd
|
PUT /fuentes/1 PUT /fuentes/1.xml
|
[
{
"docid": "3a67e291444babf32376b8471fa305df",
"score": "0.6311567",
"text": "def update\n @fuente = Fuente.find(params[:id])\n\n respond_to do |format|\n if @fuente.update_attributes(params[:fuente])\n flash[:notice] = 'Fuente was successfully updated.'\n format.html { redirect_to(@fuente) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fuente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.6487486",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.6264649",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.62555534",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.6177337",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "a6174ef5c57f0350802d9d10f71b4a2e",
"score": "0.60582966",
"text": "def test_finder_put_success\n request = Http::Request.new(\n 'PUT',\n '/file2',\n { 'X-Expected-Entity-Length' => '5' },\n 'hello'\n )\n response = self.request(request)\n\n assert_equal(201, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "545dadbe32aa3d9d0edf1d22293783fc",
"score": "0.60408413",
"text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('bar')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "713161fe04801b44f5b9cdb91a95fe89",
"score": "0.60119665",
"text": "def test_put\n request = Http::Request.new('PUT', '/file2', {}, 'hello')\n\n response = self.request(request)\n\n assert_equal(201, response.status, \"Incorrect status code received. Full response body: #{response.body_as_string}\")\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "9ddf960eb3f437e62b9b99d34992bc0f",
"score": "0.5860054",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.58484536",
"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": "d8d878c0391411134a17dcfe0f3ddd00",
"score": "0.57952553",
"text": "def put(request, response)\n if not @file\n parts = @local_path.split(\"/\")\n file = WSFile.all(parent: nil, name: parts[1])[0]\n endd = parts.last==\"\" ? -3 : -2\n parts[2..endd].each do |part|\n file = file.children(name: part)\n end\n parent = file_by_path parts[0..-2].join(\"/\")\n @file = WSFile.create(name: parts.last, create_time: DateTime.now, directory: false, edit_time: DateTime.now, parent: parent)\n Permission.create(user: @ws_user, file: @file, level: \"owner\")\n end\n io = request.body\n temp = Tempfile.new(\"websync-dav-upload\")\n data = io.read rescue \"\"\n temp.write data\n temp.close\n @file.content_type = _content_type temp.path\n temp.flush rescue nil\n @file.edit_time = DateTime.now\n @file.save!\n @file.data=data\n Created\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.5794514",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "dabaaacc799019b0211d250061f3be92",
"score": "0.5724067",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n\n format.html { redirect_to(servicos_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f43d79cb8ce757f5e82d8476fd01962",
"score": "0.57173747",
"text": "def test_should_update_topic_via_API_XML\r\n get \"/logout\"\r\n put \"/forum_topics/1.xml\", :forum_topic => {:title=>'Updated API Test Topic',\r\n :description=>'Updated Test topic desc',\r\n :user_id=>1}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "868a07f432c6ef3001b9ae74badf43f4",
"score": "0.5716864",
"text": "def update\n @fabricante = Fabricante.find(params[:id])\n\n respond_to do |format|\n if @fabricante.update_attributes(params[:fabricante])\n flash[:notice] = 'Fabricante was successfully updated.'\n format.html { redirect_to(@fabricante) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fabricante.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a",
"score": "0.56734204",
"text": "def put(*args)\n request :put, *args\n end",
"title": ""
},
{
"docid": "a6eaddde60ad0ad290c11346400ad414",
"score": "0.5665333",
"text": "def put\n request = Net::HTTP::Put.new(endpoint_uri.request_uri)\n request.basic_auth Unfuzzle.username, Unfuzzle.password\n request.content_type = 'application/xml'\n \n Response.new(client.request(request, @payload))\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.5631628",
"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": "50b39f321f99c2d2a02d4e084bf29755",
"score": "0.5615732",
"text": "def update\n @existencia = Existencia.find(params[:id])\n\n respond_to do |format|\n if @existencia.update_attributes(params[:existencia])\n format.html { redirect_to(@existencia, :notice => 'Existencia was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @existencia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.56068075",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
},
{
"docid": "6cbbddc73e7fbb152fae713f712777b3",
"score": "0.5604966",
"text": "def update\n update_resource(@tomato)\n end",
"title": ""
},
{
"docid": "ea416b077fa0aa7e84ec3fe2ef9c3772",
"score": "0.56021005",
"text": "def put\n request_method('PUT')\n end",
"title": ""
},
{
"docid": "1be44c3e0ba097e5e9e3383b5907538c",
"score": "0.5599932",
"text": "def update(id, member=\"Default member\", rating=\"9\", venue_Name=\"Default Venue_Name\", address=\"Default Address\", city=\"Default City\", phone=\"9999999999\" , date=\"\" , comment= \"Default Comment\")\r\n\t\txml_req =\r\n\t\t\"<?xml version='1.0' encoding='UTF-8'?>\r\n\t\t\t<review>\r\n\t\t\t\t<Member>#{member}</Member>\r\n\t\t\t\t<Rating>#{rating}</Rating>\r\n\t\t\t\t<Venue-Name>#{venue_Name}</Venue-Name>\r\n\t\t\t\t<Address>#{address}</Address>\r\n\t\t\t\t<City>#{city}</City>\r\n\t\t\t\t<Phone>#{phone}</Phone>\r\n\t\t\t\t<Date-of-Visit>date</Date-of-Visit>\r\n\t\t\t\t<Comment>#{comment}</Comment>\t\t\t\t\t\r\n\t\t\t</review>\"\r\n\r\n\t\trequest = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n\t\trequest.add_field \"Content-Type\", \"application/xml\"\r\n\t\trequest.body = xml_req\r\n\r\n\t\thttp = Net::HTTP.new(@uri.host, @uri.port)\r\n\t\tresponse = http.request(request)\r\n\r\n\t\t# no response body will be returned\r\n\t\tcase response\r\n\t\twhen Net::HTTPSuccess\r\n\t\t\treturn \"#{response.code} OK\"\r\n\t\telse\r\n\t\t\treturn \"#{response.code} ERROR\"\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "d1c3515310609a67bb874ad5528d4d62",
"score": "0.55897796",
"text": "def update\n @etiqueta = Etiqueta.find(params[:id])\n\n respond_to do |format|\n if @etiqueta.update_attributes(params[:etiqueta])\n flash[:notice] = 'Etiqueta was successfully updated.'\n format.html { redirect_to(@etiqueta) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @etiqueta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7a14e2aa23ff59599ab20fae8653115",
"score": "0.55796105",
"text": "def update\n @fascicle = Fascicle.find(params[:id])\n\n respond_to do |format|\n if @fascicle.update_attributes(params[:fascicle])\n flash[:notice] = 'Fascicle was successfully updated.'\n format.html { redirect_to(@fascicle) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fascicle.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a48b3229e830876ae619b936301400b2",
"score": "0.5567446",
"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": "db5491193284f64b730962d4f3a7adf0",
"score": "0.5566319",
"text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to(@oferta, :notice => 'Oferta was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e85be5ce3460003e975b0f9400be6d3",
"score": "0.5564596",
"text": "def update\n @foto = Foto.find(params[:id])\n\n respond_to do |format|\n if @foto.update_attributes(params[:foto])\n flash[:notice] = 'Foto atualizada com sucesso.'\n format.html { redirect_to(@foto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @foto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f9d1a83075ee53a1b9a2c593bdb0a05b",
"score": "0.55629724",
"text": "def update\n @uf = Uf.find(params[:id])\n\n respond_to do |format|\n if @uf.update_attributes(params[:uf])\n flash[:notice] = 'Uf was successfully updated.'\n format.html { redirect_to(@uf) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @uf.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "024f8313de2e30dc67d9a60de89be777",
"score": "0.55507153",
"text": "def update\n @foto = Foto.find(params[:id])\n\n respond_to do |format|\n if @foto.update_attributes(params[:foto])\n flash[:notice] = 'Фотография успешно обновленна.'\n format.html { redirect_to(@foto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @foto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92b09616055b9a2d16e9e7686b430a3c",
"score": "0.5550295",
"text": "def update\n @fascicle = Fascicle.find(params[:id])\n\n respond_to do |format|\n if @fascicle.update_attributes(params[:fascicle])\n format.html { redirect_to(@fascicle, :notice => 'Fascicle was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fascicle.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c03435802a94654b085bf64176af84a",
"score": "0.5538412",
"text": "def update\n @tipos = Tipo.find(params[:id])\n\n respond_to do |format|\n if @tipos.update_attributes(params[:tipo])\n flash[:notice] = 'SALVO COM SUCESSO.'\n format.html { redirect_to(@tipos) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b88e8534e926c1447e1f752c95d2a77",
"score": "0.5536783",
"text": "def rest_put(path, options = {}, api_ver = @api_version)\n rest_api(:put, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "6b88e8534e926c1447e1f752c95d2a77",
"score": "0.5536783",
"text": "def rest_put(path, options = {}, api_ver = @api_version)\n rest_api(:put, path, options, api_ver)\n end",
"title": ""
},
{
"docid": "5e7f56eb1e62b28a791b8dded85ac5c5",
"score": "0.55363125",
"text": "def update_rest\n @v1_item_usage = V1ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @v1_item_usage.update_attributes(params[:v1_item_usage])\n flash[:notice] = 'V1ItemUsage was successfully updated.'\n format.html { redirect_to(@v1_item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @v1_item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "238fd956be713471aa406c76bf19254a",
"score": "0.55353326",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :status_post => {:body => 'API Status Post 1' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "9edd250f9ef2f84de508b36800ca1d9b",
"score": "0.5527838",
"text": "def update\n @familia = Familia.find(params[:id])\n\n respond_to do |format|\n if @familia.update_attributes(params[:familia])\n flash[:notice] = \"Los datos de la Familia #{@familia.nombre} se han actualizado.\"\n format.html { redirect_to(@familia) }\n format.xml { head :ok }\n else\n flash[:error] = \"Hubo un error actualizando la familia.\"\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @familia.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b44fcca808470030b0d4a8ca0e32b4b7",
"score": "0.5526074",
"text": "def update\n @estagiarios = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiarios.update_attributes(params[:estagiario])\n flash[:notice] = 'ESTAGIÁRIO SALVO COM SUCESSO.'\n format.html { redirect_to(@estagiarios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiarios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f877e4eb8ad891757363200d77ba796a",
"score": "0.55142224",
"text": "def update\n @ouve = Ouve.find(params[:id])\n\n respond_to do |format|\n if @ouve.update_attributes(params[:ouve])\n format.html { redirect_to(@ouve, :notice => 'Ouve was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ouve.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a32e35dc9d663204110e6dfa92e28fff",
"score": "0.55099076",
"text": "def update\n @fattura = Fattura.find(params[:id])\n\n respond_to do |format|\n if @fattura.update_attributes(params[:fattura])\n format.html { redirect_to(@fattura, :notice => 'Fattura was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fattura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15111011a74e3532dbaf4ee7dbffb8f0",
"score": "0.55094165",
"text": "def update\n @ficha = Ficha.find(params[:id])\n\n respond_to do |format|\n if @ficha.update_attributes(params[:ficha])\n format.html { redirect_to(@ficha, :notice => 'Ficha was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ficha.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "177a19f7f85a31ed8cc5bc04c10f899d",
"score": "0.5503195",
"text": "def update\n @tipo_osexterna = TipoOsexterna.find(params[:id])\n\n respond_to do |format|\n if @tipo_osexterna.update_attributes(params[:tipo_osexterna])\n flash[:notice] = 'ATUALIZADO COM SUCESSO.'\n format.html { redirect_to(@tipo_osexterna) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_osexterna.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb3474e1d26ed3f6b6a32c3f3a1ea64d",
"score": "0.54950714",
"text": "def update\n @estagiario = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiario.update_attributes(params[:estagiario])\n flash[:notice] = 'Estagiario foi atualizado com sucesso.'\n format.html { redirect_to(@estagiario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27096800d14893529f640b6cf4566aba",
"score": "0.54918677",
"text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <milestone_id>#{milestone_id}</milestone_id>\n </todo-list>\",\n XML_REQUEST_HEADERS)\n end",
"title": ""
},
{
"docid": "d846991d6ba630ceaa5fda21e09adfda",
"score": "0.54876393",
"text": "def update\n @efectivo = Efectivo.find(params[:id])\n\n respond_to do |format|\n if @efectivo.update_attributes(params[:efectivo])\n format.html { redirect_to(@efectivo, :notice => 'Efectivo was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @efectivo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9684da993d6c9d1c618b73093689492f",
"score": "0.54875314",
"text": "def update\n @fonction = Fonction.find(params[:id])\n\n respond_to do |format|\n if @fonction.update_attributes(params[:fonction])\n format.html { redirect_to(@fonction, :notice => 'Fonction was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fonction.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0451d48b60c995d80dcec0e792ed42a",
"score": "0.54837775",
"text": "def update\n @tipoespacio = Tipoespacio.find(params[:id])\n\n respond_to do |format|\n if @tipoespacio.update_attributes(params[:tipoespacio])\n flash[:notice] = 'Tipo actualizado correctamente.'\n format.html { redirect_to(@tipoespacio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipoespacio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8347d51fd953ab0b206f28328a0bfdaf",
"score": "0.54766345",
"text": "def update\n @arquivo_documento = Arquivo::Documento.find(params[:id])\n\n respond_to do |format|\n if @arquivo_documento.update_attributes(params[:arquivo_documento])\n format.html { redirect_to(@arquivo_documento, :notice => 'Documento atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @arquivo_documento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "476c34f1955d8e27ff8ba558ce2abe37",
"score": "0.5471092",
"text": "def test_put_no_parent\n request = Http::Request.new(\n 'PUT',\n '/file1/file2',\n {},\n 'hello'\n )\n\n response = self.request(request)\n assert_equal(409, response.status)\n end",
"title": ""
},
{
"docid": "07918d5a67562e424f50e841ebcd6a84",
"score": "0.54644877",
"text": "def put(path , params = {})\n request(:put , path , params)\n end",
"title": ""
},
{
"docid": "dd3cd2095af1713b6a86d6515db81de4",
"score": "0.5459945",
"text": "def put_update(options = {})\n options[:id] ||= @fax.id\n options[:fax] ||= @attributes\n\n put :update,options\n end",
"title": ""
},
{
"docid": "c4589bd5377d8e8928267dbe5341b4fb",
"score": "0.5459542",
"text": "def update\n @tipo_juicio = TipoJuicio.find(params[:id])\n\n respond_to do |format|\n if @tipo_juicio.update_attributes(params[:tipo_juicio])\n format.html { redirect_to(@tipo_juicio, :notice => 'TipoJuicio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_juicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "736d298cd2f7293ceea7d622b6d31a5e",
"score": "0.5454384",
"text": "def update\n @episodio = get_by_numero(params[:id])\n\n respond_to do |format|\n if @episodio.update_attributes(params[:episodio])\n flash[:notice] = 'Episodio was successfully updated.'\n format.html { redirect_to(@episodio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @episodio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6a5dc72c103ba3c3beba47888ce833ce",
"score": "0.5454092",
"text": "def update\n @fiber = Fiber.find(params[:id])\n respond_to do |format|\n if @fiber.update_attributes(params[:fiber])\n format.html { render(:json => {:success => true}) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fiber.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eb5e8963359d2ecd5ff52b1e341a1519",
"score": "0.54476476",
"text": "def update\n @objeto = Objeto.find(params[:id])\n\n respond_to do |format|\n if @objeto.update_attributes(params[:objeto])\n flash[:notice] = 'Objeto was successfully updated.'\n format.html { redirect_to(@objeto) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @objeto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02cbcb020722333594c34235ddff84e6",
"score": "0.54466623",
"text": "def update\n @ufalta = Ufalta.find(params[:id])\n\n respond_to do |format|\n if @ufalta.update_attributes(params[:ufalta])\n flash[:notice] = 'Ufalta was successfully updated.'\n format.html { redirect_to(@ufalta) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ufalta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f7c155102aac0f0ea40f28ba410d889c",
"score": "0.5445613",
"text": "def update\n @fichaselemento = Fichaselemento.find(params[:id])\n\n respond_to do |format|\n if @fichaselemento.update_attributes(params[:fichaselemento])\n format.html { redirect_to(@fichaselemento, :notice => 'Fichaselemento was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fichaselemento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2308e095d218dc4f009cc2a376ebf88",
"score": "0.5433664",
"text": "def update\n @faixa = Faixa.find(params[:id])\n\n respond_to do |format|\n if @faixa.update_attributes(params[:faixa])\n format.html { redirect_to @faixa, notice: 'Faixa was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @faixa.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d849c2bc448d5ce0df573d1ab918e8f7",
"score": "0.5432918",
"text": "def put(url, options={}, header={})\n body = options[:body]\n access_token.put(url, body, {'Content-Type' => 'application/xml' })\n end",
"title": ""
},
{
"docid": "9190018f7b11e39e2d177190a0b4c098",
"score": "0.54302907",
"text": "def update\n @servicios = Servicios.find(params[:id])\n\n respond_to do |format|\n if @servicios.update_attributes(params[:servicios])\n flash[:notice] = 'Servicios was successfully updated.'\n format.html { redirect_to(@servicios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @servicios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7532822ec0f934e3941267e5bcf8972f",
"score": "0.54267365",
"text": "def update\n @utente = Utente.find(params[:id])\n\n respond_to do |format|\n if @utente.update_attributes(params[:utente])\n format.html { redirect_to(@utente, :notice => 'Utente was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @utente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66c777e75a28033e8738bb59802a448d",
"score": "0.5425913",
"text": "def update\n @fertiliza = Fertiliza.find(params[:id])\n\n respond_to do |format|\n if @fertiliza.update_attributes(params[:fertiliza])\n flash[:notice] = 'Fertiliza was successfully updated.'\n format.html { redirect_to(@fertiliza) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @fertiliza.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a67c6e88e405c4fa2ae09bb37c84573c",
"score": "0.54187065",
"text": "def update\n @cursos = Curso.find(:all)\n @festivo = Festivo.find(params[:id])\n\n respond_to do |format|\n if @festivo.update_attributes(params[:festivo])\n flash[:notice] = 'El Festivo se grabó correctamente.'\n format.html { redirect_to(@festivo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @festivo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "608d2f58e93e2a844cba814b363df9ef",
"score": "0.5416713",
"text": "def update(id, name=\"Updated Name\", extension=0000)\n xml_req =\"{\\\"device\\\":{ \\\"id\\\":#{id},\\\"number\\\":\\\"#{number}\\\",\\\"name\\\":\\\"#{name}\\\",\\\"address\\\":\\\"#{address}\\\"}}\"\n \n \n request = Net::HTTP::Put.new(\"#{@url}/#{id}.json\")\n request.add_field \"Content-Type\", \"application/json\"\n request.body = xml_req\n \n http = Net::HTTP.new(@uri.host, @uri.port)\n response = http.request(request)\n \n # no response body will be returned\n case response\n when Net::HTTPSuccess\n return \"#{response.code} OK\"\n else\n return \"#{response.code} ERROR\"\n end\n end",
"title": ""
},
{
"docid": "fc5dc2013556fa956ea5ea16c1464619",
"score": "0.5414579",
"text": "def update\n @utente = Utente.find(params[:id])\n\n respond_to do |format|\n if @utente.update_attributes(params[:utente])\n flash[:notice] = 'Utente was successfully updated.'\n format.html { redirect_to(@utente) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @utente.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e571bfc367368e5c1172837b07922ce4",
"score": "0.54139477",
"text": "def update\n @factura = Factura.find(params[:id])\n\n respond_to do |format|\n if @factura.update_attributes(params[:factura])\n format.html { redirect_to(@factura, :notice => 'Factura was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @factura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e571bfc367368e5c1172837b07922ce4",
"score": "0.54139477",
"text": "def update\n @factura = Factura.find(params[:id])\n\n respond_to do |format|\n if @factura.update_attributes(params[:factura])\n format.html { redirect_to(@factura, :notice => 'Factura was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @factura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e2e55a6ecb4c00b7fe18a670cc021207",
"score": "0.54013157",
"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": "ecd3507f13ad65c6c60772ae8bc3ff20",
"score": "0.53975",
"text": "def update\n @esfera = Esfera.find(params[:id])\n\n respond_to do |format|\n if @esfera.update_attributes(params[:esfera])\n format.html { redirect_to(@esfera, :notice => 'Esfera was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @esfera.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba39d0fa374658cb9542d1d5849415cf",
"score": "0.539469",
"text": "def update\n @nome = Nome.find(params[:id])\n\n respond_to do |format|\n if @nome.update_attributes(params[:nome])\n format.html { redirect_to(@nome, :notice => 'Nome was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nome.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5107799c0dd7cd130bbac771656bac7",
"score": "0.53878194",
"text": "def update\n @estoque = Estoque.find(params[:id])\n\n respond_to do |format|\n if @estoque.update_attributes(params[:estoque])\n format.html { redirect_to(@estoque, :notice => 'Estoque was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estoque.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e19ed14d3a0045bce379129c84762379",
"score": "0.53877443",
"text": "def update\n respond_to do |format|\n if @fluxo.update(fluxo_params)\n format.html { redirect_to @fluxo, notice: 'Fluxo was successfully updated.' }\n format.json { render :show, status: :ok, location: @fluxo }\n else\n format.html { render :edit }\n format.json { render json: @fluxo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "faae01059690e7c1e2db2ec33c860fdd",
"score": "0.5384334",
"text": "def update\n @exemplo = Exemplo.find(params[:id])\n\n respond_to do |format|\n if @exemplo.update_attributes(params[:exemplo])\n flash[:notice] = 'Exemplo was successfully updated.'\n format.html { redirect_to(@exemplo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exemplo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96c2c4ca74afa5a26914fb582062f271",
"score": "0.5379947",
"text": "def test_should_update_event_via_API_XML\r\n get \"/logout\"\r\n put \"/events/1.xml\", :event => {:name => 'Test API Event 1',\r\n :start_time => Time.now.to_s(:db),\r\n :end_time => Time.now.to_s(:db),\r\n :user_id => 1,\r\n :description => 'Test API Event 1 Desc',\r\n :event_type => 'API Type',\r\n :location => 'Testville, USA',\r\n :street => 'Testers Rd.',\r\n :city => 'TestTown',\r\n :website => 'http://www.test.com',\r\n :phone => '555-555-5555',\r\n :organized_by => 'API Testers of America'}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "8cf5582be869fc5b155331c1d0f7a490",
"score": "0.5378004",
"text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to @oferta, :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c3b7291f2f5cbd27583941c52cc8111",
"score": "0.537647",
"text": "def update\n @folio = Folio.find(params[:id])\n\n respond_to do |format|\n if @folio.update_attributes(params[:folio])\n format.html { redirect_to(@folio, :notice => 'Folio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @folio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8030b6a3a618d66537d0f1f7e1a4175e",
"score": "0.5376131",
"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": "05ea17c98e44cddbeef3eb53041a3cf1",
"score": "0.5373166",
"text": "def update\n @enquete = Enquete.find(params[:id])\n\n respond_to do |format|\n if @enquete.update_attributes(params[:enquete])\n format.html { redirect_to(@enquete, :notice => 'Enquete atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @enquete.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "751b40364ff9660c1c678ae6d5798635",
"score": "0.53720754",
"text": "def update\n @atribuicao = Atribuicao.find(params[:id])\n\n respond_to do |format|\n if @atribuicao.update_attributes(params[:atribuicao])\n flash[:notice] = 'Atribuicao was successfully updated.'\n format.html { redirect_to(@atribuicao) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @atribuicao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8415acb983da3addb269a79e461bba00",
"score": "0.5372005",
"text": "def put(uri, options = {})\n request :put, options\n end",
"title": ""
},
{
"docid": "c82cce87718d916e1aa52d59378dd881",
"score": "0.53595847",
"text": "def update\n @faxis = Fax.find(params[:id])\n\n respond_to do |format|\n if @faxis.update_attributes(params[:faxis])\n format.html { redirect_to @faxis, notice: 'Fax was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @faxis.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cccedbc650e23974fd4e4a3d738acb54",
"score": "0.53557867",
"text": "def update\n @especie = Especie.find(params[:id])\n\n respond_to do |format|\n if @especie.update_attributes(params[:especie])\n flash[:notice] = 'Espécie foi atualizada com sucesso.'\n format.html { redirect_to(@especie) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @especie.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "984c51b5a0d5d9aed9f0db63025f467c",
"score": "0.5350967",
"text": "def update\n @fabricante = Fabricante.find(params[:id])\n\n respond_to do |format|\n if @fabricante.update_attributes(params[:fabricante])\n format.html { redirect_to @fabricante, notice: 'Fabricante was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fabricante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5edb8a9b2cad14c7874c5f42c5809e9",
"score": "0.53490996",
"text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end",
"title": ""
},
{
"docid": "67b0d51a055ccb895b19eef170a96c0a",
"score": "0.53485465",
"text": "def update\n @espacio = Espacio.find(params[:id])\n\n respond_to do |format|\n if @espacio.update_attributes(params[:espacio])\n flash[:notice] = 'Espacio actualizado correctamente.'\n format.html { redirect_to(@espacio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @espacio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67c9ab4237b70c6d7f1a4a457785ec83",
"score": "0.5348006",
"text": "def put(path, opts = {}, &app); add_with_request_method(path, :put, opts, &app); end",
"title": ""
},
{
"docid": "e8f0ca92ccd488d4678cfd10dd8f0415",
"score": "0.5346383",
"text": "def update\n @tipo_viatura = TipoViatura.find(params[:id])\n\n respond_to do |format|\n if @tipo_viatura.update_attributes(params[:tipo_viatura])\n format.html { redirect_to(@tipo_viatura, :notice => 'Tipo viatura was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_viatura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.534564",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "1a70151d1b548969f237388e7429b150",
"score": "0.5342124",
"text": "def update_rest\n @v1_page_usage = V1PageUsage.find(params[:id])\n\n respond_to do |format|\n if @v1_page_usage.update_attributes(params[:v1_page_usage])\n flash[:notice] = 'V1PageUsage was successfully updated.'\n format.html { redirect_to(@v1_page_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @v1_page_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fd8842ed08fa1572950f3e78514aecf",
"score": "0.5337967",
"text": "def do_PUT(req, res)\n domain, resource, id, format = parse_request_path(req.path_info)\n attributes = from_xml(resource, req.body)\n attributes['updated-at'] = Time.now.iso8601\n logger.debug \"Updating item with attributes: #{attributes.inspect}\"\n sdb_put_item(domain, attributes, true)\n raise WEBrick::HTTPStatus::OK\n end",
"title": ""
},
{
"docid": "b271d4bc7e55b51206f5eea944372d58",
"score": "0.5334262",
"text": "def update\n @efactura = Efactura.find(params[:id])\n\n respond_to do |format|\n if @efactura.update_attributes(params[:efactura])\n format.html { redirect_to(@efactura, :notice => 'Efactura was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @efactura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5494946e311f840bac5a88c54becb14",
"score": "0.5333881",
"text": "def update\n @tipo_suelo = TipoSuelo.find(params[:id])\n\n respond_to do |format|\n if @tipo_suelo.update_attributes(params[:tipo_suelo])\n flash[:notice] = 'TipoSuelo was successfully updated.'\n format.html { redirect_to(@tipo_suelo) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_suelo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "377043d3ab23ba53a00f5f100328db2b",
"score": "0.53292775",
"text": "def update\n @folk = Folk.find(params[:id])\n\n respond_to do |format|\n if @folk.update_attributes(params[:folk])\n flash[:notice] = 'Folk was successfully updated.'\n format.xml { head :ok }\n else\n format.xml { render :xml => @folk.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cb7fe69eea2b9315d2fa92ae3a462c66",
"score": "0.53287554",
"text": "def update\n @feriadocentebeneficiario = Feriadocentebeneficiario.find(params[:id])\n\n respond_to do |format|\n if @feriadocentebeneficiario.update_attributes(params[:feriadocentebeneficiario])\n format.html { redirect_to(@feriadocentebeneficiario, :notice => 'Feriadocentebeneficiario was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feriadocentebeneficiario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7ce258097892d5a25ac06cf5fa6fa33",
"score": "0.5327969",
"text": "def test_put_existing_if_match_correct\n request = Http::Request.new(\n 'PUT',\n '/file1',\n { 'If-Match' => \"\\\"#{Digest::MD5.hexdigest('foo')}\\\"\" },\n 'hello'\n )\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "72d3c9097ed81ad38e4b9ca7d14bca29",
"score": "0.5324127",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n flash[:notice] = 'Fattura modificata con successo!'\n format.html { redirect_to(@invoice) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c7d3cd0f218c42e01dbd0246ab7b00c9",
"score": "0.53230107",
"text": "def put(path, params={}); make_request(:put, host, port, path, params); end",
"title": ""
},
{
"docid": "1e28e53cc6a046657398add19da32118",
"score": "0.5319726",
"text": "def put(path, arguments = {})\n Mavenlink.logger.note \"Started PUT /#{path} with #{arguments.inspect}\"\n parse_request(connection.put(path, arguments))\n end",
"title": ""
},
{
"docid": "fa27a582d0b61cd39ab3fb7be4ea58f9",
"score": "0.53193486",
"text": "def update\n @file = Argo::File.find(params[:id])\n\n respond_to do |format|\n if @file.update_attributes(params[:argo_file])\n flash[:notice] = 'Argo::File was successfully updated.'\n format.html { redirect_to(@file) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @file.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e4f005403f749a7cd2e207c0220fcac3",
"score": "0.5318218",
"text": "def update\n @voluntario = Voluntario.find(params[:id])\n params[:voluntario].delete :inclusoes\n\n respond_to do |format|\n if @voluntario.update_attributes(params[:voluntario])\n format.html { redirect_to(@voluntario, :notice => 'Voluntário atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @voluntario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c1cf41ae3a0e0832108fa291a6e79c8",
"score": "0.5317459",
"text": "def test_should_update_group_via_API_XML\r\n get \"/logout\"\r\n put \"/groups/1.xml\", :group => { :name=>'renamed unit test group',\r\n :description=>'my new desc',\r\n :featured=>false }\r\n assert_response 401\r\n end",
"title": ""
}
] |
7a78266305d5677635f813bf4d59b675
|
GET /skies GET /skies.json
|
[
{
"docid": "629c5e03e509e629d42bc0cfe7eb2d17",
"score": "0.6875771",
"text": "def index\n @skies = Sky.all\n end",
"title": ""
}
] |
[
{
"docid": "5c095376904a89497a99ae147634095f",
"score": "0.67623144",
"text": "def get_skus()\n\tputs \"Getting skus\"\n\tresponse = request_get(\"/api/sku\")\n\tputs response.body\nend",
"title": ""
},
{
"docid": "f4778b977254735c05948bec43b21062",
"score": "0.6559958",
"text": "def index\n skickers = Skicker.order(power: :asc)\n render json: { status: 'SUCCESS', message: 'Loaded skickers', value: skickers }\n end",
"title": ""
},
{
"docid": "a1d9fc82f15089729c8eeca4721db103",
"score": "0.6497567",
"text": "def show\n @skid = Skid.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skid }\n end\n end",
"title": ""
},
{
"docid": "7bf278041bd23f7564ff918e871cb1cc",
"score": "0.6401643",
"text": "def index\n @sightings = Sighting.all\n render json: @sightings\n end",
"title": ""
},
{
"docid": "c958fbd8929630d1701647c9b5092eb8",
"score": "0.6319045",
"text": "def show\n render json: @shelter\n end",
"title": ""
},
{
"docid": "75dae99f0bfcb0790bd31a946ca7fa7d",
"score": "0.62964666",
"text": "def show\n render json: @sighting\n end",
"title": ""
},
{
"docid": "3d1044f460e5da6ba7cbfcc6b2315da1",
"score": "0.626598",
"text": "def index\n @skus = Sku.all\n end",
"title": ""
},
{
"docid": "293c3d3093391170facc9f466b7e6020",
"score": "0.62380993",
"text": "def skins\n client.get \"skins/#{inst_id}/list\"\n end",
"title": ""
},
{
"docid": "13a09d4411bfc90c4b4e940386170d55",
"score": "0.6181996",
"text": "def show\n @ski = Ski.find(params[:id])\n\n @image = Image.where(:ski_id => params[:id])\n\n @inventory = Inventory.where(:ski_id => params[:id])\n\n @store = Store.where(:ski_id => params[:id])\n\n @spec = Spec.where(:ski_id => params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ski }\n end\n end",
"title": ""
},
{
"docid": "e0fa2d4f191fa89e37885c44f76cd9ec",
"score": "0.61472476",
"text": "def show\n @sku = Sku.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sku }\n end\n end",
"title": ""
},
{
"docid": "f49eda85f5d1c8094c9331bde3f3d1a8",
"score": "0.61042744",
"text": "def index\n @specialties = Specialty.all\n\n render json: @specialties\n end",
"title": ""
},
{
"docid": "4b862462beb1d6d10506f73daf71f18c",
"score": "0.6080828",
"text": "def index\n sighting = Sighting.all \n render json: SightingSerializer.new(sighting)\n end",
"title": ""
},
{
"docid": "92d818134951af9cc3a90d845126b8ad",
"score": "0.606046",
"text": "def show\n render json: Seances::UseCases::AvailableSeats.new.call(id: params[:id])\n end",
"title": ""
},
{
"docid": "a910a57d78b8e21c88472bb4debf1a82",
"score": "0.6023681",
"text": "def show\n animal = Animal.find(params[:id])\n #return all the sightings for the animal\n render json: animal.to_json(include: :sightings)\nend",
"title": ""
},
{
"docid": "0a97dfc5f9fb90f6a3038c0ac575f83b",
"score": "0.6009509",
"text": "def index\n @kids = Kid.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kids }\n end\n end",
"title": ""
},
{
"docid": "676aff6ee6568debb8991ad8f5c599d4",
"score": "0.5983374",
"text": "def index\n @shelters = Shelter.where(filtering_params)\n render json: @shelters\n end",
"title": ""
},
{
"docid": "0382d2c31e6af2fc315f1edfed4df0d7",
"score": "0.5950824",
"text": "def index\n @desks = Desk.all\n\n render json: @desks\n end",
"title": ""
},
{
"docid": "395ab8b2599166b1921489248a0dd58c",
"score": "0.5942492",
"text": "def index\n @joys = Joy.all\n render json: @joys\n end",
"title": ""
},
{
"docid": "106a006d1772dba771f3103a72316652",
"score": "0.59228486",
"text": "def index # public\n if params[:shelter_id]\n set_shelter\n render json: @shelter.animals\n else\n @animals = Animal.includes(:shelter).all\n render 'index.json.jbuilder'\n end\n end",
"title": ""
},
{
"docid": "d88bf6975358f0976c3c31d6f70ef334",
"score": "0.59209853",
"text": "def show\n @kitty = Kitty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitty }\n end\n end",
"title": ""
},
{
"docid": "12ea101542bab3130880457a7ba2bafe",
"score": "0.59084123",
"text": "def index\n @buisnesses = Buisness.all\n\n render json: @buisnesses \n end",
"title": ""
},
{
"docid": "40255f36f9d6ebed8694272c58efd3b5",
"score": "0.5899943",
"text": "def show\n render json: @desk\n end",
"title": ""
},
{
"docid": "4204a601b939b718f5732dc2a17131ad",
"score": "0.5896469",
"text": "def index\n @shorties = Shorty.per_user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shorties }\n end\n end",
"title": ""
},
{
"docid": "83da38c48b99cbc07528287007de7b9d",
"score": "0.58889955",
"text": "def show\n @county = County.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @county }\n end\n end",
"title": ""
},
{
"docid": "0c65c0a81d245f227bdfafbb178f015e",
"score": "0.5888092",
"text": "def show\n @sklad = Sklad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sklad }\n end\n end",
"title": ""
},
{
"docid": "9af3f55c94efce132c48655739c7e23c",
"score": "0.58801347",
"text": "def index\n @sells = Sell.all\n\n render json: @sells\n end",
"title": ""
},
{
"docid": "0dd9a1f097f08eab266be1c3437ea3c9",
"score": "0.58534116",
"text": "def scubooks\n sections = Section.all\n render json: sections\n end",
"title": ""
},
{
"docid": "19caa188955e5bd10076180a93621521",
"score": "0.5851274",
"text": "def index\n @dairy_plans = DairyPlan.where(:student_id => @student.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dairy_plans }\n end\n end",
"title": ""
},
{
"docid": "39493d3ea72f60e37621ffd469fb309a",
"score": "0.5843862",
"text": "def show\n @skydatum = Skydatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @skydatum }\n end\n end",
"title": ""
},
{
"docid": "1a554ce87ace32adef2285763a8aa620",
"score": "0.58400714",
"text": "def semesters\n uni_year = UniYear.find_by_id(params[:uni_year_id])\n @semesters = uni_year ? uni_year.semesters : []\n \n respond_to do |format|\n format.json { render json: @semesters }\n end\n end",
"title": ""
},
{
"docid": "72554d1d08ed09cfa1c5ee51ea674cd9",
"score": "0.58399004",
"text": "def show\n @saiken = Saiken.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @saiken }\n end\n end",
"title": ""
},
{
"docid": "5d6c9ce6f507f718cdf343e71a7108d2",
"score": "0.5836249",
"text": "def show\n @shoe = Shoe.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shoe }\n end\n end",
"title": ""
},
{
"docid": "1c023b92436aba459134eaf1a5d9ba25",
"score": "0.5830858",
"text": "def show\n @stylist = Stylist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stylist }\n end\n end",
"title": ""
},
{
"docid": "4544e28b9900085c8ae64c104d69ec20",
"score": "0.5824046",
"text": "def show\n animal = Animal.find(params[:id])\n render json: animal.as_json(include: :sightings) \n end",
"title": ""
},
{
"docid": "1a77bd464251f4065b7e5e134e079622",
"score": "0.5822514",
"text": "def show\n render json: @sell\n end",
"title": ""
},
{
"docid": "2257e9d4179964e87e5fa526da1c31eb",
"score": "0.5804162",
"text": "def index\n @shoes = Shoe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shoes }\n end\n end",
"title": ""
},
{
"docid": "7a017fb2992ac2b7fda37ba7a4f9a420",
"score": "0.58016473",
"text": "def index\n render json: Seller.all\n end",
"title": ""
},
{
"docid": "2340d55ae9ca068c6c9fc41e3edc5063",
"score": "0.57976305",
"text": "def index\n @students = Student.all\n render json: @students\n end",
"title": ""
},
{
"docid": "0766111cf6ab9910302eab1e3658881f",
"score": "0.5796772",
"text": "def index\n @user = User.find(session[:user_id])\n @schools = @user.schools\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schools }\n end\n end",
"title": ""
},
{
"docid": "88662c853e33c6bf2a24b2906f7a45c3",
"score": "0.57958585",
"text": "def index\n @sklads = Sklad.all\n end",
"title": ""
},
{
"docid": "7fd81d7b0f1950694d154f8f465a9203",
"score": "0.57927567",
"text": "def index\n @winners = Winner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @winners }\n end\n end",
"title": ""
},
{
"docid": "6a9c6504041b9c3483220c011c16517f",
"score": "0.57784325",
"text": "def index\n @used_bikes = UsedBike.all\n\n render json: @used_bikes, each_serializer: Web::V1::UsedBikeSerializer\n end",
"title": ""
},
{
"docid": "419c55bdaf3c1e033350ab5dcd3660b3",
"score": "0.5758843",
"text": "def show\n render json: @used_bike, serializer: Web::V1::UsedBikeSerializer\n end",
"title": ""
},
{
"docid": "19aa3aeb1bb18d715a0ab5c25cc2a620",
"score": "0.575138",
"text": "def index\n @dices = Dice.all\n\n render json: @dices\n end",
"title": ""
},
{
"docid": "c1656232b16a2048742c04658d96466d",
"score": "0.57369506",
"text": "def show\n @kitten = Kitten.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitten }\n end\n end",
"title": ""
},
{
"docid": "9bca47d9da6667c6ef035eac8ac3aa75",
"score": "0.5734897",
"text": "def show\n render json: @dice\n end",
"title": ""
},
{
"docid": "11367d36e4c90c8a0de89176b3b870a4",
"score": "0.57346594",
"text": "def index\n @clients = current_user.clients\n render json: @clients\n end",
"title": ""
},
{
"docid": "d1300e445b2b6215bad266785c343018",
"score": "0.5730516",
"text": "def show\n render json: @rock\n end",
"title": ""
},
{
"docid": "a07b189291abeb452ded9b2e6d206128",
"score": "0.57244736",
"text": "def show\n @sighting = Sighting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sighting }\n end\n end",
"title": ""
},
{
"docid": "79ba9475ed6f4a9af1c8e78692173d44",
"score": "0.5693006",
"text": "def index\n @shains = Shain.all\n end",
"title": ""
},
{
"docid": "9e5090b72df2949e9e290d051754356f",
"score": "0.56842256",
"text": "def show\n @joy = Joy.find(params[:id])\n render json: @joy\n end",
"title": ""
},
{
"docid": "b1e42c81d6f585a54fca808250b3d533",
"score": "0.5672851",
"text": "def show\n render json: @weapon\n end",
"title": ""
},
{
"docid": "eb002ce1540723b5cdb09ad5a638450b",
"score": "0.56715196",
"text": "def index\n @kwasnies = Kwasny.all\n end",
"title": ""
},
{
"docid": "2b073d010d03f651a3fd8e5ab2c2111b",
"score": "0.5662381",
"text": "def index\n @stations = Station.all\n\n render json: @stations\n end",
"title": ""
},
{
"docid": "72ff47af638d81ad48d0049a4e2c4e68",
"score": "0.5647209",
"text": "def index\n @skills = Skill.all\n\n render json: @skills\n end",
"title": ""
},
{
"docid": "3120d4114f1d3ddef044095a5ba4bac3",
"score": "0.5643708",
"text": "def show\n @clientsOffers = ClientsOffers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientsOffers }\n end\n end",
"title": ""
},
{
"docid": "a3dfe7b16149492c783c46c1b84e8c5c",
"score": "0.5636896",
"text": "def show\n @species = Specie.find(params[:id])\n\n @pets = Pet.where(:specie_id => @species).all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {:secie => @species, :pets => @pets } }\n end\n end",
"title": ""
},
{
"docid": "6fd41785e23ea733c905e419600e0c13",
"score": "0.56141627",
"text": "def show\n sighting = Sighting.find(params[:id])\n #render json: sighting.to_json(:include => {:bird => {:only =>[:name, :species]}, :location => {:only =>[:latitude, :longitude]}}, :except => [:updated_at])\n end",
"title": ""
},
{
"docid": "bf94e516c878809af782ae35b9c921b1",
"score": "0.5608824",
"text": "def index\n @shots = Shot.all\n\n render json: @shots\n end",
"title": ""
},
{
"docid": "4a4ce059d1dcafae09e4e5ac7e084a7a",
"score": "0.56053275",
"text": "def show\n @seat = Seat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seat }\n end\n end",
"title": ""
},
{
"docid": "90ad714c0ad2089c924d69e701fe27e3",
"score": "0.5604514",
"text": "def show\n render json: @championship\n end",
"title": ""
},
{
"docid": "6e8b66a91e4c11283a7c94401964d76c",
"score": "0.56024975",
"text": "def index\n @clubs = Club.all\n render json: @clubs\n end",
"title": ""
},
{
"docid": "9628cbd7217e4f94a674bfe1014d714d",
"score": "0.5586607",
"text": "def show\n render json: Agent.find(params[:id]).buyers\n end",
"title": ""
},
{
"docid": "fea34df6da874875487cf6aa44f9bf5a",
"score": "0.5576224",
"text": "def show\n @sluzby = Sluzby.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sluzby }\n end\n end",
"title": ""
},
{
"docid": "a3081c8cec82b1471251d7c0af972e55",
"score": "0.5571519",
"text": "def index\n @wks = Wk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wks }\n end\n end",
"title": ""
},
{
"docid": "7245a99b2919dc773c2b0b84e3eda56b",
"score": "0.5568734",
"text": "def index\n @weapons = Weapon.all\n\n render json: @weapons\n end",
"title": ""
},
{
"docid": "7355d98e80955d1f28884909c0627a87",
"score": "0.55684114",
"text": "def show\n @spieler = Spieler.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @spieler }\n end\n end",
"title": ""
},
{
"docid": "fdd1a2404285c2b12cebc23ca64b6f7b",
"score": "0.55680525",
"text": "def get_students\n @course = Course.find(params[:course_id])\n\n render json: @course.students\n end",
"title": ""
},
{
"docid": "381f228778d3343e3e046de490404528",
"score": "0.55675936",
"text": "def index\n @harvestings = Harvesting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvestings }\n end\n end",
"title": ""
},
{
"docid": "06fa86df2e18bc92bfcbc8c5b47c1d74",
"score": "0.55652654",
"text": "def show\n\t\trecords = University.where(['name LIKE ?', \"#{params[:name]}%\"])\n\t\tschools = Array.new\n\n\t\trecords.each do |record|\n\t\t\tcents_rating = RatesSchool.find_by_sql [\n\t\t\t\t'SELECT avg(rating) AS average\n\t\t\t\tFROM rates_schools\n\t\t\t\tWHERE university_id = ?',\n\t\t\t\trecord.id\n\t\t\t]\n\t\t\trecord = record.as_json\n\t\t\trecord[:average_rating] = cents_rating[0][:average].to_f\n\t\t\tschools << record.except('id', 'created_at', 'updated_at')\n\t\tend\n\n\t\tif schools.present?\n\t\t\treturn render json: schools, status: 200\n\t\telse\n\t\t\treturn render json: [], status: 404\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f5010b4a4d2a3d10d2a46d4d90e0673d",
"score": "0.55577284",
"text": "def show\n render json: @wellist\n end",
"title": ""
},
{
"docid": "14bab7d17cacb2a4e39e7225ec7ef1bc",
"score": "0.5557246",
"text": "def index\n @disciplines = Discipline.all\n\n render json: @disciplines\n end",
"title": ""
},
{
"docid": "ea572448465a950ba5e8ffe436bffd2e",
"score": "0.5556359",
"text": "def index\n @stars = Star.all\n render :json => @stars\n end",
"title": ""
},
{
"docid": "a3a63d696d3aaeecff0dfa1107ff8d15",
"score": "0.5556038",
"text": "def index\n user_id = @user.id\n @auctions = Auction.where(\"seller_id = ?\", user_id)\n\n # get all belong auctions\n render json: @auctions\n end",
"title": ""
},
{
"docid": "8c7151b10324cf8b642c3e98eaa4f340",
"score": "0.555417",
"text": "def show\n @secry = Secry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @secry }\n end\n end",
"title": ""
},
{
"docid": "dcc5d8c8b6a5007edbc5653c529c6c7d",
"score": "0.5547349",
"text": "def show\n @shout = Shout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shout }\n end\n end",
"title": ""
},
{
"docid": "7853f168cadcee39578a5cb384981828",
"score": "0.5546469",
"text": "def show\n hub = Hub.find(params[:id])\n respond_to do |format|\n format.json { render :json => hub.warehouses }\n end\n end",
"title": ""
},
{
"docid": "dcc5d8c8b6a5007edbc5653c529c6c7d",
"score": "0.5546138",
"text": "def show\n @shout = Shout.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shout }\n end\n end",
"title": ""
},
{
"docid": "a56e370f49542acee32ae1077f5656bf",
"score": "0.5542483",
"text": "def index\n @parties = Party.order(:name).all\n\n respond_to do |format|\n format.html\n format.json { render json: @parties }\n format.xml { render xml: @parties }\n end\n end",
"title": ""
},
{
"docid": "0a1d0ac4d25875d8fc731c4a715fc360",
"score": "0.5532549",
"text": "def index\n @spoofers = Spoofer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @spoofers }\n end\n end",
"title": ""
},
{
"docid": "29fcc7c3bee7428121799f8973e4c715",
"score": "0.5528858",
"text": "def index\n @clients = Client.all\n render json: @clients\n end",
"title": ""
},
{
"docid": "b04a53cfc7efbfbf64e9b9ed591386c7",
"score": "0.55284846",
"text": "def index\n @sprinkles = Sprinkle.all\n end",
"title": ""
},
{
"docid": "aee5965c72ef813463638006340b336e",
"score": "0.5528369",
"text": "def index\n @sekilas_infos = SekilasInfo.all\n end",
"title": ""
},
{
"docid": "fe602d671c12a8112bd4337494b35d8b",
"score": "0.5516677",
"text": "def show\n @bruger = Bruger.find_by_id(current_user.id)\n @onske = Onske.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @onske }\n end\n end",
"title": ""
},
{
"docid": "a6597983394e1ffee1d5abb4d6452f4b",
"score": "0.55166674",
"text": "def index\n json_response(Spot.all)\n end",
"title": ""
},
{
"docid": "a9d9cd8429d952f3886721c34cb4676a",
"score": "0.551659",
"text": "def index\n @zones = Zone.all\n\n render json: @zones\n end",
"title": ""
},
{
"docid": "3ae2c9dad4847f06c68f1a1ab00ea803",
"score": "0.5515857",
"text": "def index\n\t\t@clubs = Club.all\n\t\trender json: @clubs\n\tend",
"title": ""
},
{
"docid": "ef28dde0a4dbcfeb8305150e3049cad1",
"score": "0.55149",
"text": "def show\n @zombie_sighting = ZombieSighting.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @zombie_sighting }\n end\n end",
"title": ""
},
{
"docid": "bf1a179fcbd8793256c42537244ebc6d",
"score": "0.5513028",
"text": "def index\n sanitized_params = parse_params(client_where_params)\n clients = Client.find_all(sanitized_params)\n render json: clients\n end",
"title": ""
},
{
"docid": "cba8abfdff70382fb2517e482e9fe8e9",
"score": "0.5512953",
"text": "def index\n @stalkees = Stalkee.all\n end",
"title": ""
},
{
"docid": "5e6636ee2b70e8c2672cbc1083991868",
"score": "0.55116105",
"text": "def get_smokers\n get_clients.select{ |client| client.smoke_cigarettes}\n end",
"title": ""
},
{
"docid": "e0d60f0ecbd523ff62f6663f0e5de10a",
"score": "0.5511363",
"text": "def list_whiskies(whisky_url)\n #scrape and and create array of whisky hashes for all selected whiskies using url\n @whiskies = WhiskyPicker::Whisky.scrape_index_page(BASE_PATH + whisky_url)\n #display list of whiskies\n @whiskies.each_with_index do |whisky, index|\n puts \"#{index+1}. #{whisky.name}\"\n end\n menu\n end",
"title": ""
},
{
"docid": "3c79b6b68c7a963cd39a4eab36326ae9",
"score": "0.5511142",
"text": "def buyers\n result = get_buyers(params, false)\n render json: result, status: 200\n end",
"title": ""
},
{
"docid": "ac701e5972c1d34f1b0d0552e4c529c2",
"score": "0.5510894",
"text": "def show\n render json: @shot\n end",
"title": ""
},
{
"docid": "29ee642713543041f82e0bfc6f76fa89",
"score": "0.5507722",
"text": "def show\n @vessel = Vessel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vessel }\n end\n end",
"title": ""
},
{
"docid": "d4b3477e73c78fd2455f7a2d83df1a0c",
"score": "0.550572",
"text": "def show\n @sighting = Sighting.find(params[:id])\n if @sighting\n render json: @sighting, status: :ok\n else\n render json: @sighting.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "700172c0fe7acafe12a8448e116bcc34",
"score": "0.5504752",
"text": "def index\n @supermarkets = Supermarket.all\n respond_to do |format|\n format.json { render json: @supermarkets, status: :ok } \n end \n end",
"title": ""
},
{
"docid": "606ffd077cc64de2a9fcc0e96293ba3c",
"score": "0.55042887",
"text": "def index\n @student_profiles = StudentProfile.all \n render json: @student_profiles\n end",
"title": ""
},
{
"docid": "37b17b6417a2366983ae4c6bd3102899",
"score": "0.549262",
"text": "def show\n render json: @client\n end",
"title": ""
},
{
"docid": "e91e5d3f9ef9e02b6a2e211249b2d409",
"score": "0.54916215",
"text": "def index\n @varieties = Variety.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @varieties }\n end\n end",
"title": ""
}
] |
fe990ff1e5ff2986f3975f97f58ad3ef
|
Initializes form name = form name saved_data = existing data on the server form_data = data displayed on the form live_data = existing data from deployment manifest
|
[
{
"docid": "2ef993da6ffbabf31552687b642cf606",
"score": "0.6447264",
"text": "def initialize(name, saved_data, form_data, live_data)\n @name = name\n @saved_data = saved_data\n @form_data = form_data\n @live_data = live_data\n @volatile_data = nil\n\n @screens = []\n\n get_form_config.each do |screen|\n @screens << Screen.new(screen['screen'], self)\n end\n end",
"title": ""
}
] |
[
{
"docid": "a2ca9e3170d03afb236736158c65072e",
"score": "0.6337217",
"text": "def set_new_form_information\n @information[:form_url] = budgets_path(@budget)\n @information[:filter_form_url] = new_budget_path\n @information[:subtitle] = t('view.budgets.new_title')\n @information[:button_text] = t('view.budgets.save')\n @information[:back_path] = back_path\n end",
"title": ""
},
{
"docid": "13c1c7fef110956d5afa9086fb9e33f4",
"score": "0.62884",
"text": "def fill_all_form_data()\n if verbose_messages\n p @fillable_form_fields\n p @current_page_data_object\n end\n\n @fillable_form_fields.each do |field|\n value = @current_page_data_object.retrieve_data_for(field)\n enter_element_value(field, value) if value and (value != \"nil\")\n end\n end",
"title": ""
},
{
"docid": "9ae3acbbaab7e651b22a36864b8c9f67",
"score": "0.625899",
"text": "def init_forms\n if ! @fw.nil?\n # was already called in child class - do not re-init forms\n return\n end\n\n @form_params = {}\n\n @fw = FrameWork.new\n\n @co = ConfigOptions.new\n @fw = @co.get_fw_forms_specs(@fw)\n end",
"title": ""
},
{
"docid": "630220110c00b06dd8a4dc17850a5969",
"score": "0.6228113",
"text": "def form_data\n user_specified_options[:form_data]\n end",
"title": ""
},
{
"docid": "5e863ca84d251aab6b36c58da754a100",
"score": "0.61696446",
"text": "def form_fill\n options = {\n # Vet's ID\n # Veteran name is filled out through autosize text box, not pdf fields\n form_fields.middle_initial => form_data.veteran.middle_initial,\n form_fields.ssn_first_three => form_data.veteran_ssn_first_three,\n form_fields.ssn_second_two => form_data.veteran_ssn_second_two,\n form_fields.ssn_last_four => form_data.veteran_ssn_last_four,\n # Veteran file number is filled out through autosize text box, not pdf fields\n form_fields.veteran_birth_month => form_data.veteran.birth_month,\n form_fields.veteran_birth_day => form_data.veteran.birth_day,\n form_fields.veteran_birth_year => form_data.veteran.birth_year,\n form_fields.insurance_policy_number => form_data.veteran.insurance_policy_number,\n form_fields.mailing_address_state => form_data.veteran.state_code,\n form_fields.mailing_address_country => form_data.veteran.country_code,\n form_fields.veteran_homeless => form_data.veteran_homeless,\n form_fields.veteran_phone_area_code => form_data.veteran_area_code,\n form_fields.veteran_phone_prefix => form_data.veteran_phone_prefix,\n form_fields.veteran_phone_line_number => form_data.veteran_phone_line_number,\n\n # Claimant\n # Claimant name is filled out through autosize text box, not pdf fields\n form_fields.claimant_middle_initial => form_data.claimant.middle_initial,\n form_fields.claimant_first_three_ssn => form_data.claimant_ssn_first_three,\n form_fields.claimant_second_two_ssn => form_data.claimant_ssn_second_two,\n form_fields.claimant_last_four_ssn => form_data.claimant_ssn_last_four,\n form_fields.claimant_birth_month => form_data.claimant.birth_month,\n form_fields.claimant_birth_day => form_data.claimant.birth_day,\n form_fields.claimant_birth_year => form_data.claimant.birth_year,\n form_fields.claimant_mailing_address_state => form_data.claimant.state_code,\n form_fields.claimant_mailing_address_country => form_data.claimant.country_code,\n form_fields.claimant_phone_area_code => form_data.claimant_area_code,\n form_fields.claimant_phone_prefix => form_data.claimant_phone_prefix,\n form_fields.claimant_phone_line_number => form_data.claimant_phone_line_number,\n\n # Benefit Type\n form_fields.benefit_type(0) => form_data.benefit_type('education'),\n form_fields.benefit_type(1) => form_data.benefit_type('nationalCemeteryAdministration'),\n form_fields.benefit_type(2) => form_data.benefit_type('veteransHealthAdministration'),\n form_fields.benefit_type(3) => form_data.benefit_type('lifeInsurance'),\n form_fields.benefit_type(4) => form_data.benefit_type('loanGuaranty'),\n form_fields.benefit_type(5) => form_data.benefit_type('fiduciary'),\n form_fields.benefit_type(6) => form_data.benefit_type('veteranReadinessAndEmployment'),\n form_fields.benefit_type(7) => form_data.benefit_type('pensionSurvivorsBenefits'),\n form_fields.benefit_type(8) => form_data.benefit_type('compensation'),\n\n # Optional Informal Conference\n form_fields.informal_conference => form_data.informal_conference,\n form_fields.conference_8_to_12 => form_data.informal_conference_time('veteran', '800-1200 ET'),\n form_fields.conference_12_to_1630 => form_data.informal_conference_time('veteran', '1200-1630 ET'),\n form_fields.conference_rep_8_to_12 => form_data.informal_conference_time('representative', '800-1200 ET'),\n form_fields.conference_rep_12_to_1630 => form_data.informal_conference_time('representative',\n '1200-1630 ET'),\n # Rep name should be filled with autosize text boxes, not pdf fields\n form_fields.rep_phone_area_code => form_data.rep_phone_area_code,\n form_fields.rep_phone_prefix => form_data.rep_phone_prefix,\n form_fields.rep_phone_line_number => form_data.rep_phone_line_number,\n\n # Section V: SOC/SSOC Opt-In\n form_fields.sso_ssoc_opt_in => form_data.soc_opt_in,\n\n # Section VI: Issues (allows 13 in fields)\n # Dates filled via fill_contestable_issues_dates!, below.\n # Issue text is filled out through autosize text boxes.\n\n # Section VII: Cert & Sig\n form_fields.date_signed_month => form_data.date_signed_mm,\n form_fields.date_signed_day => form_data.date_signed_dd,\n form_fields.date_signed_year => form_data.date_signed_yyyy\n\n # Section VIII: Authorized Rep Sig\n # NOT YET SUPPORTED\n }\n\n fill_contestable_issues_dates!(options)\n end",
"title": ""
},
{
"docid": "7f4062295ce1779b92f25a3123e93f85",
"score": "0.61594087",
"text": "def form_data?; end",
"title": ""
},
{
"docid": "7f4062295ce1779b92f25a3123e93f85",
"score": "0.61594087",
"text": "def form_data?; end",
"title": ""
},
{
"docid": "7f4062295ce1779b92f25a3123e93f85",
"score": "0.61594087",
"text": "def form_data?; end",
"title": ""
},
{
"docid": "7f4062295ce1779b92f25a3123e93f85",
"score": "0.61594087",
"text": "def form_data?; end",
"title": ""
},
{
"docid": "e1a5d2ce2a033da423ab6a9b95a13366",
"score": "0.61523634",
"text": "def set_form_vars\n @in_a_form_props = true\n session[:field_data] = {}\n @edit = {}\n session[:edit] = {}\n @edit[:ae_class_id] = @ae_class.id\n @edit[:new] = {}\n @edit[:current] = {}\n @edit[:new_field] = {}\n @edit[:rec_id] = @ae_class.id || nil\n @edit[:key] = \"aeclass_edit__#{@ae_class.id || \"new\"}\"\n\n @edit[:new][:name] = @ae_class.name\n @edit[:new][:display_name] = @ae_class.display_name\n @edit[:new][:description] = @ae_class.description\n @edit[:new][:namespace] = @ae_class.namespace\n @edit[:new][:inherits] = @ae_class.inherits\n @edit[:inherits_from] = MiqAeClass.all.collect { |c| [c.fqname, c.fqname] }\n @edit[:current] = @edit[:new].dup\n @right_cell_text = if @edit[:rec_id].nil?\n _(\"Adding a new Automate Class\")\n else\n _(\"Editing Automate Class \\\"%{name}\\\"\") % {:name => @ae_class.name}\n end\n session[:edit] = @edit\n @in_a_form = true\n end",
"title": ""
},
{
"docid": "21eebe3ecd3bf049094c7b69f23c7b98",
"score": "0.614523",
"text": "def store_form_data\n form_number = 'ss-5' if session[:reasons][:married].present?\n form_number = '79960' if session[:reasons][:court_order].present?\n body = {}\n body.merge!(:form_number => form_number)\n body.merge!(:data => session[:user])\n @mygov_access_token.post(\"/api/forms\", :body => body)\n end",
"title": ""
},
{
"docid": "53a57682edf84416dd7c51e6536c327f",
"score": "0.61290175",
"text": "def fill_out_form(hash)\n self.main_title=hash[:main_title]\n self.main_author=hash[:main_author]\n self.co_authors=hash[:co_authors]\n self.publisher=hash[:publisher]\n self.place_of_publication=hash[:place]\n self.volume_title=hash[:volume_title]\n self.volume_information=hash[:volume_info]\n self.year=hash[:year]\n self.number=hash[:number]\n self.series_title=hash[:series]\n self.url=hash[:url]\n end",
"title": ""
},
{
"docid": "b28979535502ddce48132ff339907a8a",
"score": "0.6118614",
"text": "def create_ds_set_form_vars\n @edit = {}\n @edit[:new] = {}\n @edit[:key] = \"ontap_file_share_create_ds__#{@sfs.id}\"\n @edit[:new][:ds_name] = @sfs.default_datastore_name\n @edit[:hosts] = @sfs.applicable_hosts\n end",
"title": ""
},
{
"docid": "aa6dd07dd210d2ab4c1f64ea591b4fb4",
"score": "0.61153305",
"text": "def ap_set_form_vars\n @edit = {}\n session[:file_names] = []\n session[:reg_entries] = []\n session[:nteventlog_entries] = []\n @edit[:scan_id] = @scan.id\n @edit[:new] = {}\n @edit[:current] = {}\n @edit[:key] = \"ap_edit__#{@scan.id || \"new\"}\"\n\n @edit[:new][:name] = @scan.name\n @edit[:new][:scan_mode] = @scan.mode\n @edit[:new][:description] = @scan.description\n\n scanitems = @scan.members # Get the member sets\n\n # @edit[:new][:items] = Array.new\n scanitems.each_with_index do |scanitem, _i|\n @edit[:new][scanitem.item_type] = {}\n # @edit[:new][scanitem.item_type][:id] = scanitem.id\n @edit[:new][scanitem.item_type][:name] = scanitem.name\n @edit[:new][scanitem.item_type][:description] = scanitem.description\n @edit[:new][scanitem.item_type][:definition] = scanitem.definition.dup\n @edit[:new][scanitem.item_type][:type] = scanitem.item_type\n session[:file_names] = @edit[:new][scanitem.item_type][:definition][\"stats\"].dup unless @edit[:new][scanitem.item_type][:definition][\"stats\"].nil?\n session[:reg_entries] = @edit[:new][\"registry\"][:definition][\"content\"].dup unless @edit[:new][\"registry\"].nil?\n session[:nteventlog_entries] = @edit[:new][\"nteventlog\"][:definition][\"content\"].dup unless @edit[:new][\"nteventlog\"].nil?\n end\n\n @edit[:current] = copy_hash(@edit[:new])\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "faee4248085bf9beb3ea357fe635634a",
"score": "0.61147445",
"text": "def iso_datastore_set_form_vars\n @edit = {}\n @edit[:isd] = @isd\n\n @edit[:new] = {}\n @edit[:current] = {}\n @edit[:key] = \"isd_edit__#{@isd.id || \"new\"}\"\n @edit[:rec_id] = @isd.id || nil\n @edit[:new][:ems_id] = @isd.ext_management_system.try(:id)\n\n @edit[:emses] = ManageIQ::Providers::Redhat::InfraManager\n .without_iso_datastores\n .order(:name)\n .pluck(:name, :id)\n\n @edit[:current] = copy_hash(@edit[:new])\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "9796dd91923d1a4d01e0a831e21617e6",
"score": "0.6103246",
"text": "def set_new_form_information\n @information[:form_url] = orders_path(@order)\n @information[:subtitle] = t('view.orders.new_title')\n @information[:button_text] = t('view.orders.save')\n @information[:back_path] = back_path\n end",
"title": ""
},
{
"docid": "105a5b89413f113ac5761a2e212f5489",
"score": "0.60645854",
"text": "def data\n @field.widget.value_from_formdata(@form.data, @form.files, @html_name)\n end",
"title": ""
},
{
"docid": "ec713a7fdbf686e30d67d506c76dab24",
"score": "0.6033753",
"text": "def initialize(instance)\n @form = instance.form_version.form\n @instance = instance\n @is_new = @instance.id.nil?\n @controls = []\n form_metadata = FD::Metadata::Form.new(instance.form_version.metadata)\n @tree, @controls = build_tree(form_metadata)\n @connections = build_connections(form_metadata)\n end",
"title": ""
},
{
"docid": "112a654c86c790f4d5a216625a20d8a8",
"score": "0.60066855",
"text": "def ap_get_form_vars\n @scan = @edit[:scan_id] ? ScanItemSet.find(@edit[:scan_id]) : ScanItemSet.new\n @edit[:new][:name] = params[:name] if params[:name]\n @edit[:new][:description] = params[:description] if params[:description]\n\n if params[:item].present? || params[:item_type].present?\n ap_get_form_vars_category if @sb[:ap_active_tab] == \"category\"\n if @edit[:new][\"category\"]\n @edit[:new][\"category\"][:name] = \"#{params[:name]}_category\" if params[:name]\n if params[:description]\n @edit[:new][\"category\"][:description] = _(\"%{description} category Scan\") %\n {:description => params[:description]}\n end\n end\n\n ap_get_form_vars_file if @sb[:ap_active_tab] == \"file\" && params[:item] && params[:item][\"type1\"]\n if @edit[:new][\"file\"]\n @edit[:new][\"file\"][:name] = \"#{params[:name]}_file\" if params[:name]\n if params[:description]\n @edit[:new][\"file\"][:description] = \"%{description} file Scan\" % {:description => params[:description]}\n end\n end\n\n ap_get_form_vars_registry if @sb[:ap_active_tab] == \"registry\"\n if @edit[:new][\"registry\"]\n @edit[:new][\"registry\"][:name] = \"#{params[:name]}_registry\" if params[:name]\n if params[:description]\n @edit[:new][\"registry\"][:description] = _(\"%{description} registry Scan\") %\n {:description => params[:description]}\n end\n end\n\n ap_get_form_vars_event_log if @sb[:ap_active_tab] == \"event_log\"\n if @edit[:new][\"nteventlog\"]\n @edit[:new][\"nteventlog\"][:name] = \"#{params[:name]}_nteventlog\" if params[:name]\n @edit[:new][\"nteventlog\"][:description] = \"#{params[:description]} nteventlog Scan\" if params[:description]\n end\n end\n end",
"title": ""
},
{
"docid": "9de950a5096892e0da357aa4f7dbeb88",
"score": "0.59882426",
"text": "def generate_form_data\n data = {\n 'optimisation-mode' => @optimisation_mode,\n 'output-format' => @output_format,\n 'colour-enhancement' => @colour_enhancement,\n 'resize-mode' => @resize_mode\n }\n \n # Only include width and height if resize requested\n if @resize_mode != nil && @resize_mode != Zara4::API::ImageProcessing::ResizeMode::NONE\n data['width'] = @width\n data['height'] = @height\n end\n \n return data\n end",
"title": ""
},
{
"docid": "aa73bb3464d86c5f8f769a925f69f7ad",
"score": "0.59658",
"text": "def set_instances_form_vars\n session[:inst_data] = {}\n @edit = {\n :ae_inst_id => @ae_inst.id,\n :ae_class_id => @ae_class.id,\n :rec_id => @ae_inst.id || nil,\n :key => \"aeinst_edit__#{@ae_inst.id || \"new\"}\",\n :new => {}\n }\n @edit[:new][:ae_inst] = {}\n instance_column_names.each do |fld|\n @edit[:new][:ae_inst][fld] = @ae_inst.send(fld)\n end\n\n @edit[:new][:ae_values] = @ae_values.collect do |ae_value|\n value_column_names.each_with_object({}) do |fld, hash|\n hash[fld] = ae_value.send(fld)\n end\n end\n\n @edit[:new][:ae_fields] = @ae_class.ae_fields.collect do |ae_field|\n field_column_names.each_with_object({}) do |fld, hash|\n hash[fld] = ae_field.send(fld)\n end\n end\n\n @edit[:current] = copy_hash(@edit[:new])\n @right_cell_text = if @edit[:rec_id].nil?\n _(\"Adding a new Automate Instance\")\n else\n _(\"Editing Automate Instance \\\"%{name}\\\"\") % {:name => @ae_inst.name}\n end\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "b9a1747942bbf9dc6cd7ce4d7949e1fb",
"score": "0.5958764",
"text": "def form_hash\n { data: { target: 'expense-claim.expenseEntryForm expense-entry.form',\n expense_entry_changed: '0',\n action: 'ajax:complete->expense-claim#ajaxComplete '\\\n 'ajax:success->expense-entry#ajaxSuccessThereforeResetErrors' } }\n end",
"title": ""
},
{
"docid": "8a7796c951c62a89f02b0843f5b8c637",
"score": "0.595544",
"text": "def prepare_form_data\n @reminder_types = ReminderType.all\n @contracts = Contract.all\n @akts = Akt.all\n end",
"title": ""
},
{
"docid": "163912cf5be0146a50d793fc184ec343",
"score": "0.59538627",
"text": "def initialize(context, form)\n self.context = context\n self.form = form\n self.url = CGI.unescapeHTML(form[\"action\"])\n self.inputs = []\n self.submits = []\n fill_in_initial_values!\n end",
"title": ""
},
{
"docid": "12b206976251a1a5f05df22a2023406d",
"score": "0.5951322",
"text": "def fields_set_form_vars\n @in_a_form_fields = true\n session[:field_data] = {}\n @edit = {\n :ae_class_id => @ae_class.id,\n :rec_id => @ae_class.id,\n :new_field => {},\n :key => \"aefields_edit__#{@ae_class.id || \"new\"}\",\n :fields_to_delete => []\n }\n\n @edit[:new] = {\n :datatypes => build_dtype_options, # setting dtype combo for adding a new field\n :aetypes => build_type_options # setting aetype combo for adding a new field\n }\n\n @edit[:new][:fields] = @ae_class.ae_fields.sort_by { |a| [a.priority.to_i] }.collect do |fld|\n field_attributes.each_with_object({}) do |column, hash|\n hash[column] = fld.send(column)\n end\n end\n\n # combo to show existing fields\n @combo_xml = build_type_options\n # passing in fields because that's how many combo boxes we need\n @dtype_combo_xml = build_dtype_options\n @edit[:current] = copy_hash(@edit[:new])\n @right_cell_text = if @edit[:rec_id].nil?\n _(\"Adding a new Class Schema\")\n else\n _(\"Editing Class Schema \\\"%{name}\\\"\") % {:name => @ae_class.name}\n end\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "786b36df116ce1e0f36f04f3b77563ef",
"score": "0.5945038",
"text": "def set_form_vars\n @edit[:new][:name] = @record.name\n @edit[:new][:description] = @record.description\n @edit[:new][:long_description] = @record.long_description\n @edit[:new][:provision_cost] = @record.provision_cost\n @edit[:new][:display] = @record.display || false\n @edit[:new][:catalog_id] = @record.service_template_catalog.try(:id)\n @edit[:new][:dialog_id] = nil # initialize\n @edit[:new][:st_prov_type] ||= @record.prov_type\n @edit[:new][:generic_subtype] = @record.generic_subtype || \"custom\" if @edit[:new][:st_prov_type] == 'generic'\n @edit[:new][:tenant_ids] = @record.additional_tenant_ids\n @tenants_tree = build_tenants_tree # Build the tree with available tenants\n @available_catalogs = available_catalogs.sort # Get available catalogs with tenants and ancestors\n @additional_tenants = @edit[:new][:tenant_ids].map(&:to_s) # Get ids of selected Additional Tenants in the Tenants tree\n available_orchestration_templates if @record.kind_of?(ServiceTemplateOrchestration)\n available_ansible_tower_managers if @record.kind_of?(ServiceTemplateAnsibleTower) || @record.kind_of?(ServiceTemplateAwx)\n available_container_managers if @record.kind_of?(ServiceTemplateContainerTemplate)\n fetch_zones\n @edit[:new][:zone_id] = @record.zone_id\n\n @edit[:new][:currency] = @record.currency ? @record.currency.id : nil\n @edit[:new][:code_currency] = @record.currency ? code_currency_label(@record.currency.id) : _(\"Price / Month\")\n @edit[:new][:price] = @record.price\n\n # initialize entry_point fields and its type to nil\n ENTRY_POINT_TYPES.each do |key, _prefix|\n fields = entry_point_fields(key)\n @edit[:new][key] = @edit[:new][fields[:type]] = @edit[:new][fields[:configuration_script_id]] = nil\n @edit[:new][fields[:previous]] = {:embedded_automate => nil, :embedded_workflow => nil}\n @edit[:new][fields[:type]] = default_entry_point_type\n end\n\n @record.resource_actions.each do |ra|\n @edit[:new][:dialog_id] = ra.dialog_id.to_i\n\n # To display the automation_type and its entry point values in edit page.\n entry_point = resource_action_entry_point(ra)\n\n if ra.action.downcase == 'provision'\n @edit[:new][:fqname] = entry_point[:name]\n @edit[:new][:provision_entry_point_type] = entry_point[:type]\n @edit[:new][:provision_configuration_script_id] = entry_point[:configuration_script_id]\n elsif ra.action.downcase == 'reconfigure'\n @edit[:new][:reconfigure_fqname] = entry_point[:name]\n @edit[:new][:reconfigure_entry_point_type] = entry_point[:type]\n @edit[:new][:reconfigure_configuration_script_id] = entry_point[:configuration_script_id]\n elsif ra.action.downcase == 'retirement'\n @edit[:new][:retire_fqname] = entry_point[:name]\n @edit[:new][:retire_entry_point_type] = entry_point[:type]\n @edit[:new][:retire_configuration_script_id] = entry_point[:configuration_script_id]\n end\n end\n load_available_dialogs\n @right_cell_text = if @record.id.blank?\n _(\"Adding a new Service Catalog Item\")\n else\n _(\"Editing Service Catalog Item \\\"%{name}\\\"\") % {:name => @record.name}\n end\n build_automate_tree(:automate_catalog) # Build Catalog Items tree\n form_available_vars_ovf_template if @record.kind_of?(ManageIQ::Providers::Vmware::InfraManager::OvfServiceTemplate)\n end",
"title": ""
},
{
"docid": "9e3c525ceb3f000d4634ec9dd34dbc40",
"score": "0.593676",
"text": "def form_data\n data = {}\n\n _attributes.each do |name, options|\n type = options.fetch(:type, 'string')\n data[name] = public_send(\"form_data_#{type}\", options)\n end\n\n data\n end",
"title": ""
},
{
"docid": "f8dbf5ccce4688fb90cc52b3576ba183",
"score": "0.5934666",
"text": "def initialized_update_form\n form_class.new(current_intake, form_params)\n end",
"title": ""
},
{
"docid": "f8dbf5ccce4688fb90cc52b3576ba183",
"score": "0.5934666",
"text": "def initialized_update_form\n form_class.new(current_intake, form_params)\n end",
"title": ""
},
{
"docid": "9778adb2883f1a225ce17d1f5b47a717",
"score": "0.59268314",
"text": "def prefill\n @identity_information = initialize_identity_information\n @contact_information = initialize_contact_information\n @military_information = initialize_military_information\n mappings = self.class.mappings_for_form(form_id)\n\n form = form_id == '1010EZ' ? '1010ez' : form_id\n form_data = generate_prefill(mappings) if FormProfile.prefill_enabled_forms.include?(form)\n\n { form_data:, metadata: }\n end",
"title": ""
},
{
"docid": "b3b09a9c9c1a6edc630c5ca12336afc3",
"score": "0.59250635",
"text": "def set_form\n end",
"title": ""
},
{
"docid": "47ebeac7c5eeb4290f4c15e45308e63d",
"score": "0.59118426",
"text": "def set_data_form\n @data_form = DataForm.find(params[:id])\n end",
"title": ""
},
{
"docid": "5df94e016e5efd1e0243f20939df0fb8",
"score": "0.5906879",
"text": "def dc_fields_for_form\n html = \"<div id='data_fields' \" + (@form['form']['height'] ? \"style=\\\"height: #{@form['form']['height']}px;\\\">\" : '>')\n @js ||= ''\n @css ||= ''\n # fields\n if (form_fields = @form['form']['fields'])\n html << dc_input_form_create(form_fields) + '</div>'\n # tabs\n elsif @form['form']['tabs']\n html = dc_tabs_form_create()\n end\n # add last_updated_at hidden field so controller can check if record was updated in db during editing\n html << hidden_field(nil, :last_updated_at, value: @record.updated_at.to_i) if @record.respond_to?(:updated_at)\n # add form time stamp to prevent double form submit\n html << hidden_field(nil, :form_time_stamp, value: Time.now.to_i)\n # add javascript code if defined by form\n @js << \"\\n#{@form['script']} #{@form['js']}\"\n @css << \"\\n#{@form['css']}\\n#{@form['form']['css']}\"\n html.html_safe\nend",
"title": ""
},
{
"docid": "e689ada81fa1fb8c262970b74bbeb3cc",
"score": "0.590002",
"text": "def fill_out_form(hash)\n self.email=hash[:email]\n self.fax=hash[:fax]\n self.institution=hash[:institution]\n self.department=hash[:department]\n self.title_role=hash[:title]\n self.instant_messaging=hash[:im]\n self.phone=hash[:phone]\n self.mobile=hash[:mobile]\n self.address=hash[:address]\n self.city=hash[:city]\n self.state=hash[:state]\n self.postal_code=hash[:zip]\n self.country=hash[:country]\n end",
"title": ""
},
{
"docid": "ba22d2a05ed630657c70ace60e2b25a9",
"score": "0.5874305",
"text": "def set_new_form_information\n @information[:form_url] = purchases_path(@order)\n @information[:subtitle] = t('view.purchases.new_title')\n @information[:button_text] = t('view.purchases.save')\n @information[:back_path] = back_path\n end",
"title": ""
},
{
"docid": "b60268359592844ead60fbb8e1dfbfdb",
"score": "0.58679515",
"text": "def load_form_data\n load_reasons\n load_return_items\n load_reimbursement_types\n end",
"title": ""
},
{
"docid": "89d9edd4e7f70eb5af5464227663f06c",
"score": "0.5863744",
"text": "def init_forms\n @fw = FrameWork.new\n @ir = InterfaceResults.new\n\n @optgroup = \"test_packaging\"\n init_fields\n end",
"title": ""
},
{
"docid": "90dcb1ff7ebfaea563272a4b489f65e2",
"score": "0.5835236",
"text": "def template_get_form_vars\n @ct = @edit[:ct_id] ? CustomizationTemplate.find_by_id(@edit[:ct_id]) : CustomizationTemplate.new\n @edit[:new][:name] = params[:name] if params[:name]\n @edit[:new][:description] = params[:description] if params[:description]\n @edit[:new][:img_type] = params[:img_typ] if params[:img_typ]\n @edit[:new][:typ] = params[:typ] if params[:typ]\n @edit[:new][:script] = params[:script_data] if params[:script_data]\n @edit[:new][:script] = @edit[:new][:script] + \"...\" if !params[:name] && !params[:description] && !params[:img_typ] && !params[:script_data] && !params[:typ]\n end",
"title": ""
},
{
"docid": "5d5b1af58967ccc5329076e79ea772ed",
"score": "0.5829894",
"text": "def project_setup_form\n\t\tproject_id = params[:project_id]\n\t\t@project = Project.find(project_id)\n\t\t@template_id = params[:bank_id]\n\n\t\t# get information about the key questions in the project\n\t\t@key_questions = KeyQuestion.where(:project_id=>project_id).all\n\t\tavailable_question_info = ExtractionForm.get_available_questions(project_id,nil)\n\t\t@available_questions = available_question_info[0]\n\t\t@assigned_questions = available_question_info[1]\t\n\t\t@no_more_extraction_forms = @project.all_key_questions_accounted_for\n\n\t\t# in the view, change the modal html to be a form to update the title and assign \n\t\t# key questions to the form after it is copied over.\n\tend",
"title": ""
},
{
"docid": "c68874eebd8387d014ad8b481f0f61b8",
"score": "0.58296233",
"text": "def capture_form\n errors = []\n \n mem = @data.mem\n\n values = Hash.new(\"\")\n\n mem.add_to_hash(values)\n @cgi.keys.each {|k| values[k] = @cgi[k]}\n\n mem.mem_name = values['mem_name']\n mem.mem_schoolname = values['mem_schoolname']\n mem.mem_district = values['mem_district']\n\n mem.mem_type = values['mem_type']\n\n if mem.mem_name.empty?\n errors << \"The passport name cannot be empty\"\n end\n\n\n if mem.mem_schoolname.empty?\n errors << \"The school name cannot be empty\"\n end\n\n if mem.mem_district.empty?\n errors << \"The school district cannot be empty\"\n end\n\n\n \n email = values['creator_email']\n\n if email != @data.creator_email\n @data.creator_email = email\n\n if email.empty?\n errors << \"Must specify a TeamPak creator\"\n end\n \n user = User.with_email(email)\n unless user\n errors << \"TeamPak creator must be an existing user\"\n else\n mem.creator = user\n @data.creator_name = user.contact.con_name\n end\n end\n\n email = values['con_email']\n\n unless email.empty?\n msg = Mailer.invalid_email_address?(email)\n errors << msg if msg \n end\n\n res = @data.mem.set_admin_from_email(email)\n errors << res if res\n\n\n 99.times do |i|\n qty_key = \"prd_qty_\" + i.to_s\n id_key = \"prd_id_\" + i.to_s\n break unless values.has_key?(qty_key)\n qty = values[qty_key]\n qty = '0' if qty.empty?\n errors << \"Invalid quantity '#{qty}'\" unless qty =~ /^\\d+$/\n prd_id = values[id_key].to_i\n @data.product_qty[prd_id] = qty.to_i\n end\n\n errors\n end",
"title": ""
},
{
"docid": "6202aee254ea117ff0e39be3778aab0a",
"score": "0.5822379",
"text": "def form_setup\n\tend",
"title": ""
},
{
"docid": "0d4930bbf3835c8d748e94f8fe3aa1ac",
"score": "0.5822027",
"text": "def ready_form(post, showing_tags = '')\n @form = PostDecorator.option_form(post, showing_tags)\n @tags = TagService.name_and_attached_count\n end",
"title": ""
},
{
"docid": "eba4fa1319b2ff058b49cc80749bc36e",
"score": "0.5813141",
"text": "def data_form_params\n params.fetch(:data_form, {})\n end",
"title": ""
},
{
"docid": "c620edd20dcf808cecdeb85add17ae2f",
"score": "0.5804638",
"text": "def get_form_vars\n @ae_class = MiqAeClass.find_by(:id => @edit[:ae_class_id])\n # for class add tab\n @edit[:new][:name] = params[:name].presence if params[:name]\n @edit[:new][:description] = params[:description].presence if params[:description]\n @edit[:new][:display_name] = params[:display_name].presence if params[:display_name]\n @edit[:new][:namespace] = params[:namespace] if params[:namespace]\n @edit[:new][:inherits] = params[:inherits_from] if params[:inherits_from]\n\n # for class edit tab\n @edit[:new][:name] = params[:cls_name].presence if params[:cls_name]\n @edit[:new][:description] = params[:cls_description].presence if params[:cls_description]\n @edit[:new][:display_name] = params[:cls_display_name].presence if params[:cls_display_name]\n @edit[:new][:namespace] = params[:cls_namespace] if params[:cls_namespace]\n @edit[:new][:inherits] = params[:cls_inherits_from] if params[:cls_inherits_from]\n end",
"title": ""
},
{
"docid": "e85d043e6b9901df1074a36e76c22e91",
"score": "0.5754984",
"text": "def init\n @coi_form = BlanketCoiForm.new\n @coi_form.user_d = @user.id\n\n # They may have already filled out a COI form\n if @existing_coi_form = BlanketCoiForm.find(:first, :conditions=>{:user_id=>@user.id}, :order=>'version DESC')\n \n # They haven't finished their last form, redirect to edit that one\n if ! @existing_coi_form.committed\n redirect_to :action => 'edit', :id=>@existing_coi_form.id\n return\n \n # This is a new version of the same form, populate with the old form's data, and increment the version\n else\n @coi_form = @existing_coi_form.create_an_update\n end\n end\n \n if @coi_form.save\n render :action => \"edit\", :id=>@coi_form.id\n else\n flash[:notice] = \"There was a problem creating your COI form.\"\n redirect_to :controller=>'home', :action=>\"error\"\n end\n end",
"title": ""
},
{
"docid": "99b255e88320156bb5f414c4816ebf82",
"score": "0.5752776",
"text": "def defaultForm; @forms[@defaultFormName]; end",
"title": ""
},
{
"docid": "45efe10cb1810a2c76461d1ed2a7c25a",
"score": "0.574683",
"text": "def emit_form(title, prev_data)\n _whimsy_panel(title, style: 'panel-success') do\n _form.form_horizontal method: 'post' do\n _whimsy_forms_subhead(label: 'Example Form Section')\n field = 'text1'\n _whimsy_forms_input(label: 'Example Text Field', name: field, id: field,\n value: prev_data[field], helptext: 'Enter some text, keep it polite!'\n )\n field = 'listbox'\n _whimsy_forms_select(label: 'Select Some Values', name: field,\n multiple: true, values: prev_data[field],\n options: ['another value', 'yet another value'],\n icon: 'glyphicon-time', iconlabel: 'clock',\n helptext: 'Select as many values as ya like!'\n )\n field = 'text2'\n _whimsy_forms_input(label: 'A multi-line Text Field', name: field, id: field, rows: 10,\n value: prev_data[field], helptext: 'Pretty boring form example, huh?'\n )\n _whimsy_forms_submit(value: 'PUSH ME!')\n end\n end\nend",
"title": ""
},
{
"docid": "111363400faba95e12687c4c614b49ec",
"score": "0.5746505",
"text": "def build_form(form_builder, options)\n set_value_in_hash options\n self.class.create_load_form helper: self,\n file: options[:value].presence,\n input_name: form_builder.object_name + '[value]',\n widget_id: form_builder_name_to_id(form_builder, '[value]'),\n with_desc: options[:with_desc]\n end",
"title": ""
},
{
"docid": "e2998c1905cd6bb84ea2c88d0992dbb0",
"score": "0.57399267",
"text": "def pre_form\n\n end",
"title": ""
},
{
"docid": "69fbf188825e04f799326aa9f44b9266",
"score": "0.5736011",
"text": "def iso_datastore_set_form_vars\n @edit = {}\n @edit[:emses] = ExtManagementSystem.order(:name).supporting(:create_iso_datastore)\n end",
"title": ""
},
{
"docid": "13cc55742e33ba99e3e0ea83a472d934",
"score": "0.57356644",
"text": "def get_form_parameters\n \t {}\n end",
"title": ""
},
{
"docid": "59d7229964c226093e57b2e761c50639",
"score": "0.5716316",
"text": "def fill_form project=Project.all.sample, page=current_page, form=contact_form, sender=Sender.new(generate: @@dictionary_locale.upcase)\n fill_hash = form_fields form\n\n session.visit form.page.uri.to_s\n\n name = fill_hash[:last_name].present? ? sender.name.split(' ') : [sender.name]\n email = sender.email\n\n temp_page = page.is_a?(Page) ? page : Page.find_by(uri: page.uri.to_s)\n message_text = project.messages.reload.sample.try(:sanitize, sender, temp_page.recollection_pages.sample, js: true).try(:text)\n\n # Fill name and lastname\n if @@dynamic_fill\n fill_field :name, name.first, fill_hash if fill_hash[:name].present?\n fill_field :last_name, name.last, fill_hash if fill_hash[:last_name].present?\n fill_field :email, email, fill_hash if fill_hash[:email].present?\n fill_field :phone, Sender.mobile_number(country: @@dictionary_locale), fill_hash if fill_hash[:phone].present? \n begin\n fill_field :message, message_text, fill_hash if fill_hash[:message].present?\n rescue StandardError => e\n if e.message.include?('unterminated string literal')\n fill_field :message, message_text.gsub(\"\\n\", '\\n'), fill_hash if fill_hash[:message].present?\n else\n raise 'Message can\\'t fill'\n end\n end\n begin\n form.radiobuttons.group_by{|t| t['name']}.each {|key,value| session.choose value.first.text || value.first.name }\n rescue StandardError => e\n raise 'Radio buttons can\\'t fill'\n end\n else\n session.fill_in dictionary_fields['name'].try(:first), with: name.first+' '+name.last\n session.fill_in dictionary_fields['email'].try(:first), with: email\n session.fill_in dictionary_fields['phone'].try(:first), with: Sender.mobile_number(country: @@dictionary_locale)\n session.fill_in dictionary_fields['message'].try(:first), with: message_text\n end\n\n send_button = find_submit form\n sleep 3\n session.click_button send_button.value || send_button.name\n sleep 5\n end",
"title": ""
},
{
"docid": "7aad19665e130556cb262155dffa395b",
"score": "0.5689921",
"text": "def create\n @form = Form.new(params[:form])\n # Do not let the users specify the User ID. it can show them others forms.\n @form.user_id = @user.id # specify the user id in the form yourself. \n respond_to do |format|\n if @form.save\n # create dependent forms based on this form.\n create_sub_forms(@form) \n set_session_forms_id(@form) #save the form id in session\n @pinfo = @form.personal_info\n format.html {redirect_to :controller=>'personal_infos', :action=>'edit', :id => @pinfo.id}\n format.xml { head :ok } \n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @form.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c233dcd01246dc1cd3995c3e00b9af04",
"score": "0.5685848",
"text": "def old_dialogs_set_form_vars\n @edit = {}\n @edit[:dialog] = @dialog\n\n @edit[:new] = {}\n @edit[:current] = {}\n @edit[:key] = \"dialog_edit__#{@dialog.id || \"new\"}\"\n\n @edit[:new][:name] = @dialog.name\n @edit[:new][:description] = @dialog.description\n @edit[:new][:dialog_type] = if @dialog.dialog_type\n @dialog.dialog_type\n else\n # if new customization dialogs, check if add button was pressed form folder level, to auto select image type\n x_node == \"root\" ? @dialog.dialog_type : x_node.split('_')[1]\n end\n\n @edit[:new][:content] = @dialog.content.to_yaml\n @edit[:current] = copy_hash(@edit[:new])\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "3b53df70d8763d842eeffabb24cbf6ad",
"score": "0.56788296",
"text": "def page1_options(data)\n base_form = 'form1[0].#subform[0]'\n {\n # Veteran\n \"#{base_form}.VeteransLastName[0]\": data.dig('veteran', 'lastName'),\n \"#{base_form}.VeteransFirstName[0]\": data.dig('veteran', 'firstName'),\n \"#{base_form}.TelephoneNumber_IncludeAreaCode[0]\": \"#{data.dig('veteran', 'phone', 'areaCode')} #{data.dig('veteran', 'phone', 'phoneNumber')}\",\n \"#{base_form}.SocialSecurityNumber_FirstThreeNumbers[0]\": data.dig('veteran', 'ssn')[0..2],\n \"#{base_form}.SocialSecurityNumber_SecondTwoNumbers[0]\": data.dig('veteran', 'ssn')[3..4],\n \"#{base_form}.SocialSecurityNumber_LastFourNumbers[0]\": data.dig('veteran', 'ssn')[5..8],\n \"#{base_form}.DOBmonth[0]\": data.dig('veteran', 'birthdate').split('-').second,\n \"#{base_form}.DOBday[0]\": data.dig('veteran', 'birthdate').split('-').last.first(2),\n \"#{base_form}.DOByear[0]\": data.dig('veteran', 'birthdate').split('-').first,\n \"#{base_form}.Veterans_MailingAddress_NumberAndStreet[0]\": data.dig('veteran', 'address', 'numberAndStreet'),\n \"#{base_form}.MailingAddress_ApartmentOrUnitNumber[1]\": data.dig('veteran', 'address', 'aptUnitNumber'),\n \"#{base_form}.MailingAddress_City[1]\": data.dig('veteran', 'address', 'city'),\n \"#{base_form}.MailingAddress_StateOrProvince[1]\": data.dig('veteran', 'address', 'state'),\n \"#{base_form}.MailingAddress_Country[1]\": data.dig('veteran', 'address', 'country'),\n \"#{base_form}.MailingAddress_ZIPOrPostalCode_FirstFiveNumbers[1]\": data.dig('veteran', 'address', 'zipFirstFive'),\n \"#{base_form}.MailingAddress_ZIPOrPostalCode_ZIPOrPostalCode_LastFourNumbers[1]\": data.dig('veteran', 'address', 'zipLastFour'),\n\n # Service Branch\n \"#{base_form}.ARMYCheckbox1[0]\": (data.dig('veteran', 'serviceBranch') == 'ARMY' ? 1 : 0),\n \"#{base_form}.NAVYCheckbox2[0]\": (data.dig('veteran', 'serviceBranch') == 'NAVY' ? 1 : 0),\n \"#{base_form}.AIR_FORCECheckbox3[0]\": (data.dig('veteran', 'serviceBranch') == 'AIR FORCE' ? 1 : 0),\n \"#{base_form}.MARINE_CORPSCheckbox4[0]\": (data.dig('veteran', 'serviceBranch') == 'MARINE CORPS' ? 1 : 0),\n \"#{base_form}.COAST_GUARDCheckbox5[0]\": (data.dig('veteran', 'serviceBranch') == 'COAST GUARD' ? 1 : 0),\n \"#{base_form}.SPACE_FORCECheckbox3[0]\": (data.dig('veteran', 'serviceBranch') == 'SPACE FORCE' ? 1 : 0),\n \"#{base_form}.OTHER_Checkbox6[0]\": (data.dig('veteran', 'serviceBranch') == 'OTHER' ? 1 : 0),\n \"#{base_form}.JF15[0]\": data.dig('veteran', 'serviceBranchOther'),\n\n # Claimant\n \"#{base_form}.Claimants_First_Name[0]\": data.dig('claimant', 'firstName'),\n \"#{base_form}.Claimants_Last_Name[0]\": data.dig('claimant', 'lastName'),\n \"#{base_form}.Claimants_Middle_Initial1[0]\": data.dig('claimant', 'middleInitial'),\n \"#{base_form}.MailingAddress_NumberAndStreet[0]\": data.dig('claimant', 'address', 'numberAndStreet'),\n \"#{base_form}.MailingAddress_ApartmentOrUnitNumber[0]\": data.dig('claimant', 'address', 'aptUnitNumber'),\n \"#{base_form}.MailingAddress_City[0]\": data.dig('claimant', 'address', 'city'),\n \"#{base_form}.MailingAddress_StateOrProvince[0]\": data.dig('claimant', 'address', 'state'),\n \"#{base_form}.MailingAddress_Country[0]\": data.dig('claimant', 'address', 'country'),\n \"#{base_form}.MailingAddress_ZIPOrPostalCode_FirstFiveNumbers[0]\": data.dig('claimant', 'address', 'zipFirstFive'),\n \"#{base_form}.MailingAddress_ZIPOrPostalCode_ZIPOrPostalCode_LastFourNumbers[0]\": data.dig('address', 'zipLastFour'),\n \"#{base_form}.TelephoneNumber_IncludeAreaCode[1]\": \"#{data.dig('claimant', 'phone', 'areaCode')} #{data.dig('claimant', 'phone', 'phoneNumber')}\",\n \"#{base_form}.EmailAddress_Optional[1]\": data.dig('claimant', 'email'),\n \"#{base_form}.RelationshipToVeteran[0]\": data.dig('claimant', 'relationship'),\n\n \"#{base_form}.NAME_OF_INDIVIDUAL_APPOINTED_AS_REPRESENTATIVE[0]\": \"#{data.dig('serviceOrganization', 'firstName')} #{data.dig('serviceOrganization', 'lastName')}\",\n \"#{base_form}.Checkbox3[0]\": 1,\n \"#{base_form}.ADDRESSOFINDIVIDUALAPPOINTEDASCLAIMANTSREPRESENTATATIVE[0]\": stringify_address(data.dig('serviceOrganization', 'address')),\n \"#{base_form}.SpecifyOrganization[0]\": data.dig('serviceOrganization', 'organizationName'),\n\n \"#{base_form}.Date_Of_Signature[0]\": I18n.l(Time.zone.now.to_date, format: :va_form),\n \"#{base_form}.Date_Of_Signature[1]\": I18n.l(Time.zone.now.to_date, format: :va_form)\n }\n end",
"title": ""
},
{
"docid": "a7c93859447254385e4fcc8fc0b6e4ab",
"score": "0.567733",
"text": "def form\n @form ||= OpenStruct.new\n end",
"title": ""
},
{
"docid": "be8af2a644737b7311eb42e5202153e5",
"score": "0.5673581",
"text": "def set_edit_form_information\n @information[:form_url] = budget_path(@budget)\n @information[:subtitle] = t('view.budgets.edit_title', budget_number: @budget.number)\n @information[:button_text] = t('view.budgets.save')\n @information[:back_path] = @budget\n end",
"title": ""
},
{
"docid": "d74f05744991fd30ed1c55490e0bec4b",
"score": "0.5670498",
"text": "def form\n @form_hash ||= JSON.parse(form_json)\n end",
"title": ""
},
{
"docid": "d0a9951dd84d6114f2143e1d7ca0b83e",
"score": "0.56691575",
"text": "def zone_set_form_vars\n @edit = {}\n @edit[:zone_id] = @zone.id\n @edit[:new] = {}\n @edit[:current] = {}\n @edit[:key] = \"zone_edit__#{@zone.id || \"new\"}\"\n\n @edit[:new][:name] = @zone.name\n @edit[:new][:description] = @zone.description\n @edit[:new][:proxy_server_ip] = @zone.settings ? @zone.settings[:proxy_server_ip] : nil\n @edit[:new][:concurrent_vm_scans] = @zone.settings ? @zone.settings[:concurrent_vm_scans].to_i : 0\n\n session[:verify_ems_status] = nil\n set_verify_status\n\n @edit[:current] = copy_hash(@edit[:new])\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "9f2b636ebb51ffce6aa1a000b5a41b7f",
"score": "0.56680363",
"text": "def template_set_form_vars\n @edit = {}\n @edit[:ct_id] = @ct.id\n\n @edit[:new] = {}\n @edit[:current] = {}\n @edit[:key] = \"ct_edit__#{@ct.id || \"new\"}\"\n @edit[:rec_id] = @ct.id || nil\n @edit[:pxe_image_types] = PxeImageType.order(:name).collect { |img| [img.name, img.id] }\n @edit[:new][:name] = @ct.name\n @edit[:new][:description] = @ct.description\n @edit[:new][:typ] = @ct.type\n # in case record is being copied\n if @ct.id || @ct.pxe_image_type_id\n @edit[:new][:img_type] = @ct.pxe_image_type.id\n else\n # if new customization template, check if add button was pressed form folder level, to auto select image type\n @edit[:new][:img_type] = x_node == \"T\" ? @ct.pxe_image_type : x_node.split('_')[1]\n end\n\n @edit[:new][:script] = @ct.script || \"\"\n @edit[:current] = copy_hash(@edit[:new])\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "3f9b067131632a3583823c023a9ea170",
"score": "0.5660821",
"text": "def form_fields\n fields.merge('TradeInfo' => trade_info, 'TradeSha' => trade_sha)\n end",
"title": ""
},
{
"docid": "b5b699f9c0408709a59dfc8c09105b94",
"score": "0.56581974",
"text": "def fill_form_with(attributes)\n fill_title_input_with attributes[\"title\"]\n fill_description_input_with attributes[\"description\"]\n fill_summary_input_with attributes[\"summary\"]\n # fill_youtube_link_with attributes[\"youtube_link\"]\n # fill_category_input_with attributes[:category]\n end",
"title": ""
},
{
"docid": "2d965fed0b96da4d1cd2057b03544dc2",
"score": "0.5646522",
"text": "def fields_get_form_vars\n @ae_class = MiqAeClass.find_by(:id => @edit[:ae_class_id])\n @in_a_form = true\n @in_a_form_fields = true\n if params[:item].blank? && !%w[accept save].include?(params[:button]) && params[\"action\"] != \"field_delete\"\n field_data = session[:field_data]\n new_field = @edit[:new_field]\n\n field_attributes.each do |field|\n field_name = \"field_#{field}\".to_sym\n field_sym = field.to_sym\n if field == \"substitute\"\n field_data[field_sym] = new_field[field_sym] = params[field_name] == \"1\" if params[field_name]\n elsif params[field_name]\n field_data[field_sym] = new_field[field_sym] = params[field_name]\n end\n end\n\n field_data[:default_value] = new_field[:default_value] = params[:field_password_value] if params[:field_password_value]\n new_field[:priority] = 1\n @edit[:new][:fields].each_with_index do |flds, i|\n if i == @edit[:new][:fields].length - 1\n new_field[:priority] = flds['priority'].nil? ? 1 : flds['priority'].to_i + 1\n end\n end\n new_field[:class_id] = @ae_class.id\n\n @edit[:new][:fields].each_with_index do |fld, i|\n field_attributes.each do |field|\n field_name = \"fields_#{field}_#{i}\"\n if field == \"substitute\"\n fld[field] = params[field_name] == \"1\" if params[field_name]\n elsif %w[aetype datatype].include?(field)\n var_name = \"fields_#{field}#{i}\"\n fld[field] = params[var_name.to_sym] if params[var_name.to_sym]\n elsif field == \"default_value\"\n fld[field] = params[field_name] if params[field_name]\n fld[field] = params[\"fields_password_value_#{i}\".to_sym] if params[\"fields_password_value_#{i}\".to_sym]\n elsif params[field_name]\n fld[field] = params[field_name]\n end\n end\n end\n elsif params[:button] == \"accept\"\n if session[:field_data][:name].blank? || session[:field_data][:aetype].blank?\n field = session[:field_data][:name].blank? ? \"Name\" : \"Type\"\n field += \" and Type\" if field == \"Name\" && session[:field_data][:aetype].blank?\n add_flash(_(\"%{field} is required\") % {:field => field}, :error)\n return\n end\n new_fields = {}\n field_attributes.each do |field_attribute|\n new_fields[field_attribute] = @edit[:new_field][field_attribute.to_sym]\n end\n @edit[:new][:fields].push(new_fields)\n @edit[:new_field] = session[:field_data] = {}\n end\n end",
"title": ""
},
{
"docid": "195d8ba76f408b8a6ecefd2fdfb76fd4",
"score": "0.563699",
"text": "def capture_form\n errors = []\n \n values = Hash.new(\"\")\n\n @data.mem.add_to_hash(values)\n @cgi.keys.each {|k| values[k] = @cgi[k]}\n\n# values.keys.sort.each do |k|\n# $stderr.puts \"#{k} => #{values[k].inspect}\"\n# end\n\n\n if values['mem_name'].empty?\n errors << \"The passport name cannot be empty\"\n else\n @data.mem.mem_name = values['mem_name']\n end\n\n\n if values['mem_schoolname'].empty?\n errors << \"The school name cannot be empty\"\n else\n @data.mem.mem_schoolname = values['mem_schoolname']\n end\n\n if values['mem_district'].empty?\n errors << \"The school district cannot be empty\"\n else\n @data.mem.mem_district = values['mem_district']\n end\n\n\n passport = values['mem_passport']\n\n if passport.empty?\n @data.mem.mem_passport = nil\n else\n aff = @data.owner.affiliate\n if passport.length < aff.aff_passport_length\n passport = \"0\"*(aff.aff_passport_length-passport.length) + passport\n end\n\n unless aff.passport_is_valid(passport)\n errors << \"Passport number is not valid \" +\n \"(it must be #{aff.aff_passport_length+3} \" +\n \"digits including the prefix)\"\n end\n unless @data.renewing || aff.passport_is_free(passport)\n errors << \"Sorry, but passport #{passport} is already taken\"\n end\n @data.mem.mem_passport = passport\n end\n\n \n if values['mem_type'].empty?\n errors << \"Specify a membership type (Individual or FivePak)\"\n else\n @data.mem.mem_type = values['mem_type']\n end\n\n 99.times do |i|\n qty_key = \"prd_qty_\" + i.to_s\n id_key = \"prd_id_\" + i.to_s\n break unless values.has_key?(qty_key)\n qty = values[qty_key]\n qty = '0' if qty.empty?\n errors << \"Invalid quantity '#{qty}'\" unless qty =~ /^\\d+$/\n prd_id = values[id_key].to_i\n @data.product_qty[prd_id] = qty\n end\n\n msg = PaymentMethod.from_form(values, @data.payment_option)\n errors << msg if msg\n\n email = values['con_email']\n\n unless email.empty?\n msg = Mailer.invalid_email_address?(email)\n errors << msg if msg \n end\n\n# if errors.empty?\n res = @data.mem.set_admin_from_email(email)\n errors << res if res\n# end\n\n errors\n end",
"title": ""
},
{
"docid": "3bc1942503358b3343a26b131fd11e6a",
"score": "0.563614",
"text": "def ns_set_form_vars\n session[:field_data] = session[:edit] = {}\n @edit = {\n :ae_ns_id => @ae_ns.id,\n :typ => @ae_ns.domain? ? \"MiqAeDomain\" : \"MiqAeNamespace\",\n :key => \"aens_edit__#{@ae_ns.id || \"new\"}\",\n :rec_id => @ae_ns.id || nil\n }\n @edit[:new] = {\n :ns_name => @ae_ns.name,\n :ns_description => @ae_ns.description\n }\n # set these field for a new domain or when existing record is a domain\n @edit[:new][:enabled] = @ae_ns.enabled if @ae_ns.domain?\n @edit[:current] = @edit[:new].dup\n @right_cell_text = ns_right_cell_text\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "d12d16bc3650330461d4ce13f200c4e4",
"score": "0.56265724",
"text": "def set_form_vars\n @edit = {}\n @edit[:rpt_id] = @rpt.id # Save a record id to use it later to look a record\n @edit[:rpt_title] = @rpt.title\n @edit[:rpt_name] = @rpt.name\n @edit[:new] = {}\n @edit[:key] = \"report_edit__#{@rpt.id || \"new\"}\"\n if params[:pressed] == \"miq_report_copy\"\n @edit[:new][:rpt_group] = \"Custom\"\n @edit[:new][:rpt_type] = \"Custom\"\n else\n @edit[:new][:rpt_group] = @rpt.rpt_group\n @edit[:new][:rpt_type] = @rpt.rpt_type\n end\n\n # Get the simple string/number fields\n @edit[:new][:name] = @rpt.name\n @edit[:new][:title] = @rpt.title\n @edit[:new][:model] = @rpt.db\n @edit[:new][:priority] = @rpt.priority\n @edit[:new][:order] = @rpt.order.presence || \"Ascending\"\n\n # @edit[:new][:graph] = @rpt.graph\n # Replaced above line to handle new graph settings Hash\n if @rpt.graph.kind_of?(Hash)\n @edit[:new][:graph_type] = @rpt.graph[:type]\n @edit[:new][:graph_count] = @rpt.graph[:count]\n @edit[:new][:chart_mode] = @rpt.graph[:mode]\n @edit[:new][:chart_column] = @rpt.graph[:column]\n @edit[:new][:graph_other] = @rpt.graph[:other] ? @rpt.graph[:other] : false\n else\n @edit[:new][:graph_type] = @rpt.graph\n @edit[:new][:graph_count] = ReportController::Reports::Editor.chart_top_values\n @edit[:new][:chart_mode] = 'counts'\n @edit[:new][:chart_column] = ''\n @edit[:new][:graph_other] = true\n end\n\n @edit[:new][:dims] = @rpt.dims\n @edit[:new][:categories] = @rpt.categories\n @edit[:new][:categories] ||= []\n\n @edit[:new][:col_options] = @rpt.col_options.presence || {}\n\n # Initialize options\n @edit[:new][:perf_interval] = nil\n @edit[:new][:perf_start] = nil\n @edit[:new][:perf_end] = nil\n @edit[:new][:tz] = nil\n @edit[:new][:perf_trend_db] = nil\n @edit[:new][:perf_trend_col] = nil\n @edit[:new][:perf_limit_col] = nil\n @edit[:new][:perf_limit_val] = nil\n @edit[:new][:perf_target_pct1] = nil\n @edit[:new][:perf_target_pct2] = nil\n @edit[:new][:perf_target_pct3] = nil\n @edit[:new][:cb_interval] = nil\n @edit[:new][:cb_interval_size] = nil\n @edit[:new][:cb_end_interval_offset] = nil\n\n @edit[:cb_cats] = categories_hash\n\n if %i[performance trend].include?(model_report_type(@rpt.db))\n @edit[:new][:perf_interval] = @rpt.db_options[:interval]\n @edit[:new][:perf_avgs] = @rpt.db_options[:calc_avgs_by]\n @edit[:new][:perf_end] = @rpt.db_options[:end_offset].to_s\n @edit[:new][:perf_start] = (@rpt.db_options[:start_offset] - @rpt.db_options[:end_offset]).to_s\n @edit[:new][:tz] = @rpt.tz ? @rpt.tz : session[:user_tz] # Set the timezone, default to user's\n if @rpt.time_profile\n @edit[:new][:time_profile] = @rpt.time_profile_id\n @edit[:new][:time_profile_tz] = @rpt.time_profile.tz\n else\n set_time_profile_vars(selected_time_profile_for_pull_down, @edit[:new])\n end\n @edit[:new][:perf_trend_db] = @rpt.db_options[:trend_db]\n @edit[:new][:perf_trend_col] = @rpt.db_options[:trend_col]\n @edit[:new][:perf_limit_col] = @rpt.db_options[:limit_col]\n @edit[:new][:perf_limit_val] = @rpt.db_options[:limit_val]\n @edit[:new][:perf_target_pct1], @edit[:new][:perf_target_pct2], @edit[:new][:perf_target_pct3] = @rpt.db_options[:target_pcts]\n elsif Chargeback.db_is_chargeback?(@rpt.db)\n @edit[:new][:tz] = @rpt.tz ? @rpt.tz : session[:user_tz] # Set the timezone, default to user's\n options = @rpt.db_options[:options]\n if options.key?(:owner) # Get the owner options\n @edit[:new][:cb_show_typ] = \"owner\"\n @edit[:new][:cb_owner_id] = options[:owner]\n elsif options.key?(:tenant_id) # Get the tenant options\n @edit[:new][:cb_show_typ] = \"tenant\"\n @edit[:new][:cb_tenant_id] = options[:tenant_id]\n elsif options.key?(:tag) # Get the tag options\n @edit[:new][:cb_show_typ] = \"tag\"\n @edit[:new][:cb_tag_cat] = tag_category_from(options[:tag])\n @edit[:new][:cb_tag_value] = tag_values_from(options[:tag])\n @edit[:cb_tags] = entries_hash(@edit[:new][:cb_tag_cat])\n elsif options.key?(:entity_id)\n @edit[:new][:cb_show_typ] = \"entity\"\n @edit[:new][:cb_entity_id] = options[:entity_id]\n @edit[:new][:cb_provider_id] = options[:provider_id]\n end\n\n # @edit[:new][:cb_include_metrics] = nil - it means YES (YES is default value for new and legacy reports)\n @edit[:new][:cb_include_metrics] = options[:include_metrics].nil? || options[:include_metrics]\n @edit[:new][:method_for_allocated_metrics] = options[:method_for_allocated_metrics].try(:to_sym) || default_chargeback_allocated_method\n @edit[:new][:cumulative_rate_calculation] = options[:cumulative_rate_calculation].nil? || options[:cumulative_rate_calculation]\n @edit[:new][:cb_groupby_tag] = options[:groupby_tag] if options.key?(:groupby_tag)\n @edit[:new][:cb_groupby_label] = options[:groupby_label] if options.key?(:groupby_label)\n @edit[:new][:cb_model] = Chargeback.report_cb_model(@rpt.db)\n @edit[:new][:cb_interval] = options[:interval]\n @edit[:new][:cb_interval_size] = options[:interval_size]\n @edit[:new][:cb_end_interval_offset] = options[:end_interval_offset]\n @edit[:new][:cb_groupby] = options[:groupby]\n cb_entities_by_provider if [ChargebackContainerImage, ChargebackContainerProject, MeteringContainerImage, MeteringContainerProject].include?(@rpt.db.safe_constantize)\n end\n\n # Build trend limit cols array\n if model_report_type(@rpt.db) == :trend\n @edit[:limit_cols] = VimPerformanceTrend.trend_limit_cols(@edit[:new][:perf_trend_db], @edit[:new][:perf_trend_col], @edit[:new][:perf_interval])\n end\n\n if %i[performance trend].include?(model_report_type(@rpt.db))\n ensure_perf_interval_defaults\n end\n\n expkey = :record_filter\n @edit[expkey] ||= ApplicationController::Filter::Expression.new\n @edit[expkey][:record_filter] = [] # Store exps in an array\n @edit[expkey][:expression] = {\"???\" => \"???\"} # Set as new exp element\n # Get the conditions MiqExpression\n if @rpt.conditions.kind_of?(MiqExpression)\n @edit[:new][:record_filter] = @rpt.conditions.exp\n @edit[:miq_exp] = true\n elsif @rpt.conditions.nil?\n @edit[:new][:record_filter] = nil\n @edit[:new][:record_filter] = @edit[expkey][:expression] # Copy to new exp\n @edit[:miq_exp] = true\n end\n\n # Get the display_filter MiqExpression\n @edit[:new][:display_filter] = @rpt.display_filter.nil? ? nil : @rpt.display_filter.exp\n expkey = :display_filter\n @edit[expkey] ||= ApplicationController::Filter::Expression.new\n @edit[expkey][:expression] = [] # Store exps in an array\n @edit[expkey][:expression] = {\"???\" => \"???\"} # Set as new exp element\n # Build display filter expression\n @edit[:new][:display_filter] = @edit[expkey][:expression] if @edit[:new][:display_filter].nil? # Copy to new exp\n\n # Get the pdf page size, if present\n @edit[:new][:pdf_page_size] = if @rpt.rpt_options.kind_of?(Hash) && @rpt.rpt_options[:pdf]\n @rpt.rpt_options[:pdf][:page_size] || DEFAULT_PDF_PAGE_SIZE\n else\n DEFAULT_PDF_PAGE_SIZE\n end\n\n # Get the hide details setting, if present\n @edit[:new][:hide_details] = if @rpt.rpt_options.kind_of?(Hash) && @rpt.rpt_options[:summary]\n @rpt.rpt_options[:summary][:hide_detail_rows]\n else\n false\n end\n\n # Get the timeout if present\n @edit[:new][:queue_timeout] = if @rpt.rpt_options.kind_of?(Hash) && @rpt.rpt_options[:queue_timeout]\n @rpt.rpt_options[:queue_timeout]\n end\n\n case @rpt.group\n when \"y\"\n @edit[:new][:group] = \"Yes\"\n when \"c\"\n @edit[:new][:group] = \"Counts\"\n else\n @edit[:new][:group] = \"No\"\n @edit[:new][:row_limit] = @rpt.rpt_options[:row_limit].to_s if @rpt.rpt_options\n end\n\n # build selected fields array from the report record\n @edit[:new][:sortby1] = ReportHelper::NOTHING_STRING # Initialize sortby fields to nothing\n @edit[:new][:sortby2] = ReportHelper::NOTHING_STRING\n @edit[:new][:pivot] = ReportController::PivotOptions.new\n if params[:pressed] == \"miq_report_new\"\n @edit[:new][:fields] = []\n @edit[:new][:categories] = []\n @edit[:new][:headers] = {}\n @edit[:new][:col_formats] = {}\n @edit[:pivot_cols] = {}\n else\n build_selected_fields(@rpt) # Create the field related @edit arrays and hashes\n end\n\n # Rebuild the tag descriptions in the new fields array to match the ones in available fields\n @edit[:new][:fields].each do |nf|\n tag = nf.first.split(':')\n if nf.first.include?(\"Managed :\")\n entry = MiqExpression.reporting_available_fields(@edit[:new][:model], @edit[:new][:perf_interval]).find { |a| a.last == nf.last }\n nf[0] = entry ? entry.first : \"#{tag.last.strip} (Category not found)\"\n end\n end\n\n @edit[:current] = %w[copy new].include?(params[:action]) ? {} : copy_hash(@edit[:new])\n @edit[:new][:name] = \"Copy of #{@rpt.name}\" if params[:pressed] == \"miq_report_copy\"\n\n # For trend reports, check for percent field chosen\n if @rpt.db && @rpt.db == ApplicationController::TREND_MODEL &&\n MiqExpression.reporting_available_fields(@edit[:new][:model], @edit[:new][:perf_interval]).find do |af|\n af.last ==\n @edit[:new][:perf_trend_db] + \"-\" + @edit[:new][:perf_trend_col]\n end.first.include?(\"(%)\")\n @edit[:percent_col] = true\n end\n end",
"title": ""
},
{
"docid": "aae6a8dd6eb13262b5fe252d49d32fc0",
"score": "0.5626301",
"text": "def preinitialize_on_first_load(input_document, server_markers, server_form_array)\n # Unless this method has already been called...\n unless self.class.class_variable_defined?('@@preinitialized')\n\n # Loop over the server markers, get the info_value data, and create\n # context objects for AR System\n @@remedy_contexts = {}\n server_markers.each do |server_marker|\n spit \"Creating context for server #{server_marker}.\" \n my_context = ArsModels::Context.new(\n :server => get_info_value(\n input_document, server_marker + '.hostname'),\n :username => get_info_value(\n input_document, server_marker + '.username'),\n :password => get_info_value(\n input_document, server_marker + '.password'),\n :port => get_info_value(\n input_document, server_marker + '.port'),\n :prognum => get_info_value(\n input_document, server_marker + '.prognum'),\n :authentication => get_info_value(\n input_document, server_marker + '.authentication')\n )\n # The server_marker is the key for accessing the context object.\n @@remedy_contexts[server_marker] = my_context\n end\n\n # Initialize the remedy forms that will be used by this handler.\n # This hash has a key that's the name of the form with a value\n # that's the form object, so at any point you can call it by name.\n # server_marker => { \n # form_name => form_obj,\n # form_name => form_obj,\n # form_name => form_obj\n # }\n @@remedy_forms = {}\n\n server_form_array.each do |form_def|\n form_def.each_pair do |server_marker, form_name|\n\n # Has this form already been initialized?\n if !@@remedy_forms[server_marker].nil? and \\\n !@@remedy_forms[server_marker][form_name].nil?\n spit \"#{form_name} is already initialized. Skipping.\"\n next\n end\n\n spit \"Initializing form #{form_name} on server_marker #{server_marker}\" \n # The key tells us which server the form (value) belongs to.\n form_obj = ArsModels::Form.find(form_name, :context => @@remedy_contexts[server_marker])\n\n # Pack the hash.\n if @@remedy_forms[server_marker].nil?\n @@remedy_forms[server_marker] = {form_name => form_obj}\n else\n @@remedy_forms[server_marker].merge!({form_name => form_obj})\n end\n end\n end\n spit @@remedy_forms.pretty_inspect\n\n # Set a global boolean that indicates we're preinitialized so that \n # this method isn't called twice.\n @@preinitialized = true\n end\n end",
"title": ""
},
{
"docid": "77c0e28230351e75308d16a9ca71dcd6",
"score": "0.562548",
"text": "def initialize(the_instance = nil,the_form = nil,attributes = nil,presentation_name=nil,options = {})\n @cache = RecordCache.new\n @ficache = RecordCache.new if CACHE\n the_instance = FormInstance.new if !the_instance\n @form_instance = the_instance\n \n #TODO this is bogus!!\n #what about adding with_record here? more bogusness\n if the_form.nil?\n the_form = Form.make_form(the_instance.form.to_s)\n end\n \n @form = the_form\n \n if attributes\n set_attributes(attributes,presentation_name,options)\n end\n end",
"title": ""
},
{
"docid": "5e0df3b983d184443617811fcdf50793",
"score": "0.5621016",
"text": "def set_form\n @form = @workflow.form\n end",
"title": ""
},
{
"docid": "7b44678a374b1e4d51d383021ee8eb86",
"score": "0.5619716",
"text": "def zone_set_form_vars\n @edit = {}\n @edit[:zone_id] = @zone.id\n @edit[:new] = {}\n @edit[:current] = {}\n @edit[:key] = \"zone_edit__#{@zone.id || \"new\"}\"\n\n @edit[:new][:name] = @zone.name\n @edit[:new][:description] = @zone.description\n @edit[:new][:proxy_server_ip] = @zone.settings ? @zone.settings[:proxy_server_ip] : nil\n @edit[:new][:concurrent_vm_scans] = @zone.settings ? @zone.settings[:concurrent_vm_scans].to_i : 0\n\n @edit[:new][:userid] = @zone.authentication_userid(:windows_domain)\n @edit[:new][:password] = @zone.authentication_password(:windows_domain)\n @edit[:new][:verify] = @zone.authentication_password(:windows_domain)\n @edit[:new][:ntp] = @zone.settings_for_resource.ntp.to_h\n\n session[:verify_ems_status] = nil\n set_verify_status\n\n @edit[:current] = copy_hash(@edit[:new])\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "0e3aec2d6b294e1ec83377a397e76ac7",
"score": "0.5617406",
"text": "def data\n @field.widget.value_from_formdata(@form.data, @html_name)\n end",
"title": ""
},
{
"docid": "32837257fa56d80b647985cda4cbc38d",
"score": "0.56073904",
"text": "def build_main_form\n add_form_line_text('Hostname: ', :@hostname)\n add_form_line_text('Username: ', :@username)\n add_form_pass_text('Password: ', :@password)\n add_form_pass_text('Root Password: ', :@root_password)\n add_form_line_text('Port: ', :@port)\n\n add_form_line_toggle('Use Sudo', :@sudo)\n add_submit_button('Run Profile') { run_profile }\n end",
"title": ""
},
{
"docid": "975245dc3818b5dec438eff522ae6f03",
"score": "0.56035954",
"text": "def initialize(form)\r\n @form = form\r\n end",
"title": ""
},
{
"docid": "5dd7c19e47f5ec0eca8903f3ba933d1a",
"score": "0.560209",
"text": "def print_form_hash\n update_object!(:component_type, :display_name, :version)\n ret = { \n type: component_type_print_form,\n version: self[:version] || 'master'\n }\n if title = ComponentTitle.title?(self)\n ret.merge!(title: title)\n end \n ret\n end",
"title": ""
},
{
"docid": "7aaf2e90c5c98f58f0b964cf1bdd233d",
"score": "0.5592544",
"text": "def set_form\n @form = SampleForm.build(params.merge(get_form))\n end",
"title": ""
},
{
"docid": "a5e96971b4e8cd8066f3b704c2af19f4",
"score": "0.5588551",
"text": "def prepare_user_forms\n set_hr_forms\n @user_hr_forms_data = if @user.persisted?\n @user.form_data.includes(:custom_form).\n where(custom_form_id: @hr_forms.map(&:id))\n else\n @hr_forms.map(&:form_data).\n map{|i| i.new(creator_user_id: current_user.id)}\n end\n end",
"title": ""
},
{
"docid": "311ce7440b5522de804a129905c571dc",
"score": "0.5588216",
"text": "def form\n @form ||= Form.new(get(\"form/#{all['form_id']}\")).use_api(@api)\n end",
"title": ""
},
{
"docid": "2f406f6a8452b1f928df627bb2bd17d0",
"score": "0.5587627",
"text": "def additional_form_locals\n {}\n end",
"title": ""
},
{
"docid": "2f406f6a8452b1f928df627bb2bd17d0",
"score": "0.5587627",
"text": "def additional_form_locals\n {}\n end",
"title": ""
},
{
"docid": "e605fe6c5481e84c097a6cf74d0d5dbc",
"score": "0.55733156",
"text": "def uhook_asset_form form\n ''\n end",
"title": ""
},
{
"docid": "4c5ddadeffb8658af85b4d31d78c26f0",
"score": "0.55615973",
"text": "def form; end",
"title": ""
},
{
"docid": "ec0135c0925b5c86d8f0112487d59d8e",
"score": "0.5559209",
"text": "def template_get_form_vars\n @ct = @edit[:ct_id] ? CustomizationTemplate.find(@edit[:ct_id]) : CustomizationTemplate.new\n copy_params_if_present(@edit[:new], params, %i[name description typ])\n @edit[:new][:img_type] = params[:img_typ] if params[:img_typ]\n @edit[:new][:script] = params[:script_data] if params[:script_data]\n @edit[:new][:script] = @edit[:new][:script] + \"...\" if !params[:name] && !params[:description] && !params[:img_typ] && !params[:script_data] && !params[:typ]\n end",
"title": ""
},
{
"docid": "94970e027ad49e20f7c26792c90d9906",
"score": "0.5545826",
"text": "def prefill(user)\n @identity_information = initialize_identity_information(user)\n @contact_information = initialize_contact_information(user)\n @military_information = initialize_military_information(user)\n mappings = self.class.mappings_for_form(form_id)\n form_data = generate_prefill(mappings)\n { form_data: form_data, metadata: metadata }\n end",
"title": ""
},
{
"docid": "52680b432a52c29f5a19986df9fa8bb2",
"score": "0.5541812",
"text": "def process_form(formdata: {})\n # Example that uses SVN to update an existing file: members/mentor-update.cgi\n _p class: 'system' do\n _ 'If this were a real process_form() it would do something with your data:'\n _br\n formdata.each do |k,v|\n _ \"#{k} = #{v.inspect}\"\n _br\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "f3b5c9293f0cba5f23a21f38728dc642",
"score": "0.5536238",
"text": "def common_edit_form_hash(extras = {})\n res = extras.dup\n\n res[:remote] = true\n res[:html] ||= {}\n res[:html].merge!(\n 'data-result-target' => \"##{hyphenated_name}-#{@master&.id}-#{@id}, \" \\\n \"[form-res-id='#{hyphenated_name}-#{@master&.id}-#{@id}']\",\n 'data-template' => \"#{hyphenated_name}-result-template\"\n )\n res\n end",
"title": ""
},
{
"docid": "a61343c2b8663bcb84dda81d5944919c",
"score": "0.55338246",
"text": "def complete_info_form(data)\n enter_reference_number data\n enter_normal_location data\n enter_current_location data\n enter_location_date data\n end",
"title": ""
},
{
"docid": "328d13e0f2892411f9c30270bf85c62d",
"score": "0.5531368",
"text": "def initialize(form)\n @form = form\n end",
"title": ""
},
{
"docid": "96d0ff966762fb38e2c829ab02842dc1",
"score": "0.5527251",
"text": "def dc_fields_for_form()\n html, tabs, tdata = '',[], ''\n# Only fields defined \n if (fields = @form['form']['fields'])\n html << \"<div id='data_fields' \" + (@form['form']['height'] ? \"style=\\\"height: #{@form['form']['height']}px;\\\">\" : '>') \n html << dc_fields_for_tab(fields) + '</div>'\n else\n# there are multiple tabs on form \n first = true # first tab \n @form['form']['tabs'].keys.sort.each do |tabname|\n next if tabname.match('actions')\n# Tricky. If field name is not on the tab skip to next tab\n if params[:edit_only]\n is_on_tab = false\n @form['form']['tabs'][tabname].each {|k,v| is_on_tab = true if params[:edit_only] == v['name'] }\n next unless is_on_tab\n end\n# first div is displayed all other are hidden \n tdata << \"<div id='data_#{tabname}'\"\n tdata << ' class=\"div-hidden\"' unless first\n tdata << \" style=\\\"height: #{@form['form']['height']}px;\\\"\" if @form['form']['height']\n tdata << \">#{dc_fields_for_tab(@form['form']['tabs'][tabname])}</div>\"\n tabs << tabname\n first = false \n end\n# make it all work together\n html << '<ul class=\"dc-form-ul\" >'\n first = true # first tab must be selected\n tabs.each do |tab| \n html << \"<li id='li_#{tab}' data-div='#{tab}' class='dc-form-li #{'dc-form-li-selected' if first }'>#{t_name(tab, tab)}</li>\" \n first = false\n end\n html << '</ul>'\n html << tdata\n end\n # add last_updated_at hidden field so controller can check if record was updated in during editing\n html << hidden_field(nil, :last_updated_at, value: @record.updated_at.to_i) if @record.respond_to?(:updated_at)\n # add form time stamp to prevent double form submit\n html << hidden_field(nil, :form_time_stamp, value: Time.now.to_i)\n html.html_safe\nend",
"title": ""
},
{
"docid": "c8f3626eb4de0f8675bc2940a55600bc",
"score": "0.5526596",
"text": "def merge_form_data(form_data)\n merged_data = form_data.with_indifferent_access\n # merge in existing information about AnnData file, using form data first if present\n anndata_info_attributes = form_data[:ann_data_file_info_attributes] || attributes.with_indifferent_access\n\n # only check/update refererence_anndata_file attribute if this is a new AnnData upload\n if new_record?\n # check value of :reference_anndata_file which is passed as a string\n # it is not present in 'classic mode' so the absence of it means this is a reference upload\n reference_file = merged_data[:reference_anndata_file].nil? ? true : merged_data[:reference_anndata_file] == 'true'\n anndata_info_attributes[:reference_file] = reference_file\n merged_data.delete(:reference_anndata_file)\n end\n fragments = []\n DATA_TYPE_FORM_KEYS.each do |key, form_segment_name|\n fragment_form = merged_data[form_segment_name]\n next if fragment_form.blank? || fragment_form.empty?\n\n case key\n when :metadata\n merged_data[:use_metadata_convention] = fragment_form[:use_metadata_convention]\n when :cluster\n fragments << extract_form_fragment(\n fragment_form, key,\n :_id, :name, :description, :obsm_key_name, :x_axis_label, :y_axis_label, :x_axis_min, :x_axis_max,\n :y_axis_min, :y_axis_max, :z_axis_min, :z_axis_max, :spatial_cluster_associations\n )\n when :expression\n merged_data[:taxon_id] = fragment_form[:taxon_id]\n merged_exp_fragment = fragment_form.merge(expression_file_info: merged_data[:expression_file_info_attributes])\n fragments << extract_form_fragment(\n merged_exp_fragment, key, :_id, :description, :y_axis_label, :taxon_id, :expression_file_info\n )\n end\n # remove from form data once processed to allow normal save of nested form data\n merged_data.delete(form_segment_name)\n end\n merged_data[:ann_data_file_info_attributes] = merge_form_fragments(anndata_info_attributes, fragments)\n merged_data\n end",
"title": ""
},
{
"docid": "286c9bac2c225374732b4530a797d8b0",
"score": "0.5525406",
"text": "def init_forms\n super\n\n ### DATE AND TIME ###\n fo = @fw.add_form(\"datetime\")\n fo.required_notice = false\n\n fi = fo.add_field(\"datetime\", \"datetime\", { \"required\" => true })\n \n @tm = Time.new\n @timezones = [[\"UTC/GMT\", \"Etc/UTC\"]]\n tzs = `cat /usr/share/zoneinfo/zone.tab | grep -v ^# | cut -f 3 | sort`.split(\"\\n\")\n @timezones += tzs.zip(tzs)\n @fw.forms[\"datetime\"].fields[\"datetime\"].value = \n { \"year\" => @tm.year, \"month\" => @tm.month, \"day\" => @tm.day,\n \"hour\" => @tm.hour, \"min\" => @tm.min, \"sec\" => @tm.sec,\n \"timezone\" => `cat /etc/timezone`.strip }\n end",
"title": ""
},
{
"docid": "e37875b8ffc7eb3004e67e9f5d57479f",
"score": "0.55244607",
"text": "def lt_map_set_form_vars\n @edit = {}\n @edit[:lt_map] = @lt_map\n @edit[:new] = {}\n @edit[:key] = \"label_tag_mapping_edit__#{@lt_map.id || \"new\"}\"\n @edit[:new][:entity] = @lt_map.labeled_resource_type\n @edit[:new][:label_name] = @lt_map.label_name\n @edit[:new][:category] = @lt_map.tag.classification.description\n @edit[:current] = copy_hash(@edit[:new])\n @edit[:new][:options] = entity_options\n session[:edit] = @edit\n end",
"title": ""
},
{
"docid": "6f359b1b8af6efe3cfa22336afeb4c24",
"score": "0.5523649",
"text": "def build_ingest_form\n @form = Metadata::Ingest::Form.new\n @form.internal_groups = @asset_map.keys.collect {|key| key.to_s}\n @form.association_class = OregonDigital::Metadata::Association\n end",
"title": ""
},
{
"docid": "5a5aed3d086fb893a1279e36be6cf26f",
"score": "0.5514584",
"text": "def req_post_form\n\n end",
"title": ""
},
{
"docid": "5a5aed3d086fb893a1279e36be6cf26f",
"score": "0.5514584",
"text": "def req_post_form\n\n end",
"title": ""
},
{
"docid": "2d0d374d88dd9f20cdbdb3a7b64c5a06",
"score": "0.5510616",
"text": "def set_method_form_vars\n session[:field_data] = {}\n @ae_class = ae_class_for_instance_or_method(@ae_method)\n @edit = {}\n session[:edit] = {}\n @edit[:ae_method_id] = @ae_method.id\n @edit[:fields_to_delete] = []\n @edit[:new] = {}\n @edit[:new_field] = {}\n @edit[:ae_class_id] = @ae_class.id\n @edit[:rec_id] = @ae_method.id || nil\n @edit[:key] = \"aemethod_edit__#{@ae_method.id || \"new\"}\"\n @sb[:squash_state] ||= true\n\n @edit[:new][:name] = @ae_method.name\n @edit[:new][:display_name] = @ae_method.display_name\n @edit[:new][:scope] = \"instance\"\n @edit[:new][:language] = \"ruby\"\n @edit[:new][:available_expression_objects] = MiqAeMethod.available_expression_objects.sort\n @edit[:new][:location] = @ae_method.location\n if @edit[:new][:location] == \"expression\"\n expr_hash = @ae_method.data_for_expression\n if expr_hash[:db] && expr_hash[:expression]\n @edit[:new][:expression] = expr_hash[:expression]\n expression_setup(expr_hash[:db])\n end\n else\n @edit[:new][:data] = @ae_method.data.to_s\n end\n @edit[:new][:data] = @ae_method.data.to_s\n @edit[:default_verify_status] = @edit[:new][:location] == \"inline\" && @edit[:new][:data] && @edit[:new][:data] != \"\"\n @edit[:new][:fields] = @ae_method.inputs.collect do |input|\n method_input_column_names.each_with_object({}) do |column, hash|\n hash[column] = input.send(column)\n end\n end\n @edit[:new][:available_datatypes] = MiqAeField.available_datatypes_for_ui\n @edit[:new][:embedded_methods] = @ae_method.embedded_methods\n @edit[:current] = copy_hash(@edit[:new])\n @right_cell_text = if @edit[:rec_id].nil?\n _(\"Adding a new Automate Method\")\n else\n _(\"Editing Automate Method \\\"%{name}\\\"\") % {:name => @ae_method.name}\n end\n session[:log_depot_default_verify_status] = false\n session[:edit] = @edit\n session[:changed] = @changed = false\n end",
"title": ""
},
{
"docid": "eb43ccde845918897e42a4b0db01a928",
"score": "0.5507934",
"text": "def old_dialogs_get_form_vars\n @dialog = @edit[:dialog]\n @edit[:new][:name] = CGI.unescape(params[:name]) if params[:name]\n @edit[:new][:description] = CGI.unescape(params[:description]) if params[:description]\n @edit[:new][:dialog_type] = CGI.unescape(params[:dialog_type]) if params[:dialog_type]\n @edit[:new][:content] = params[:content_data] if params[:content_data]\n @edit[:new][:content] = @edit[:new][:content] + \"...\" if !params[:name] && !params[:description] && !params[:dialog_type] && !params[:content_data]\n end",
"title": ""
},
{
"docid": "1eb8492caee58f0ab406dc6e29324692",
"score": "0.5505277",
"text": "def prefill(user)\n @identity_information = initialize_identity_information(user)\n @contact_information = initialize_contact_information(user)\n mappings = self.class.mappings_for_form(form_id)\n form_data = generate_prefill(mappings)\n { form_data: form_data, metadata: metadata }\n end",
"title": ""
},
{
"docid": "d7ef7c294d161a8099947e6390982851",
"score": "0.5499705",
"text": "def initialize(args)\n self.form_data = args[:form_type].new unless !(args.kind_of? Hash) or args[:form_type].nil?\n args[:form_type] = FormType.find_by_name(args[:form_type].to_s)\n super(args)\n end",
"title": ""
},
{
"docid": "c4a7d8efa24282d44b06a1b9f6b04ec6",
"score": "0.5493248",
"text": "def field_fill_with_values(data)\n fields_on_form.each do |field|\n session[:form_processing] = field['name'] # for debuging\n next if field['type'].nil? || field['readonly']\n\n # return value from form field definition\n value = DrgcmsFormFields.const_get(field['type'].camelize).get_data(params, field['name'])\n value = value.map(&:to_s) if value.class == Array\n # set to nil if blank\n value = nil if value.blank?\n\n keys = field['key'] ? field['key'].split(/\\.|\\,|\\;/) : [field['name']]\n if params[:element].present?\n keys = ['settings', params[:element]] + keys\n end\n\n h = data\n if value.blank?\n # remove field from hash if empty\n keys.each_with_index do |key, i|\n if i + 1 == keys.size\n h.delete(keys.last) if h\n else\n h = h[key]\n end\n break if h.nil?\n end\n # set hash element\n else\n keys.each_with_index do |key, i|\n break if i + 1 == keys.size\n\n h[key] = {} unless h.key?(key)\n h = h[key]\n end\n h[keys.last] = value\n end\n end\nend",
"title": ""
},
{
"docid": "aaebd86d1a733f98cffa849fb55ffbb2",
"score": "0.5491051",
"text": "def build_form(name, slug)\n {\n \"name\" => name,\n \"pages\" => [\n {\n \"elements\" => [\n {\n \"type\" => \"button\",\n \"label\" => \"Submit\",\n \"name\" => \"Submit Button\",\n \"visible\" => true,\n \"enabled\" => true,\n \"renderType\" => \"submit-page\",\n \"renderAttributes\" => {}\n }\n ],\n \"events\" => [],\n \"name\" => \"Page 1\",\n \"renderType\" => \"submittable\",\n \"type\" => \"page\"\n }\n ],\n \"status\" => \"Active\",\n \"slug\" => slug\n }\nend",
"title": ""
}
] |
2e4b1f08ccc71aa5485223c237424d5b
|
PATCH/PUT /disponibilites/1 PATCH/PUT /disponibilites/1.json
|
[
{
"docid": "fd85f41201e233fa695ce0bf8cf6b942",
"score": "0.7074159",
"text": "def update\n respond_to do |format|\n if @disponibilite.update(disponibilite_params)\n format.html { redirect_to @disponibilite, notice: 'Disponibilité bien mise à jour.' }\n format.json { render :show, status: :ok, location: @disponibilite }\n else\n format.html { render :edit }\n format.json { render json: @disponibilite.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "d9989e48c6a20e50a7ba22578f066054",
"score": "0.7366413",
"text": "def update\n @disponibilite = Disponibilite.find(params[:id])\n\n respond_to do |format|\n if @disponibilite.update_attributes(params[:disponibilite])\n format.html { redirect_to @disponibilite, notice: 'Disponibilite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disponibilite.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84d1b01c30f2ee4ebc9450e4fc3cf8ce",
"score": "0.6779706",
"text": "def update\n respond_to do |format|\n if @disponibilidad.update(disponibilidad_params)\n format.html { redirect_to \"/disponibilidads\", notice: 'Disponibilidad actualizada con éxito.' }\n else\n format.html { render :edit }\n format.json { render json: @disponibilidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4021e0e39af148a682c998dc76c404ed",
"score": "0.60697806",
"text": "def set_disponibilite\n @disponibilite = Disponibilite.find(params[:id])\n end",
"title": ""
},
{
"docid": "1b6471536b81582a297c9b47bbf8e7fc",
"score": "0.60485554",
"text": "def set_disponibilidade\n @disponibilidade = Disponibilidade.find(params[:id])\n end",
"title": ""
},
{
"docid": "4c76f923cfd4509d94f010e13b346552",
"score": "0.6046602",
"text": "def update\n @dispensal = Dispensal.find(params[:id])\n\n respond_to do |format|\n if @dispensal.update_attributes(params[:dispensal])\n format.html { redirect_to @dispensal, notice: 'Dispensal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dispensal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "281c7cbca87d465fd7bbdaf38ef1f3e7",
"score": "0.60443205",
"text": "def update\n\t\tauthorize! :update, HorarioDisponible\n respond_to do |format|\n if @horario_disponible.update(horario_disponible_params)\n format.html { redirect_to @horario_disponible, notice: 'Horario disponible fue actualizado satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @horario_disponible }\n else\n format.html { render :edit }\n format.json { render json: @horario_disponible.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "558126448a733e020f4cfe4597ef5174",
"score": "0.6002995",
"text": "def update\n respond_to do |format|\n if @dispensible_generic.update(dispensible_generic_params)\n format.html { redirect_to @dispensible_generic, notice: 'Dispensible generic was successfully updated.' }\n format.json { render :show, status: :ok, location: @dispensible_generic }\n else\n format.html { render :edit }\n format.json { render json: @dispensible_generic.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d48202924e43232911bad2c2f99ad1cd",
"score": "0.5996078",
"text": "def update\n @dispo = Dispo.find(params[:id])\n\n respond_to do |format|\n if @dispo.update_attributes(params[:dispo])\n format.html { redirect_to @dispo, notice: 'Dispo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dispo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d48202924e43232911bad2c2f99ad1cd",
"score": "0.5996078",
"text": "def update\n @dispo = Dispo.find(params[:id])\n\n respond_to do |format|\n if @dispo.update_attributes(params[:dispo])\n format.html { redirect_to @dispo, notice: 'Dispo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dispo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d37b7818364c89709c49b9b242de1c7d",
"score": "0.59889853",
"text": "def update\n @breadcrumb = 'update'\n @complaint_status = ComplaintStatus.find(params[:id])\n @complaint_status.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @complaint_status.update_attributes(params[:complaint_status])\n format.html { redirect_to @complaint_status,\n notice: (crud_notice('updated', @complaint_status) + \"#{undo_link(@complaint_status)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @complaint_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9a6d768bee1ab902d351cda2933f519",
"score": "0.5975516",
"text": "def update\n respond_to do |format|\n if @dispense.update(dispense_params)\n format.html { redirect_to @dispense, notice: 'Dispense was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dispense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1ad05eae82555a545e01dd6214d1ccb0",
"score": "0.59718794",
"text": "def set_disponibilidade\n @disponibilidade = Disponibilidade.find(params[:id])\n end",
"title": ""
},
{
"docid": "1b43604bd409d8c4644421c395d71320",
"score": "0.59685415",
"text": "def update\n\t\t\t\trender json: {}, status: 405\n\t\t\tend",
"title": ""
},
{
"docid": "434984b56cf1e904ddd05e2714867144",
"score": "0.59579986",
"text": "def update\n @displasium = Displasium.find(params[:id])\n\n respond_to do |format|\n if @displasium.update_attributes(params[:displasium])\n format.html { redirect_to @displasium, notice: 'Displasium was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @displasium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "675c6a046d478a1b9ab402519a4d7139",
"score": "0.5955158",
"text": "def update\n @disp = Disp.find(params[:id])\n\n respond_to do |format|\n if @disp.update_attributes(params[:disp])\n format.html { redirect_to client_disps_path(@client), notice: I18n.t(:record_updated) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disp.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93b8a6cf87c7075b0a9369d572877e87",
"score": "0.59547013",
"text": "def update\n respond_to do |format|\n if @credibilidade.update(credibilidade_params)\n format.html { redirect_to @credibilidade, notice: 'Credibilidade was successfully updated.' }\n format.json { render :show, status: :ok, location: @credibilidade }\n else\n format.html { render :edit }\n format.json { render json: @credibilidade.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db280714f42b83990a69be8fef41b8de",
"score": "0.5953861",
"text": "def update\n respond_to do |format|\n if @api_v1_pending.update(api_v1_pending_params)\n format.html { redirect_to @api_v1_pending, notice: 'Pending was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_pending }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_pending.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5bbc2693e33f6bce3eb31defb41aa437",
"score": "0.5948953",
"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": "6d204552315ee10c65455866fc8efa4c",
"score": "0.5936121",
"text": "def update\n invite = current_user.received_invites.find(params[:id])\n raise PermissionViolation unless current_user.updatable_by?(current_user)\n \n case params[:status].downcase\n when 'accepted' then invite.accept!\n when 'ignored' then invite.ignore!\n end\n \n respond_to do |format|\n format.json { render :json => [invite.to_rest] }\n end\n end",
"title": ""
},
{
"docid": "89f702256c471e7b0a5cd705e439866b",
"score": "0.5934498",
"text": "def update\n @resource_waiting_list = Resource::WaitingList.find(params[:id])\n\n respond_to do |format|\n if @resource_waiting_list.update_attributes(params[:resource_waiting_list])\n format.html { redirect_to @resource_waiting_list, notice: 'Waiting list was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @resource_waiting_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b915317bafa3e1970b52fa0da732e07c",
"score": "0.5927996",
"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": "3e41c5b851f3ed245c85c648f089d03f",
"score": "0.59139466",
"text": "def update\n @type_civilites_correspondance = TypeCivilitesCorrespondance.find(params[:id])\n\n respond_to do |format|\n if @type_civilites_correspondance.update_attributes(params[:type_civilites_correspondance])\n format.html { redirect_to(@type_civilites_correspondance, :notice => 'Type civilites correspondance was successfully updated.') }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>@type_civilites_correspondance}}\n \n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @type_civilites_correspondance.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c8cd798a9bfe54a8a79b6b143efa4a2d",
"score": "0.59063095",
"text": "def update\n @extra_disponible = ExtraDisponible.find(params[:id])\n\n respond_to do |format|\n if @extra_disponible.update_attributes(params[:extra_disponible])\n format.html { redirect_to @extra_disponible, notice: 'Extra disponible was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @extra_disponible.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3ed90d1dde078d86f1b11b3ba4a33da",
"score": "0.59037346",
"text": "def update\n @factura = Factura.find(params[:factura_id])\n @renglon_factdetalle = @factura.renglon_factdetalles.find(params[:id])\n\n if (params[:renglon_factdetalle][:impuesto_ids] == nil)\n params[:renglon_factdetalle][:impuesto_ids] = []\n end\n\n respond_to do |format|\n if @renglon_factdetalle.update_attributes(params[:renglon_factdetalle])\n format.html { redirect_to @factura, notice: 'Renglon factdetalle was successfully updated.' }\n format.json { render json: @renglon_factdetalle }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @renglon_factdetalle.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "bb6728e17394e0550f94bddc40152dae",
"score": "0.59035736",
"text": "def update\n respond_to do |format|\n if @dispositon.update(dispositon_params)\n format.html { redirect_to @dispositon, notice: 'Dispositon was successfully updated.' }\n format.json { render :show, status: :ok, location: @dispositon }\n else\n format.html { render :edit }\n format.json { render json: @dispositon.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "193ead6d3429a3a795654bc66122b768",
"score": "0.5894142",
"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": "4fa6d6c67a7b11113aea7d6bbbdfd9e8",
"score": "0.5873482",
"text": "def update\n respond_to do |format|\n if @visite_protocolaire.update(visite_protocolaire_params)\n format.html { redirect_to @visite_protocolaire, notice: 'Visite protocolaire was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @visite_protocolaire.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c66337842235931f96d0440707d02e67",
"score": "0.5871777",
"text": "def update\n respond_to do |format|\n if @collectible.update(collectible_params)\n format.html { redirect_to @collectible, notice: 'Collectible was successfully updated.' }\n format.json { render :show, status: :ok, location: @collectible }\n else\n format.html { render :edit }\n format.json { render json: @collectible.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c66337842235931f96d0440707d02e67",
"score": "0.5871777",
"text": "def update\n respond_to do |format|\n if @collectible.update(collectible_params)\n format.html { redirect_to @collectible, notice: 'Collectible was successfully updated.' }\n format.json { render :show, status: :ok, location: @collectible }\n else\n format.html { render :edit }\n format.json { render json: @collectible.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "efaa320c34ca51fbd501a79d958ccc7b",
"score": "0.58683467",
"text": "def update\n respond_to do |format|\n if @combustivel.update(combustivel_params)\n format.html { redirect_to combustiveis_url, notice: 'Combustível editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @combustivel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb67bf9263bb8e61423df6b9a9cf013e",
"score": "0.58626384",
"text": "def update\n respond_to do |format|\n if @fuel_limit.update(fuel_limit_params)\n\n #for checking - unremark to enable\n #NotificationMailer.notify_email2(@fuel_limit).deliver_now\n\n format.html { redirect_to @fuel_limit, notice: 'Fuel limit was successfully updated.' }\n format.json { render :show, status: :ok, location: @fuel_limit }\n else\n format.html { render :edit }\n format.json { render json: @fuel_limit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "218f1a7d061dc1b3c21c2c0a4d7811b7",
"score": "0.5854524",
"text": "def update\n @aural_fidelity = AuralFidelity.find(params[:id])\n\n respond_to do |format|\n if @aural_fidelity.update_attributes(params[:aural_fidelity])\n format.html { redirect_to @aural_fidelity, notice: 'Aural fidelity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aural_fidelity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c44cd68f433d7e4aa2faf97e22ac317a",
"score": "0.5849795",
"text": "def update\n @requests_devolutions_component = Requests::Devolutions::Component.find(params[:id])\n status_id = params[:requests_devolutions_component][:status_id]\n if status_id == @close_status.id\n if ! @requests_devolutions_component.close\n respond_to do |format|\n format.js { \n @notice = \"No se puede cambiar el estado a \"+@close_status.name+\", probablemente las cantidades sean incoherentes\"\n render action: \"edit\"\n }\n end\n else else_update end\n else else_update end\n end",
"title": ""
},
{
"docid": "e037aa690abad36c9eec81c19354d7c0",
"score": "0.583523",
"text": "def update\n @avail = Avail.find(params[:id])\n\n respond_to do |format|\n if @avail.update_attributes(params[:avail])\n format.html { redirect_to @avail, :notice => 'Avail was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @avail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a78bebe2151637e5ef2e4cdbc4308bf",
"score": "0.5830144",
"text": "def update\n @disposable = Disposable.find(params[:id])\n\n respond_to do |format|\n if @disposable.update_attributes(params[:disposable])\n format.html { redirect_to @disposable, notice: 'Disposable was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disposable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "352f2ec67a98ba202160f1b2b0c2e7ad",
"score": "0.5827481",
"text": "def update\n respond_to do |format|\n if @expense.update_attributes(params[:expense])\n Notifier.became_owner(@expense).deliver if (@expense.owner_id_changed?) and (@expense.owner_id?)\n Notifier.status_changed(@expense).deliver if @expense.expense_status_id_changed?\n \n format.html { redirect_to get_expense_list_path, flash: { success: \"Expense '#{@expense.purpose}' was successfully updated.\" } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d14c238f993a5568c60a6556160c7c70",
"score": "0.5803061",
"text": "def update\n @credibility = Credibility.find(params[:id])\n\n respond_to do |format|\n if @credibility.update_attributes(params[:credibility])\n format.html { redirect_to @credibility, notice: 'Credibility was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @credibility.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44cf21d9c58f83ac3803f9839d6bb50e",
"score": "0.5800425",
"text": "def update\n authorize :resquest_criminal, :update?\n respond_to do |format|\n if @resquest_criminal.update(resquest_criminal_params)\n format.html { redirect_to @resquest_criminal, notice: 'Resquest criminal was successfully updated.' }\n format.json { render :show, status: :ok, location: @resquest_criminal }\n else\n format.html { render :edit }\n format.json { render json: @resquest_criminal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "470369b7ff586fc5881b51a88bb20440",
"score": "0.5800213",
"text": "def update\n authorize! :update, CompetenceType\n @competence_type.update!(competence_type_params)\n render json: {status: :ok}\n end",
"title": ""
},
{
"docid": "79ab38fc7e03b697d9850d8f2453e7de",
"score": "0.57946134",
"text": "def update\n usuarioLogueado = User.find(session[:user_id])\n if usuarioLogueado.manager\n @companies = Company.where(:user_id => usuarioLogueado.id)\n else\n @companies = Company.all\n end\n \n params[:internship][:task_ids] ||= []\n @internship = Internship.find(params[:id])\n @situations = Situation.all\n @types = Type.all\n\n respond_to do |format|\n if @internship.update_attributes(params[:internship])\n format.html { redirect_to @internship, :notice => 'Internship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @internship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c9237641ddfac99c93febe76ffd7294",
"score": "0.57921374",
"text": "def update\n @breadcrumb = 'update'\n @contracting_request_status = ContractingRequestStatus.find(params[:id])\n @contracting_request_status.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @contracting_request_status.update_attributes(params[:contracting_request_status])\n format.html { redirect_to @contracting_request_status,\n notice: (crud_notice('updated', @contracting_request_status) + \"#{undo_link(@contracting_request_status)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contracting_request_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dbab898c9e6038b92d53fd1c965a2872",
"score": "0.5789111",
"text": "def update\n respond_to do |format|\n if @disposisi.update(disposisi_params)\n format.html { redirect_to @disposisi, notice: 'Disposisi was successfully updated.' }\n format.json { render :show, status: :ok, location: @disposisi }\n else\n format.html { render :edit }\n format.json { render json: @disposisi.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "230d4db13462de50791cb626fd7be2da",
"score": "0.5788855",
"text": "def update\n respond_to do |format|\n if @availibility.update(availibility_params)\n format.html { redirect_to @availibility, notice: 'Availibility was successfully updated.' }\n format.json { render :show, status: :ok, location: @availibility }\n else\n format.html { render :edit }\n format.json { render json: @availibility.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4e67bbebe06004980d1d76cdb1cfdee5",
"score": "0.5786478",
"text": "def activo_update\n respond_to do |format|\n activo = params[:plan_paciente][:activo]\n id = params[:id]\n PlanPaciente.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"title": ""
},
{
"docid": "3c3ef5cd3e6093697b493fbe55b93254",
"score": "0.5777585",
"text": "def set_disponibilidad\n @disponibilidad = Disponibilidad.find(params[:id])\n end",
"title": ""
},
{
"docid": "d8bf87dd9917b3125c7c808732e44bc7",
"score": "0.57693017",
"text": "def update\n @presence = Presence.find(params[:id])\n @presence.update_attributes(:presence => params[:status])\n \n respond_to do |format|\n format.js if request.xhr?\n end\n end",
"title": ""
},
{
"docid": "b792e0914be2a8dedf6e3cd581c917ab",
"score": "0.57614565",
"text": "def update\n respond_to do |format|\n if @expense_status.update_attributes(params[:expense_status])\n format.html { redirect_to expense_statuses_path, flash: { success: \"Expense status '#{@expense_status.name}' was successfully updated.\" } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expense_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25de12993c5501529fb375df538b3a10",
"score": "0.57562286",
"text": "def update\n respond_to do |format|\n action_message_for(@corporate_information.content_item.status)\n if update_corporate_information\n format.html { redirect_to redirect_target(@corporate_information), flash: @feedback_flash }\n format.json { render :show, status: :ok, location: @corporate_information }\n else\n @corporate_information.content_item.status = session[:content_item_status]\n format.html { render :edit }\n format.json { render json: @corporate_information.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79caf56a15f3ef0a114141fb5855c8f0",
"score": "0.57553816",
"text": "def update\n respond_to do |format|\n if @complaint.update(complaint_params)\n @complaint.status_id = complaint_params[:status_id]\n format.html { redirect_to @complaint, notice: 'Complaint was successfully updated.' }\n format.json { render :show, status: :ok, location: @complaint }\n else\n format.html { render :edit }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2051b7e19281c134405378b378714a4e",
"score": "0.5750664",
"text": "def update\n @competition = Competition.find(params[:id])\n @competition.send_edit_notification current_user\n respond_to do |format|\n if @competition.update_attributes(params[:competition])\n format.html { redirect_to @competition, :notice => 'Competition was successfully updated.' }\n format.json { respond_with_bip(@competition) }\n else\n format.html { render :action => 'edit' }\n format.json { respond_with_bip(@competition) }\n end\n end\n end",
"title": ""
},
{
"docid": "0643bfb5aa6d0a684ea010f1b7c34ded",
"score": "0.57432353",
"text": "def update\n @breadcrumb = 'update'\n @billable_concept = BillableConcept.find(params[:id])\n @billable_concept.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @billable_concept.update_attributes(params[:billable_concept])\n format.html { redirect_to @billable_concept,\n notice: (crud_notice('updated', @billable_concept) + \"#{undo_link(@billable_concept)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @billable_concept.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "804281f57dcf78c61793eefdf9aa5131",
"score": "0.57399744",
"text": "def update\n @contacter = Contacter.find(params[:id])\n params[:contacter][:available] = true\n\n respond_to do |format|\n if @contacter.update_attributes(params[:contacter])\n format.html { redirect_to(@contacter, :notice => 'Contacter was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contacter.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "68c415d4bcbda613cefb7049d15785a1",
"score": "0.5712095",
"text": "def update\n @firewall = Firewall.find(params[:id])\n checkaccountobject(\"firewalls\",@firewall)\n respond_to do |format|\n if @firewall.update_attributes(params[:firewall])\n @firewall.send_update\n format.html { redirect_to @firewall, notice: 'Firewall was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @firewall.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "030079782b7d89aab855918c703ab10c",
"score": "0.5711512",
"text": "def update\n params[:bonlivraison][:facture_ids] ||= []\n @bonlivraison = Bonlivraison.find(params[:id])\n\n #respond_to do |format|\n if @bonlivraison.update_attributes(params[:bonlivraison])\n flash[:notice] = \"Les modifications concernant ce bon de livraison s'est bien déroulé elle est désormais disponible\"\n # format.html { redirect_to(@bonlivraison, :notice => 'Bonlivraison was successfully updated.') }\n # format.xml { head :ok }\n\t redirect_to :controller=>\"bonlivraisons\", :action=>\"index\", :devi_id=>@bonlivraison.devi_id\n else\n\t flash[:notice] = \"Les modifications concernent ce bon de livraison ne s'est pas déroulé correctement et n'est donc pas disponible\"\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @bonlivraison.errors, :status => :unprocessable_entity }\n \t respond_with(@bonlivraison)\n end\n #end\n end",
"title": ""
},
{
"docid": "a4af375ba3076c6f8bb3417928a6459e",
"score": "0.57048875",
"text": "def update\n @blueprint = Blueprint.find(params[:id])\n\n respond_to do |format|\n if @blueprint.update_attributes(params[:blueprint])\n vision_category=Category.find(:all, :conditions =>[\"vision=1\"])\n calculate_progress(vision_category)\n get_graph_data\n format.html { redirect_to(@blueprint, :notice => 'Blueprint was successfully updated.') }\n format.xml { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @blueprint.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc79724c2e5dbe68f1c274b572c7add1",
"score": "0.57019496",
"text": "def update\n respond_to do |format|\n if @dispatch_call_status.update(dispatch_call_status_params)\n format.html { redirect_to @dispatch_call_status, notice: 'Dispatch call status was successfully updated.' }\n format.json { render :show, status: :ok, location: @dispatch_call_status }\n else\n format.html { render :edit }\n format.json { render json: @dispatch_call_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9bd149a0b209203384695c72dec2a363",
"score": "0.5698401",
"text": "def update\n @allowed_status = AllowedStatus.find(params[:id])\n\n respond_to do |format|\n if @allowed_status.update_attributes(params[:allowed_status])\n format.html { redirect_to(@allowed_status, :notice => 'AllowedStatus was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => 'edit' }\n format.xml do\n render :xml => @allowed_status.errors,\n :status => :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d7916ec3ad58e3bcce0b4e7f7846e09d",
"score": "0.5695817",
"text": "def update\n respond_to do |format|\n if @consideration_list.update(consideration_list_params)\n format.html { redirect_to @consideration_list, notice: 'Consideration list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @consideration_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "302367414296b9a7e76098f845bfdcb2",
"score": "0.5695652",
"text": "def update\n @nico_list = NicoList.find(params[:id])\n\n respond_to do |format|\n if @nico_list.update_attributes(params[:nico_list])\n format.html { redirect_to(@nico_list, :notice => 'Nico list was successfully updated.') }\n format.json { render :json => @nico_list }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @nico_list.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f6c9c9a6a53c4b3de4c0c462112d1c8e",
"score": "0.56946474",
"text": "def activo_update\n respond_to do |format|\n activo = params[:sustancium][:activo]\n id = params[:id]\n Sustancium.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"title": ""
},
{
"docid": "8e130c24448ccf1732669a12026a3519",
"score": "0.56857145",
"text": "def update\n $customerio.track(current_user.id, \"availables\",:type => \"updated\")\n \n @available = Available.find(params[:id])\n\n respond_to do |format|\n if @available.update_attributes(params[:available])\n format.html { redirect_to @available, notice: 'Available was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @available.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da19cf23acedd5ee735a47cbc828c57f",
"score": "0.5685664",
"text": "def update\n authorize! :update_compra,Sigesp::Solicitud \n @solicitud.actualizar(sigesp_solicitud_params)\n if @solicitud.errors.empty?\n return render :show\n else\n return render json:@solicitud.errors ,status: :unprocessable_entity\n end \n end",
"title": ""
},
{
"docid": "fdb21080435fab94ecb8ef9b59ee3400",
"score": "0.5682245",
"text": "def update\n respond_to do |format|\n if @allocation.update(allocation_params)\n format.html { redirect_to :back }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fact.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "348c69f68d4d118cc31c3a0aeb8685fd",
"score": "0.566068",
"text": "def update\n @recibo = Recibo.find(params[:id])\n\n# if (params[:recibo][:factura_ids] == nil)\n# params[:recibo][:factura_ids] = []\n# end\n\n respond_to do |format|\n if @recibo.update_attributes(params[:recibo])\n format.html { redirect_to @recibo, notice => 'Recibo was successfully updated.' }\n format.json { render json: @recibo }\n else\n format.html { render :action => \"edit\" }\n format.json { render json: @recibo.errors }\n end\n end\n end",
"title": ""
},
{
"docid": "d0d3e3c058e3bf3ed201e52e7f7a123f",
"score": "0.5655577",
"text": "def update\n @discapacity = Discapacity.find(params[:id])\n\n respond_to do |format|\n if @discapacity.update_attributes(params[:discapacity])\n format.html { redirect_to @discapacity, notice: 'Discapacity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @discapacity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b995c5d116d9f41f47e9c4fe1ce55bb9",
"score": "0.56538105",
"text": "def update\n respond_to do |format|\n if @black_list_status.update(black_list_status_params)\n format.html { redirect_to @black_list_status, notice: 'Black list status was successfully updated.' }\n format.json { render :show, status: :ok, location: @black_list_status }\n else\n format.html { render :edit }\n format.json { render json: @black_list_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d3612a262ec5eb0a14285215f8b6275",
"score": "0.5652761",
"text": "def update\n respond_to do |format|\n if @disabilityinfo.update(disabilityinfo_params)\n format.html { redirect_to @disabilityinfo, notice: 'Disabilityinfo was successfully updated.' }\n format.json { render :show, status: :ok, location: @disabilityinfo }\n else\n format.html { render :edit }\n format.json { render json: @disabilityinfo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e330994d854d206ab0ae882802953d72",
"score": "0.5650364",
"text": "def update\n respond_to do |format|\n if @activity_pending.update(activity_pending_params)\n format.html { redirect_to @activity_pending, notice: 'Activity pending was successfully updated.' }\n format.json { render :show, status: :ok, location: @activity_pending }\n else\n format.html { render :edit }\n format.json { render json: @activity_pending.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3315cb610a6331e6b8b60005ddab66d6",
"score": "0.5649139",
"text": "def update\n respond_to do |format|\n if @complaint.update(complaint_params)\n populate_new_edit_notifications(params, \"edit\")\n format.html { redirect_to @complaint, notice: 'Complaint was successfully updated.' }\n format.json {render json: {\"success\" => 1}}\n else\n format.html { render :edit }\n format.json { render json: @complaint.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "abad6198dbc7d9746425adfa8e9fdd96",
"score": "0.56474084",
"text": "def update\n authorize! :update, Dependencia\n respond_to do |format|\n if @dependencia.update(dependencia_params)\n log(\"Se ha editado la dependencia #{@lt}\", 1)\n format.html { redirect_to dependencias_path, notice: 'Los datos de la dependencia fueron actualizados exitosamente.' }\n format.json { render :show, status: :ok, location: @dependencia }\n else\n format.html { render :edit }\n format.json { render json: @dependencia.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d1d0a1cfae8d276693aa145776d8152",
"score": "0.5642495",
"text": "def update\n respond_with []\n end",
"title": ""
},
{
"docid": "73a061e6c4911f0522cbc82046dbdcdd",
"score": "0.56404936",
"text": "def update\n @offer = Offer.find(params[:id])\n @offer.certification_fee_twos.delete_all\n if params[:certification_fee_twos] != nil\n params[:certification_fee_twos].each do |id|\n @offer.certification_fee_twos << CertificationFeeTwo.find(id)\n end\n end\n\n respond_to do |format|\n if @offer.update_attributes(params[:offer])\n if params[:offer][:current_visibility_type] == \"visibility 3\"\n @offer.current_visibility_type = params[:current_visibility_type_other]\n @offer.save\n end\n if params[:offer][:planned_visibility_type] == \"visibility 3\"\n @offer.planned_visibility_type = params[:planned_visibility_type_other]\n @offer.save\n end\n flash[:notice] = t('Offer updated')\n add_to_log(t('Updated offer no') + @offer.order_number, \"offers\",\"update\")\n format.html { redirect_to(@offer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @offer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "397b5b93fb9a89b21250bf7f880a1732",
"score": "0.5640332",
"text": "def update\r\n @nonconformance = Nonconformance.find(params[:id])\r\n my_status = @nonconformance.status\r\n\r\n respond_to do |format|\r\n if @nonconformance.update_attributes(params[:nonconformance])\r\n\r\n if @nonconformance.status == \"Waiting on Supplier\"\r\n @nonconformance.notification_date = Time.now\r\n @nonconformance.close_date = nil\r\n @nonconformance.save\r\n elsif @nonconformance.status == \"Open\"\r\n @nonconformance.notification_date = nil\r\n @nonconformance.close_date = nil\r\n @nonconformance.save\r\n elsif @nonconformance.status == \"Closed\"\r\n @nonconformance.notification_date = Time.now\r\n @nonconformance.close_date = Time.now\r\n @nonconformance.save\r\n else \r\n @nonconformance.close_date = nil\r\n @nonconformance.save\r\n end\r\n\r\n\r\n format.html {\r\n redirect_to(nonconformances_path(:status => my_status)) }\r\n\r\n\r\n \r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @nonconformance.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "e852bc67f37f06e8c2965b3136c261da",
"score": "0.56395113",
"text": "def update\n @commission_status = CommissionStatus.find(params[:id])\n\n respond_to do |format|\n if @commission_status.update_attributes(params[:commission_status])\n format.html { redirect_to @commission_status, notice: 'Commission status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commission_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02c1ab436a1fda84110404fadd3dbd69",
"score": "0.5637872",
"text": "def update\n flash[:notice] = t('scaffold.notice.updated', :item => SicossContractMode.model_name.human) if @sicoss_contract_mode.update_attributes(params[:sicoss_contract_mode])\n respond_with(@sicoss_contract_mode, :location => sicoss_contract_modes_path)\n end",
"title": ""
},
{
"docid": "bf24a2488a05604824762dedd25c157e",
"score": "0.56308603",
"text": "def update\n @disposable_type = DisposableType.find(params[:id])\n\n respond_to do |format|\n if @disposable_type.update_attributes(params[:disposable_type])\n format.html { redirect_to @disposable_type, notice: 'Disposable type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @disposable_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da3f055ff42ee7a0d93c753e96e4d10a",
"score": "0.56301916",
"text": "def update\n respond_to do |format|\n _maintenance_params = maintenance_params\n last_status = @maintenance.status\n current_status = maintenance_params[:status]\n if(last_status!=current_status) && current_status=='completed'\n _maintenance_params[:completed_at] = Date.today\n else(last_status!=current_status) && last_status=='completed'\n _maintenance_params[:completed_at] = nil\n end\n if(last_status!=current_status) && current_status=='canceled'\n _maintenance_params[:canceled_at] = Date.today\n else(last_status!=current_status) && last_status=='canceled'\n _maintenance_params[:canceled_at] = nil\n end\n if @maintenance.update(_maintenance_params)\n UserNotificationMailer.send_mail_maintenance_updated(@maintenance).deliver_later\n format.html { redirect_to @maintenance, notice: 'Maintenance was successfully updated.' }\n format.json { render :show, status: :ok, location: @maintenance }\n else\n format.html { render :edit }\n format.json { render json: @maintenance.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73406ef4d70531e9518f503063f81733",
"score": "0.56284136",
"text": "def update\n #@factura = Factura.find(params[:factura_id])\n #@linea_factura = @factura.linea_facturas.find(params[:id])\n #@linea_factura.update(params[:linea_factura].permit(:numero, :descripcion))\n @factura = Factura.find(@linea_factura.factura)\n @linea_factura.update(linea_factura_params)\n redirect_to factura_path(@factura)\n #respond_to do |format|\n #if @linea_factura.update(linea_factura_params)\n # format.html { redirect_to linea_factura_path }\n # format.json { head :no_content }\n #else\n # format.html { render action: 'edit' }\n # format.json { render json: @linea_factura.errors, status: :unprocessable_entity }\n # end\n #end\n end",
"title": ""
},
{
"docid": "815fa08689d9111531922c1b2151a426",
"score": "0.56247646",
"text": "def update\n @updateavail = Updateavail.find(params[:id])\n\n respond_to do |format|\n if @updateavail.update_attributes(params[:updateavail])\n format.html { redirect_to @updateavail, notice: 'Updateavail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @updateavail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2f906401980562004a0f87dea585efa",
"score": "0.56241864",
"text": "def update\n respond_to do |format|\n if @lab_badge.update_attributes(lab_badge_params)\n format.html { redirect_to @lab_badge, :notice => 'Lab badge was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => 'edit' }\n format.json { render :json => @lab_badge.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "68473edbce77f77cc1dbc27239f7f083",
"score": "0.56198937",
"text": "def update\n respond_to do |format|\n if @visite_protocolaire_equipement.update(visite_protocolaire_equipement_paramspermit(:idtype_potentiel,:valeur_potentiel,:idtype_equipement,:Nom,:tolerance,:commentaire))\n format.html { redirect_to @visite_protocolaire_equipement, notice: 'la Visite protocolaire équipement a été mis à jour.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @visite_protocolaire_equipement.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80ff5754adce72b5ef7c0fe50b61a8f4",
"score": "0.5619397",
"text": "def update\n respond_to do |format|\n if @conciliatiom.update(conciliatiom_params)\n format.html { redirect_to @conciliatiom, notice: 'Conciliatiom was successfully updated.' }\n format.json { render :show, status: :ok, location: @conciliatiom }\n else\n format.html { render :edit }\n format.json { render json: @conciliatiom.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4bb7e07d64e5f3bb85cb43615eb4718b",
"score": "0.5617758",
"text": "def new\n @disponibilite = Disponibilite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @disponibilite }\n end\n end",
"title": ""
},
{
"docid": "dffd889deaa0c9d147e2403ae067364f",
"score": "0.56171685",
"text": "def update\n @rest = Rest.find(params[:id])\n respond_to do |format|\n if @rest.update_attributes(params[:rest])\n format.html { redirect_to @rest.report, notice: t(\"activerecord.models.rest\") + t(\"message.updated\") }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce6584f2eadd0e02e9a0c46cc38b9a0e",
"score": "0.5616372",
"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": "135d838074573f9ce9db7892042ed33c",
"score": "0.56151706",
"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": "549fa1dd22f8532f045dbb9008e7def4",
"score": "0.5612448",
"text": "def update\n @badge_list = BadgeList.find(params[:id])\n\n respond_to do |format|\n if @badge_list.update_attributes(params[:badge_list])\n format.html { redirect_to @badge_list, notice: 'Badge list was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @badge_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f956ad32cc8009943eae34290e2fa7a4",
"score": "0.5611615",
"text": "def update\n respond_to do |format|\n if @disability.update(disability_params)\n format.html { redirect_to @disability, notice: 'Disability was successfully updated.' }\n format.json { render :show, status: :ok, location: @disability }\n else\n format.html { render :edit }\n format.json { render json: @disability.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c0e5280a1044fe1e8b65e1919db6ca7",
"score": "0.5610547",
"text": "def update\n respond_to do |format|\n if @maintenance_detail.update(maintenance_detail_params)\n format.html { redirect_to @maintenance_detail, notice: (t 'maintenance_details.title')+(t 'actions.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @maintenance_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7dd2979507bf831f753e88cc9aeeae97",
"score": "0.5608003",
"text": "def update\n @nagios_status = NagiosStatus.find(params[:id])\n\n respond_to do |format|\n if @nagios_status.update_attributes(params[:nagios_status])\n format.html { redirect_to @nagios_status, notice: 'Nagios status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nagios_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b8369732c3b1537a68352a5a6ee3b0fe",
"score": "0.5607403",
"text": "def update\n respond_to do |format|\n if @consumable.update(consumable_params)\n format.html { redirect_to @consumable, notice: 'Consumible fue actualizado de forma exitosa.' }\n format.json { render :show, status: :ok, location: @consumable }\n else\n format.html { render :edit }\n format.json { render json: @consumable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31d28753b6455d15680162aaa297bf21",
"score": "0.5605766",
"text": "def update\n respond_to do |format|\n if @vip_ref_status.update(vip_ref_status_params)\n format.html { redirect_to @vip_ref_status, notice: 'Vip ref status was successfully updated.' }\n format.json { render :show, status: :ok, location: @vip_ref_status }\n else\n format.html { render :edit }\n format.json { render json: @vip_ref_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e43508302288a7e487551fd3a7a8d25",
"score": "0.5604496",
"text": "def update\n respond_to do |format|\n if @dependable.update(dependable_params)\n format.html { redirect_to @dependable, notice: 'Dependable was successfully updated.' }\n format.json { render :show, status: :ok, location: @dependable }\n else\n format.html { render :edit }\n format.json { render json: @dependable.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f01fa118f8b72e928c77525b1f7f32f9",
"score": "0.56023854",
"text": "def update\n respond_to do |format|\n if @maintenance_contract.update(maintenance_contract_params)\n format.html { redirect_to @maintenance_contract.server, notice: 'Contrat de maintenance modifié.' }\n format.json { render :show, status: :ok, location: @maintenance_contract }\n else\n format.html { render :edit }\n format.json { render json: @maintenance_contract.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "993d0da245628bd2d5b1f6397facdb4e",
"score": "0.56018925",
"text": "def update\n respond_to do |format|\n if @capacity.update(capacity_params)\n format.html { redirect_to @capacity, notice: 'Capacity was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @capacity.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19f598f1e6737f0209e5e45649d6f3ac",
"score": "0.56005025",
"text": "def update\n @breadcrumb = 'update'\n @debt_claim_status = DebtClaimStatus.find(params[:id])\n @debt_claim_status.updated_by = current_user.id if !current_user.nil?\n\n respond_to do |format|\n if @debt_claim_status.update_attributes(params[:debt_claim_status])\n format.html { redirect_to @debt_claim_status,\n notice: (crud_notice('updated', @debt_claim_status) + \"#{undo_link(@debt_claim_status)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @debt_claim_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "97f704738bc698264029710d1dcfbb7a",
"score": "0.55998284",
"text": "def update\r\n respond_to do |format|\r\n if @expense.flag_abgerechnet?\r\n format.html { redirect_to coffee_box_expense_path(@coffee_box, @expense), flash.alert => \"Ausgabe wurde bereits abgerechnet. Eine nachträgliche Änderung ist nicht erlaubt.\" }\r\n elsif @expense.update_attributes(params[:expense])\r\n format.html { redirect_to coffee_box_expense_path(@coffee_box, @expense), notice: \"Änderungen gespeichert.\" }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @expense.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "cee2f93bf08ff5b9092c252d3c7403e6",
"score": "0.559672",
"text": "def update\n respond_to do |format|\n if @collective_decision.update(collective_decision_params)\n format.html { redirect_to @collective_decision, notice: 'Collective decision was successfully updated.' }\n format.json { render :show, status: :ok, location: @collective_decision }\n else\n format.html { render :edit }\n format.json { render json: @collective_decision.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42e4d81ce0f91ce996dcbc347df2958d",
"score": "0.5596169",
"text": "def update\n @response = self.class.put(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\", :body => \"{'resource_form_name':#{JSON.generate(@opts)}}\")\n end",
"title": ""
},
{
"docid": "6090eee715819430681bf7680110a5f4",
"score": "0.55926514",
"text": "def update\n @page_title = @commission.name\n\n respond_to do |format|\n if @commission.update(commission_params)\n if @commission.message_thread\n MessageBroadcastController.publish('/commissions', commission_data(@commission))\n end\n\n pictures = [*params[:commission][:pictures]] || []\n unless pictures.empty?\n @commission.pictures.destroy_all\n\n pictures.each do |picture|\n @commission.pictures.create!(picture: picture)\n end\n end\n\n if @commission.buyer\n @commission.unaccept!(@commission.partner(current_user))\n @commission.accept!(current_user)\n\n @commission.seller.notifications.find_by(commission: @commission).destroy if @commission.seller.notifications.find_by(commission: @commission)\n @commission.buyer.notifications.find_by(commission: @commission).destroy if @commission.buyer.notifications.find_by(commission: @commission)\n @commission.buyer.notifications.create(about_user: @commission.seller, state: \"counter offer\", commission: @commission)\n end\n\n format.html { redirect_to @commission, notice: 'Commission was successfully updated' }\n format.json { render :show, status: :ok, location: @commission }\n else\n format.html { render :edit }\n format.json { render json: @commission.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
c7defcf9fbbf8e64187e82b64c679f54
|
GET /comments/1 GET /comments/1.json
|
[
{
"docid": "b6e695d840f73def61bfa1ea063dda42",
"score": "0.72470427",
"text": "def show\n # comment = Comment.find_comment\n render json: @comment\n end",
"title": ""
}
] |
[
{
"docid": "db20166192f49f573bb8746e971d1bf0",
"score": "0.8280257",
"text": "def comments\n client.get(\"/#{id}/comments\")\n end",
"title": ""
},
{
"docid": "2d7ceb879edc63d117e7ddc1136c4c54",
"score": "0.74416476",
"text": "def comments\n @list.client.get(\"#{url}/comments\")\n end",
"title": ""
},
{
"docid": "2d7ceb879edc63d117e7ddc1136c4c54",
"score": "0.74416476",
"text": "def comments\n @list.client.get(\"#{url}/comments\")\n end",
"title": ""
},
{
"docid": "db59ae812a080735ba726c73f0d776b7",
"score": "0.7434451",
"text": "def comments\n @article = Article.find(params[:id])\n @comments = @article.comments\n\n respond_to do |format|\n format.html \n format.json { render json: @comments, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "280bc0df1d948ec39d2d400d45a17ae4",
"score": "0.7404793",
"text": "def show\n comment = Comment.find(params[:id])\n render json: comment, status: 200\n end",
"title": ""
},
{
"docid": "5076d558da622f0ff25ea69991ed5332",
"score": "0.7303314",
"text": "def comments; rest_query(:comment); end",
"title": ""
},
{
"docid": "15ac3ba6a843b836557d761d21c45eb0",
"score": "0.7282542",
"text": "def comments\n render json: @post.comments\n end",
"title": ""
},
{
"docid": "4a4f773284262537adf9507a69e451b9",
"score": "0.72574276",
"text": "def show\n @comment = Comment.find(params[:id])\n render json:@comment\n end",
"title": ""
},
{
"docid": "061b0a5695e7bcd3913958d14086ac24",
"score": "0.72542727",
"text": "def show\n user = User.find_by({token: env['HTTP_TOKEN']})\n render json: user.comments.find(params[:id])\n end",
"title": ""
},
{
"docid": "31e51bb7e4d32a7350907110fcda97e4",
"score": "0.7242218",
"text": "def show\n comment = Comment.find_by(id: params[:id])\n render json: comment\n end",
"title": ""
},
{
"docid": "0a15a114180028c56f82fd4fd9b0ec6b",
"score": "0.7219159",
"text": "def show\n @comment = @commentable.comments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "db1e13ce761c62a5ae163b1a6103915c",
"score": "0.7217871",
"text": "def show\n comment = Comment.find(params[:id])\n render json: comment, status: :ok\n end",
"title": ""
},
{
"docid": "7d7f2bb98bf054ce440008d4f3725fe0",
"score": "0.72176784",
"text": "def show\n @comments = @post.comments\n respond_to do |format|\n format.html\n format.json\n end\n end",
"title": ""
},
{
"docid": "5b08f7de1133f24026b595d5f2db4aba",
"score": "0.71734184",
"text": "def index\n @comments = @commentable.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"title": ""
},
{
"docid": "f3ca813e7575795eb999c8e9d17aa510",
"score": "0.7157483",
"text": "def index\n comments = @project.comments\n render json: comments\n end",
"title": ""
},
{
"docid": "0c8fa5a1b9081205b4bf9b660b53d261",
"score": "0.7156849",
"text": "def index\n @post = Post.find_by_id(params[:post_id])\n if @post.nil?\n return render json: { error: \"Post not found\" }, status: :not_found\n end\n render json: @post.comments,status: 200\n end",
"title": ""
},
{
"docid": "99729352a2fe4a211bcdc005ac207c6f",
"score": "0.71178067",
"text": "def show\n @comment1 = Comment1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment1 }\n end\n end",
"title": ""
},
{
"docid": "b730c3b9ba544df26fbb22372ac719ea",
"score": "0.7117778",
"text": "def index\n @comments = DiscussionComment.all\n render json: @comments\n end",
"title": ""
},
{
"docid": "f9df013c71e7f89d89a70cca9e8c6128",
"score": "0.71012414",
"text": "def get_comment(comment_id)\n get(\"comments/#{comment_id}\")\n end",
"title": ""
},
{
"docid": "f4633dfbc542c8720bfbf12a6bd77cf0",
"score": "0.70996296",
"text": "def index\n @comments = Comment.all\n render json: @comments\n end",
"title": ""
},
{
"docid": "b9d308bb678f7ab7624371f4fc07e7ec",
"score": "0.709326",
"text": "def index\n if params[:comment_id].nil?\n render json: {\n comments: @card.comments.paginate(page: params[:page], per_page: 3)\n }, statues: :ok\n else\n @comment = Comment.find(params[:comment_id])\n render json: {\n comment: @comment,\n replaies: @comment.replaies.paginate(page: params[:page], per_page: 3)\n }, statues: :ok\n end\n end",
"title": ""
},
{
"docid": "b876cfdcbeb040426b601ccf294fd9ca",
"score": "0.7075605",
"text": "def list\n comments = Comment.where(post: @post)\n render json: comments, status: 200\n end",
"title": ""
},
{
"docid": "a7bd9a0361c3e0d9b36e8c89025030fd",
"score": "0.70607615",
"text": "def show\n @comment = @posting.comments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "22a404245ce5a6b8801a915d3cd7a937",
"score": "0.70469993",
"text": "def index\n #@comments = Comment.all\n comments = @blog.comments\n render json: comments, status: :ok\n end",
"title": ""
},
{
"docid": "dd5d51eab858673bfa09dbab877d80e2",
"score": "0.7041377",
"text": "def show\n @post = Post.find(params[:id])\n @comments = Comment.where(:post_id => params[:id]).order(\"id desc\")\n @comments = @comments.page(params[:page]).per(20)\n @comment = Comment.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "61a37d6d2e59f834c0fa8c289b1df0a3",
"score": "0.7026612",
"text": "def show\n render json: comment\n end",
"title": ""
},
{
"docid": "ec36dfffe76a4179f1faf0971a00ea19",
"score": "0.70096487",
"text": "def show\n render json: @comment\n end",
"title": ""
},
{
"docid": "7cc734fab856486e9c83d995b5875609",
"score": "0.6991003",
"text": "def GetComments id,params = {}\n\n params = params.merge(path: \"tickets/#{id}/comments.json\")\n APICall(params)\n\n end",
"title": ""
},
{
"docid": "66b55085dc11e2868d5c37137f79d945",
"score": "0.6973729",
"text": "def index\n comments = @post.comments\n render json: { comments: comments }\n #loop through comments and find first and last name by user_id\n #User.find....etc\n end",
"title": ""
},
{
"docid": "537d630570836db1f1a90df76ce3cc66",
"score": "0.696011",
"text": "def show\n @comment = Comment.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "4cfb695428b14cb32f176760959ead36",
"score": "0.6952527",
"text": "def get_comment\n @comment = Comment.find(params[:id])\n end",
"title": ""
},
{
"docid": "b6f1aad70f81b27f7bbdd806d2c0d02d",
"score": "0.69522464",
"text": "def all_comments\n render :json => User.find(params[:user_id]).comments\n end",
"title": ""
},
{
"docid": "3d48e310a77c2be201047be6eef9db4d",
"score": "0.6913443",
"text": "def comment\n Comment.find(params[:id])\n end",
"title": ""
},
{
"docid": "4b47f909183b9e7daba452b4d1ed3931",
"score": "0.691221",
"text": "def show\n @comment = Comment.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n \tend\n end",
"title": ""
},
{
"docid": "2aedb2037bffc0c4b6b83b741ce27d36",
"score": "0.69052315",
"text": "def index\n @comments = Comment.where('user_id = ?', current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68968195",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "3ec350c4003bb2894f40f9f5cc747106",
"score": "0.68965167",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "20fda40e93b4264a8bce88bf8e15d929",
"score": "0.6881779",
"text": "def comments_for(url)\n get_data(\"comments/show/#{FORMAT}?url=#{url}\")\n end",
"title": ""
},
{
"docid": "f9aa0a84c533acac71c7051a3c95bb20",
"score": "0.68767893",
"text": "def comments(options={})\n parse_comments(request(singular(id) + \"comments\", options))\n end",
"title": ""
},
{
"docid": "395f20fa027598701fb96d92d816a226",
"score": "0.686565",
"text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"title": ""
},
{
"docid": "395f20fa027598701fb96d92d816a226",
"score": "0.686565",
"text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"title": ""
},
{
"docid": "395f20fa027598701fb96d92d816a226",
"score": "0.686565",
"text": "def index\n @comments = Comment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comments }\n end\n end",
"title": ""
},
{
"docid": "3a03101398911b8be47df70a1f7f8812",
"score": "0.6864471",
"text": "def show\n render json: { comment: @comment, replaies: @comment.replaies }, status: :ok\n end",
"title": ""
},
{
"docid": "ed374480a5ef870e3f34bf4f12131ede",
"score": "0.6860159",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @comment }\n end\n end",
"title": ""
},
{
"docid": "ed374480a5ef870e3f34bf4f12131ede",
"score": "0.6860159",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @comment }\n end\n end",
"title": ""
},
{
"docid": "ed374480a5ef870e3f34bf4f12131ede",
"score": "0.6860159",
"text": "def show\n @comment = Comment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @comment }\n end\n end",
"title": ""
},
{
"docid": "8c6ddc254e1f56af9c8e037bea1943e0",
"score": "0.6856828",
"text": "def index\n logger.info(\"comments got index! #{params}\");\n @comments = Comment.find_by_post_id(params[:post_id])\n respond_with @comments\n end",
"title": ""
},
{
"docid": "b98c64c53107fd77d843a6c55e47d329",
"score": "0.6856264",
"text": "def details(id, params = {})\n wrike.execute(:get, api_url(\"comments/#{id}\"), params)\n end",
"title": ""
},
{
"docid": "52500ce0c8203e5c6d92cc0fbd55c179",
"score": "0.68498874",
"text": "def comments\n Birdman::ApiPaginatedCollection.new(\"movies/#{id}/comments\")\n end",
"title": ""
},
{
"docid": "82fb854c80d8c499425113ef7eecf0ff",
"score": "0.68280095",
"text": "def show\n @post = Post.find(params[:id])\n @comments = @post.comments.order('created_at DESC')\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "628d500d53135eaa52c0553b7325e037",
"score": "0.68225616",
"text": "def show\n @comments = Recipe.find(params[:recipe_id]).comments.all\n @comment = Recipe.find(params[:recipe_id]).comments.find(params[:id]) \n if @comment \n respond_to do |f|\n f.html {render :index}\n f.json {render json: @comment}\n end\n else\n @comments\n respond_to do |f|\n f.html {render :index}\n f.json {render json: @comments}\n end\n end\n end",
"title": ""
},
{
"docid": "91873c57a9e274179c790a9aeb61b28d",
"score": "0.680551",
"text": "def show\n @comments = @servidor.comments.order(\"id DESC\").page(params[:page]).per(3)\n end",
"title": ""
},
{
"docid": "aeb2a5edfe5bdc2a05ac4cbc0a052981",
"score": "0.6802573",
"text": "def index\n @post = Post.find(params[:post_id])\n @comments = @post.comments\n\n render json: @comments, include: ['user']\n end",
"title": ""
},
{
"docid": "35f0a1bc37656d876bd8ca8f56adb6e2",
"score": "0.6793266",
"text": "def comment(options)\n get(\"/content/items/#{options.delete(:item)}/comments/#{options[:id]}\",options)\n end",
"title": ""
},
{
"docid": "53ddae73756ef9764bf9584f8043b520",
"score": "0.67866015",
"text": "def show\n @comment = @song.comments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "4457049f0703b0df0b43482345a64de9",
"score": "0.67826325",
"text": "def show\n @comment = Comment.find_by_permalink(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment }\n end\n end",
"title": ""
},
{
"docid": "c5607e0f344b7f51105c657350824e84",
"score": "0.67652863",
"text": "def index\n @comments = @entry.comments\n respond_with(@comments)\n end",
"title": ""
},
{
"docid": "d133bb4433e6ebd3e6370ee74df34f15",
"score": "0.6764235",
"text": "def index\n @comments = @post.comments.order(created_at: :desc)\n render json: @comments, status: :ok\n\n end",
"title": ""
},
{
"docid": "33f2793c66ff512a1b1a2e82daea9ef9",
"score": "0.6757986",
"text": "def show\n @post = Post.find(params[:id], include: :comments, order: 'comments.id')\n @comment = Comment.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "fd695212ffc7f63a6b493b374e83978f",
"score": "0.6744526",
"text": "def show\n render json: @comment, status: :ok\n\n end",
"title": ""
},
{
"docid": "4f3d4cfe0b7b2a6e4b66b1707ce77c26",
"score": "0.67398757",
"text": "def show\n @new_comment = Comment.build_from(@post, \"\")\n\n render json: @post, status: 200\n\n\n end",
"title": ""
},
{
"docid": "9092329149e417848edc2fd2b1a9d22f",
"score": "0.6724224",
"text": "def show\n recipe = Recipe.find_by_id(params[:id])\n\n respond_to do |format|\n if recipe\n @comments = []\n comments = recipe.comments\n for comment in comments\n comment_user = comment.user\n @comments << { :user => comment_user, :profile_picture => comment_user.profile_picture.url, :comment => comment }\n end\n\n format.json { render :json => @comments }\n else\n format.json { render :status => 404, :json => { :message => \"No such Recipe\"}}\n end\n end\n end",
"title": ""
},
{
"docid": "dc6bd52cde17a8e9aa4c0e3da9a529ee",
"score": "0.67201436",
"text": "def index\n @comments = @complaint.comments\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @comments }\n format.js\n end\n end",
"title": ""
},
{
"docid": "60a982c43ea71cb6f7f126306fee8761",
"score": "0.67125",
"text": "def index\n comments = list.comments.desc(:created_at)\n comments = comments[5, (comments.length-1)]\n\n render json: comments\n end",
"title": ""
},
{
"docid": "6ede163d225abb5bc2b9eb1adc698e2e",
"score": "0.6704979",
"text": "def show\n @comments = Comment.where(post_id: params[:id])\n end",
"title": ""
},
{
"docid": "e39e53c0608bb64f69b20f7f23f56064",
"score": "0.6696969",
"text": "def gist_comments(id)\n get \"/gists/#{id}/comments\"\n end",
"title": ""
},
{
"docid": "3c426dc6264455ca92f2fa551af4449e",
"score": "0.6691325",
"text": "def show\n logger.info(\"comments got show! #{params}\");\n @comments = Comment.find_by_post_id(params[:post_id])\n respond_with @comments\n end",
"title": ""
},
{
"docid": "b770a3c3c7bdd1fa34e28c325f3fa5ae",
"score": "0.66872007",
"text": "def index\n event = Event.find(params[:event_id])\n render json: event.comments, status: :ok\n end",
"title": ""
},
{
"docid": "5fb05ca2499902c397ec697fe20687a0",
"score": "0.66822386",
"text": "def comments\n expose Challenge.comments(@oauth_token, params[:challenge_id].strip)\n end",
"title": ""
},
{
"docid": "4b037e4c572f6d2e70f58a3edd8b50fd",
"score": "0.6681735",
"text": "def show\n if @comment.nil?\n render json: {error: \"Not Found\"}, status: :not_found\n else\n render json: @comment, status: :ok\n end\n end",
"title": ""
},
{
"docid": "39e30a0e3c01056d12a19c13173c70b0",
"score": "0.6668344",
"text": "def get_comments(user_name)\n uri = create_api_uri(@@base_uri, user_name, 'getComments')\n return get(uri)\n end",
"title": ""
},
{
"docid": "c24e44422ec2d3ecdf7659e4161c5fed",
"score": "0.6667345",
"text": "def index\n @comments = Comment.order(\"created_at DESC\")\n render json: @comments, status: :ok\n end",
"title": ""
},
{
"docid": "dc08a9a072f19c612822c6027124d40e",
"score": "0.66317564",
"text": "def index\n if params[:_post_id]\n post_comments = PostComment.where(post_id: params[:_post_id])\n render json: post_comments.as_json(\n include: { user: { only: [:name, :id] } },\n except: [:post_id, :user_id]),\n status: :ok\n else\n render json: @current_user.post_comments.as_json(\n include: { post: { only: [:title, :id, :excerpt] } },\n except: [:user_id, :post_id]),\n status: :ok\n end\n end",
"title": ""
},
{
"docid": "95d7605c743568410d96d52ab232480b",
"score": "0.6625409",
"text": "def view_comment\n @comment = Comment.find(params[:id])\n end",
"title": ""
},
{
"docid": "36492ae9ca012e4a090fc5dce9789e3a",
"score": "0.6619273",
"text": "def show\n @comment_relationship = CommentRelationship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comment_relationship }\n end\n end",
"title": ""
},
{
"docid": "ddc398606f3822f267a1b3cafb1c0dde",
"score": "0.66192627",
"text": "def index\n @comments = @commentable.comments\n end",
"title": ""
},
{
"docid": "1995fd4517d1d334bf93356f102d3518",
"score": "0.66190165",
"text": "def index\n # @post = Post.find(params[:post_id])\n @comments = @post.comments\n end",
"title": ""
},
{
"docid": "d454434b16128d4632be424c59da7c42",
"score": "0.66184336",
"text": "def show\n @comment = @complaint.comments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @comment }\n format.js\n end\n end",
"title": ""
},
{
"docid": "5b9b09cdd51dd51e18c86c1b7bf5030e",
"score": "0.661762",
"text": "def show\n @messages_comment = MessagesComment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @messages_comment }\n end\n end",
"title": ""
},
{
"docid": "daa79dab2f2ef3dd344278fcd777e297",
"score": "0.6614873",
"text": "def getComment(response)\r\n\t\t\t\r\n\t\t\t\tjsonObject = JSON.parse response\r\n\t\t\t\t\r\n\t\t\t\tcomments = jsonObject[\"comments\"]\r\n\t\t\t\t\t\r\n\t\t\t\treturn jsonToComment(comments[0])\r\n\t\t\t\r\n\t\t\tend",
"title": ""
}
] |
65f06377d2e1b11b76d41f6b4f41459a
|
args format for array: sound_file, invalid_file, min = 0, max = 10, tries = 3, timeout = 7000, terminators = [""], chan_var = "fsr_read_dtmf", regexp = '\d'
|
[
{
"docid": "df6a9922283c092b20df2655c242cedb",
"score": "0.61104554",
"text": "def initialize(sound_file, invalid_file, *args)\n #puts args.inspect\n if args.size == 1 and args.first.kind_of?(Hash)\n arg_hash = DEFAULT_ARGS.merge(args.first)\n elsif args.size > 0\n # The array used to .zip the args here can be replaced with DEFAULT_ARGS.keys if Hash keys are ordered (1.9)\n # For now we'll hard code them to preserve order in 1.8/jruby\n arg_hash = DEFAULT_ARGS.merge(Hash[[:min, :max, :tries, :timeout, :terminators, :chan_var, :regexp][0 .. (args.size-1)].zip(args)]) \n elsif args.size == 0\n arg_hash = DEFAULT_ARGS\n else\n raise \"Invalid Arguments for PlayAndGetDigits#new (must pass (sound_file, invalid_file, hash) or (sound_file, invalid_file, min = 0, max = 10, tries = 3, timeout = 7000, terminators = ['#'], chan_var = 'fsr_read_dtmf', regexp = '\\d'))\"\n end\n @sound_file = sound_file\n @invalid_file = invalid_file\n @min = arg_hash[:min]\n @max = arg_hash[:max]\n @tries = arg_hash[:tries]\n @timeout = arg_hash[:timeout]\n @chan_var = arg_hash[:chan_var]\n @terminators = arg_hash[:terminators]\n @regexp = arg_hash[:regexp]\n\n raise unless test_files(@sound_file, @invalid_file)\n\n end",
"title": ""
}
] |
[
{
"docid": "47de9506db07563b3d65038387a8b72c",
"score": "0.5360855",
"text": "def senddtmf(options={})\n check_state\n\n base_uri = 'http://hosting.tropo.com/49767/www/audio/dtmf/'\n options[:args][0].split(//).each do |char|\n case char\n when '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'a', 'b', 'c', 'd'\n playback({ :args => [ base_uri + \"#{char}.wav\" ] })\n when '#'\n playback({ :args => [ base_uri + \"#.wav\" ] })\n else\n show \"Cannot play DTMF with: #{char.inspect}\"\n end\n end\n AGI_SUCCESS_PREFIX + \"0\\n\"\n rescue => e\n log_error(this_method, e)\n end",
"title": ""
},
{
"docid": "e6141b4505302f5f9f4db180742b779e",
"score": "0.5327808",
"text": "def get_data(options)\n raise ArgumentError if options[:args].nil?\n soundfile, timeout, maxdigits = options[:args]\n raise ArgumentError if soundfile.nil?\n\n soundfile = fetch_asterisk_sound(soundfile) || soundfile\n\n # Match Asterisk's timeout handling\n timeout = 6000 if timeout.nil? || timeout.to_i == 0\n # Yes, 1 million seconds. Copied directly from Asterisk main/app.c\n timeout = 1_000_000 if timeout.to_i < 0\n timeout = timeout.to_i / 1000 if timeout.to_i > 0\n\n # Yes, 1,024 digits. Copied directly from Asterisk res/res_agi.c\n maxdigits = 1024 if maxdigits.nil?\n\n options = {:timeout => timeout,\n :choices => \"[#{maxdigits} DIGITS]\",\n :mode => 'dtmf',\n }\n\n result = @current_call.ask(soundfile, options)\n case result.name\n when 'timeout'\n AGI_SUCCESS_PREFIX + \" (timeout)\\n\"\n when 'choice'\n AGI_SUCCESS_PREFIX + \"#{result.value}\\n\"\n else\n show \"Unknown Tropo response! #{result.inspect}\"\n raise CommandSoftFail\n end\n end",
"title": ""
},
{
"docid": "8f6739261a208f588c1a2da8742d3637",
"score": "0.53102726",
"text": "def parse_args(args)\n raise UsageError, \"usage is: scan_query_times.rb <partition_file> <log_file> <overlap_file> <unmatched_file>\" unless (args.length == 4)\n\n partition_file = args[0]\n raise UsageError, \"File '#{partition_file}' does not exist.\" unless File.exist?(partition_file)\n log_file = args[1]\n raise UsageError, \"File '#{log_file}' does not exist.\" unless File.exist?(log_file)\n overlap_file = args[2]\n raise UsageError, \"File '#{overlap_file}' does not exist.\" unless File.exist?(overlap_file)\n unmatched_file = args[3]\n raise UsageError, \"File '#{unmatched_file}' does not exist.\" unless File.exist?(unmatched_file)\n\n return partition_file, log_file, overlap_file, unmatched_file\nend",
"title": ""
},
{
"docid": "33e7707cd59978fdd6cd99cacda9d9c5",
"score": "0.53028077",
"text": "def senddtmf(options={})\n check_state\n \n base_uri = 'http://hosting.tropo.com/49767/www/audio/dtmf/'\n options[:args][0].split(//).each do |char|\n case char\n when '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'a', 'b', 'c', 'd'\n playback({ :args => [ base_uri + \"#{char}.wav\" ] })\n when '#'\n playback({ :args => [ base_uri + \"#.wav\" ] })\n else\n show 'Cannot play DTMF with:', char\n end\n end\n @agi_response + \"0\\n\"\n rescue => e\n log_error(this_method, e)\n end",
"title": ""
},
{
"docid": "06aab5c223f99ec178d31b72bb1f2966",
"score": "0.5242794",
"text": "def read(args)\n\t\t\t\t# Adjust prompt\n\t\t\t\tmsg = args[:msg] + ((msg !~ /([:?](\\s*))$/) ? \":\" : \"\")\n\t\t\t\tmsg += \" \" if msg !~ / ^/\n\n\t\t\t\t# Turn choices into regular expressions\n\t\t\t\tregexps = (args[:valids] || []).force_array.collect do |valid|\n\t\t\t\t\tif !valid.is_a?(Regexp) then\n\t\t\t\t\t\tvalid = Regexp.new((valid !~ /^\\^/ ? \"^\" : \"\") + valid + (valid !~ /\\$$/ ? \"$\" : \"\"), Regexp::EXTENDED + (args[:case_sensitive] ? Regexp::IGNORECASE : 0), \"U\")\n\t\t\t\t\telse\n\t\t\t\t\t\tvalid\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\trv = nil\n\n\t\t\t\t# Read input\n\t\t\t\twhile true do\n\t\t\t\t\t# Show message\n\t\t\t\t\tprint(msg)\n\n\t\t\t\t\t# Get reply\n\t\t\t\t\tbufs = gets.chop()\n\n\t\t\t\t\t# If we don't have any regexp\n\t\t\t\t\tif regexps.length == 0 then\n\t\t\t\t\t\trv = bufs\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\n\t\t\t\t\t# Validate inputs\n\t\t\t\t\tregexps.each do |re|\n\t\t\t\t\t\tif bufs =~ re then\n\t\t\t\t\t\t\trv = bufs\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tbreak if rv\n\t\t\t\t\tself.write(warn: \"Sorry, your reply was not understood. Please try again\")\n\t\t\t\tend\n\n\t\t\t\trv\n\t\t\tend",
"title": ""
},
{
"docid": "bb773fe2405008dcbb9a30626970af07",
"score": "0.51388025",
"text": "def test_check_args_file_valid\r\n file_args = [\"../CS1632_Deliverable6/File1.rpn\"]\r\n val = 0\r\n assert_output(\"3\\n\") {val = @arg_checker.check_args(file_args)}\r\n assert val.is_a?(Array)\r\n end",
"title": ""
},
{
"docid": "c4d152e2d9f79dd42ed82f90cf54470f",
"score": "0.5124855",
"text": "def get_option(options)\n raise ArgumentError if options[:args].nil?\n soundfile, digits, timeout = options[:args]\n raise ArgumentError if soundfile.nil?\n\n soundfile = fetch_asterisk_sound(soundfile) || soundfile\n\n # Match Asterisk's timeout handling\n timeout = 5000 if timeout.nil? || timeout.to_i == 0\n # Yes, 1 million seconds. Copied directly from Asterisk main/app.c\n timeout = 0 if timeout.to_i < 0\n timeout = timeout.to_i / 1000 if timeout.to_i > 0\n\n options = {:timeout => timeout,\n :choices => format_escape_digits(digits),\n :mode => 'dtmf',\n }\n\n result = @current_call.ask(soundfile, options)\n case result.name\n when 'timeout'\n AGI_SUCCESS_PREFIX + \"0 endpos=1000\\n\"\n when 'choice'\n AGI_SUCCESS_PREFIX + \"#{result.value} endpos=1000\\n\"\n else\n show \"Unknown Tropo response! #{result.inspect}\"\n raise CommandSoftFail\n end\n\n end",
"title": ""
},
{
"docid": "33ab19614f8dd2d0d022d0bad88a098a",
"score": "0.50813496",
"text": "def test_check_correct_file_extension\r\n file_args = [\"../CS1632_Deliverable6/File1.rpn\"]\r\n assert_output(\"\") {@arg_checker.check_array_arguments(file_args)}\r\n end",
"title": ""
},
{
"docid": "a9087b0ccf4065ae23c7cc36c02eeffe",
"score": "0.5065119",
"text": "def main(args)\n if args.length != 4 \n puts \"Usage: #{$0} <path> <allowed attempts> <Length of time for bad attempts> <Block Length>\"\n puts \"For infinite ban use 0 in blocklength field\"\n return 1\n end\n Reader.limit(args[1])\n Reader.errorTime(args[2])\n Reader.blockTime(args[3])\n printf(\"Monitoring: %s\\n\", args[0])\n EventMachine.run do\n EventMachine::file_tail(args[0], Reader)\n end\nend",
"title": ""
},
{
"docid": "b8bb7ca9089b7ce143e06f2148972edc",
"score": "0.50407165",
"text": "def parse_dtmf(dtmf)\n return if dtmf.nil?\n dtmf.split(' ').inject '' do |final, digit|\n final << parse_dtmf_digit(digit)\n end\n end",
"title": ""
},
{
"docid": "c941eb93b6b6c9e15c3f24bebcb4cccc",
"score": "0.50027955",
"text": "def processCommandLineParameters(args)\n if args.length != 5 && args.length != 2\n printUsage()\n exit -1\n else\n @fcName = args[0]\n @laneBarcode = args[1]\n @limsFCName = @pHelper.formatFlowcellNameForLIMS(@fcName)\n end\n\n if args.length == 5\n @readLength = Integer(args[2])\n \n if args[3].downcase.eql?(\"paired\")\n @fcPaired = true\n else\n @fcPaired = false\n end\n @refPath = args[4]\n end\n end",
"title": ""
},
{
"docid": "60a513a177740709218fa5a894eeb905",
"score": "0.49923712",
"text": "def read(*args)\n check_state\n\n # Set defaults\n prompt, choices, attempts, timeout = 'silence', '[1-255 DIGITS]', 1, 30\n\n # Set the prompt\n prompt = args[1] if !args[1].empty?\n asterisk_sound_url = fetch_asterisk_sound(prompt)\n prompt = asterisk_sound_url if asterisk_sound_url\n\n # Set other values if provided\n choices = \"[1-#{args[2]} DIGITS]\" unless args[2].nil? || args[2].empty?\n attempts = args[4] unless args[4].nil? || args[4].empty?\n timeout = args[5].to_f unless args[5].nil? || args[5].empty?\n\n response = nil\n attempts.to_i.times do\n response = @current_call.ask prompt, { :choices => choices,\n :choiceMode => 'keypad',\n :terminator => '#',\n :timeout => timeout }\n break if response.value\n end\n\n # Set the variable the user has specified for the value to insert into\n @chanvars[args[0]] = response.value\n AGI_SUCCESS_PREFIX + \"0\\n\"\n end",
"title": ""
},
{
"docid": "1a3a3c03a65e0be101a4d88434b42371",
"score": "0.49761647",
"text": "def xtest_temp21\n OptionParser.new(\n :names => %w(--file -file --files -files -f),\n :arity => [1,-1],\n :arg_description => \"file1 [file2, ...]\")\n\n end",
"title": ""
},
{
"docid": "4da5933420e88104de641fee4b293d0a",
"score": "0.49237576",
"text": "def test_check_incorrect_file_extension\r\n file_args = [\"../CS1632_Deliverable6/File1.gupta\"]\r\n assert_equal @arg_checker.check_array_arguments(file_args), [5, 0, -1]\r\n end",
"title": ""
},
{
"docid": "ff752cb95b2b3b0587d6c039b9f820f8",
"score": "0.49046874",
"text": "def generate_fastq\n total_read_cnt = 0\n pass_read_cnt = 0\n ARGV.each do |qseq_arg|\n # expand metacharacters in the qseq file expression\n Dir.glob(qseq_arg).sort.each do |qseq_file|\n\t# convert one qseq file to fastq\n\tSTDERR.puts \"Processing #{qseq_file}...\" if @verbose\n IO.foreach(qseq_file) do |line|\n line.chomp\n fields = line.split(\" \")\n die \"parse error at #{qseq_file}:#{$INPUT_LINE_NUMBER}\" if\n fields.size != 11\n @total_read_cnt += 1\n machine, runid, lane, tile, dx, dy, idx, readid, seq, qual, pass =\n fields\n rname = \"#{machine}:#{lane}:#{tile}:#{dx}:#{dy}##{idx}/#{readid}\"\n seq.tr!('.', 'N')\t# convert . to N\n\t out = nil\n if pass == \"1\"\n out = @pass\n @pass_read_cnt += 1\n else\n out = @reject;\n end\n if !out.nil?\n out.print \"@#{rname}\\n\"\n out.print \"#{seq}\\n\"\n out.print \"+#{rname}\\n\"\n out.print \"#{qual}\\n\"\n end\n end # IO.foreach\n end # Dir.glob\n end # ARGV.each\n end",
"title": ""
},
{
"docid": "8c942d51537e8ae0900a8f28395a8156",
"score": "0.49026757",
"text": "def test_check_args_incorrect_extension\r\n file_args = [\"../CS1632_Deliverable6/File1.gupta\"]\r\n assert_equal @arg_checker.check_args(file_args), [5, 0, -1]\r\n end",
"title": ""
},
{
"docid": "2b198bd9838ccbd24795bd517e5dccfa",
"score": "0.49007192",
"text": "def test_check_args_file_nonexist\r\n file_args = [\"../CS1632_Deliverable6/File69.rpn\"]\r\n assert_equal @arg_checker.check_args(file_args), [5, 0, -1]\r\n end",
"title": ""
},
{
"docid": "2a6860c972976e7a9a56962618932872",
"score": "0.48675132",
"text": "def test_multiple_correct_files_provided\r\n file_args = [\"File1.rpn File2.rpn File3.rpn\"]\r\n assert_equal @arg_checker.read_file(file_args), 'INV'\r\n end",
"title": ""
},
{
"docid": "4ea8873808f60b5641f7ad1315e3d663",
"score": "0.48487726",
"text": "def test_check_args_valid_array\n assert_equal true, check_args([\"sample.txt\"])\n end",
"title": ""
},
{
"docid": "c79164b8ab3fdcf3a29423ade3f13eab",
"score": "0.48172998",
"text": "def get_matching_files(options)\n cmd = [options.cmd, '-l', '-Q',]\n cmd << '--ackmate' if options.cmd.end_with?('ag')\n options.file_types.each { |val| cmd << \"--#{val}\" }\n cmd << options.pattern\n cmd << options.path\n\n puts cmd.join(' ')\n files, status = Open3.capture2(*cmd)\n files = files[1..-1].to_s.gsub(\"\\n:\", \"\\n\").split(\"\\n\")\n\n if files.empty?\n STDERR.puts \"Nothing matched pattern: '#{options.pattern.red}'\"\n exit 0\n elsif !status.success?\n exit_code = $?.to_i\n STDERR.puts \"Non zero exit code (#{exit_code}) for #{cmd.join(' ').inspect}\"\n exit exit_code\n else\n puts \"Files contianing text from pattern: '#{options.pattern.green}'\"\n puts files.join(\"\\n\").green\n end\n files\nend",
"title": ""
},
{
"docid": "3397a426ec7193a80740dfba6790f5a4",
"score": "0.47432452",
"text": "def processArgs(args)\r\n \r\n args.each_index do | index |\r\n expansion = false\r\n files = nil\r\n if index > 0\r\n # not \"rtxt(a)\" but \"rtxt\"\r\n if (not (args[index] =~ /^r.+\\(.+\\)$/i)) and (args[index] =~ /^r.+$/i)\r\n # check for expansion\r\n prev = @args.last\r\n if prev =~ /^i.+\\((.+)\\)$/i # does it equal iX(Y) ?\r\n pathAndFileSpec = $1\r\n pathEnd = nil\r\n pathEnd = pathAndFileSpec.rindex(\"\\\\\")\r\n tmp = pathAndFileSpec.rindex(\":\")\r\n pathEnd = tmp if not pathEnd or (tmp and tmp > pathEnd)\r\n tmp = pathAndFileSpec.rindex(\"/\")\r\n pathEnd = tmp if not pathEnd or (tmp and tmp > pathEnd)\r\n if pathEnd\r\n path = pathAndFileSpec[0,pathEnd+1]\r\n Dir.chdir(path) if path.length > 0\r\n fileSpec = pathAndFileSpec[(pathEnd+1)..(pathAndFileSpec.length-1)]\r\n else\r\n fileSpec = pathAndFileSpec\r\n end\r\n if false # case sensitive: z*.bmp != Z*.bmp\r\n files = Dir[fileSpec]\r\n else # case insensitive\r\n dosFileSpec = \"^\"\r\n fileSpec.length.times do | charIndex |\r\n ch = fileSpec[charIndex,1]\r\n case ch\r\n when \"*\"\r\n dosFileSpec += \".*\"\r\n when \"?\"\r\n dosFileSpec += \".\"\r\n when \".\"\r\n dosFileSpec += \"\\\\.\"\r\n when \"+\"\r\n dosFileSpec += \"\\\\+\"\r\n when \"(\"\r\n dosFileSpec += \"\\\\(\"\r\n when \")\"\r\n dosFileSpec += \"\\\\)\"\r\n when \"[\"\r\n dosFileSpec += \"\\\\[\"\r\n when \"]\"\r\n dosFileSpec += \"\\\\]\"\r\n when \"{\"\r\n dosFileSpec += \"\\\\{\"\r\n when \"}\"\r\n dosFileSpec += \"\\\\}\"\r\n when \"-\"\r\n dosFileSpec += \"\\\\-\"\r\n when \"|\"\r\n dosFileSpec += \"\\\\|\"\r\n when \"\\\\\"\r\n dosFileSpec += \"\\\\\"\r\n when \"^\"\r\n dosFileSpec += \"\\\\^\"\r\n when \"$\"\r\n dosFileSpec += \"\\\\$\"\r\n else\r\n dosFileSpec += ch\r\n end\r\n end\r\n dosFileSpec += \"$\"\r\n dosFileMatch = Regexp.new(dosFileSpec,Regexp::IGNORECASE)\r\n files = Dir[\"*\"]\r\n files = files.collect { | file | file if file =~ dosFileMatch }\r\n files.compact!\r\n end\r\n expansion = true if files.length > 0\r\n end\r\n end\r\n end\r\n if expansion\r\n imageArg = @args.pop # remove last entry from @args\r\n imageArg =~ /^i(.+)\\(.+\\)$/i\r\n imageType = $1\r\n files.each do | filename |\r\n if filename != \".\" and filename != \"..\"\r\n @args << \"i\" + imageType + \"(\" + filename + \")\"\r\n @args << args[index]\r\n end\r\n end\r\n else # no expansion\r\n @args << args[index]\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "d61e7ded44f986db256712fa30e6d286",
"score": "0.47198406",
"text": "def command_line_validator(array)\n if array.any? { |x| ['-nc', '-d1', '-d2', '-d3', '-d4', '--help', '-crash'].include? x }\n if array.size > 2\n raise StandardError, 'Too many arguments provided'\n elsif array.include?('--help')\n help_screen\n exit\n elsif array.include?('-crash')\n ['-crash']\n elsif array.size <= 2\n array\n end\n elsif array.empty?\n array\n else\n raise StandardError, 'Argument not recognized'\n end\n end",
"title": ""
},
{
"docid": "4457b1b26e80d7e10ebf8223e6b6fa4b",
"score": "0.4710515",
"text": "def recipe args={}\n raise ArgumentError, \"Requires input and output files.\" unless args.include? 'input' and args.include? 'output' and args.include? 'format'\n\t\t\n recipe = \"ffmpeg -i #{args['input']} -f #{args['format']}\"\n \n args['options'] = {} if args['options'].nil?\n\t\targs['options'].each do |k,v|\n \trecipe += \" -#{k} #{v}\"\n end\n if args['format'] == \"flv\"\n recipe += \" - | flvtool2 -U stdin #{args['output']}\"\n else\n recipe += \" -y #{args['output']}\" \n end\n recipe\n end",
"title": ""
},
{
"docid": "576a2cd697fe35c0cfa0492aa1f46ffe",
"score": "0.47039315",
"text": "def dtmf_params\n params.require(:dtmf).permit(:isActive, :sessionId, :direction, :callerNumber, :destinationNumber, :dtmfDigits, :recordingUrl, :durationInSeconds, :currencyCode, :amount)\n end",
"title": ""
},
{
"docid": "8b7fdc352ad708eeb3c762e541b76857",
"score": "0.4699875",
"text": "def cli_user_input(arg_array)\n @cli_read_path = arg_array[0]\n @cli_write_path = arg_array[1]\n @cli_message = file_read(@cli_read_path)\n if arg_array.length == 3\n @cli_key = arg_array[2] \n @cli_date = date_formatter\n end\n @cli_date = arg_array[3] if arg_array.length == 4\n end",
"title": ""
},
{
"docid": "2667301e883bc8b6a94b4354c413130f",
"score": "0.4699197",
"text": "def check_arguments(args)\n if args.count != 1\n show_usage_no_args\n elsif args.count == 1\n begin\n txt_file = File.new(args[0], 'r')\n File.open(txt_file, 'r')\n rescue StandardError\n show_usage_file_error\n end\n end\n txt_file\nend",
"title": ""
},
{
"docid": "8fd6a560efcb8ddde0ff6302cea3c652",
"score": "0.4681273",
"text": "def grammar_accept(digits = '0123456789#*')\n allowed_digits = '0123456789#*'\n gram_digits = digits.chars.select { |x| allowed_digits.include? x }\n\n RubySpeech::GRXML.draw :mode => 'dtmf', :root => 'inputdigits' do\n rule id: 'inputdigits', scope: 'public' do\n one_of do\n gram_digits.each { |d| item { d.to_s } }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d3d3e54be80df5bb48c8f44546c97ee6",
"score": "0.46641514",
"text": "def parse_arguments\n expect_exactly(1, \"files to split\")\n end",
"title": ""
},
{
"docid": "1acad496e3efbbce70434c0e7e314ce5",
"score": "0.46476847",
"text": "def validate_command_line\n\n exit_with_error(USAGE_MESSAGE) if ARGV.size < 2\n \n valid_duration_end_chars = %w(0 1 2 3 4 5 6 7 8 9 s S m M h H) # digits plus sShHmM\n last_char = ARGV[0][-1]\n exit_with_error(USAGE_MESSAGE) unless valid_duration_end_chars.include?(last_char)\nend",
"title": ""
},
{
"docid": "b3f5d092649b7d689e7f5a6209559635",
"score": "0.46423164",
"text": "def test_file_input\n return unless Ffprober::FfprobeVersion.valid?\n\n ffprobe = Ffprober::Parser.from_file(\n 'test/assets/301 extracting a ruby gem.m4v'\n )\n\n assert_equal(\n 'test/assets/301 extracting a ruby gem.m4v',\n ffprobe.format.filename\n )\n\n assert_equal '44100', ffprobe.audio_streams.first.sample_rate\n assert_equal 1, ffprobe.audio_streams.count\n\n assert_equal 0, ffprobe.subtitle_streams.count\n\n assert_equal 1, ffprobe.video_streams.count\n assert_equal 480, ffprobe.video_streams.first.width\n\n assert_equal 0, ffprobe.chapters.count\n\n assert_equal 2, ffprobe.json[:streams].count # json raw access\n end",
"title": ""
},
{
"docid": "8aa930d2072dc8f56fd520d75c9ed216",
"score": "0.46248478",
"text": "def cmd_flen(*args)\n self.idx ||= 0\n flen = -1\n opts = Rex::Parser::Arguments.new(\n '-h' => [ false, 'Help Banner' ],\n '-l' => [ true, 'Fixed Length' ]\n )\n opts.parse(args) do |opt, _idx, val|\n case opt\n when '-h'\n print_line(\"Usage: flen -l <length>\\n\")\n print_line(opts.usage)\n return\n when '-l'\n flen = val.to_i\n end\n end\n if flen == -1\n print_line(\"You must specify a length\")\n return\n end\n r = client.rftransceiver.make_pkt_flen(idx, flen)\n print_success(r)\n end",
"title": ""
},
{
"docid": "d9cb6652486707a29c419e20bf8497a1",
"score": "0.46155232",
"text": "def prepare_args_calctype(args)\n case @option[:inputFormat]\n when \"basic\" then\n [args[2], args[3]]\n when \"binary\" then\n args\n end\n end",
"title": ""
},
{
"docid": "2346b954bee405b0a31225cd874f9da6",
"score": "0.46060237",
"text": "def sanity_check_arguments(args)\n if ARGV.length == 0\n raise(\"No arguments - usage is: ruby i18nChecker.rb <file_spec_glob> [complete] [summary]\")\n end\n \n file_spec = args[0]\n complete = false;\n summary = false;\n \n args[1..-1].each do |arg|\n if \"complete\" == arg.downcase()\n complete = true\n elsif \"summary\" == arg.downcase()\n summary = true\n else \n raise(\"'#{arg}' is an invalid argument\")\n end\n end\n\n puts \"file_spec = '#{file_spec}', complete = #{complete}, summary = #{summary}\"\n return file_spec, complete, summary\n end",
"title": ""
},
{
"docid": "8a9d514309dc5eba7029b7930f563600",
"score": "0.45824006",
"text": "def extractDelimited( *args )\r\n rval = scanDelimited( *args ) or return nil\r\n return rval[:match]\r\n end",
"title": ""
},
{
"docid": "a1a4e602a57a5aafc512dca3ced5af23",
"score": "0.4574574",
"text": "def read(*args); end",
"title": ""
},
{
"docid": "a1a4e602a57a5aafc512dca3ced5af23",
"score": "0.4574574",
"text": "def read(*args); end",
"title": ""
},
{
"docid": "a1a4e602a57a5aafc512dca3ced5af23",
"score": "0.4574574",
"text": "def read(*args); end",
"title": ""
},
{
"docid": "5e4adacf7e384d594e822864056e70b9",
"score": "0.45743582",
"text": "def glob_pattern(timestamp, pid = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "069d5bd63a37fcfb56806deb8e56cec4",
"score": "0.45699528",
"text": "def runq(args={})\n result = StringIO.new\n\n if args.include?(:pattern)\n mcresult = mc.delivermatching(:pattern => args[:pattern])\n else\n mcresult = mc.runq\n end\n\n mcresult.each do |r|\n if r[:statuscode] == 0\n msg = r[:data][:status]\n else\n msg = r[:statusmsg]\n end\n\n result.puts \"%30s: %s\" % [r[:sender], msg]\n end\n\n return result.string\n end",
"title": ""
},
{
"docid": "63928c960c3e9c96e18de28a79f6e907",
"score": "0.45670867",
"text": "def parse_command_line\n seconds = parse_delay\n message = ARGV[1..-1].join(' ')\n [seconds, message]\nend",
"title": ""
},
{
"docid": "8d86f2c869aec431032c420704e465bd",
"score": "0.45624945",
"text": "def test_parse_file_line_valid_all\r\n input = [\"LET\", \"PRINT\", \"1\", \"-1\", \"200\", \"999999999999999999999999999999999999\", \"+\", \"-\", \"/\", \"*\", \"a\", \"Z\"]\r\n val = @arg_checker.parse_file_line(input)\r\n assert_equal val, input\r\n end",
"title": ""
},
{
"docid": "c351d93b1c2d0643ac79a0b9b18e6fb1",
"score": "0.45623696",
"text": "def get_valid_options()\n file_array = IO.readlines $0\n option_list = file_array.grep(/\\['--/)\n return option_list\nend",
"title": ""
},
{
"docid": "c351d93b1c2d0643ac79a0b9b18e6fb1",
"score": "0.45623696",
"text": "def get_valid_options()\n file_array = IO.readlines $0\n option_list = file_array.grep(/\\['--/)\n return option_list\nend",
"title": ""
},
{
"docid": "6a2970b6ad14b62e27ecec9b0cb1b45a",
"score": "0.45601365",
"text": "def test_002\n # @type [Array<Message>] messages\n messages = quick_test('002_pdf_fl.log', { error: 4, warning: 0, info: 1 },\n 11 => ['push /usr/local/texlive/2016/texmf-dist/tex/generic/german/ngerman.sty'],\n 12 => ['pop /usr/local/texlive/2016/texmf-dist/tex/generic/german/ngerman.sty'],\n 44 => ['push /usr/local/texlive/2016/texmf-dist/tex/latex/url/url.sty',\n 'pop /usr/local/texlive/2016/texmf-dist/tex/latex/url/url.sty',\n 'pop /usr/local/texlive/2016/texmf-dist/tex/latex/hyperref/hyperref.sty'],\n 52 => [],\n 53 => ['pop /usr/local/texlive/2016/texmf-dist/tex/context/base/mkii/supp-pdf.mkii',\n 'push /usr/local/texlive/2016/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty'],\n 61 => ['push /usr/local/texlive/2016/texmf-dist/tex/latex/bbold/Ubbold.fd',\n 'pop /usr/local/texlive/2016/texmf-dist/tex/latex/bbold/Ubbold.fd',\n 'pop ./002.tex']\n )\n\n # Runaway argument?\n # {Test. Also, it contains some \\ref {warnings} and \\ref {errors} for t\\ETC.\n verify_message(messages,\n message: /Runaway argument/,\n log_lines: { from: 62, to: 63 },\n level: :error)\n\n # ! File ended while scanning use of \\@footnotetext.\n verify_message(messages,\n message: /File ended while scanning/,\n source_file: /002\\.tex/,\n log_lines: { from: 64, to: 67 },\n level: :error)\n\n # ! Emergency stop.\n verify_message(messages,\n message: /Emergency stop/,\n source_file: /002\\.tex/,\n log_lines: { from: 69, to: 70 },\n level: :error)\n\n # ! ==> Fatal error occurred, no output PDF file produced!\n verify_message(messages,\n message: /no output PDF/,\n log_lines: { from: 72, to: 73 },\n level: :error)\n end",
"title": ""
},
{
"docid": "13aac15a0173a62f03d72030d00e5705",
"score": "0.45579246",
"text": "def parse_file_path_helper(path)\n if @date_num_sample.match(path)\n return (/\\d\\d-\\d\\d-\\d\\d_[0-9]+-CF[0-9]+_USI-[A-Za-z0-9]+_?[0-9]*_?([PE12]*)_FC[0-9a-zA-Z]+-L[0-9]+-([\\w_\\-]*)/.match(path).to_a)\n elsif @date_date_sample.match(path)\n return (/[0-9\\-]+_\\d\\d-\\d\\d-\\d\\d_[0-9]+_?([PE12]*)-([0-9A-Za-z_\\-]*)/.match(path).to_a)\n elsif @date_machine_FC.match(path)\n return (/[0-9]+_USI-[A-Za-z0-9]+_?[0-9]*_?[R2]*_?([PE12]*)_FC[0-9a-zA-Z_]+-L[0-9]+-([\\w_\\-\\.\\+]*)/.match(path).to_a)\n elsif @fc_l_sample.match(path)\n return (/_?([PE12]*)_?FC[A-Za-z0-9]+-L[0-9]+-([0-9A-Za-z_\\-]+)/.match(path).to_a)\n end\nend",
"title": ""
},
{
"docid": "15f5637b7b177aa57b8c5c771cb8d5e5",
"score": "0.4550093",
"text": "def match(argv1)\n return nil unless argv1\n regex = %r{(?>\n access[ ]denied[.][ ]IP[ ]name[ ]lookup[ ]failed\n |access[ ]from[ ]ip[ ]address[ ].+[ ]blocked\n |blacklisted[ ]by\n |Blocked[ ]-[ ]see[ ]https://support[.]proofpoint[.]com/dnsbl-lookup[.]cgi[?]ip=.+\n |can[']t[ ]determine[ ]Purported[ ]Responsible[ ]Address\n |cannot[ ]resolve[ ]your[ ]address\n |client[ ]host[ ].+[ ]blocked[ ]using\n |client[ ]host[ ]rejected:[ ](?:\n may[ ]not[ ]be[ ]mail[ ]exchanger\n |cannot[ ]find[ ]your[ ]hostname # Yahoo!\n |was[ ]not[ ]authenticated # Microsoft\n )\n |confirm[ ]this[ ]mail[ ]server\n |connection[ ](?:\n dropped\n |refused[ ]by\n |reset[ ]by[ ]peer\n |was[ ]dropped[ ]by[ ]remote[ ]host\n )\n |domain[ ]does[ ]not[ ]exist:\n |domain[ ].+[ ]mismatches[ ]client[ ]ip\n |dns[ ]lookup[ ]failure:[ ].+[ ]try[ ]again[ ]later\n |DNSBL:ATTRBL\n |Go[ ]away\n |hosts[ ]with[ ]dynamic[ ]ip\n |IP[ ]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[ ]is[ ]blocked[ ]by[ ]EarthLink # Earthlink\n |IP[/]domain[ ]reputation[ ]problems\n |is[ ]not[ ]allowed[ ]to[ ]send[ ]mail[ ]from\n |mail[ ]server[ ]at[ ].+[ ]is[ ]blocked\n |Messages[ ]from[ ].+[ ]temporarily[ ]deferred[ ]due[ ]to[ ]user[ ]complaints # Yahoo!\n |no[ ]access[ ]from[ ]mail[ ]server\n |Not[ ]currently[ ]accepting[ ]mail[ ]from[ ]your[ ]ip # Microsoft\n |Please[ ]get[ ]a[ ]custom[ ]reverse[ ]DNS[ ]name[ ]from[ ]your[ ]ISP[ ]for[ ]your[ ]host\n |please[ ]use[ ]the[ ]smtp[ ]server[ ]of[ ]your[ ]ISP\n |Rejecting[ ]open[ ]proxy # Sendmail(srvrsmtp.c)\n |sorry,[ ](?:\n that[ ]domain[ ]isn'?t[ ]in[ ]my[ ]list[ ]of[ ]allowed[ ]rcpthosts\n |your[ ]remotehost[ ]looks[ ]suspiciously[ ]like[ ]spammer\n )\n |SPF[ ]record\n |the[ ](?:email|domain|ip).+[ ]is[ ]blacklisted\n |unresolvable[ ]relay[ ]host[ ]name\n |your[ ](?:\n network[ ]is[ ]temporary[ ]blacklisted\n |server[ ]requires[ ]confirmation\n )\n |was[ ]blocked[ ]by[ ].+\n |we[ ]do[ ]not[ ]accept[ ]mail[ ]from[ ](?: # @mail.ru\n hosts[ ]with[ ]dynamic[ ]IP[ ]or[ ]generic[ ]dns[ ]PTR-records\n |dynamic[ ]ips\n )\n |http://www[.]spamcop[.]net/bl[.]\n )\n }xi\n\n return true if argv1 =~ regex\n return false\n end",
"title": ""
},
{
"docid": "d003fb621dc81a72268db6a24e50941a",
"score": "0.453631",
"text": "def match(argv1)\n return nil unless argv1\n regex = %r{(?>\n can[']t[ ]create[ ]user[ ]output[ ]file\n |Could[ ]not[ ]load[ ]DRD[ ]for[ ]domain\n |Internal[ ](?:\n error[ ]reading[ ]data # Microsoft\n |server[ ]error:[ ]Operation[ ]now[ ]in[ ]progress # Microsoft\n )\n |interrupted[ ]system[ ]call\n |it[ ](?:\n encountered[ ]an[ ]error[ ]while[ ]being[ ]processed\n |would[ ]create[ ]a[ ]mail[ ]loop\n )\n |local[ ](?:\n configuration[ ]error\n |error[ ]in[ ]processing\n )\n |loop[ ]was[ ]found[ ]in[ ]the[ ]Mail[ ]eXchanger\n |mail[ ](?:\n for[ ].+[ ]loops[ ]back[ ]to[ ]myself\n |system[ ]configuration[ ]error\n )\n |server[ ]configuration[ ]error\n |service[ ]currently[ ]unavailable\n |system[ ]config[ ]error\n |Temporary[ ]local[ ]problem\n |timeout[ ]waiting[ ]for[ ]input\n )\n }ix\n\n return true if argv1 =~ regex\n return false\n end",
"title": ""
},
{
"docid": "ca2758fea780ad78665fa15cf0e405cd",
"score": "0.4512332",
"text": "def ffmpeg_to_parse\n\t\t\t\tfile = @file\n\t\t\t\tdirectory = @directory\n\t\t\t\toutput_file = \"cut_\" + @file\n\t\t \tif file.include?(' ') || file.include?(\"'\") || directory.include?(' ') || directory.include?(\"'\")\n\t\t file = file.to_s.dup\n\t\t directory = directory.to_s.dup\n\t\t file = file+'\"'\n\t\t directory = '\"' + directory\n\t\t end\n\n\t\t \tto_exec = \"#{getFFMPEGexec()} -i #{directory}/#{file}\" + ERROR\n\t\t \toutput = `#{to_exec}`\n\n\t\t \tif output.include? 'command not found' # Check here whether we have installed ffmpeg or not.\n\t\t raise LoadError, 'Can\\'t find ffmpeg'\n\t\t else\n\t\t _ = output.match(MAIN_REGEX)[1]\n\t\t # Must convert the format given in _ to seconds.\n\t\t duration = timeToSecond(_)\n\t\t return duration\n\t\t end\n\t\t end",
"title": ""
},
{
"docid": "5da15bb10dab33a92781001ef76b2872",
"score": "0.45063013",
"text": "def read_fastq\n\n seq_name = nil\n seq_fasta = nil\n seq_qual = nil\n comments = nil\n \n reading = :fasta\n \n if !@fastq_file.eof\n \n begin\n #read four lines\n name_line = @fastq_file.readline.chomp\n seq_fasta = @fastq_file.readline.chomp\n name2_line = @fastq_file.readline.chomp\n seq_qual = @fastq_file.readline.chomp\n\n \n # parse name\n if name_line =~ /^@\\s*([^\\s]+)\\s*(.*)$/\n # remove comments\n seq_name = $1\n comments=$2\n else\n raise \"Invalid sequence name in #{name_line}\"\n end\n \n # parse fasta\n seq_fasta.strip! if !seq_fasta.empty?\n\n # parse qual_name\n \n if !seq_name.nil? && !seq_qual.empty?\n\n @num_seqs += 1\n \n if @qual_to_phred\n seq_qual=seq_qual.each_char.map{|e| (@to_phred.call(e.ord))}\n\n if !@qual_to_array\n seq_qual=seq_qual.join(' ')\n end\n end\n \n end\n rescue EOFError\n raise \"Bad format in FastQ file\"\n end\n end\n \n return [seq_name,seq_fasta,seq_qual,comments]\n end",
"title": ""
},
{
"docid": "4977b4a8b64b1d3a7a81cb4dfead44f2",
"score": "0.4499426",
"text": "def parse_file_path(file_path)\n file_name = File.basename(file_path)\n file_name_split = file_name.split('_')\n\n sample_rate, format = file_name_split[4].split('.')\n\n opts = {\n uuid: file_name_split[0],\n start_offset: file_name_split[1].to_f,\n end_offset: file_name_split[2].to_f,\n channel: file_name_split[3].to_i,\n sample_rate: sample_rate.to_i,\n format: format\n }\n\n validate_uuid(opts)\n validate_start_offset(opts)\n validate_end_offset(opts)\n validate_channel(opts)\n validate_sample_rate(opts)\n validate_format(opts)\n\n opts\n end",
"title": ""
},
{
"docid": "32ecab24600d7b38977ed57af6669ec1",
"score": "0.44830754",
"text": "def match(argv1)\n return nil unless argv1\n regex = %r{(?>\n because[ ]the[ ]recipient[ ]is[ ]not[ ]accepting[ ]mail[ ]with[ ](?:attachments|embedded[ ]images) # AOL Phoenix\n |closed[ ]mailing[ ]list\n |Denied[ ]by[ ]policy\n |email[ ](?:\n not[ ]accepted[ ]for[ ]policy[ ]reasons\n # http://kb.mimecast.com/Mimecast_Knowledge_Base/Administration_Console/Monitoring/Mimecast_SMTP_Error_Codes#554\n |rejected[ ]due[ ]to[ ]security[ ]policies\n )\n |header[ ](?:are[ ]not[ ]accepted|error)\n |Mail[ ]from[ ].+[ ]rejected[ ]for[ ]policy[ ]reasons\n |message[ ](?:\n given[ ]low[ ]priority\n |not[ ]accepted[ ]for[ ]policy[ ]reasons\n )\n |Messages[ ]with[ ]multiple[ ]addresses\n |You[ ]have[ ]exceeded[ ]the[ ]the[ ]allowable[ ]number[ ]of[ ]posts[ ]without[ ]solving[ ]a[ ]captcha\n |Protocol[ ]violation\n |The[ ]email[ ]address[ ]used[ ]to[ ]send[ ]your[ ]message[ ]is[ ]not[ ]subscribed[ ]to[ ]this[ ]group\n )\n }ix\n\n return true if argv1 =~ regex\n return false\n end",
"title": ""
},
{
"docid": "17a9f1589137a3ce74f4437a9dea1a28",
"score": "0.44802535",
"text": "def gather call_id, options={}\n # TODO: fail on wrong options\n options[:prompt] = options[:audio].to_hash if options[:audio]\n dtmf, _headers = get \"calls/#{call_id}/gather\", options\n\n Types::DTMF.new dtmf\n end",
"title": ""
},
{
"docid": "67e739be73006e60622d914f63bb4b91",
"score": "0.44802037",
"text": "def example(*args)\n if args.count > 0\n @example = args.first\n validate_example_and_regex!\n end\n @example\n end",
"title": ""
},
{
"docid": "eaff5d3eb26f2abb64936c06b7150459",
"score": "0.44788587",
"text": "def match(argv1)\n return nil unless argv1\n regex = %r{(?>\n access[ ]denied[.][ ]IP[ ]name[ ]lookup[ ]failed\n |access[ ]from[ ]ip[ ]address[ ].+[ ]blocked\n |all[ ]mail[ ]servers[ ]must[ ]have[ ]a[ ]PTR[ ]record[ ]with[ ]a[ ]valid[ ]Reverse[ ]DNS[ ]entry\n |blacklisted[ ]by\n |Blocked[ ]-[ ]see[ ]https://support[.]proofpoint[.]com/dnsbl-lookup[.]cgi[?]ip=.+\n |can[']t[ ]determine[ ]Purported[ ]Responsible[ ]Address\n |cannot[ ]resolve[ ]your[ ]address\n |client[ ]host[ ].+[ ]blocked[ ]using\n |client[ ]host[ ]rejected:[ ](?:\n Abus[ ]detecte[ ]GU_EIB_0[24] # SFR\n |cannot[ ]find[ ]your[ ]hostname # Yahoo!\n |may[ ]not[ ]be[ ]mail[ ]exchanger\n |was[ ]not[ ]authenticated # Microsoft\n )\n |confirm[ ]this[ ]mail[ ]server\n |connection[ ](?:\n dropped\n |refused[ ]by\n |reset[ ]by[ ]peer\n |was[ ]dropped[ ]by[ ]remote[ ]host\n )\n |Connections[ ](?:\n not[ ]accepted[ ]from[ ]IP[ ]addresses[ ]on[ ]Spamhaus[ ]XBL\n |will[ ]not[ ]be[ ]accepted[ ]from[ ].+because[ ]the[ ]ip[ ]is[ ]in[ ]Spamhaus's[ ]list\n )\n |domain[ ]does[ ]not[ ]exist:\n |domain[ ].+[ ]mismatches[ ]client[ ]ip\n |dns[ ]lookup[ ]failure:[ ].+[ ]try[ ]again[ ]later\n |DNSBL:ATTRBL\n |Dynamic/zombied/spam[ ]IPs[ ]blocked\n |Email[ ]blocked[ ]by[ ](?:\n .+[.]barracudacentral[.]org\n |SPAMHAUS\n )\n |Fix[ ]reverse[ ]DNS[ ]for[ ].+\n |Go[ ]away\n |hosts[ ]with[ ]dynamic[ ]ip\n |IP[ ]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[.]\\d{1,3}[ ]is[ ]blocked[ ]by[ ]EarthLink # Earthlink\n |IP[/]domain[ ]reputation[ ]problems\n |is[ ](?:\n in[ ]a[ ]black[ ]list[ ]at[ ].+[.]spamhaus[.]org\n |not[ ]allowed[ ]to[ ]send[ ]mail[ ]from\n )\n |mail[ ]server[ ]at[ ].+[ ]is[ ]blocked\n |Messages[ ]from[ ].+[ ]temporarily[ ]deferred[ ]due[ ]to[ ]user[ ]complaints # Yahoo!\n |no[ ]access[ ]from[ ]mail[ ]server\n |No[ ]PTR[ ]Record[ ]found[.]\n |Not[ ]currently[ ]accepting[ ]mail[ ]from[ ]your[ ]ip # Microsoft\n |part[ ]of[ ]their[ ]network[ ]is[ ]on[ ]our[ ]block[ ]list\n |Please[ ]get[ ]a[ ]custom[ ]reverse[ ]DNS[ ]name[ ]from[ ]your[ ]ISP[ ]for[ ]your[ ]host\n |please[ ]use[ ]the[ ]smtp[ ]server[ ]of[ ]your[ ]ISP\n |Rejecting[ ]open[ ]proxy # Sendmail(srvrsmtp.c)\n |Reverse[ ]DNS[ ](?:failed|required)\n |Reverse[ ]DNS[ ]lookup[ ]for[ ]host[ ].+[ ]failed[ ]permanently\n |Server[ ]access[ ](?:\n .+[ ]forbidden[ ]by[ ]invalid[ ]RDNS[ ]record[ ]of[ ]your[ ]mail[ ]server\n |forbidden[ ]by[ ]your[ ]IP[ ]\n )\n |service[ ]permits[ ]\\d+[ ]unverifyable[ ]sending[ ]IPs\n |SMTP[ ]error[ ]from[ ]remote[ ]mail[ ]server[ ]after[ ]initial[ ]connection: # Exim\n |sorry,[ ](?:\n that[ ]domain[ ]isn'?t[ ]in[ ]my[ ]list[ ]of[ ]allowed[ ]rcpthosts\n |your[ ]remotehost[ ]looks[ ]suspiciously[ ]like[ ]spammer\n )\n |SPF[ ]record\n |SPF:[ ].+[ ]is[ ]not[ ]allowed[ ]to[ ]send[ ]mail.+[A-Z]{3}.+401\n |the[ ](?:email|domain|ip).+[ ]is[ ]blacklisted\n |This[ ]system[ ]will[ ]not[ ]accept[ ]messages[ ]from[ ]servers[/]devices[ ]with[ ]no[ ]reverse[ ]DNS\n |Too[ ]many[ ]spams[ ]from[ ]your[ ]IP # free.fr\n |unresolvable[ ]relay[ ]host[ ]name\n |Veuillez[ ]essayer[ ]plus[ ]tard.+[A-Z]{3}.+(?:103|510)\n |your[ ](?:\n network[ ]is[ ]temporary[ ]blacklisted\n |sender's[ ]IP[ ]address[ ]is[ ]listed[ ]at[ ].+[.]abuseat[.]org\n |server[ ]requires[ ]confirmation\n )\n |was[ ]blocked[ ]by[ ].+\n |we[ ]do[ ]not[ ]accept[ ]mail[ ]from[ ](?: # @mail.ru\n hosts[ ]with[ ]dynamic[ ]IP[ ]or[ ]generic[ ]dns[ ]PTR-records\n |dynamic[ ]ips\n )\n |http://www[.]spamcop[.]net/bl[.]\n )\n }xi\n\n return true if argv1 =~ regex\n return false\n end",
"title": ""
},
{
"docid": "32653b2eb5d858f5fbe25893a614f18c",
"score": "0.44774297",
"text": "def match(argv1)\n return nil unless argv1\n regex = %r{(?>\n connection[ ]timed[ ]out\n |could[ ]not[ ]find[ ]a[ ]gateway[ ]for\n |delivery[ ]time[ ]expired\n |Failed[ ]to[ ]deliver[ ]to[ ]domain[ ].+[ ]after[ ]\\d+[ ]tries\n |giving[ ]up[ ]on\n |it[ ]has[ ]not[ ]been[ ]collected[ ]after\n |message[ ](?:\n expired[ ]after[ ]sitting[ ]in[ ]queue[ ]for\n |timed[ ]out\n )\n |retry[ ]time[ ]not[ ]reached[ ]for[ ]any[ ]host[ ]after[ ]a[ ]long[ ]failure[ ]period\n |server[ ]did[ ]not[ ]respond\n |this[ ]message[ ]has[ ]been[ ]in[ ]the[ ]queue[ ]too[ ]long\n |was[ ]not[ ]reachable[ ]within[ ]the[ ]allowed[ ]queue[ ]period\n |Your[ ]message[ ]could[ ]not[ ]be[ ]delivered[ ]for[ ]more[ ]than\n )\n }ix\n\n return true if argv1 =~ regex\n return false\n end",
"title": ""
},
{
"docid": "a2877bcb4101fdcb8113b85c58f6b762",
"score": "0.44757798",
"text": "def test_parseargs_more_than_3\n sim = Simulator.new\n refute sim.parseargs(['1','2','3','4'])\n end",
"title": ""
},
{
"docid": "3d14e053cca8055d4cd98f67ed18ddb1",
"score": "0.4468079",
"text": "def wait_for_digit(timeout = 1)\n timeout = nil if timeout == -1\n timeout *= 1_000 if timeout\n input_component = execute_component_and_await_completion Punchblock::Component::Input.new :mode => :dtmf,\n :initial_timeout => timeout,\n :inter_digit_timeout => timeout,\n :grammar => {\n :value => grammar_accept.to_s\n }\n\n reason = input_component.complete_event.reason\n result = reason.respond_to?(:utterance) ? reason.utterance : nil\n parse_dtmf result\n end",
"title": ""
},
{
"docid": "facbcdb23e8733a2857686114b4c304a",
"score": "0.4467647",
"text": "def initialize(thePatterns, aDelta = nil)\n @patterns = validate_file_patterns(thePatterns)\n @delta = validate_delta(aDelta)\n end",
"title": ""
},
{
"docid": "689197224a71ec845a3a517a5002208c",
"score": "0.44667992",
"text": "def grep!( args )\n rex = %r{^#{self.prefix}#{@name}(?:=(.+))?$}\n index = args.index { |arg| rex =~ arg }\n\n if index.nil?\n @default\n else\n match = rex.match(args.delete_at(index))\n @converter.convert(match[1])\n end\n rescue Caty::OptionArgumentError => e\n e.option = @name\n raise e\n end",
"title": ""
},
{
"docid": "e46a3ed4c44d270cd85e9a8e02189be0",
"score": "0.44613817",
"text": "def analyze_call(input)\n\n\t\treturn if not input\n\t\treturn if not File.exist?(input)\n\n\t\tbname = File.expand_path(File.dirname(input))\n\t\tnum = File.basename(input)\n\t\tres = {}\n\n\t\t#\n\t\t# Create the signature database\n\t\t#\n\t\traw = WarVOX::Audio::Raw.from_file(input)\n\t\tfft = KissFFT.fftr(8192, 8000, 1, raw.samples)\n\n\t\tfreq = raw.to_freq_sig_txt()\n\n\t\t# Save the signature data\n\t\tres[:fprint] = freq\n\n\t\t#\n\t\t# Create a raw decompressed file\n\t\t#\n\n\t\t# Decompress the audio file\n\t\trawfile = Tempfile.new(\"rawfile\")\n\t\tdatfile = Tempfile.new(\"datfile\")\n\n\t\t# Data files for audio processing and signal graph\n\t\tcnt = 0\n\t\trawfile.write(raw.samples.pack('v*'))\n\t\tdatfile.write(raw.samples.map{|val| cnt +=1; \"#{cnt/8000.0} #{val}\"}.join(\"\\n\"))\n\t\trawfile.flush\n\t\tdatfile.flush\n\n\t\t# Data files for spectrum plotting\n\t\tfrefile = Tempfile.new(\"frefile\")\n\n\t\t# Calculate the peak frequencies for the sample\n\t\tmaxf = 0\n\t\tmaxp = 0\n\t\ttones = {}\n\t\tfft.each do |x|\n\t\t\trank = x.sort{|a,b| a[1].to_i <=> b[1].to_i }.reverse\n\t\t\trank[0..10].each do |t|\n\t\t\t\tf = t[0].round\n\t\t\t\tp = t[1].round\n\t\t\t\tnext if f == 0\n\t\t\t\tnext if p < 1\n\t\t\t\ttones[ f ] ||= []\n\t\t\t\ttones[ f ] << t\n\t\t\t\tif(t[1] > maxp)\n\t\t\t\t\tmaxf = t[0]\n\t\t\t\t\tmaxp = t[1]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\t# Save the peak frequency\n\t\tres[:peak_freq] = maxf\n\n\t\t# Calculate average frequency and peaks over time\n\t\tavg = {}\n\t\tpks = []\n\t\tpkz = []\n\t\tfft.each do |slot|\n\t\t\tpks << slot.sort{|a,b| a[1] <=> b[1] }.reverse[0]\n\t\t\tpkz << slot.sort{|a,b| a[1] <=> b[1] }.reverse[0..9]\n\t\t\tslot.each do |f|\n\t\t\t\tavg[ f[0] ] ||= 0\n\t\t\t\tavg[ f[0] ] += f[1]\n\t\t\tend\n\t\tend\n\n\t\t# Save the peak frequencies over time\n\t\tres[:peak_freq_data] = pks.map{|f| \"#{f[0]}-#{f[1]}\" }.join(\" \")\n\n\t\t# Generate the frequency file\n\t\tavg.keys.sort.each do |k|\n\t\t\tavg[k] = avg[k] / fft.length\n\t\t\tfrefile.write(\"#{k} #{avg[k]}\\n\")\n\t\tend\n\t\tfrefile.flush\n\n\t\t# Count significant frequencies across the sample\n\t\tfcnt = {}\n\t\t0.step(4000, 5) {|f| fcnt[f] = 0 }\n\t\tpkz.each do |fb|\n\t\t\tfb.each do |f|\n\t\t\t\tfdx = ((f[0] / 5.0).round * 5.0).to_i\n\t\t\t\tfcnt[fdx] += 0.1\n\t\t\tend\n\t\tend\n\n\t\t#\n\t\t# Signature processing\n\t\t#\n\n\t\tsproc = SignalProcessor.new\n\t\tsproc.data =\n\t\t{\n\t\t\t:raw => raw,\n\t\t\t:freq => freq,\n\t\t\t:fcnt => fcnt,\n\t\t\t:fft => fft,\n\t\t\t:pks => pks,\n\t\t\t:pkz => pkz,\n\t\t\t:maxf => maxf,\n\t\t\t:maxp => maxp\n\t\t}\n\n\t\tWarVOX::Config.signatures_load.each do |sigfile|\n\t\t\tbegin\n\t\t\t\tstr = File.read(sigfile, File.size(sigfile))\n\t\t\t\tsproc.proc(str)\n\t\t\trescue ::Exception => e\n\t\t\t\t$stderr.puts \"DEBUG: Caught exception in #{sigfile}: #{e} #{e.backtrace}\"\n\t\t\tend\n\t\t\tbreak if sproc.line_type\n\t\tend\n\n\t\t# Save the guessed line type\n\t\tres[:line_type] = sproc.line_type\n\n\t\t# Save any matched signatures\n\t\tres[:signatures] = sproc.signatures.map{|s| \"#{s[0]}:#{s[1]}:#{s[2]}\" }.join(\"\\n\")\n\n\t\tpng_big = Tempfile.new(\"big\")\n\t\tpng_big_dots = Tempfile.new(\"bigdots\")\n\t\tpng_big_freq = Tempfile.new(\"bigfreq\")\n\t\tpng_sig = Tempfile.new(\"signal\")\n\t\tpng_sig_freq = Tempfile.new(\"sigfreq\")\n\n\t\t# Plot samples to a graph\n\t\tplotter = Tempfile.new(\"gnuplot\")\n\n\t\tplotter.puts(\"set ylabel \\\"Signal\\\"\")\n\t\tplotter.puts(\"set xlabel \\\"Seconds\\\"\")\n\t\tplotter.puts(\"set terminal png medium size 640,480 transparent\")\n\t\tplotter.puts(\"set output \\\"#{png_big.path}\\\"\")\n\t\tplotter.puts(\"plot \\\"#{datfile.path}\\\" using 1:2 title \\\"#{num}\\\" with lines\")\n\t\tplotter.puts(\"set output \\\"#{png_big_dots.path}\\\"\")\n\t\tplotter.puts(\"plot \\\"#{datfile.path}\\\" using 1:2 title \\\"#{num}\\\" with dots\")\n\n\t\tplotter.puts(\"set terminal png medium size 640,480 transparent\")\n\t\tplotter.puts(\"set ylabel \\\"Power\\\"\")\n\t\tplotter.puts(\"set xlabel \\\"Frequency\\\"\")\n\t\tplotter.puts(\"set output \\\"#{png_big_freq.path}\\\"\")\n\t\tplotter.puts(\"plot \\\"#{frefile.path}\\\" using 1:2 title \\\"#{num} - Peak #{maxf.round}hz\\\" with lines\")\n\n\t\tplotter.puts(\"set ylabel \\\"Signal\\\"\")\n\t\tplotter.puts(\"set xlabel \\\"Seconds\\\"\")\n\t\tplotter.puts(\"set terminal png small size 160,120 transparent\")\n\t\tplotter.puts(\"set format x ''\")\n\t\tplotter.puts(\"set format y ''\")\n\t\tplotter.puts(\"set output \\\"#{png_sig.path}\\\"\")\n\t\tplotter.puts(\"plot \\\"#{datfile.path}\\\" using 1:2 notitle with lines\")\n\n\t\tplotter.puts(\"set ylabel \\\"Power\\\"\")\n\t\tplotter.puts(\"set xlabel \\\"Frequency\\\"\")\n\t\tplotter.puts(\"set terminal png small size 160,120 transparent\")\n\t\tplotter.puts(\"set format x ''\")\n\t\tplotter.puts(\"set format y ''\")\n\t\tplotter.puts(\"set output \\\"#{png_sig_freq.path}\\\"\")\n\t\tplotter.puts(\"plot \\\"#{frefile.path}\\\" using 1:2 notitle with lines\")\n\t\tplotter.flush\n\n\t\tsystem(\"#{WarVOX::Config.tool_path('gnuplot')} #{plotter.path}\")\n\t\tFile.unlink(plotter.path)\n\t\tFile.unlink(datfile.path)\n\t\tFile.unlink(frefile.path)\n\t\tplotter.close\n\t\tdatfile.close\n\t\tfrefile.path\n\n\t\t::File.open(png_big.path, 'rb') { |fd| res[:png_big] = fd.read }\n\t\t::File.open(png_big_dots.path, 'rb') { |fd| res[:png_big_dots] = fd.read }\n\t\t::File.open(png_big_freq.path, 'rb') { |fd| res[:png_big_freq] = fd.read }\n\t\t::File.open(png_sig.path, 'rb') { |fd| res[:png_sig] = fd.read }\n\t\t::File.open(png_sig_freq.path, 'rb') { |fd| res[:png_sig_freq] = fd.read }\n\n\t\t[png_big, png_big_dots, png_big_freq, png_sig, png_sig_freq ].map {|x| x.unlink; x.close }\n\n\n\t\t# Detect DTMF and MF tones\n\t\tdtmf = ''\n\t\tmf = ''\n\t\tpfd = IO.popen(\"#{WarVOX::Config.tool_path('dtmf2num')} -r 8000 1 16 #{rawfile.path} 2>/dev/null\")\n\t\tpfd.each_line do |line|\n\t\t\tline = line.strip\n\t\t\tif(line.strip =~ /^- MF numbers:\\s+(.*)/)\n\t\t\t\tnext if $1 == 'none'\n\t\t\t\tmf = $1\n\t\t\tend\n\t\t\tif(line.strip =~ /^- DTMF numbers:\\s+(.*)/)\n\t\t\t\tnext if $1 == 'none'\n\t\t\t\tdtmf = $1\n\t\t\tend\n\t\tend\n\t\tpfd.close\n\t\tres[:dtmf] = dtmf\n\t\tres[:mf] = mf\n\n\n\t\ttmp_wav = Tempfile.new(\"wav\")\n\t\ttmp_mp3 = Tempfile.new(\"mp3\")\n\n\t\t# Generate a WAV file from raw linear PCM\n\t\t::File.open(tmp_wav.path, \"wb\") do |fd|\n\t\t\tfd.write(raw.to_wav)\n\t\tend\n\n\t\t# Default samples at 8k, bump it to 32k to get better quality\n\t\tsystem(\"#{WarVOX::Config.tool_path('lame')} -b 32 #{tmp_wav.path} #{tmp_mp3.path} >/dev/null 2>&1\")\n\n\t\tFile.unlink(rawfile.path)\n\t\trawfile.close\n\n\t\t::File.open(tmp_mp3.path, \"rb\") { |fd| res[:mp3] = fd.read }\n\n\t\t[tmp_wav, tmp_mp3].map {|x| x.unlink; x.close }\n\n\t\tclear_zombies()\n\n\t\tres\n\tend",
"title": ""
},
{
"docid": "85928015f2e2954b4ee6f2459b7b552d",
"score": "0.4446111",
"text": "def parse_args cmd\n args = cmd.strip.split(/\\s+/)\n cmd = args.shift\n if cmd !~ %r{#{CMD_FORMAT.keys.map { |c| \"^#{c}$\" }.join '|'}}\n raise InvalidCommandError, \"Invalid command: #{cmd}.\"\n end\n files = args.slice_before { |co| co =~ /^-/ }.to_a.last.delete_if { |co| co =~ /^-/ }\n files.shift while CMD_FORMAT[cmd].max < files.size\n files.keep_if { |file| file =~ /^\\w+(\\.\\w+)+$/ } if cmd == 'view'\n unless CMD_FORMAT[cmd].include? files.size\n raise RequiredFilesMissingError,\n \"Required #{CMD_FORMAT[cmd].join ' or '} file(s), \" <<\n \"#{CMD_FORMAT[cmd][0] - files.size} missing.\"\n end\n files\n end",
"title": ""
},
{
"docid": "5f4d5408e661737d33cd36287bb29448",
"score": "0.4438644",
"text": "def command_line_arguments\n %W(\n --fail-fast\n ) + strategy.spec_files(mutation.subject)\n end",
"title": ""
},
{
"docid": "35bd65b9dc2ccb9aab87dac84fefa330",
"score": "0.44381773",
"text": "def match(argv1)\n return nil unless argv1\n regex = %r{(?>\n improper[ ]use[ ]of[ ]8-bit[ ]data[ ]in[ ]message[ ]header\n |message[ ](?:\n header[ ]size,[ ]or[ ]recipient[ ]list,[ ]exceeds[ ]policy[ ]limit\n |mime[ ]complexity[ ]exceeds[ ]the[ ]policy[ ]maximum\n )\n |routing[ ]loop[ ]detected[ ][-][-][ ]too[ ]many[ ]received:[ ]headers\n |this[ ]message[ ]contains?[ ](?:\n invalid[ ]MIME[ ]headers\n |improperly[-]formatted[ ]binary[ ]content\n |text[ ]that[ ]uses[ ]unnecessary[ ]base64[ ]encoding\n )\n )\n }xi\n\n return true if argv1 =~ regex\n return false\n end",
"title": ""
},
{
"docid": "d30c6ca7ba42675430b27188f0de0681",
"score": "0.44355977",
"text": "def parse_srt_files\r\n\tARGV.each do |file|\r\n\t\tputs \"\"\r\n\t\tdescription = parse_srt_file file\r\n\t\ttimeshift description\r\n\t\tsave_results description\r\n\tend\r\n\r\n\tputs \"\"\r\n\tputs \"DONE!\"\r\nend",
"title": ""
},
{
"docid": "ec1c6add64210ddb97e6bb569e0248de",
"score": "0.4431108",
"text": "def error_message_for_file_to_convert\n if not self.class::EXTENSION_WHITE_LIST_WITH_DOT.include?(original_filename_extension)\n 'unsupported format'\n else\n info = Info.new(@original_file.path, false)\n if !info.valid?\n 'invalid audio'\n elsif info.duration < self.class::MIN_DURATION\n 'invalid duration'\n end\n end\n end",
"title": ""
},
{
"docid": "a5c43c061f7f16f1df4fe1b96f1f055b",
"score": "0.44304213",
"text": "def initialize(args)\n @opt = OptionParser.new do |opts| # rubocop:disable Metrics/BlockLength\n opts.banner = 'Usage: fast expression <files> [options]'\n opts.on('-d', '--debug', 'Debug fast engine') do\n @debug = true\n end\n\n opts.on('--ast', 'Print AST instead of code') do\n @show_sexp = true\n end\n\n opts.on('--captures', 'Print only captures of the patterns and skip node results') do\n @captures = true\n end\n\n opts.on('--headless', 'Print results without the file name in the header') do\n @headless = true\n end\n\n opts.on('--pry', 'Jump into a pry session with results') do\n @pry = true\n end\n\n opts.on('-c', '--code', 'Create a pattern from code example') do\n if @pattern\n @from_code = true\n @pattern = Fast.ast(@pattern).to_sexp\n debug 'Expression from AST:', @pattern\n end\n end\n\n opts.on('-s', '--similar', 'Search for similar code.') do\n @similar = true\n @pattern = Fast.expression_from(Fast.ast(@pattern))\n debug \"Looking for code similar to #{@pattern}\"\n end\n\n opts.on_tail('--version', 'Show version') do\n puts Fast::VERSION\n exit\n end\n\n opts.on_tail('-h', '--help', 'Show help. More at https://jonatas.github.io/fast') do\n @help = true\n end\n\n @pattern, *@files = args.reject { |arg| arg.start_with? '-' }\n end\n @opt.parse! args\n\n @files = [*@files]\n @files.reject! { |arg| arg.start_with?('-') }\n end",
"title": ""
},
{
"docid": "5057e14980bc1c1e9182bd1b744a2d14",
"score": "0.44130367",
"text": "def glob_match_func(*args)\n glob_match(args[0], args[1])\n end",
"title": ""
},
{
"docid": "f514c9c523a995837d4840dab241239a",
"score": "0.44003475",
"text": "def parse_args cmd\n args = cmd.strip.split(/\\s+/)\n cmd = args.shift\n if cmd !~ %r{#{CMD_FORMAT.keys.map { |c| \"^#{c}$\" }.join '|'}}\n raise InvalidCommandError, \"Invalid command: #{cmd}.\"\n end\n files = args.slice_before { |co| co =~ /^-/ }.to_a.last.delete_if { |co| co =~ /^-/ }\n files.shift while CMD_FORMAT[cmd].max < files.size\n files.keep_if { |file| file =~ /^\\w+(\\.\\w+)+$/ } if cmd == 'mem'\n unless CMD_FORMAT[cmd].include? files.size\n raise RequiredFilesMissingError,\n \"Required #{CMD_FORMAT[cmd].join ' or '} file(s), \" <<\n \"#{CMD_FORMAT[cmd][0] - files.size} missing.\"\n end\n files\n end",
"title": ""
},
{
"docid": "0e021aa0914d5c7f01d6f8385c04a138",
"score": "0.4398056",
"text": "def parsePlayParams(p)\n\t\tpassedInAnswer = \"\"\n\t\tunless p.length < 1 then\n\t\t\t@verbose = true if p.include?(\"v\") || p.include?(\"-v\")\n\n\t\t\t# Look for \"XXXX\" type string passed in and save it\n\t\t\tpassedInAnswer = p.select { |e| e.length == 4 }.join\t\t# if a game pattern string was passed in\t\t\t\n\t\tend\n\n\t\tif passedInAnswer != \"\"\n\t\t\tputs \"playing as CodeMaker : #{passedInAnswer.upcase}\" \n\t\t\t@computerCodeBreaker = true\n\t\t\tsetTheAnswer(passedInAnswer.upcase)\n\t\telse\n\t\t\tsetTheAnswer()\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3506161ba62f6ada67a6641d866a38ab",
"score": "0.4395299",
"text": "def start_argument_parsing\n file_name = evaluate_file_name(get_argument_file_name(@command_arguments))\n get_specified_file_content(file_name)\n end",
"title": ""
},
{
"docid": "f4ad838ef0ef096c811f7528f6c5779b",
"score": "0.43884",
"text": "def check_file_filter(options={})\n # returns true if matches file filter regexp on a particular line number\n options = { :regexp => '', # regexp to use for filtering file\n :line_no => 1, # line no containing regexp\n }.merge(options)\n\n\n if (options[:line_no] < 1)\n abort \"ERROR: invalid line_no passed to 'check_file_filter'!\\n\"\n end\n\n if @infile.size > 0\n regexp_line = @infile.readlines[options[:line_no] - 1]\n @infile.rewind # reset file pointer back to 0\n\n begin\n regexp_line.match(options[:regexp]) # return value\n rescue\n print \"Error scanning through file : #{options[:inputfilename]} at line no #{line_no} \\n\"\n print \" Likely an invalid characer, please check\\n\"\n raise\n end\n end\n\n end",
"title": ""
},
{
"docid": "5db4f7bd388fa80e04d36c97a1527fa5",
"score": "0.4378824",
"text": "def throw\n options = []\n options << \"-framerate ntsc\"\n options << \"-video_size #{@resolution}\"\n options << \"-f x11grab -i #{ENV['DISPLAY']}\"\n options << \"-f alsa -i pulse\"\n options << \"-vcodec libx264 -tune zerolatency -crf 26 -preset ultrafast\"\n options << \"-f mpegts udp://#{host}:#{port}?pkt_size=#{packet_size}\"\n `ffmpeg #{options.join(' ')}`\n end",
"title": ""
},
{
"docid": "ef4c4b3e610769aa55243ac93b8e2b9f",
"score": "0.43666548",
"text": "def parse_arguments\n expect_exactly(0, \"arguments\")\n end",
"title": ""
},
{
"docid": "e3b11dde55c90f78e271718bcd57f9b0",
"score": "0.43659112",
"text": "def test_match_args_valid\n sim = Simulator.new\n assert sim.match_args('1')\n end",
"title": ""
},
{
"docid": "9da888b40c8b48ffa066db3e0d02d157",
"score": "0.43657213",
"text": "def test_check_existent_file\r\n file_args = [\"../CS1632_Deliverable6/File1.rpn\"]\r\n val = 0\r\n assert_output(\"\") {val = @arg_checker.read_file(file_args)}\r\n assert_equal val, [[\"LET A 1\", \"LET B 2\", \"PRINT A B +\"]]\r\n end",
"title": ""
},
{
"docid": "d9b9028e091b068030f509c34ff44e1c",
"score": "0.43555757",
"text": "def initialize(options = {})\n if options[:raw_response]\n @raw_response = options[:raw_response]\n elsif options[:file]\n if options[:ffmpeg_binary]\n @ffmpeg_binary = options[:ffmpeg_binary]\n raise RuntimeError, \"ffmpeg could not be found (trying #{@ffmpeg_binary})\" unless FileTest.exist?(@ffmpeg_binary)\n else\n # assume it is in the unix path\n raise RuntimeError, 'ffmpeg could not be found (expected ffmpeg to be found in the Unix path)' unless FileTest.exist?(`which ffmpeg`.chomp)\n @ffmpeg_binary = \"ffmpeg\"\n end\n\n file = options[:file]\n @filename = File.basename(file)\n @path = File.dirname(file)\n @full_filename = file\n raise TranscoderError::InputFileNotFound, \"File not found (#{file})\" unless FileTest.exist?(file.gsub(\"\\\"\",\"\"))\n @raw_response = `#{@ffmpeg_binary} -i #{@full_filename} 2>&1`\n else\n raise ArgumentError, \"Must supply either an input file or a pregenerated response\" if options[:raw_response].nil? and file.nil?\n end\n\n metadata = /(Input \\#.*)\\n.+\\n\\Z/m.match(@raw_response)\n \n if /Unknown format/i.match(@raw_response) || metadata.nil?\n @unknown_format = true\n elsif /Duration: N\\/A/im.match(@raw_response)\n# elsif /Duration: N\\/A|bitrate: N\\/A/im.match(@raw_response)\n @unreadable_file = true\n @raw_metadata = metadata[1] # in this case, we can at least still get the container type\n else\n @raw_metadata = metadata[1]\n end\n end",
"title": ""
},
{
"docid": "1679aa99cb62d5720a1685d01cd26cc3",
"score": "0.43530953",
"text": "def extract_ais_fields_from_filename(filename)\n pn = Pathname.new(filename)\n matches = /vdm-ais-type-(\\d)d(\\d+)f(\\d+)\\.txt/.match(pn.basename.to_s)\n return nil if matches.nil?\n matches.captures\nend",
"title": ""
},
{
"docid": "1f6c734b24bff48aa11e8374e63d2c6f",
"score": "0.4352976",
"text": "def get_phone_numbers\n phone_numbers = ARGV.drop(3)\n\n phone_array = []\n \n phone_array = phone_numbers[0] ? argv_numbers(phone_numbers) : entered_numbers\n end",
"title": ""
},
{
"docid": "0e8e79437597413814bed59c91d3516e",
"score": "0.43462294",
"text": "def audio_file_list(arg,files_to_process)\n\targ = File.expand_path(arg)\n\tif File.directory?(arg)\n\t\taudio_files_in_dir = Dir.glob(File.join(arg,ALLOWED_AUDIO_FILE_EXTENSIONS))\n\t\taudio_files_in_dir.each do |audio_filename|\n\t\t\tfiles_to_process << audio_filename\n\t\tend\n\telsif File.extname(arg).eql? \".txt\"\n\t\taudio_files_in_txt = File.read(arg).split(\"\\n\")\n\t\taudio_files_in_txt.each do |audio_filename|\n\t\t\taudio_filename = File.expand_path(audio_filename)\n\t\t\tif File.exists?(audio_filename)\n\t\t\t\tfiles_to_process << audio_filename\n\t\t\telse\n\t\t\t\tSTDERR.puts \"Could not find: #{audio_filename}\"\n\t\t\tend\n\t\tend\n\telsif File.exists? arg\n\t\tfiles_to_process << arg\n\telse\n\t\tSTDERR.puts \"Could not find: #{arg}\"\n\tend\n\tfiles_to_process\nend",
"title": ""
},
{
"docid": "53917a4b884313ead13f2ebf790b8e79",
"score": "0.4340228",
"text": "def regex_match_func(*args)\n regex_match(args[0], args[1])\n end",
"title": ""
},
{
"docid": "d026052b17771f35904a6fa05acef418",
"score": "0.4339456",
"text": "def exigrep_limiters\n args = []\n\n get_request(:limit_sender, :shellsafe) {|val| args << \"-f #{val}\"}\n get_request(:limit_recipient, :shellsafe) {|val| args << \"-r #{val}\"}\n get_request(:limit_younger_than, :shellsafe) {|val| args << \"-y #{val}\"}\n get_request(:limit_older_than, :shellsafe) {|val| args << \"-o #{val}\"}\n get_request(:limit_frozen_only, :boolean) {|val| args << \"-z\"}\n get_request(:limit_unfrozen_only, :boolean) {|val| args << \"-x\"}\n\n args\n end",
"title": ""
},
{
"docid": "9aa73f371289ad0cd831742e0f2dd9d9",
"score": "0.4338536",
"text": "def match(argv1)\n return nil unless argv1\n regex = %r{(?>\n because[ ]the[ ]recipient[ ]is[ ]only[ ]accepting[ ]mail[ ]from[ ]\n specific[ ]email[ ]addresses # AOL Phoenix\n |Bounced[ ]Address # SendGrid|a message to an address has previously been Bounced.\n |due[ ]to[ ]extended[ ]inactivity[ ]new[ ]mail[ ]is[ ]not[ ]currently[ ]\n being[ ]accepted[ ]for[ ]this[ ]mailbox\n |has[ ]restricted[ ]SMS[ ]e-mail # AT&T\n |http://postmaster[.]facebook[.]com/.+refused[ ]due[ ]to[ ]recipient[ ]preferences # Facebook\n |IS[ ]NOT[ ]ACCEPTING[ ]ANY[ ]MAIL\n |permanent[ ]failure[ ]for[ ]one[ ]or[ ]more[ ]recipients[ ][(].+:blocked[)]\n |RESOLVER[.]RST[.]NotAuthorized # Microsoft Exchange\n |This[ ]account[ ]is[ ]protected[ ]by\n |user[ ](?:\n not[ ]found # Filter on MAIL.RU\n |reject\n )\n |we[ ]failed[ ]to[ ]deliver[ ]mail[ ]because[ ]the[ ]following[ ]address\n [ ]recipient[ ]id[ ]refuse[ ]to[ ]receive[ ]mail # Willcom\n )\n |You[ ]have[ ]been[ ]blocked[ ]by[ ]the[ ]recipient\n }ix\n\n return true if argv1 =~ regex\n return false\n end",
"title": ""
},
{
"docid": "4ef13324dbdcf16cd692407ea4115851",
"score": "0.43376696",
"text": "def error_message_for_converted_files\n m4a_path, ogg_path = @converted_files[:m4a], @converted_files[:ogg]\n if !@original_filename_without_extension.is_a?(String)\n 'invalid filename'\n elsif !m4a_path.instance_of?(String) || !ogg_path.instance_of?(String)\n 'invalid paths'\n elsif [m4a_path, ogg_path].map{ |p| File.extname(p) } != %w(.m4a .ogg)\n 'invalid extension'\n else\n\n m4a_duration, ogg_duration = \n if durations?\n [ durations[:m4a], durations[:ogg] ]\n else\n if !(m4a_info = Info.new(m4a_path, false)).valid? || !(ogg_info = Info.new(ogg_path, false)).valid?\n return 'invalid video'\n end\n [ m4a_info.duration, ogg_info.duration ]\n end\n\n if [m4a_duration, ogg_duration].min < self.class::MIN_DURATION\n 'invalid duration'\n elsif !similar_durations?(m4a_duration, ogg_duration)\n 'invalid duration difference'\n end\n\n end\n\n end",
"title": ""
},
{
"docid": "7d482d2daea91de7fcfd960d218894f3",
"score": "0.4332802",
"text": "def runRegex fd\n rx = @config.searchArgument\n command = fd.each_line.detect do |line|\n rx.match line\n end\n raise CommandNotFound, \"Did not find a regex-ed command in file `#{fd.path}`\" unless command\n command.gsub!(rx, '') if @config.stripMatched\n\n applyCommand command, fd\n end",
"title": ""
},
{
"docid": "4dfbe25987da339d2a9fc0cdef3926ad",
"score": "0.43282732",
"text": "def DVB_retrieve(file_in) #generate a hash with key = mux frequency => [program]\n f = File.open(\"channels.conf\")\n channels = Hash.new\n f.each do |line|\n s = line.split(/:/)\n program = Programs.new(*s) \n (channels[program.frequency] ||= []) << program\n end\n return channels\nend",
"title": ""
},
{
"docid": "1dbb923dff0595e233538a89d2503a29",
"score": "0.43243524",
"text": "def glob(pattern, *args); end",
"title": ""
},
{
"docid": "3f955e220dffd04ea243d3ec90505023",
"score": "0.4312904",
"text": "def ffmpeg_build\n /(\\n\\s*)(built on.*)(\\n)/.match(@raw_response)[2]\n end",
"title": ""
},
{
"docid": "3c5a27c0289eda8f77cfc38b26956833",
"score": "0.43110672",
"text": "def process_args (args)\n @report, @mask = :short_report, /./\n\n args.each do |arg|\n if arg == '-l'\n @report = :long_report\n else\n @mask = arg\n end\n end\n\n end",
"title": ""
},
{
"docid": "291d47c7ea1b7c9dffdfcfe03ae02ccc",
"score": "0.43109572",
"text": "def rx(list, opts={})\n Regexp.new pattern(list, opts)\n end",
"title": ""
},
{
"docid": "49f96d665f355eafb45a56a4063ee3f4",
"score": "0.43093264",
"text": "def parse_file_name(name)\n\n matches = Parser.parse_file_name(name)\n if ( !matches || matches['name'] == nil ||\n matches['season'] == nil || matches['episode'] == nil )\n raise GetMeSubsError.new(\"Failed to recognize name, season or episode of serial.\")\n end\n @name = matches['name'].gsub(/[^a-zA-Z]+/, ' ').strip # example: 'the flash'\n @season = matches['season'] # example: '01'\n @episode = matches['episode'] # example: '03'\n \n end",
"title": ""
},
{
"docid": "979633c6227ac1ccd14ce5b9c0cfff5c",
"score": "0.4308259",
"text": "def parse_file_path(file_path)\n file_name = File.basename(file_path)\n file_name_split = file_name.split('_')\n\n colour, format = file_name_split[7].split('.')\n\n opts = {\n uuid: file_name_split[0],\n start_offset: file_name_split[1].to_f,\n end_offset: file_name_split[2].to_f,\n channel: file_name_split[3].to_i,\n sample_rate: file_name_split[4].to_i,\n window: file_name_split[5].to_i,\n window_function: file_name_split[6],\n colour: colour,\n format: format\n }\n\n validate_uuid(opts)\n validate_start_offset(opts)\n validate_end_offset(opts)\n validate_channel(opts)\n validate_sample_rate(opts)\n validate_window(opts)\n validate_window_function(opts)\n validate_colour(opts)\n validate_format(opts)\n\n opts\n end",
"title": ""
},
{
"docid": "09a3838b492c36a4f8f90fd3c0b19e90",
"score": "0.43022838",
"text": "def usage\n puts \"Usage: #{$0} [<options> ...] <inputfile>\"\n puts \"Options:\"\n puts \" -o --output {<filename>|auto} Set the output file\"\n puts \" -T --temp-file {<file>|auto} Change the temp file for two-pass\"\n puts \" -L --log {<filename>|auto} Change the log file\"\n puts \" -2 --two-pass Enable two-pass encoding\"\n puts \" -1 --one-pass Disable two-pass encoding\"\n puts \" -S --skip-first Skip the first pass (advanced only)\"\n puts \" --old-stats Use old statistics file (advanced only)\"\n puts \" --skip-stats Do not autodetect (advanced only)\"\n puts \" -A --append <options> Append <options> to BOTH encode passes\"\n puts \" -R --rip-from <device> <title> Rip dvd://<title> from <device> to <inputfile> first\"\n puts \" --rip-only Don't encode, just rip the DVD\"\n puts \" -L --rip-lang <lang-id> Set the rip subtitle language (after -R) (default: en)\"\n puts \" --subid <subtitle-index> Set the subtitle language by numerical ID\"\n puts \" --eject Eject after ripping from DVD\"\n puts \" -q --quality {1..100} Quality (affects bitrate, default is 50 for onepass)\"\n puts \" -M --size <size> Calculate bitrate from the size given (in megabytes)\"\n puts \" -P --no-preview Disable the preview of what will be ripped from DVD\"\n puts \" -p --pretend Don't actually execute any commands\"\n puts \" -y --yes Do not ask confirm the various transcode phases\"\n puts \" -I --iphone Make iphone-compatible video\"\n exit\nend",
"title": ""
},
{
"docid": "d90c0d4d0fffc92ac124fb54eece50b3",
"score": "0.42971396",
"text": "def match(args)\n args = args.dup\n types = @specs.map{|t,s|t}\n case types\n when [:opt, :req]\n opt, req = @specs.map{|t,s|s}\n return nil unless (req.length..(req.length+opt.length)) === args.size\n args[0...-req.length].zip(opt).to_a + req.zip(args[-req.length..-1]).to_a\n else\n # [reqs, opts, rest, reqs]\n partial = []\n i = 0\n if types[i] == :req\n partial.push @specs[i][1]\n i += 1\n else\n partial.push []\n end\n if types[i] == :opt\n partial.push @specs[i][1]\n i += 1\n else\n partial.push []\n end\n if types[i] == :res\n partial.push @specs[i][1]\n i += 1\n else\n partial.push []\n end\n if types[i] == :req\n partial.push @specs[i][1]\n i += 1\n else\n partial.push []\n end\n return nil unless i == types.length\n reqs, opts, rest, reqs2 = partial\n raise unless rest.length < 2\n\n len_min = reqs.length + reqs2.length\n if rest.empty?\n len_max = reqs.length + opts.length + reqs2.length\n return nil unless (len_min..len_max) === args.length\n else\n return nil unless len_min <= args.length\n end\n reqs_args = args.shift(reqs.length)\n reqs2_args = args.pop(reqs2.length)\n opts_args = args.shift([opts.length, args.length].min)\n rest_args = args\n\n rest_spec = rest[0]\n return [\n *reqs_args.zip(reqs),\n *opts_args.zip(opts),\n *(rest_spec ? rest_args.map{|a|[a, rest_spec]} : []),\n *reqs2_args.zip(reqs2),\n ]\n end\n end",
"title": ""
},
{
"docid": "87ebe5b312d269f0d52ed3b5d1ff5925",
"score": "0.42911813",
"text": "def process_inputs(file)\n\t\tinput_file = FileReader.new(file)\n\t\tputs \"\\n\"\n\n\t\tinput_file.contents.each_with_index do |test_string, i|\n\t\t\toutput = \"accept\" if self.valid_string?(test_string)\n\t\t\toutput ||= \"reject\"\n\n\t\t\tputs output\n\t\tend\n\tend",
"title": ""
},
{
"docid": "786774d48ca1c3aa16018eeafd2c9537",
"score": "0.4290533",
"text": "def test_4a_two_valid_arguments_name_mm_dd\n output = `./cheers Abby 08/25`\n expected = <<EOS\nGive me an... A\nGive me a... B\nGive me a... B\nGive me a... Y\nAbby’s just GRAND!\n\nAwesome! Your birthday is in 124 days! Happy Birthday in advance!\nEOS\n assert_equal expected, output\n end",
"title": ""
},
{
"docid": "fdddc93b97cb86d8d348f3caf20f9d8c",
"score": "0.42838174",
"text": "def sanity_check_arguments(args)\n raise UsageError, \"usage is: display_name_inserter.rb <rdf_file> <display_names_input_file> <locale> [filter_file] <n3_output_file> [ok]\" unless (3..5).include?(args.length)\n\n \tif args[-1].downcase == 'ok'\n\t ok = true\n\t args.pop\n\telse\n\t ok = false\n end\n\n n3_output_file = args.pop\n raise UsageError, \"File '#{n3_output_file}' already exists. specify 'ok' to overwrite it.\" if File.exist?(n3_output_file) && !ok\n\n rdf_file = args[0]\n raise UsageError, \"File '#{rdf_file}' does not exist.\" unless File.exist?(rdf_file)\n\n display_names_input_file = args[1]\n raise UsageError, \"File '#{display_names_input_file}' does not exist.\" unless File.exist?(display_names_input_file)\n\n locale = args[2]\n raise UsageError, \"Locale should be like 'ab' or 'ab-CD'.\" unless /^[a-z]{2}(-[A-Z]{2})?$/ =~ locale\n\n filter_file = args[3]\n raise UsageError, \"File '#{filter_file}' does not exist.\" if filter_file && !File.exist?(filter_file)\n filter = DisplayNameCommon.load_filter(filter_file)\n\n return rdf_file, display_names_input_file, locale, filter, n3_output_file\n end",
"title": ""
},
{
"docid": "44ecd5bb9d07165d0bfaee76bbf08db8",
"score": "0.42805272",
"text": "def emit_match_pattern=(_arg0); end",
"title": ""
},
{
"docid": "c417a40b9efaafb2b8ab128be7952f5d",
"score": "0.42767012",
"text": "def read(*args)\n case args.size\n when 0\n read_all\n when 1\n read_part(args[0].to_i, \"\")\n when 2\n read_part(args[0].to_i, args[1])\n else\n raise ArgumentError, \"wrong number of arguments (#{args.size} for 0 .. 2)\"\n end\n end",
"title": ""
},
{
"docid": "0a064e769c12c4693263f9c3df643932",
"score": "0.42739454",
"text": "def usage\n \"#{at_nick} <words> - if <words> matches a regular expression defined in the Chatfile, responds with the specified response\"\n end",
"title": ""
},
{
"docid": "80c7528c9bee2f2edb83524bd25440bc",
"score": "0.42733774",
"text": "def dtmf2_params\n params.require(:dtmf2).permit(:isActive, :sessionId, :direction, :callerNumber, :destinationNumber, :dtmfDigits, :recordingUrl, :durationInSeconds, :currencyCode, :amount)\n end",
"title": ""
}
] |
95cd46db760099aabfb72d43cea6b454
|
want to pluck all the words out of the sentencecan't use .split, etc.
|
[
{
"docid": "8f9052164a1287b3ff967c45f3fde95d",
"score": "0.6793797",
"text": "def words\n arr = []\n counter = 0\n string = \"\"\n while counter < self.length\n if self.text[counter] == \" \" #a space means a word has ended which means we need to push a new one in\n arr.push(string)\n string = \"\" #resets the value of string since we're now creating a new word\n elsif counter == self.length - 1 #deals with the edge case of the last item in the array\n string += self.text[counter]\n arr.push(string)\n else\n string += self.text[counter]\n end\n counter += 1\n end\n arr\n end",
"title": ""
}
] |
[
{
"docid": "55b2db708ce983114042e16be39eb1fb",
"score": "0.77765435",
"text": "def words\n @phrase.split(' ')\n end",
"title": ""
},
{
"docid": "a28181b1f485808fe65c6ff139545f2f",
"score": "0.77374357",
"text": "def words\n phrase.split\n end",
"title": ""
},
{
"docid": "8f5940429e6d718b295551382e91320a",
"score": "0.7704681",
"text": "def split_sentence_to_words sentence\n return sentence.split \" \"\n end",
"title": ""
},
{
"docid": "b9844e15d57a4e5ffff52414a27fea11",
"score": "0.76751345",
"text": "def collect_words(sentence)\n words = sentence.split(/ |--|—/) #split on spaces, double-dashes, and em-dashes\n #remove non-internal punctuation\n words = words.map do |word|\n strip_punctuation(word)\n end\n words.delete('') #remove empty strings\n words\nend",
"title": ""
},
{
"docid": "6b62b63f854a4a1fe6844c915fa1bc1f",
"score": "0.76616836",
"text": "def getWords(text)\n text.downcase!\n text.strip!\n return text.split(' ')\n end",
"title": ""
},
{
"docid": "ef931e6e83b5b720d6612655e729f218",
"score": "0.76509637",
"text": "def words\n @phrase.\n split(/[\\n ,]/).\n map {|w| normalize_word(w) }.\n delete_if {|w| w.empty? }\n end",
"title": ""
},
{
"docid": "dddba5e5bb52ac296f53b53be47bb5f7",
"score": "0.7589506",
"text": "def words\n text.words.map {|word| word.to_s}.uniq\n end",
"title": ""
},
{
"docid": "32e19c0fd11f3173e27657b45a952b9d",
"score": "0.75217164",
"text": "def words\n sentences = @sentences.collect do |s|\n s.words\n end\n\n return sentences.flatten\n end",
"title": ""
},
{
"docid": "0cd1820441c307b019066971312182a2",
"score": "0.74800473",
"text": "def separate_into_words\n @phrase.split(\" \")\n end",
"title": ""
},
{
"docid": "8765b8fe023a84f4df81562e92d13215",
"score": "0.7388295",
"text": "def words\n @text.downcase.scan(/[a-z]+/)\n end",
"title": ""
},
{
"docid": "1e647d35829073298cc9e9f87bbf6ca9",
"score": "0.7383211",
"text": "def get_words(line)\n line=line.split(/[^[[:word:]]]+/)\n line\n end",
"title": ""
},
{
"docid": "c4533a7386e2e21b7691b6bc7be9577b",
"score": "0.7348286",
"text": "def split_words(sentence)\n\twords = sentence.split.reverse.join(\" \")\n\tputs words\n\treturn words\nend",
"title": ""
},
{
"docid": "19ca7e3294085f20d38349238b89ba95",
"score": "0.73387223",
"text": "def words\n self.split(/\\W+/)\n end",
"title": ""
},
{
"docid": "96187e50a8ee648a46b57673cc2e3769",
"score": "0.7323617",
"text": "def sentence_to_stripped_array sentence\n # all lowercase, baby\n sentence = sentence.downcase\n # remove all http://URLs, #hashtags, @references, and 'quotation marks' from sentence\n TwitterSentiment::Prefs::Defaults.strip_regex.each_value do |rule|\n sentence.gsub!(rule[:regex], rule[:sub])\n end\n words = sentence.split(/[?!., ]/) # break up by spaces or punctuation\n words.reject! { |word| word.nil? or word.empty? } # get rid of any blank entries\n while not (i = words.index(\"not\")).nil?\n words[i,2] = words[i,2].join(\" \") unless i == words.length\n end\n return words\n end",
"title": ""
},
{
"docid": "b87cb1e90511736ea028dd47f7c06c48",
"score": "0.72992164",
"text": "def words\n @words ||= %q{\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque\n faucibus tellus eu magna venenatis eu scelerisque sapien ultrices. Morbi\n viverra, arcu vel lobortis suscipit, magna erat venenatis velit, sit amet\n mattis sapien nisi id dui. Sed sed metus quam. Nulla pellentesque, leo\n sed condimentum tempor, neque sem mattis sem, eget congue nibh augue sit\n amet urna. Quisque hendrerit consequat metus sed lacinia. In sit amet\n velit sit amet nunc euismod tincidunt id at ligula. Donec faucibus lectus\n et justo feugiat a aliquet lacus viverra. Vestibulum ante ipsum primis in\n faucibus orci luctus et ultrices posuere cubilia Curae; Curabitur quis\n justo urna. Integer at lectus ac arcu mattis faucibus ac vel neque. Nulla\n commodo pharetra mauris, ac lobortis turpis feugiat id.\n }.gsub(/[.,;]/, '').split\n end",
"title": ""
},
{
"docid": "6f4b4ef5055348d42a4032458d9984e0",
"score": "0.72684515",
"text": "def words\n phrase.downcase.split(/[^'[[:alnum:]]]/).reject(&:empty?)\n end",
"title": ""
},
{
"docid": "7aa454facc2726008931bf1ddcf1a97d",
"score": "0.7231525",
"text": "def words\n @words ||= self.class.permutate(@string).sort.map do |word|\n [Dictionary.include?(word), word] \n end\n end",
"title": ""
},
{
"docid": "0da8478b05b20f565cb002203e5568ab",
"score": "0.72137797",
"text": "def words\n distinct(:word).order(:word).pluck(:word)\n end",
"title": ""
},
{
"docid": "43bb9c6ef03f3d12667223fb0264920f",
"score": "0.7212468",
"text": "def words\n self.split(/[\\s\\W]+/)\n end",
"title": ""
},
{
"docid": "b1662b6a71b3b3c1b9e3a3195090efa5",
"score": "0.72065103",
"text": "def words\n # Actively scan for word characters instead of splitting on space characters so that punctuation is ignored.\n unnormalized_words = string.scan(/\\w+/)\n normalized_word = unnormalized_words.map(&:downcase)\n\n normalized_word\n end",
"title": ""
},
{
"docid": "5205c9ccf985e11ac66ae64be5bc8102",
"score": "0.72045857",
"text": "def o_words(sentence)\n # Write your code here\n sentence.split(\" \").select{|words|words unless !words.downcase.include? \"o\"}\n #map return also nil while select return only detected words\nend",
"title": ""
},
{
"docid": "8b8271b634cbb770f239f710bd950acb",
"score": "0.7197987",
"text": "def words\n @content.split\n end",
"title": ""
},
{
"docid": "56a055e841025bf8e409a35a686cf7db",
"score": "0.71972656",
"text": "def each_word\n @sentence.downcase.scan(/\\w+/)\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "139724247fa5ce31b30d3db12b3fe7e6",
"score": "0.71733254",
"text": "def words (text)\n return text.downcase.scan(/[a-z]+/) #find all matches of this simple regular expression\n end",
"title": ""
},
{
"docid": "7a2101f6966fd74b8094ddc90b302649",
"score": "0.7170289",
"text": "def words (text)\n return text.scan(/[a-z]+/)\n end",
"title": ""
},
{
"docid": "0ecc99576fc7e412d8f827b5b340b28f",
"score": "0.7170137",
"text": "def o_words(sentence)\n #sentence = sentence.split(\" \")\n return sentence.split.select { |ele| ele.include?(\"o\") }\nend",
"title": ""
},
{
"docid": "cce11fe30d203968e554fbd038873e21",
"score": "0.7154552",
"text": "def break_words(stuff)\n\twords = stuff.split(' ')\n\treturn words\nend",
"title": ""
},
{
"docid": "f70405266677129cf7a9b2e9608f35f1",
"score": "0.7144957",
"text": "def words\n @words = text.split(/[^a-zA-Z]/).delete_if { |word| word.empty? }\n end",
"title": ""
},
{
"docid": "fc9ef454c69538538a3f1b28894ebe2b",
"score": "0.7143962",
"text": "def words\n @words ||= text.split(/[[:space:]!|\\\\;:,\\.\\?\\/'\\(\\)\\[\\]]/)\n end",
"title": ""
},
{
"docid": "f3aa73bafcfafae4e1cffe31cbc15b97",
"score": "0.714268",
"text": "def o_words(sentence)\n return sentence.split(\" \").select { |ele| ele.include?(\"o\") }\nend",
"title": ""
},
{
"docid": "a01982b6822dfe84cf7c04caffd23c2c",
"score": "0.71364653",
"text": "def words\n @text.split @word_separator\n end",
"title": ""
},
{
"docid": "65a60c3f7912789dcc6502c9aa7269e4",
"score": "0.7136201",
"text": "def words(string)\n string.split(' ')\n end",
"title": ""
},
{
"docid": "2882f261c8bd4479c0da4c1494210bf9",
"score": "0.710663",
"text": "def words\n # As opposed to words()\n @content.split\n # As opposed to @content.split()\n end",
"title": ""
},
{
"docid": "d8f449ec58da50557f5e9d3606aab8b1",
"score": "0.7105285",
"text": "def o_words(sentence)\n \n formatArr = sentence.split(\" \")\n returnArr = formatArr.select { |ele| ele.include?(\"o\")}\n\n return returnArr\n\n\n\nend",
"title": ""
},
{
"docid": "e3e7085a55dd57ccc1417a9091caf0e7",
"score": "0.7089114",
"text": "def words\n @data.split(' ')\n end",
"title": ""
},
{
"docid": "af20a57eb0e8908c6fd55675d6a364b1",
"score": "0.70715433",
"text": "def split_words\n @words.downcase\n .split(/\\W/)\n .reject {|s| s.empty? }\n end",
"title": ""
},
{
"docid": "5cbc3da6bbca39ade8c812da1aa43ac2",
"score": "0.70442396",
"text": "def sentence(text)\n text.split(sentencer).each_slice(2).map{ |*bits| bits.join }.select{ |s| s =~ /\\S/ }\n end",
"title": ""
},
{
"docid": "dc6689717172447558178555416d9d21",
"score": "0.70389235",
"text": "def words\n unless @words\n @words = @string.gsub( /[,\\\"\\\\]/, \"\" ).gsub( /\\+/, \" \" ).split.select do |word|\n case word\n # Ignore really common words.\n when \"a\", \"of\", \"the\", \"to\", \"or\", \"in\", \"is\", \"and\", \"for\", \"+\", \"on\", \"at\", \"!\", \"-\"\n false\n # Ignore things that will generally be Google directives.\n when /^-[a-z]+?:/\n false\n else\n true\n end\n end.uniq\n end\n @words\n end",
"title": ""
},
{
"docid": "8a506598d3d3c57ed6bcc768efc5fca1",
"score": "0.7021254",
"text": "def sentence words\n\twords.join ' '\nend",
"title": ""
},
{
"docid": "2ed06fd3bd44a1420c766a5a670d5954",
"score": "0.70193005",
"text": "def o_words(sentence)\n\treturn sentence.split.select { |word| word.include?(\"o\") }\nend",
"title": ""
},
{
"docid": "b68c4985eb9ab5e83ed9562577f05a88",
"score": "0.7012688",
"text": "def split_into_words text\n text.gsub(/\\s+/m, ' ').strip.split(\" \")\n end",
"title": ""
},
{
"docid": "9c5ffba5970adbfef5e9a87d007f0eeb",
"score": "0.70096904",
"text": "def yell_sentence(sent)\n words = sent.split(\" \")\n puts words\nend",
"title": ""
},
{
"docid": "e49a53bf34a2baaff33a50a3d2286f03",
"score": "0.700265",
"text": "def extract_words(text)\n new_str = \"\"\n text.each_char do |char|\n if char.match(/[a-zA-Z\\']/)\n new_str += char\n else\n new_str += \" \"\n end\n end\n new_new_str = new_str.split()\n return new_new_str\n end",
"title": ""
},
{
"docid": "93b0f17908341732226a12efabecbe70",
"score": "0.7001557",
"text": "def words\n @data.split\n end",
"title": ""
},
{
"docid": "345554729364d9406e128ae4a26b2393",
"score": "0.6991783",
"text": "def o_words(sentence)\n sentence = sentence.split(\" \")\n return sentence.select { |ele| ele.include?(\"o\") }\nend",
"title": ""
},
{
"docid": "27393532052b0f76870e5cd2a13df34d",
"score": "0.69909406",
"text": "def o_words(sentence)\n return sentence.split.select { |word| word.include?(\"o\")}\nend",
"title": ""
},
{
"docid": "9dc6e92f2e4860305371e21d4996d4ed",
"score": "0.69906646",
"text": "def whisper_words(words)\n return words.map {|w| w.downcase+\"...\"}\nend",
"title": ""
},
{
"docid": "9252dce2d9e75d8236043926d3b8cab5",
"score": "0.6983419",
"text": "def words\n scan(/\\S+/)\n end",
"title": ""
},
{
"docid": "a23b7c180e76879794a050779905ac3b",
"score": "0.6968048",
"text": "def o_words(sentence)\n return sentence.split.select { |word| word.include?(\"o\") }\nend",
"title": ""
},
{
"docid": "50f5d1e529cd0f8f87e3043e28436762",
"score": "0.6965933",
"text": "def words(text)\n text.downcase.scan(/[a-z]+/)\n end",
"title": ""
},
{
"docid": "d78fa28052ba3391ce68cffa10d561da",
"score": "0.69650704",
"text": "def o_words(sentence)\n \n sentence_arr = sentence.split(\" \")\n print sentence_arr\n puts\n \no_words = sentence_arr.select { |word| word.include?('o') }\n\n \n print o_words\nend",
"title": ""
},
{
"docid": "39ab0cca2784367d29bd517cd33cfd62",
"score": "0.69561476",
"text": "def low_tech_split(sentence)\n words = []\n i, j = 0\n\n while i < sentence.length\n if sentence[i] == ' '\n i += 1\n else\n words << sentence[j..i]\n \"asdf\".\n sentence = sentence.\n i += 1\n j = i\n end\n end\n words\nend",
"title": ""
},
{
"docid": "f5d74ccdc40f6cb703deb10f936e5255",
"score": "0.69360554",
"text": "def words_from_string(string)\n string.downcase.gsub(/[^a-z\\-0-9_\\s]/, '').split(' ') #ignores punctuation, line endings, and is case insensitive\nend",
"title": ""
},
{
"docid": "7bf0fe17153100cdcecd2754ea90b5ab",
"score": "0.6919596",
"text": "def break_words(stuff)\n words = stuff.split(' ')\n return words\nend",
"title": ""
},
{
"docid": "c69a40c76443c5785950e56e05498547",
"score": "0.6895578",
"text": "def words\n sentence.tagged_words\n end",
"title": ""
},
{
"docid": "f48453d0d078979e907986e722b21d70",
"score": "0.6895283",
"text": "def break_words(stuff)\n words = stuff.split(' ')\n return words\nend",
"title": ""
},
{
"docid": "8d973be71b0baaf274c33c9b34280c86",
"score": "0.6890496",
"text": "def whisper_words(words)\n return words.map { |ele| ele.downcase + \"...\"}\nend",
"title": ""
},
{
"docid": "4d84a6a84791f0dc792b9adb4aeef96a",
"score": "0.6889446",
"text": "def words\n self.clean_words.split(' ')\n end",
"title": ""
},
{
"docid": "472d6a3705351f5d70b6021fbe336d45",
"score": "0.6883337",
"text": "def o_words(sentence)\n sentence.split.select { |i| i if i.include?('o') }\nend",
"title": ""
},
{
"docid": "e6b574a2f8404c33c920891c6a18f18a",
"score": "0.6879648",
"text": "def words\n\t\tscan(/\\w+/u)\n\tend",
"title": ""
},
{
"docid": "8968e02bb2b024197101176fb2f90512",
"score": "0.68734586",
"text": "def word_list\n word_list = raw_text.to_textual.split(/\\W/)\n end",
"title": ""
},
{
"docid": "b39ce78f697fd43fcacf4b0eee058516",
"score": "0.68717635",
"text": "def words_from_string(string) \t\t\t# downcase returns a lowercase version of a string\n\tstring.downcase.scan(/[\\w']+/)\t\t# scan returns an array of substrings that match a pattern\n\tend",
"title": ""
},
{
"docid": "c22742383d14f57fcf9edab7dfa2e13c",
"score": "0.68671304",
"text": "def words\n %w(\n shit\n shitty\n fuck\n fucked\n fucking\n ass\n asshole\n cunt\n dick\n cock\n pussy\n )\n end",
"title": ""
},
{
"docid": "e442c19266871abd1d2a35ddbafdc3d4",
"score": "0.68537706",
"text": "def o_words(sentence)\n sentence.split(\" \").select {|w| w.include?(\"o\")}\nend",
"title": ""
},
{
"docid": "4f119edf387a884580418a6c8175caee",
"score": "0.68363965",
"text": "def words\n @content.scan(/[[[:alpha:]]']+/)\n end",
"title": ""
},
{
"docid": "0cd5971ec838156d186981c6c991e283",
"score": "0.68355125",
"text": "def remove_w_words(sentence)\n result = []\n sentence.split.each do |word|\n if \",?\".include?(word[-1])\n result << word[-1]\n elsif word.downcase.include?(\"w\")\n result << \"\"\n else\n result << word\n end\n end\n result.join(\" \")\nend",
"title": ""
},
{
"docid": "d1dde679be56bd8bb82420e495a3dbfb",
"score": "0.6828781",
"text": "def text_to_words(text)\n \ttext.split\n end",
"title": ""
},
{
"docid": "7523f052833d64f9c4a1894c38919347",
"score": "0.6828248",
"text": "def o_words(sentence)\n\tsentence.split.select { |word| word.include?(\"o\")}\nend",
"title": ""
},
{
"docid": "8445d727a0285601781cba3602f2a508",
"score": "0.6827738",
"text": "def whisper_words(words)\n return words.map { |ele| ele.downcase + \"...\" }\nend",
"title": ""
},
{
"docid": "3d6f0e3a3f5a00d38bc39d7a2347ab4a",
"score": "0.6823738",
"text": "def extract_words(string)\n words = []\n (1..3).each do |length| #break the string by half at position 1,2,3\n first = string[0..length]\n second = string[length+1..string.size-1]\n \n if contain?(first.downcase) && contain?(second.downcase)\n words << [first, second]\n end\n end\n\n return words\n end",
"title": ""
},
{
"docid": "c615346b64ed5119a504f6f0cd73fd31",
"score": "0.6813664",
"text": "def brak_words(stuff\n words = stuff.split(\" \")\n word\nend",
"title": ""
},
{
"docid": "94ebba6ff7d1d887fce6c742164b7085",
"score": "0.6811164",
"text": "def split_words\n self.gsub(/[\\s]+/, ' ').strip.split\n end",
"title": ""
},
{
"docid": "0bc5c2b001ef9023e68b2b294885f9c3",
"score": "0.679038",
"text": "def split_words\n self.scan SPLIT_REGEX\n end",
"title": ""
},
{
"docid": "2f8e5caea78a1620744b89eaf1462982",
"score": "0.67877823",
"text": "def text_to_words(text)\n # TODO(dan): mark common words?\n words = text.downcase.split(/[^\\w]+/)\n # remove words smaller than 2 chars\n words.delete_if { |word| word.length < 2 }\n words\nend",
"title": ""
},
{
"docid": "e84e138b518934f1c72474ec41fb84d1",
"score": "0.67787665",
"text": "def o_words(sentence)\n # Write your code here\n new_sentence= sentence.split(\" \")\n new_sentence.select { |n| n.include?(\"o\")}\nend",
"title": ""
},
{
"docid": "3f740eedc04c2f98f8c1120bc1fd9839",
"score": "0.6778694",
"text": "def get_subwords(word)\n word.underscore.\n gsub(\"_\", \" \").\n gsub(\"-\", \" \").\n split(\" \")\nend",
"title": ""
},
{
"docid": "203a35c4c226cb4b220fa78f5e3de302",
"score": "0.67761487",
"text": "def words\n gsub(/[^A-Za-z0-9_-|\\s]/, '').downcase.split(\" \").uniq\n end",
"title": ""
},
{
"docid": "613b75da4f294bc38bd2657f7901c3bf",
"score": "0.67608714",
"text": "def words\n\t\tscan(/\\w[\\w\\-\\']*/)\n\tend",
"title": ""
},
{
"docid": "234e10629f544eff10136f3012915e18",
"score": "0.6742185",
"text": "def yell_sentence(sent)\n words = sent.split # what happens, not putting any in () ?\n print words\nend",
"title": ""
},
{
"docid": "f6e71971e34588de50a673504ed81ae2",
"score": "0.6739988",
"text": "def croon sentence\n separate = sentence.split(\" \").map do |word|\n word.split(\"\").join(\"-\")\n end\n separate.join(\" \")\nend",
"title": ""
},
{
"docid": "5d7ad8e0ddcbe63dd29dfd9f32541dbd",
"score": "0.6732784",
"text": "def seperate\n result = nil\n result = self.word.chars.to_a\n result\n end",
"title": ""
},
{
"docid": "35ad8a6360d45c5023ced6ef4470d449",
"score": "0.6732009",
"text": "def words(text)\n text.downcase.scan(/[a-z]+/)\nend",
"title": ""
},
{
"docid": "b03275392dac89db9e670e005f5ee3bd",
"score": "0.67201173",
"text": "def words\n words = [self]\n if self =~ / /\n words = self.split(' ')\n elsif self =~ /_/\n words = self.split('_')\n else\n words = self.scan(/[A-Z][a-z]*/)\n end\n words\n end",
"title": ""
},
{
"docid": "5abff262feaa2af58086335afcbd2d92",
"score": "0.6718086",
"text": "def words\n\t\t(0...self.length).to_a.collect do |i|\n\t\t\tself.word( i )\n\t\tend\n\tend",
"title": ""
},
{
"docid": "babe4dba21b2601ad417a364817ee23f",
"score": "0.6704899",
"text": "def get_words\n page = Nokogiri::HTML(open(\"http://wiki.dothraki.org/Idioms_and_Phrases\"))\n dictionary = page.css(\"li b\").text\n words = dictionary.split(/\\b/)\n words.delete_if {|element| element == \" \" || element == \"'\" || element == \"!\" || element == \"?\" || element == \".\"}\n words.pop\n words.delete(\"vikeesichomakvichomerakyershafkaShekhikhiGweholatMe\")\n words\nend",
"title": ""
},
{
"docid": "30c8f8c5ce0b29c664db8d5724ed34b9",
"score": "0.6701359",
"text": "def sentences\n substrings(sentence_regex)\n end",
"title": ""
},
{
"docid": "f8d9a6588d9f28347db5eb6dea2a1a7b",
"score": "0.6687495",
"text": "def remove_w_words(sentence)\n\n result = []\n sentence.split.each do |word|\n result << word if word.chars[0] != \"w\"\n end\n\n result.join\nend",
"title": ""
},
{
"docid": "27f85ded98e05d99c7936f4516ec124a",
"score": "0.66852564",
"text": "def whisper_words(words)\n return words.map { |word| word.downcase + \"...\" }\nend",
"title": ""
},
{
"docid": "e6832a971a608f9be5dcd6ed7005980b",
"score": "0.66681",
"text": "def sentences(text)\n sentence = text.split(/(\\.|\\?|\\!)/)\n\n rsentence = []\n sentence.each_with_index do |k,v|\n\n # need to keep our punctuation ... not sure about this\n if k.match(/(\\.|\\?|\\!)/).nil? && !sentence[v+1].nil? then\n rsentence << k.lstrip + sentence[v+1]\n end\n\n end\n\n rsentence\n end",
"title": ""
},
{
"docid": "1e6485296c7373330dbc12d33b804a09",
"score": "0.6659277",
"text": "def words\n [\n \"geography\", \"cat\", \"yesterday\", \"java\", \"truck\", \"opportunity\",\n \"fish\", \"token\", \"transportation\", \"bottom\", \"apple\", \"cake\",\n \"remote\", \"boots\", \"terminology\", \"arm\", \"cranberry\", \"tool\",\n \"caterpillar\", \"spoon\", \"watermelon\", \"laptop\", \"toe\", \"toad\",\n \"fundamental\", \"capitol\", \"garbage\", \"anticipate\", \"pesky\"\n ]\n end",
"title": ""
},
{
"docid": "1c9abfd5a9b1377e2877bb57179932dd",
"score": "0.6657311",
"text": "def words_from_string(string)\n string.downcase.scan(/[\\w'']+/) # => [\"this\", \"is\", \"a\", \"five\", \"worder\"]\n end",
"title": ""
}
] |
3f2d49c61c52c68c5fa3ccd6c513c2d4
|
Find and return the dock application
|
[
{
"docid": "39a847d190e7e85ed9f90d074071e6c7",
"score": "0.64528334",
"text": "def dock\n new 'com.apple.dock'\n end",
"title": ""
}
] |
[
{
"docid": "34414f5a27717082ffad874310ac6a98",
"score": "0.6393752",
"text": "def application\n Accessibility::Element.application_for pid\n end",
"title": ""
},
{
"docid": "b699afce0fb5c9778863dbfab7543078",
"score": "0.6362145",
"text": "def local_app_name\n [File.expand_path(\"~/\"), '/'].each{|place|\n local_app = File.join(place, APP_NAME)\n return local_app if File.exist?(local_app) && File.executable?(local_app)\n }\n raise AppNotFoundError.new(\"Could not find the CocoaDialog app. Maybe it is not installed?\")\n end",
"title": ""
},
{
"docid": "ba2a853eee2de5f71f227e0bc723140e",
"score": "0.636176",
"text": "def find_ui_app(arguments={})\n api_call(arguments, 'applications/ui/find')\n end",
"title": ""
},
{
"docid": "2dff9078a16cc8c3714c0ff5f839889d",
"score": "0.62084574",
"text": "def current_app\n line = `adb shell dumpsys window windows`.each_line.grep(/mFocusedApp/).first.strip\n pair = line.split(' ').last.gsub('}','').split '/'\n pkg = pair.first\n act = pair.last\n OpenStruct.new line: line,\n package: pkg,\n activity: act,\n am_start: pkg + '/' + act\n end",
"title": ""
},
{
"docid": "2a83e324b63d998b4ea7ce73f3b087de",
"score": "0.61809087",
"text": "def get_app(name)\n apps = @client.describe_apps({:stack_id => stack_id})[:apps]\n apps = apps.select {|a| a[:name].eql? name}\n\n if apps.length == 0 \n raise \"Could not find app called \\\"#{name}\\\"!\"\n end\n \n OpsWorksApp.new(self, apps.first)\n end",
"title": ""
},
{
"docid": "664b7b13294579147e36a17d6361407d",
"score": "0.6180217",
"text": "def find_app\n \n [5,4,3].each { |n|\n \n f = \"Adobe Flash CS#{n}\"\n p = \"/Applications/#{f}/#{f}.app\"\n \n if File.exist?(p)\n @name = f\n @path = p\n break\n end\n \n }\n \n end",
"title": ""
},
{
"docid": "e101b879b03e50f63dfa4aad681f5a15",
"score": "0.6175456",
"text": "def find_app_by_root(path_to_origen_root, options = {})\n app = _applications_lookup[:root][Pathname.new(path_to_origen_root).realpath.to_s]\n if !app || options[:reload]\n # If the application is already defined then un-define it, this is to allow it to\n # be reloaded.\n # This option feels like it doesn't belong here, but is part of the legacy import\n # require system. When that has been removed in future so can this reload system, under\n # bundler app versions will be resolved before loading them so there will be no need\n # for this\n if app\n begin\n Object.send(:remove_const, app.class.to_s)\n rescue\n # Nothing to do here\n end\n end\n require File.join(path_to_origen_root, APP_CONFIG)\n app = _applications_lookup[:root][Pathname.new(path_to_origen_root).realpath.to_s]\n end\n return app if app\n\n puts \"Couldn't find application instance with root #{path_to_origen_root}, known roots are:\"\n _applications_lookup[:root].keys.each do |key|\n puts \" #{key}\"\n end\n puts\n fail 'Application lookup error!'\n end",
"title": ""
},
{
"docid": "3b2702be7bbf97126a679a8300943535",
"score": "0.6166434",
"text": "def find_app(what, item, app)\n id = get_id(what, item)\n the_app = get_app(what, app, id)\n raise \"#{what} #{item['text']} app #{app} not found\" unless the_app\n the_app\n end",
"title": ""
},
{
"docid": "c2aa7aaee49633c58befb9e307ce07ff",
"score": "0.616549",
"text": "def current_app\n line = `adb shell dumpsys window windows`.each_line.grep(/mFocusedApp/).first.strip\n pair = line.split(' ').last.gsub('}', '').split '/'\n pkg = pair.first\n act = pair.last\n OpenStruct.new(line: line,\n package: pkg,\n activity: act,\n am_start: pkg + '/' + act)\n end",
"title": ""
},
{
"docid": "e8dd8877c2e2db98621c7b37c5c6e92a",
"score": "0.61245304",
"text": "def app\n lookup(:app)\n end",
"title": ""
},
{
"docid": "5e472722e77e8c47f60f6c22c1177c24",
"score": "0.60999155",
"text": "def application_with_name name\n # @todo We don't launch apps if they are not running, but we could if\n # we used `NSWorkspace#launchApplication`, but it will be a headache\n NSRunLoop.currentRunLoop.runUntilDate Time.now\n workspace = NSWorkspace.sharedWorkspace\n app = workspace.runningApplications.find { |app| app.localizedName == name }\n application_with_pid(app.processIdentifier) if app\n end",
"title": ""
},
{
"docid": "2aee9c50afdceb26aac7669124db3ea9",
"score": "0.60501015",
"text": "def front_most_app\n proxy_for(:frontMostApp, proxy_klass: UIAutomation::Application)\n end",
"title": ""
},
{
"docid": "ccd5d79b99dce14f9578b1b53ebcdc29",
"score": "0.60382473",
"text": "def frontmost_application\n new NSWorkspace.sharedWorkspace.frontmostApplication\n end",
"title": ""
},
{
"docid": "e89b9ad08bb15cb916563bab18d2673e",
"score": "0.6026056",
"text": "def find(word)\n\t\t\treturn Bini::Config[:applications][word] if Bini::Config[:applications] && Bini::Config[:applications][word]\n\t\t\tword\n\t\tend",
"title": ""
},
{
"docid": "db2b8ee281f18e77070771286b592325",
"score": "0.6024138",
"text": "def active_application\n applications.select(&:open?).last\n end",
"title": ""
},
{
"docid": "71c272241af62df0232aa8114b03718f",
"score": "0.60166603",
"text": "def current_app\n\t\t\t# did something get supplied on the cli? try to find it.\n\t\t\tif Bini::Options[:token]\n\t\t\t\t@current_app = find Bini::Options[:token]\n\t\t\telse\n\t\t\t\t@current_app = find Bini::Config[:applications].values.first if Bini::Config[:applications]\n\t\t\tend\n\t\t\t@current_app\n\t\tend",
"title": ""
},
{
"docid": "459d72f610dc9717a9e1564dd32b6aef",
"score": "0.59858334",
"text": "def select_app launcher\n ftype = file_type launcher\n @app_map[ ftype ]\n end",
"title": ""
},
{
"docid": "2f2fb7615af2f9b208cd68bb728cf8df",
"score": "0.5953121",
"text": "def application\n hit = if EY.metadata.preset_app_name?\n catch(:found_it) do\n environments.each do |e|\n if hit = e['apps'].detect { |a| a['name'] == EY.metadata.app_name }\n throw :found_it, hit\n end\n end\n end\n elsif possible_to_detect_app_from_environment_name?\n environment['apps'][0]\n elsif possible_to_detect_app_from_git_config?\n catch(:found_it) do\n environments.each do |e|\n if hit = e['apps'].detect { |a| a['repository_uri'] == repository_uri_from_git_config }\n throw :found_it, hit\n end\n end\n end\n end\n raise RuntimeError, \"[engineyard-metadata gem] Couldn't find a matching application. Please set EY.metadata.app_name= or ENV['EY_APP_NAME']\" unless hit\n hit\n end",
"title": ""
},
{
"docid": "782c49c9fe1456f51705c124c6f953b7",
"score": "0.59283006",
"text": "def dock_find(opts = {})\n data, _status_code, _headers = dock_find_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "efda7b79f7287f63674038f4d325de47",
"score": "0.5915018",
"text": "def application_for pid\n NSRunLoop.currentRunLoop.runUntilDate Time.now\n if NSRunningApplication.runningApplicationWithProcessIdentifier pid\n AXUIElementCreateApplication(pid)\n else\n raise ArgumentError, 'pid must belong to a running application'\n end\n end",
"title": ""
},
{
"docid": "314f5de247a8122667ddc72c11762b64",
"score": "0.5904379",
"text": "def application ; applications.last ; end",
"title": ""
},
{
"docid": "b129262df3d797c3cc42494277d502e0",
"score": "0.5883848",
"text": "def app\n @app ||= begin\n current = stack\n until current.kind_of?(App::Stack)\n current = current.stack\n end\n current.app\n end\n end",
"title": ""
},
{
"docid": "4dd37eabedcb09146303761b12a12f34",
"score": "0.5845461",
"text": "def find_rack_app(path = nil, &block)\n return self if (block && block.call(self))\n has_delegate? ? delegate.find_rack_app(path, &block) : nil\n end",
"title": ""
},
{
"docid": "100a98f5aa6d070793ddc3973f13fc3c",
"score": "0.5842626",
"text": "def get_app_by_name(app_name)\n app = @client.apps.find { |app|\n app.name == app_name\n }\n app\nend",
"title": ""
},
{
"docid": "f2b2cd079a135bc3c57182db024c9736",
"score": "0.58004385",
"text": "def app\n @slot.app\n end",
"title": ""
},
{
"docid": "127ec09be30f59fe7c9223bd4f6eab6d",
"score": "0.57921076",
"text": "def [](app_name)\n select { |app| app.name == app_name }.first\n end",
"title": ""
},
{
"docid": "e630b920b628ccbe99483121dc01dad5",
"score": "0.57908726",
"text": "def current_app\n @current_app || File.basename(Dir.pwd)\n end",
"title": ""
},
{
"docid": "b7e7c9e26b90f9b688626076b4595042",
"score": "0.5787044",
"text": "def dock_find_one(opts = {})\n data, _status_code, _headers = dock_find_one_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "93e2fb4d9252f59e321855bd8a56231c",
"score": "0.5756067",
"text": "def get_macs_fan_control_app_name()\n app_name = \"Macs Fan Control\"\n return app_name\nend",
"title": ""
},
{
"docid": "17eaed929159c710f50dec8c7151e617",
"score": "0.5719077",
"text": "def desktop_app\n @attributes[:desktop_app]\n end",
"title": ""
},
{
"docid": "17eaed929159c710f50dec8c7151e617",
"score": "0.5719077",
"text": "def desktop_app\n @attributes[:desktop_app]\n end",
"title": ""
},
{
"docid": "7817c72b338f76e665927533fa03d5ae",
"score": "0.5710195",
"text": "def fetch_app_name(app='app')\n app_path = destination_root(app, 'app.rb')\n @app_name ||= File.read(app_path).scan(/class\\s(.*?)\\s</).flatten[0]\n end",
"title": ""
},
{
"docid": "39a4788aaea5418d64dceba7a85a3b29",
"score": "0.5705892",
"text": "def select_app(file_name)\n ftype = file_type file_name\n @app_map[ftype]\n end",
"title": ""
},
{
"docid": "a2864a0928d5ab90abb4888bb81f1111",
"score": "0.57017714",
"text": "def app_ocid(app_name:, compartment_name:)\n apps(compartment_name: compartment_name)\n .select { |a| a.display_name == app_name }\n .fetch(0) { raise \"Could not find application #{app_name}\" }\n .id\nend",
"title": ""
},
{
"docid": "8351b0cdf9a185ddb300e4ed3d749e4e",
"score": "0.5686052",
"text": "def app_by_tag(tag)\n manifest[:applications][tag]\n end",
"title": ""
},
{
"docid": "ff61ff6bf1a8ff493505181af42cbc2c",
"score": "0.56687826",
"text": "def fetch_app_name(app='app')\n app_path = destination_root(app, 'app.rb')\n @app_name ||= File.read(app_path).scan(/module\\s(.*?)\\n/).flatten[0]\n end",
"title": ""
},
{
"docid": "7150e24f99a2ddc9a5d681543b3adc6b",
"score": "0.5655161",
"text": "def application_for_pid pid\n raise ArgumentError, 'pid must be greater than 0' unless pid > 0\n AXUIElementCreateApplication(pid)\n end",
"title": ""
},
{
"docid": "03e809e77b2a224f79c3cdf9c7c827b3",
"score": "0.5648287",
"text": "def single_application_or_by_name(app_name)\n if(applications.length == 1)\n manifest_app_part = applications.first\n else\n manifest_app_part = application(app_name)\n end\n manifest_app_part\n end",
"title": ""
},
{
"docid": "8ae03df356a4bfcff05f0e27b561245c",
"score": "0.56461287",
"text": "def find_window_by_name(a_name)\n Wx::Window.find_window_by_name(a_name, self)\n end",
"title": ""
},
{
"docid": "0f06f6b4ba9a03e6ff8362b1ac7d1a49",
"score": "0.5639949",
"text": "def current_application_name\n require 'accessibility/extras'\n app = NSRunningApplication.runningApplicationWithProcessIdentifier(\n current_application_pid\n )\n return '/usr/libexec/sshd-keygen-wrapper' if app.nil?\n app.bundleIdentifier || app.executableURL.path\n end",
"title": ""
},
{
"docid": "b7df738f53984cf56ab118df9928040c",
"score": "0.5629355",
"text": "def get_app_folder\n app_folder = nil\n app = nil\n\n # look through all the installed sims\n sims = Pow( Pow(\"~/Library/Developer/CoreSimulator/Devices\") )\n\n sims.each do |simulator_folder|\n next if simulator_folder.class != Pow::Directory\n\n apps = Pow( \"#{simulator_folder}/data/Applications/\" )\n next unless apps.exists?\n\n # look through all the hash folders for apps\n apps.each do |maybe_app_folder|\n next unless maybe_app_folder.directory?\n\n # find the app in the folder and compare their modified dates\n # remember .apps are folders\n maybe_app = maybe_app_folder.directories.select{ |p|\n p.extension == \"app\" && p.exists?\n }.first\n next unless maybe_app\n\n if app\n if maybe_app.modified_at > app.modified_at\n app_folder = maybe_app_folder\n app = maybe_app\n end\n else\n # make the first one the thing to beat\n app_folder = maybe_app_folder\n app = maybe_app\n end\n end\n\n end\n app_folder\n end",
"title": ""
},
{
"docid": "9323da83fade9a59cd6dc3691cf1d3da",
"score": "0.56207865",
"text": "def get_active_window\n xdotool(\"getactivewindow\").chomp\n end",
"title": ""
},
{
"docid": "32720722105781462a87b91feb86f041",
"score": "0.5619683",
"text": "def parent\n application\n end",
"title": ""
},
{
"docid": "08f03fe91f0a2a1483ab309b688464c9",
"score": "0.5619104",
"text": "def application_name\n raise Error, _('No current task scheduler. ITaskScheduler is NULL.') if @pits.nil?\n raise Error, _('No currently active task. ITask is NULL.') if @pitask.nil?\n\n app = nil\n\n FFI::MemoryPointer.new(:pointer) do |ptr|\n @pitask.GetApplicationName(ptr)\n\n ptr.read_com_memory_pointer do |str_ptr|\n app = str_ptr.read_arbitrary_wide_string_up_to(MAX_PATH) unless str_ptr.null?\n end\n end\n\n app\n end",
"title": ""
},
{
"docid": "7ce590823cadfba872d84d5c394780af",
"score": "0.5612401",
"text": "def get_diskmaker_x_app_name()\n app_name = \"DiskMaker X\"\n return app_name\nend",
"title": ""
},
{
"docid": "9ac5e10c691c861a956ab7c944b7bebd",
"score": "0.5598167",
"text": "def find_appsupport_root\n home_dir = File.expand_path(ENV['HOME'])\n root = File.join(home_dir, 'Dropbox', 'Application Support', 'BBEdit')\n if not File.exist?(root)\n root = File.join(home_dir, 'Library', 'Application Support', 'BBEdit')\n if not File.exist?(root)\n raise IOError.new('No BBEdit directory found in ~/Dropbox/Application Support or ~/Library/Application Support')\n end\n end\n return root\nend",
"title": ""
},
{
"docid": "84ff5c5e489be3b7108a565692706b0d",
"score": "0.5591191",
"text": "def application_name\n check_for_active_task\n\n app = nil\n\n @task.Definition.Actions.each do |action|\n if action.Type == 0 # TASK_ACTION_EXEC\n app = action.Path\n break\n end\n end\n\n app\n end",
"title": ""
},
{
"docid": "84ff5c5e489be3b7108a565692706b0d",
"score": "0.5591191",
"text": "def application_name\n check_for_active_task\n\n app = nil\n\n @task.Definition.Actions.each do |action|\n if action.Type == 0 # TASK_ACTION_EXEC\n app = action.Path\n break\n end\n end\n\n app\n end",
"title": ""
},
{
"docid": "9e2dffa0024bf89fcc70a0db460f58e9",
"score": "0.55900353",
"text": "def get_komodo_edit_9_app_name()\n app_name = \"Komodo Edit 9\"\n return app_name\nend",
"title": ""
},
{
"docid": "cfe42069068527fc188f081dd27021b0",
"score": "0.557799",
"text": "def app name\n try_json get(\"/app/#{name}\")\n end",
"title": ""
},
{
"docid": "123a4ba2a585ebb2f4129e7b4a1a15b9",
"score": "0.5573194",
"text": "def app\n fetch('silicon_valley.apps')\n end",
"title": ""
},
{
"docid": "a1276b00c98f9a2b7aafbb9cb5e63c06",
"score": "0.5568452",
"text": "def application_name\n current = self.expand_path\n until current.root?\n if current.siblings.collect {|r| r.basename}.include?('rb_main.rb') then\n if current.parent.basename == 'Resources' && current.parent.parent.basename == 'Contents'\n # Part of an application bundle, applicationname.app\n OSX::NSLog \"application_name (appbundle): #{current.parent.parent.parent.basename_sans_ext}\"\n return current.parent.parent.parent.basename_sans_ext\n else\n # Assuming that we now are in the project folder, and that it is named like the app\n #OSX::NSLog \"application_name (raw): #{current.parent.basename}\"\n return current.parent.basename\n end\n end\n current = current.parent # Up one level for the next round in the loop\n end\n raise 'Unable to find an application name.'\n end",
"title": ""
},
{
"docid": "a1276b00c98f9a2b7aafbb9cb5e63c06",
"score": "0.5568452",
"text": "def application_name\n current = self.expand_path\n until current.root?\n if current.siblings.collect {|r| r.basename}.include?('rb_main.rb') then\n if current.parent.basename == 'Resources' && current.parent.parent.basename == 'Contents'\n # Part of an application bundle, applicationname.app\n OSX::NSLog \"application_name (appbundle): #{current.parent.parent.parent.basename_sans_ext}\"\n return current.parent.parent.parent.basename_sans_ext\n else\n # Assuming that we now are in the project folder, and that it is named like the app\n #OSX::NSLog \"application_name (raw): #{current.parent.basename}\"\n return current.parent.basename\n end\n end\n current = current.parent # Up one level for the next round in the loop\n end\n raise 'Unable to find an application name.'\n end",
"title": ""
},
{
"docid": "bc5ed45422457c68188e4af703361e3e",
"score": "0.5566517",
"text": "def get_dark_boot_app_name()\n app_name = \"Dark Boot\"\n return app_name\nend",
"title": ""
},
{
"docid": "1088c15aed56fba8cfca30de14ec758d",
"score": "0.5566081",
"text": "def select_app file_name\n ftype = file_type file_name\n @app_map[ ftype ]\n end",
"title": ""
},
{
"docid": "3a3d67f9c1b7b14a4762824cec54883d",
"score": "0.5560341",
"text": "def app\n @request[\"apps\"].first\n end",
"title": ""
},
{
"docid": "e9b3abfc398aefff001e7417a16cf176",
"score": "0.55569905",
"text": "def editor\n app 'Textmate'\n rescue ::FindApp::ApplicationNotFoundError\n LOG.debug \"#{__FILE__}:#{__LINE__ - 2}: Textmate application can't be found, maybe not installed?\"\n end",
"title": ""
},
{
"docid": "84a6aef505ea7f7e2a8fbf452cfccb33",
"score": "0.5554081",
"text": "def find_rush_application(rushee)\n return RushApplication.find_by(rushee_id: rushee.id)\n rescue\n nil\n end",
"title": ""
},
{
"docid": "0df9f52423e0799a22cffddf9a2eb867",
"score": "0.5548212",
"text": "def select_app file_name\n ftype = file_type file_name\n @app_map[ ftype ]\n end",
"title": ""
},
{
"docid": "082f2de1502e6622c7874d1ebc4ec77c",
"score": "0.5530592",
"text": "def detect_app_name\n app_files = app_files_matching_patterns\n\n # We may have multiple releases. Look for app names where we also have a script in bin/ to boot them\n interesting_app_files = app_files.select do |app_file|\n app_name = File.basename(app_file)[0..-5] # Remove the .rel suffix\n File.exists? \"app/bin/#{app_name}\"\n end\n\n appname = if interesting_app_files.length == 1\n File.basename(interesting_app_files.first)[0..-5] # Remove the .rel suffix\n elsif interesting_app_files.length == 0\n raise \"No valid Erlang releases with start scripts found. Cannot start application.\"\n else\n raise \"Multiple Erlang releases with different names found. Cannot start application. (Found: #{interesting_app_files.inspect})\"\n end\n\n # TODO - Currently staging exceptions are not handled well.\n # Convert to using exit status and return value on a case-by-case basis.\n raise \"Unable to determine Erlang startup command\" unless appname\n appname\n end",
"title": ""
},
{
"docid": "bda6ebfe9c1ead249225246d86f28f78",
"score": "0.5528916",
"text": "def find_application\n \tDoorkeeper::Application.where(uid: auth_params[:app_id], secret: auth_params[:app_secret]).first\n end",
"title": ""
},
{
"docid": "74efa1b9c481bf1b8c717b57f229ac91",
"score": "0.55202407",
"text": "def command\n OSX::NSBundle.mainBundle.infoDictionary['CFBundleExecutable'].to_s\n end",
"title": ""
},
{
"docid": "e8d60f2795767934ebf27ef2b1e50376",
"score": "0.5513697",
"text": "def find_application\n @application = Application.cached_app(params[:application_id])\n end",
"title": ""
},
{
"docid": "934587c54a29fa87950062cb538e930c",
"score": "0.550468",
"text": "def application()\n @application = nil if !defined?(@application)\n return @application\n end",
"title": ""
},
{
"docid": "651ecdb9df463ac74661786d0035f659",
"score": "0.55037117",
"text": "def get_main_application\n get_app_properties().root.attributes['mainApplicationPath'].split(\"/\").last\n end",
"title": ""
},
{
"docid": "d67c231eb66184b0d79959d5a5838885",
"score": "0.5502224",
"text": "def application\n [email protected]? && @modes.has_key?(@settings[:mode]) ? @modes[@settings[:mode]][:app] : \"unknown\"\n end",
"title": ""
},
{
"docid": "c7dc6488043fac3100f58d94e4c61779",
"score": "0.54859805",
"text": "def app\n app_name = self.respond_to?(:app_name) && self.app_name\n app_name ||= self.class.respond_to?(:app_name) && self.class.app_name\n app_name ? \"[#{app_name}]\" : \"\"\n end",
"title": ""
},
{
"docid": "2b6ce681860d0cec7e5984ef1940f9dd",
"score": "0.54852223",
"text": "def detect\n console_executable ? CONTAINER_NAME : nil\n end",
"title": ""
},
{
"docid": "2b6ce681860d0cec7e5984ef1940f9dd",
"score": "0.54852223",
"text": "def detect\n console_executable ? CONTAINER_NAME : nil\n end",
"title": ""
},
{
"docid": "9b41a15f900ebd59e9953ffb41755c87",
"score": "0.5476302",
"text": "def executable_name\n app.executable_name\n end",
"title": ""
},
{
"docid": "49865cc250413c210c66a5c899e55801",
"score": "0.5473542",
"text": "def select_app file_name \n ftype = file_type( file_name ).downcase\n @app_map[ ftype ]\n end",
"title": ""
},
{
"docid": "bc58b00e246e0c00bae9d510f264098d",
"score": "0.5469109",
"text": "def application\n detect_product('PocketCasts')\n end",
"title": ""
},
{
"docid": "3bcf4f3b8a9e59a22d973820d7baba00",
"score": "0.54588217",
"text": "def active_window\n if has_prog?('x-active-id')\n 'x-active-id'\n elsif File.exists?(wmii_namespace)\n 'wmiir cat /client/sel/ctl | sed 1q'\n else\n %q[xprop -root _NET_ACTIVE_WINDOW | awk '/#/ { print $(NF) ; exit } END { exit 1 }' || xdotool getwindowfocus]\n end\nend",
"title": ""
},
{
"docid": "9d4ffe65bca50a0dc996c350101adc81",
"score": "0.5457756",
"text": "def app\n return @app\n end",
"title": ""
},
{
"docid": "de410b367558c923f30a3e9d9e1b1bb1",
"score": "0.5457038",
"text": "def owner\n #returns Shoes::App\n throw NotImplementedError\n end",
"title": ""
},
{
"docid": "cbb2ef384b5c27f32112df7304d667ac",
"score": "0.5447252",
"text": "def application_with_pid pid\n AX::Element.process AX.application_for_pid pid\n end",
"title": ""
},
{
"docid": "3fa7a05b22b2f525495938040dfc01cf",
"score": "0.5431808",
"text": "def find_app_path(file)\n app_path = nil\n \n if load_path = find_load_path_for(file)\n Plugin.mixable_app_types.each do |type, regex|\n file_path = file.sub(load_path, '')\n \n # Make sure it matches our regular expression if there are certain file\n # name conventions\n if file =~ /app\\/#{type}\\/(.*\\/)?(#{regex.source})(\\.rb)?$/\n app_path = File.join(type.to_s, file_path)\n break\n end\n end\n end\n \n app_path\n end",
"title": ""
},
{
"docid": "e44290188056b9e01e18792c793a9da0",
"score": "0.54276896",
"text": "def dock\n write(143)\n end",
"title": ""
},
{
"docid": "89eb9e295a91d7876ec6840dbc4a0d7e",
"score": "0.54258436",
"text": "def findProgram( progname )\n\t\tENV['PATH'].split(File::PATH_SEPARATOR).each {|d|\n\t\t\tfile = File.join( d, progname )\n\t\t\treturn file if File.executable?( file )\n\t\t}\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "5d9c8f4cd2f18e60bcf7297c51072848",
"score": "0.5422084",
"text": "def application(application)\n get(\"applications/#{application}\").pop\n end",
"title": ""
},
{
"docid": "c13dadded6b0a5c7b74109f1d8f7b3ab",
"score": "0.54165983",
"text": "def app\n @theApp\n end",
"title": ""
},
{
"docid": "5c78a9a8d858c7f7aa5809c47542643a",
"score": "0.54110897",
"text": "def dock_icon\n mac = RUBY_PLATFORM.match(/darwin/i) || (RUBY_PLATFORM == 'java' && ENV_JAVA['os.name'].match(/mac/i))\n mac ? [\"-Xdock:name=Ruby-Processing\", \"-Xdock:icon=#{RP5_ROOT}/lib/templates/application/Contents/Resources/sketch.icns\"] : []\n end",
"title": ""
},
{
"docid": "2487da4fb2a2b2f73c91d1faebd0f20d",
"score": "0.5408547",
"text": "def app\n @app || self.class.app\n end",
"title": ""
},
{
"docid": "a90184a85af2f72fa6d27c69cfde5652",
"score": "0.53964627",
"text": "def applications_path \n File.expand_path @target || \"/Applications\"\n end",
"title": ""
},
{
"docid": "c90b63aa87a6ca5f9af95f7609e5fca6",
"score": "0.5392371",
"text": "def app\n parent.app\n end",
"title": ""
},
{
"docid": "07e40dff1db5cfc69247e1a27f3ee14c",
"score": "0.5389784",
"text": "def get_app(app)\n connection.request(\n :method => :get,\n :path => \"/apps/#{app}\"\n )\n end",
"title": ""
},
{
"docid": "a3c25da6c79d1b4ad2a0f0f47d047f80",
"score": "0.5374987",
"text": "def detect_appname(target)\n return \"app.rb\" if File.exist?(File.join(self.target, \"app.rb\"))\n return \"application.rb\" if File.exist?(File.join(self.target, \"application.rb\"))\n file_array = Dir.glob(File.join(\"#{target}\", \"*.rb\"))\n return file_array[0] if ! file_array.nil? and file_array.count == 1\n return \"\" # gracefully failure\n end",
"title": ""
},
{
"docid": "49ea61eb05a66b591b6455c4d88732b3",
"score": "0.53706276",
"text": "def finder\n new 'com.apple.finder'\n end",
"title": ""
},
{
"docid": "ddd60a0f8f2af6fcbde041ccf5030b05",
"score": "0.5360583",
"text": "def get_mplayerx_settings_gui_app_name()\n app_name = \"Mplayerx Settings GUI\"\n return app_name\nend",
"title": ""
},
{
"docid": "c7b33411a9453920caa325a1acf54423",
"score": "0.53589946",
"text": "def dock\n unless $browser.is_element_present(\"#{@locator}[contains(@class,'docked')]\")\n show\n $browser.click_at(@@button_locator,\"1,1\")\n end\n end",
"title": ""
},
{
"docid": "e8e2c62f8eeccdf38aa88d6edb7a6d01",
"score": "0.5351536",
"text": "def windows_os_window(application)\n titles = `tasklist /v /fi \"imagename eq #{application}.exe\" /fo list | findstr Window`\n .split(\"\\n\")\n .map { |i| i.gsub(FILTERED_TITLES, '') }\n .reject(&:empty?)\n raise RecorderErrors::ApplicationNotFound, \"No open windows found for: #{application}.exe\" if titles.empty?\n\n warn_on_mismatch(titles, application)\n titles\n end",
"title": ""
},
{
"docid": "5db59baf54f4bcd2e6a853e5a1a45607",
"score": "0.53510404",
"text": "def find_command(name)\n\tENV['PATH'].split(File::PATH_SEPARATOR).detect do |directory|\n\t\tpath = File.join(directory, name.to_s)\n\t\tif File.executable?(path)\n\t\t\treturn path\n\t\tend\n\tend\n\treturn nil\nend",
"title": ""
},
{
"docid": "9a484e656245001b72a6c60974ec6afc",
"score": "0.53448087",
"text": "def app?(name)\n\n # With force enabled, NOTHING has been installed\n return false if @options[:force]\n\n # First see if the name is a command\n return true if command? name\n\n # Otherwise, check for different app types\n case name.split('.').last.downcase.to_sym\n\n when :app\n return true if find? \"/Applications\", name\n return true if find? \"~/Applications\", name\n return true if find? \"~/Library/Application Support\", name\n\n when :prefpane\n return true if find? \"~/Library/PreferencePanes\", name\n return true if find? \"/Library/PreferencePanes\", name\n\n when :service\n return true if find? \"~/Library/Services\", name\n return true if find? \"/Library/Services\", name\n\n when :plugin\n return true if find? \"~/Library/Internet Plug-Ins\", name\n return true if find? \"/Library/Internet Plug-Ins\", name\n\n when :safariextz\n return true if find? \"~/Library/Safari/Extensions\", name\n\n when :fxplug\n return true if find? \"/Library/Plug-Ins/FxPlug\", name\n\n when :moef\n return true if find? \"~/Movies/Motion Templates/Effects\", name\n\n end\n false\n end",
"title": ""
},
{
"docid": "53964e4c1fe44ed0d4c58f4cbaa79c31",
"score": "0.5341779",
"text": "def mma_pkg_app_path\n share/\"Mathematica\"/\"Applications\"\n end",
"title": ""
},
{
"docid": "53964e4c1fe44ed0d4c58f4cbaa79c31",
"score": "0.5341779",
"text": "def mma_pkg_app_path\n share/\"Mathematica\"/\"Applications\"\n end",
"title": ""
},
{
"docid": "9d3ef1c41f537b2279c115b5f801d3cf",
"score": "0.53394604",
"text": "def autodmenu\n ['rofi -dmenu', 'dmenu'].find { |launcher| `which #{launcher.split.first}`; $?.success? }\nend",
"title": ""
},
{
"docid": "99958f0bbc1b221cc218a30cace9e10a",
"score": "0.5336059",
"text": "def find_command(name)\n\tname = name.to_s\n\tENV['PATH'].to_s.split(File::PATH_SEPARATOR).detect do |directory|\n\t\tpath = File.join(directory, name)\n\t\tif File.file?(path) && File.executable?(path)\n\t\t\treturn path\n\t\tend\n\tend\n\treturn nil\nend",
"title": ""
},
{
"docid": "e814afd13793971c7f1935fbd577ab44",
"score": "0.53330207",
"text": "def appname(new_name = None)\n Tk.execute(:tk, :appname, new_name)\n end",
"title": ""
},
{
"docid": "38a4fbe296d944cf71fa8af335325ba7",
"score": "0.53318477",
"text": "def fetch_app_details\n # Extract app_id\n app_id = Nutella.current_app.config['name']\n return app_id, Dir.pwd\n end",
"title": ""
},
{
"docid": "14ec831412c539e6b21f353240d3b33f",
"score": "0.5318811",
"text": "def getAppname()\n\t\tquery = SearchQuery.new\n\t \tquery.name = @APPNAME\n\t \titem = search(query)[0]\n\t\tif ! item.nil?\n\t\t\treturn item.getMySelf(@TEXT)\n\t \tend\n\tend",
"title": ""
}
] |
98c68a95bc0656c6570ff62a14eb6b83
|
A method that might be used in the future, but isn't currently def score
|
[
{
"docid": "d8e1e4d33697e5ce0631fd9b427a20ce",
"score": "0.0",
"text": "def draw\n self.image.draw_rot((@x+0.5)*60, (@y+1.5)*60, ZOrder::Piece, @angle)\n end",
"title": ""
}
] |
[
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
"score": "0.87415296",
"text": "def score; end",
"title": ""
},
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
"score": "0.87415296",
"text": "def score; end",
"title": ""
},
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
"score": "0.87415296",
"text": "def score; end",
"title": ""
},
{
"docid": "8ecaf647f536b0bd12fb07d6e189ff9d",
"score": "0.87415296",
"text": "def score; end",
"title": ""
},
{
"docid": "af9f634fb68331d3c1bec77a362ccbe4",
"score": "0.8582105",
"text": "def score\n end",
"title": ""
},
{
"docid": "af9f634fb68331d3c1bec77a362ccbe4",
"score": "0.8582105",
"text": "def score\n end",
"title": ""
},
{
"docid": "af9f634fb68331d3c1bec77a362ccbe4",
"score": "0.8582105",
"text": "def score\n end",
"title": ""
},
{
"docid": "042b3dfd500308adaffa18f36fa9b709",
"score": "0.8556434",
"text": "def score\n end",
"title": ""
},
{
"docid": "fe4b2e20edd5a55bd2632325ee78937b",
"score": "0.8556063",
"text": "def scoring\n end",
"title": ""
},
{
"docid": "24a2f2f4c811e4aed432a5e21036fc0a",
"score": "0.8423712",
"text": "def calculateScore\n\n\tend",
"title": ""
},
{
"docid": "c6c588a59c31a1cb822a607f3ce1842c",
"score": "0.8412295",
"text": "def calculate_score\n #to be written later\n end",
"title": ""
},
{
"docid": "bb828ae8e8aa8bc1bcddce854d9dad59",
"score": "0.8278487",
"text": "def score\n 0\n end",
"title": ""
},
{
"docid": "fd588b10d42a3be06fae86674e5512cd",
"score": "0.8238501",
"text": "def score\n #no clue\n\n\n end",
"title": ""
},
{
"docid": "d9b313c60e1142abba31bfed0ebb8fad",
"score": "0.8214018",
"text": "def score\n 0\n end",
"title": ""
},
{
"docid": "d9b313c60e1142abba31bfed0ebb8fad",
"score": "0.8214018",
"text": "def score\n 0\n end",
"title": ""
},
{
"docid": "837f43b342f08ae159587c5eeba0c50e",
"score": "0.8180836",
"text": "def calculateScore\n\t\treturn 42\n\tend",
"title": ""
},
{
"docid": "512de64cf2cfb0ffeead743d7e3282e7",
"score": "0.811613",
"text": "def score\n raise\n end",
"title": ""
},
{
"docid": "136ff1ddd2f8dfbb3b46193610c8b308",
"score": "0.8033808",
"text": "def by_score\n end",
"title": ""
},
{
"docid": "fe38bd374ac91a8f6940011f2e78984d",
"score": "0.8029641",
"text": "def scores\n \n end",
"title": ""
},
{
"docid": "e2e51dc85b8f5a4d25ecf5c6765e536f",
"score": "0.796661",
"text": "def total_score; end",
"title": ""
},
{
"docid": "564dde74c940ae101aad77f3cf40033c",
"score": "0.7952646",
"text": "def score\n 99.98\n end",
"title": ""
},
{
"docid": "47b79d4c5bdffdb77beaeba87b893481",
"score": "0.7946887",
"text": "def score\n @score\n end",
"title": ""
},
{
"docid": "bfe19bfc74f10b671e0c3167693c0507",
"score": "0.7934154",
"text": "def score=(_arg0); end",
"title": ""
},
{
"docid": "98b2abcb9239fb5d66838b89b6907aea",
"score": "0.7839455",
"text": "def match_score(val); end",
"title": ""
},
{
"docid": "98b2abcb9239fb5d66838b89b6907aea",
"score": "0.7839455",
"text": "def match_score(val); end",
"title": ""
},
{
"docid": "96ab59ee1f9df9525db7aa7c68058e10",
"score": "0.78300995",
"text": "def score\n @score\n end",
"title": ""
},
{
"docid": "4f2ee2a387e93fbcb8c75bbf00f86e1b",
"score": "0.7811236",
"text": "def calculate_score\n raise 'Abstract Method'\n end",
"title": ""
},
{
"docid": "31e0636cc7e655d0a4a87d8c0c43f729",
"score": "0.7779583",
"text": "def score\n nil\n end",
"title": ""
},
{
"docid": "edf1c251c3b9d34d0c000ab8d1193267",
"score": "0.7766857",
"text": "def score\n prepare_quiz\n compute_result\n score_feedback\n end",
"title": ""
},
{
"docid": "c4f4cd91636c5499f50b8b944eef1f7b",
"score": "0.775566",
"text": "def calculate_score\n self.score = (ll_score + tw_base + fb_base + google_base + pinterest_base + linkedin_base + delicious_base + stumble_base) / (((Time.now - created_at) / 1.hour) + 2 ** 3.0)\n end",
"title": ""
},
{
"docid": "ca3544483539a281165b769ac95bf0ef",
"score": "0.77407855",
"text": "def score\n OPS.map { |op| method(op[1]).call()}.find([0]) { |score| score }\n end",
"title": ""
},
{
"docid": "76f52f45c4d8921aa797b4c6e4d8ed61",
"score": "0.76910955",
"text": "def score\n rate.score\n end",
"title": ""
},
{
"docid": "2e579fdca18b100c5b41e4a7000e041c",
"score": "0.7657078",
"text": "def score\n return 'love' if @points == 0\n return 'fifteen' if @points == 1\n return 'thirty' if @points == 2\n return 'fourty' if @points == 3\n end",
"title": ""
},
{
"docid": "705748189e4a3ef28a471b432000c7f6",
"score": "0.7629405",
"text": "def get_score\n @score = 3 * @tally + 5 * @strength + 2 * @wealth + @food + 30 * @mk\n @score\n end",
"title": ""
},
{
"docid": "3961623e7a8e62a6cfa5739def1946c4",
"score": "0.76150477",
"text": "def average_score\n end",
"title": ""
},
{
"docid": "600854cad122fd5e1b4fd9775d314d9c",
"score": "0.7614518",
"text": "def calculate_score\n self.score = RatingSystem::SCORE_FACTOR * (skill_mean - 2 * skill_deviation)\n self.score = [self.score.to_i, 0].max # ensure not negative\n end",
"title": ""
},
{
"docid": "b1f2cab09ba25ff3e05e95f3232c3d49",
"score": "0.7579814",
"text": "def score( plyr )\n plyr.score\n end",
"title": ""
},
{
"docid": "9e0062d8acc7501cb19aa3c5fed1eb82",
"score": "0.756638",
"text": "def calculate_score\n\t\tscore = Score.new\n\t\tscore.analyze(self)\n\t\tscore.score\n\tend",
"title": ""
},
{
"docid": "0f37b814aea35a54cb27981d8a3f0041",
"score": "0.7536447",
"text": "def score\n return 'love' if @points == 0\n return 'fifteen' if @points == 1\n return 'thirty' if @points == 2\n return 'forty' if @points == 3\n return 'advantage' if @points == 4\n return 'adv +' if @points >= 5\n end",
"title": ""
},
{
"docid": "f03b53499deba5589c04e8b1eb76953b",
"score": "0.7527058",
"text": "def getCurrentScore\n return currentScore\n end",
"title": ""
},
{
"docid": "3660c8d48fc7d62a7c14efd56b988fbf",
"score": "0.7526822",
"text": "def score\n case points\n when 0\n 'love'\n when 1\n 'fifteen'\n when 2\n 'thirty'\n when 3\n 'fourty'\n end\n end",
"title": ""
},
{
"docid": "6e7ab434c068ef1aff0d0b70608114a2",
"score": "0.75261724",
"text": "def score\n return 'love' if @points == 0\n end",
"title": ""
},
{
"docid": "e2a36f7856c1b2045ee6bdf07b7ebeeb",
"score": "0.7509808",
"text": "def calculateScore(score)\n\t\t\t@score = @adventureInfo.calculateScore(@levelInfo[2],@levelInfo[4],score)\n\tend",
"title": ""
},
{
"docid": "a93d2869580ac15ba4c355202130b27d",
"score": "0.75030315",
"text": "def score(obj)\n 1\n end",
"title": ""
},
{
"docid": "8061dfe350080a0bde52cd3f634c0d00",
"score": "0.74829537",
"text": "def calculate_score\n self.score = RatingSystem::SCORE_FACTOR * (skill_mean - RatingSystem::SCORE_MEAN_DEVIATION_K * skill_deviation)\n self.score = [self.score.to_i, 0].max # ensure not negative\n end",
"title": ""
},
{
"docid": "4c4d75f88c422680f3f556d37ceab60e",
"score": "0.7478997",
"text": "def score\n return @score\n end",
"title": ""
},
{
"docid": "1f54082df60dd5ab3c0323654fe57d52",
"score": "0.7467322",
"text": "def score\n (object.score*20).round if object.score\n end",
"title": ""
},
{
"docid": "1286113d4dbd2e5f9872eafe2b6fdcb2",
"score": "0.74665314",
"text": "def calculate_score\n\n # Default score\n score = 0\n\n # Extra points for picture\n if has_picture? then\n score += 5\n end\n\n score += (5 - last_active) # score for being active\n score += campaign_score # Calculate score on certain camp\n\n\n return score\n end",
"title": ""
},
{
"docid": "853ca927ab6ef714006bb97ebd791b8e",
"score": "0.7445315",
"text": "def score\n return 'love' if @points == 0\n return 'fifteen' if @points == 1\n return 'thirty' if @points == 2\n return 'forty' if @points == 3\n return 'advantage' if @points == 4 && opponent.points == 5\n end",
"title": ""
},
{
"docid": "831ac54bd0a7bb9032723816360cda85",
"score": "0.7432803",
"text": "def score\n 3*@tally + 5*@strength + 2*@wealth + @food + 30*@monsters_killed\n end",
"title": ""
},
{
"docid": "411f72c215fecdec854de460db10f640",
"score": "0.74135315",
"text": "def scoreOf(_psStub)\n return 0 ;\n end",
"title": ""
},
{
"docid": "e478cf0e62f9c20cd0a1dd8fecbb1021",
"score": "0.7408963",
"text": "def score_value\n return @score\n end",
"title": ""
},
{
"docid": "4663c68c6e8cce690cde5b37903072c6",
"score": "0.7374958",
"text": "def calculate_score!\n highest_possible_score = 0\n actual_score = 0\n self.criteria_responses.each{|cr|\n if cr.score\n highest_possible_score += 10 * cr.criteria.weight\n actual_score += cr.score * cr.criteria.weight\n end\n }\n self.score = (highest_possible_score == 0) ? 0 : (actual_score * 100) / highest_possible_score\n \n ## check for initial_score\n if self.score == 0 && self.initial_score.to_i > 0\n self.score = self.initial_score.to_i\n end\n end",
"title": ""
},
{
"docid": "eec1b20b72a5dfe0ee93d124f01132ab",
"score": "0.7354695",
"text": "def score(game)\n count\n 0\n end",
"title": ""
},
{
"docid": "db8e780981ebef715b302f48b4070cb4",
"score": "0.7343092",
"text": "def score_standard\n\t\t@total_score += @roll + @next_roll\n\t\t@current_roll += 2\n\tend",
"title": ""
},
{
"docid": "7077596588a6c33520c72f7ec91fed91",
"score": "0.7317632",
"text": "def score\n score = stat(\"G\")\n score += 0.239908 * stat(\"SG\") # shots on goal\n score += 0.198056 * stat(\"SV\") # saves\n score += 0.588098 * stat(\"A\") # assists\n score -= 0.488015 * stat(\"RC\") # red cards (negative)\n return score\n end",
"title": ""
},
{
"docid": "c5109f7a455cc5b938052528606aa6cc",
"score": "0.73150975",
"text": "def score(request); end",
"title": ""
},
{
"docid": "cb32144f99b7694b40be991a75e4eaf6",
"score": "0.73132443",
"text": "def score_one\n if how_many? > 5\n @score += 2000\n elsif how_many? > 2\n @score += 1000 + (how_many?-3)*100\n else\n @score += how_many?*100\n end\n end",
"title": ""
},
{
"docid": "c89a05ea7a431edb9500db770ff97f34",
"score": "0.73117614",
"text": "def getScore()\n\t\treturn @score\n\tend",
"title": ""
},
{
"docid": "9ac4207060b4c3ac25c3c03458f19ee7",
"score": "0.7305747",
"text": "def pure_score\n self.our_score.to_i\n end",
"title": ""
},
{
"docid": "8b220afb0c1d94137098f6f931dd669c",
"score": "0.73013765",
"text": "def score m\n m.score_Paper self\n end",
"title": ""
},
{
"docid": "90f612f33cae6aa1f2606aedaef9c7cb",
"score": "0.72868615",
"text": "def score\n\n self.ball_scores.inject(0) do |sum, i| \n\t sum += i\n\tend\n end",
"title": ""
},
{
"docid": "7681eaa8dea2d69299f4f7ed74b3d651",
"score": "0.7286199",
"text": "def rateable_score\n @rateable_score ||= results.inject(0.0) { |t, r| t + (r.rateable ? r.score : 0.0) }\n end",
"title": ""
},
{
"docid": "59e6327367f0736642c87fd3c1d0790a",
"score": "0.7273208",
"text": "def show_score\n end",
"title": ""
},
{
"docid": "2560c807fb329d73b22c5533e0375cf3",
"score": "0.7267706",
"text": "def calculated_score\n if @score.nil?\n UPPER_LIMIT + 1\n else\n @score\n end\n end",
"title": ""
},
{
"docid": "2560c807fb329d73b22c5533e0375cf3",
"score": "0.7267706",
"text": "def calculated_score\n if @score.nil?\n UPPER_LIMIT + 1\n else\n @score\n end\n end",
"title": ""
},
{
"docid": "a52838d2e7f90e5cf14105f911203fdc",
"score": "0.7253729",
"text": "def get_score(word)\n Scrabble::Scoring.score(word)\n end",
"title": ""
},
{
"docid": "ad204a1a2853f8c8340e6443cbe7f3f5",
"score": "0.72438663",
"text": "def score\n @data[:score]\n end",
"title": ""
},
{
"docid": "601fbe0a7befc8e1da1e35f8b58c0f67",
"score": "0.72183925",
"text": "def preferred_score\n :highscore\n end",
"title": ""
},
{
"docid": "51071c021a22b604793cc3d574c92a90",
"score": "0.72127825",
"text": "def score()\n score = sum_block_sizes()-@mis_matches.to_i()\n end",
"title": ""
},
{
"docid": "ca46070eb919c747d5e86a0df2d87704",
"score": "0.7208476",
"text": "def score\n self[:score].to_i\n end",
"title": ""
},
{
"docid": "44316e1fe3b48347e8633057f0889985",
"score": "0.7201489",
"text": "def score\n score = 0\n first_n.each do |key, value|\n score += value.value\n end\n if @plagiarism\n score -= -100\n end\n score\n end",
"title": ""
},
{
"docid": "ec5b7774ed2dba17fd8b638f533dcce3",
"score": "0.720137",
"text": "def score()\n\t\tif self.score_1.blank?\n\t\t\tif self.score_2.blank?\n\t\t\t\treturn 0\n\t\t\telse \n\t\t\t\treturn score_2\n\t\t\tend\n\t\telse\n\t\t\tif self.score_2.blank?\n\t\t\t\treturn score_1\n\t\t\telse \n\t\t\t\treturn (score_2 + score_1) / 2\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f705a4918f6a0249b6bd6bc9395bcc3d",
"score": "0.71915126",
"text": "def script_score\n 0\n end",
"title": ""
},
{
"docid": "c516c84c1b5c7d7bc331d09a7642b07c",
"score": "0.71881515",
"text": "def get_alternative_total_score()\n # TODO The method get_total_score() above does not seem correct. Replace with this method.\n total_score = 0\n\n self.scores.each { |score| total_score = total_score + score.score }\n\n total_score\n end",
"title": ""
},
{
"docid": "390363c2bf8f7e965112a2e55653a787",
"score": "0.71853715",
"text": "def min_score\n end",
"title": ""
},
{
"docid": "87437b752ce206eb90fd4796e6b9f042",
"score": "0.71852946",
"text": "def score\n return 'love' if @points == 0\n return 'fifteen' if @points == 1\n return 'thirty' if @points == 2\n return 'forty' if @points == 3\n return \"#{@points}\" if @points > 3\n end",
"title": ""
},
{
"docid": "b79ac77d2cbd8b60f38f8de40af93a8d",
"score": "0.7181163",
"text": "def score(key)\n fail \"Score #{key.inspect} does not exist or is not calculated yet.\" unless @scores.key? key\n @scores.fetch(key)\n end",
"title": ""
},
{
"docid": "8556010c27f895ad9fdbc1112e8d9430",
"score": "0.7177604",
"text": "def score m\n m.score_Rock self\n end",
"title": ""
},
{
"docid": "75dec1b9c929a5440513a99bc83d10ec",
"score": "0.7159014",
"text": "def score\n normalize_scores\n [:our, :their].map{|team| send(\"#{team.to_s}_display_score\") }\n end",
"title": ""
},
{
"docid": "098a2f8db35da464fe8991194d4d0ff2",
"score": "0.7149983",
"text": "def score_at_index(index)\n 0\n end",
"title": ""
},
{
"docid": "a0dd9854fe704fab44522d7dc84647b0",
"score": "0.7141681",
"text": "def score_all!\n false # TODO\n end",
"title": ""
},
{
"docid": "a0dd9854fe704fab44522d7dc84647b0",
"score": "0.7141681",
"text": "def score_all!\n false # TODO\n end",
"title": ""
},
{
"docid": "0ff86f65b9edf40b2e98af90a6117acd",
"score": "0.7139795",
"text": "def get_alternative_total_score\n # TODO: The method get_total_score() above does not seem correct. Replace with this method.\n total_score = 0\n\n self.scores.each {|score| total_score += score.score }\n\n total_score\n end",
"title": ""
},
{
"docid": "aaa5522dbb30c91d71c9d82f01660bd4",
"score": "0.71387124",
"text": "def score(args)\n @signature.score(args)\n end",
"title": ""
},
{
"docid": "0949c94ea9e931ebacda920f514b568f",
"score": "0.7135564",
"text": "def calculate()\n avgScore = @scores.sum.to_f / @scores.length.to_f\n\n case avgScore\n when 90..100\n \"O\"\n when 80..89\n \"E\"\n when 70..79\n \"A\"\n when 55..69\n \"P\"\n when 40..54\n \"D\"\n else\n \"T\"\n end\n end",
"title": ""
},
{
"docid": "99dfc00c5b0908ab3dac2a775fcc984c",
"score": "0.7131185",
"text": "def score_regular\n if how_many? > 5\n @score += @die*200\n elsif how_many? > 2\n @score += @die*100\n end\n end",
"title": ""
},
{
"docid": "f3af4f69d8040d2827bd1f1950ca33c0",
"score": "0.71099246",
"text": "def score m\n m.score_Scissors self\n end",
"title": ""
},
{
"docid": "84e426c0b1d01de88d53db89d37095e7",
"score": "0.71012026",
"text": "def add_score\r\n @score += 1\r\n end",
"title": ""
},
{
"docid": "d4946bbbebfee34a641e131d6a4dde15",
"score": "0.70987695",
"text": "def score=(value)\n @score = value\n end",
"title": ""
},
{
"docid": "aa49486e50cdd10e4da563bbcc274f3a",
"score": "0.7097239",
"text": "def score\n letters = self.word.split(//)\n symbols = letters.map {|letter| letter.to_sym}\n word_score = symbols.reduce(0) do |sum, symbol|\n sum + @points[symbol]\n end \n return word_score\n end",
"title": ""
},
{
"docid": "33348ada2ec0b963fdc9dad8da16f584",
"score": "0.7095522",
"text": "def scoring\n vars[:scoring]\n end",
"title": ""
},
{
"docid": "93af77ba8fd00fef5ee9875583abbac6",
"score": "0.709311",
"text": "def increment_score()\n @score += 1\n end",
"title": ""
},
{
"docid": "aa77dd811749f0fe1141eb4214332aba",
"score": "0.70857733",
"text": "def initialize\n @score = 0\n end",
"title": ""
},
{
"docid": "97385420589dfbbafdec2a475574b989",
"score": "0.7082429",
"text": "def score_rating\n \tscore[1][0]\n end",
"title": ""
},
{
"docid": "b665fd62b93a41457e0d1a7fe9d1a1b1",
"score": "0.70770717",
"text": "def get_score\n if result.length == 0\n return -1\n else\n return result[0][:points]\n end\n end",
"title": ""
},
{
"docid": "12b633078b65ff2ef662afc79f7d5804",
"score": "0.70736545",
"text": "def score(answers)\n if @answers & @answer_key == @answers \n return 100\n else\n return 75.0\n end\n\n # if grader.grades.count == 0 \n # i =+ 1 \n # else\n # return \"No grades have been taken\"\n # end\n end",
"title": ""
},
{
"docid": "b36a3cb334677855a00ecfe0e7fc1590",
"score": "0.70735663",
"text": "def score\n SCORES.each do |name, evaluation|\n return name if send(evaluation)\n end\n \"High Card\"\n end",
"title": ""
},
{
"docid": "88b40a80478e8f2c5dd791c954f9fce9",
"score": "0.7071833",
"text": "def score(r1,r2)\n (4*(r1-1)+1) * (4*(r2-1)+1)\nend",
"title": ""
},
{
"docid": "56cf501a7ba36e8c1ee65fe4e4be045c",
"score": "0.7064937",
"text": "def score_index\n SCORES.index score\n end",
"title": ""
},
{
"docid": "e59268b7354a133e55872109a420a1c7",
"score": "0.70619303",
"text": "def score_total\n score_geo + score_gci + score_gen if score_geo && score_gci && score_gen\n end",
"title": ""
}
] |
d629bc42316b554a95d65d17c03db1ba
|
post method when paid button is click
|
[
{
"docid": "31a446c83bbe2a2e3b3d4f4c1cd4bbc6",
"score": "0.0",
"text": "def receive_donation\n donation = Donation.find(params[:donation_id])\n if donation.update(paid: true)\n respond_to do |format|\n format.html {redirect_to users_chair_path, notice: \"donation received\"}\n format.js {head :no_content}\n end\n # redirect_to users_chair_path\n end\n end",
"title": ""
}
] |
[
{
"docid": "bda0a9c779b47ddfa623bd173b9f11cb",
"score": "0.7664195",
"text": "def mark_as_paid_button\n @template.button_to 'Mark as paid', mark_as_paid_effort_path(self, :uid => self.id), :method => :post, data: { confirm: 'Are you sure?' }\n end",
"title": ""
},
{
"docid": "ed21afda8becc14887432d542ee7ab30",
"score": "0.73394203",
"text": "def payment\n\n\n end",
"title": ""
},
{
"docid": "ffb249ae823a1e3d0596ebe0d43a5569",
"score": "0.73105323",
"text": "def payment\n \n end",
"title": ""
},
{
"docid": "8222aa58cb6e4f180762a64a9e67e06c",
"score": "0.71032304",
"text": "def pay\n handle_action('pay')\n notify(\"paid\",nil)\n end",
"title": ""
},
{
"docid": "af3a827ee367aed3e02e11979c678a99",
"score": "0.7073288",
"text": "def paid\n notification = Robokassa.notification request.raw_post, :secret => APP['robokassa'][\"secret_2\"]\n if notification.acknowledge # check if it’s genuine Robokassa request\n #@payment.approve! # project-specific code\n render :text => notification.success_response\n else\n head :bad_request\n end\n end",
"title": ""
},
{
"docid": "60e10d1b14c1fbbec14be6e47e0f5aab",
"score": "0.67921525",
"text": "def paid\n\t\t\t#@notification = Robokassa::Notification.new(request.query_string,\n\t\t\t# :secret => Rails.configuration.robokassa_secret2)\n\t\t\tif @notification.acknowledge # check if it’s genuine Robokassa request\n\t\t\t\tenter_payment\n\t\t\t\trender :text => @notification.success_response\n\t\t\telse\n\t\t\t\thead :bad_request\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "8f140fbd47dab12fdb317570d18e14e9",
"score": "0.67636985",
"text": "def payments\n end",
"title": ""
},
{
"docid": "52b1c496cb9db7beafaa16038a518be1",
"score": "0.6711844",
"text": "def pay\n \n end",
"title": ""
},
{
"docid": "51427b1f17e0f87af5cc19410e37331f",
"score": "0.66242516",
"text": "def pay_up!\n paid!\n end",
"title": ""
},
{
"docid": "4fc6852c9136fefb44ab3181f935fca8",
"score": "0.6547574",
"text": "def ask_pledge\n if request.post?\n if @payment.update(params.permit(:payment_in, :amount))\n render_success_message 'Pledge successfully updated!'\n else\n render_error_model @payment\n end\n end\n end",
"title": ""
},
{
"docid": "4aa73f9ff78c4eb68b2981a52df41b98",
"score": "0.6538002",
"text": "def confirm_purchase\n @b.link(:id => 'buy-submit').when_present.click\n end",
"title": ""
},
{
"docid": "0431755cd7c59a892c16ca96d6e013ab",
"score": "0.64936095",
"text": "def post_payment_details\n @details = helpers.vrn_to_pay(helpers.initiated_payment_data[:details])\n end",
"title": ""
},
{
"docid": "6b645dce2004f742eb328a89d28fe9e3",
"score": "0.64756",
"text": "def pay_app\n pay_now_btn.click\n end",
"title": ""
},
{
"docid": "a4241b612c6c3b323879ea5f709aae72",
"score": "0.64546764",
"text": "def payment\n \tcurrent_user\n \t@owner = Owner.find(@current_user.resource_id)\n \t@plan = SignupPlan.find_by_id(params[:id])\n \t@current_user.resource.signup_plan = @plan\n \t@invoice = Invoice.new\n \[email protected]_plan = @plan\n \[email protected] = @current_user\n \[email protected] = @plan.price\n \[email protected] = \"Payment due\"\n \[email protected]!\n end",
"title": ""
},
{
"docid": "03609247f6603698e31f370d6c11b9a7",
"score": "0.6423514",
"text": "def submit_payment val\r\n InvoiceProcessor.new(self).submit_payment val\r\n end",
"title": ""
},
{
"docid": "a606d5351bcce2e50042970ab967111a",
"score": "0.6403008",
"text": "def pay_now\n\[email protected] = 1\n respond_to do |format|\n if @purchase.save\n format.html { redirect_to @purchase, notice: 'Purchase Payment Made.' }\n format.json { head :no_content }\n else\n format.html { render action: \"pay_now\" }\n format.json { render json: @purchase.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9938febf99d5ffec98e79afa378479de",
"score": "0.64027",
"text": "def paid\n @order = Order.last\n #@order = Order.find(params[:id])\n #@order.update_attribute(:status, 'Order Paid')\n @order.update_attribute(:status, 'Paid with PayPal')\n end",
"title": ""
},
{
"docid": "c3034d0306d2867fb28877b1f035a39f",
"score": "0.6377692",
"text": "def pay\n payment = @promotion.payment || @promotion.build_payment(amount: @promotion.budget, user: current_user)\n if request.post? || params[:PayerID]\n uri = grow_church_dashboard_user_group_churches_management_index_url(user_group_id: @church)\n make_payment_helper(payment, paypal_cancel_url: uri, success_msg: 'Promotion successfully saved!') do\n @promotion.update(is_paid: true)\n end\n end\n end",
"title": ""
},
{
"docid": "4d58e92a95277461cfb8d8fb5b625940",
"score": "0.6346256",
"text": "def paypal_postback\n raise('paypal provider is not available') unless EffectiveOrders.paypal?\n\n @order ||= Effective::Order.where(id: (params[:invoice].to_i rescue 0)).first\n\n # We do this even if we're not authorized\n EffectiveResources.authorized?(self, :update, @order)\n\n if @order.present?\n if @order.purchased?\n order_purchased(payment: params, provider: 'paypal', card: params[:payment_type])\n elsif (params[:payment_status] == 'Completed' && params[:custom] == EffectiveOrders.paypal[:secret])\n order_purchased(payment: params, provider: 'paypal', card: params[:payment_type], current_user: current_user)\n else\n order_declined(payment: params, provider: 'paypal', card: params[:payment_type])\n end\n end\n\n head(:ok)\n end",
"title": ""
},
{
"docid": "b87947a82ed469d2fa0b1ddd4a0e8980",
"score": "0.63333076",
"text": "def proceed_to_checkout\n custom_click_button :title, 'Proceed to Checkout'\n end",
"title": ""
},
{
"docid": "b31acc4282c043ff547912b6024ff7a1",
"score": "0.63214296",
"text": "def paid\n if @notification.acknowledge # check if it’s genuine Robokassa request\n #@payment.approve! # project-specific code\n Transaction.find_or_create_by({\n amount: @notification.amount,\n user_id: params['shp_uid'],\n target_id: @notification.item_id,\n target_type: 'balance'\n })\n\n render :text => @notification.success_response\n else\n head :bad_request\n end\n end",
"title": ""
},
{
"docid": "ae8766b518a95f99e5ca5704587a3b3b",
"score": "0.63086563",
"text": "def paid\n notification = Robokassa::Notification.new(request.raw_post, secret: ENV['ROBOKASSA_PASSWORD2'])\n\n item = BalanceIncome.find(notification.item_id)\n Rollbar.info('RobokassaController#paid', item: item,\n notification: notification)\n\n # check if it’s genuine Robokassa request\n if item.pending? &&\n notification.acknowledge &&\n notification.amount == item.amount\n\n Rails.logger.info \"RobokassaPayment success. Item: [#{item.id}]\"\n item.paid!\n Rollbar.info(\"Robokassa paid!\", item: item,\n notification: notification)\n\n render text: notification.success_response\n else\n Rails.logger.warn \"RobokassaPayment declined. Item: [#{item.id}]\"\n Rollbar.info(\"Robokassa declined!\", item: item,\n notification: notification)\n item.failed!\n on_payment_failed\n end\n\n rescue => e\n Rails.logger.info \"=== #{e.message} #{e.backtrace} ===\"\n Rollbar.error(e)\n item.try(:failed!)\n on_payment_failed\n end",
"title": ""
},
{
"docid": "fe7ab848f1769311b3a1d2fd25810904",
"score": "0.62978375",
"text": "def pay\n @expense = Expense.find(params[:expense_id])\n \n if (@expense.update_attributes(:paid => true))\n return render :json=> {:success => true, :message => \"expense paid successfully\"}\n else\n return render :json=> {:success => false, :message => \"expense paid unsuccessfully\"}\n end\n end",
"title": ""
},
{
"docid": "61912f487fc887fa61a1c609906ee5bd",
"score": "0.6293392",
"text": "def post\n end",
"title": ""
},
{
"docid": "61912f487fc887fa61a1c609906ee5bd",
"score": "0.6293392",
"text": "def post\n end",
"title": ""
},
{
"docid": "2e0991527c66426ddf9c29b4c26d6574",
"score": "0.62814933",
"text": "def show_payment\n end",
"title": ""
},
{
"docid": "c841fdef81c3ec9afe3812cc225039db",
"score": "0.623844",
"text": "def get_payment\n standard_page(\"Maintain Payment\",\n {\n 'done_url' => url(@data.handler),\n 'action' => @data.label,\n 'our_ref' => @data.our_ref,\n },\n IDENTIFY_PAYMENT);\n end",
"title": ""
},
{
"docid": "f606e74c084e10460916932588d944c6",
"score": "0.6222854",
"text": "def Complete_sample_delivery_submit\n end",
"title": ""
},
{
"docid": "9496342884eb81ec387570fdcd4a2062",
"score": "0.620927",
"text": "def receive_payment\n respond_modal_with(@invoice)\n end",
"title": ""
},
{
"docid": "74055a2a610ff9b189285dace8b8a9ad",
"score": "0.62031525",
"text": "def proceed_to_secure_checkout\n wait_until_element_present { @page.button('ctl00_contentBody_submit') }\n @page.click_button('ctl00_contentBody_submit')\n return DeliveryPage.new(@page, @country)\n end",
"title": ""
},
{
"docid": "2015ad79004a57eb31e9e221c8f83346",
"score": "0.6196719",
"text": "def payment_requested!\n self.status = STATUS[:payment_requested]\n self.save\n end",
"title": ""
},
{
"docid": "ea85c7142e17e7f04524e8f7c5924b9d",
"score": "0.61966705",
"text": "def pay\n\t\tpayment = Payment.find_by_id(params[:payment_id].to_i)\n\t\tnext_url = session[:next_url]\n\t\trender_404 if payment.nil?\n\t\tif next_url.nil?\n\t\t\tflash[:error] = \"There was a problem redirecting you to our payment provider\"\n\t\t\tredirect_to payment \n\t\tend\n\t\tif payment.success?\n\t\t\tflash[:error] = \"This order has already been paid\"\n\t\t\tredirect_to payment \n\t\tend\n \trender :locals => {:next_url => next_url, :payment => payment}\n\tend",
"title": ""
},
{
"docid": "8c3bdfba363a6474ade57511c074ddfa",
"score": "0.619482",
"text": "def verify_paid\n @paid = true\n end",
"title": ""
},
{
"docid": "d3f7830e69a9f6b8498860c2842d17af",
"score": "0.6193803",
"text": "def submit_single_page\n\n end",
"title": ""
},
{
"docid": "8c6d28f880d2111c7104015dbe6beb59",
"score": "0.61886084",
"text": "def secure_checkout_button\n @page.button('ctl00_contentBody_submit')\n end",
"title": ""
},
{
"docid": "c6114e1920db557589a27de67eb36c93",
"score": "0.6178391",
"text": "def pay\n @ac = nil\n ac_id = params[:id]\n student_id = params[:student_id]\n the_trans = Transaction.find(params[:trans_id])\n unless the_trans.nil?\n if the_trans.paid?\n the_trans.paid = false\n else\n the_trans.paid = true\n end\n the_trans.save\n format.json\n end\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "c6114e1920db557589a27de67eb36c93",
"score": "0.6178391",
"text": "def pay\n @ac = nil\n ac_id = params[:id]\n student_id = params[:student_id]\n the_trans = Transaction.find(params[:trans_id])\n unless the_trans.nil?\n if the_trans.paid?\n the_trans.paid = false\n else\n the_trans.paid = true\n end\n the_trans.save\n format.json\n end\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "0413240815854fc0bef6c6a0f2da97a1",
"score": "0.61724514",
"text": "def confirm_submission\n end",
"title": ""
},
{
"docid": "ed2ae01111a2eaab7f8cfe95802224b2",
"score": "0.616191",
"text": "def payment\n @amount = 10.00\n @sim_transaction = AuthorizeNet::SIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['api_transaction_key'], @amount, :hosted_payment_form => true)\n @sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(:link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', :link_url => payments_thank_you_url(:only_path => false)))\n end",
"title": ""
},
{
"docid": "0209d3e822395236728709e67463b3d6",
"score": "0.61372274",
"text": "def submit\n @@driver.find_element(:id ,'submitAccount').click\n return ConfirmationPage.new(@@driver)\n end",
"title": ""
},
{
"docid": "caf47508ef7f8c649d8dc75fd407ab75",
"score": "0.61366653",
"text": "def mark_paid\n @student_user = StudentUser.find(params[:id])\n @student_user.pay_status = \"yes\"\n @student_user.save!\n render 'admins/see_info'\n end",
"title": ""
},
{
"docid": "a1bb76b0d2653f51a90b420f0b41d015",
"score": "0.61364704",
"text": "def payment2\n \n # Amount needs to be determined based on the Camp for which the User is Registering\n @amount = 10.00\n \n @sim_transaction = AuthorizeNet::SIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], \n AUTHORIZE_NET_CONFIG['api_transaction_key'], @amount, :hosted_payment_form => true)\n @sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(\n :link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', \n :link_url => payments_thank_you_url(:only_path => false)))\n end",
"title": ""
},
{
"docid": "d8012e656ffe210494b902b484b55116",
"score": "0.6128903",
"text": "def create\n @payment = Payment.new(payment_params)\n @payment.paid = \"Yes\"\n respond_to do |format|\n if @payment.save\n flash[:success] = \"Payment Process Complete\"\n format.html { redirect_to @payment }\n format.json { render :show, status: :created, location: @payment }\n else\n format.html { render :new }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f613dff3d837eaa96804b5523158115",
"score": "0.61147827",
"text": "def pay_subscriptions\r\n @group = Center.find(params[:id])\r\n\t\tputs \"PAY_SUBSCRIPTIONS #{params.inspect} group:subscription_service: #{@group.subscription_service}\"\r\n if request.post? && params[:yes]\r\n\t\t\t# debugger\r\n flash[:notice] = \"Abonnementer er betalt.\" if @group.subscription_service.pay_active_subscriptions! # @group.set_active_subscriptions_paid!\r\n redirect_to center_path(@group)\r\n end\r\n @subscription_presenter = @group.subscription_presenter\r\n @options = {:hide_buttons => true}\r\n\r\n rescue ActiveRecord::RecordNotFound\r\n flash[:error] = 'Dette center (abonnement) kunne ikke findes.'\r\n redirect_to center_path(@group) #:action => :show, :id => @group\r\n end",
"title": ""
},
{
"docid": "57a7639ba25535fe676d6eb4013f43ed",
"score": "0.61035764",
"text": "def enter_verifying_payment; end",
"title": ""
},
{
"docid": "38f5688d14e12b9a8e9ff4a473302d8d",
"score": "0.6100264",
"text": "def check_for_payment(check_for_payment); JSON[Api::post_check_for_payment(check_for_payment, self)]; end",
"title": ""
},
{
"docid": "f90f1a3a242bb230bee51834b0225696",
"score": "0.6099516",
"text": "def pay\n if @invoice.pay\n render :show, status: :ok\n else\n render json: @invoice.errors.full_messages, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "661c21c33f1570bf12d6d984c0e4d95e",
"score": "0.6094116",
"text": "def complete\n @runner = current_runner\n @runner.update_attributes(paid: true)\n flash[:notice] = \"Your purchase is complete!\"\n redirect_to(root_path)\n end",
"title": ""
},
{
"docid": "00df81fbe2bb0542505db231e8a6719e",
"score": "0.6087998",
"text": "def process_payment( pennies_paid = 2995, subscription_expires_on = 1.year.from_now )\n\t\tself.pennies_paid = pennies_paid\n\t\tself.last_paid_at = Time.now\n\t self.subscription_expires_on = subscription_expires_on\n\t self.save!\n\tend",
"title": ""
},
{
"docid": "9f2817e782221633950717780102431e",
"score": "0.6077342",
"text": "def make_payment \n @member = current_member\n @invoice = current_member.member_invoices.find(params[:ledger_item_id])\n\n raise \"Invoice is already paid\" if @invoice.paid?\n\n respond_to do |format| \n payment = @space.payment_for(@invoice)\n\n if payment.status == \"cleared\"\n format.html { redirect_to \"/\", notice: 'Payment succeeded' }\n else\n flash[:notice]= payment.description\n format.html { redirect_to \"/\", notice: payment.description }\n end\n end\n end",
"title": ""
},
{
"docid": "8d244c8e93c271a7e92ea1ee63d3dddc",
"score": "0.6072873",
"text": "def POST; end",
"title": ""
},
{
"docid": "8d244c8e93c271a7e92ea1ee63d3dddc",
"score": "0.6072873",
"text": "def POST; end",
"title": ""
},
{
"docid": "8d244c8e93c271a7e92ea1ee63d3dddc",
"score": "0.6072873",
"text": "def POST; end",
"title": ""
},
{
"docid": "8d244c8e93c271a7e92ea1ee63d3dddc",
"score": "0.6072873",
"text": "def POST; end",
"title": ""
},
{
"docid": "56ab2806c0dd29d2554beaae2ea5a10b",
"score": "0.6069732",
"text": "def paid!\n update_columns(invoice_number: get_invoice_number, status: 'paid', paid_at: Time.current)\n end",
"title": ""
},
{
"docid": "6f973d5e19d9092fcfd3bc07816936be",
"score": "0.6044843",
"text": "def handle_paid_payment(payment)\n # nothing to do by default\n end",
"title": ""
},
{
"docid": "9f94febad1eb8a7173cb1f453f34b415",
"score": "0.6038197",
"text": "def action\n return \"MODIFY\" if self.paid? or self.pending?\n return \"SUBMIT\"\n end",
"title": ""
},
{
"docid": "55677981784c142dbe61ef58c454df71",
"score": "0.6024548",
"text": "def paypal\r\n if params[:token]\r\n if @subscription.complete_paypal(params[:token])\r\n flash[:notice] = 'Your billing information has been updated'\r\n redirect_to :action => \"billing\"\r\n else\r\n render :action => 'billing'\r\n end\r\n else\r\n redirect_to :action => \"billing\"\r\n end\r\n end",
"title": ""
},
{
"docid": "2b826ef118c4eeb4143f2e9f5e97fa20",
"score": "0.6020002",
"text": "def hook\n params.extract!(:controller, :action) # Remove these from params as they are not needed\n\n user = User.find_by(email: params[\"custom\"]) # Get user by callback email (Devise email)\n\n if user\n if params[\"payment_status\"] == \"Completed\"\n if !user.approved? # Dont approve them if they are already approved\n user.update_attribute(:approved, true) # Approve the user\n ContactMailer.new_member(user).deliver # Send email notification on download instructions\n PaymentLog.create!(payment_status: params[\"payment_status\"], payment_date: params[\"payment_date\"], paypal_email: params[\"payer_email\"], paypal_transaction_number: params[\"txn_id\"], user: user)\n end\n end\n end\n render nothing: true\n end",
"title": ""
},
{
"docid": "d72a0dd2799d449a1fa2e0df63e472bc",
"score": "0.6012325",
"text": "def set_paid!\n if set_paid\n self.save\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "339e5521828a900e1e89fbf3faa2625b",
"score": "0.60096747",
"text": "def create\n # You maybe want to log this notification\n notify = Paypal::Notification.new request.raw_post\n @order = Order.unpaid.find(notify.item_id)\n\n if notify.acknowledge\n # Make sure you received the expected payment!\n if notify.complete? and @order.price == BigDecimal.new( params[:mc_gross] )\n # All your bussiness logic goes here\n @order.update_attributes(:paid => true)\n render :nothing => true\n end\n rescue\n #Make sure you log the exceptions you have.\n end",
"title": ""
},
{
"docid": "b8861faba340bac0f30436c5ece21e15",
"score": "0.6006967",
"text": "def save_paid\r\n self.paid = calc_paid\r\n self.save\r\n end",
"title": ""
},
{
"docid": "8bfa002fcf1735afaa942bc2289e6077",
"score": "0.600091",
"text": "def confirm_pagseguro\n return unless (params[:state] == \"payment\") && params[:order][:payments_attributes]\n\n payment_method = PaymentMethod.find(params[:order][:payments_attributes].first[:payment_method_id])\n if payment_method.kind_of?(BillingIntegration::Pagseguro::Checkout)\n pagseguro_checkout_url = payment_method.redirect_url(@order)\n\n @order.payments.create(:amount => @order.total, :payment_method_id => payment_method.id)\n redirect_to pagseguro_checkout_url\n end\n end",
"title": ""
},
{
"docid": "4fb0aaacb8dd15794d92437199ba839c",
"score": "0.59991777",
"text": "def paypal_return\n # verify transaction thru pdt method\n response = pdt_post_request\n \n # save notification\n response.gsub!(\"\\n\", \"&\")\n @notification = PaymentNotification::Paypal.process_raw_post(response)\n\n # process order\n @notification.process_order\n\n # redirect_to order page\n redirect_to Api::Application.config.www_receipts_url\n end",
"title": ""
},
{
"docid": "d224aaa14566075be6b46c864e506392",
"score": "0.5997208",
"text": "def payment_done\n @yandex_payment = YandexMoney.find_by(invoiceId: yandex_params[:invoiceId])\n @yandex_payment.try(:update, yandex_params)\n add_gems_to_user unless @error_code or @yandex_payment.invalid?\n end",
"title": ""
},
{
"docid": "f32ad1d49669d94ee08bcd3927c27471",
"score": "0.5995972",
"text": "def payment_processed\n @plan = Plan.find session[:purchased_plan_id]\n session[:purchased_plan_id] = nil\n @user = current_user\n\n # Ask confirmation for the purchase\n purchase = EXPRESS_GATEWAY.purchase @plan.price_in_cents,\n ip: request.remote_ip,\n token: params[:token],\n payer_id: params[:PayerID]\n \n if purchase.success?\n\n # Save payment data for this user\n @user.update_attributes(\n express_token: params[:token], \n express_payer_id: params['PayerID'],\n transaction_data: EXPRESS_GATEWAY.details_for(params[:token])\n )\n @user.switch_to_plan(@plan.id, true)\n\n # Inform operators an account has been paid\n AdministrativeMailer.delay.account_upgraded(@user)\n\n redirect_to root_path, notice: \"Your payment was successful and your account has been upgraded.\"\n else\n redirect_to upgrade_account_path(@user), notice: purchase.message\n end\n end",
"title": ""
},
{
"docid": "acf9e3b6523ccc2ef812fb1f5b20722a",
"score": "0.5991927",
"text": "def payment_sent\n\n order = Spree::Order.find(session[:order_id]) || raise(ActiveRecord::RecordNotFound)\n\n session[:order_id] = nil # Reset cart\n redirect_to spree.order_path(order), :notice => Spree.t(:order_processed_successfully)\n\n end",
"title": ""
},
{
"docid": "589a19c2b8f7c7b7f987670a05525507",
"score": "0.5991268",
"text": "def handle_response\n \tif params[:st]==\"Completed\"\n \tpaypal_addition = params[:amt].split(':')[0].to_i/3\n \tcurrent_user.can_upload = current_user.can_upload.to_i+paypal_addition\n \tcurrent_user.save\n \t\tpayment = Payment.create(\n\t \t\t\t\t\t\t\t:user_id => current_user.id,\n\t \t\t\t\t\t\t\t:status => params[:st],\n\t \t\t\t\t\t\t\t:transaction_id => params[:tx],\n\t \t\t\t\t\t\t\t:amount => params[:amt]\n \t\t\t\t\t\t\t)\n \t\tflash.now[:notice] = \"Your Payment is successful.\"\n \t\tredirect_to cars_new_path\n \telse\n \t\tredirect_to paypal_error_path\n \tend\n end",
"title": ""
},
{
"docid": "a9218f1987a2badee832ae7f3a695df0",
"score": "0.5988325",
"text": "def paypal\n if params[:token]\n if @subscription.complete_paypal(params[:token])\n flash[:notice] = 'Your billing information has been updated'\n redirect_to :action => \"billing\"\n else\n render :action => 'billing'\n end\n else\n redirect_to :action => \"billing\"\n end\n end",
"title": ""
},
{
"docid": "a9218f1987a2badee832ae7f3a695df0",
"score": "0.5988325",
"text": "def paypal\n if params[:token]\n if @subscription.complete_paypal(params[:token])\n flash[:notice] = 'Your billing information has been updated'\n redirect_to :action => \"billing\"\n else\n render :action => 'billing'\n end\n else\n redirect_to :action => \"billing\"\n end\n end",
"title": ""
},
{
"docid": "a9218f1987a2badee832ae7f3a695df0",
"score": "0.5988325",
"text": "def paypal\n if params[:token]\n if @subscription.complete_paypal(params[:token])\n flash[:notice] = 'Your billing information has been updated'\n redirect_to :action => \"billing\"\n else\n render :action => 'billing'\n end\n else\n redirect_to :action => \"billing\"\n end\n end",
"title": ""
},
{
"docid": "7e606c6f138a1520784ef54d49cdc56a",
"score": "0.59764314",
"text": "def paypal\n if params[:token]\n if @subscription.complete_paypal(params[:token])\n if admin_user_pending?\n redirect_to activate_path(@user.activation_code)\n else\n flash[:notice] = 'Your billing information has been updated'\n redirect_to :action => \"billing\"\n end\n else\n render :action => 'billing'\n end\n else\n redirect_to :action => \"billing\"\n end\n end",
"title": ""
},
{
"docid": "62e4ee7586420e0b09e419a0b2165c85",
"score": "0.5972978",
"text": "def paid(order)\n @order = order\n mail to: order.email, subject: 'Dog Grooming Services Order Paid'\nend",
"title": ""
},
{
"docid": "85522c41a3ae9b613b7431e3065ae9eb",
"score": "0.59721404",
"text": "def paid?\n \ttrue\n end",
"title": ""
},
{
"docid": "35f9557769287362408d3126404c2c64",
"score": "0.597118",
"text": "def pba_hb_deposit_payment(options ={})\n click \"deposit\" if options[:deposit]\n click \"hospitalPayment\"\n sleep 10\n click \"cashPaymentMode1\" if !(is_checked(\"//*[@id=\\\"cashPaymentMode1\\\"]\"))\n sleep 3\n type \"cashBillAmount\", options[:cash]\n type \"cashAmountInPhp\", options[:cash]\n click \"save\", :wait_for => :page\n is_element_present \"//input[@value='Go To Landing Page']\"\n end",
"title": ""
},
{
"docid": "9829f7a2b42b3ab0f85d9e4fb97c000d",
"score": "0.59670484",
"text": "def set_paid\n if @order.allow_admin_to_set_paid? && [nil, false].include?(@order.buyer_payout.try(:paid))\n # A buyer_payout should always exist for orders in EXPIRED, PAID_NO_STOCK but not for PAYMENT_PENDING.\n # When refund has been processed already , don't allow.\n # Payout record needs to be deleted otherwise the payout info and form will show on the order view.\n # Eventually the buyer_payout may be created again, ie they may request partial refund from vendor.\n @order.buyer_payout.destroy! if @order.buyer_payout\n @order.update!(status: Order::PAID, admin_set_paid: true)\n redirect_to admin_order_path(@order), notice: 'Order status has been changed to PAID'\n else\n redirect_to admin_order_path(@order), alert: 'This order can not be set to PAID'\n end\n end",
"title": ""
},
{
"docid": "738909b875e9211596836d7c32859975",
"score": "0.5960586",
"text": "def after_approve(approval); end",
"title": ""
},
{
"docid": "4a94ad819dd4afd8ddc61dbfb5425b23",
"score": "0.5959897",
"text": "def payment\n \n @cart = Cart.find(params[:id])\n @amount = @cart.total_price\n if(@amount>0)\n p 22222222222223333333333333333333333333\n p @sim_transaction = AuthorizeNet::SIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG[ 'api_transaction_key'], @amount, :hosted_payment_form => true) \n @sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(:link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', :link_url => payments_thank_you_url(:only_path => false)))\n \n \n else\n redirect_to store_url, :notice => \"Your cart is empty\"\n end\n end",
"title": ""
},
{
"docid": "9b58de888fe7090beb1e487a3825d4bc",
"score": "0.595975",
"text": "def pay\n if @order.pay\n @order.prepare #cheating for now\n render :show, status: :ok\n else\n render json: @order.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "e1dee05dc7c0219d933e78a6eab9c164",
"score": "0.59579515",
"text": "def invoice_paid\n @transaction = Transaction.find(params[:id])\n @transaction.update(paid: true)\n @transaction.save\n render json: @transaction\n end",
"title": ""
},
{
"docid": "4195864e5e9678642de7e651ef207035",
"score": "0.59552103",
"text": "def paid\n if shop_signed_in?\n @transaction = current_shop.transactions.find(params[:id])\n @transaction.update(date_paid: Time.now)\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "69d6e1eecf19a4710c2145603b387137",
"score": "0.5946108",
"text": "def toggle_paid\n\t@invoice = Invoice.find(params[:id])\n @invoice.paid = :paid\n\[email protected]!\n end",
"title": ""
},
{
"docid": "de61ef0e49bcc0e6f36bdbadc201e683",
"score": "0.5945558",
"text": "def success\n flash[:notice] = 'Thank you for your donation. Your payment has been successfully processed.'\n redirect_to appeals_path\n end",
"title": ""
},
{
"docid": "3245318fe3ea50efc87e534020844dd9",
"score": "0.59378433",
"text": "def post\n frm.button(:value=>\"Post\").click\n SyllabusEdit.new(@browser)\n end",
"title": ""
},
{
"docid": "3245318fe3ea50efc87e534020844dd9",
"score": "0.59378433",
"text": "def post\n frm.button(:value=>\"Post\").click\n SyllabusEdit.new(@browser)\n end",
"title": ""
},
{
"docid": "28c2b07ed04e9cb1668e69c7f501b8b7",
"score": "0.5935253",
"text": "def do_confirm\n Log.add_info(request, params.inspect)\n\n raise(RequestPostOnlyException) unless request.post?\n\n @research = Research.find(params[:research_id])\n @research.update_attribute(:status, Research::U_STATUS_COMMITTED)\n\n render(:action => 'show_receipt')\n\n rescue => evar\n Log.add_error(request, evar)\n render(:action => 'edit_page')\n end",
"title": ""
},
{
"docid": "568825b172bc2ca86b62ef39aab7ea05",
"score": "0.59349155",
"text": "def pay\n\t\tself.update paid_amount: self.amount, payed: true\n\tend",
"title": ""
},
{
"docid": "4ec9281fb321f6548783843076009eac",
"score": "0.5930938",
"text": "def handle_payment\n pay = @data.payment\n\n values = {\n 'payment_type' => @data.payment_type,\n 'match_url' => url(:get_payment_details),\n 'po' => @data.payment.pay_type == Payment::PO,\n }\n \n pay.add_to_hash(values)\n \n standard_page(\"Enter Payment Details\",\n values,\n GET_PAYMENT_DETAILS)\n end",
"title": ""
},
{
"docid": "139dd58e2cf29bf40bf751b0be9427d7",
"score": "0.592732",
"text": "def mark_paid\n @student_user = StudentUser.find(params[:id]) #finds correct student\n @student_user.pay_status = \"yes\"\n @student_user.save(validate: false) #validate: false prevents it from asking for a password upon update\n UserMailer.thanks_email(@student_user.email).deliver_now\n render 'admins/see_info'\n end",
"title": ""
},
{
"docid": "93e521faeb25c4a96c55dc18e982b711",
"score": "0.5918966",
"text": "def paypal_return\n\t\tflash[:notice] = \"Thanks for buying this!\"\n\t\tredirect_to root_path\n\t\t#return param format\n\t\t#success?tx=3NP32002NG491474D&st=Completed&amt=40.00&cc=GBP&cm=72&item_number=72\n\tend",
"title": ""
},
{
"docid": "076964a9c74ede14b6cb3365ce002f0e",
"score": "0.59058756",
"text": "def postback\n expire_page :controller => 'home', :action => 'index'\n \n # accountname - User's account name as defined in merchant's system (if previously sent to UPay) - johndoe408 - AN, 75\n # adminpwd - PlaySpan-provided admin password - Aci4sh5skhGsklj283 - AN, 20\n # appid - Merchant-defined application ID. Same as above - betagame - AN, 128\n # commtype - PAYMENT, ADMIN_REVERSAL, FORCED_REVERSAL - PAYMENT - A, 20\n # currency - ISO 3-letter currency code. Default is \"USD\" for US Dollars. See ISO 4217 - USD - A, 3\n # detail - Additional details associated with the commtype - SUBSCRIPTION - A, 20\n # dtdatetime - Datetime in YYYYMMDDHHMMSS format, EST timezone - 20100813214224 - N, 14\n # gwtid - Internal use only \n # hash (back-end) - An MD5 hash based on the variables included in our POST to you. See back-end hash for the hash construction. - 5f9ae151091b057a100adcc4d9a5e1a2 - AN, 32\n # livemode - Indicates whether a transaction was in live mode (\"T\") or test (\"F\") - T \n # login - Internal use only - NAE0M6tkNx - AN, 20\n # merchtrans - Merchant-defined unique transaction or order ID. Same as above. - US-131827-20101019232716 \n # - We pass in order-12345 or credit-12345666443 where the first part describes the object being puchased, either\n # an iou or virtual currency. the second param is the order id or the credit token\n # mirror - Custom data that you would like to be mirrored back with all notifications. This value must be URL-encoded to eliminate characters disallowed in URL strings. Passed in on original transaction. - orderbegintime=1286602659&itemid=239427 \n # paymentid - 2-letter payment method ID. - CH - Same as above\n # pbctrans - PlaySpan's unique transaction ID - {32d5d327-270b-4e3b-89b9-03b53130c4b1} - AN, 38\n # rescode - Internal use only \n # sepamount - Amount collected from the user (default currency is US dollar). - 6.99 - Same as above.\n # set_amount - Amount to be settled to merchant (payment to us!). Will be negative if reflecting a reversal or refund. - 7.15 - N, 11\n # sn - 4-letter UltimatePay service name that is assigned by PlaySpan. Same as above - ACME \n # userid - Merchant-defined unique user ID. Same as above - 131827 - AN, 50 \n \n # For all credit events I want to track them and save them locally\n #curl -d \"pegged_currency_amount_iso_currency_code=USD&premium_currency_amount=50000×tamp=1278000045&simulated=true&socialgold_transaction_id=5da8a17ac88d917890fc5070e6e700a3&signature=9dbb5d82ccf1f96eb0c07558bb71d47f&amount=50000&pegged_currency_amount=611&socialgold_transaction_status=SUCCESS&net_payout_amount=549&cc_token=t7evqmnzjyvos4y3776diqm8sltc4jf&billing_country_code=US&pegged_currency_label=USD&version=1&user_id=6&offer_amount=500&premium_currency_label=Buddy%20Beers%20Bucks&billing_zip=98121&offer_amount_iso_currency_code=EUR&event_type=BOUGHT_CURRENCY&external_ref_id=&offer_id=nvdo9h70w2i5eum8a9ra4og2b&user_balance=100180\" \"http://localhost:3000/credits/postback\"\n\n # Validate the post:\n # \n # MD5 Hash Digest (back-end):\n # \n # We return a hash of our own when communicating with you. The order of the concatenated strings (including optional parameters), \n # is dtdatetime, login, adminpwd, merchant authentication phrase (aka secret), userid, commtype, set_amount, amount, sepamount, \n # currency, sn, mirror, pbctrans, developerid, appid, virtualamount, virtualcurrency.\n #\n # How to Respond to the Postback:\n # \n # When UltimatePay makes the POST request to your Postback URL, it expects the HTTP response \"Content-type\" to be \"text/plain\" \n # and the entire response on one line. Each response text string has four components separated by a \"pipe\" character (\"|\"). \n # There shall never be a pipe embedded in any of the response comments.\n # \n # Result Code Must be \"[OK]\" or \"[ERROR]\". Any response that isn't prefixed with ?\"[OK]\" will be interpreted as an error.\n # [OK] indicates that the POSTBACK was accepted\n # [ERROR] indicates the POSTBACK could not be processed and must be resubmitted, potentially with corrections, at a later time. \n # A lack of response shall be interpreted as an [ERROR]\n # Date/time - Your system's local date and time when the POSTBACK was received\n # PBCTrans - PlaySpan's unique transaction ID\n # Reason Code - ?URL-encoded string indicating the reason(s) for the ERROR result code, if applicable. A tilde (\"~\") may be \n # used to delimit multiple reasons. If the Result Code is [OK], then the Reason code should be passed as ?\"[N/A]\". \n #\n # Response to a valid transaction\n # \n # Format\n # [OK]|YYYYMMDDHHMMSS|pbctrans|[N/A]\n # \n # Example\n # [OK]|20100813204227|{32d5d327-270b-4e3b-89b9-03b53130c4b1}|[N/A]\n # Response to an invalid transaction\n # \n # Format\n # [ERROR]|YYYYMMDDHHMMSS|pbctrans|Reason_for_error_with_no_spaces\n # \n # Example\n # [ERROR]|20100818104134|{5546a9a3-cb87-4552-bbda-d5e6d3417b98}|Blacklisted_user\n #\n # Warning:\n # In the event we post a communication to you and do not receive an [OK] response back, our systems will retry the communication \n # using the pbctrans value originally used. This ensures that you have the information you need to discard duplicates! If you have \n # already received that transaction, you should simply return an [OK] and then discard the transaction. Your system should NOT return \n # [ERROR] as this would trigger our system to retry yet again.\n \n # create the hash that UltimatePay is expecting\n hash_string = [params[:dtdatetime], params[:login], account_password, account_secret, \n params[:userid], params[:commtype], params[:set_amount], params[:amount], params[:sepamount], \n params[:currency], params[:sn], params[:mirror], params[:pbctrans], params[:developerid], \n params[:appid], params[:virtualamount], params[:virtualcurrency]].join()\n \n @hash = Digest::MD5.hexdigest(hash_string)\n \n # Find Credit Event by previously posted pbctransaction\n if @credit_event = CreditEvent.find_by_pbctrans(params[:pbctrans])\n \n # store the passed in attributes\n store_credit_event_attributes\n \n # if the payment was successful and the hashes match, update user's credits and update the credit event with the appropriate message\n if hash_matches?\n if update_users_credits\n @credit_event.update_attribute(:status_message, \"[OK]\")\n else\n @credit_event.update_attribute(:status_message, \"[ERROR] Error updating users credits\")\n Notifier.credit_event_error(@credit_event, params, \"Very Important! The user has likely paid for their credits but not received them. The credit event was found from a previous transaction (or error) but there was an error updating the user's credits\", 2).deliver\n end\n else\n @credit_event.update_attribute(:status_message, \"[ERROR] Hash does not match\")\n Notifier.credit_event_error(@credit_event, params, \"Very Important! The user has likely paid for their credits but not received them. The credit event was found from a previous transaction (or error) but there was an error matching the hash. The generated hash was: #{@hash}\", 2).deliver\n end\n \n # We have to return an OK response here otherwise Ultimatepay will continuously postback this information\n ultimate_pay_response(\"[OK]\")\n \n # if the transaction is for virtual currency: \n elsif params[:merchtrans].split(\"-\")[0] == \"credit\"\n \n # find the credit event from the token and the user id. if there is none, create it\n @credit_event = CreditEvent.find_or_create_by_token_and_user_id(:token => params[:merchtrans].split(\"-\")[1], :user_id => params[:userid])\n \n # if it was found and there is a user\n if @credit_event.user.present?\n \n # store the passed in attributes\n store_credit_event_attributes\n \n # if the payment was successful and the hashes match update user's credits and return appropriate response\n if hash_matches?\n if update_users_credits\n @credit_event.update_attribute(:status_message, \"[OK]\")\n ultimate_pay_response(\"[OK]\")\n else\n @credit_event.update_attribute(:status_message, \"[ERROR] Error updating users credits\")\n ultimate_pay_response(\"[ERROR]\", \"Error updating users credits\")\n Notifier.credit_event_error(@credit_event, params, \"The credit event was found but there was an error updating the user's credits\", 1).deliver\n end\n else\n @credit_event.update_attribute(:status_message, \"[ERROR] Hash does not match\")\n ultimate_pay_response(\"[ERROR]\", \"Hash does not match\")\n Notifier.credit_event_error(@credit_event, params, \"The credit event was found but there was an error matching the hash. The generated hash was: #{@hash}\", 1).deliver\n end\n else\n @credit_event.update_attributes(:provider => \"UltimatePay\", :status_message => \"[ERROR] User not present or doesn't exist\")\n store_credit_event_attributes\n ultimate_pay_response(\"[ERROR]\", \"User not present or doesn't exist\")\n Notifier.credit_event_error(@credit_event, params, \" User not present or doesn't exist. The token was: #{params[:merchtrans].split(\"-\")[1]} The user id was: #{params[:userid]}\", 1).deliver\n end\n else\n @credit_event = CreditEvent.create(:provider => \"UltimatePay\", :status_message => \"[ERROR] Could not find credit event or unknown transaction type\")\n # store the passed in attributes\n store_credit_event_attributes\n ultimate_pay_response(\"[ERROR]\", \"Could not find credit event or unknown transaction type\")\n Notifier.credit_event_error(@credit_event, params, \"The credit event was not found from a previous transaction or the merchtrans param didn't contain the word credit. The merchtrans was: #{params[:merchtrans]}\", 1).deliver\n end\n end",
"title": ""
},
{
"docid": "6cf4ce4fc028d4f29a6271799f710fe5",
"score": "0.59049916",
"text": "def claim_submit\n authorize! :manage, :processing\n reset_session\n @title = \"Submission Results\"\n #check for edi vendor\n @edivendor = EdiVendor.primary.first\n respond_to do |format|\n if params[:commit] == \"View Claims\" && params[:checked]\n @title = \"View Submission Results\"\n # print the claims selected\n @hcfa = HcfaForm.new(params[:checked])\n @hcfa.build\n format.pdf { send_data @hcfa.render, :filename => \"hcfa.pdf\", :type => \"application/pdf\" }\n format.html { send_data @hcfa.render, :filename => \"hcfa.pdf\", :type => \"application/pdf\" }\n elsif (params[:commit] == \"Print Claims\" || params[:commit] == \"Download PDF\") && params[:checked]\n @title = \"Print Submission Results\"\n # print the claims selected, send false to not use the form\n @hcfa = HcfaForm.new(params[:checked], false)\n @hcfa.build\n format.pdf { send_data @hcfa.render, :filename => \"hcfa.pdf\", :type => \"application/pdf\" }\n format.html { send_data @hcfa.render, :filename => \"hcfa.pdf\", :type => \"application/pdf\" }\n #update insurance_billing\n params[:checked].each { |c| InsuranceBilling.update(c, {:status => BillingFlow::PRINTED, :claim_submitted => DateTime.now, :updated_user => current_user.login_name}) }\n end\n end\n end",
"title": ""
},
{
"docid": "82058aab4196cba541826318a7c31861",
"score": "0.5900091",
"text": "def pay\n @pledge = Pledge.find(params[:pledge_id])\n @pledge[:payment_status] = \"success\"\n if @pledge.save\n backer_id = @pledge.backer.id\n @backed_project_ids = Project.joins(:pledges).where(pledges: { backer_id: backer_id}).pluck(:id)\n @backed_reward_ids = Reward.joins(:pledges).where(pledges: { backer_id: backer_id}).pluck(:id)\n render :update\n else\n render json: [@pledge.errors.full_messages], status: 401\n end\n end",
"title": ""
},
{
"docid": "ff7e31a9f218658f812f9ea0011a4825",
"score": "0.58975655",
"text": "def paypal_return\n flash[:notice] = \"Thanks for buying this!\"\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "fb1491ff3ca50832d2f5a0f0cd3384a5",
"score": "0.58972925",
"text": "def paid(email, name)\n @name = name\n \tbegin\n mail(:to => email, :subject => \"Pay4Me request approved\") do |format|\n format.text\n format.html\n end\n rescue => e\n logger.info(e)\n end\n\n end",
"title": ""
},
{
"docid": "d53f497ed87df170dd4f48d9c9e49b7b",
"score": "0.58963597",
"text": "def post_approval_request(post)\n @post = post\n #+ logger.info(\"@@@@@Post ID: #{@post.id}\")\n mail to: \"[email protected]\", subject:\"Post #{@post.id} was created and seeks your approval\"\n end",
"title": ""
},
{
"docid": "45cc3ca4cb39499f76c1da4e83820ccd",
"score": "0.5893132",
"text": "def payaccounts\n @meta_title = I18n.t 'meta_title.m_payment_accounts'\n @user = User.find(session[:user_id])\n @event = Event.find_all_events(session[:user_id])\n \n if request.post?\n respond_to do |format|\n if params[:type] == 'event'\n User.update_all([\"event_pay_account = ? \", params[:event_pay_account]], [\"id = ?\", @user[:id]])\n end \n \n if params[:type] == 'ref'\n User.update_all([\" ref_pay_account = ? \", params[:ref_pay_account]], [\"id = ?\", @user[:id]])\n end \n \n flash[:notice1] = I18n.t 'manage_account_controller.your_paypal_email_update_successfully' \n format.html { redirect_to(:action=>'payaccounts' ) }\n \n format.xml { render :xml => @user, :status => :created, :location => @user }\n end\n end \n end",
"title": ""
},
{
"docid": "c62d57e23ee08eae83e971fee532fdef",
"score": "0.5892879",
"text": "def post_account(req)\n notify_by_email(req) if email_changed?\n dealership = dealer_dao.save(dealership(req).set(posted))\n update_stripe(dealership) if stripe_changed?(dealership)\n #update_stripe(dealership) if email_changed? || name_changed?\n redirect \"/admin/#{dealership.slug}/account\"\n end",
"title": ""
},
{
"docid": "5f7fd4e3b18f127b6994d50d46b385d7",
"score": "0.58914495",
"text": "def successful_purchase_response\n end",
"title": ""
},
{
"docid": "525b82affba4fc89c65c0c0bec9504a4",
"score": "0.58909476",
"text": "def donate\n # f_and_e = nav.a(class: 'g-nav-primary__button--book')\n # f_and_e.click!\n # # binding.pry\n donatebutton = nav.a(class: 'g-nav-primary__button--donate')\n donatebutton.click!\n end",
"title": ""
},
{
"docid": "655f213c8ad495ec5ba7eebb8b7b42c9",
"score": "0.5884538",
"text": "def rbk_success\n instrument('on_success.rbk_payment', params: params)\n\n flash[:success] = I18n.t('dashboard.billing.invoices.controller.success_payment')\n redirect_to dashboard_billing_invoices_url\n end",
"title": ""
}
] |
607ef8ed4cf5882daf6b2153dbd9a7b4
|
GET /provider_accounts/new GET /provider_accounts/new.xml
|
[
{
"docid": "0074099226371c6e07518d67b1ef11c6",
"score": "0.74458814",
"text": "def new\n\t\t@provider_account = ProviderAccount.new\n\t\t@users = User.find(:all, :order => :login)\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @provider_account }\n\t\tend\n\tend",
"title": ""
}
] |
[
{
"docid": "41d3b707bd7f2e7af0fc1188e7bbdef5",
"score": "0.7334351",
"text": "def new\n @account = Account.new_named\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4f0bef714f3b886835f6e4735f86612b",
"score": "0.7330635",
"text": "def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider }\n end\n end",
"title": ""
},
{
"docid": "4f0bef714f3b886835f6e4735f86612b",
"score": "0.7330635",
"text": "def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider }\n end\n end",
"title": ""
},
{
"docid": "d47f4495e6187b6074cd6b2ec9da0e1b",
"score": "0.7320653",
"text": "def new\n @account = current_user.accounts.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n format.xml { render xml: @account }\n end\n end",
"title": ""
},
{
"docid": "1c9bac787f18e3c47a546b891a1a2753",
"score": "0.73075867",
"text": "def new\n @provider = Provider.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider }\n end\n end",
"title": ""
},
{
"docid": "4b404ddd508e92a0faed8e3efc510776",
"score": "0.7228605",
"text": "def new\n @account = Account.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4d3502291b584f7f3bf49a33fb818d57",
"score": "0.7207843",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4d3502291b584f7f3bf49a33fb818d57",
"score": "0.7207843",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4d3502291b584f7f3bf49a33fb818d57",
"score": "0.7207843",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4d3502291b584f7f3bf49a33fb818d57",
"score": "0.7207843",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4d3502291b584f7f3bf49a33fb818d57",
"score": "0.7207843",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4d3502291b584f7f3bf49a33fb818d57",
"score": "0.7207843",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4d3502291b584f7f3bf49a33fb818d57",
"score": "0.7207843",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4d3502291b584f7f3bf49a33fb818d57",
"score": "0.7207843",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "4d3502291b584f7f3bf49a33fb818d57",
"score": "0.7207843",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "624c2d6bf5d633870953d38764967824",
"score": "0.7204447",
"text": "def new\n @provider = Provider.new\n respond_to do |format|\n format.json { render json: @provider }\n format.xml { render xml: @provider }\n end\n end",
"title": ""
},
{
"docid": "5516ec4dc92876e558c43830b19aaf72",
"score": "0.71217775",
"text": "def new\n @user_accounts = UserAccounts.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_accounts }\n end\n end",
"title": ""
},
{
"docid": "8c5bd1084799928081c0fe965d6412c0",
"score": "0.70992184",
"text": "def new\n @assert_account = AssertAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assert_account }\n end\n end",
"title": ""
},
{
"docid": "12379ab1da7e61bfb7338ab3cc6e7827",
"score": "0.70147866",
"text": "def new\n @useraccount = Useraccount.new(:person_id => params[:person_id])\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @useraccount }\n end\n end",
"title": ""
},
{
"docid": "8ebbfa993d259e180af02043562deffa",
"score": "0.6977423",
"text": "def new\n @spaccount = Spaccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @spaccount }\n end\n end",
"title": ""
},
{
"docid": "4b77adf956206e8b737dd4d5e68cffe7",
"score": "0.6968624",
"text": "def new\n @account = current_user.build_account\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "3e41d42ae1d50e4eb2fd7962626fe500",
"score": "0.69510037",
"text": "def new\n @account_type = AccountType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account_type }\n end\n end",
"title": ""
},
{
"docid": "3e41d42ae1d50e4eb2fd7962626fe500",
"score": "0.69510037",
"text": "def new\n @account_type = AccountType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account_type }\n end\n end",
"title": ""
},
{
"docid": "4c3a8bcbf2647f91c81494beaf82227c",
"score": "0.69447327",
"text": "def new\n @account_class = AccountClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account_class }\n end\n end",
"title": ""
},
{
"docid": "6ff0291b61d33c0fd7463b034e828077",
"score": "0.6905505",
"text": "def new\n @account = Salesforce::Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "2ee3dbe9232fd180454ba629a14c41c3",
"score": "0.68825996",
"text": "def new\n @custaccount = Custaccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @custaccount }\n end\n end",
"title": ""
},
{
"docid": "2ec7d70b08314e491805db5bb6455504",
"score": "0.6867408",
"text": "def new\n @user = @account.users.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "827f512176be9caf43f4f9a085443da0",
"score": "0.68475336",
"text": "def new\n @grant = Grant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @grant }\n end\n end",
"title": ""
},
{
"docid": "33cf50b9c0343b78068819bd99a4db7e",
"score": "0.6819148",
"text": "def new\n @account = current_person.accounts.new\n @screen_name = current_person.default_screen_name\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "c09295860f2dbb086c91eef906d6ea59",
"score": "0.68141973",
"text": "def create\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n flash[:notice] = 'Provider was successfully created.'\n format.html { redirect_to(@provider) }\n format.xml { render :xml => @provider, :status => :created, :location => @provider }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @provider.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ea84ab27747001eb23511a605358a8c",
"score": "0.6803014",
"text": "def new\n @bank_account = BankAccount.new :owner => current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bank_account }\n end\n end",
"title": ""
},
{
"docid": "873e7cee567cbfcc2f41f62ee773ece9",
"score": "0.67960256",
"text": "def create\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to(@provider, :notice => 'Provider was successfully created.') }\n format.xml { render :xml => @provider, :status => :created, :location => @provider }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @provider.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3a866a9448cf1eb8c6ffe317afdb91e",
"score": "0.6763621",
"text": "def new\n @twitter_account = TwitterAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @twitter_account }\n end\n end",
"title": ""
},
{
"docid": "196cba6a1cc29bf55a0d234995ab8ec1",
"score": "0.67537177",
"text": "def new\n @paypal_account = PaypalAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @paypal_account }\n end\n end",
"title": ""
},
{
"docid": "24088e0e01114bfb4466fdc2f8e5d20f",
"score": "0.6741983",
"text": "def new\n @ledger_account = LedgerAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ledger_account }\n end\n end",
"title": ""
},
{
"docid": "2aea33c042baec2ac01ed0205780bdd7",
"score": "0.67412275",
"text": "def new\n @account_user = AccountUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account_user }\n end\n end",
"title": ""
},
{
"docid": "bb56dc2f29642b77aefb2f2a23601e7f",
"score": "0.67369807",
"text": "def new\n @bank_account = BankAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bank_account }\n end\n end",
"title": ""
},
{
"docid": "bb56dc2f29642b77aefb2f2a23601e7f",
"score": "0.67369807",
"text": "def new\n @bank_account = BankAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bank_account }\n end\n end",
"title": ""
},
{
"docid": "aae326235a2f5db0847c38277b9675b1",
"score": "0.6731425",
"text": "def new\n @account = Account.new\n\t\t@parents = @current_user.accounts\n\n respond_to do |format|\n format.html { render :action => 'edit' }\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "21b5f82b3124155efc4161e055d6de69",
"score": "0.6726407",
"text": "def new\n @accountaction = Accountaction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @accountaction }\n end\n\n end",
"title": ""
},
{
"docid": "b9a31e5b15a4b4ca7bf02e7cdfce4568",
"score": "0.6724668",
"text": "def new\n @linked_account = Admin::LinkedAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @linked_account }\n end\n end",
"title": ""
},
{
"docid": "7f36ca117d8960111dc0b5ceaf444813",
"score": "0.6712795",
"text": "def new\n @title = t('view.providers.new_title')\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end",
"title": ""
},
{
"docid": "203b3292b6af36d9544d02214a527066",
"score": "0.6704154",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @activity_account }\n end\n end",
"title": ""
},
{
"docid": "7d1e653b605713e5d185088e81f0a3d5",
"score": "0.6702943",
"text": "def new\n @accountbook = Accountbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @accountbook }\n end\n end",
"title": ""
},
{
"docid": "4efdcc412e63f51f2520e54d3de8c98e",
"score": "0.66859007",
"text": "def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end",
"title": ""
},
{
"docid": "5900558602902b0d56670301e2c4628d",
"score": "0.6681349",
"text": "def new\n @credito = Credito.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @credito }\n end\n end",
"title": ""
},
{
"docid": "152ecaeb904093e96f88a8e9364e6c20",
"score": "0.6680652",
"text": "def new\n @provider = Provider.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end",
"title": ""
},
{
"docid": "e6f1d35b48411f977cf01cb12186f6fe",
"score": "0.6674113",
"text": "def new\n @account = Account.new\n respond_to do |format|\n format.html\n format.xml {head :unsupported_media_type}\n end\n end",
"title": ""
},
{
"docid": "d39e93ac837261207db21838c4c4f50c",
"score": "0.66155726",
"text": "def create\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n flash[:notice] = 'Fornecedor criado.'\n format.html { redirect_to(@provider) }\n format.xml { render :xml => @provider, :status => :created, :location => @provider }\n else\n default_data\n format.html { render :action => \"new\" }\n format.xml { render :xml => @provider.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c185bcfea3250ec501b01636ad88553d",
"score": "0.6606823",
"text": "def new\n @kth_account = KthAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @kth_account }\n end\n end",
"title": ""
},
{
"docid": "ce067c559761d78c10e0ee5586277376",
"score": "0.6580114",
"text": "def new\n @account_plan = AccountPlan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account_plan }\n end\n end",
"title": ""
},
{
"docid": "faa827c79755e6b93f730ba86ef71655",
"score": "0.65708333",
"text": "def new\n authorize! :manage_account, current_account\n @location = current_account.locations.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end",
"title": ""
},
{
"docid": "1fb3cf460cca154ca8a93c59f3ead565",
"score": "0.6558675",
"text": "def new\n @property_account = PropertyAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @property_account }\n end\n end",
"title": ""
},
{
"docid": "5817831ba6a0f732a8b97d9a6e957252",
"score": "0.6540035",
"text": "def create\n if params[:cancel_button] \n redirect_back_or_default(provider_accounts_path)\n else\n\t\t@provider_account = ProviderAccount.new(params[:provider_account])\n\t\t@provider_account.users = [ current_user ]\n\n\t\trespond_to do |format|\n\t\t\tif @provider_account.save\n\t\t\t\to = @provider_account\n\t\t\t\tAuditLog.create(\n\t\t\t\t\t:provider_account_name => o.name,\n\t\t\t\t\t:provider_account_id => o.id,\n\t\t\t\t\t:cluster_name => nil,\n\t\t\t\t\t:cluster_id => nil,\n\t\t\t\t\t:auditable_id => o.id,\n\t\t\t\t\t:auditable_type => o.class.to_s,\n\t\t\t\t\t:auditable_name => o.name,\n\t\t\t\t\t:author_login => current_user.login,\n\t\t\t\t\t:author_id => current_user.id,\n\t\t\t\t\t:summary => \"created '#{o.name}'\",\n\t\t\t\t\t:changes => o.tracked_changes,\n\t\t\t\t\t:force => true\n\t\t\t\t)\n\t\t\t\tflash[:notice] = 'Account was successfully created, it can take up to 2 minutes for the initial refresh.'\n\t\t\t\tformat.html { redirect_to @provider_account }\n\t\t\t\tformat.xml { render :xml => @provider_account, :status => :created, :location => @provider_account }\n\t\t\telse\n\t\t\t\tflash[:error] = 'Failed to Create an Account'\n\t\t\t\tformat.html { render :action => \"new\" }\n\t\t\t\tformat.xml { render :xml => @provider_account.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n end\n\tend",
"title": ""
},
{
"docid": "0654d3df098fb3444bfe6ef123b79d88",
"score": "0.6499619",
"text": "def new\n @mail_account = MailAccount.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mail_account }\n end\n end",
"title": ""
},
{
"docid": "694a2f845637165c7b9f0a59a934a1c4",
"score": "0.64918983",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end",
"title": ""
},
{
"docid": "694a2f845637165c7b9f0a59a934a1c4",
"score": "0.64918983",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end",
"title": ""
},
{
"docid": "694a2f845637165c7b9f0a59a934a1c4",
"score": "0.64918983",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end",
"title": ""
},
{
"docid": "694a2f845637165c7b9f0a59a934a1c4",
"score": "0.64918983",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end",
"title": ""
},
{
"docid": "694a2f845637165c7b9f0a59a934a1c4",
"score": "0.64918983",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end",
"title": ""
},
{
"docid": "694a2f845637165c7b9f0a59a934a1c4",
"score": "0.64918983",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end",
"title": ""
},
{
"docid": "694a2f845637165c7b9f0a59a934a1c4",
"score": "0.64918983",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end",
"title": ""
},
{
"docid": "2acc6e3a3d1c91b635bab94a539c810b",
"score": "0.6477936",
"text": "def new\n @access_token = ServiceProvider.find(params[:service_provider_id]).access_tokens.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @access_token }\n end\n end",
"title": ""
},
{
"docid": "42ca68ecb0def207ad21191c075a8d3a",
"score": "0.6466841",
"text": "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @account }\n end\n end",
"title": ""
},
{
"docid": "f6ba29adbb8a568debebf8537b80dace",
"score": "0.64641756",
"text": "def new\n @payhead = Payhead.new\n @accounts = TransactionType.fetch_to_accounts(@company.id, 'earningacc')\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @payhead }\n end\n end",
"title": ""
},
{
"docid": "0523f62c018d5795c5b97462e153c0f8",
"score": "0.6455079",
"text": "def provider_new\n @page_title = _('New_provider')\n @page_icon = \"add.png\"\n @provider, @tariffs, @servers = Provider.provider_new(session)\n\n if not @tariffs\n flash[:notice] = _('No_tariffs_available')\n redirect_to :action => 'list'\n end\n end",
"title": ""
},
{
"docid": "d9e1688b036106af71ab2f6735602e82",
"score": "0.6450083",
"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": "40720aa605f0d28a0f36423b737f948d",
"score": "0.64487475",
"text": "def new\n @provider_location = ProviderLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider_location }\n end\n end",
"title": ""
},
{
"docid": "0f92096b61583a57a22b8dd0b5c3e87d",
"score": "0.64430326",
"text": "def new\n @account = @scope.build(:cents => 0)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "b9eccc5463d791973030b670cc63e897",
"score": "0.644134",
"text": "def new\n @post_action = {:controller => 'accounts', :action => 'create' }\n @available_groups = Group.accessible_by(current_ability, :manage)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "783d7eb6083e7a45a05d15d0a94196ff",
"score": "0.64234746",
"text": "def new\n @consumer = Consumer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @consumer }\n end\n end",
"title": ""
},
{
"docid": "89ab0438416de68e880753ee32d03582",
"score": "0.6422848",
"text": "def new\n @domain = @account.domains.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @domain }\n end\n end",
"title": ""
},
{
"docid": "cbde76124fcf44c73774c351979f0625",
"score": "0.64107025",
"text": "def new\n @data_provider = DataProvider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @data_provider }\n end\n end",
"title": ""
},
{
"docid": "d5188cb0ca028566a35b06262f610bc4",
"score": "0.6406598",
"text": "def new\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bank }\n end\n end",
"title": ""
},
{
"docid": "d5188cb0ca028566a35b06262f610bc4",
"score": "0.6406598",
"text": "def new\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bank }\n end\n end",
"title": ""
},
{
"docid": "d5188cb0ca028566a35b06262f610bc4",
"score": "0.6406598",
"text": "def new\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bank }\n end\n end",
"title": ""
},
{
"docid": "c0b04c2caa079aca6a688862e248e7b2",
"score": "0.6371635",
"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": ""
},
{
"docid": "5040680e58906381804886690cc24164",
"score": "0.63671905",
"text": "def new\n @bank_info = BankInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bank_info }\n end\n end",
"title": ""
},
{
"docid": "4d17dbb07f548608c183cb9e9576b08f",
"score": "0.63615024",
"text": "def new\n @owner = Owner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @owner }\n end\n end",
"title": ""
},
{
"docid": "4d17dbb07f548608c183cb9e9576b08f",
"score": "0.63615024",
"text": "def new\n @owner = Owner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @owner }\n end\n end",
"title": ""
},
{
"docid": "4d17dbb07f548608c183cb9e9576b08f",
"score": "0.63615024",
"text": "def new\n @owner = Owner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @owner }\n end\n end",
"title": ""
},
{
"docid": "3d7ed2dfd8f0a45f14a7d941ccdd8661",
"score": "0.63537127",
"text": "def new\n @provider_speciality = ProviderSpeciality.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider_speciality }\n end\n end",
"title": ""
},
{
"docid": "7aa77dbd1ef3c95af9672946a3853ea2",
"score": "0.6345505",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @signup }\n end\n end",
"title": ""
},
{
"docid": "acc659a7931998731a31671ef39a055f",
"score": "0.6340664",
"text": "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @company }\n end\n end",
"title": ""
},
{
"docid": "c8356a245e64124de76a8d1ba7ec30b6",
"score": "0.6339567",
"text": "def new\n @account = Account.new(:bank_id => @bank.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @account }\n end\n end",
"title": ""
},
{
"docid": "57de685c00d98745c1b405f1058fa85a",
"score": "0.6327223",
"text": "def new\n @account = Account.new\n @all_institutions = Institution.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "c5eb3d502cbaf8cdf2689190837f2c66",
"score": "0.6326177",
"text": "def new\n @org = Org.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @org }\n end\n end",
"title": ""
},
{
"docid": "8549d6faecbe17da21b31ed6b8a6f012",
"score": "0.63259757",
"text": "def new\n @annonce = Annonce.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @annonce }\n end\n end",
"title": ""
},
{
"docid": "4636566767fa3797208f37a20858c4b8",
"score": "0.63215405",
"text": "def new\n @make_payment = MakePayment.new\n @from_accounts = TransactionType.fetch_from_accounts(@company.id,'payments')\n @to_accounts = TransactionType.fetch_to_accounts(@company.id, 'payments')\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @make_payment }\n end\n end",
"title": ""
},
{
"docid": "6ea1eed1ad061793306122964d805c9c",
"score": "0.63171566",
"text": "def new\n @pcr = Pcr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pcr }\n end\n end",
"title": ""
},
{
"docid": "11bb6be187ec57e7dfe2c2e56c146eae",
"score": "0.63147646",
"text": "def new\n @identity = Identity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @identity }\n end\n end",
"title": ""
},
{
"docid": "2615b0fa01e524018f5a04b022616154",
"score": "0.6307136",
"text": "def new\n @pcr = Pcr.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pcr }\n end\n end",
"title": ""
},
{
"docid": "803bbd910f58bb8d8f2e06f7b5cdd75d",
"score": "0.63046354",
"text": "def new\r\n @transaction = Transaction.new\r\n @transaction.from = @account\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @transaction }\r\n end\r\n end",
"title": ""
},
{
"docid": "ac1e68a59c7b77ab8438ebb6456b1b84",
"score": "0.6303728",
"text": "def new\n @account_adjustment = AccountAdjustment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account_adjustment }\n end\n end",
"title": ""
},
{
"docid": "d4ddf2e580db0f0b66d554e7e1ff4400",
"score": "0.6303165",
"text": "def new\n @caller = Caller.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @caller }\n end\n end",
"title": ""
},
{
"docid": "42f1f8c80a4ad2ebcf2e215595ada654",
"score": "0.6299772",
"text": "def create\n @title = t('view.providers.new_title')\n @provider = Provider.new(params[:provider])\n\n respond_to do |format|\n if @provider.save\n format.html { redirect_to @provider, notice: t('view.providers.correctly_created') }\n format.json { render json: @provider, status: :created, location: @provider }\n else\n format.html { render action: 'new' }\n format.json { render json: @provider.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "73bd1ada1f8dc0be7b9a2221618cdc12",
"score": "0.6296455",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fund_grant }\n end\n end",
"title": ""
},
{
"docid": "6c4f96cb836db954e414e61b76548a31",
"score": "0.62963295",
"text": "def new\n @account = Account.new\n @account.active = true\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"title": ""
},
{
"docid": "f6a2eba9d586fe30e5480dbdeecc22d6",
"score": "0.62945545",
"text": "def new\n @balance = Balance.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @balance }\n end\n end",
"title": ""
},
{
"docid": "c2676493e0fbfda9539098812debb8f7",
"score": "0.6293978",
"text": "def new\n @profile = Emailaccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @profile }\n end\n end",
"title": ""
}
] |
7d761213983a530ebd0bed790a487898
|
UNIT TESTS FOR METHOD get_hash()
|
[
{
"docid": "ce63b2018ca0aabfd2748cb9850b6cbe",
"score": "0.7576859",
"text": "def test_get_hash_test_string\r\n\t\tassert_equal @bc.get_hash('test'), 'f3f2' \r\n\tend",
"title": ""
}
] |
[
{
"docid": "d5db449918e4bf88c6ce33a68de5903c",
"score": "0.772417",
"text": "def get_hash(*params); raise('Stub or mock required.') end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.76852226",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.76852226",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "727b40f9aeaf16679278f4e7e7c6a588",
"score": "0.768445",
"text": "def hash()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "62907e11027cfbb42be2452e9691a16c",
"score": "0.7655411",
"text": "def test_hash_valid\n sim = VerifierSimulator.new\n assert_equal 'f896', sim.hash('bill')\n end",
"title": ""
},
{
"docid": "317395f85717d6f934f097445224117e",
"score": "0.76097",
"text": "def test_compute_hash_correct\n ver = Verifier.new\n assert_equal(ver.compute_hash($block_number,$reference_previous_hash,$transactions,$epoch_time),$new_hash)\n\n end",
"title": ""
},
{
"docid": "b78a8c3fbbda0dc6b3ed59f810316f24",
"score": "0.76021236",
"text": "def hash(*) end",
"title": ""
},
{
"docid": "4213c29fa9b24034a042b988ad5616b1",
"score": "0.7496628",
"text": "def test_compute_hash_incorrect\n ver = Verifier.new\n\n refute_equal(ver.compute_hash($block_number,$reference_previous_hash,$transactions,$epoch_time),\"23d2\")\n end",
"title": ""
},
{
"docid": "de2864b8e560565e46fc5fda17e4864e",
"score": "0.748562",
"text": "def test_hashed_value\n object1 = 'Jon Snow'\n sha_hash = Digest::SHA256.hexdigest Serializer.serialize(object1)\n h1 = @hasher_class.generate(object: object1, serializer: @s)\n assert_equal sha_hash, h1\n end",
"title": ""
},
{
"docid": "20277807e44403042f92161b4d06e5cf",
"score": "0.74784905",
"text": "def test_hash_bill\n assert_equal('f896', @checker.calculate_hash('bill'.unpack('U*')))\n end",
"title": ""
},
{
"docid": "d6bc0e2d941f5ee4f48f28673e00cc63",
"score": "0.7469004",
"text": "def test_hash\n (Digest::SHA256.new << str_to_hash).to_s\n end",
"title": ""
},
{
"docid": "0dbe2a68299399de67be9d62005975d7",
"score": "0.7406005",
"text": "def hash;0;end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "ef200ff818c310e9a179653879c9f2f1",
"score": "0.73991334",
"text": "def hash; end",
"title": ""
},
{
"docid": "0efc33cf18bcedff4c20f96e9d5d65c5",
"score": "0.7371111",
"text": "def _calc_hash(value)\n value.hash\nend",
"title": ""
},
{
"docid": "9944b05469ac538369643c1740c2d3bb",
"score": "0.7369454",
"text": "def test_hash_equals\n\t\tresult = @methods.check_hash_equals \"95a7\", \"95a7\"\n\t\tassert_equal 1, result\n\tend",
"title": ""
},
{
"docid": "15ab111544bfee6d598c82c6a202f376",
"score": "0.7295855",
"text": "def hashfunc; end",
"title": ""
},
{
"docid": "de162bb4d5a6acaaec8bdf1974c71753",
"score": "0.7238712",
"text": "def test_hash_val_low\r\n assert_equal 0, @g.hash_val(65536)\r\n end",
"title": ""
},
{
"docid": "af984c86e7114d5fe8dd19142d11e74d",
"score": "0.7216707",
"text": "def test_check_hash_pass\n sim = VerifierSimulator.new\n assert_equal true, sim.check_hash('1c12', '1c24')\n end",
"title": ""
},
{
"docid": "76bae4e708d6438223c6d05d0887eca4",
"score": "0.7194347",
"text": "def hash\n 1\n end",
"title": ""
},
{
"docid": "f7ee06710fae7e9f54d602e096fb7972",
"score": "0.7152713",
"text": "def hash_function\r\n\t\traise \"SYSTEM ERROR: Method missing\"\r\n\tend",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.71507835",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.71507835",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.71507835",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.71507835",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.71507835",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.71507835",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.71507835",
"text": "def hash\n end",
"title": ""
},
{
"docid": "a5e23f671dd691b971ea0c05c4dc4135",
"score": "0.71507835",
"text": "def hash\n end",
"title": ""
},
{
"docid": "39b15da071a5d18e77c7674f9a946414",
"score": "0.71197665",
"text": "def hash\n @hash || calculate_hash!\n end",
"title": ""
},
{
"docid": "a38a5ff80e615b643c7e6b195a3523f1",
"score": "0.7117297",
"text": "def test_hash\n property_of{\n value = range(lo = 0, hi = 65_536)\n }.check{ |value|\n hashed_value = @checker.hash(value)\n assert (hashed_value = ((value**3000) + (value**value) - (3**value)) * (7**value))\n }\n end",
"title": ""
},
{
"docid": "dcd2d2a7b8b5351f882af58dc9101795",
"score": "0.7079933",
"text": "def hash\n @hash ||= _calculate_hash\n end",
"title": ""
},
{
"docid": "15a32affa0944f826369fb01b6050680",
"score": "0.702475",
"text": "def test_get_hash_empty_string\r\n\t\tassert_equal @bc.get_hash(''), '0' \r\n\tend",
"title": ""
},
{
"docid": "8f97e73317cd71f4efbc229f285343ba",
"score": "0.70199037",
"text": "def hash_function\n @hash_function ||= 'sha256'\n end",
"title": ""
},
{
"docid": "419a753ad187297e6f1a37a15d99be05",
"score": "0.7018465",
"text": "def test_calculate_change_hash_random\n assert_equal(66, get_total( @@cr.calculate_change_hash(0.34, 1.00) ))\n assert_equal(99, get_total( @@cr.calculate_change_hash(0.01, 1.00) ))\n assert_equal(966, get_total( @@cr.calculate_change_hash(0.34, 10.00) ))\n end",
"title": ""
},
{
"docid": "4b9afbe46040b477700a1119208c0076",
"score": "0.7013421",
"text": "def test_hash_inequal\n\t\tresult = @methods.check_hash_equals \"95a7\", \"95a8\"\n\t\tassert_equal 0, result\n\tend",
"title": ""
},
{
"docid": "26fab0c477fbf1eaa413cec435e785b2",
"score": "0.70114136",
"text": "def hash\n 0\n end",
"title": ""
},
{
"docid": "f64a65b96a4698c5937303a0645843d0",
"score": "0.6940746",
"text": "def test_check_hash_fails\n sim = VerifierSimulator.new\n assert_equal false, sim.check_hash('2d7f', '2d7f')\n end",
"title": ""
},
{
"docid": "fff1d340d09abfeab4e4d4deafe3b442",
"score": "0.6921644",
"text": "def hash() ajd.hash end",
"title": ""
},
{
"docid": "b57595534585581dcad80e28672bbf0f",
"score": "0.69070166",
"text": "def hash\n @digest.hexdigest\n end",
"title": ""
},
{
"docid": "43b0bbf74f6c526fca47e5c34bd71d2d",
"score": "0.69061345",
"text": "def get_hash\n @hash\n end",
"title": ""
},
{
"docid": "75b7a648ac451becaa9a29a4fd7d5c47",
"score": "0.6841355",
"text": "def test_prev_hash_true \n\t\tassert verify_prev_hash(\"beef\", \"beef\")\n\tend",
"title": ""
},
{
"docid": "9031460f18db66fd8a4f6da4b3ffb77f",
"score": "0.68349475",
"text": "def test_get\n @table.add(IntHash.new(2))\n @table.add(IntHash.new(7))\n @table.add(StringHash.new(\"char\"))\n assert_equal(@table.get(IntHash.new(7)), IntHash.new(7))\n assert_equal(@table.get(StringHash.new(\"char\")), StringHash.new(\"char\"))\n end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.6807162",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.6807162",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "ae1a628dcfbcd0df0510d0ce3bf0cde6",
"score": "0.6807162",
"text": "def hash=(_arg0); end",
"title": ""
},
{
"docid": "a0723003eee4af505775c3ea17ef5f3b",
"score": "0.68018734",
"text": "def hash() @ajd.hash end",
"title": ""
},
{
"docid": "7f8cb648339a08f5845275d39012de0b",
"score": "0.67995334",
"text": "def hash = other.hash",
"title": ""
},
{
"docid": "17a858516abe042b032473822b816e9b",
"score": "0.6789666",
"text": "def hash\n @hash\n end",
"title": ""
},
{
"docid": "17a858516abe042b032473822b816e9b",
"score": "0.6789666",
"text": "def hash\n @hash\n end",
"title": ""
},
{
"docid": "5cf0cde2707b78dec9057df4d44e510c",
"score": "0.6787955",
"text": "def test_correct_hash\n\t\tresult = @methods.check_hash_value \"0|0|SYSTEM>Henry(100)|1518892051.737141000\", \"1c12\"\n\t\tassert_nil result\n\tend",
"title": ""
},
{
"docid": "fb25dff2b7c8a85d0e28b9c32fcd889f",
"score": "0.67756456",
"text": "def test_driver5_7\n initval = 0\n key = 'Four score and seven years ago'\n hashval = @h.hashlittle(key, initval)\n str = sprintf \"%.8x\", hashval\n assert_equal str, '17770551'\n end",
"title": ""
},
{
"docid": "36da72b2b3ffe685f718a0f93601d946",
"score": "0.67735195",
"text": "def hash\n result['hash']\n end",
"title": ""
},
{
"docid": "bd01e938a6eb9a6faec2e5062a60e3c5",
"score": "0.6772642",
"text": "def test_calc_hash\n utf_vals = {}\n hash_input = 'A'\n res = @my_bc.calc_hash(hash_input, utf_vals)\n assert_equal \"78b9\", res\n end",
"title": ""
},
{
"docid": "d380b21383987fbda06848c4e42d1ae7",
"score": "0.67704034",
"text": "def test_hash_val_high\r\n assert_equal 65535, @g.hash_val(131071)\r\n end",
"title": ""
},
{
"docid": "2d00126f8b1893a386a987761276d1bd",
"score": "0.67639565",
"text": "def test_driver5_8\n initval = 1\n key = 'Four score and seven years ago'\n hashval = @h.hashlittle(key, initval)\n str = sprintf \"%.8x\", hashval\n assert_equal str, 'cd628161'\n end",
"title": ""
},
{
"docid": "78aec9b80a71e03d40b63254b9773b37",
"score": "0.67635757",
"text": "def test_hash\n assert_equal @v.hash(\"0|0|SYSTEM>Henry(100)|1518892051.737141000\"), \"1c12\"\n assert_equal @v.hash(\"1|1c12|SYSTEM>George(100)|1518892051.740967000\"), \"abb2\"\n end",
"title": ""
},
{
"docid": "553adb68c66b5fd53bb111803a1522e7",
"score": "0.6759761",
"text": "def hash\n if @hash_value.nil?\n @hash_value = (name.hash * 53) ^ version.hash\n end\n @hash_value\n end",
"title": ""
},
{
"docid": "b940fbf27863997f6b8832e89ef64224",
"score": "0.6756976",
"text": "def hash()\n unless @hash\n s = StringIO.new\n describe(s, 0, 0, '|')\n str = s.string\n @hash = str.hash\n end\n @hash\n end",
"title": ""
},
{
"docid": "3e48d78391045e8a0e2eb05680f1bcb2",
"score": "0.6743511",
"text": "def hash\n @hash_value\n end",
"title": ""
},
{
"docid": "f459a9624fdc7dc64f609b076dcbcada",
"score": "0.6723869",
"text": "def hash_expected(use_cache = true)\n\t\t\tvalue = resolve use_cache\n\t\t\treturn value \\\n\t\t\t\t\t? Digest::SHA1.hexdigest(value) \\\n\t\t\t\t\t: nil\n\t\tend",
"title": ""
},
{
"docid": "17a7bb1da545cd9b8a50f7d6ef5c9566",
"score": "0.6697713",
"text": "def get_hash(key)\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.6660184",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "78e0fa25227cb54fedee25c3c91a686e",
"score": "0.6660184",
"text": "def hash\n shasum.hash\n end",
"title": ""
},
{
"docid": "9b12dc079c560aa86486c8b0352214e6",
"score": "0.6659436",
"text": "def hash\n generate_data.hash\n end",
"title": ""
},
{
"docid": "484024748318db5a1c3fb8ce741795d6",
"score": "0.6654291",
"text": "def hash\n key.hash\n end",
"title": ""
},
{
"docid": "484024748318db5a1c3fb8ce741795d6",
"score": "0.6654291",
"text": "def hash\n key.hash\n end",
"title": ""
}
] |
e36086a58ad1b293b875b481dbbbc812
|
DELETE /player_item_stats/1 DELETE /player_item_stats/1.json
|
[
{
"docid": "013e9542fd6f50d24a887aac6a3ff6ba",
"score": "0.76522267",
"text": "def destroy\n @player_item_stat.destroy\n respond_to do |format|\n format.html { redirect_to player_item_stats_url, notice: 'Player item stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "c331826f6c8e836228dfa418016c2ce3",
"score": "0.7189387",
"text": "def destroy\n @player_stat = PlayerStat.find(params[:id])\n @player_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to player_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ba93e0a02357930713a225ad5557d70b",
"score": "0.69027275",
"text": "def destroy\n @player_stat.destroy\n respond_to do |format|\n format.html { redirect_to player_stats_url, notice: 'Player stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ff531f1abf0716edaa3d1303269770f6",
"score": "0.68965876",
"text": "def destroy\n @test_play_stat.destroy\n respond_to do |format|\n format.html { redirect_to test_play_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5123a73821672ef7138dc18c1f61f860",
"score": "0.6889841",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n track_activity @item\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "937bba91d4e52bc8eed1004326ad082c",
"score": "0.6844806",
"text": "def destroy\n @rushing_stat = RushingStat.find(params[:id])\n @rushing_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to rushing_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9cbd6d13d3d30ec49d9180d854566752",
"score": "0.68147844",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9cbd6d13d3d30ec49d9180d854566752",
"score": "0.68147844",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9cbd6d13d3d30ec49d9180d854566752",
"score": "0.68147844",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9cbd6d13d3d30ec49d9180d854566752",
"score": "0.68147844",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4887a9d53412b199ea6602c5fb87d221",
"score": "0.68122256",
"text": "def destroy\n @gamestat = Gamestat.find(params[:id])\n @gamestat.destroy\n\n respond_to do |format|\n format.html { redirect_to gamestats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1e9285fcee81ceb444ecde8a695405bc",
"score": "0.6806231",
"text": "def destroy\n @game_stat.destroy\n respond_to do |format|\n format.html { redirect_to game_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "46a243e450c40ef9bf263a13c004068c",
"score": "0.6796209",
"text": "def destroy\n @player_item.destroy\n respond_to do |format|\n format.html { redirect_to player_items_url, notice: 'Player item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d6515ed551ad871c4a284e1903adf3da",
"score": "0.6755819",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/stats\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a610b1ed9e56c060810ceabc2942283f",
"score": "0.6752682",
"text": "def destroy\r\n # JSON is not allowed to destroy item_infos. Must be done through the website.\r\n respond_to do |format|\r\n format.html {\r\n @item_info = ItemInfo.find(params[:id])\r\n @item_info.destroy\r\n GameInfoHelper.updateTime\r\n redirect_to item_infos_url\r\n }\r\n format.json {\r\n create_error(:forbidden, :put, params[:item_info], \"Data incorrect\")\r\n }\r\n end\r\n end",
"title": ""
},
{
"docid": "403cd204b14f421ff1445b54cfb4042c",
"score": "0.67511064",
"text": "def destroy\n @pokemon_stat = PokemonStat.find(params[:id])\n @pokemon_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to pokemon_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b96c767b3be482b4ff90e3e872aa4307",
"score": "0.66959524",
"text": "def destroy\n @baseball_stat = BaseballStat.find(params[:id])\n @baseball_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/stats\", notice: 'Baseball stats deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9e258202c8cc09eef55fe4071f172fc0",
"score": "0.66696477",
"text": "def destroy\n @player_statistic.destroy\n respond_to do |format|\n format.html { redirect_to player_statistics_url, notice: 'Player statistic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85de423f1f24305391029737d0265f61",
"score": "0.6664437",
"text": "def destroy\n item = Item.find(params[:id])\n item.destroy\n render :json => item\n end",
"title": ""
},
{
"docid": "4677846e016e5e6c8501f3bfe075fb34",
"score": "0.66590255",
"text": "def destroy\n @basketball_stat = BasketballStat.find(params[:id])\n @basketball_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/stats\", notice: 'Basketball stats deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "606ca6421f51328db405314ea9ab0010",
"score": "0.6651494",
"text": "def destroy\n @uniform_item.destroy\n respond_to do |format|\n format.html { redirect_to uniform_items_url, notice: (t 'uniform_items.title')+(t 'actions.removed') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "21ecf0e1b847bb2fde49396ad37bd467",
"score": "0.66475624",
"text": "def destroy\n @item = Item.find(params[:id])\n\n # redirect_if_not_authorized(@item.user_id) ? return : nil\n \n @item.update_status(\"deleted\")\n @item.buckets.each {|b| b.update_count }\n\n respond_to do |format|\n format.html { redirect_to user_items_path(current_user) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a82ffe6e0bea3bb1cc29c2685cc0f5ee",
"score": "0.6646876",
"text": "def destroy\n @item.destroy\n render json: { status: 'success' }\n end",
"title": ""
},
{
"docid": "0e571e4d98b2cc87c9b172feeb03010f",
"score": "0.6644996",
"text": "def destroy\n @soccer_stat = SoccerStat.find(params[:id])\n @soccer_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/stats\", notice: 'Soccer stats deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d308208374599eb66498f80edd119434",
"score": "0.6620339",
"text": "def destroy\n @tournament_stat.destroy\n respond_to do |format|\n format.html { redirect_to tournament_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a42ce5de9eb42edd35fcf4b95d94310b",
"score": "0.6614744",
"text": "def destroy\n @score_item.destroy\n respond_to do |format|\n format.html { redirect_to score_items_url, notice: 'Score item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ed33c3686243517526941b530d57f404",
"score": "0.6603872",
"text": "def destroy\n @football_stat = FootballStat.find(params[:id])\n @football_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to \"/stats\", notice: 'Football stats deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ba3ffc3f842560fa1fbcad79adc92a0",
"score": "0.6593513",
"text": "def delete_item\n @item.destroy!\n render json: { }\n end",
"title": ""
},
{
"docid": "e0dbffdde87c3142e67bce9c9a188c32",
"score": "0.65872335",
"text": "def destroy\n @item = Item.find(params[:item_id])\n @minute.destroy\n respond_to do |format|\n format.html { redirect_to item_url(@item), notice: \"Minute was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "fd8e3576cdcb36ff64b9810f2c4e1061",
"score": "0.658398",
"text": "def destroy\n @file_stat = FileStat.find(params[:id])\n @file_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to file_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0a2f8844dbc164590762672eaecb393e",
"score": "0.65748996",
"text": "def destroy\n @stat.destroy\n respond_to do |format|\n format.html { redirect_to stats_url, notice: 'Account was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c2b06c8934a1264699cd5a0e366f4cd9",
"score": "0.65742487",
"text": "def destroy\n # :id here represents the name so we don't have to change the routes\n @item = Item.find_by_name(params[:id])\n p params\n logger.debug @item.inspect\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "412758de17333f5451499fad0aa4446d",
"score": "0.65738976",
"text": "def destroy\n @item = Item.find(params[:item_id])\n @minute.destroy\n respond_to do |format|\n format.html { redirect_to item_url(@item), notice: 'Minute was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "08ac1844292a345a47268676791fa00a",
"score": "0.65691173",
"text": "def destroy\n @game_stat.destroy\n respond_to do |format|\n format.html { redirect_to game_stats_url, notice: 'Game stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3cc779a7faff768760e5ea007e3d25ba",
"score": "0.65675914",
"text": "def destroy\n @user_game_stat.destroy\n respond_to do |format|\n format.html { redirect_to user_game_stats_url, notice: \"User game stat was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df45e9a0dd59752ffbe30f09d9d9c008",
"score": "0.6565788",
"text": "def destroy\n @stat.destroy\n respond_to do |format|\n format.html { redirect_to stats_url, notice: 'Stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "df45e9a0dd59752ffbe30f09d9d9c008",
"score": "0.6565788",
"text": "def destroy\n @stat.destroy\n respond_to do |format|\n format.html { redirect_to stats_url, notice: 'Stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.65636045",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "843a80eb7a01621c89af1e3f1743b40e",
"score": "0.65604085",
"text": "def destroy\n @item.destroy\n render json: nil\n end",
"title": ""
},
{
"docid": "508ded624f8adc9e8abbf8eab0f50272",
"score": "0.65596426",
"text": "def destroy\n @stat = Statistic.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to statistics_url(otdel: params[:otdel]) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "746267891fbcd0208595647aa560bd04",
"score": "0.65448576",
"text": "def destroy\n @allstat.destroy\n respond_to do |format|\n format.html { redirect_to stats_url, notice: 'Stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "55f77cc0d71f93763bf5aa6593b9cab0",
"score": "0.65422523",
"text": "def destroy\n @vote.destroy\n @item.decrement!(:rank)\n respond_to do |format|\n format.html { redirect_to @playlist }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9b5a3722f632497b0777ea2c3b6dd0bc",
"score": "0.65276575",
"text": "def destroy\n @calculated_player_statistic = CalculatedPlayerStatistic.find(params[:id])\n @calculated_player_statistic.destroy\n\n respond_to do |format|\n format.html { redirect_to calculated_player_statistics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9df5493612b7cad981e008bd4513cd2b",
"score": "0.6504992",
"text": "def destroy\n @api_item.destroy\n end",
"title": ""
},
{
"docid": "9df5493612b7cad981e008bd4513cd2b",
"score": "0.6504992",
"text": "def destroy\n @api_item.destroy\n end",
"title": ""
},
{
"docid": "f05c3ac3a6b4605523178be8c717b422",
"score": "0.6489921",
"text": "def destroy\n @ship_item.destroy\n respond_to do |format|\n format.html { redirect_to player_ships_path, notice: 'Ship item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d88b1d645b1bfaa512d198cd8c5e12a2",
"score": "0.64852005",
"text": "def delete\n\t\trender json: Player.delete(params[\"id\"])\n\tend",
"title": ""
},
{
"docid": "9f90a597426aa29f602691cfa42c810a",
"score": "0.64824945",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "221858579afa4f11746f587f4bfaf259",
"score": "0.6477566",
"text": "def delete\n\n thePlayer = Player.find(@player_id)\n render :json => thePlayer.destroy, :except => [:password_digest]\n\n end",
"title": ""
},
{
"docid": "d2da3fb19e3ad67321e6b918c13d3ddd",
"score": "0.64714885",
"text": "def destroy\n @item.destroy\n render :json => { status: :deleted, head: :no_content }\n end",
"title": ""
},
{
"docid": "fc41093496eb008561efb9949a78d9e2",
"score": "0.6461955",
"text": "def destroy\n @shoot = @shot_list_item.shoot\n @shot_list_item.destroy\n respond_to do |format|\n format.html { redirect_to shoot_path(@shoot, :active => 'shotlist'), notice: 'Shot list item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6083398146326d9abc404d4c896db347",
"score": "0.6460603",
"text": "def destroy\n @user_item = UserItem.find_by(item_id: params[:id])\n @user_item.destroy\n render json: {message: \"Deleted!\"}\n end",
"title": ""
},
{
"docid": "25f482a9f6c932afd7b9ec0267f071a7",
"score": "0.64584726",
"text": "def destroy\n @level_play.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6d383b577bd67d39816cd2c734dcb759",
"score": "0.6454667",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to(stats_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6d383b577bd67d39816cd2c734dcb759",
"score": "0.6454667",
"text": "def destroy\n @stat = Stat.find(params[:id])\n @stat.destroy\n\n respond_to do |format|\n format.html { redirect_to(stats_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4f7c3e8669e83c6bdf1841186accf241",
"score": "0.64537466",
"text": "def destroy\n @serie_stat.destroy\n respond_to do |format|\n format.html { redirect_to serie_stats_url, notice: 'Stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ac278824f920f0792bd927135f84f6fd",
"score": "0.6445887",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.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": "5b7cc9ad9c9ac8200004158c35f6ef7e",
"score": "0.6444511",
"text": "def destroy\n @share_a_stat.destroy\n respond_to do |format|\n format.html { redirect_to share_a_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "187b68328484bba6c0c885e64d5e3936",
"score": "0.6443554",
"text": "def destroy\n @trackable_item = TrackableItem.find(params[:id])\n @trackable_item.destroy\n \n respond_to do |format|\n format.html { redirect_to(trackable_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4107dddc77164a96d9420f2ceb0ca66d",
"score": "0.6443122",
"text": "def destroy\r\n @stat = Stat.find(params[:id])\r\n @stat.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(stats_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "bb1bbf46ce51c592fb2c9f05e26a44ef",
"score": "0.6440767",
"text": "def destroy\n if @item.destroy\n head :no_content, status: 200\n else\n render json: @item.errors, status: 405\n end\n end",
"title": ""
},
{
"docid": "4ce6b3a26ee2952773765c9ca4cfc79b",
"score": "0.64390177",
"text": "def destroy\n @shot = Shot.find(params[:id])\n @shot.destroy\n\n respond_to do |format|\n format.html { redirect_to shots_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "58a19bec2989c13fc0d9b0b84e9fea64",
"score": "0.6431515",
"text": "def destroy\n @time_item.destroy\n respond_to do |format|\n format.html { redirect_to @time_item.timeline }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d1525a8c51ae79d4baf10045fdb55077",
"score": "0.6429922",
"text": "def destroy\n @batting_stat = BattingStat.find(params[:id])\n @batting_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to batting_stats_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6c0e35b42950430cf64244072db55d29",
"score": "0.6427016",
"text": "def destroy\n @action_item = ActionItem.find(params[:id])\n @action_item.destroy\n\n respond_to do |format|\n format.html { redirect_to action_items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d866dd8021a627b02e509af02a6e8555",
"score": "0.6424661",
"text": "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d7894fe8f8289be6ddf4d659bbd69209",
"score": "0.6421609",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n \n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cdc69632974a72dbd8aadc2e9957f7f6",
"score": "0.64168644",
"text": "def destroy_rest\n @v1_item_usage = V1ItemUsage.find(params[:id])\n @v1_item_usage.destroy\n\n respond_to do |format|\n format.html { redirect_to(v1_item_usages_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2e239f49dd94db73835d0021dcd013d6",
"score": "0.6414967",
"text": "def destroy\n @item = Report.find(params[:id])\n if @item.destroy\n render :status => 200, :json =>{:response => \"deleted\"}\n else\n render :status => 403, :json =>{:error => @item.errors}\n end\n end",
"title": ""
},
{
"docid": "f99c6f15db62709056c1dfe9dd06190c",
"score": "0.64095575",
"text": "def destroy\n @game_stash_datum = GameStashDatum.find(params[:id])\n @game_stash_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to game_stash_data_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.640755",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.640755",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.640755",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.640755",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.640755",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.640755",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "93410db0dd3b63a15a62dbc0f7c34584",
"score": "0.640755",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b2988b0163b129d1253fed92301651f7",
"score": "0.64075404",
"text": "def destroy\n item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c2bfd4e95abd4eb70ac25be957a9d64a",
"score": "0.64067745",
"text": "def destroy\n @stat.destroy\n respond_to do |format|\n format.html { redirect_to stats_url, notice: 'Water Successfully Changed' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "057bb7143c78bf8c674d0317504021f0",
"score": "0.64023465",
"text": "def destroy\n @item = Item.find(params[:id])\n respond_to do |format|\n if @item.destroy\n format.json { render json: {:id => @item.id}, status: :ok }\n else\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b67dd03ef5ef7b1e7c509d7f9f5d6c71",
"score": "0.63952494",
"text": "def destroy\n @watcheditem.destroy\n respond_to do |format|\n format.html { redirect_to watcheditems_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c921a9eff16cf6b16f271d14adc4aae1",
"score": "0.6395064",
"text": "def destroy\n @shot = Shot.find(params[:id])\n @shot.destroy\n\n respond_to do |format|\n format.html { redirect_to shots_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c921a9eff16cf6b16f271d14adc4aae1",
"score": "0.6395064",
"text": "def destroy\n @shot = Shot.find(params[:id])\n @shot.destroy\n\n respond_to do |format|\n format.html { redirect_to shots_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b6438de4bcefb499673c3f3ddd46e14",
"score": "0.6394175",
"text": "def destroy\n @line_item = LineItem.find(params[:id])\n @line_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(@line_item.user, :notice => 'Game removed') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "195efbe55200134a83c546bedfee5e59",
"score": "0.6392858",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "12eb6568a3f6151ea70f030dfa8de5d4",
"score": "0.6389849",
"text": "def destroy\n generic_item = @specific_item.generic_item\n @specific_item.destroy\n\n respond_to do |format|\n format.html { redirect_to :back, :notice => t('notice.successfully_deleted')}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "20ec5155d440e780c2935a0b2d013896",
"score": "0.6381898",
"text": "def destroy\n @item_api = ItemApi.find(params[:id])\n @item_api.destroy\n\n respond_to do |format|\n format.html { redirect_to(item_apis_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "44fdbcfd9f56def910e4f0266b0492f6",
"score": "0.63773286",
"text": "def destroy\n @quasi_stat.destroy\n respond_to do |format|\n format.html { redirect_to quasi_stats_url, notice: 'Quasi stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.63770986",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cebd84430491d8af42dedf4a3a398bf1",
"score": "0.63768464",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dc15299ba1456113ba6dc4a91653ad18",
"score": "0.6376815",
"text": "def destroy\n @item = Item.find(params[:id])\n @item.destroy\n\n respond_to do |format|\n format.html { redirect_to items_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
69a8f5aeaf0985ea690ce33e744d7a62
|
Get Rates with Shipment Details
|
[
{
"docid": "8a0a535dbbaa7b11b524d68aa926cca6",
"score": "0.6839806",
"text": "def get_rates_with_shipment_details(shipment_details, config = {})\n @rates.get_rates_with_shipment_details(shipment_details, config)\n end",
"title": ""
}
] |
[
{
"docid": "465439dc4a9e71190b878876066ef9dd",
"score": "0.7121323",
"text": "def shipment_rates\n order.shipments.flat_map do |shipment|\n calculate_rates(shipment)\n end\n end",
"title": ""
},
{
"docid": "5c7eb4e8285927935b83d1690c4b58c0",
"score": "0.6262499",
"text": "def rates(date)\n build_rates(date)\n end",
"title": ""
},
{
"docid": "b32e73503ac85c80f6c792f276196ede",
"score": "0.62497085",
"text": "def get_smart_rates(id)\n @client.make_request(:get, \"shipments/#{id}/smartrate\", MODEL_CLASS).result || []\n end",
"title": ""
},
{
"docid": "d533d6e31abcf9990b3a0f1d7faf2908",
"score": "0.6145652",
"text": "def shipments\n # get prepared shipments\n @prepared_shipments = Shipment.where.not(shipping_company: '',\n tracking_number: '').pluck(:delivery_id)\n @in_progress_shipments = Delivery.where(id: @prepared_shipments).\n where(status: \"in progress\")\n @already_shipped = Delivery.where(id: @prepared_shipments).\n where(status: \"delivered\") \n #Rails.logger.debug(\"Upcoming deliveries: #{@in_progress_delivery_info.inspect}\")\n \n # get list of upcoming delivery dates\n @upcoming_shipment_dates = @in_progress_shipments.pluck(:delivery_date).uniq\n #Rails.logger.debug(\"Upcoming delivery dates: #{@upcoming_delivery_dates.inspect}\")\n \n # determine number of drinks in each delivery currently live\n @in_progress_shipments.each do |delivery|\n # get account delivery details\n @account_delivery = AccountDelivery.where(delivery_id: delivery.id)\n \n # count number of drinks in delivery\n @drink_count = @account_delivery.sum(:quantity)\n \n # attribute this drink count to the delivery\n delivery.delivery_quantity = @drink_count\n end\n \n # determine number of drinks in each delivery already delivered\n @already_shipped.each do |delivery|\n # get account delivery details\n @account_delivery = AccountDelivery.where(delivery_id: delivery.id)\n \n # count number of drinks in delivery\n @drink_count = @account_delivery.sum(:quantity)\n \n # attribute this drink count to the delivery\n delivery.delivery_quantity = @drink_count\n end\n \n end",
"title": ""
},
{
"docid": "4ec8b1885d70f20b4e827dc5e34af9be",
"score": "0.6128853",
"text": "def retrieve_estimated_delivery_date(id, planned_ship_date)\n url = \"shipments/#{id}/smartrate/delivery_date\"\n params = { planned_ship_date: planned_ship_date }\n\n @client.make_request(:get, url, MODEL_CLASS, params).rates\n end",
"title": ""
},
{
"docid": "06ad2b6019682c5c92de1553c5796369",
"score": "0.6116053",
"text": "def rate_estimates(shipment, options:, debug: false)\n rate_request_xml = SerializeRatingServiceSelectionRequest.call(shipment: shipment, options: options)\n url = base_url + RESOURCES[:rates]\n request = FriendlyShipping::Request.new(\n url: url,\n http_method: \"POST\",\n body: access_request_xml + rate_request_xml,\n readable_body: rate_request_xml,\n debug: debug\n )\n\n client.post(request).bind do |response|\n ParseRateResponse.call(response: response, request: request, shipment: shipment)\n end\n end",
"title": ""
},
{
"docid": "be8406498c73f90ff0de360bcc4a1433",
"score": "0.6056522",
"text": "def rates\n date = nearest_date\n\n [\n date.currencies.find{ |d| d.key == @to },\n date.currencies.find{ |d| d.key == @from }\n ]\n end",
"title": ""
},
{
"docid": "7bc78caabf7cab82073f20d30640d279",
"score": "0.60512185",
"text": "def get_rates!\n if self.status\n Forex.forex_ticker.each do |key|\n self.rates[key]= self.all_rates[key]\n end\n end\n self.rates\n end",
"title": ""
},
{
"docid": "c2b10d50681c651e1384583407a1a4e2",
"score": "0.60449547",
"text": "def rate_estimates(shipment, options:, debug: false)\n freight_rate_request_hash = GenerateFreightRateRequestHash.call(shipment: shipment, options: options)\n request = build_request(:rates, freight_rate_request_hash, debug)\n\n client.post(request).fmap do |response|\n ParseFreightRateResponse.call(response: response, request: request)\n end\n end",
"title": ""
},
{
"docid": "9fcb0162f8db6ad3b59bc879ba1bd6ba",
"score": "0.60163873",
"text": "def list_shipment_rates_with_http_info(shipment_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ShipmentsApi.list_shipment_rates ...'\n end\n # verify the required parameter 'shipment_id' is set\n if @api_client.config.client_side_validation && shipment_id.nil?\n fail ArgumentError, \"Missing the required parameter 'shipment_id' when calling ShipmentsApi.list_shipment_rates\"\n end\n if @api_client.config.client_side_validation && shipment_id.to_s.length > 25\n fail ArgumentError, 'invalid value for \"shipment_id\" when calling ShipmentsApi.list_shipment_rates, the character length must be smaller than or equal to 25.'\n end\n\n if @api_client.config.client_side_validation && shipment_id.to_s.length < 1\n fail ArgumentError, 'invalid value for \"shipment_id\" when calling ShipmentsApi.list_shipment_rates, the character length must be great than or equal to 1.'\n end\n\n pattern = Regexp.new(/^se(-[a-z0-9]+)+$/)\n if @api_client.config.client_side_validation && shipment_id !~ pattern\n fail ArgumentError, \"invalid value for 'shipment_id' when calling ShipmentsApi.list_shipment_rates, must conform to the pattern #{pattern}.\"\n end\n\n # resource path\n local_var_path = '/v1/shipments/{shipment_id}/rates'.sub('{' + 'shipment_id' + '}', CGI.escape(shipment_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'created_at_start'] = opts[:'created_at_start'] if !opts[:'created_at_start'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'ListShipmentRatesResponseBody' \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: ShipmentsApi#list_shipment_rates\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "443de27d1c7cddb32ffb8d442c11e286",
"score": "0.5981672",
"text": "def fetch_rates\n data = build_uri.read\n extract_rates(data)\n end",
"title": ""
},
{
"docid": "3f4e68419b8fd23feeb7324a8af36a3d",
"score": "0.5968364",
"text": "def vat_rates( _shipping = self.shipping )\n\n rates = ActiveRecord::Base.connection.select_values(\"\n \tselect distinct vat from so_items\n \twhere supplier_order_id = #{id}\n \tand product_id is not null\n \")\n\n # Also take shipping into account\n str = self.shipping_tr\n tmp_shipping = _shipping.nil? ? 0 : _shipping\n if ((tmp_shipping > 0) && !rates.include?(str.to_s))\n rates.push str\n end\n\n vat_rates = []\n for r in rates\n \tvr = VatRate.new\n \tvr.rate = r.to_f\n \tvr.value = ActiveRecord::Base.connection.select_value(\"\n \t\tselect sum( qty * price * vat ) from so_items\n \t\twhere supplier_order_id = #{id}\n \t\tand vat = #{vr.rate}\n \t\").to_f\n \tvr.value += tmp_shipping * str if (vr.rate == str)\n \tvr.value = vr.value.round / 100.0\n \tvat_rates << vr\n end\n return vat_rates\n end",
"title": ""
},
{
"docid": "5f895ede95e22f8ba0020d6cef31c6ac",
"score": "0.5966602",
"text": "def usps_rates\n usps = ActiveShipping::USPS.new(login: ENV['USPS_LOGIN'])\n get_rates_from_shipper(usps)\n end",
"title": ""
},
{
"docid": "53c7820b8b3c0ed7b5aedf35a470ee46",
"score": "0.5963908",
"text": "def get_rates\n @response = @client.call(:get_rate_estimate, message: { originPostalCode: @originPostalCode,\n originCountry: @originCountry,\n destinationPostalCode: @destinationPostalCode,\n destinationCountry: @destinationCountry,\n odfl4MeUser: self.odfl4MeUser,\n odfl4MePassword: self.odfl4MePassword,\n odflCustomerAccount: self.odflCustomerAccount,\n tariff: self.tariff,\n movement: self.movement,\n mexicoServiceCenter: self.mexicoServiceCenter,\n currencyFormat: self.currencyFormat,\n requestReferenceNumber: self.requestReferenceNumber,\n freightItems: {\n \"Freight\" => self.freight\n },\n weightUnits: self.weightUnits,\n numberPallets: self.freight.count,\n linearFeet: self.linearFeet,\n accessorials: {\n string: self.accessorials\n },\n totalCubicVolume: @totalCubicVolume,\n cubicUnits: @cubicUnits,\n numberStackablePallets: self.numberStackablePallets,\n pickupDateTime: @pickupDateTime,\n deliveryDateTime: @deliveryDateTime,\n shipType: self.shipType,\n codAmount: @codAmount,\n insuranceAmount: self.insuranceAmount,\n loosePieces: self.loosePieces,\n email: self.email,\n sendEmailOffers: self.sendEmailOffers,\n firstName: self.firstName,\n lastName: self.lastName\n })\n processResult(@response)\n\n if @resultHash[:success]\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "e473f96f26a52524446be6cb2ebb8e14",
"score": "0.59580123",
"text": "def index\n @quote_shipping_rates = QuoteShippingRate.all\n end",
"title": ""
},
{
"docid": "2af0d40f484df40193a43b54f73c2105",
"score": "0.59390086",
"text": "def find_rates(origin, destination, packages, options = {})\n ::ActiveShipping::RateResponse.new(true, \"success!\", {}, :rates => [instance_double('rate', service_name: 'Bogus Calculator', price: 999)], :xml => \"\")\n end",
"title": ""
},
{
"docid": "e5f2ea19c9ffc6e7a1c3d3e7f924d81d",
"score": "0.59049916",
"text": "def get_shipping_prices\n prices = Array.new\n # If they're in the USA\n address = self.shipping_address\n if address.country_id == 1 then\n shipping_types = OrderShippingType.get_domestic\n else \n shipping_types = OrderShippingType.get_foreign\n end\n \n ship = Shipping::FedEx.new(:prefs => \"#{RAILS_ROOT}/config/shipping.yml\")\n ship.fedex_url = SHIP_FEDEX_URL\n ship.fedex_account = SHIP_FEDEX_ACCOUNT\n ship.fedex_meter = SHIP_FEDEX_METER\n ship.sender_zip = SHIP_SENDER_ZIP\n ship.sender_country = SHIP_SENDER_COUNTRY\n ship.weight = self.weight\n ship.zip = address.zip\n ship.city = address.city\n ship.country = address.country.fedex_code\n \n logger.info(\"\\n\\nCREATED A SHIPPING OBJ\\n#{ship.inspect}\\n\\n\")\n \n for type in shipping_types\n ship.service_type = type.service_type\n ship.transaction_type = type.transaction_type\n # Rescue errors. The Shipping gem likes to throw nasty errors\n # when it can't get a price.\n #\n # Usually this means the customer didn't enter a valid address (zip code most of the time)\n # In that case we go for our own shipping prices.\n begin\n # FedEx can be flaky sometimes and return 0 for prices.\n # Make sure we always calculate a shipping rate even if they're being wacky.\n price = ship.discount_price\n if price == 0\n price = ship.price\n end\n if price == 0\n type.calculate_price(self.weight)\n else\n type.price = price + @@handling_fee\n end\n rescue\n logger.error \"\\n[ERROR] #{$!.message}\"\n type.calculate_price(self.weight)\n type.price += @@handling_fee\n end\n # logger.info \"#{type.name} : ship.discount_price / type.price\"\n prices << type\n end\n \n return prices\n \n end",
"title": ""
},
{
"docid": "2d9293faafef2e90640bb1b52a35d33e",
"score": "0.5893531",
"text": "def shipments\n sql = <<-EOF\n\t\tselect aff.id as affiliate_id, aff.name as affiliate_name, shp.status, count(shp.status) as total\n\t\tfrom store_shipments shp\n\t\tjoin core_affiliates aff on aff.id = shp.fulfilled_by_id\n\t\twhere shp.created_at > '#{@start_date}' and shp.created_at < '#{@end_date}'\n\t\tgroup by shp.fulfilled_by_id, shp.status;\n EOF\n\n @data = []\n ActiveRecord::Base.connection.execute(sql).each(as: :hash) { |row| @data << row }\n end",
"title": ""
},
{
"docid": "f474b040118a0021c9f3d1bfa241964e",
"score": "0.5884431",
"text": "def rate_estimates(shipment, options: FriendlyShipping::Services::ShipEngine::RateEstimatesOptions.new, debug: false)\n request = FriendlyShipping::Request.new(\n url: \"#{API_BASE}rates/estimate\",\n http_method: \"POST\",\n body: SerializeRateEstimateRequest.call(shipment: shipment, options: options).to_json,\n headers: request_headers,\n debug: debug\n )\n client.post(request).bind do |response|\n ParseRateEstimateResponse.call(response: response, request: request, options: options)\n end\n end",
"title": ""
},
{
"docid": "42981dfb3b25473d6eb2741b10383888",
"score": "0.5880574",
"text": "def getRates\n url = URI.parse 'http://sellonline.canadapost.ca:30000/'\n request = Net::HTTP::Post.new(url.path)\n request.content_type = 'application/x-www-form-urlencoded'\n request.body = prepareXML\n response = Net::HTTP.start(url.host, url.port) {|http| http.request(request)}\n xml = REXML::Document.new(response.body).root\n if error = xml.elements['error']\n error = error.elements['statusMessage'].text\n raise StandardError.new(error)\n end\n xml = xml.elements['ratesAndServicesResponse']\n result = {}\n result[:products] = []\n xml.elements.each('product') do |p|\n product = {}\n p.elements.each do |t|\n product[t.name.to_sym] = t.text\n end\n result[:products] << product\n end\n result[:options] = {}\n xml.elements['shippingOptions'].elements.each do |t|\n result[:options][t.name.to_sym] = t.text\n end\n return result\n end",
"title": ""
},
{
"docid": "eab0491b0fbf29bb887bfeb851b38419",
"score": "0.58782786",
"text": "def ssp_rates\n [\n {min: Date.parse(\"6 April 2011\"), max: Date.parse(\"5 April 2012\"), ssp_weekly_rate: 81.60 },\n {min: Date.parse(\"6 April 2012\"), max: Date.parse(\"5 April 2012\"), ssp_weekly_rate: 85.85}\n ]\n end",
"title": ""
},
{
"docid": "174611ab1e52f13318af4627a208efd6",
"score": "0.5868878",
"text": "def index\n @shipments = Shipment.order(\"created_at DESC\").page(params[:page]).per(5)\n end",
"title": ""
},
{
"docid": "f23b60f87822045e5c57d99173e3fd13",
"score": "0.58515817",
"text": "def getDates()\n url=\"http://api.tradingphysics.com/getdates?type=orderflow\"\n return(Net::HTTP.get(URI.parse(url)).gsub(\"-\").split(\"\\r\\n\"));\n end",
"title": ""
},
{
"docid": "6d720077476e26e3d3866112b79a36e4",
"score": "0.58460975",
"text": "def extract_rates(response)\n rates = response.get('ga_hotel_avail_rs.room_stays.room_stay')\n Array(rates)\n end",
"title": ""
},
{
"docid": "940a25cc5a15fe07e818cbc8ac1036ca",
"score": "0.5839647",
"text": "def calculate_estimated_ship_date_and_inhand_dates\n doc = Hpricot::XML(request.raw_post)\n result = Sales::DateUtility.calculate_estimated_ship_date_and_inhand_dates(doc)\n render :xml=>\"#{result}\"\n end",
"title": ""
},
{
"docid": "e40b0ecaf30d77a5db914981d05eecde",
"score": "0.58362526",
"text": "def sales_info(dates, site)\n\tparams, orders_ids, orders_names, all_skus, orders_request, orders = [],[],[],[],[],[]\n\torders_amount = 0\n\n\tparams.clear.push(['status', 'any'], ['financial_status', 'paid'],['created_at_min', dates])\n\torders_count = JSON.parse(request(site,'get', \"/orders/count\", params).body)\n\tpage_count = (orders_count['count']/250.to_f).ceil\n\t\n\tif page_count > 1\n\t\ti = 1\n\t\twhile i < page_count + 1\n\t\t\tparams.clear.push(['status', 'any'], ['financial_status', 'paid'],['created_at_min', dates],['limit', '250'],['page', i])\t\n\t\t\torders_request.push(request(site,'get', \"/orders\", params).body)\n\t\t\ti +=1\n\t\tend\n\n\t\torders_request.each do |request|\n\t\t\thashed_request = JSON.parse(request)\n\t\t\thashed_request['orders'].each do |ind_order|\n\t\t\t\torders << ind_order\n\t\t\tend\n\t\tend\n\n\t\torders.each do |order|\n\t\t\torders_names.push(order['name'])\n\t\t\torders_ids.push(order['id'])\n\t\t\torder['line_items'].each {|line| all_skus.push(line['sku'])}\n\t\tend\n\n\telse\n\t\tparams.clear.push(['status', 'any'], ['financial_status', 'paid'],['created_at_min', dates],['limit', '250'])\n\t\torders = JSON.parse(request(site,'get', \"/orders\", params).body)\n\t\torders['orders'].each do |order|\n\t\t\torders_names.push(order['name'])\n\t\t\torders_ids.push(order['id'])\n\t\t\torder['line_items'].each {|line| all_skus.push(line['sku'])}\n\t\tend\n\tend\n\n\tsales_info = {\n\t\t\"count\" => orders_count['count'],\n\t\t\"order_ids\" => orders_ids,\n\t\t\"order_numbers\" => orders_names,\n\t\t\"refund_amounts\" => orders_amount,\n\t\t\"skus\" => all_skus\n\t}\nend",
"title": ""
},
{
"docid": "eef23577e5d3205197761df2781ec250",
"score": "0.5816021",
"text": "def refund_info(dates, site)\n\tparams, refunded_orders_ids, refunded_orders_names = [],[],[]\n\trefunded_orders_amount = 0\n\n\tparams.push(['status', 'any'], ['financial_status', 'refunded'],['created_at_min', dates])\n\trefunded_orders = JSON.parse(request(site,'get', \"/orders\", params).body)\n\trefunded_orders_count = JSON.parse(request(site,'get', \"/orders/count\", params).body)\n\t\n\trefunded_orders['orders'].each do |order|\n\t\trefunded_orders_names.push(order['name'])\n\t\trefunded_orders_ids.push(order['id'])\n\t\trefunded_orders_amount = refunded_orders_amount + order['refunds'][0]['transactions'][0]['receipt']['TotalRefundedAmount'].to_i\n\tend\n\t\n\trefunded_orders['orders'][0]['refunds'][0]['transactions'][0]['receipt']['TotalRefundedAmount']\n\n\trefunds = {\n\t\t\"count\" => refunded_orders_count['count'],\n\t\t\"order_ids\" => refunded_orders_ids,\n\t\t\"order_numbers\" => refunded_orders_names,\n\t\t\"refund_amounts\" => refunded_orders_amount\n\t}\n end",
"title": ""
},
{
"docid": "6c081389e0193af7a1649b4d539f79b3",
"score": "0.58117986",
"text": "def delivery_dates\n dispatch_delivery_dates.map(&:delivery_date)\n end",
"title": ""
},
{
"docid": "1c3992118995901ed932a62a5b5aa321",
"score": "0.58052254",
"text": "def rates(options)\n self.class.bridge.hotel_details(hotel_property[:hotel_chain],\n hotel_property[:hotel_code],\n options).try(:hotel_rate_details) || []\n end",
"title": ""
},
{
"docid": "0385da5d6bd4205a53015149b3b8821d",
"score": "0.5791239",
"text": "def index\n @shipment_lines = ShipmentLine.all\n end",
"title": ""
},
{
"docid": "11772e109612e2b130c52f9b86346635",
"score": "0.57660675",
"text": "def all_rates_for_country\n @country = Country.find_by_code(shipping_rates_params[:country_code])\n @shipping_rates = ShippingRate.where(:country => @country).order(:currency_code)\n \n #TODO : serialization\n respond_to do |format|\n format.json do\n render :json => {\n :shipping_rates => @shipping_rates.as_json(:only => [:currency_code, :regular_rate, :express_rate])\n }\n end\n end\n end",
"title": ""
},
{
"docid": "ee109395d967b8ed7a3a99aa846570d0",
"score": "0.57503974",
"text": "def rate_estimates(shipment, options: RateEstimateOptions.new, debug: false)\n rate_request_xml = SerializeRateRequest.call(shipment: shipment, login: login, options: options)\n request = build_request(api: :rates, xml: rate_request_xml, debug: debug)\n client.post(request).bind do |response|\n ParseRateResponse.call(response: response, request: request, shipment: shipment, options: options)\n end\n end",
"title": ""
},
{
"docid": "589f5b011f1973796e76bd9fd4fabf5b",
"score": "0.57486784",
"text": "def index\n @shipment_details = ShipmentDetail.all\n end",
"title": ""
},
{
"docid": "2c60904c9cb76182034680d71740d916",
"score": "0.57422745",
"text": "def index\n @shipments = Shipment.scopied.page(params[:page]).per(30).order('created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @shipments }\n end\n end",
"title": ""
},
{
"docid": "3800c5f96b278dc43f571633d9fe79d9",
"score": "0.5741284",
"text": "def rates\n fail_if_rates_missing\n @rates\n end",
"title": ""
},
{
"docid": "9c37d6fe310e6ef9bc1e929632551b74",
"score": "0.57235485",
"text": "def ssp_rates\n [\n {min: Date.parse(\"6 April 2011\"), max: Date.parse(\"5 April 2012\"), ssp_weekly_rate: 81.60},\n {min: Date.parse(\"6 April 2012\"), max: Date.parse(\"5 April 2013\"), ssp_weekly_rate: 85.85},\n {min: Date.parse(\"6 April 2013\"), max: Date.parse(\"5 April 2014\"), ssp_weekly_rate: 86.70},\n {min: Date.parse(\"6 April 2014\"), max: Date.parse(\"5 April 2015\"), ssp_weekly_rate: 87.55}\n ]\n end",
"title": ""
},
{
"docid": "c33a57c1bbab5fb9cfb347077e4b99da",
"score": "0.5704358",
"text": "def index\n @shipments = Shipment.all\n end",
"title": ""
},
{
"docid": "c33a57c1bbab5fb9cfb347077e4b99da",
"score": "0.5704358",
"text": "def index\n @shipments = Shipment.all\n end",
"title": ""
},
{
"docid": "c33a57c1bbab5fb9cfb347077e4b99da",
"score": "0.5704358",
"text": "def index\n @shipments = Shipment.all\n end",
"title": ""
},
{
"docid": "c33a57c1bbab5fb9cfb347077e4b99da",
"score": "0.5704358",
"text": "def index\n @shipments = Shipment.all\n end",
"title": ""
},
{
"docid": "c33a57c1bbab5fb9cfb347077e4b99da",
"score": "0.5704358",
"text": "def index\n @shipments = Shipment.all\n end",
"title": ""
},
{
"docid": "c33a57c1bbab5fb9cfb347077e4b99da",
"score": "0.5704358",
"text": "def index\n @shipments = Shipment.all\n end",
"title": ""
},
{
"docid": "3dc67cde659a984b0e7ffcba43f726f5",
"score": "0.57039654",
"text": "def rate_estimate(params)\n if @international\n shipment = Element.new 'IntlShipment'\n shipment.attributes['action'] = 'RateEstimate'\n shipment.attributes['version'] = '1.0'\n \n credentials = Element.new 'ShippingCredentials'\n key = Element.new 'ShippingKey'\n key.text = params[:international_shipping_key]\n account = Element.new 'AccountNbr'\n account.text = params[:account_num]\n\n credentials << key\n credentials << account\n shipment << credentials\n\n shipment_details = Element.new 'ShipmentDetail'\n ship_date = Element.new 'ShipDate'\n ship_date.text = date(params[:date])\n shipment_details << ship_date\n\n service = Element.new 'Service'\n service_code = Element.new 'Code'\n service_code.text = service_code(params[:service_code])\n service << service_code\n shipment_details << service\n\n shipment_type = Element.new 'ShipmentType'\n type_code = Element.new 'Code'\n type_code.text = shipment_code(params[:shipment_code])\n shipment_type << type_code\n shipment_details << shipment_type\n\n weight = Element.new 'Weight'\n weight.text = weight(params[:weight], 'P')\n shipment_details << weight\n\n content_description = Element.new 'ContentDesc'\n content_description.text = 'Computer Parts'\n shipment_details << content_description\n\n shipment << shipment_details\n\n dutiable = Element.new 'Dutiable'\n dutiable_flag = Element.new 'DutiableFlag'\n dutiable_flag.text = 'Y'\n dutiable << dutiable_flag\n\n customs_value = Element.new 'CustomsValue'\n customs_value.text = '100'\n dutiable << customs_value\n shipment << dutiable\n\n billing = Element.new 'Billing'\n party = Element.new 'Party'\n party_code = Element.new 'Code'\n party_code.text = 'S'\n party << party_code\n billing << party\n duty_payment_type = Element.new 'DutyPaymentType'\n duty_payment_type.text = 'S'\n billing << duty_payment_type\n shipment << billing\n\n receiver = Element.new 'Receiver'\n address = Element.new 'Address'\n street = Element.new 'Street'\n street.text = params[:to_street]\n address << street\n city = Element.new 'City'\n city.text = params[:to_city]\n address << city\n state = Element.new 'State'\n state.text = params[:to_state]\n address << state\n country = Element.new 'Country'\n country.text = params[:to_country]\n address << country\n postal_code = Element.new 'PostalCode'\n postal_code.text = params[:to_zip]\n address << postal_code\n receiver << address\n\n shipment << receiver\n else\n # <Shipment action=\"RateEstimate\" version=\"1.0\">\n shipment = Element.new \"Shipment\"\n shipment.attributes[\"action\"] = \"RateEstimate\"\n shipment.attributes[\"version\"] = \"1.0\"\n\n # <ShippingCredentials>\n # <ShippingKey>key</ShippingKey> \n # <AccountNbr>number</AccountNbr>\n # </ShippingCredentials>\n credentials = Element.new \"ShippingCredentials\"\n\n key = Element.new \"ShippingKey\"\n key.text = params[:shipping_key] \n account = Element.new \"AccountNbr\"\n account.text = params[:account_num] \n\n credentials << key\n credentials << account\n shipment << credentials\n\n # <ShipmentDetail>\n # <ShiptDate>date</ShipDate>\n shipment_detail = Element.new \"ShipmentDetail\"\n ship_date = Element.new \"ShipDate\" \n ship_date.text = date(params[:date])\n shipment_detail << ship_date\n\n # TODO: Implement SAT and 1030 services\n\n # <Service>\n # <Code>code</Code>\n # </Service>\n service = Element.new \"Service\"\n service_code = Element.new \"Code\"\n service_code.text = service_code(params[:service_code])\n service << service_code\n\n shipment_detail << service\n\n # <ShipmentType>\n # <Code>code</Code>\n # </ShipmentType>\n shipment_type = Element.new \"ShipmentType\"\n shipment_type_code = Element.new \"Code\"\n shipment_type_code.text = shipment_code(params[:shipment_code])\n shipment_type << shipment_type_code\n shipment_detail << shipment_type\n\n # <Weight>weight</Weight>\n weight = Element.new \"Weight\"\n weight.text = weight(params[:weight], params[:shipment_code])\n\n # </ShipmentDetail> \n shipment_detail << weight\n\n shipment << shipment_detail\n\n # <Billing>\n # <Party>\n # <Code>S</Code>\n # </Party>\n # </Billing>\n billing = Element.new \"Billing\"\n billing_party = Element.new \"Party\"\n billing_party_code = Element.new \"Code\"\n\n # Since we're just doing some quick calulations we don't want to be\n # worrying about who's gonna send the package. Just make the calulations \n # assuming the sender pays for the shipping.\n billing_party_code.text = \"S\"\n\n billing << billing_party << billing_party_code\n\n shipment << billing\n\n # <Receiver>\n # <Address>\n # <State>state</State>\n # <Country>country</Country>\n # <PostalCode>code</PostalCode>\n # </Address>\n # </Receiver>\n receiver = Element.new \"Receiver\"\n receiver_addr = Element.new \"Address\"\n receiver_state = Element.new \"State\"\n receiver_country = Element.new \"Country\"\n receiver_zipcode = Element.new \"PostalCode\"\n\n receiver_state.text = state(params[:to_state])\n receiver_country.text = \"US\"\n receiver_zipcode.text = zip_code(params[:to_zip])\n\n receiver_addr << receiver_state\n receiver_addr << receiver_country\n receiver_addr << receiver_zipcode\n receiver << receiver_addr\n\n shipment << receiver\n end\n\n root = @xml.elements[\"eCommerce\"]\n root.add shipment\n end",
"title": ""
},
{
"docid": "de19a1f750a17fcd2d97970ea47626dc",
"score": "0.5696072",
"text": "def ups_rates\n ups = ActiveShipping::UPS.new(login: UPS_LOGIN, password: UPS_PASSWORD, key: UPS_KEY)\n response = ups.find_rates(origin, destination, package)\n response.rates.each do |rate|\n rates << Rate.create(shipment_id: id, service_name: rate.service_name, total_price: rate.total_price)\n end\n end",
"title": ""
},
{
"docid": "32a1e732d94e7c8bb15b8a4ba6ecaafd",
"score": "0.56948507",
"text": "def shipping_info (to_zip_code, weight)\r\n \r\n initialize();\r\n \r\n #Shipment Info Start\r\n \r\n packages = [ Package.new( weight * 16, # weight in ounce = LB *16\r\n [10,5,4], # in Inches \r\n :units => :imperial) \r\n ]\r\n\r\n origin = Location.new( :country => 'US',\r\n :zip => @FROM_ZIP_CODE)\r\n\r\n destination = Location.new( :country => 'US',\r\n :zip => to_zip_code)\r\n #Shipment Info End\r\n \r\n # Fedex Info Start\r\n \r\n fedex = FedEx.new(:key => @FEDEX_KEY,\r\n :password => @FEDEX_PASSWORD,\r\n :account => @FEDEX_ACCOUNT_NUMBER,\r\n :login => @FEDEX_METER,\r\n :test => @FEDEX_TESTMODE\r\n )\r\n fedex_rates = {}\r\n \r\n begin \r\n\r\n fedex_response = fedex.find_rates(origin, destination, packages)\r\n\r\n #fedex_transit_time = get_fedex_transit_time(@FROM_ZIP_CODE, to_zip_code, weight)\r\n\r\n fedex_rates = fedex_response.rates.sort_by(&:price).collect {|rate| rate.delivery_date == nil ? [\"Carrier\" => rate.carrier, \"Code\" => rate.service_name, \"Price\" => rate.price.to_f/100, \"Transit Time\" => get_fedex_transit_time(@FROM_ZIP_CODE, to_zip_code, weight)] : [\"Carrier\" => rate.carrier, \"Code\" => rate.service_name, \"Price\" => rate.price.to_f/100, \"Delivery On\" => rate.delivery_date]} \r\n\r\n rescue Exception => e\r\n if (e.message == 'ERROR - 0105: General Error')\r\n puts 'Fedex Service is temporary not available'\r\n end\r\n end\r\n # Fedex Info End\r\n \r\n #UPS Info Start\r\n \r\n ups_rates = {}\r\n \r\n begin\r\n \r\n ups = ActiveMerchant::Shipping::UPS.new(:login => @UPS_USER_ID, :password => @UPS_PASSWORD, :key => @UPS_ACCESS_LICENSE_NUMBER, :test => @UPS_TESTMODE)\r\n \r\n response = ups.find_rates(origin, destination, packages)\r\n \r\n #ups_ground_transit_time = get_ups_ground_transit_time(from_zip_code, to_zip_code, weight)\r\n \r\n ups_rates = response.rates.collect {|rate| rate.delivery_date == nil ? [\"Carrier\" => rate.carrier, \"Code\" => rate.service_name, \"Price\" => rate.price.to_f/100, \"Transit Time\" => get_ups_ground_transit_time(@FROM_ZIP_CODE, to_zip_code, weight) ] : [\"Carrier\" => rate.carrier, \"Code\" => rate.service_name, \"Price\" => rate.price.to_f/100, \"Delivery On\" => rate.delivery_date]}\r\n \r\n rescue Exception => e\r\n puts e.message\r\n end\r\n \r\n #UPS Info End\r\n \r\n #USPS Start\r\n \r\n #USPS End\r\n \r\n #OUTPUT\r\n \r\n output = []\r\n \r\n puts output = [fedex_rates, ups_rates]\r\n \r\n\r\n end",
"title": ""
},
{
"docid": "40e7a08e84337c031e68c254342ea5d9",
"score": "0.5687654",
"text": "def shipping\n set_title('Shipping rates')\n @shipping_types = OrderShippingType.find(:all)\n end",
"title": ""
},
{
"docid": "d5c024d7ee4c746207220b4c7eb2228a",
"score": "0.5679841",
"text": "def shipping_rate(address, options={})\n shipping_subtotal_amount = options[:subtotal_amount] || subtotal_cart\n rate = ShippingRate.where(:system => current_system, :\"price_min_#{current_currency}\".lte => shipping_subtotal_amount, :\"price_max_#{current_currency}\".gte => shipping_subtotal_amount, :zone_or_country => address.us? ? FedexZone.get_zone_by_address(address).try(:to_s) : address.country).first\n if rate.blank?\n msg = if is_sizzix_us? && !address.us?\n \"Sizzix.com only ships to U.S addresses. Please change your shipping address, or place your order on sizzix.co.uk\"\n elsif is_sizzix_uk? && address.us?\n \"Sizzix.co.uk does not ship to U.S addresses. Please change your shipping address, or place your order on sizzix.com\"\n else\n 'Please try again later.'\n end\n raise \"Unable to calculate shipping. #{msg}\"\n end\n @rates = []\n standard = Shippinglogic::FedEx::Rate::Service.new\n standard.name = standard.type = \"STANDARD\"\n standard.rate = rate.percentage ? (shipping_subtotal_amount * rate.send(\"standard_rate_#{current_currency}\")/100.0).round(2) : rate.send(\"standard_rate_#{current_currency}\")\n @rates << standard\n unless rate.send(\"rush_rate_#{current_currency}\").blank?\n rush = Shippinglogic::FedEx::Rate::Service.new\n rush.name = rush.type = \"RUSH\"\n rush.rate = rate.percentage ? (shipping_subtotal_amount * rate.send(\"rush_rate_#{current_currency}\")/100.0).round(2) : rate.send(\"rush_rate_#{current_currency}\")\n @rates << rush\n end\n @rates\n end",
"title": ""
},
{
"docid": "f376493e09f8d0f2b11f67e440359c5e",
"score": "0.56715417",
"text": "def booking_dates\n result = []\n self.bookings.each do |booking|\n if booking.state == \"paid\"\n demand = (booking.start_datetime..booking.end_datetime).to_a\n result += demand\n end\n end\n result\n end",
"title": ""
},
{
"docid": "5aa98624a5ad19b0354cb9f4f8bac2a6",
"score": "0.56679416",
"text": "def index\n @shipments = Shipment.all\n end",
"title": ""
},
{
"docid": "af1a3cbb4a6df338a2efff24e3a39eff",
"score": "0.56675386",
"text": "def shipping_json\n render :json => { :error => 'Not logged in.' } and return if !logged_in?\n render :json => { :error => 'No shippable items.' } and return if [email protected]_shippable_items?\n render :json => { :error => 'Empty shipping address.' } and return if @invoice.shipping_address.nil? \n \n @invoice.calculate\n \n #ops = @invoice.invoice_packages \n #if params[:recalculate_invoice_packages] || ops.count == 0\n # # Remove any invoice packages \n # LineItem.where(:invoice_id => @invoice.id).update_all(:invoice_package_id => nil)\n # InvoicePackage.where(:invoice_id => @invoice.id).destroy_all \n # \n # # Calculate what shipping packages we'll need \n # InvoicePackage.create_for_invoice(@invoice)\n #end\n\n # Now get the rates for those packages \n rates = ShippingCalculator.rates(@invoice) \n render :json => rates \n end",
"title": ""
},
{
"docid": "84aa2f98d7877fe8e8e5d59157f6058c",
"score": "0.5658942",
"text": "def request_with_dates(from, to)\n response = request_shipment_notice_xml(xml: DatesRequest.new(from, to).to_xml)\n process_response(response)\n end",
"title": ""
},
{
"docid": "1643d3053700af3b5457e5ebd0e21c21",
"score": "0.56515664",
"text": "def get_by_startDate_endDate(startDate, endDate)\n self.class.get(\"/aldebaran-goodsreceivednotes/goodsreceivednotes/items?startDate=#{startDate}&endDate=#{endDate}\", :basic_auth => @auth)\n end",
"title": ""
},
{
"docid": "bc89cc4e0db909d2e919843d60c77d21",
"score": "0.5629126",
"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": "50537f28529df86042ea8ee3d0a95dd9",
"score": "0.5606502",
"text": "def download_rates(as_of_date)\n date_str = as_of_date.strftime \"%Y-%m-%d\"\n url = \"http://openexchangerates.org/api/historical/#{date_str}.json?app_id=51b534fba001480d989ae03c571a7166\"\n request = Net::HTTP::Get.new(url)\n net = Net::HTTP.new(\"openexchangerates.org\", 80)\n net.use_ssl = false\n net.set_debug_output STDOUT \n net.read_timeout = 3\n net.open_timeout = 3\n response = net.start do |http|\n http.request(request)\n end\n response.body\n end",
"title": ""
},
{
"docid": "0a6a2286ccec5d688bf364e1a32ba894",
"score": "0.5605394",
"text": "def all_rates\n session = Patron::Session.new\n session.timeout = 30000 # 10 secs\n session.connect_timeout = 2000 # 2 secs\n\n ExchangeRatesGenerator.logger.info \"Retrieving exchange rates from #{source}...\"\n\n http_response = session.get(source)\n\n if ['404', '405', '406', '410'].include?(http_response.status)\n # Not Found, auth failure, etc. Some form of it wasn't there.\n raise Errors::NotFoundError, \"The exchange rate source file seems to be unavailable\"\n elsif !['1', '2'].include?(http_response.status.to_s[0..0])\n # Other non-specific failures.\n raise Errors::UnexpectedError, \"Error while making a request to #{source}\\nResponse: #{http_response.inspect}\"\n end\n\n convert_to_exchange_rate_hash(http_response.body)\n end",
"title": ""
},
{
"docid": "d32be5bc768880ac1358833b3ab8edf4",
"score": "0.56039846",
"text": "def index\n @shipments = @order.shipments\n respond_with(@shipments) do |format|\n format.html\n format.json { render :json => @shipments }\n end\n \n end",
"title": ""
},
{
"docid": "37d220fe9b7e0b2047528bb54f668676",
"score": "0.5591367",
"text": "def get_rates(origin, destination, items)\n \n HTTPI.adapter = :curb\n client = Savon.client(\n # wsdl: \"https://webservices.purolator.com/EWS/V1/Estimating/WSDLs/EstimatingService.wsdl\", \n namespace: \"http://purolator.com/pws/service/v1\", \n endpoint: self.get_endpoint,\n basic_auth:self.get_key,\n env_namespace: \"soap\",\n log: !Rails.env.production?,\n ssl_verify_mode: :none,\n soap_header: { \n \"RequestContext\"=>\n {\n Version: \"1.3\", \n Language: \"en\", \n GroupID: \"xxx\", \n RequestReference: \"Rating Example\"\n }\n }\n )\n\n xml_message = build_xml(origin, destination, items)\n \n response = client.call(\n :get_quick_estimate, \n# message: message,\n soap_action: \"http://purolator.com/pws/service/v1/GetQuickEstimate\",\n xml: xml_message\n ) \n res = response.hash\n error = false\n error_msg = \"\"\n unless ( res[:envelope][:body][:get_quick_estimate_response][:response_information][:errors].nil?)\n error_msg = res[:envelope][:body][:get_quick_estimate_response][:response_information][:errors][:error][:description]\n error = true\n end\n if (error)\n #return an error array\n \n return [ {\"service_name\" => \"ERROR:\" + error_msg.to_s, 'service_code'=> error_msg, 'total_price' =>0.0, 'currency' => \"CAD\"} ]\n else\n rates = res[:envelope][:body][:get_quick_estimate_response][:shipment_estimates][:shipment_estimate] \n # rates should be in cents\n return_array = rates.collect{ |service| {\"service_name\" => service[:service_id], 'service_code'=> service[:service_id], 'total_price' => service[:total_price].to_f*100, 'currency' => \"CAD\"} }\n end\n return_array\n end",
"title": ""
},
{
"docid": "fa0e337c0f7185b54868404c338686f0",
"score": "0.5576898",
"text": "def dates\n @booking = Booking.new(booking_params)\n @from = @shuttle.shuttle_cities.find(params[:booking][:from_id])\n @to = @shuttle.shuttle_cities.find(params[:booking][:to_id])\n\n @depart_dates = []\n @return_dates = []\n\n if @from != @to\n\n passengers = @booking.private_shuttle? ? 11 : @booking.passengers\n\n @depart_dates = @shuttle.dates_for_journey(@from, @to, passengers)\n if @booking.round_trip\n date_range = @booking.depart_date ? (@booking.depart_date + 1)..(@booking.depart_date + 12.months) : Date.today..12.months.from_now\n @return_dates = @shuttle.dates_for_journey(@to, @from, passengers)\n end\n end\n end",
"title": ""
},
{
"docid": "4c1ee0ace8d9a98b8345d2a40967b175",
"score": "0.55643934",
"text": "def get_recurring_payins\n\n end",
"title": ""
},
{
"docid": "3e3dff36e4964c63f71885849dbed9d1",
"score": "0.55619246",
"text": "def rates_from_response_node(xml, shipment, options)\n xml.xpath(PACKAGE_NODE_XPATH).each_with_object({}) do |package_node, result|\n package_id = package_node['ID']\n corresponding_package = shipment.packages[package_id.to_i]\n package_options = options.options_for_package(corresponding_package)\n # There should always be a package in the original shipment that corresponds to the package ID\n # in the USPS response.\n raise BoxNotFoundError if corresponding_package.nil?\n\n result[corresponding_package] = package_node.xpath(SERVICE_NODE_NAME).map do |service_node|\n ParsePackageRate.call(service_node, corresponding_package, package_options)\n end\n end\n end",
"title": ""
},
{
"docid": "8493f577048d5d46fc5088d5dfe27baa",
"score": "0.55583036",
"text": "def shipping_method\n shipping_rate.shipping_method\n end",
"title": ""
},
{
"docid": "a3ad6ec41d17f973f4e7289831c97377",
"score": "0.55487525",
"text": "def booked_dates\n @booked_dates = []\n\n self.reservations.each do |reserved|\n reserved.start_date.upto(reserved.end_date) do |date|\n @booked_dates << date.strftime(\"%m-%d-%Y\") end\n end\n @booked_dates\n end",
"title": ""
},
{
"docid": "08cb5a10f062bbef20cf050340224c03",
"score": "0.5539243",
"text": "def test_get_dates\n ExchangeDate.create({:date => Date.new(2015, 12, 05), :rates => [{:currency => 'USD', :rate => '1.5678'}, {:currency => 'GBP', :rate => '6.6789'}]})\n ExchangeDate.create({:date => Date.new(2015, 12, 06), :rates => [{:currency => 'USD', :rate => '1.5678'}, {:currency => 'GBP', :rate => '6.6789'}]})\n dates = ExchangeDate.get_dates\n assert_equal(dates, [Date.new(2016, 1, 1), Date.new(2015, 12, 06), Date.new(2015, 12, 05)])\n end",
"title": ""
},
{
"docid": "2dc3706ab3cfdc4bc18849aa4606f7e4",
"score": "0.5515852",
"text": "def get_receipt_call(start_date, end_date, options = {})\n if end_date.to_datetime.utc?\n end_date = ( end_date ).to_datetime\n else \n end_date = ( end_date ).to_datetime.in_time_zone 'UTC' # missing txns\n end\n \n start_date = (start_date.to_datetime.beginning_of_day).strftime(\"%FT%T\")\n end_date = (end_date).strftime(\"%FT%T\")\n \n options = {\n :use_sell_date => false,\n :per_page => 50,\n :current_page => 1\n }.merge(options)\n \n request = build_receipt_request(start_date, end_date, options)\n response = post_xml(request)\n \n \n receipts = Receipt.parse(response)\n wrap_array_with_pagination(receipts, response, options[:current_page], options[:per_page])\n end",
"title": ""
},
{
"docid": "f43ab64effe3f966610c5d3c0969f385",
"score": "0.55097806",
"text": "def shipping_quote\n shipper = MySettings.shipper\n if !shipper.blank?\n # Create packages array containing a package of each order item. (What to do with multiples of the same item?)\n packages = []\n self.line_items.each do |item|\n product = item.product\n for i in (1..item.quantity)\n packages.push( Package.new(\n product.weight,\n [product.width, product.height, product.depth],\n :value => product.price\n )\n )\n end\n end\n\n # Set up Origin and Destination\n origin = Location.new(\n :country => MySettings.origin_country,\n :province => MySettings.origin_province,\n :city => MySettings.origin_city,\n :postal_code => MySettings.origin_postal\n )\n add = self.shipping_address\n destination = Location.new(\n :country => add.country.code,\n :province => add.province.title,\n :city => add.city,\n :postal_code => add.postal\n )\n\n # Run functions to get cost estimates\n shipper = \"ActiveMerchant::Shipping::#{MySettings.shipper.underscore.parameterize('_').camelize}\".constantize.new(Forge::Settings[Rails.env.to_sym][MySettings.shipper.underscore.parameterize(\"_\").to_sym])\n begin\n response = shipper.find_rates(origin, destination, packages)\n # Store all rates, order by price. Return cheapest rate.\n rates = response.rates.sort_by(&:price).collect {|rate| {:service => rate.service_name, :price => rate.price/100.0}}\n rescue ActiveMerchant::Shipping::ResponseError => e\n # Error response\n rates = nil\n end\n else\n #No shipper has been defined\n end\n\n return rates\n end",
"title": ""
},
{
"docid": "8ce1f7a60e2a1e0bfbb0b0e5199e0e1a",
"score": "0.54907143",
"text": "def index\n @shipping_methods = ShippingMethod.all\n end",
"title": ""
},
{
"docid": "fac9f8dfdf9f1d2900309d8d9ba205e0",
"score": "0.5487055",
"text": "def read_rates(date = nil)\n if date\n date = date.is_a?(String) ? date : date.strftime('%F')\n date = nil if Date.parse(date) == Date.today\n end\n @rates = parse_result(read_url(date))\n @rates\n end",
"title": ""
},
{
"docid": "eabfef5ca468d4536e87db41e75676c6",
"score": "0.54793864",
"text": "def shipping_rates(items = nil)\n items ||= OrderItem.order_items_in_cart(self.id)\n rates = items.inject([]) do |rates, item|\n rates << item.shipping_rate if item.shipping_rate.individual? || !rates.include?(item.shipping_rate)\n rates\n end\n end",
"title": ""
},
{
"docid": "b0eb292711c9659693a23903a737e0c4",
"score": "0.5479102",
"text": "def retrieve_rates\n response = HTTParty.get(\n source_url,\n headers: { 'Authorization' => \"Bearer #{access_key}\" },\n ssl_version: service_ssl_version\n )\n response.body\n rescue HTTParty::Error, SocketError => e\n raise e if raise_on_failure\n [{}]\n end",
"title": ""
},
{
"docid": "53c6dddeb4357ea0c9565a44a61d7029",
"score": "0.5474663",
"text": "def tax_rates_by_postal_code(options={}) path = \"/api/v2/taxrates/bypostalcode\"\r\n get(path, options) end",
"title": ""
},
{
"docid": "1ff9d84fdeb9ec184037ad3be200e51b",
"score": "0.5467982",
"text": "def period\n if shipping_method.try(:boxberry?) && shipment.present?\n Boxberry::API::get_delivery_period( shipment.order.try(:ship_address).try(:zipcode), \n shipment.inventory_units.joins(:variant).sum(:weight) )\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "ab5b802048ab1e88f9b613486946935b",
"score": "0.5454187",
"text": "def index\n @sno = 1\n all_return_rates\n # (Date.current + 330.minutes).strftime(\"%Y-%m-%d\")\n todaydate = Date.today # Time.zone.now + 330.minutes\n @from_date = todaydate - 7.days # 30.days\n @to_date = todaydate\n @return_url = request.original_url\n\n if params.key?(:from_date)\n from_date = Date.strptime(params[:from_date], '%Y-%m-%d')\n @from_date = from_date.to_date - 1.days # 30.days\n @to_date = from_date.to_date\n end\n \n @regenerate_ppo = \"Regenerate PPOS between #{@from_date} and #{@to_date}\"\n ppo_sales = SalesPpo.new\n @employeeorderlist = ppo_sales.sales_ppos_between_dates @from_date, @to_date\n\n @or_for_date = @to_date\n end",
"title": ""
},
{
"docid": "affee8a0f1cbdc449a658ade9876ded2",
"score": "0.54526114",
"text": "def index\n @order_shipments = OrderShipment.all\n end",
"title": ""
},
{
"docid": "357ed35b5efb9a26691d6009136346fa",
"score": "0.5451265",
"text": "def get_personal_rate_details(tariff, dg, exrate)\n rate = dg.rate(tariff.id)\n\n @arates = []\n @arates = Aratedetail.find(:all, :conditions => \"rate_id = #{rate.id} AND artype = 'minute'\", :order => \"price DESC\") if rate\n\n #check for custom rates\n @crates = []\n crate = Customrate.find(:first, :conditions => \"user_id = '#{session[:user_id]}' AND destinationgroup_id = '#{dg.id}'\")\n if crate && crate[0]\n @crates = Acustratedetail.find(:all, :condition => \"customrate_id = '#{crate[0].id}'\", :order => \"price DESC\")\n @arates = @crates if @crates[0]\n end\n if @arates[0]\n @arate_cur = Currency.count_exchange_prices({:exrate => exrate, :prices => [@arates[0].price.to_d]}) if @arates[0]\n end\n end",
"title": ""
},
{
"docid": "b82ffca4b285cccc313c08ebe03bfec0",
"score": "0.54393363",
"text": "def inventory_receipts\n # @delivery_orders = if current_user.has_non_spg_role?\n # Shipment.select(:id, :delivery_order_number, :delivery_date, :received_date, :quantity, :is_receive_date_changed).joins(:order_booking).where(\"received_date IS NULL\")\n # else\n # Shipment.select(:id, :delivery_order_number, :delivery_date, :received_date, :quantity, :is_receive_date_changed).joins(:order_booking).where(\"order_bookings.destination_warehouse_id = #{current_user.sales_promotion_girl.warehouse_id} AND received_date IS NULL\")\n # end\n @delivery_orders = Shipment.select(:id, :delivery_order_number, :delivery_date, :received_date, :quantity, :is_receive_date_changed).joins(:order_booking).where(\"order_bookings.destination_warehouse_id = #{current_user.sales_promotion_girl.warehouse_id} AND received_date IS NOT NULL\")\n end",
"title": ""
},
{
"docid": "6a732801b862f41db534c54ba623a2f4",
"score": "0.54314464",
"text": "def fetch_rates\n fetcher = Commands::RatesFetcher.new(credentials.code_partner)\n fetcher.call\n end",
"title": ""
},
{
"docid": "c51e4489ad543060fe4aa6ab6baa2ce7",
"score": "0.54307985",
"text": "def tax_rates_by_postal_code(options={}) path = \"/api/v2/taxrates/bypostalcode\"\n get(path, options, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "bb83900e18a400fe431f2a9cb74dcd6c",
"score": "0.5430564",
"text": "def get_supplier_payments0(fecha1,fecha2)\n @vouchers = SupplierPayment.where([\" company_id = ? AND fecha1 >= ? and fecha1<= ? \", self.id, \"#{fecha1} 00:00:00\",\"#{fecha2} 23:59:59\" ]).order(:id)\n return @vouchers \n end",
"title": ""
},
{
"docid": "d6f1e4915766de5f67c457bf720c0c1b",
"score": "0.5426832",
"text": "def paid_dates\n @paid_dates ||= PaymentsApi.paid_payments_dates(\n vrn: vrn,\n zone_id: zone_id,\n start_date: start_date.strftime(VALUE_DATE_FORMAT),\n end_date: end_date.strftime(VALUE_DATE_FORMAT)\n )\n end",
"title": ""
},
{
"docid": "863188ec54cb7eb2ca23e8426e13d9b8",
"score": "0.5424493",
"text": "def index\n @active_shipments = Shipment.includes(:shipment_statuses).active\n @completed_shipments = Shipment.includes(:shipment_statuses).done\n end",
"title": ""
},
{
"docid": "856424fdceefecb810a2b9b1dcae6c5f",
"score": "0.5417431",
"text": "def index\n @rad_repayments = Rad::Repayment.by_bond_id(params[:cor_bond_id]).order(\"repay_date DESC\")\n end",
"title": ""
},
{
"docid": "51192cc314a2443222ac3f099434d70d",
"score": "0.54153526",
"text": "def show\n @shipping_rate = ShippingRate.find(params[:id])\n \n respond_to do |format|\n format.html # show.rhtml\n end\n end",
"title": ""
},
{
"docid": "f8e32c49696211ff8eb4e56971f0a5fa",
"score": "0.5410561",
"text": "def index\n @order_arrival_dates = OrderArrivalDate.all\n end",
"title": ""
},
{
"docid": "fecd6ff3e9a9028b4841c4420974c497",
"score": "0.5406783",
"text": "def shipment_shipdate\n @shipment.created_at.to_date\n end",
"title": ""
},
{
"docid": "6876777b94c0b83cc8b74938ee2ab249",
"score": "0.53972816",
"text": "def orders_report(start_date, end_date, status, format, offset=0)\n rest_url = \"#{@api}/report/orders/detail/#{format}?startDate=#{start_date}&endDate=#{end_date}&status=#{status}&offset=#{offset}\"\n RestClient.get rest_url, @header\n end",
"title": ""
},
{
"docid": "6876777b94c0b83cc8b74938ee2ab249",
"score": "0.53972816",
"text": "def orders_report(start_date, end_date, status, format, offset=0)\n rest_url = \"#{@api}/report/orders/detail/#{format}?startDate=#{start_date}&endDate=#{end_date}&status=#{status}&offset=#{offset}\"\n RestClient.get rest_url, @header\n end",
"title": ""
},
{
"docid": "b915c3815a965d454fd33034dc9c8180",
"score": "0.539701",
"text": "def get_estimate_delivery_date_standard\n $tracer.trace(\"WebInStoreCommonDSL : #{__method__}, Line : #{__LINE__}\")\n current_date=DateTime.now\n current_date = current_date.strftime(\"%Y-%m-%d\")\n today = Date.parse(current_date)\n sunday=1\n saturday=1\n from_day=today+4\n\n if (from_day.wday==4)\n to_day=from_day+1+saturday+sunday\n else\n if (from_day.wday==5)\n to_day=from_day+2+saturday+sunday\n else\n if (from_day.wday==6)\n from_day=from_day+saturday+sunday\n to_day=from_day+2\n else\n if (from_day.wday==0)\n from_day=from_day+saturday+sunday\n to_day=from_day+2\n else\n to_day=from_day+2\n end\n end\n end\n end\n date_from=\"#{concat_date(from_day.mon)}/#{concat_date(from_day.mday)}\"\n date_to=\"#{concat_date(to_day.mon)}/#{concat_date(to_day.mday)}\"\n\n return date_from, date_to\n end",
"title": ""
},
{
"docid": "22367f0a8971dce9c25f2a1e9e10b8f2",
"score": "0.5396643",
"text": "def list_recurring_details(shopper_reference)\n RecurringService.new(:shopper => { :reference => shopper_reference }).list\n end",
"title": ""
},
{
"docid": "bfb2936b04a6c034a1dcde350a41cc3f",
"score": "0.53957605",
"text": "def download_tax_rates_by_zip_code(date, options={}) path = \"/api/v2/taxratesbyzipcode/download/#{date}\"\n get(path, options, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "59989bb6a2c56ef731ab815721eed267",
"score": "0.53930026",
"text": "def available_shipment\n\n sql = available_shipment_query\n shipment_count = sql.count\n\n Rails.logger.warn \"Found #{shipment_count} shipments, but expected 1: #{sql}\" if shipment_count > 1\n\n sql.order('created_at asc').first\n end",
"title": ""
},
{
"docid": "35405487b0b2836c9a76eac528d55c8e",
"score": "0.53904134",
"text": "def show_rates\n \n @get_rates = Updaterete.get_rates(params)\n render :layout=>\"gds\"\n end",
"title": ""
},
{
"docid": "dd62d8457ffafd6ac5713b0d969a9064",
"score": "0.5388477",
"text": "def show\n @array_datewise = fetch_data\n uri = URI(\"http://data.fixer.io/api/latest?access_key=90b760542e55ffc6a374fa98ca6f76a0&symbols=#{@conversion.target_currency}\")\n res = JSON.parse(Net::HTTP.get(uri))\n @current_rate = res['rates'][@conversion.target_currency.to_s]\n end",
"title": ""
},
{
"docid": "010f0bd68cfe5836bd690e13135f75b2",
"score": "0.5386799",
"text": "def get_latest_rates\n begin\n @response = self.class.get(\"/latest.json\")\n return @response[\"rates\"]\n rescue\n return {}\n end\n end",
"title": ""
},
{
"docid": "b3bf9887b998cb4eec35a8a49dda7440",
"score": "0.5384244",
"text": "def line_item_rates\n order.line_items.flat_map do |line_item|\n calculate_rates(line_item)\n end\n end",
"title": ""
},
{
"docid": "37010a8039d6f4a2d8cd25ca4a622114",
"score": "0.53775597",
"text": "def fedex_rate(address, options={})\n Rails.logger.info \"Getting Fedex rate for #{address.inspect}\"\n @fedex = Shippinglogic::FedEx.new(FEDEX_AUTH_KEY, FEDEX_SECURITY_CODE, FEDEX_ACCOUNT_NUMBER, FEDEX_METER_NUMBER, :test => false)\n @rates = @fedex.rate(:service_type => options[:service_type], :shipper_company_name => \"Ellison\", :shipper_streets => '25862 Commercentre Drive', :shipper_city => 'Lake Forest', :shipper_state => 'CA', :shipper_postal_code => \"92630\", :shipper_country => \"US\",\n :recipient_name => \"#{address.first_name} #{address.last_name}\", :recipient_company_name => address.company, :recipient_streets => \"#{address.address1} #{address.address2}\", :recipient_city => address.city, :recipient_postal_code => address.zip_code, :recipient_state => address.with_state? ? address.state : nil, :recipient_country => country_2_code(address.country), :recipient_residential => options[:residential],\n :package_weight => options[:weight], :rate_request_types => options[:request_type] || \"ACCOUNT\", :packaging_type => options[:packaging_type] || \"FEDEX_BOX\", :package_length => options[:package_length] || 12, :package_width => options[:package_width] || 12, :package_height => options[:package_height] || 12, :ship_time => options[:ship_time] || skip_weekends(Time.now, 3.days), :package_count => options[:package_count] || 1)\n raise \"unable to calculate shipping rates. please check your shipping address or call customer service to place an order.\" if @rates.blank?\n @rates\n end",
"title": ""
},
{
"docid": "1b4da72bd5615f73f7adf85d5fef4883",
"score": "0.537646",
"text": "def index\n @rates = Rate.at_month(@date)\n respond_with @rates\n end",
"title": ""
},
{
"docid": "30ce0d4bbec64778cfff8f53ac5228de",
"score": "0.5369579",
"text": "def get_rate_maps(display_date, full_rate)\n hash = PricingMap.rates_from_full(display_date, self.organization_id, full_rate)\n return_map = {\n \"federal_rate\" => Service.fix_service_rate(hash[:federal_rate]),\n \"corporate_rate\" => Service.fix_service_rate(hash[:corporate_rate]),\n \"other_rate\" => Service.fix_service_rate(hash[:other_rate]),\n \"member_rate\" => Service.fix_service_rate(hash[:member_rate])\n }\n return_map\n end",
"title": ""
},
{
"docid": "13fe1f3e8799784a9a0480e568c49ced",
"score": "0.5367457",
"text": "def download_tax_rates_by_zip_code(date, options={}) path = \"/api/v2/taxratesbyzipcode/download/#{date}\"\r\n get(path, options) end",
"title": ""
},
{
"docid": "e0d8b3abc5f0e52280c545c738b11efc",
"score": "0.5366371",
"text": "def purchase_order_report\n \n if params[\"from_date\"].present? and params[\"to_date\"].present?\n @purchase_order=JSON.parse RestClient.get $api_service+\"/send_mails/purchase_order_report?from_date=#{params[\"from_date\"]}&to_date=#{params[\"to_date\"]}&supplier_id=#{params[\"supplier_id\"]}\"\n else \n @purchase_order=JSON.parse RestClient.get $api_service+'/send_mails/purchase_order_report'\n end\n #@suppliers=JSON.parse RestClient.get $api_service+'/suppliers'\n end",
"title": ""
},
{
"docid": "6397b2351588a0c2328f52b90ce3fa37",
"score": "0.5366312",
"text": "def show\n @receivable = Receivable.find(params[:receivable_id])\n @receivable_shipment = @receivable.receivable_shipments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @receivable_shipment }\n end\n end",
"title": ""
}
] |
d66b4c5f2ac273f23487ab726a93ac79
|
DELETE /pitches/1 DELETE /pitches/1.json
|
[
{
"docid": "286ce3afd034ae077e62bc40f915b58c",
"score": "0.6664212",
"text": "def destroy\n @pitch.destroy\n respond_to do |format|\n format.html { redirect_to pitches_url, notice: 'Projeto destruído com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "0af354043041a2cd60d427a369516b6b",
"score": "0.7051979",
"text": "def destroy\n @pitch = Pitch.find(params[:id])\n @pitch.destroy\n\n respond_to do |format|\n format.html { redirect_to pitches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b1a17c1ee1af05c79fe156622df44818",
"score": "0.70384103",
"text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end",
"title": ""
},
{
"docid": "b445c184893647d3482f8fbc6a507a52",
"score": "0.6955599",
"text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end",
"title": ""
},
{
"docid": "2d0e23b55656937c773ea6fdac1c0334",
"score": "0.69495",
"text": "def destroy\n @pitch = Pitch.find(params[:id])\n @pitch.destroy\n\n respond_to do |format|\n format.html { redirect_to(pitches_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0223322a704cdeb2c5d0b6fc71048e7c",
"score": "0.6861689",
"text": "def destroy\n @pathway = Pathway.find(params[:id])\n @pathway.destroy\n\n respond_to do |format|\n format.html { redirect_to pathways_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3ed3ad2668c4be8e11c57ad01e4a939d",
"score": "0.67191434",
"text": "def destroy\n @pitch = Pitch.find(params[:id])\n @pitch.destroy\n\n respond_to do |format|\n format.html { redirect_to pitchs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "174b723f9e43bfa7501a9cdc389e4c1b",
"score": "0.6718376",
"text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end",
"title": ""
},
{
"docid": "0b24cbc6495df3923ea7679acbcd8deb",
"score": "0.6683316",
"text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend",
"title": ""
},
{
"docid": "c40235f4d5fa427bf84b2e2d41718e4d",
"score": "0.6654745",
"text": "def destroy\n @stitch = Stitch.find(params[:id])\n @stitch.destroy\n\n respond_to do |format|\n format.html { redirect_to stitches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "925d6a8535056e579213234526ae5e84",
"score": "0.6620617",
"text": "def destroy\n @pitch.destroy\n respond_to do |format|\n format.html { redirect_to pitches_url, notice: 'Pitch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "47a3c9c28e1fcd0fcae5ea58416b42bd",
"score": "0.65995616",
"text": "def delete(path)\n api :delete, path\n end",
"title": ""
},
{
"docid": "773e5d611adeb09776f9c841e1b876cc",
"score": "0.65624905",
"text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end",
"title": ""
},
{
"docid": "a45222ffe18dcf0ef2705baf7588734d",
"score": "0.653551",
"text": "def destroy\n @tooth = Tooth.find(params[:id])\n @tooth.destroy\n\n respond_to do |format|\n format.html { redirect_to tooths_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "23a0306e85c2846aff52f5eec403486e",
"score": "0.6497833",
"text": "def destroy\n @answer_switch.destroy\n respond_to do |format|\n format.html { redirect_to answer_switches_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0661ff25d0ad9c36635b228e8f772e3b",
"score": "0.6495118",
"text": "def destroy\n @telemetry = Telemetry.find(params[:id])\n #path = \"telemetries/IXV/#{@telemetry.database.version}/#{@telemetry.name}_#{@telemetry.version}\"\n delete = %x[rm -R #{@telemetry.path}]\n @telemetry.destroy\n respond_to do |format|\n format.html { redirect_to telemetries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9c8ef0b4313fef9d26c4290371bc530d",
"score": "0.64746064",
"text": "def delete!\n client.delete(:path => base_path)\n nil\n end",
"title": ""
},
{
"docid": "e3ea90f717278b79d8908e5b537926be",
"score": "0.6453739",
"text": "def delete(path)\n client.delete(\"/v1/#{encode_path(path)}\")\n return true\n end",
"title": ""
},
{
"docid": "59322e542e383fbb019450abd09e033c",
"score": "0.6441602",
"text": "def destroy\n @way.destroy\n respond_to do |format|\n format.html { redirect_to ways_url, notice: 'Маршрут успешно удален.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f63d95bfef02afc816b0ec3803fd8912",
"score": "0.6432757",
"text": "def destroy\n @the_switch.destroy\n respond_to do |format|\n format.html { redirect_to the_switches_url, notice: 'The switch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1f503713f8197ec47be81d517dab2736",
"score": "0.64326227",
"text": "def destroy\n @pokedb = Pokedb.find(params[:id])\n @pokedb.destroy\n\n respond_to do |format|\n format.html { redirect_to pokedbs_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6a19ba99f0d1f7225b5ed73fe068136d",
"score": "0.6430954",
"text": "def delete(path, params: {}, headers: {})\n request_json :delete, path, params, headers\n end",
"title": ""
},
{
"docid": "d2d392fb0adb0f27814e7174538a060f",
"score": "0.64294285",
"text": "def destroy\n @stitch.destroy\n respond_to do |format|\n format.html { redirect_to stitches_url }\n format.xml { head :no_content }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "75a785bddc2252b3dfe08070dcb44399",
"score": "0.64162654",
"text": "def delete(args)\n if args[:json]\n post(args.merge(method: :delete))\n else\n get(args.merge(method: :delete))\n end\n end",
"title": ""
},
{
"docid": "bcd67aa454351acbab99831d0695a79c",
"score": "0.64137995",
"text": "def destroy\n @rhythm.destroy\n respond_to do |format|\n format.html { redirect_to rhythms_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e6c97514569f9aa69c6ceba65b8a072c",
"score": "0.64082897",
"text": "def destroy\n @light_switch.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'Switch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8934cef19b65ce06b916d664091c7174",
"score": "0.6398088",
"text": "def destroy\n @paddle = Paddle.find(params[:id])\n @paddle.destroy\n\n respond_to do |format|\n format.html { redirect_to paddles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7290f0e6fbc8eb802f96850a60c2d19f",
"score": "0.63912773",
"text": "def destroy\n @snake = Snake.find(params[:id])\n @snake.destroy\n\n respond_to do |format|\n format.html { redirect_to snakes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f980177937a8bc2da13355e3395f5c2d",
"score": "0.6386749",
"text": "def destroy\n # delete a specific thing\n end",
"title": ""
},
{
"docid": "9ce52ea3ca38bcdbf0d46fb6a877ce93",
"score": "0.6386745",
"text": "def destroy\n @hypocrite = Hypocrite.find(params[:id])\n @hypocrite.destroy\n\n respond_to do |format|\n format.html { redirect_to hypocrites_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f8158543f8be0ea72e1431f32617f5e",
"score": "0.63831425",
"text": "def destroy\n @stipple.destroy\n respond_to do |format|\n format.html { redirect_to stipples_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c5a5c7b0eb437b2c3172008b2b99bc03",
"score": "0.63775074",
"text": "def destroy\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_racks_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.63738036",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "dcd92bcd99d20c0188cd1b70a11c3b67",
"score": "0.6371295",
"text": "def destroy\n @pitcher = Pitcher.find(params[:id])\n @pitcher.destroy\n\n respond_to do |format|\n format.html { redirect_to pitchers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3a00d8ea26ea5cbb1f2510c3bfea3e39",
"score": "0.6364154",
"text": "def destroy\n Feedback.where(pitch_id: @pitch.id).destroy_all\n\n @pitch.destroy\n respond_to do |format|\n format.html { redirect_to pitches_url, notice: 'Pitch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0387aa3c568d857184e97a214e580a14",
"score": "0.635861",
"text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end",
"title": ""
},
{
"docid": "00c90bc63b0302afbbc4b2979ae20b57",
"score": "0.6357063",
"text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end",
"title": ""
},
{
"docid": "ec94400f30de363b2660ab6e0c84ada7",
"score": "0.63522166",
"text": "def destroy\n @hole = Hole.find(params[:id])\n @hole.destroy\n\n respond_to do |format|\n format.html { redirect_to holes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b841f8bd5ae2e8a70ac0e4d47ce30a94",
"score": "0.6351125",
"text": "def destroy\n @side_hustle = SideHustle.find(params[:id])\n @side_hustle.destroy\n\n respond_to do |format|\n format.html { redirect_to side_hustles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c1cde2518cb592b6add14fe05ae1b37d",
"score": "0.6349273",
"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": "312d6003d1fa220c27f0c7be51b640a8",
"score": "0.634897",
"text": "def destroy\n @switch.destroy\n respond_to do |format|\n format.html { redirect_to switches_url, notice: \"Switch was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8cda52bddf607049b6783e034cc4d4a1",
"score": "0.634643",
"text": "def destroy\n @switch = Switch.find(params[:id])\n @switch.destroy\n\n respond_to do |format|\n format.html { redirect_to switches_path, :notice => 'Switch was sucessfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5bff5f0c75184c0a2770f43bd8d931bb",
"score": "0.6345451",
"text": "def destroy\n @ping = Ping.find(params[:id])\n @ping.destroy\n\n respond_to do |format|\n format.html { redirect_to pings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "18e2e510d42eb56b97f10b3cacac036c",
"score": "0.63441736",
"text": "def destroy\n @mumble = Mumble.find(params[:id])\n @mumble.destroy\n\n respond_to do |format|\n format.html { redirect_to mumbles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d4c39b634aa275aaa3ae8717a27094db",
"score": "0.6343182",
"text": "def destroy\n @pickline = Pickline.find(params[:id])\n @pickline.destroy\n\n respond_to do |format|\n format.html { redirect_to picklines_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b965aa2e76649b84623ed925811f4794",
"score": "0.63421047",
"text": "def delete(_path)\n end",
"title": ""
},
{
"docid": "167bacfa68653819506bf6fda97ebf73",
"score": "0.63349533",
"text": "def destroy\n @light.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9e094d640ad34a99e802dbab6291221b",
"score": "0.6332787",
"text": "def destroy\n @ping.destroy\n respond_to do |format|\n format.html { redirect_to(\n edit_recruiter_path(id: @ping.recruiter_id),\n notice: 'Ping was successfully destroyed.') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4cb8018c1a8a093a9a2dc5ee84f90297",
"score": "0.63327515",
"text": "def destroy\n @chemo_therapy = ChemoTherapy.find(params[:id])\n @chemo_therapy.destroy\n\n respond_to do |format|\n format.html { redirect_to chemo_therapies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "09839ae34313f956ebaa756a169a5176",
"score": "0.63258225",
"text": "def destroy\n @chapstick.destroy\n respond_to do |format|\n format.html { redirect_to chapsticks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "feb05fa712cede2232b7a79bf0cdeb56",
"score": "0.63238376",
"text": "def delete\n render json: Entry.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "5dd65d080651836e21cc61fc15b4fb91",
"score": "0.632352",
"text": "def destroy\n @thot = Thot.find(params[:id])\n @thot.destroy\n\n respond_to do |format|\n format.html { redirect_to thots_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7452c4d15daf08108aaa5a1b728adb31",
"score": "0.63232905",
"text": "def destroy\n @json.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "ba67ebd85114998e01be10599c8943ca",
"score": "0.6320667",
"text": "def delete(path)\n RestClient.delete request_base+path\n end",
"title": ""
},
{
"docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d",
"score": "0.6316892",
"text": "def delete\n client.delete uri\n end",
"title": ""
},
{
"docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d",
"score": "0.6316892",
"text": "def delete\n client.delete uri\n end",
"title": ""
},
{
"docid": "cbc56944ea25652cff40b0164bdbce0b",
"score": "0.6316661",
"text": "def destroy\n @pong = Pong.find(params[:id])\n @pong.destroy\n\n respond_to do |format|\n format.html { redirect_to pongs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f46ca21e1ec7e165874a0c631e71c960",
"score": "0.6314176",
"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": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.6310578",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.6310578",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "3830fb790533c084b828b73f7d29d322",
"score": "0.63082534",
"text": "def destroy\n @recycling_way.destroy\n respond_to do |format|\n format.html { redirect_to recycling_ways_url, notice: 'Recycling way was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1863036776f86c3860f125fb0d8dd82e",
"score": "0.63050103",
"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": "5c181505ac0deedddfba684db419e428",
"score": "0.6302104",
"text": "def delete\n render json: Own.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "5f840ae119fc85fc7b89046b097b08d8",
"score": "0.6300659",
"text": "def destroy\n @sockmonkey = Sockmonkey.find(params[:id])\n @sockmonkey.destroy\n\n respond_to do |format|\n format.html { redirect_to sockmonkeys_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6a86cf4ec744bc3ea9fd1b273059d43",
"score": "0.62978435",
"text": "def destroy\n @hypsometry = Hypsometry.find(params[:id])\n @hypsometry.destroy\n\n respond_to do |format|\n format.html { redirect_to hypsometries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c2f54ac72f8d2e3e81167ea03a821143",
"score": "0.628788",
"text": "def destroy\n @spectacle = Spectacle.find(params[:id])\n @spectacle.destroy\n\n respond_to do |format|\n format.html { redirect_to spectacles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "09f6303f18ce5612216026bdd448d644",
"score": "0.6283982",
"text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end",
"title": ""
},
{
"docid": "600506a9f1d90911d25af649841e68bf",
"score": "0.6282256",
"text": "def destroy\n @bottle = Bottle.find(params[:id])\n @bottle.destroy\n\n respond_to do |format|\n format.html { redirect_to bottles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85f54cf19c1b669da79b62a1be7dd843",
"score": "0.6280159",
"text": "def destroy\n Indicator.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to indicators_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5f93594d7970a5bb29d92a9db038db4c",
"score": "0.62792593",
"text": "def destroy\n @ultra_evil_witch = UltraEvilWitch.find(params[:id])\n @ultra_evil_witch.destroy\n\n respond_to do |format|\n format.html { redirect_to(ultra_evil_witches_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d37248e7b997579ad08b10bf215a602c",
"score": "0.62787914",
"text": "def destroy\n @buttle = Buttle.find(params[:id])\n @buttle.destroy\n\n respond_to do |format|\n format.html { redirect_to myadmin_buttles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "662478f4d0921c3602d083b5ac2372bb",
"score": "0.6276673",
"text": "def destroy\n @pick = Pick.find(params[:id])\n @pick.destroy\n\n respond_to do |format|\n format.html { redirect_to picks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "662478f4d0921c3602d083b5ac2372bb",
"score": "0.6276673",
"text": "def destroy\n @pick = Pick.find(params[:id])\n @pick.destroy\n\n respond_to do |format|\n format.html { redirect_to picks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "662478f4d0921c3602d083b5ac2372bb",
"score": "0.6276673",
"text": "def destroy\n @pick = Pick.find(params[:id])\n @pick.destroy\n\n respond_to do |format|\n format.html { redirect_to picks_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "274121f2de4248dfe7419934779af770",
"score": "0.62752956",
"text": "def destroy\n @broadside = Broadside.find(params[:id])\n @broadside.destroy\n\n respond_to do |format|\n format.html { redirect_to broadsides_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "817cc731f1501d9067014cdc5562ba75",
"score": "0.6272984",
"text": "def destroy\n @pinhole.destroy\n respond_to do |format|\n format.html { redirect_to pinholes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.62684566",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "f06b8341ff3776a7041a4e6ce5580df4",
"score": "0.6266304",
"text": "def destroy\n @twitch.destroy\n respond_to do |format|\n format.html { redirect_to twitches_url, notice: 'Twitch was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "64bd75af1aa8f200b5d15304057bb840",
"score": "0.6265222",
"text": "def destroy\n PolicyBrief.delete_hack(params[:id])\n\n respond_to do |format|\n format.html { redirect_to policy_briefs_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9f16024b7a8f54befe01b8172efb6573",
"score": "0.62592375",
"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": "22b4c24965b9b6b9b962155dcd68ccab",
"score": "0.62575334",
"text": "def destroy\n @exercise = Exercise.find(params[:id])\n File.unlink(@exercise.path)\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2b3748d7cf321a55ab3ad777ad275018",
"score": "0.62528527",
"text": "def destroy\n @lop_mon_hoc = LopMonHoc.find(params[:id])\n @lop_mon_hoc.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0b192bf6a9f0a10fe147c6909e198b57",
"score": "0.6250801",
"text": "def destroy\n @witcher.destroy\n respond_to do |format|\n format.html { redirect_to witchers_url, notice: 'Witcher was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1b4b996c0eb9e09732b637ca911ebccf",
"score": "0.6249886",
"text": "def destroy\n @ring = Ring.find(params[:id])\n @ring.destroy\n\n respond_to do |format|\n format.html { redirect_to rings_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9106867cee9e8775ba817195d3bc2020",
"score": "0.6249855",
"text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end",
"title": ""
},
{
"docid": "4e70e9c2b1f973b009d4f47a413c70d7",
"score": "0.6249426",
"text": "def delete(path)\n require 'dystio/commands/delete'\n Dystio::Commands::Delete.call(path, options)\n end",
"title": ""
},
{
"docid": "be66b3f0de082d8392338bdaa470ffb5",
"score": "0.62488467",
"text": "def destroy\n @hitchhiker = Hitchhiker.find(params[:id])\n @hitchhiker.destroy\n\n respond_to do |format|\n format.html { redirect_to hitchhikers_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9cb14f1d65d414aec1e90b4706219b74",
"score": "0.62456137",
"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": "3ccd2fbecbaa95071b33c865c59c07fc",
"score": "0.6242997",
"text": "def delete(*args)\n RubyKong::Request::Api.delete args[0]\n end",
"title": ""
},
{
"docid": "733b079dd5f50202f62fdac4b21f361c",
"score": "0.6242143",
"text": "def destroy\n @hq_switch = HqSwitch.find(params[:id])\n @hq_switch.destroy\n \n respond_to do |format|\n format.html { redirect_to(hq_switches_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "079fb3ab982dfc61f78ea75c0eabe762",
"score": "0.6241435",
"text": "def destroy\n @pitch.destroy\n redirect_to pitches_path, :notice => 'Pitch was successfully destroyed.'\n end",
"title": ""
},
{
"docid": "77c6d995d47726907fa130dfac5e04da",
"score": "0.62322223",
"text": "def destroy\n #@trip = Trip.find(params[:id])\n @trip.destroy\n\n respond_to do |format|\n format.html { redirect_to trips_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7ebe23c6fa8b3649035ebd7cb0ee6d5e",
"score": "0.62320864",
"text": "def destroy\n return if new_record?\n \n @api.delete \"/notes/#{shortcode_url}.json\"\n end",
"title": ""
},
{
"docid": "77c742322d16bbccac07ab52cc2f42db",
"score": "0.62301946",
"text": "def delete\n # TODO\n end",
"title": ""
},
{
"docid": "b8b1fcb64a4e0b3b61ca1d987c980647",
"score": "0.6229279",
"text": "def destroy\n @shuttle = Shuttle.find(params[:id])\n @shuttle.destroy\n\n respond_to do |format|\n format.html { redirect_to shuttles_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a7b8cf09df0fdc635b176cfae6bf09c3",
"score": "0.62279385",
"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": "d590117e238d391eff3f34d1e04b1014",
"score": "0.6226371",
"text": "def destroy\n @snipet = Snipet.find(params[:id])\n @snipet.destroy\n\n respond_to do |format|\n format.html { redirect_to snipets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "904a4a8e3e729f4022b67eeb88fdf53c",
"score": "0.62260264",
"text": "def destroy\n @pulse = Pulse.find(params[:id])\n @pulse.destroy\n\n respond_to do |format|\n format.html { redirect_to pulses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b9ec212f62402c26e0f73d4d5a7d4eca",
"score": "0.622297",
"text": "def _delete(path, isD2l = true, headers = {})\n headers[:content_type] = :json\n auth_uri = path\n auth_uri = create_authenticated_uri(path, 'DELETE') if isD2l == true\n RestClient.delete(auth_uri, headers)\nend",
"title": ""
},
{
"docid": "2675aa0e2ced04fc9c7de6fc57be6a59",
"score": "0.62202656",
"text": "def delete(path)\r\n fetch(:path => path, :method => 'DELETE')\r\n end",
"title": ""
},
{
"docid": "9b5dc6682c60f2d98091450a95a94d6f",
"score": "0.6219596",
"text": "def delete\n Client.delete(\"/kits/#{@id}\")\n end",
"title": ""
}
] |
b6b1600178046ca9cbc34e9194b36555
|
just a nicer alias for Ruby's own sleep
|
[
{
"docid": "f7221eddbbdefa3ee14a0c3d095917ee",
"score": "0.0",
"text": "def keep_going(duration)\n Kernel::sleep duration\n end",
"title": ""
}
] |
[
{
"docid": "2cdaf22be53fc159991d2d8017f8796c",
"score": "0.8376403",
"text": "def put_sleep(time)\r\n\tsleep(time)\r\nend",
"title": ""
},
{
"docid": "a22ad261bbc3fb758116529f95ba6f04",
"score": "0.82045156",
"text": "def sleep_example(seconds)\n\tputs \"From now\"\n\tp sleep(seconds)\n\tputs \"to now\"\nend",
"title": ""
},
{
"docid": "ff8b711058774989c68741831e696f4d",
"score": "0.8140146",
"text": "def sleep(seconds)\n sleep(seconds)\n end",
"title": ""
},
{
"docid": "c00214f4443ec3e7f82aabdea28d61c4",
"score": "0.80778295",
"text": "def sleep (sec)\n # Don't really sleep ;)\n end",
"title": ""
},
{
"docid": "19751bbd661931515c4a492e504c6b3a",
"score": "0.8071288",
"text": "def sleep\n end",
"title": ""
},
{
"docid": "caa8387fbc4c6a9acb8ee089240c6a3d",
"score": "0.7993313",
"text": "def sleep_test\n sleep(10)\n \"slept for 10 sec!\"\n end",
"title": ""
},
{
"docid": "b3cc4e23e617d1638f17335b1df0717f",
"score": "0.7892223",
"text": "def sleep\n Kernel.sleep(to_sec)\n end",
"title": ""
},
{
"docid": "c00b55c84928dd13c23cf43c417c18c9",
"score": "0.78838694",
"text": "def cmd_sleep(*args)\n\t\treturn if not (args and args.length == 1)\n\t\tRex::ThreadSafe.sleep(args[0].to_f)\n\tend",
"title": ""
},
{
"docid": "8a1f1afcf07acd2a919168fb2088b26b",
"score": "0.78609914",
"text": "def sleepy\n sleep(2)\nend",
"title": ""
},
{
"docid": "912e292c4b86a78bbfff7fc6a33a3eed",
"score": "0.7832771",
"text": "def sleeping\n end",
"title": ""
},
{
"docid": "912e292c4b86a78bbfff7fc6a33a3eed",
"score": "0.7832771",
"text": "def sleeping\n end",
"title": ""
},
{
"docid": "912e292c4b86a78bbfff7fc6a33a3eed",
"score": "0.7832771",
"text": "def sleeping\n end",
"title": ""
},
{
"docid": "1c4150540171ad9aac5fde00b506e4c2",
"score": "0.7813223",
"text": "def sleep\n sleep_after(0)\n end",
"title": ""
},
{
"docid": "8f18505c8ccf9fb77304743f0ee4dedd",
"score": "0.7777422",
"text": "def _sleep(time)\n sleep(time)\n end",
"title": ""
},
{
"docid": "c0fad516c32ed46966a7661ec3f90680",
"score": "0.7715046",
"text": "def countdown_with_sleep(number)\n sleep(number)\n puts \"I am asleep\"\nend",
"title": ""
},
{
"docid": "343554a876140a2d37c76c4c57777283",
"score": "0.75959605",
"text": "def sleep(seconds)\n java.lang.Thread.sleep(seconds * 1000)\nend",
"title": ""
},
{
"docid": "a25caf0b081559ce078bdfd5c0019101",
"score": "0.7565954",
"text": "def sleep=(value) @sleep = value; end",
"title": ""
},
{
"docid": "178ac2b769484f27bdff0f8d2b7ebacf",
"score": "0.7555585",
"text": "def countdown_with_sleep int\n sleep int\nend",
"title": ""
},
{
"docid": "881da6b6e150a8f7b2c55c15da1587c1",
"score": "0.7509139",
"text": "def msleep(msecs)\n @functions[__method__] ||= AU3_Function.new(\"Sleep\", 'L')\n @functions[__method__].call(msecs)\n end",
"title": ""
},
{
"docid": "6594d48a97206da299691d3b4c094c0c",
"score": "0.74743104",
"text": "def _sleep t, d = 0.2\r\n sleep t * (1 - d / 2 + d * Random.rand(1))\r\n end",
"title": ""
},
{
"docid": "2fe107a7b838b6616ddd472ce7c59fff",
"score": "0.74662286",
"text": "def sleep(seconds)\n @seconds_slept ||= 0\n @seconds_slept += seconds\n end",
"title": ""
},
{
"docid": "7414d2a5c1b5d020995357d6f06be571",
"score": "0.7431751",
"text": "def sleep_for(count)\n sleep count\n end",
"title": ""
},
{
"docid": "b130dd627eabd202148f120feb84ae21",
"score": "0.74064213",
"text": "def pause(value = 1)\n sleep value\nend",
"title": ""
},
{
"docid": "b130dd627eabd202148f120feb84ae21",
"score": "0.74064213",
"text": "def pause(value = 1)\n sleep value\nend",
"title": ""
},
{
"docid": "b130dd627eabd202148f120feb84ae21",
"score": "0.74064213",
"text": "def pause(value = 1)\n sleep value\nend",
"title": ""
},
{
"docid": "9aa2770e17d083acad7ea3cfcdacc4db",
"score": "0.7401238",
"text": "def sleep(_beats = nil)\n #This is a stub, used for indexing\nend",
"title": ""
},
{
"docid": "98fd0fa97f6bdbf689aee2d1f952c032",
"score": "0.73479205",
"text": "def wait_a_second(delay=0.3)\n sleep(delay)\nend",
"title": ""
},
{
"docid": "6502ba0d74fb91d801d27b016d2f2710",
"score": "0.73079354",
"text": "def sleep(delay)\n if delay < 1\n Kernel::sleep delay\n return\n end\n elapsed = 0 \n while !@terminate && elapsed < delay\n Kernel::sleep((delay - elapsed < 1) ? (delay - elapsed) : 1)\n elapsed = elapsed + 1 \n end\n end",
"title": ""
},
{
"docid": "f8fb396bb82b5039c0d8def6c11a99bc",
"score": "0.7292311",
"text": "def transit_to_sleeping\n sleep 1\n end",
"title": ""
},
{
"docid": "f5b9ea308b2520b208cfb68a21913887",
"score": "0.72775257",
"text": "def sleep(args={})\n fc = Wihajster::GCode.format_command(\"Sleep\", arguments)\n write_command(fc)\n end",
"title": ""
},
{
"docid": "566039d0d2d48f4bb09d5c6e1041e28a",
"score": "0.7231277",
"text": "def sleep(seconds)\n Kernel.sleep(seconds)\n end",
"title": ""
},
{
"docid": "e005b5b6d800cec196bf70e6c4d48385",
"score": "0.71893835",
"text": "def sleep\n log\n Kernel.sleep(@delay)\n end",
"title": ""
},
{
"docid": "ee18aee6c321352857f479af6182c8b3",
"score": "0.7175312",
"text": "def wait sec\n sleep sec\nend",
"title": ""
},
{
"docid": "45f336ec464cc9b0d420c4e83ba035e3",
"score": "0.7175117",
"text": "def wait_sleep(duration = nil)\n\tend",
"title": ""
},
{
"docid": "c0712f20285c1c365d46174db9774981",
"score": "0.7167123",
"text": "def sleep(time)\n error \"sleep parameter must be a float or a integer\" if\n not time.kind_of?(Numeric)\n seconds = time.to_f\n puts \"Waiting #{time} seconds...\"\n Kernel.sleep seconds\n end",
"title": ""
},
{
"docid": "fcf901c3860c88a590d6370031afdf65",
"score": "0.7159526",
"text": "def go_to_sleep\n sleep_ms = @settings[\"sleep_ms\"]\n if sleep_ms > 0\n sleep sleep_ms/1000\n else\n sleep 0\n end\nend",
"title": ""
},
{
"docid": "13ac963a465ee24b59713be7ffa4a60f",
"score": "0.7145178",
"text": "def sleep_randomly\n random_sleep = rand(5...10) * rand()\n sleep(random_sleep)\nend",
"title": ""
},
{
"docid": "264b2ba6b4df8af6b17218a826cef486",
"score": "0.7091556",
"text": "def countdown_with_sleep(x)\nwhile x > 0\n puts \"#{x} SECOND(S)!\"\n x -= 1\n sleep(1)\nend \n\"HAPPY NEW YEAR!\"\nend",
"title": ""
},
{
"docid": "ddacd7d48b7c374354fc702e3aa77f24",
"score": "0.7078107",
"text": "def sleep(cycles) #usage: sleep n (n>1)\n if cycles < 2\n raise \"MACRO ERROR: 'SLEEP': Duration must be > 1\"\n end\n\n if cycles & 1\n bit :VSYNC\n end\n\n cycles -= 3\n\n (cycles / 2).times do\n nop\n end\nend",
"title": ""
},
{
"docid": "a6d48d0a8e1758a1f9c3109f42dd67d8",
"score": "0.70604205",
"text": "def sleep\n @next_start ||= Time.now\n if @sleep > 0\n now = Time.now\n sleep_time = @next_start - Time.now\n sleep_time = 0 if sleep_time < 0\n @next_start = Time.now + sleep_time + @sleep\n EM::Synchrony.sleep(sleep_time) if sleep_time > 0\n end\n end",
"title": ""
},
{
"docid": "a04369b73ec24cd6ef5dd8fb661bdd75",
"score": "0.7044712",
"text": "def sleep seconds\n seconds = seconds.to_f\n raise ArgumentError, 'bad sleep seconds' if seconds < 0\n\n # NOTE request_wake requires request as param, so this method can not be generalized to Fiber.sleep\n\n Ext.request_sleep request # place sleep actions before wake\n Thread.new do\n Kernel.sleep seconds\n Ext.request_wakeup request\n end\n Fiber.yield :sleep # see event.c for the handler\n end",
"title": ""
},
{
"docid": "1f6f30b848ef10370ba5e44f208eb89b",
"score": "0.70441335",
"text": "def big_sleep\n sleep(1000.years)\n end",
"title": ""
},
{
"docid": "1ca73e82c1b341e2583dad3ee87d03e5",
"score": "0.70326126",
"text": "def countdown_with_sleep(countdown_start_number)\n while countdown_start_number > 0 do\n puts \"#{countdown_start_number} SECOND(S)!\"\n countdown_start_number -= 1\n # #sleep(num_seconds) tells the Ruby program to wait num_seconds before executing the next line of code\n sleep(1)\n end\n puts \"HAPPY NEW YEAR!\"\n \"HAPPY NEW YEAR!\"\nend",
"title": ""
},
{
"docid": "30c4fbb21835719755ff479cc95bf7a2",
"score": "0.7028186",
"text": "def sleep seconds\n seconds = seconds.to_f\n raise ArgumentError, 'bad sleep seconds' if seconds < 0\n\n # NOTE request_wake requires request as param, so this method can not be generalized to Fiber.sleep\n\n Ext.request_sleep self # place sleep actions before wake\n Thread.new do\n sleep seconds\n Ext.request_wakeup self\n end\n Fiber.yield :sleep # see event.c for the handler\n end",
"title": ""
},
{
"docid": "af94f659be9537ae819ccfcce2092d40",
"score": "0.7006339",
"text": "def sleep(timeout = nil)\n unlock\n begin\n timeout ? Kernel.sleep(timeout) : Kernel.sleep\n ensure\n lock\n end\n end",
"title": ""
},
{
"docid": "b0a17b18d2415dd4cc4ed821bcc226b0",
"score": "0.70012504",
"text": "def sleep_between_cycles;\t0.02\t\t\t\tend",
"title": ""
},
{
"docid": "c220c15be1412afa8ff5916e021e5341",
"score": "0.6986964",
"text": "def countdown_with_sleep(int)\n\n while int > 0 do\n puts \"#{int} SECOND(S)!\"\n int -= 1\n sleep(1)\n end\n\n \"HAPPY NEW YEAR!\"\nend",
"title": ""
},
{
"docid": "0b270b8bbde5a218a2b384203156cf8f",
"score": "0.6980044",
"text": "def countdown_with_sleep(count)\n count = 10\n while count != 0\n puts \"#{count} SECOND(S)!\"\n count -= 1\n sleep(0.5)\n end\n \"HAPPY NEW YEAR!\"\nend",
"title": ""
},
{
"docid": "45aaf80ebe7f62612fd4bb87a9182bf8",
"score": "0.6971308",
"text": "def delay\n sleep 3\n end",
"title": ""
},
{
"docid": "38aea4adddb6ed4dd185160e136be9cf",
"score": "0.6966406",
"text": "def sleep_time\n 15\n end",
"title": ""
},
{
"docid": "6be6f656e2907aa455f4f36efa488e01",
"score": "0.6965725",
"text": "def countdown_with_sleep(int)\n while int > 0\n puts \"#{int} SECOND(S)!\"\n int -= 1 \n sleep 1\n end\n \"HAPPY NEW YEAR!\"\nend",
"title": ""
},
{
"docid": "8576ff359807ea25102e7763cb8499a0",
"score": "0.6964567",
"text": "def countdown_with_sleep(seconds)\ncounter = seconds\nwhile counter > 0\n puts \"#{counter} SECOND(S)!\"\n counter -= 1\n sleep 1\nend\n\"HAPPY NEW YEAR!\"\nend",
"title": ""
},
{
"docid": "137844d0cba61934ce589572aee2d378",
"score": "0.6943157",
"text": "def sleep(timeout = nil)\n unlock\n begin\n timeout ? Kernel.sleep(timeout) : Kernel.sleep\n ensure\n lock\n end\n end",
"title": ""
},
{
"docid": "fab5475c9755c4959d12deb2bc6e8d65",
"score": "0.69422996",
"text": "def sleep_until_next_second\n return unless darwin?\n\n t = Time.now\n diff = t.to_f - t.to_i\n\n sleep(1.05 - diff)\nend",
"title": ""
},
{
"docid": "7292acf2036f4c248905d6b1e7ca99ee",
"score": "0.6938198",
"text": "def start_sleep\n # This case statement is legacy from the original sleep code\n @sleep_on_time = false\n @elapsed_time.update { |v| 0 } \n @last_time += @sleeptime\n @count.update { |v| 0 }\n @logger.debug? && @logger.debug(\"Sleeping\", :delay => @sleeptime)\n sleep(@sleeptime)\n end",
"title": ""
},
{
"docid": "bb001cf55c5c2d9647632a4dba6a8352",
"score": "0.69344616",
"text": "def countdown_with_sleep(number)\n sleep(5)\n hny = \"HAPPY NEW YEAR!\"\n while number >= 1\n puts \"#{number} SECOND(S)!\"\n number -= 1\n end\n hny\nend",
"title": ""
},
{
"docid": "62f5e37913f378284150be84aa8fcfd4",
"score": "0.69324946",
"text": "def sleep(length=nil)\n start_time = ::Time.now.to_f\n if(length)\n defer{ ::Kernel.sleep(length) }\n else\n ::Thread.current[:root_fiber] == ::Fiber.current ? ::Kernel.sleep : ::Fiber.yield\n end\n ::Time.now.to_f - start_time\n end",
"title": ""
},
{
"docid": "67ab3664befc46a66015a9e40e1c2005",
"score": "0.6926829",
"text": "def sleep(duration)\n super(duration/1000.0) * 1000.0 #Not sure if it's needed, but just to be on the safe side\n end",
"title": ""
},
{
"docid": "4cd383dc29e754a49f8b31170361437b",
"score": "0.6926793",
"text": "def breakable_sleep(seconds:, step:)\n t = 0.0\n while(t < seconds)\n sleep(step)\n break if $quit\n t += step\n end\nend",
"title": ""
},
{
"docid": "9e75530c2a86f0b67988eb0a8d1699d5",
"score": "0.69228417",
"text": "def sleep(duration = nil)\n if duration\n Polyphony.backend_sleep(duration)\n else\n Polyphony.backend_wait_event(true)\n end\n end",
"title": ""
},
{
"docid": "38d1d952627b801f37cc25cde57bfcee",
"score": "0.6914344",
"text": "def kernel_sleep(duration = nil)\n self.block(:sleep, duration)\n end",
"title": ""
},
{
"docid": "f049a6b937e0197aec0991785f8d4bbd",
"score": "0.6908899",
"text": "def sleep(interval)\n EM::Synchrony.sleep interval\n end",
"title": ""
},
{
"docid": "ce29405d0ab1f97b1398921312dc912a",
"score": "0.689889",
"text": "def countdown_with_sleep(n)\n until n == 0\n puts \"#{n} SECOND(S)!\"\n n -=1\n sleep (1)\nend\n\"HAPPY NEW YEAR!\"\nend",
"title": ""
},
{
"docid": "d9bceffb88c8226846b3fe143ad28d23",
"score": "0.6896761",
"text": "def sleep(sec)\n url = sprintf($urlbase+\"pm/sleep/%s\", sec)\n res = access(url)\n\n return (res)\n end",
"title": ""
},
{
"docid": "2ef7a1237d195d15c867facad356998e",
"score": "0.68803567",
"text": "def run_something\n sleep 1\nend",
"title": ""
},
{
"docid": "fd9c7f8df91bc27dfbb4b4fb13a8e57f",
"score": "0.68748176",
"text": "def sleeper\n\t\tsleep(0.2)\n\tend",
"title": ""
},
{
"docid": "db767da9878b5aad9b74f77238353fb0",
"score": "0.6873936",
"text": "def countdown_with_sleep(int)\n counter = 10\n sleep 5 \n # sleep method can be used for .seconds .minutes .hours also \n until counter == 0 do \n puts \"#{counter} SECOND(S)!\"\n counter -= 1 \n end \n \"HAPPY NEW YEAR!\"\nend",
"title": ""
},
{
"docid": "848bec1d3241b9224de37c2e989d3fe0",
"score": "0.68730867",
"text": "def sleep_if_set\n config[:sleep].to_i.times do\n print '.'\n sleep 1\n end\n end",
"title": ""
},
{
"docid": "848bec1d3241b9224de37c2e989d3fe0",
"score": "0.68730867",
"text": "def sleep_if_set\n config[:sleep].to_i.times do\n print '.'\n sleep 1\n end\n end",
"title": ""
},
{
"docid": "bec9449aef6ad96ff0bfcd72cd1db1b2",
"score": "0.6872848",
"text": "def sleep(timeout = nil)\n raise \"Whoops, Eventless doesn't implement Mutex#sleep yet\"\n end",
"title": ""
},
{
"docid": "50a6f492557d86d415510afa68cfc197",
"score": "0.6865293",
"text": "def breakable_sleep(seconds)\n while seconds > 0\n sleep(1)\n seconds -= 1\n break unless $running\n end\nend",
"title": ""
},
{
"docid": "0fbd1fc2c50ab0dbcbf9c5dfd26bc82d",
"score": "0.6860076",
"text": "def sleep_if_set\n config[:sleep].to_i.times do\n info(\".\")\n sleep 1\n end\n end",
"title": ""
},
{
"docid": "faebb7a1cdf14bbb1bf49b4ca08b70dc",
"score": "0.6845884",
"text": "def slow_down\n\tsleep 3\nend",
"title": ""
},
{
"docid": "092c3896961e772d189c428e9201f4b2",
"score": "0.6836413",
"text": "def before_next_sleep\n sleep(0.5)\nend",
"title": ""
},
{
"docid": "0da0422ffe81f57ac1038bc250aa3559",
"score": "0.6835746",
"text": "def cmd_sleep(*args)\n if args.empty? || args.include?('-h')\n cmd_sleep_help\n return\n end\n\n seconds = args.shift.to_i\n\n if seconds <= 0\n cmd_sleep_help\n return\n end\n\n print_status(\"Telling the target instance to sleep for #{seconds} seconds ...\")\n if client.core.transport_sleep(seconds)\n print_good(\"Target instance has gone to sleep, terminating current session.\")\n client.shutdown_passive_dispatcher\n shell.stop\n else\n print_error(\"Target instance failed to go to sleep.\")\n end\n end",
"title": ""
},
{
"docid": "edbb086a5671f229eb2210f11b71c6f5",
"score": "0.68299156",
"text": "def _sleep_until_next_second\n return unless darwin? || windows?\n\n t = Time.now\n diff = t.to_f - t.to_i\n\n sleep(1.05 - diff)\n end",
"title": ""
},
{
"docid": "bbc4c15debb4e98aff6114ed0e32ed78",
"score": "0.68233186",
"text": "def backoff_sleep(tries)\n # Exponential with some randomization\n sleep_time = 2**tries\n puts \"Sleeping for #{sleep_time} seconds after attempt #{tries}...\"\n sleep sleep_time\n nil\n end",
"title": ""
},
{
"docid": "86da0b92ae2fea28964bff5398435b69",
"score": "0.68221164",
"text": "def sleep_between_calls\n print 'Sleeping for ', self.pauseMillis, ' milliseconds', \"\\n\"\n pause_seconds = (self.pauseMillis.to_i / 1000)\n sleep(pause_seconds)\n puts '------------------------------------------------------------'\n end",
"title": ""
},
{
"docid": "f93650bd2eaccb8ef1e839a7b34cb94f",
"score": "0.68191534",
"text": "def sleep(duration)\n `if(duration==null){while(true){};}else{var awaken=new(Date)().valueOf()+(1000*duration);while(new(Date)().valueOf()<awaken){};}`\n return `Math.round(duration)`\n end",
"title": ""
},
{
"docid": "f3d4c7fbbc655694a2e436f4d5526881",
"score": "0.68154067",
"text": "def sleep_counter(sleep_time, timeout)\n sleep sleep_time\n timeout - sleep_time\n end",
"title": ""
},
{
"docid": "d383a36bbe6f24ff7790aacbfe062007",
"score": "0.68027085",
"text": "def delay\n\t\tsleep 1\n\tend",
"title": ""
},
{
"docid": "1f74197c1f1ab6dd9543d0ff8654a0eb",
"score": "0.6755274",
"text": "def sleep\n if @timeout > 0\n now = Time.now\n sleep_time = @next_start - Time.now\n sleep_time = 0 if sleep_time < 0\n @next_start = Time.now + sleep_time + @timeout\n EM::Synchrony.sleep(sleep_time) if sleep_time > 0\n end\n end",
"title": ""
},
{
"docid": "79ffe453dde1944a175f7f3eb6d2ba2b",
"score": "0.67383945",
"text": "def delay(seconds)\n sleep(seconds)\n end",
"title": ""
},
{
"docid": "3c8f2c1d88496ee608d8e211ec3b52f3",
"score": "0.67358214",
"text": "def sleep_counter(sleep_time, timeout)\n sleep sleep_time\n timeout - sleep_time\n end",
"title": ""
},
{
"docid": "c784f407d9f3a9a42b632e66920d11ac",
"score": "0.6734276",
"text": "def delay(value)\n sleep value/1000 # time in millis\n end",
"title": ""
},
{
"docid": "111f7401c066ebe794946d2bcaabc2c7",
"score": "0.67109907",
"text": "def delay()\n sleep(rand / 100)\n end",
"title": ""
},
{
"docid": "5222bd9276f904e654367f9fd622df5f",
"score": "0.67109877",
"text": "def sleep(duration)\n secs = duration.to_sec if duration === Duration\n wall_sleep(secs) unless secs < 0\n end",
"title": ""
},
{
"docid": "b583470b18e26c6792bd43b1264dc502",
"score": "0.67074215",
"text": "def wait\n sleep 2\nend",
"title": ""
},
{
"docid": "a1c1808ff35235b993ba9591eec8a218",
"score": "0.67060906",
"text": "def delay; end",
"title": ""
},
{
"docid": "24d10eda5111d0313a449c8b84897a1a",
"score": "0.66945046",
"text": "def light_sleep(seconds)\r\n @raise_interrupts = true\r\n sleep seconds\r\n rescue InterruptException\r\n # nothing, just return\r\n ensure\r\n @raise_interrupts = false\r\n end",
"title": ""
},
{
"docid": "dcbd881c33bd94e5017eb3eb94479459",
"score": "0.66938806",
"text": "def sleep(duration=undefined)\n if duration.equal? undefined\n duration = nil\n elsif !duration.kind_of?(Numeric)\n raise TypeError, 'time interval must be a numeric value'\n end\n\n chan = Rubinius::Channel.new\n\n start = Process.time\n chan.receive_timeout duration\n Process.time - start\n end",
"title": ""
},
{
"docid": "023d90ee487cf03312cc2b2799ae400f",
"score": "0.6689899",
"text": "def pause(seconds)\n sleep seconds\n end",
"title": ""
},
{
"docid": "023d90ee487cf03312cc2b2799ae400f",
"score": "0.6689899",
"text": "def pause(seconds)\n sleep seconds\n end",
"title": ""
},
{
"docid": "be1f002226483973d0b4ee9b0385fe48",
"score": "0.66890264",
"text": "def random_delay\r\n=begin\r\n n = (rand * 100000.0).to_i\r\n n.times do \r\n Thread.pass\r\n end\r\n=end\r\n n = rand * 7.0 + 3.0\r\n sleep(n)\r\nend",
"title": ""
},
{
"docid": "d693618381e67cbd3cc0dcd371bba60a",
"score": "0.66787934",
"text": "def calculate_sleep; end",
"title": ""
},
{
"docid": "9dbbfce10330a1a4db65280e6fa3b578",
"score": "0.6656675",
"text": "def countdown_with_sleep(var1)\n while var1 >0\n puts \"#{var1} SECOND(S)!\"\n sleep(1)\n var1 -= 1\n end\n \"HAPPY NEW YEAR!\"\nend",
"title": ""
},
{
"docid": "50ff5223d9f11a74ef2eaca07a7f9cc6",
"score": "0.6652079",
"text": "def be_sleepy(delay, randelay)\n total = delay + (randelay * rand)\n total = [0, [total, 5].min].max # clamp\n #\n EM::Synchrony.sleep(total)\n end",
"title": ""
},
{
"docid": "4c2cf2a2dd1b168c5cf0dd067fb98a81",
"score": "0.6642186",
"text": "def delay\n sleep(2)\n end",
"title": ""
},
{
"docid": "c6f6b6a93300d35adb93a27dd2e3a881",
"score": "0.6625954",
"text": "def sleep(time=1)\n sleeper.with(self) do |sleeper|\n start\n __sleep\n sleeper.wait(time)\n wake\n stop\n end\n time\n end",
"title": ""
},
{
"docid": "81a81549918108a3ca785380b2392a60",
"score": "0.66259295",
"text": "def sleep\n @health = @health + 10\n end",
"title": ""
},
{
"docid": "82e6e5a2080f569e823a395826c921a0",
"score": "0.66131115",
"text": "def captain_sleep(sec)\n IO.select([ SELF_PIPE[0] ], nil, nil, sec) or return\n SELF_PIPE[0].kgio_tryread(11)\n end",
"title": ""
}
] |
e81fe427871b8e78dcb2ac2c461b06d9
|
size of the file in bytes. see Filesize
|
[
{
"docid": "665f123d25807b0bc83a8af66848484c",
"score": "0.8059351",
"text": "def size\n @size = File.size(self.path) unless @size\n @size\n end",
"title": ""
}
] |
[
{
"docid": "c30f6d0273555c2694b76185aa803b98",
"score": "0.87965727",
"text": "def size_in_bytes\n ( file_length * 16 ) / 8\n end",
"title": ""
},
{
"docid": "f5db59cb191775922da7c169b811c138",
"score": "0.8710147",
"text": "def size\n file.size\n end",
"title": ""
},
{
"docid": "567aed4a81334cadddb6b7005020a730",
"score": "0.86295587",
"text": "def size\n @size ||= File.size(file)\n end",
"title": ""
},
{
"docid": "937e42216f7e7b38f4425b2380b8b250",
"score": "0.85882884",
"text": "def file_size\n stream.size\n end",
"title": ""
},
{
"docid": "689b0a811ff29103f2fbbc4159371147",
"score": "0.8537614",
"text": "def size\n File.size(@filename)\n end",
"title": ""
},
{
"docid": "f0ec3c6b6606784b9cda769a65277b7a",
"score": "0.8522847",
"text": "def size\n file.content_length\n end",
"title": ""
},
{
"docid": "3637f3925e1577f1fe9efe72047cfca2",
"score": "0.85047203",
"text": "def file_size\n @file_size ||= 0\n end",
"title": ""
},
{
"docid": "b62279f7ff16b10acea311e617ed6589",
"score": "0.8484757",
"text": "def file_size\n self.file_file_size\n end",
"title": ""
},
{
"docid": "3030015b8da0bc5d52ec5f3be772a7cb",
"score": "0.83804196",
"text": "def filesize; end",
"title": ""
},
{
"docid": "0959cc7a1b0d9ae629f573fd515d5873",
"score": "0.8318181",
"text": "def getFileSize()\n getRealFileSize(file) / MEGABYTE\n end",
"title": ""
},
{
"docid": "13be8d3c4d48426440ae20c2645d4991",
"score": "0.8245227",
"text": "def size\n ::File.size(@path)\n end",
"title": ""
},
{
"docid": "e317af1017965afa248b08978a1d02bc",
"score": "0.82208025",
"text": "def size\n file.try(:size) || 0\n end",
"title": ""
},
{
"docid": "0f387f456b68b61570a96b274fc60514",
"score": "0.81931686",
"text": "def file_size; @io_size[@rio] end",
"title": ""
},
{
"docid": "785dc35c68151d645625b608d649ffe8",
"score": "0.8191798",
"text": "def size\n # return @file.size if @file.respond_to?(:size)\n File.size(self.path) rescue 0\n end",
"title": ""
},
{
"docid": "3ecdd9ac82d03547b040cebb15e0fc46",
"score": "0.818555",
"text": "def data_size\n File.size(file_path)\n end",
"title": ""
},
{
"docid": "3ecdd9ac82d03547b040cebb15e0fc46",
"score": "0.818555",
"text": "def data_size\n File.size(file_path)\n end",
"title": ""
},
{
"docid": "60067e44ba9d164159939d4a87891187",
"score": "0.80717707",
"text": "def file_size\n if @filename\n File.size(filename)\n elsif file.respond_to?(:size)\n file.size\n # :nocov:\n else\n file.seek(0, IO::SEEK_END) && file.pos\n # :nocov:\n end\n end",
"title": ""
},
{
"docid": "78ca9f6831d82ad3df9611bd26f635d4",
"score": "0.80636704",
"text": "def filesize\n File.size?(path)\n end",
"title": ""
},
{
"docid": "407e11a1ad3e4bddcd4cd4cc2c219286",
"score": "0.8047707",
"text": "def size\n File.size(path)\n end",
"title": ""
},
{
"docid": "c3f6cf80563cf3dc8069d9fd3d5e87b3",
"score": "0.80432165",
"text": "def size\n File.size(self)\n end",
"title": ""
},
{
"docid": "c3f6cf80563cf3dc8069d9fd3d5e87b3",
"score": "0.80432165",
"text": "def size\n File.size(self)\n end",
"title": ""
},
{
"docid": "c3f6cf80563cf3dc8069d9fd3d5e87b3",
"score": "0.80432165",
"text": "def size\n File.size(self)\n end",
"title": ""
},
{
"docid": "c3f6cf80563cf3dc8069d9fd3d5e87b3",
"score": "0.80432165",
"text": "def size\n File.size(self)\n end",
"title": ""
},
{
"docid": "5cad4ee783bc4638f93956ef0f1bf6ab",
"score": "0.8025145",
"text": "def file_size(file_name)\n size = File.size?(file_name)\n size = 0 if size.nil?\n LoggerHelper.print_to_log(\"Size of file '#{file_name}' is #{size}\")\n size\n end",
"title": ""
},
{
"docid": "65d32956d1eb4c5d94da153bbfbe4f40",
"score": "0.80206656",
"text": "def bytesize\n @fd.stat.size\n end",
"title": ""
},
{
"docid": "f33ac131a9bbe208843f60b748f5df05",
"score": "0.80081767",
"text": "def size\n File.size( fullpath )\n end",
"title": ""
},
{
"docid": "5f8a2423c258685f28ca7b5e44b2329f",
"score": "0.79401463",
"text": "def file_size\n number_to_human_size(super)\n end",
"title": ""
},
{
"docid": "b8797107a5283788c0364310b8e7ec34",
"score": "0.7918278",
"text": "def size_in_bytes\n files.inject(0) do |sum, f|\n path = File.join self.path, f\n sum + File.size(path)\n end\n end",
"title": ""
},
{
"docid": "f64cf4f1deee54027a16cbc29cbe2bbd",
"score": "0.786813",
"text": "def get_file_size\n file = Storage.get_file(ENV['AWS_S3_DIR_PAGES'], self.issue_id, self.filename )\n return file.content_length\n end",
"title": ""
},
{
"docid": "4831ea3ad90567341edaaf598725bf61",
"score": "0.78576094",
"text": "def edf_size\n File.size(@filename)\n end",
"title": ""
},
{
"docid": "2ec6c9ab13dc50af4d4feae6d861926d",
"score": "0.78542906",
"text": "def size\n @files.size\n end",
"title": ""
},
{
"docid": "6ab6242b4644489ff97464bc02e5344e",
"score": "0.7843668",
"text": "def size\n instance_read(:file_size) || (@queued_for_write[:original] && @queued_for_write[:original].size)\n end",
"title": ""
},
{
"docid": "adf09bccc70f7e76e0eebfc415cd4b13",
"score": "0.7826493",
"text": "def getFileSize\r\n\t\t\t\t\treturn @fileSize\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "4398043a13083dfee15762074a308e62",
"score": "0.7812059",
"text": "def byte_size\n inject(0){ |sum, path| sum + FileTest.size(path) }\n end",
"title": ""
},
{
"docid": "46aca257acccb72c283cbff4e79143c5",
"score": "0.7801072",
"text": "def size\n size = File.size(@path).to_i\n case\n when size.to_i == 1; \"1 byte\"\n when size < 1024; \"%d bytes\" % size\n when size < (1024*1024); \"%.2f kilobytes\" % (size / 1024.0)\n else \"%.2f megabytes\" % (size / (1024 * 1024.0))\n end.sub(/([0-9])\\.?0+ /, '\\1 ' )\n end",
"title": ""
},
{
"docid": "bbc4b355eb15141f5e40ddff546481ad",
"score": "0.7797493",
"text": "def size; file_log.size(file_rev); end",
"title": ""
},
{
"docid": "cee0632e9de4fe5328c6bddc65f5b3c6",
"score": "0.777504",
"text": "def filesize(file)\n '%.2f' % (File.size(file).to_f / 2**20)\n end",
"title": ""
},
{
"docid": "308d911dc61fb29d0d431b43de20db28",
"score": "0.77345896",
"text": "def filesize\r\n file_exists? ? File.size(full_path) : nil\r\n end",
"title": ""
},
{
"docid": "49fa763e3633c41da2512fdb6c2b301f",
"score": "0.7704276",
"text": "def size\n read.bytesize\n end",
"title": ""
},
{
"docid": "0376edd6d851e02f614a3d90ee7bd662",
"score": "0.7698761",
"text": "def get_file_size_in_mb\n mb = ::ApplicationController.helpers.number_to_human_size(self.file_size, precision: 2) \n return mb\n end",
"title": ""
},
{
"docid": "a94f7378009f2adf694816f159443f4a",
"score": "0.7694878",
"text": "def size\n if is_path?\n exists? ? File.size(path) : 0\n elsif @file.respond_to?(:size)\n @file.size\n elsif path\n exists? ? File.size(path) : 0\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "2e2a6261b5f5c26baf2a02ff3234d5ba",
"score": "0.7684412",
"text": "def size(path)\n info = Private.info_with(path, GLib::G_FILE_ATTRIBUTE_STANDARD_SIZE)\n GLib.g_file_info_get_size(info)\n end",
"title": ""
},
{
"docid": "dcdcd54e653b7270afbf0d0d05452eea",
"score": "0.7672145",
"text": "def get_file_size!(f)\n size = File.size?(f)\n #print(\"#{size},\")\n end",
"title": ""
},
{
"docid": "5a1273ecf7ce9674ccdcb1c7b1c7117a",
"score": "0.76535195",
"text": "def size\n @file_list.size\n end",
"title": ""
},
{
"docid": "3c151db2f7b63c066ebd71ce96707d51",
"score": "0.76470554",
"text": "def bytes\n @bytes = 0\n @files.each do |file|\n @bytes += File.new(\"#{file}\").size\n end\n @bytes\n end",
"title": ""
},
{
"docid": "caee3b0b1cc1dd8ac5eeda3c905b356f",
"score": "0.7644773",
"text": "def file_size\n 1000 # temporarily disable file size calculation\n # TODO: fix this in production env (perhaps zencoder is not replacing target file?)\n # self.file.size\n end",
"title": ""
},
{
"docid": "089078b4f59ace99ad2d45f71ced5616",
"score": "0.76306945",
"text": "def test_size\r\n assert_respond_to(File, :size)\r\n assert_equal(17, File.size(@file))\r\n end",
"title": ""
},
{
"docid": "e0c95e9f3fffddd377d86979764c0654",
"score": "0.75730586",
"text": "def size\n chunk_size = nil\n File.open(@file_name) do |file|\n file.seek(@offset + 4, IO::SEEK_CUR)\n case @size_length\n when 4\n chunk_size = file.read(@size_length).unpack('L').first\n when 2\n chunk_size = file.read(@size_length).unpack('S').first\n else\n raise \"Can't decode size field of length #{@size_length}\"\n end\n end\n chunk_size + @data_size_correction\n end",
"title": ""
},
{
"docid": "499285b72e32224531a17cf2c79f9aaa",
"score": "0.75676656",
"text": "def size\n size = popen(%W(du -s), full_path).first.strip.to_i\n (size.to_f / 1024).round(2)\n end",
"title": ""
},
{
"docid": "8d944fa02649d48efce23ffeb9ae20e5",
"score": "0.75665146",
"text": "def size\n File.new(self.server_path).size\n end",
"title": ""
},
{
"docid": "6c436ae67d4b69002e6fe6e07c8ad55c",
"score": "0.7563362",
"text": "def original_file_size\n return @original_file_size\n end",
"title": ""
},
{
"docid": "6859e684c9f82c87b1b6ad3caa519999",
"score": "0.75566864",
"text": "def file_size\n # pretty value\n attachments.order(position: 'asc').first.file_size\n rescue StandardError => exc\n logger.error(\"Message for the log file #{exc.message}\")\n 0\n end",
"title": ""
},
{
"docid": "61a0f57dc6787b47e27a005b92e82e7e",
"score": "0.7524328",
"text": "def filesize\n @descriptive_detail.filesize\n end",
"title": ""
},
{
"docid": "4e7a448c52eceb6a38e2eea17e57a9dc",
"score": "0.7495456",
"text": "def size\n if persistent?\n filename.size\n else\n page_size = @db.send(:get_int_pragma, 'page_size')\n page_count = @db.send(:get_int_pragma, 'page_count')\n page_size * page_count\n end\n end",
"title": ""
},
{
"docid": "e86b6c503e1629718fd5dee0bf976e44",
"score": "0.74790335",
"text": "def size\n raise NotImplementedError.new(\"size() must be implemented by subclasses of AbstractVersionedFile.\")\n end",
"title": ""
},
{
"docid": "9c9576c0044a58f1cc5e97161155201d",
"score": "0.74086016",
"text": "def size_fil_header\n 4 + 4 + 4 + 4 + 8 + 2 + 8 + 4\n end",
"title": ""
},
{
"docid": "2de36fd1d0b8620c6ea8ad4786815fcd",
"score": "0.74042034",
"text": "def size(name)\n File.size(path(name))\n end",
"title": ""
},
{
"docid": "7960853f188933a0e5046eb36c3e0cdc",
"score": "0.7392706",
"text": "def content_length\n stat.size\n end",
"title": ""
},
{
"docid": "7ea610c8b771726e1309c06f32bba8ed",
"score": "0.7382174",
"text": "def size\n @io.size\n end",
"title": ""
},
{
"docid": "51889350f2a8fc1e688a6d6dbf475331",
"score": "0.73814255",
"text": "def size\n raise MissingFileMapping.new if mapping.blank?\n raise NodesMissing.new if mapping.nodes.blank?\n\n retrieve_meta!\n\n return self.meta['file_size'].to_i\n end",
"title": ""
},
{
"docid": "1a818e74e1b937221cc884fa04b81dd2",
"score": "0.7352409",
"text": "def get_size(path)\n read_size(@uri + path)\n end",
"title": ""
},
{
"docid": "b288f81f38385c4bdf9acd9f612f3477",
"score": "0.7334999",
"text": "def get_file_size(img_path)\n File.size(img_path)\nend",
"title": ""
},
{
"docid": "f03c3dbcea46d291f4fe4c4c1efbc619",
"score": "0.73344356",
"text": "def byte_size; size.y * line_byte_size; end",
"title": ""
},
{
"docid": "79d75c8a16760343a9506fc8f66c28b0",
"score": "0.7334206",
"text": "def get_size\n\t\tend",
"title": ""
},
{
"docid": "7151861c934f1b8b596ac7e20c65c20c",
"score": "0.73340034",
"text": "def size_in_byte\n return @size_in_byte\n end",
"title": ""
},
{
"docid": "c21140595650d0af4acac1ca1fc8a9ff",
"score": "0.7333519",
"text": "def total_bytes\n self.files.map {|file| file[:size].to_i}.reduce(:+) # to_i handles any nil file sizes\n end",
"title": ""
},
{
"docid": "a3caaa4be4cd55de0b0886e2835c3f04",
"score": "0.73300153",
"text": "def size\n\t\tstat[:size]\n\tend",
"title": ""
},
{
"docid": "a3caaa4be4cd55de0b0886e2835c3f04",
"score": "0.73300153",
"text": "def size\n\t\tstat[:size]\n\tend",
"title": ""
},
{
"docid": "061f28fdc867a3c5585ffd2c673b9e02",
"score": "0.73287624",
"text": "def size\n contents.size\n end",
"title": ""
},
{
"docid": "f5e19ac213e7e74480a823b9568760db",
"score": "0.7326257",
"text": "def height\n file.height\n end",
"title": ""
},
{
"docid": "e40d4ff10b71d96bab45123290c1606c",
"score": "0.7322798",
"text": "def size(msg)\n debug \"#{Dir.pwd}/#{msg}: #{File.exists?(\"#{Dir.pwd}/#{msg}\")}\"\n if File.exists?(\"#{Dir.pwd}/#{msg}\")\n bytes = File.size(msg)\n \"#{msg} #{bytes}\"\n else\n \"553 File doesn't exist\" \n end\n\n end",
"title": ""
},
{
"docid": "99564b0764d6b54e56ef03bd452f3ca6",
"score": "0.7288654",
"text": "def size; @_io.size; end",
"title": ""
},
{
"docid": "08ab849c0919a433a42a9f1862da877f",
"score": "0.7285999",
"text": "def size_in_bytes\n to_i description['SizeInBytes']\n end",
"title": ""
},
{
"docid": "99057fe8212590ce8e9ac5fb5814c2d6",
"score": "0.72848696",
"text": "def size\n @size ||= @request[FSIZE].to_i\n end",
"title": ""
},
{
"docid": "917d14ffbf768e19f321a9091742a6af",
"score": "0.7279243",
"text": "def size\n raise \"The wallet file #{path} doesn't exist\" unless File.exist?(path)\n File.size(path)\n end",
"title": ""
},
{
"docid": "ad2175eb919cebfd4fbca581ea742451",
"score": "0.7276817",
"text": "def size\n @size \n end",
"title": ""
},
{
"docid": "ad2175eb919cebfd4fbca581ea742451",
"score": "0.7276817",
"text": "def size\n @size \n end",
"title": ""
},
{
"docid": "745c5f6332a1780e2dda5609cb913946",
"score": "0.72708684",
"text": "def compressed_file_size\n return @compressed_file_size\n end",
"title": ""
},
{
"docid": "4eeb67eb2f5012134397dfa5bd2ef7cb",
"score": "0.72706795",
"text": "def size\n if [email protected]?\n @tmpfile.size # File#size calls rb_io_flush_raw()\n else\n File.size(@tmpfile.path)\n end\n end",
"title": ""
},
{
"docid": "273e74c05252d4100a685d7e08b5cb9d",
"score": "0.72617805",
"text": "def path_size (path)\n if Dir.exist? path\n o, e, s = Open3.capture3('du', '-s', '-b', path)\n o.split('/')[0].to_i\n end\n end",
"title": ""
},
{
"docid": "c2094a87f6386afbbe70d16cea44590b",
"score": "0.7246448",
"text": "def size\n data\n image.filesize\n end",
"title": ""
},
{
"docid": "d775cb1b10c44ceb17d1dafd4147a7e4",
"score": "0.72369254",
"text": "def size\n blob.size\n end",
"title": ""
},
{
"docid": "ea0b69b7ea6eb6a0e61b0c1f6bdd0b94",
"score": "0.7236876",
"text": "def filesize\n if filesize_extent\n filesize_extent.bytes\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "04af32438a081cd99dfc4b560c8fe7fc",
"score": "0.7217234",
"text": "def size(full_path)\n\t\t`du -sb #{full_path}`.match(/(\\d+)/)[1].to_i\n\tend",
"title": ""
},
{
"docid": "8734aae1754f887ab9a8c4a441ca8a79",
"score": "0.72060686",
"text": "def size\n @content.bytesize\n end",
"title": ""
},
{
"docid": "42d33ae19ee1dcda42d316c797e4c8fa",
"score": "0.7205679",
"text": "def size\n @contents.bytes.size\n end",
"title": ""
},
{
"docid": "3980e5b3d1a7858c66950ca081826382",
"score": "0.718706",
"text": "def output_size(stat)\n HdfsUtils::Units.new.format_filesize(stat['length'],\n @settings[:filesizeunits])\n end",
"title": ""
},
{
"docid": "4d8c9a6a0eb0cf29555c102af60b5953",
"score": "0.7153501",
"text": "def file_size_field\n Solrizer.solr_name(:file_size, CurationConcerns::FileSetIndexer::STORED_INTEGER)\n end",
"title": ""
},
{
"docid": "3782b7f8e1c5154cbf283b1bea9958bd",
"score": "0.71418303",
"text": "def get_size(path)\n file = scope.get(path)\n InvalidPath.raise! {!file}\n return 0 if file.is_dir\n file.info[:size]\n end",
"title": ""
},
{
"docid": "7cc2e005286e2c8c7a0f54d220e5cb5b",
"score": "0.7128108",
"text": "def extract_size(io)\n io.size\n end",
"title": ""
},
{
"docid": "a95088cdd9dc5dc6d90e0766b8515e9f",
"score": "0.71180284",
"text": "def size\n content.size\n end",
"title": ""
},
{
"docid": "022e41bc8d1131f8a71c0007da10b03d",
"score": "0.71122324",
"text": "def size(full_path)\n\t\t`du -s #{Rush.quote(full_path)}`.match(/(\\d+)/)[1].to_i\n\tend",
"title": ""
},
{
"docid": "f01cff1e93f7afae0cf31145858e13d6",
"score": "0.71118885",
"text": "def get_size\n\t\treturn @size\n\tend",
"title": ""
},
{
"docid": "8fbfc9d5bd08c470ad80411e96a9644a",
"score": "0.7088681",
"text": "def get_character_size account, filename\n end",
"title": ""
},
{
"docid": "17be3da86154e621c00aa457a92bb779",
"score": "0.7080993",
"text": "def d_size\n uint64(header, 'size') / @blockSize\n end",
"title": ""
},
{
"docid": "15e192e2fbb02d839b79bf9d5277563c",
"score": "0.706215",
"text": "def size\n stream_size * 8\n end",
"title": ""
},
{
"docid": "1e5bee0544f29643e4fc6dc4da5a1599",
"score": "0.7054662",
"text": "def size\n if @tmpfile\n @tmpfile.flush\n @tmpfile.stat.size\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "c8eb67c0ae5239bb85d724c766aa5faf",
"score": "0.7053323",
"text": "def size\n @data.bytesize\n end",
"title": ""
},
{
"docid": "790d1c15ba781c35664460f7baf56831",
"score": "0.7035507",
"text": "def size\n\t\treturn 0 if @setup.secure or @setup['no_cache'] or not FileTest::exist?( @setup['cache_path'] )\n\n\t\tFileTest.size( @setup['cache_path'] )\n\tend",
"title": ""
},
{
"docid": "7b265b8425f324470af2873278008876",
"score": "0.7033328",
"text": "def size\n return 0 unless @spoolfile\n\n @spoolfile.flush\n @spoolfile.stat.size\n end",
"title": ""
}
] |
f4da41ae32bc38d9a6d89937a458afc2
|
fetches all objects in order of their succession
|
[
{
"docid": "7aec45960c9960015fa71565f200ffd1",
"score": "0.0",
"text": "def all_in_succession\n all = []\n object = self.first_in_succession\n while object do\n all.push(object)\n object = object.successor\n end\n all\n end",
"title": ""
}
] |
[
{
"docid": "a212dd8149abba459bee148ccc75fd06",
"score": "0.7069825",
"text": "def all\n ordered @objects\n end",
"title": ""
},
{
"docid": "17946cf672f70b49a04d3acc915e8f83",
"score": "0.6733282",
"text": "def fetch!\n collection.fetch_objects!\n end",
"title": ""
},
{
"docid": "17946cf672f70b49a04d3acc915e8f83",
"score": "0.6733282",
"text": "def fetch!\n collection.fetch_objects!\n end",
"title": ""
},
{
"docid": "af32952f08d0c6f20a95992e62a3d2c2",
"score": "0.6610397",
"text": "def fetch\n collection.fetch_objects\n end",
"title": ""
},
{
"docid": "2ac706f37b514b35e437674229db2e43",
"score": "0.6538977",
"text": "def fetch_objects(lookup = :parallel)\n items = valid_parse_objects\n if lookup == :parallel\n items.threaded_each { |o| o.fetch }\n else\n items.each { |e| e.fetch }\n end\n #self.replace items\n self\n end",
"title": ""
},
{
"docid": "254809e0e8e09e321f399111a948c987",
"score": "0.64437985",
"text": "def fetch_objects!(lookup = :parallel)\n # this gets all valid parse objects from the array\n items = valid_parse_objects\n\n # make parallel requests.\n unless lookup == :parallel\n # force fetch all objects\n items.threaded_each { |o| o.fetch! }\n else\n # serially fetch each object\n items.each { |o| o.fetch! }\n end\n self #return for chaining.\n end",
"title": ""
},
{
"docid": "09c9e386efd3f338e8bab056f0149db7",
"score": "0.6416593",
"text": "def fetch_all\n fetch(-2)\n end",
"title": ""
},
{
"docid": "98402f6a656ea099124472e7c5e6440f",
"score": "0.63409936",
"text": "def fetch_all\n loop do\n item = @fetch.call\n\n unless item\n @fetch = DFB\n return\n end\n\n @buffer << item\n end\n end",
"title": ""
},
{
"docid": "05e35d93df683178a10af41d105422d8",
"score": "0.6251676",
"text": "def all\n order(:id)\n end",
"title": ""
},
{
"docid": "fac1e54b7e6013b67fcc14ac8ab52f36",
"score": "0.6131938",
"text": "def get_individual_objects(object)\n object[\"objectIDs\"][0..2000].each do |id|\n response = RestClient.get(INDIVIDUAL_URL + \"#{id}\")\n new_piece = JSON.parse(response)\n persist_to_db(new_piece)\n end\nend",
"title": ""
},
{
"docid": "bd210199f18b32efcd536d3479f16c40",
"score": "0.6124387",
"text": "def all_sequentially &block\n page, per_page = 1, 5\n begin\n results = paginate(page: page, per_page: per_page, order: '_id asc')\n results.each{|o| block.call o}\n page += 1\n end until results.blank? or results.size < per_page\n end",
"title": ""
},
{
"docid": "deab701dc4ab73c80574ae87b392f8d0",
"score": "0.6079148",
"text": "def fetch_all\n \n end",
"title": ""
},
{
"docid": "489a4f8a73b957c1e5e5ca19fb6f8213",
"score": "0.6055721",
"text": "def refresh_ordered_list(obj={})\n list_ids = ordered_list_ids(obj)\n records = liszt_relation(obj).to_a\n real_ids = records.map(&:id)\n\n refresh_ordered_records obj, list_ids, records, real_ids\n end",
"title": ""
},
{
"docid": "65d8f66679aaf9f72671c2e20d9af03d",
"score": "0.59913015",
"text": "def each\n while @remaining_objects > 0\n yield next_object\n end\n end",
"title": ""
},
{
"docid": "7234ed7d1e774ff85aa7dd6562008186",
"score": "0.59544724",
"text": "def fetch_all_objects(object_symbol)\n logger.debug \"Fetching all objects (#{object_symbol})\"\n object_array = []\n object_hash_array = persist_ctrl.object_hash_get_all(object_symbol)\n object_hash_array.each { |object_hash| object_array << object_hash_to_object(object_hash) }\n object_array\n end",
"title": ""
},
{
"docid": "6a2efef87faf356059f3981b6f4b29cc",
"score": "0.59477586",
"text": "def fetch_all_objects(object_symbol)\n logger.debug \"Fetching all objects (#{object_symbol})\"\n persist_ctrl.object_hash_get_all(object_symbol).map do |object_hash|\n object_hash_to_object(object_hash)\n end\n end",
"title": ""
},
{
"docid": "52d892f3ec5507a22b9c299d7b29c432",
"score": "0.5940541",
"text": "def each(&block)\n get unless loaded\n self.objects.first[1].each(&block)\n end",
"title": ""
},
{
"docid": "b0d4ee5a49338bf639dc4194c6222c3a",
"score": "0.59047043",
"text": "def return_objects(collection)\n @data.fetch_all_objects(collection)\n end",
"title": ""
},
{
"docid": "8cbf2504c9cf950957da437f347a36b4",
"score": "0.58940583",
"text": "def next( count = 1 )\n\n objects = nil\n\n if count > 1\n\n objects = [ ]\n count.times do\n objects.push( get_object( @adapter_cursor.next ) )\n end\n\n else\n\n objects = get_object( @adapter_cursor.next )\n\n end\n\n return objects\n\n end",
"title": ""
},
{
"docid": "88868e2b8e153973686bd7fad408c4a8",
"score": "0.58831334",
"text": "def load\n all do |items|\n @list.items = items.reverse\n end\n end",
"title": ""
},
{
"docid": "0b4cbec97b2770a4f9e4d34376ea985a",
"score": "0.58778065",
"text": "def fetch_all_sources\n @sources ||= Source.sorted\n end",
"title": ""
},
{
"docid": "afc9a62b3b58b24fdec2a10dbf810840",
"score": "0.5867557",
"text": "def post_load(objects)\n super\n objects.each do |o|\n next unless o.is_a?(Sequel::Model)\n o.retrieved_by = self\n o.retrieved_with = objects\n end\n end",
"title": ""
},
{
"docid": "f28c2cfed1ac5cd02b3fcc877014dbbd",
"score": "0.58558697",
"text": "def fetch(i, &block)\n @object.fetch(i, &block)\n end",
"title": ""
},
{
"docid": "c7b4c9c94b87e856b4c40c9ac3b67c62",
"score": "0.58527195",
"text": "def fetch\n workers = WorkersPool.new 4\n workers.worker(&:fetch)\n each do |hit|\n workers << hit\n end\n workers.end\n workers.result\n @fetched = true\n self\n end",
"title": ""
},
{
"docid": "2685cf22f3e63e15a519577264c098c9",
"score": "0.58516175",
"text": "def return_objects(collection)\n # setup_data\n @data.fetch_all_objects(collection)\n end",
"title": ""
},
{
"docid": "207755b327973a06124355a11a507387",
"score": "0.5843113",
"text": "def get_all_objects\n # stub method\n puts 'call get_all_objects'\n end",
"title": ""
},
{
"docid": "3d400c8f2335ed803c8e446e6885eb87",
"score": "0.58293474",
"text": "def saved_objects\n\t object_ids = saved_items.pluck(:obj_id)\n\t User.where(id: object_ids).sorted\n\t end",
"title": ""
},
{
"docid": "a4f355405db96f491f6a79d8fc11e4dd",
"score": "0.5824597",
"text": "def fetch_all\n self.to_a\n end",
"title": ""
},
{
"docid": "1b906a82153fae6a3c759a874b0fd56f",
"score": "0.58243847",
"text": "def ordered_all_known_objects(project_id)\n available_known_objects=self.available_known_objects\n other_known_objects=KnownObject.find(:all, :conditions=>[\"project_id = ?\", project_id]) - available_known_objects\n return (available_known_objects + other_known_objects)\n end",
"title": ""
},
{
"docid": "0c32c21b08270447541070d80a17e77a",
"score": "0.58142245",
"text": "def all(conditions = nil)\n objs = []\n # check for order conditions, make conditions nil if an order condition\n # is the only one passed to Resource.all\n if conditions && conditions[:order]\n order = conditions[:order].to_a.flatten\n conditions.delete(:order)\n conditions = nil if conditions.empty?\n end\n # Don't bother getting into crazy object searches if there are no\n # conditions -- just grab the objects directly out of the current \n # store\n unless conditions\n @@store.resources[self.to_s.make_key].each do |o|\n objs << o[1]\n end\n else\n objs = find(conditions, self.to_s.make_key)\n end\n if order\n raise \"Order should be passed with :asc or :desc, got #{order[1].inspect}\" \\\n unless [:asc,:desc].include? order[1]\n # FIXME: something about this breaks under certain conditions \n # that I can't find yet\n begin\n objs.sort! {|x,y| x.send(order[0]) <=> y.send(order[0])}\n rescue\n end\n objs.reverse! if order[1] == :desc\n end\n objs\n end",
"title": ""
},
{
"docid": "42e1ab9d12537253a4d75a3868dececa",
"score": "0.5813635",
"text": "def all_objects; end",
"title": ""
},
{
"docid": "a7d2e3c60d44637175532e758c673e03",
"score": "0.5787819",
"text": "def list\n @objects = @object_class.page params[:page]\n end",
"title": ""
},
{
"docid": "4a3948ffa9a10b9d7b666660d62a1a57",
"score": "0.5784475",
"text": "def fetch\n self.bc.next\n end",
"title": ""
},
{
"docid": "c878cf7b72600cf028c52219fa285435",
"score": "0.5766839",
"text": "def objects; @store.objects(self); end",
"title": ""
},
{
"docid": "10fbbd74f46c2a17f48210eabd987ed1",
"score": "0.5747367",
"text": "def objects_on_remote_for(job)\n cloud_io.objects(remote_path_for(job)).sort_by(&:key)\n end",
"title": ""
},
{
"docid": "d228b95f9b40b4357a298c63bd5eaed5",
"score": "0.57444215",
"text": "def all\n ContentObject.order(:created_at).all\n end",
"title": ""
},
{
"docid": "56845e541f8c60459d660a9584a2622d",
"score": "0.571186",
"text": "def refresh\n @ordered_instances = nil\n end",
"title": ""
},
{
"docid": "2067bf1ffd3d6b0b13816bbb0dd796b4",
"score": "0.5670072",
"text": "def _stream\n buffer = RingBuffer.new(100)\n remaining = @limit > 0 ? reverse_each.to_a : []\n\n loop do\n remaining.push(*fetch_prev_listing)\n remaining.reverse_each do |o|\n next if buffer.include?(o.id)\n buffer.add(o.id)\n yield o\n end\n remaining.clear\n end\n end",
"title": ""
},
{
"docid": "afee317e14b94d4e65d0ba35e1a6074b",
"score": "0.56621635",
"text": "def each\r\n while data = self.fetch\r\n yield(data)\r\n end\r\n end",
"title": ""
},
{
"docid": "ef1ceb4c4454e5f4f4d82ea9c3cd9fc9",
"score": "0.5661517",
"text": "def saved_objects\n User.where(:id => saved_items.pluck(:obj_id)).order(:id)\n end",
"title": ""
},
{
"docid": "f63e7b899474558b95cc89b72da87b5b",
"score": "0.56537074",
"text": "def fetch_all\n\t\tresult = []\n\t\teach_record do |record|\n\t\t\tresult.push(record)\n\t\tend\n\t\treturn result\n\tend",
"title": ""
},
{
"docid": "827f4343fbbcef7c0a1df102d2fc470a",
"score": "0.56513727",
"text": "def retrieve_all(type)\n begin\n object_data = []\n _page = 1\n begin\n _result = @api.resource(type.to_sym).call(:index, params = { :page => _page.to_s })\n object_data.concat(_result['results'])\n _page += 1\n end while _result['results'] != []\n rescue => e\n raise(Exception, \"\\n Could not retreive dat from #{@url} for type #{type}: #{e.inspect}\")\n end\n object_data\nend",
"title": ""
},
{
"docid": "117ebee86c9ffe4cf292141c4ef4f781",
"score": "0.563393",
"text": "def lazy_order_by(objects, field)\n case field\n when :mapviews\n lazy_order_by_mapviews(objects)\n when :row_count\n lazy_order_by_row_count(objects)\n when :size\n lazy_order_by_size(objects)\n end\n end",
"title": ""
},
{
"docid": "58a258728c31303d69809e960a5cbb4e",
"score": "0.56282574",
"text": "def cycle\n fetch\n decode\n execute\n end",
"title": ""
},
{
"docid": "a0ab2bb60ff97b2d6b27511ab0c469c2",
"score": "0.56179476",
"text": "def objects_on_remote_for(job)\n cloud_io.objects(remote_path_for(job)).sort_by(&:name)\n end",
"title": ""
},
{
"docid": "05173fe8c19a438b9acca1bd867649b0",
"score": "0.56177855",
"text": "def fetch_recent_orders\n\t #puts \"FETCH_RECENT_ORDERS: last date is #{get_last_date}\"\n\t\tfetch_orders(get_last_date, Time.now)\n\t\t#puts \"FETCH_RECENT_ORDERS: finishing\"\n\tend",
"title": ""
},
{
"docid": "d84a1492f33dddac8a01765844b5109d",
"score": "0.5616329",
"text": "def saved_objects\n object_ids = saved_items.pluck(:obj_id)\n objects = Issue.where(:id => object_ids).order(:id).preload(:tracker, :priority, :status)\n end",
"title": ""
},
{
"docid": "8d114d644079aa53d0f62b7200eec555",
"score": "0.5599208",
"text": "def each\n while data = self.fetch\n yield(data)\n end\n end",
"title": ""
},
{
"docid": "8d114d644079aa53d0f62b7200eec555",
"score": "0.5599208",
"text": "def each\n while data = self.fetch\n yield(data)\n end\n end",
"title": ""
},
{
"docid": "79df9412fafeb1dec0c3a8751688bcb2",
"score": "0.5590478",
"text": "def fetch\n if Settings.opt_batch\n priorities.each {|rn| Catalog.instance.get(rn).fetch}\n else\n Catalog.instance.get(priorities.last).fetch\n end\n end",
"title": ""
},
{
"docid": "3bf86275973b53a59624b4da7f5d79ea",
"score": "0.55864364",
"text": "def retrieve_photos\n retrieve_flickr\n retrieve_tweets\n\n @all_photos.sort_by! do |photo|\n -photo.values[0]\n end\n\n puts @all_photos\nend",
"title": ""
},
{
"docid": "7c087f3281a045e6f79690310fd6dd52",
"score": "0.5585636",
"text": "def fetch(ids)\n data = nil\n\n model.synchronize do\n ids.each do |id|\n redis.queue(\"HGETALL\", namespace[id])\n end\n\n data = redis.commit\n end\n\n return [] if data.nil?\n\n [].tap do |result|\n data.each_with_index do |atts, idx|\n if atts.is_a?(Array) && atts.size > 0\n result << model.new(Utils.dict(atts).update(:id => ids[idx]))\n end\n end\n end\n end",
"title": ""
},
{
"docid": "28d32573b7f24a7794cb114945fdf2db",
"score": "0.55818737",
"text": "def get(*args)\n adapter = adapter_from_args(*args)\n objs = extract_from(connection(adapter || :default).get(*args))\n # puts \"#{objs ? objs.length : 0} objects.\"\n # puts \"Like #{objs[0].inspect}\" if objs\n if objs.is_a?(Array)\n safe = 1\n while(objs[-1].respond_to?(:meta) && objs[-1].meta['total'] > objs.length && objs[-1].meta['next'])\n safe += 1\n objs.concat(extract_from(connection(adapter || :default).raw_get(objs[-1].meta['next'])))\n break if safe >= 50 # Safeguard: if we do 50 requests we're probably on a runaway. Paginating at 50/page would be 2500 records...\n end\n objs.each {|e| e.instance_variable_set(:@adapter, adapter)} if adapter\n else\n objs.instance_variable_set(:@adapter, adapter) if adapter\n end\n # puts \"TOTAL #{objs ? objs.length : 0} objects in all.\"\n # puts \"Like #{objs[-1].inspect}\" if objs\n objs\n end",
"title": ""
},
{
"docid": "3b380c59cdcddd92aac06a33fb4c9a2d",
"score": "0.5578322",
"text": "def find_all_batches\n PharmacyBatch.order(date_created: :desc)\n end",
"title": ""
},
{
"docid": "3b380c59cdcddd92aac06a33fb4c9a2d",
"score": "0.5578322",
"text": "def find_all_batches\n PharmacyBatch.order(date_created: :desc)\n end",
"title": ""
},
{
"docid": "3b380c59cdcddd92aac06a33fb4c9a2d",
"score": "0.5578322",
"text": "def find_all_batches\n PharmacyBatch.order(date_created: :desc)\n end",
"title": ""
},
{
"docid": "e9c5fbd94f98f3ca0fb6c202877c0759",
"score": "0.5577843",
"text": "def all_whatever\n puts \"Which API would you like to use? (people, planets, films, species, vehicles, starships)\"\n thing = gets.chomp\n all_objects = RestClient.get(\"http://www.swapi.co/api/#{thing}/\")\n objects_hash = JSON.parse(all_objects)\n objects_data = []\n\n while (!!all_objects)\n objects_data << objects_hash.fetch(\"results\")\n break if (objects_hash.fetch(\"next\") == nil)\n all_objects = RestClient.get(objects_hash.fetch(\"next\"))\n objects_hash = JSON.parse(all_objects)\n end\n objects_data.flatten\nend",
"title": ""
},
{
"docid": "320e6c0e2b3954c890bb14424709bfe5",
"score": "0.55737704",
"text": "def fetch\n if Settings.opt_batch\n priorities.each {|rn| Catalog.get(rn).fetch}\n else\n Catalog.get(priorities.last).fetch\n end\n end",
"title": ""
},
{
"docid": "fa92b513524a3ee4a7437fab3bf786bc",
"score": "0.5566721",
"text": "def fetch_pages\n items = all\n list = graph.get_objects(items.map(&:page_id), { fields: [:id, :name, :picture] }) rescue {}\n items.each do |item|\n item.page = list[item.page_id.to_s]\n end\n items\n end",
"title": ""
},
{
"docid": "0ed4a457c87c33d1a18b4c3e8bdd7040",
"score": "0.5566452",
"text": "def fetch_all\n @git_repo_list.each do |repo|\n self.fetch(repo)\n end\n end",
"title": ""
},
{
"docid": "e57c77ad133b174530b8b6da30e7b6ea",
"score": "0.5561555",
"text": "def index\n @people = Person.all.includes(:creator, :updater)\n @recent_objects = Person.order(updated_at: :desc).limit(10)\n end",
"title": ""
},
{
"docid": "a9ca0c3587153526d0763bba7427bf99",
"score": "0.5554991",
"text": "def fetch\r\n end",
"title": ""
},
{
"docid": "16cf778cf40db788335bfdd7efe96145",
"score": "0.5546383",
"text": "def eager_ordered\n ordered_elements = []\n elements = {}\n\n all.each do |element|\n if ordered_elements.empty? && element.first?\n ordered_elements << element\n else\n elements[element.id] = element\n end\n end\n\n raise 'Multiple or no first items in the list where found. Consider defining a siblings method' if ordered_elements.length != 1 && elements.length > 0\n\n elements.length.times do\n ordered_elements << elements[ordered_elements.last.next_id]\n end\n ordered_elements.compact\n end",
"title": ""
},
{
"docid": "d141b95196373e29fa7190ca58290067",
"score": "0.5543901",
"text": "def fetch_data!\n ZendeskTicketsFetchJob.perform_later\n @tickets ||= Db::Ticket.order(recorded_at: :desc)\n end",
"title": ""
},
{
"docid": "e22403783c9867f66290c3b935dd45a2",
"score": "0.5539051",
"text": "def get_all(obj, *args)\n handler(obj).get_all(obj, *args)\n end",
"title": ""
},
{
"docid": "6130ee6e85a9c2bea32bb53a1988f93b",
"score": "0.55322635",
"text": "def objects\n return @objects if ! @objects.empty?\n\n objects = []\n key_marker = nil\n begin\n more_objects = s3_service(name).list_objects(bucket: @name, marker: key_marker)\n\n if more_objects.contents\n\tobjects += more_objects.contents.compact\n end\n\n key_marker = more_objects.contents[-1].key unless more_objects.contents.empty?\n\n end while more_objects.is_truncated \n @objects = objects\n end",
"title": ""
},
{
"docid": "216eb53cc045a169bb4b0d1cad8515db",
"score": "0.55139536",
"text": "def fetch\n history = []\n params = {\n 'user' => \"#{@user_key}\",\n 'start' => @cursor,\n 'count' => @rpp,\n 'method' => HISTORY_METHOD\n }\n output = []\n \n attempts = 1\n while output.length == 0 do\n history = do_post(HISTORY_PATH, params)\n \n if history.size > 0\n history['result']['sources'].each_with_index do |source, i|\n source['tracks'].each do |item|\n output << Item.new(item, source['extraTrackKeys'])\n end\n end\n end\n\n if output.length == 0 then\n puts \"Oops...no data even though last result said we are not done....trying again. attempt #{attempts}. cursor is at #{@cursor}\"\n attempts += 1\n sleep(1)\n else\n @cursor = history['result']['last_transaction']\n if history['result']['doneLoading'] then\n return nil\n end\n end\n end\n return output\n end",
"title": ""
},
{
"docid": "96bfa0882124dc9c6a93334d2e3c966a",
"score": "0.5513914",
"text": "def fetch_all()\n puts \"fetching\"\n m = @db[:\"#{COLLECTION_NAME}\"].find({})\n puts \"fetched...\"\n return m\n end",
"title": ""
},
{
"docid": "3413a2492b6f5d7e4d638ca4f83b6f07",
"score": "0.5511302",
"text": "def fetch\n end",
"title": ""
},
{
"docid": "2e58c487076e08ee7ad155a3c57b59a4",
"score": "0.5509764",
"text": "def fetch_results\n @results = []\n fetch_task_results\n fetch_project_results\n @results\n end",
"title": ""
},
{
"docid": "6f16b497a2d603e1cd738848aa2a31ad",
"score": "0.55086327",
"text": "def fetch\n fetch_and_save_runs(list_all_runs())\n end",
"title": ""
},
{
"docid": "f4d18f0ec18fe0c7572b39c27fa71065",
"score": "0.55078036",
"text": "def all_objects(opts = {})\n objects(\"*\", opts)\n end",
"title": ""
},
{
"docid": "1d16acb1d0c63165cb2914746463e57f",
"score": "0.5506782",
"text": "def objects(reload = false)\n if reload or @objects.nil?\n @objects = list_bucket\n else\n @objects\n end\n end",
"title": ""
},
{
"docid": "82039da7974aa98c1ed506e8a4d59e73",
"score": "0.5505734",
"text": "def all_dependencies\n recursive_fetch(self.name)\n while [email protected]?\n sleep 0.02\n end\n @all_dependencies.keys - [self.name] # just need to remove initial \n end",
"title": ""
},
{
"docid": "e2d486c2d7e0275c26c28e8be78994aa",
"score": "0.5504366",
"text": "def activity\n objects = links.take(15) + comments.take(15)\n objects = objects.sort_by(&:created_at).reverse\n end",
"title": ""
},
{
"docid": "1f2c1296e028192e04d266d04f6780b9",
"score": "0.5502299",
"text": "def fetch_all (a1=\"bts\",a2=\"cny\",max_orders=5)\n\n markets = my_compare_markets\n\n obs = []\n\n markets.each do |m|\n begin\n #if \"method\" == defined? \"fetch_\"+m\n obs.push send \"fetch_\"+m, a1, a2, max_orders\n #end\n rescue Exception => e\n print \"fetch_\"+m+\" error: \"\n puts e\n end\n end\n\n #compare_ob obs[0], obs[2]\n compare_obs obs\n\nend",
"title": ""
},
{
"docid": "c14940e429719655bb909a21b964079d",
"score": "0.54920846",
"text": "def order_list\n\t\t@cards = @cards.order(:name)\n\tend",
"title": ""
},
{
"docid": "55f71a275e58251ec0d2ad8e3bab0e5c",
"score": "0.54890025",
"text": "def load_associations(results, prefetchs)\n p_queries = prefetch_queries prefetchs, results\n a_queries = association_queries results\n objects = Tire.multi (p_queries+a_queries)\n prefetch_results prefetchs, results, objects[0...p_queries.size]\n association_results results, objects[p_queries.size..-1] \n end",
"title": ""
},
{
"docid": "2251a61839ee692ce14213716ce8d246",
"score": "0.5483238",
"text": "def fetch_articles\n log(\"fetch_articles\")\n\n # `while`-loop erzeugte anscheinend ein Scoping-Problem - die Notifications\n # wurden nie getriggert.\n # TODO: Bugreport im MacRuby-Trac\n \n (3 - @open_connections).times do\n if @list_index < @id_list.size\n a = @id_list[@list_index]\n\n # NSLog(\"Queue fetch: #{a[:id]}\")\n\n a[:article] = Article.new( a[:id], a[:title] )\n a[:article].fetch\n\n @open_connections += 1\n @list_index += 1\n end\n end\n end",
"title": ""
},
{
"docid": "d359b113cc70e66b997863b4488f9d26",
"score": "0.54815364",
"text": "def objects(prefix)\n objects = []\n resp = nil\n prefix = prefix.chomp(\"/\")\n opts = { \"prefix\" => prefix + \"/\" }\n\n while resp.nil? || resp.body[\"IsTruncated\"]\n opts[\"marker\"] = objects.last.key unless objects.empty?\n with_retries(\"GET '#{bucket}/#{prefix}/*'\") do\n resp = connection.get_bucket(bucket, opts)\n end\n resp.body[\"Contents\"].each do |obj_data|\n objects << Object.new(self, obj_data)\n end\n end\n\n objects\n end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.5470666",
"text": "def fetch; end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.5470666",
"text": "def fetch; end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.5470666",
"text": "def fetch; end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.5470666",
"text": "def fetch; end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.5470666",
"text": "def fetch; end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.5470666",
"text": "def fetch; end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.5470666",
"text": "def fetch; end",
"title": ""
},
{
"docid": "30b24f0a92c8a7f9dd1411b860d95ef4",
"score": "0.5470666",
"text": "def fetch; end",
"title": ""
},
{
"docid": "9379619961d0bf51b0590d79d3063c2f",
"score": "0.54668325",
"text": "def objects\n @@objects_by_id\n end",
"title": ""
},
{
"docid": "bd508ec133b6ad233d7f03101cab126e",
"score": "0.5465344",
"text": "def fetch_activerecords(records)\n @options[:result_klass] = result_klass\n\n if records.empty?\n if @options.paginate?\n return records.paginate(@options.opts_for_paginate(records))\n else\n return records\n end\n end\n\n ids = AridCache.framework.active_record? && records.first.is_a?(ActiveRecord) ? records.collect { |record| record[:id] } : records\n find_opts = @options.opts_for_find(ids)\n if order_in_database?\n if @options.paginate?\n if AridCache.framework.active_record?(:>=, 3)\n page_opts = @options.opts_for_paginate(ids)\n WillPaginate::Collection.create(page_opts[:page], page_opts[:per_page], page_opts[:total_entries]) do |pager|\n result = AridCache.find_all_by_id(result_klass, ids, find_opts.merge(:limit => pager.per_page, :offset => pager.offset))\n pager.replace(result)\n end\n else\n find_opts.merge!(@options.opts_for_paginate(ids))\n result_klass.paginate(ids, find_opts)\n end\n else\n AridCache.find_all_by_id(result_klass, ids, find_opts)\n end\n else\n # Limits will have already been applied, remove them from the options for find.\n [:offset, :limit].each { |key| find_opts.delete(key) }\n result = AridCache.find_all_by_id(result_klass, ids, find_opts)\n\n # Order in memory\n if @options.order_by_proc?\n result.sort!(&@options[:order])\n elsif AridCache.order_in_memory?\n object_map =\n result.inject({}) do |hash, record|\n hash[record.id] = record unless record.nil?\n hash\n end\n result = \n ids.inject([]) do |array, id|\n if value = object_map[id]\n array << value\n end\n array\n end\n end\n records.is_a?(::WillPaginate::Collection) ? records.replace(result) : result\n end\n end",
"title": ""
},
{
"docid": "fd7748b1c18f2c5fe98face1eca21bca",
"score": "0.5457557",
"text": "def index\n\t\t@batches = Batch.order(updated_at: :desc)\n\tend",
"title": ""
},
{
"docid": "df01f92a45d11afdc8e75cccf6ae807c",
"score": "0.54549474",
"text": "def list\n list = self.all.map {|object| object.name}\n list.sort!\n return list\nend",
"title": ""
},
{
"docid": "a3d1085cb4969347b88b469233598a43",
"score": "0.54549104",
"text": "def fetch_all\n start_time = DateTime.now\n\n keys = (1..@latest_issue_key).map { |key_number| @project_key + \"-\" + key_number.to_s }\n keys_with_errors = fetch(keys)\n\n @repo.save_state({\"time\" => start_time, \"errors\" => keys_with_errors})\n end",
"title": ""
},
{
"docid": "97f2b34f717249deb2f83f4bb69f40ef",
"score": "0.5452158",
"text": "def fetch_loop\n retry_count = User::FETCH_RETRY_LIMIT\n while retry_count > 0 && need_to_fetch?\n yield\n retry_count -= 1\n end\n end",
"title": ""
},
{
"docid": "2d74768eda7dbf8f7a1823d51bfca9f7",
"score": "0.544989",
"text": "def index\n @objs = Obj.all\n end",
"title": ""
},
{
"docid": "f35608ff3c5b612e7b0c7697dfa1b080",
"score": "0.5446131",
"text": "def fetch_results\n the_big_resultset = []\n \n (1...100).each do |idx|\n Result res = Result.new(:id => idx, :rate => rand(1000), :currency_code => 'USD')\n the_big_resultset << res\n end\n \n the_big_resultset\n end",
"title": ""
},
{
"docid": "40351ffdd4a59ea3a8f459199a350475",
"score": "0.54458946",
"text": "def all\n return if self.keys.nil?\n @all ||= load_robjects @bucket.get_many(@keys)\n end",
"title": ""
},
{
"docid": "c4e6568f9b5aca4279abd9d4256c437f",
"score": "0.54448426",
"text": "def objects(name = nil, options = {})\n find(name, options).object_cache\n end",
"title": ""
},
{
"docid": "74c1317a45b378f31f0cdd6a5757c624",
"score": "0.5428994",
"text": "def index\n orders = OrdersProgress.all.sort_by(&:id)\n\n @rows = orders\n\n end",
"title": ""
},
{
"docid": "ce42bc52a3c7d34ecdc29f5cbf52d037",
"score": "0.5411795",
"text": "def index\n @fetchers =\n model_class.includes(:genre, :segment, :item_code)\n .order(created_at: :desc).page(params[:page])\n end",
"title": ""
},
{
"docid": "6a1eccb4c61cbd34909e3cf0940b1ae5",
"score": "0.54093635",
"text": "def index\n @active_orders = ActiveOrder.order(\"id desc\").take(50)\n end",
"title": ""
}
] |
2fff2eefcfb12256ee79cb22c4f193ef
|
Describes the return value (and type or types) of a method. You can list multiple return tags for a method in the case where a method has distinct return cases. In this case, each case should begin with "if ...".
|
[
{
"docid": "ab14e6233a9e912a427b0d6105dd1a1a",
"score": "0.5047738",
"text": "def return_tag(text); end",
"title": ""
}
] |
[
{
"docid": "e502b5fd556a7443474986364c4c9904",
"score": "0.6182931",
"text": "def capture_return_type\n matches = @code.scan(/^\\s*[+-]\\s*\\(([^\\(\\)]*)\\)/)\n return nil if matches.size != 1\n type = matches[0][0].to_s.gsub(TAILMATCH, '')\n\n if type == 'void' || type == 'IBAction'\n @returns = nil\n else\n @returns = type\n end\n end",
"title": ""
},
{
"docid": "26bef49ff84e886e74662d5e02421470",
"score": "0.6151477",
"text": "def conditional_returned_types(defn)\n returns = defn[3][1].rest.select do |child|\n child[0] == :call and child[2] == :returned_if\n end\n if returns.any?\n returns.reduce({}) do |hash,rule|\n hash.merge({rule[3].rest.map { |arg| arg[1].to_s } .join('_') =>\n rule[1][1]})\n end\n end\n end",
"title": ""
},
{
"docid": "10ae046a9e605694c5bcaf1d99b2c1a2",
"score": "0.6013713",
"text": "def return_a_value\n \"Nice\"\nend",
"title": ""
},
{
"docid": "cbfd9f8702c76d3c76641c3a542bc91b",
"score": "0.60070056",
"text": "def method_with_explicit_return\n :a_non_return_value\n return :return_value\n :another_non_return_value\n end",
"title": ""
},
{
"docid": "cae0b6cee58832c46d32b864a66a868a",
"score": "0.59945124",
"text": "def acceptable_return?(return_val, element_name); end",
"title": ""
},
{
"docid": "318681f8bfb6aba7bbbcf391df54600d",
"score": "0.59295845",
"text": "def returns\n parsed {\n @returns\n }\n end",
"title": ""
},
{
"docid": "aa4b0b8a813d45010414c12cf7f3e424",
"score": "0.58425695",
"text": "def method_and_value; end",
"title": ""
},
{
"docid": "78bae5cde7f872fb4fec6733c260a626",
"score": "0.5840039",
"text": "def return_type_void\n @return_type_void\n end",
"title": ""
},
{
"docid": "061b4ec068182f551a27612b65c671bb",
"score": "0.58258086",
"text": "def return_type; end",
"title": ""
},
{
"docid": "061b4ec068182f551a27612b65c671bb",
"score": "0.58258086",
"text": "def return_type; end",
"title": ""
},
{
"docid": "061b4ec068182f551a27612b65c671bb",
"score": "0.58258086",
"text": "def return_type; end",
"title": ""
},
{
"docid": "bf65a49f4705a32f0f5a0085509c0fea",
"score": "0.57429564",
"text": "def returnsomething\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 18 )\n\n begin\n # at line 613:5: expression\n @state.following.push( TOKENS_FOLLOWING_expression_IN_returnsomething_848 )\n expression\n @state.following.pop\n # --> action\n\n \trt = @stack_operands.pop\n rt_t = @stack_types.pop\n if(rt_t != @current_method.return_type)\n raise \"Invalid return type #{rt_t} in the #{@current_method.return_type} type method #{@current_class.name}::#{@current_method.name}\"\n end\n generate('ret', nil, nil ,rt )\n @is_returning = true\n free_avail(rt)\n free_avail_const(rt)\n \n \n # <-- action\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 18 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "8e1da4f8611e0e2ba502175237bf1754",
"score": "0.56685615",
"text": "def returns_something?; @return_type || !@returned_arguments.empty? end",
"title": ""
},
{
"docid": "825c5e1e7218b83071a08fe7b13e69d8",
"score": "0.56485033",
"text": "def supports_returning?(type)\n true\n end",
"title": ""
},
{
"docid": "825c5e1e7218b83071a08fe7b13e69d8",
"score": "0.56485033",
"text": "def supports_returning?(type)\n true\n end",
"title": ""
},
{
"docid": "dba7beeba8d70bc44d05fabde49f511f",
"score": "0.55660224",
"text": "def some_method(x)\n if x > 5 && x < 10\n return :a\n elsif x < 5\n return :b\n end # else??\n \n :c\nend",
"title": ""
},
{
"docid": "5f8a25b50efbe7dbcbbe60f560fdc30e",
"score": "0.55621624",
"text": "def return_value; end",
"title": ""
},
{
"docid": "05e99f0f104873d9289aff7a1b762bc2",
"score": "0.5540812",
"text": "def compile_return_statement\n write_tag '<returnStatement>'\n consume(TokenType::RETURN)\n compile_expression unless check?(';') # empty expression case\n consume(';')\n write_tag '</returnStatement>'\n end",
"title": ""
},
{
"docid": "55b7f91f86f3880743a5e16c312af067",
"score": "0.551971",
"text": "def returns?\n branch_type == 'return'\n end",
"title": ""
},
{
"docid": "f8ff1baa141b82c4ecb0bc6b5c3533d9",
"score": "0.5499855",
"text": "def create_html_public_method_return_type(xml, pre, output)\n if !output.nil? && !output[0].blank?\n complex_class = output[0].find_complex_class_name\n if WashoutBuilder::Type::BASIC_TYPES.include?(output[0].type)\n xml.span('class' => 'blue') { |y| y << \"#{output[0].type}\" }\n else\n html_public_method_complex_type(pre, output, complex_class)\n end\n else\n pre << 'void'\n end\n end",
"title": ""
},
{
"docid": "b5ffc33a7ea5b6dfda7af0a5b90bcd01",
"score": "0.54994994",
"text": "def returned_type(defn)\n single_returned_type(defn) or conditional_returned_types(defn)\n end",
"title": ""
},
{
"docid": "b2b04cf723db5c736280aa8ce6538e46",
"score": "0.54946154",
"text": "def capture_return\n @returns = @code.split(/\\(/).first !~ /void/ \n end",
"title": ""
},
{
"docid": "90be3b84c147671bad183c5a4691b2f3",
"score": "0.54457486",
"text": "def expected_value_requests_return?(type, condition)\n ret_type = \"return_#{type}\"\n condition == ret_type || condition.is_a?(Array) && condition.include?(ret_type)\n end",
"title": ""
},
{
"docid": "afa1afcb3838a1b9783d6c92efdab5f9",
"score": "0.5438496",
"text": "def parse_function_return\n return_kw = expect(:KW_RETURN)\n value = nil\n\n unless peek?(:SEPARATOR)\n value = parse_expression\n end\n\n ret = StmtReturn.new(@curr_parsed_method, value, return_kw)\n\n @curr_parsed_method.returns << ret\n\n ret\n end",
"title": ""
},
{
"docid": "dd68931a1a7f77eb4fd41ce35988a9bb",
"score": "0.5428071",
"text": "def returns; end",
"title": ""
},
{
"docid": "debc1118c06a15262009b8cbf9dd7fed",
"score": "0.542432",
"text": "def print_me\n return \"I'm printing the return value!\"\nend",
"title": ""
},
{
"docid": "619d1131b4b98f22592390e9c0e40747",
"score": "0.53219575",
"text": "def searchNCheckReturn(fooName,fooType)\n if !fooType.nil?\n attrs.each do |a|\n if a.class.to_s == \"Return\"\n raise ReturnTypeError::new(fooName, a.expression.type(), fooType, a.expression.line()) unless a.expression.type() == fooType\n return true\n end\n return a.searchNCheckReturn(fooName, fooType) if a.respond_to? :searchNCheckReturn\n end\n else\n attrs.each do |a|\n return true if a.class.to_s == \"Return\"\n return a.searchNCheckReturn(fooName, fooType) if a.respond_to? :searchNCheckReturn\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "6e7885813669fd647301a6b423b0cab6",
"score": "0.53168315",
"text": "def print_me_2\n \"I'm printing the return value!!!\"\nend",
"title": ""
},
{
"docid": "39558e2a63b45104d2fe3c33556e6af2",
"score": "0.53003025",
"text": "def return_type\n self.class.const_get(:RETURN_TYPE)\n end",
"title": ""
},
{
"docid": "298d79fe57852271a7cfc8a51a2aa8a7",
"score": "0.5294908",
"text": "def return_val_type\n TypeSpec.new(@spec['return']['type'])\n end",
"title": ""
},
{
"docid": "ecc966296ad330be810e6ea96968518f",
"score": "0.5280024",
"text": "def returns val = nil\n @returns = val\n self\n end",
"title": ""
},
{
"docid": "ec52c9ab4783144aff409e86363f0e7b",
"score": "0.52694917",
"text": "def returnstmt\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 17 )\n\n begin\n # at line 608:4: 'return' ( returnsomething )? ';'\n match( T__43, TOKENS_FOLLOWING_T__43_IN_returnstmt_820 )\n # at line 608:13: ( returnsomething )?\n alt_21 = 2\n look_21_0 = @input.peek( 1 )\n\n if ( look_21_0.between?( IDENTIFIER, INTEGER ) || look_21_0.between?( FLOAT, NULL ) || look_21_0 == T__28 || look_21_0 == T__41 || look_21_0.between?( T__49, T__51 ) )\n alt_21 = 1\n end\n case alt_21\n when 1\n # at line 608:13: returnsomething\n @state.following.push( TOKENS_FOLLOWING_returnsomething_IN_returnstmt_822 )\n returnsomething\n @state.following.pop\n\n end\n match( T__31, TOKENS_FOLLOWING_T__31_IN_returnstmt_825 )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 17 )\n\n end\n \n return \n end",
"title": ""
},
{
"docid": "aa80aad2442773a0c71ea205dae7ab9e",
"score": "0.526927",
"text": "def print_me\n \"I'm printing the return value\"\nend",
"title": ""
},
{
"docid": "3dd678ce5a7c2d228ff2fe40d2442d5a",
"score": "0.5266033",
"text": "def status\n return \"skipped\" if skipped?\n return \"never\" if never?\n return \"missed\" if missed?\n return \"covered\" if covered?\n end",
"title": ""
},
{
"docid": "2f53ad3f5162b47658c865cbc1ac2bb1",
"score": "0.52527183",
"text": "def returns(type, doc = \"\")\n @return_value = ReturnValue.new(loader.resolve_interface_type(type), doc)\n self\n end",
"title": ""
},
{
"docid": "37a1d29f10baf2595645c2fa085d97bb",
"score": "0.52414477",
"text": "def parse_returns(section)\n returns, raises, current = [], [], []\n\n lines = section.split(\"\\n\") \n lines.each do |line|\n case line\n when /^Returns/\n returns << line\n current = returns\n when /^Raises/\n raises << line\n current = raises\n when /^\\s+/\n current.last << line.squeeze(' ')\n else\n current << line # TODO: What to do with non-compliant line?\n end\n end\n\n @returns, @raises = returns, raises\n end",
"title": ""
},
{
"docid": "f2dfdd98bddcb54d93902799930a0dc7",
"score": "0.5241153",
"text": "def test_method\n return \"The method will return this string here!\"\n puts \"This line of code will not run.\"\nend",
"title": ""
},
{
"docid": "3b97304543c8bac91881616260fa1a5e",
"score": "0.5239679",
"text": "def check_method_return(ast_class_name, method, class_lut)\n\tif not (class_lut.include? method.type or method.type == \"SELF_TYPE\")\n\t\tline_number = method.type_line\n\t\tmessage = \"class #{ast_class_name} has method #{method.name} with unknown return type #{method.type}\"\n\t\ttype_error(line_number, message)\t\t\t\n\tend\nend",
"title": ""
},
{
"docid": "3b97304543c8bac91881616260fa1a5e",
"score": "0.5239679",
"text": "def check_method_return(ast_class_name, method, class_lut)\n\tif not (class_lut.include? method.type or method.type == \"SELF_TYPE\")\n\t\tline_number = method.type_line\n\t\tmessage = \"class #{ast_class_name} has method #{method.name} with unknown return type #{method.type}\"\n\t\ttype_error(line_number, message)\t\t\t\n\tend\nend",
"title": ""
},
{
"docid": "ec9242ad34ffa5f74a8f538f04cb37c1",
"score": "0.5234618",
"text": "def print_me\n \"I'm printing the return value!\"\nend",
"title": ""
},
{
"docid": "ec9242ad34ffa5f74a8f538f04cb37c1",
"score": "0.5234618",
"text": "def print_me\n \"I'm printing the return value!\"\nend",
"title": ""
},
{
"docid": "ec9242ad34ffa5f74a8f538f04cb37c1",
"score": "0.5234618",
"text": "def print_me\n \"I'm printing the return value!\"\nend",
"title": ""
},
{
"docid": "ec9242ad34ffa5f74a8f538f04cb37c1",
"score": "0.5234618",
"text": "def print_me\n \"I'm printing the return value!\"\nend",
"title": ""
},
{
"docid": "ec9242ad34ffa5f74a8f538f04cb37c1",
"score": "0.5234618",
"text": "def print_me\n \"I'm printing the return value!\"\nend",
"title": ""
},
{
"docid": "f9fb4412192e529927d5a183e0838181",
"score": "0.52082753",
"text": "def generic_return(code)\n code.call\n return \"generic_return method finished\"\nend",
"title": ""
},
{
"docid": "2fa7893344e3ded3ce874bb79262e763",
"score": "0.519951",
"text": "def return\n @v_return\n end",
"title": ""
},
{
"docid": "0307a6466c19ba4993d2628e56f10357",
"score": "0.51929325",
"text": "def metodo_con_return\n return 2 + 5\nend",
"title": ""
},
{
"docid": "4b1ca82090465508ebcf04dec50cf0d6",
"score": "0.518858",
"text": "def method\n \"result\"\nend",
"title": ""
},
{
"docid": "4b1ca82090465508ebcf04dec50cf0d6",
"score": "0.518858",
"text": "def method\n \"result\"\nend",
"title": ""
},
{
"docid": "1cf16210f6085d80333828c4e68f9964",
"score": "0.518095",
"text": "def returning(expression, name=nil)\n str = \"returning #{expression}\"\n str += \" as #{name}\" if name\n @returning_expression = str\n end",
"title": ""
},
{
"docid": "6d427aaa67d2d052dfc2694ad698903a",
"score": "0.51806027",
"text": "def result\n\t\treturn get_tlv_value(TLV_TYPE_RESULT)\n\tend",
"title": ""
},
{
"docid": "6d427aaa67d2d052dfc2694ad698903a",
"score": "0.51806027",
"text": "def result\n\t\treturn get_tlv_value(TLV_TYPE_RESULT)\n\tend",
"title": ""
},
{
"docid": "ceede5bca05080885837f18d8a631c57",
"score": "0.51634055",
"text": "def tagMethod?()\r\n\t\tlang = language()\r\n\t\treturn (@type == \"m\" || @type==\"f\") if (lang == \"java\")\r\n\t\treturn (@type == \"f\") if (lang == \"cpp\")\r\n\tend",
"title": ""
},
{
"docid": "0e3fa84590c32d787e8064806578e921",
"score": "0.5159961",
"text": "def ret!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 1)\n\n type = RET\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 7:7: 'returns'\n match(\"returns\")\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__, 1)\n\n end",
"title": ""
},
{
"docid": "c68cc3e993c957e53abb24de7b281e84",
"score": "0.5147773",
"text": "def return_label\n @slot_instructions.each do |ins|\n next unless ins.is_a?(Label)\n return ins if ins.name == \"return_label\"\n end\n end",
"title": ""
},
{
"docid": "8a23ca428567160c364b8bb483a8c555",
"score": "0.51118815",
"text": "def minimal_return_block(prop, spaces)\n type = python_type(prop)\n # Complex types only mentioned in reference to RETURNS YAML block\n # Complex types are nested objects traditionally, but arrays of nested\n # objects will be included to avoid linting errors.\n type = 'complex' if prop.is_a?(Api::Type::NestedObject)|| \\\n (prop.is_a?(Api::Type::Array) && \\\n prop.item_type.is_a?(Api::Type::NestedObject))\n [\n minimal_yaml(prop, spaces),\n indent([\n 'returned: success',\n \"type: #{type}\"\n ], 4)\n ]\n end",
"title": ""
},
{
"docid": "ded96baeaee48d314566582747296895",
"score": "0.51109487",
"text": "def default_value_for(method)\n case method\n when :name then \"??????\"\n when :description, :banner then \"\"\n when :level, :banner_hue, :icon_index, :common_event_id then 0\n when :objectives, :rewards, :custom_categories then []\n when :prime_objectives then Array.new(objectives.size) { |x| x }\n when :concealed then QuestData::MANUAL_REVEAL\n when :manual_status then :active\n when :layout, :reward_given then false\n else \"\"\n end\n end",
"title": ""
},
{
"docid": "263b212962ada5e491e6966c15d5f176",
"score": "0.5103935",
"text": "def method_two(arg)\n case\n when arg > 0 then \"positive\"\n when arg < 0 then \"negative\"\t\n else \t\t\t\t\"zero\"\t\n end\nend",
"title": ""
},
{
"docid": "242087f75ae8c479bb864be35b9ad265",
"score": "0.5098405",
"text": "def api_return(rc=0, message ='', obj=nil, exception=nil )\n ret = {\n rc: exception ? (rc > 0 ? rc : 8) : rc,\n message: message\n }\n ret[:exception] = exception.to_s if exception\n ret[:return] = obj if obj\n ret\n end",
"title": ""
},
{
"docid": "69c10af8c4732909267f612bca05cbd1",
"score": "0.5087832",
"text": "def func1 val # Val should be inside round brackets ().\r\n if val = 1 # Requires == to check status\r\n return true # Indent both returns as they relate to the if and else.\r\n else\r\n return false\r\n end\r\nend",
"title": ""
},
{
"docid": "c98fb5e963908c02027e79196ec35235",
"score": "0.50754565",
"text": "def genEnding\n return ln(@resFieldName + ' += ' + @context.genMethCheckSum() + ';') if @type == 'void'\n res = ln('long meth_res = ' + @context.genMethCheckSum() + ';')\n res += ln(@resFieldName + ' += meth_res;')\n return res + ln('return meth_res % 2 > 0;') if @type == 'boolean'\n return res + ln('return;') if @constructorFlag\n res += ln('return (' + @type + ')meth_res;')\n end",
"title": ""
},
{
"docid": "7f31526357cfa93e2839ac5537db9349",
"score": "0.5060271",
"text": "def result?; end",
"title": ""
},
{
"docid": "76dcd44d84e759b460a4ff1ddd18ecbb",
"score": "0.504812",
"text": "def test_return\r\n { \r\n :int => {:type => \"int\", :name => 'cmock_to_return', :ptr? => false, :const? => false, :void? => false, :str => 'int cmock_to_return'},\r\n :int_ptr => {:type => \"int*\", :name => 'cmock_to_return', :ptr? => true, :const? => false, :void? => false, :str => 'int* cmock_to_return'},\r\n :void => {:type => \"void\", :name => 'cmock_to_return', :ptr? => false, :const? => false, :void? => true, :str => 'void cmock_to_return'},\r\n :string => {:type => \"char*\", :name => 'cmock_to_return', :ptr? => false, :const? => true, :void? => false, :str => 'const char* cmock_to_return'},\r\n }\r\n end",
"title": ""
},
{
"docid": "d70aa96456640f1be24527cd2aaa838e",
"score": "0.50323826",
"text": "def foo a\r\n if a==1; \"one\" elsif a==2; \"two\" else \"unknown\" end\r\nend",
"title": ""
},
{
"docid": "1002b5ab41ebf36f59dfad1d4136c6de",
"score": "0.50218576",
"text": "def single_returned_type(defn)\n returns = defn[3][1].rest.select do |child|\n child[0..2] == s(:call, nil, :returns)\n end\n if returns.count > 1\n raise 'Invalid stdlib class method definition: ' +\n \"#{@symbol_table.cclass}.#{defn[1]}\"\n elsif returns.count == 1\n returns[0][3][1][1]\n end\n end",
"title": ""
},
{
"docid": "41ae1a74b2960303ed6a7cd274798b8e",
"score": "0.5018655",
"text": "def myreturn\n @myreturn\n end",
"title": ""
},
{
"docid": "cc44e70ce8e126a99291308199fd6eda",
"score": "0.5018299",
"text": "def get_return_status_msg\n sql='SELECT meaning FROM rental_return_codes WHERE id = $1;'\n values=[@return_code]\n return SqlRunner.run(sql,values).first.map { |status| status[1] }[0]\nend",
"title": ""
},
{
"docid": "82aead042843f6484a3b49ed2be2e82b",
"score": "0.5018297",
"text": "def return_type\n as_java_type(@ast.return_type)\n end",
"title": ""
},
{
"docid": "a780e42811c59139e3daa1217c5f7a15",
"score": "0.5014035",
"text": "def no_return?\n !note[TSBS::NoReturnTAG].nil?\n end",
"title": ""
},
{
"docid": "a780e42811c59139e3daa1217c5f7a15",
"score": "0.5014035",
"text": "def no_return?\n !note[TSBS::NoReturnTAG].nil?\n end",
"title": ""
},
{
"docid": "6e8d2ee9bf9903af505c72d880c13fca",
"score": "0.50113356",
"text": "def return_values\n Calls.new(select(&:returned?))\n end",
"title": ""
},
{
"docid": "916afc6e6e5c554519d94968ab864240",
"score": "0.50103277",
"text": "def method_name\n def value\n 5\n end\nend",
"title": ""
},
{
"docid": "e84e43e8bd21ad2acb25460d4debd8c0",
"score": "0.5001267",
"text": "def gen\n res = ''\n res += ln('if (' + @condition.gen() + ') {') if @withinIf\n shift(1) if @withinIf\n checkSum = @context.method.context.genMethCheckSum()\n if @context.method.type == 'void'\n res += ln(@context.method.resFieldName + ' += ' + checkSum + ';') +\n ln('return;')\n elsif @context.method.type == 'boolean'\n res += ln('return ((int)(' + checkSum + ')) % 2 > 0;')\n else\n res += ln('return (' + @context.method.type + ')(' + checkSum + ');') if [email protected]==''\n res += ln('return;') if @context.method.type==''\n end\n shift(-1) if @withinIf\n res += ln('}') if @withinIf\n return res\n end",
"title": ""
},
{
"docid": "b17ecd5f5e77cbe3ab1c16cdd885ecd1",
"score": "0.4997974",
"text": "def method_missing(method, *args)\n\n # We could remove this check and return nil for any non-recognized tag.\n # The problem would be that it would make tricky to debug problems with\n # typos. For instance: <>.potr would return nil instead of raising an\n # exception\n unless supported_tags.include?(method)\n super\n return\n end\n\n # First we try the attributes. In Ruby we use snake_case, but in XML\n # CamelCase is used for some attributes\n translations_table = {\n :nexpose_id => 'id',\n :pci_severity => 'pciSeverity',\n :cvss_score => 'cvssScore',\n :cvss_vector =>'cvssVector'\n }\n\n method_name = translations_table.fetch(method, method.to_s)\n return @xml.attributes[method_name].value if @xml.attributes.key?(method_name)\n\n # Then we try simple children tags: description, solution\n tag = @xml.xpath(\"./#{method_name}/ContainerBlockElement\").first\n if tag\n lines = []\n\n # Go through Paragraphs and extract them.\n # FIXME: we're using .//. to get paragraphs nested in Nexpose lists,\n # ideally we'd convert this lists into Textile bullet point lists.\n tag.xpath(\".//Paragraph\").each do |xml_paragraph|\n lines << xml_paragraph.text.split(\"\\n\").collect(&:strip).join(' ').strip\n end\n\n return lines.join(\"\\n\\n\")\n end\n\n # Finally the enumerations: references, tags\n if method_name == 'references'\n @xml.xpath(\"./references/reference\").collect{|entry| {:source => entry['source'], :text => entry.text} }\n elsif method == 'tags'\n @xml.xpath(\"./tags/tag\").collect(&:text)\n else\n # nothing found, the tag is valid but not present in this ReportItem\n return nil\n end\n end",
"title": ""
},
{
"docid": "2392708c77a8651ffcb8d383a7993083",
"score": "0.49783057",
"text": "def return_value\n @return_value\n end",
"title": ""
},
{
"docid": "5bf249941657850e8bef7ba53690d82b",
"score": "0.49753892",
"text": "def render\n content = MessageBuilder.build do |msg|\n return_tag = tags.find do |tag|\n tag.tag_name == \"return\"\n end\n\n attr_kind = if reader? && writer?\n \"attr_accessor\"\n elsif reader? && !writer?\n \"attr_reader\"\n elsif writer? && !reader?\n \"attr_writer\"\n end\n\n msg.bold do\n msg.write path\n if return_tag\n types_signature = return_tag.types.join(\", \")\n msg.write(\" \\u{279c} (#{types_signature})\")\n end\n end\n\n msg.space\n\n msg.inline_code_block do\n msg.write(\"[#{type}, #{visibility}\")\n msg.write(\", #{attr_kind}\") if attr_kind\n msg.write(\", alias: #{name}\") if @alias\n msg.write(\"]\")\n end\n\n msg.newline\n\n if docstring.empty?\n if return_tag\n msg.write(return_tag.text.capitalize)\n else\n msg.italics do\n msg.write(\"No documentation available..\")\n end\n end\n else\n msg.write(docstring)\n end\n\n if signature\n msg.code_block do\n msg.write(signature)\n end\n end\n end\n\n Reply.new(content, embed)\n end",
"title": ""
},
{
"docid": "fb2d824f864991ca38b9fb5ecc79e5ba",
"score": "0.49591315",
"text": "def context_return_value(desired_test_result)\n raise 'desired_test_result value must be either \"pass\" or \"fail\"' unless\n %w[pass fail].include?(desired_test_result)\n\n if desired_test_result == 'fail'\n 'returns offending logical resource id'\n else\n 'returns empty list'\n end\nend",
"title": ""
},
{
"docid": "509eb312f855345ebf8315d1ba98ad0e",
"score": "0.49392265",
"text": "def return!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 45 )\n\n\n\n type = RETURN\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 223:9: 'return'\n match( \"return\" )\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__, 45 )\n\n\n end",
"title": ""
},
{
"docid": "bf78592bc81643a73bf2b8c42d8d7d8b",
"score": "0.49386832",
"text": "def return(type)\n valid = %w{ none raw structured }.include? type.to_s\n raise InvalidReturnTypeError unless valid\n\n self.return_type = type\n end",
"title": ""
},
{
"docid": "42b0ebcc4de9973ddc4b2bf2c31a3c76",
"score": "0.4936959",
"text": "def result_description\n nil\n end",
"title": ""
},
{
"docid": "42b0ebcc4de9973ddc4b2bf2c31a3c76",
"score": "0.4936959",
"text": "def result_description\n nil\n end",
"title": ""
},
{
"docid": "42b0ebcc4de9973ddc4b2bf2c31a3c76",
"score": "0.4936959",
"text": "def result_description\n nil\n end",
"title": ""
},
{
"docid": "42b0ebcc4de9973ddc4b2bf2c31a3c76",
"score": "0.4936959",
"text": "def result_description\n nil\n end",
"title": ""
},
{
"docid": "42b0ebcc4de9973ddc4b2bf2c31a3c76",
"score": "0.4936959",
"text": "def result_description\n nil\n end",
"title": ""
},
{
"docid": "42b0ebcc4de9973ddc4b2bf2c31a3c76",
"score": "0.4936959",
"text": "def result_description\n nil\n end",
"title": ""
},
{
"docid": "c3e454ba393b0faf3ad2b2e49190e84a",
"score": "0.49350533",
"text": "def supports_returning?\n false\n end",
"title": ""
},
{
"docid": "5b08fbbe3e90d3a3a6d220137366856d",
"score": "0.4929152",
"text": "def to_s\n unless Semantic.in_function\n SodaLogger.error('return can only be used inside a function definition')\n end\n \"#{Indentation.get}return #{@expression};\"\n end",
"title": ""
},
{
"docid": "c72a9f719287f4d10d5f211282bc45b9",
"score": "0.49215257",
"text": "def process_method exp, env = nil\n exp = Railroader::AliasProcessor.new.process_safely exp, env\n\n find_explicit_return_values exp\n\n if node_type? exp, :defn, :defs\n body = exp.body\n\n unless body.empty?\n @return_values << last_value(body)\n else\n Railroader.debug \"FindReturnValue: Empty method? #{exp.inspect}\"\n end\n elsif exp\n @return_values << last_value(exp)\n else\n Railroader.debug \"FindReturnValue: Given something strange? #{exp.inspect}\"\n end\n\n exp\n end",
"title": ""
},
{
"docid": "7049780a0efb0bc8ac0e193d49576b68",
"score": "0.49184683",
"text": "def return_name\n 'Taynara'\nend",
"title": ""
},
{
"docid": "e767e99d6f86418c84407cdb560a7bd9",
"score": "0.49174663",
"text": "def calculate(operator, num1, num2)\n # Use case when to invoke each method\n case operator\n when \"add\", \"+\"\n puts \"#{num1} + #{num2} = #{add(num1, num2)}\"\n # Do I need a return here\n when \"subtract\", \"-\"\n puts \"#{num1} - #{num2} = #{subtract(num1, num2)}\"\n when \"multiply\", \"*\"\n puts \"#{num1} * #{num2} = #{multiply(num1, num2)}\"\n when \"divide\", \"/\"\n puts \"#{num1} / #{num2} = #{divide(num1, num2)}\"\n when \"modulo\", \"%\"\n puts \"#{num1} % #{num2} = #{mod(num1, num2)}\"\n when \"exponify\", \"**\"\n puts \"#{num1}^#{num2} = #{exponify(num1, num2)}\"\n end\nend",
"title": ""
},
{
"docid": "6e80e36c0465d79f594ff02c379ac53f",
"score": "0.49151912",
"text": "def describeMethod(cname, type, mname)\n \n # If the class name part is ambiguous, then we have a join to\n # do\n \n method_list = methods_matching(cname, type, mname)\n\n case method_list.size\n \n when 0\n @op.error(\"Cannot find method `#{cname}#{type}#{mname}'\")\n throw :exit, 3\n \n when 1\n meth = method_list[0]\n @op.putMethodDescription do\n @op.putMethodHeader(meth.class_name, meth.typeAsSeparator, meth.name, meth.callseq)\n printFragments(meth) unless @synopsis\n end\n \n else\n\n @op.putListOfMethodsMatchingName(mname) do\n @op.putMethodList(method_list.collect { |m| \n \"#{m.class_name}#{m.typeAsSeparator}#{m.name}\" \n })\n end\n end\n end",
"title": ""
},
{
"docid": "9f0d18f8c499db81f29131777a671190",
"score": "0.49090523",
"text": "def five\n return 5 # Some people choose to use the return statement just to be clear, \n end",
"title": ""
},
{
"docid": "d9d449f92c440505fa7695d66d30bd92",
"score": "0.49026787",
"text": "def say_hello\n return \"hello\"\nend",
"title": ""
},
{
"docid": "f5730b9cc1846ed2e6fd70a76f8b7fea",
"score": "0.48992",
"text": "def fctReturn5\n return 5\nend",
"title": ""
},
{
"docid": "470eee2c4a976f7d1cd6a538a2d25250",
"score": "0.48951918",
"text": "def returns_nil_bad\n 3 # error: Returning value that does not conform to method result type\n end",
"title": ""
},
{
"docid": "4d71f4d7e4348e5e5334a6dce2452312",
"score": "0.48933125",
"text": "def may_return?\n @returnsites = instructions.list.select { |i| i.returns? } unless @returnsites\n ! @returnsites.empty? || must_return?\n end",
"title": ""
},
{
"docid": "48eaf02c350efe86e9cbf222d6a53081",
"score": "0.48897055",
"text": "def print_me\n 'I\\'m printing the return value!'\nend",
"title": ""
},
{
"docid": "ae4f9422e6b464395c572bc01659d618",
"score": "0.48811114",
"text": "def return_value(object)\n object.respond_to?(:m_return) ? object.m_return : object.return\n end",
"title": ""
},
{
"docid": "b1b3fa78e5484c765e795017684a0b24",
"score": "0.48802632",
"text": "def foo\n\treturn 'bar'\nend",
"title": ""
},
{
"docid": "73f32e394800b398a8add12d3ef90554",
"score": "0.48775777",
"text": "def result_code; end",
"title": ""
}
] |
be8a1f3648dfd1274cdadfadeace5ff7
|
read a yaml file of defaults and write out the options
|
[
{
"docid": "e4bed6b131215dec64c1aaad44085cfd",
"score": "0.6326813",
"text": "def read_defaults(config_file)\n begin\n defaults = YAML.load_file(config_file)\n\n unless defaults == false\n defaults.each do |k, v|\n if self.respond_to?(k.to_sym)\n self.instance_variable_set((\"@\" + k.to_s).to_sym, v)\n end\n end\n end\n rescue Exception => e\n puts e.message\n puts e.backtrace\n raise e\n end\n end",
"title": ""
}
] |
[
{
"docid": "6aa3a81ed636ba662fe577eb15e9e8c9",
"score": "0.66716",
"text": "def load_settings\n attributes = YAML.load_file(\"defaults.yml\")\n begin\n custom_attributes = YAML.load_file(\"config.yml\")\n attributes = simple_deep_merge(attributes, custom_attributes)\n rescue\n end\n attributes\nend",
"title": ""
},
{
"docid": "6b354923ed21f1bc884545486d33611d",
"score": "0.6638209",
"text": "def load_yaml(file, default={})\n default.merge(YAML.load_file(file))\n end",
"title": ""
},
{
"docid": "a07aa0c698b14c51458f579f000b82fb",
"score": "0.65589476",
"text": "def read_defaults(fname, o)\n if File.exist?(fname)\n IO.foreach(fname) do |line|\n next if line.match(/^\\s*#/) || line.match(/^\\s*$/)\n if /(?<key>\\S+)\\s*=\\s*(?<val>\\S+)/ =~ line\n o[key.to_sym] = val\n end\n end\n else\n STDERR.puts \"Warning: System defaults file '#{fname}' does not exist\"\n end\nend",
"title": ""
},
{
"docid": "faca677e16790e27c36876068fe254a1",
"score": "0.655671",
"text": "def read_opts(file_path=nil)\n begin\n default_opts.merge!(\n deep_symbolize(YAML.load_file(file_path || config_file_path))[environment.to_sym])\n rescue Errno::ENOENT => e\n p \"[warning] config file not read, using default options\"\n default_opts\n end\n end",
"title": ""
},
{
"docid": "4a230660309d5d2ab33770b7e3a3cacb",
"score": "0.6504592",
"text": "def defaults\n @defaults ||= Dir.glob(File.expand_path(\"defaults/**/*.yml\", __dir__))\n end",
"title": ""
},
{
"docid": "b46353e7a34b8ac03d8e51efd77916a2",
"score": "0.6492108",
"text": "def initialize(defaults,cmd_opts)\n @fields = defaults\n if !cmd_opts[:config_file].nil?\n path = cmd_opts[:config_file]\n else\n path = defaults[:config_file]\n end\n data = YAML.load_file(path)\n # Now combine data:\n # defaults, config file, command line (low->high priority)\n data.each do |k,v|\n if EXPECTED.include? k.to_sym\n @fields[k.to_sym] = v\n else\n STDERR.puts \"Warning: unknown section '#{k}' in config file\"\n end\n end\n cmd_opts.each do |k,v|\n @fields[k] = v\n end\n end",
"title": ""
},
{
"docid": "42846fd924b4616b44a330f7d80026f8",
"score": "0.6348745",
"text": "def load_config!\n return unless options.empty?\n\n data = ::YAML.load_file(File.open(\"#{directory.path}/supernova.yml\", \"r\"))\n load_paths.push(*data.fetch(\"load_paths\", []))\n\n load_paths.map! do |path|\n File.absolute_path(path, directory.path)\n end\n\n @options = data\n end",
"title": ""
},
{
"docid": "417812ba492e923411b06403a1c50301",
"score": "0.6297051",
"text": "def configuration_file_options\n file_path = @parsed_options.config_file || DEFAULT_CONFIG\n\n # if the file is 0 bytes, then this is illegal and needs\n # to be overwritten.\n if not File.exists?(file_path) or File.size(file_path) == 0 then\n determine_color_scheme\n FileUtils.mkdir_p(File.dirname(file_path))\n File.open(file_path,\"w\") do |f|\n YAML.dump(default_options.marshal_dump,f)\n end\n end\n YAML.load_file(file_path) || Hash.new\n end",
"title": ""
},
{
"docid": "a94812b39de1ce65e5a04e75ab5764b8",
"score": "0.6294579",
"text": "def default_options()\n options = {\n :verbose => 0, # Logger::DEBUG\n :logfile => STDERR\n }\n config_file = File.join(ENV['HOME'],\"#{File.basename($0, \".*\")}.rc.yaml\")\n if File.exists? config_file then\n config_options = YAML.load_file(config_file)\n options.merge!(config_options)\n end\n return options\n end",
"title": ""
},
{
"docid": "4a4ef6f7a1645629179214dfcd5169fc",
"score": "0.62716055",
"text": "def parse_default_config\n default_config_path = 'config/default.yml'\n @default_config = ( YAML.load_file(default_config_path) if File.exist?(default_config_path) ) || {}\n end",
"title": ""
},
{
"docid": "020e11d92038f426b6bf54be3a8b94cb",
"score": "0.6216231",
"text": "def yaml(*files, **options, &block) = read(*files, parse: :yaml, ext: ['.yml', '.yaml'], **options, &block)",
"title": ""
},
{
"docid": "83613660dd7d9000f80c85e7353b7953",
"score": "0.61993736",
"text": "def config_file_defaults\n Chef::Config[:knife].save(true) # this is like \"dup\" to a (real) Hash, and includes default values (and user set values)\n end",
"title": ""
},
{
"docid": "75168b5263e46571f2bdbfcfcaba1fc7",
"score": "0.61538404",
"text": "def config_for_yaml(opts = {})\n path = opts[:yaml] || fixture('app_config.yml')\n config_for({ yaml: path }.merge(opts))\n end",
"title": ""
},
{
"docid": "8befa4debbd82e30fdef1d4f12be86e4",
"score": "0.61370176",
"text": "def load_defaults cache = true\n defaults_path = @path + 'defaults' + 'main.yml'\n defaults = if defaults_path.file?\n YAML.load(defaults_path.read) || {}\n else\n {}\n end\n \n vars_path = @path + 'vars' + 'main.yml'\n vars = if vars_path.file?\n YAML.load(vars_path.read) || {}\n else\n {}\n end\n \n defaults = defaults.merge! vars\n \n if cache\n @defaults = defaults\n end\n \n defaults\n end",
"title": ""
},
{
"docid": "a2d564dc19dbd6b14b20cb4604a7a336",
"score": "0.6131479",
"text": "def write_options\n RDoc.load_yaml\n\n File.open '.rdoc_options', 'w' do |io|\n io.set_encoding Encoding::UTF_8\n\n io.print to_yaml\n end\n end",
"title": ""
},
{
"docid": "6fff380b8d740e00e36ec3d93a781ca1",
"score": "0.6110533",
"text": "def options\n return @options if @options_parsed\n options = super\n config_path = File.join(File.dirname(__FILE__),\n '../..', CONFIG_FILE_NAME)\n return options unless File.exist? config_path\n\n defaults = YAML.load_file(config_path).deep_symbolize_keys || {}\n options = defaults.merge_with_arrays(options)\n @options = Thor::CoreExt::HashWithIndifferentAccess.new(options)\n @options_parsed = true\n\n @options\n end",
"title": ""
},
{
"docid": "1faf1ae35e315688421543382cce5c38",
"score": "0.6098501",
"text": "def load_from_yaml(file)\n document_lines = File.readlines(file)\n\n headers = document_lines.enum_for(:each_with_index).\n find_all { |line, _| line =~ /^---/ }\n if headers.empty? || headers.first[1] != 0\n headers.unshift [\"--- name:default\", -1]\n end\n\n options = headers.map do |line, line_number|\n line_options = Hash.new\n line = line.chomp\n line.split(/\\s+/)[1..-1].each do |opt|\n if opt =~ /^(\\w+):(.*)$/\n line_options[$1] = $2\n else\n raise ArgumentError, \"#{file}:#{line_number}: wrong format #{opt}, expected option_name:value, where 'value' has no spaces\"\n end\n end\n line_options['merge'] = (line_options['merge'] == 'true')\n line_options['chain'] = (line_options['chain'] || '').split(',')\n [line_options, line_number]\n end\n options[0][0]['name'] ||= 'default'\n\n options.each do |line_options, line_number|\n if !line_options['name']\n raise ArgumentError, \"#{file}:#{line_number}: missing a 'name' option\"\n end\n end\n\n sections = []\n options.each_cons(2) do |(_, line0), (_, line1)|\n sections << document_lines[line0 + 1, line1 - line0 - 1]\n end\n sections << document_lines[options[-1][1] + 1, document_lines.size - options[-1][1] - 1]\n\n changed_sections = []\n @conf_options = options\n\n sections.each_with_index do |doc, idx|\n doc = doc.join(\"\")\n doc = evaluate_dynamic_content(file, doc)\n\n result = YAML.load(StringIO.new(doc))\n\n conf_options = options[idx].first\n name = conf_options.delete('name')\n changed = in_context(\"while loading section #{name} of #{file}\") do\n add(name, result || Hash.new, conf_options)\n end\n\n if changed\n changed_sections << name\n end\n end\n\t if !changed_sections.empty?\n\t \t@merged_conf.clear\n\t end\n changed_sections\n rescue Exception => e\n raise e, \"error loading #{file}: #{e.message}\", e.backtrace\n end",
"title": ""
},
{
"docid": "57620c7d7a8d7a4f3eb8fdc85627bd77",
"score": "0.6088388",
"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 load #{dotfile}: #{e}\"\n end",
"title": ""
},
{
"docid": "671b5c50ce581f460b54120ebc1c84dc",
"score": "0.6041961",
"text": "def setup\n preference_file = \"#{defaults[:root_dir]}/config.yml\"\n preferences = {}\n if File.exists? preference_file\n require 'yaml'\n File.open(preference_file) { |file| preferences = YAML.load(file) }\n end\n base_file_variations(absolute_paths(defaults.merge(preferences)))\n end",
"title": ""
},
{
"docid": "afd8a02a85eb2d99163608efa38fc873",
"score": "0.6036957",
"text": "def create_default_cfg\n if File.exist?(Cukedep::YMLFilename)\n puts \"OK to overwrite file #{Cukedep::YMLFilename}.\"\n puts '(Y/N)?'\n answer = $stdin.gets\n exit if answer =~ /^\\s*[Nn]\\s*$/\n end\n Config.default.write(Cukedep::YMLFilename)\n\n exit\n end",
"title": ""
},
{
"docid": "e81b6ea82c5c256780c48717f594de89",
"score": "0.6023538",
"text": "def load_yaml(yaml_file)\n @options = YAML.load_file(yaml_file)\n end",
"title": ""
},
{
"docid": "9e62f566325d6baa2b351c90c4f5d0dc",
"score": "0.601898",
"text": "def config options={}\n options = DEFAULT_OPTS.merge(options)\n config = Path.yaml_file(options[:file])\n unless options[:environment].nil? || options[:environment].empty?\n config[options[:environment]]\n else\n config\n end\n end",
"title": ""
},
{
"docid": "2e5cf534e059378e0a2eb7eb1856f934",
"score": "0.6013628",
"text": "def set_defaults!\n __load_config( DEFAULTS )\n end",
"title": ""
},
{
"docid": "02e65b511b147b1c500216ed8bc079c6",
"score": "0.6004715",
"text": "def register_defaults(with_hash:)\n\n # *Define* each of the possible defaults. These will have\n # default values. We're actually kind of good to go at\n # this point if we don't want to use the rc file.\n\n with_hash.each {|k,v| define_default(for_key:k, value:v) }\n\n # If the file doesn't exist, create it and add our current\n # key-value pairs to it. Otherwise, read the file, compare\n # it to our current set of key-value pairs, and make\n # adjustments, re-writing the file if necessary.\n\n if !File.file?(file_path)\n FileUtils.mkdir_p(File.dirname(file_path))\n File.open(file_path, 'w') { |file| file.write(hash_representation.to_yaml) }\n else\n #noinspection RubyResolve\n #@type [Hash] working\n working = YAML.load(File.read(file_path))\n new = working.select {|k,_| hash_representation.has_key?(k)} # only keeps working items if they are current.\n new = new.merge(hash_representation.select {|k,_| !new.has_key?(k)}) # select the new items.\n File.open(file_path, 'w') { |file| file.write(new.to_yaml) } unless working == new\n new.each {|k,v| self[k] = v }\n end\n end",
"title": ""
},
{
"docid": "895398944e545b08f22756b5b624f386",
"score": "0.5999987",
"text": "def set_defaults\n @defaults = RHC::Vendor::ParseConfig.new()\n @opts = RHC::Vendor::ParseConfig.new() # option switches that override config file\n\n @env_config = RHC::Vendor::ParseConfig.new()\n @global_config = nil\n @local_config = nil\n @opts_config = nil # config file passed in the options\n @additional_config = nil\n\n @default_proxy = nil\n\n @defaults.add('insecure', false)\n @defaults.add('libra_server', openshift_online_server)\n\n @env_config.add('libra_server', libra_server_env) if libra_server_env\n @env_config.add('libra_server', rhc_server_env) if rhc_server_env\n\n @opts_config_path = nil\n end",
"title": ""
},
{
"docid": "1071425e8c68ed05dd36318a669f4b67",
"score": "0.59822315",
"text": "def parse_config_file\n if !File.exist?(options[:config_file])\n puts \"Configuration file is not found\"\n exit 1\n end\n\n configs = YAML.load_file(options[:config_file]).deep_symbolize_keys\n options.reverse_merge!(configs[environment.to_sym] || {})\n end",
"title": ""
},
{
"docid": "91396265bf47bf283429f4d82f258792",
"score": "0.5932196",
"text": "def load\n if File.file?(@file_name)\n File.open(@file_name, 'r') do |file|\n YAML::load(file)\n end\n else\n default\n end\n end",
"title": ""
},
{
"docid": "a956b7f4b4f4a79b9f372efd8cd47d1c",
"score": "0.5920101",
"text": "def get_defaults\n unless @defaults\n conf_str = JustInCase::Templates::CONFIG_FILE\n conf_hash = JSON.parse(conf_str)\n @defaults = conf_hash.symbolize_keys!\n end\n return @defaults\n end",
"title": ""
},
{
"docid": "a0e63d967345b360e21494e341fa2dfe",
"score": "0.5914346",
"text": "def create_defaults!\n Preference.reset_column_information\n conf = File.join( File.expand_path('../../', __FILE__), 'config', 'defaults.yml' )\n YAML.load( File.open(conf) ).each do |pref|\n Preference.where(key: pref['key'])\n .first_or_create(pref)\n end\n end",
"title": ""
},
{
"docid": "7191eb6f5fc7e10583a37d64df93dfab",
"score": "0.59112304",
"text": "def yml_file_to_object(options={})\n content = read_file_content(options)\n YAML.load(content)\nend",
"title": ""
},
{
"docid": "f6871a83788cde280ee7ce9ac5e839d3",
"score": "0.5899642",
"text": "def configure_with(file)\n config = YAML.load_file(file || DEFAULT_CONFIG_FILE)\n configure(config)\n rescue Errno::ENOENT\n #puts 'YAML configuration file couldn\\'t be found. Using defaults.'\n rescue Psych::SyntaxError\n #puts 'YAML configuration file contains invalid syntax. Using defaults'\n end",
"title": ""
},
{
"docid": "7f461dc61b15bbca55c83d41633d2603",
"score": "0.58995354",
"text": "def load_settings\n begin\n save = YAML.load_file('settings.yaml')\n unless save\n # the file is empty.. well, not valid YAML\n raise(ArgumentError)\n end\n \n # do something with the loaded values\n @maildirpath = save['maildirpath']\n @known = save['known']\n @ignore = save['ignore']\n @mailers = save['mailers']\n \n rescue Errno::ENOENT, ArgumentError => e\n # file not found or not valid\n # so create a valid one\n File.open('settings.yaml', 'w' ) do |out|\n save = {'maildirpath' => '/path/to/mh/',\n 'known' => {'Firstname Lastname' => ['[email protected]']},\n 'ignore' => ['[email protected]'],\n 'mailers' => {'Mailername' => ['RegEx']}\n }\n YAML.dump(save, out)\n end\n raise(ArgumentError, 'You should check settings.yaml before re-running this program')\n end\n end",
"title": ""
},
{
"docid": "f497d24bffca0301cda36e5a3538c630",
"score": "0.58936024",
"text": "def yml_config\n return @yml_config if @yml_config\n\n require 'yaml'\n data = File.open(options[:config_path]).read\n\n require 'erb'\n data = ERB.new(data).result(binding)\n\n @yml_config ||= YAML.load(data)\n end",
"title": ""
},
{
"docid": "741df206cf500e3212189764545f53ab",
"score": "0.5873254",
"text": "def load_default_config\n # Load the default\n path = File.join(::Lyricli.root, \"config\", @defaults_path)\n\n if File.exist?(path)\n file = File.new(path, \"r\")\n @config = MultiJson.decode(file.read)\n else\n @config = {}\n end\n end",
"title": ""
},
{
"docid": "5810bd518f227e739e93bee525886fd8",
"score": "0.5872255",
"text": "def options\n original_options = super\n defaults = Thor::CoreExt::HashWithIndifferentAccess.new(\n {\n width: 72,\n count: 200,\n },\n )\n\n config_path = File.expand_path(ENV.fetch('AUGURY_CFG_PATH', '~/.augury.yml'))\n if File.file?(config_path)\n config_options = Thor::CoreExt::HashWithIndifferentAccess.new(YAML.load_file(config_path) || {})\n defaults = defaults.merge(config_options)\n end\n\n # Enforce implied options\n defaults[:links] = true if original_options[:remove_links] || defaults[:remove_links]\n\n Thor::CoreExt::HashWithIndifferentAccess.new(defaults.merge(original_options))\n end",
"title": ""
},
{
"docid": "985ea4203c14437c71be73a72bcc93d6",
"score": "0.5869933",
"text": "def generate\n FileUtils.cp DEFAULT_CONFIG, File.join(@path, 'config/rails_best_practices.yml')\n end",
"title": ""
},
{
"docid": "b271b273b294e1b3ffa35f56b860d593",
"score": "0.5866594",
"text": "def configure_with(file)\n config = YAML.load_file(file || DEFAULT_CONFIG_FILE)\n configure(config)\n rescue Errno::ENOENT\n Log.info \"#{file}: not found -- using defaults.\"\n rescue Psych::SyntaxError\n Log.warn \"#{file}: invalid syntax -- using defaults.\"\n end",
"title": ""
},
{
"docid": "7877f0ad605f56a59c9fec942bbb127d",
"score": "0.5844768",
"text": "def read_yaml(_base, _name, _opts = {})\n self.content = self.output = \"\"\n self.data ||= DEFAULT_DATA.dup\n end",
"title": ""
},
{
"docid": "6b167ee7d61d37adecc77ba75b867589",
"score": "0.5835412",
"text": "def yaml_file?; end",
"title": ""
},
{
"docid": "ed48a8afb1012f01a665048189ce93d4",
"score": "0.58204716",
"text": "def yaml(filename)\n YAML.load(IO.read(filename).gsub(/---\\z/, ''))\nend",
"title": ""
},
{
"docid": "5f14ba8d49c61492f06612c4ba661371",
"score": "0.5816309",
"text": "def defaults\n defaults = self[:defaults] || {}\n return defaults if defaults.any?\n options.fetch 'defaults', {}\n end",
"title": ""
},
{
"docid": "0671a71d695ebbef52cc8a38a449ab37",
"score": "0.57773364",
"text": "def get_options\n options = YAML.load_file(\n File.expand_path(\"#{ENV['HOME']}/.right_api_client/login.yml\")\n )\nend",
"title": ""
},
{
"docid": "9947449f726dc72e3beeb4ca7f56399d",
"score": "0.5768677",
"text": "def optional_config_file\n if ::File.exists?(@options.to_s)\n @options = @global.load_ruby_config(::File.expand_path(@options))\n end\n end",
"title": ""
},
{
"docid": "5be22ac531c7241e1cb5ac0cfa2f470c",
"score": "0.57553697",
"text": "def configure_with(path_to_yaml_file)\n if path_to_yaml_file\n begin\n config = YAML.load(IO.read(path_to_yaml_file))\n rescue Errno::ENOENT\n @log.warn(\n \"YAML configuration file couldn\\'t be found at \" \\\n \"#{path_to_yaml_file}. Using defaults.\")\n return @config\n rescue Psych::SyntaxError\n @log.warn(\n 'YAML configuration file contains invalid syntax. Using defaults.')\n return @config\n end\n else\n config = {}\n end\n\n configure(config)\n end",
"title": ""
},
{
"docid": "82b1159a5b628ba77d21411e31eb8883",
"score": "0.57485795",
"text": "def create_default_configuration_file\n puts 'Creating the default configuration'\n FileUtils.touch(CONFIGURATION_FILE)\n\n configuration = YAML::load_file(CONFIGURATION_FILE) || {}\n configuration[:elasticsearch] = { host: 'localhost',\n port: '9200',\n search_results_size: 10 }\n\n File.write(CONFIGURATION_FILE, configuration.to_yaml)\nend",
"title": ""
},
{
"docid": "0dffc332db5a58630a7042f9cd281142",
"score": "0.57482713",
"text": "def initialize_config_yaml(filename, files = Dry::Files.new, template: config_template)\n files.write(filename, template)\n end",
"title": ""
},
{
"docid": "da1a8c9a148a4fe572d66c8c76c8e6ff",
"score": "0.5742345",
"text": "def load_config\n create_yolo_dir\n unless File.exist?(yaml_path)\n @formatter.config_created(yaml_path)\n FileUtils.cp_r(File.dirname(__FILE__) + \"/config.yml\", yaml_path)\n end\n end",
"title": ""
},
{
"docid": "6c583e4358d8905a681a0c0555447df6",
"score": "0.57371825",
"text": "def load_from_file(file, options = {})\n hash =\n if yaml = YAML.load_file(file)\n yaml.to_hash\n else\n {}\n end\n\n Overcommit::Configuration.new(hash, options)\n end",
"title": ""
},
{
"docid": "8a3ae8b85578e2ff78e8d3b19a3a8429",
"score": "0.571105",
"text": "def default_config_file\n './deadlyzer.yml'\n end",
"title": ""
},
{
"docid": "382ffd695ae3440bf7f9306d6ef5043d",
"score": "0.56969213",
"text": "def update_yaml_setting(yaml, key, setting, default)\n unless yaml[key][setting]\n yaml[key][setting] = default\n File.open(yaml_path, 'w') {|f|\n f.write(yaml.to_yaml)\n }\n @formatter.config_updated(yaml_path)\n end\n end",
"title": ""
},
{
"docid": "bd44b2be8a0030c101bed95c4984424f",
"score": "0.56956494",
"text": "def read_yaml(base, name, opts = {})\n begin\n self.content = File.read(File.join(base, name),\n merged_file_read_opts(opts))\n if content =~ /\\A(---\\s*\\n.*?\\n?)^((---|\\.\\.\\.)\\s*$\\n?)/m\n self.content = $POSTMATCH\n self.data = SafeYAML.load($1)\n end\n rescue SyntaxError => e\n Jekyll.logger.warn \"YAML Exception reading #{File.join(base, name)}: #{e.message}\"\n rescue Exception => e\n Jekyll.logger.warn \"Error reading file #{File.join(base, name)}: #{e.message}\"\n end\n\n self.data ||= {}\n end",
"title": ""
},
{
"docid": "f98359a3622304038ee9cad57ee296f2",
"score": "0.56943655",
"text": "def load_config(file_path)\n file = File.read(File.expand_path(file_path, __FILE__))\n yaml = YAML.load(file)\n \n # set new options\n options.keys.each do |option|\n set_option(option, yaml[option]) if !yaml[option].nil?\n end\n \n # set new settings\n settings.keys.each do |setting|\n set(setting, yaml[setting]) if !yaml[setting].nil?\n end\n end",
"title": ""
},
{
"docid": "64f2042977e9ebfb8561d5622c8679f8",
"score": "0.5675909",
"text": "def load_yaml(filename); end",
"title": ""
},
{
"docid": "fc38821e2a4e8b82675af6f71394134e",
"score": "0.56651765",
"text": "def merge_config_file(site)\n required = [TITLE_KEY, DESC_KEY, GITHUB_KEY, SEARCH_KEY, URL_KEY]\n optional = [ORG_KEY]\n\n original_url = site.config[URL_KEY]\n\n customizations = YAML.load_file(GUIDE_CONFIG)\n if customizations\n required.each do |k|\n site.config[k] = customizations[k]\n end\n\n optional.each do |k|\n if customizations.key?(k)\n site.config[k] = customizations[k]\n end\n end\n\n # Per https://jekyllrb.com/docs/variables/, Jekyll will set\n # the url at runtime in dev environments -- preserve, if set\n if original_url\n site.config[URL_KEY] = original_url\n end\n end\n puts \" Merged \" + GUIDE_CONFIG\n end",
"title": ""
},
{
"docid": "94823d9a8b54d8fcd3577329c367c921",
"score": "0.5620113",
"text": "def read_options args={}, update_options={}\n args = {:environment => nil,\n :config_file => nil,\n :verbose => 'silent'\n }.update(args)\n\n options = {}\n\n if File.exists? @cfg_file\n vputs \"Loading '#{@cfg_file}'\", args[:verbose]\n options = load_file @cfg_file\n end\n\n if args[:config_file]\n if !File.exists? args[:config_file]\n vputs \"ERROR: Config file '#{args[:config_file]}' not found!\", args[:verbose]\n exit\n end\n vputs \"Loading '#{args[:config_file]}'\", args[:verbose]\n update_options(args[:config_file], options)\n elsif @persistent_local_cfg_file && File.exists?(@persistent_local_cfg_file)\n vputs \"Loading '#{@persistent_local_cfg_file}'\", args[:verbose]\n update_options(@persistent_local_cfg_file, options)\n elsif @local_cfg_file && File.exists?(@local_cfg_file)\n vputs \"Loading '#{@local_cfg_file}'\", args[:verbose]\n update_options(@local_cfg_file, options)\n end\n\n if args[:environment]\n vputs \"Using environment '#{args[:environment]}'\", args[:verbose]\n options = (options['default']||{}).deep_merge!(options[args[:environment]]||{})\n end\n\n options.update(update_options)\n options['environment'] = 'development' if options['environment'].nil?\n options['verbose'] = false if options['verbose'].nil?\n\n if args[:verbose] == true\n len = options.keys.map { |k| k.size }.sort.last\n vputs \"Loaded options:\", args[:verbose]\n options.each { |k, v| puts \" #{k.ljust(len)} => #{v}\" }\n end\n\n options\n end",
"title": ""
},
{
"docid": "0f5dc9ae8645953ef4b1d3238f5226ff",
"score": "0.56067944",
"text": "def read_yaml(base, name, opts = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "274bbfda15ae0961140916b019fc3710",
"score": "0.55985934",
"text": "def load_options(conf_file)\n if File.readable?(conf_file)\n conf_txt = File.read(conf_file)\n conf_opt = YAML::load(conf_txt)\n\n @options.merge!(conf_opt) if conf_opt != false\n end\n end",
"title": ""
},
{
"docid": "ce0fddd850bb3ea1be37ac89dba5b21a",
"score": "0.55918956",
"text": "def load(args)\n YAML::load_file(args[:file_name])\n end",
"title": ""
},
{
"docid": "67100b4591e11cac86571c0ecd304c82",
"score": "0.55876005",
"text": "def read_settings_file(input)\n settings_file = File.join(Dir.pwd, 'default_settings.yml')\n unless input['--settings'].nil?\n settings_file = input['--settings']\n end\n\n unless File.exists?(settings_file) \n raise \"Settings file '#{settings_file}' does not exist\"\n end\n\n File.read(settings_file)\n end",
"title": ""
},
{
"docid": "a87fc84d0f5d35ab95e3853c15044af9",
"score": "0.5586914",
"text": "def initialize(file = DEFAULTS['cfg'])\n @everything = YAML.load(ERB.new(IO.read(file)).result)\n raise \"malformed yarb config\" unless @everything.is_a?(Hash)\n @config = DEFAULTS.merge(@everything[RAILS_ENV] || {})\n rescue\n puts \"error reading config file: #{$!}, using defaults\"\n @config = DEFAULTS\n end",
"title": ""
},
{
"docid": "2c92abd3dd445cd126829ed5f3d990f8",
"score": "0.5575385",
"text": "def init_defaults\n $defaults_path = path_in_proj \"../db/defaults.yml\" \n $user_path = path_in_proj \"../db/user_info.yml\"\n $template_path = path_in_proj \"../db/template_hash.yaml\"\n $output_destination = path_in_proj \"../tmp/1010.pdf\"\n $blank_path = path_in_proj \"../db/1010-blank.pdf\"\n end",
"title": ""
},
{
"docid": "ab611e534e2c4b59c8ef40d6f69d51e3",
"score": "0.55729276",
"text": "def _parse_options(options)\n defaults = DEFAULTS.dup\n options = options.dup\n\n defaults.keys.each do |key|\n options[key] ||= defaults[key]\n end\n\n options\n end",
"title": ""
},
{
"docid": "8c87daaeb454162248e5c0bc02858a44",
"score": "0.5568242",
"text": "def load_settings(args = [], *names)\n raise \"no setting names provided\" if not args.empty? and names.empty?\n require 'yaml'\n @options = {}\n args.reverse.each do |val|\n @options[names.pop] = val\n end\n \n # import and clean up options from the yaml\n imports = YAML.load_file(SETTINGS_FILE)\n imports.each_pair do |key, value|\n if not key.is_a? Symbol\n imports[key.to_sym] = value\n imports.delete(key)\n end\n end\n\n # combine the hashes\n @options = imports.merge(@options)\n end",
"title": ""
},
{
"docid": "2ea23c5bc9cfdd3508931a0806b49c2e",
"score": "0.5565784",
"text": "def load(file, options = {})\n options = load_options_hash_from_file(file)\n\n if options.fetch(:merge_with_default, true)\n options = smart_merge(default_options_hash, options)\n end\n\n Config.new(options)\n end",
"title": ""
},
{
"docid": "afd98cf21e65549548440fa3edc458fb",
"score": "0.5564471",
"text": "def default_config\n <<~CONFIG\n defaults: &defaults\n data_root: data\n candidates_root: zzz_candidates\n departed_root: zzz_departed\n project_root: projects\n editor: code\n feedback_polarity_default: positive\n meeting_location_default: alcove\n log_filename: log.adoc\n overview_filename: overview.adoc\n pto_default: vacation\n voip_meeting_default: Zoom\n\n development:\n # <<: *defaults\n data_root: data\n candidates_root: zzz_candidates\n departed_root: zzz_departed\n project_root: projects\n editor: code\n feedback_polarity_default: positive\n meeting_location_default: alcove\n log_filename: log.adoc\n overview_filename: overview.adoc\n pto_default: vacation\n voip_meeting_default: Zoom\n\n test:\n # <<: *defaults\n data_root: data\n candidates_root: zzz_candidates\n departed_root: zzz_departed\n project_root: projects\n editor: code\n feedback_polarity_default: positive\n meeting_location_default: alcove\n log_filename: log.adoc\n overview_filename: overview.adoc\n pto_default: vacation\n voip_meeting_default: Zoom\n\n production:\n # <<: *defaults\n data_root: data\n candidates_root: zzz_candidates\n departed_root: zzz_departed\n project_root: projects\n editor: code\n feedback_polarity_default: positive\n meeting_location_default: alcove\n log_filename: log.adoc\n overview_filename: overview.adoc\n pto_default: vacation\n voip_meeting_default: Zoom\n CONFIG\n end",
"title": ""
},
{
"docid": "a390373e356540b5889ae368fa06d4de",
"score": "0.55630785",
"text": "def config_from_yaml(file)\n build_data = Pkg::Util::Serialization.load_yaml(file)\n config_from_hash(build_data)\n end",
"title": ""
},
{
"docid": "2c936cd5d1f60c59ce1ad6ea682cf214",
"score": "0.5561415",
"text": "def create_default_config_files\n create_default_database_yml\n end",
"title": ""
},
{
"docid": "3dc699a4aa9e8213574f74b7903d8863",
"score": "0.55585927",
"text": "def assign_defaults(options)\n # Normalizes languages keys from symbols to strings\n normalize_language_keys(options)\n\n # Build a complete list of the required languages\n enabled_languages = detect_languages(options)\n\n # Get all languages used in existing settings\n (LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|\n current = options[key]\n next unless current && current.kind_of?(Hash)\n current.each do |language, value|\n enabled_languages << language unless enabled_languages.include?(language)\n end\n end\n\n # Check folder list (an empty folder signifies a language is required)\n ignore_validation = options[:ignore_language_directory_validation]\n Loader.language_folders(options[:metadata_path], ignore_validation).each do |lang_folder|\n next unless File.directory?(lang_folder) # We don't want to read txt as they are non localised\n language = File.basename(lang_folder)\n enabled_languages << language unless enabled_languages.include?(language)\n end\n\n return unless enabled_languages.include?(\"default\")\n UI.message(\"Detected languages: \" + enabled_languages.to_s)\n\n (LOCALISED_VERSION_VALUES + LOCALISED_APP_VALUES).each do |key|\n current = options[key]\n next unless current && current.kind_of?(Hash)\n\n default = current[\"default\"]\n next if default.nil?\n\n enabled_languages.each do |language|\n value = current[language]\n next unless value.nil?\n\n current[language] = default\n end\n current.delete(\"default\")\n end\n end",
"title": ""
},
{
"docid": "54505d05be1932564c547babab520f85",
"score": "0.55567056",
"text": "def assign_defaults(options)\n # Normalizes languages keys from symbols to strings\n normalize_language_keys(options)\n\n # Build a complete list of the required languages\n enabled_languages = detect_languages(options)\n\n # Get all languages used in existing settings\n (LOCALISED_VERSION_VALUES.keys + LOCALISED_APP_VALUES.keys).each do |key|\n current = options[key]\n next unless current && current.kind_of?(Hash)\n current.each do |language, value|\n enabled_languages << language unless enabled_languages.include?(language)\n end\n end\n\n # Check folder list (an empty folder signifies a language is required)\n ignore_validation = options[:ignore_language_directory_validation]\n Loader.language_folders(options[:metadata_path], ignore_validation).each do |lang_folder|\n next unless File.directory?(lang_folder) # We don't want to read txt as they are non localised\n language = File.basename(lang_folder)\n enabled_languages << language unless enabled_languages.include?(language)\n end\n\n return unless enabled_languages.include?(\"default\")\n UI.message(\"Detected languages: \" + enabled_languages.to_s)\n\n (LOCALISED_VERSION_VALUES.keys + LOCALISED_APP_VALUES.keys).each do |key|\n current = options[key]\n next unless current && current.kind_of?(Hash)\n\n default = current[\"default\"]\n next if default.nil?\n\n enabled_languages.each do |language|\n value = current[language]\n next unless value.nil?\n\n current[language] = default\n end\n current.delete(\"default\")\n end\n end",
"title": ""
},
{
"docid": "1b108915fc65f5d6310254e31964b81d",
"score": "0.55524546",
"text": "def write\n require 'yaml'\n open config_file_name, 'w' do |io|\n io.write to_yaml\n end\n end",
"title": ""
},
{
"docid": "4e2eb7c5e9a09a990bffc5da308d7ab3",
"score": "0.5531671",
"text": "def formatting(file)\n data = File.read(file)\n\n YAML.load(data)\n end",
"title": ""
},
{
"docid": "bf48e55daffea00d087cc4d1b88e20c7",
"score": "0.5530178",
"text": "def build_config\n file = [options[:config_file], DEFAULT_CONFIG_FILE_LOCATION].\n compact.find {|f| File.exists?(f) }\n\n hash =\n if file\n YAML.load_file(file).each do |key, value|\n stderr.puts(\"Warn: Unknown key in config file: #{key}\") unless\n self.class.configs.find {|opt| opt.first.to_s == key.to_s }\n end\n else\n {}\n end\n\n options[:config_option].map {|str| str.split('=') }.\n inject(hash) {|m, (k,v)| m.merge(k.to_sym => v) }\n end",
"title": ""
},
{
"docid": "b16e7a033aba7cd6b73560ce7d2b1ba6",
"score": "0.55291045",
"text": "def ReadConfig()\n\n # Deep copy \n puts \"Reading global config file #{$conf[:globalConfFile]}\" if $verbose\n conf = Marshal.load( Marshal.dump($conf) )\n\n optfile = @ConfFile\n conf[\"conffile\"] = optfile\n conf[\"filename\"] = @filename\n conf[\"dir\"] = @dir\n\n if File.exists?(optfile)\n begin\n puts \"Reading specific config file #{optfile}\" if $verbose\n c = YAML.load_file(optfile)\n raise \"Invalid yaml file\" if not c\n\n # surcharge d'options\n $sections.each {|s|\n next if c[s].nil?\n if c[s].class == Array\n if $sections_uniq.include?(s)\n # remove then add option\n c[s].each {|o|\n o2 = o.gsub(/=.*/, \"=\")\n conf[s].delete_if {|o3| o3.start_with?(o2)}\n conf[s].push o\n }\n else\n c[s].each {|o|\n if o[0] == \"!\"\n # delete option\n conf[s].delete o[1..-1]\n else\n # just add option\n conf[s].push o\n end\n }\n end\n else\n conf[s] = c[s]\n end\n }\n rescue\n puts \"Error loading #{optfile}\"\n end\n else\n puts \"Skip loading unknown specific config file #{optfile}\" if $verbose\n end\n\n conf.each {|k,v|\n if v.class == Array\n conf[k].each_index {|i|\n conf[k][i].gsub!(/%B/, $basedir) if conf[k][i].class == String\n conf[k][i].gsub!(/%b/, $confdir) if conf[k][i].class == String\n conf[k][i].gsub!(/%D/, @dir) if conf[k][i].class == String\n }\n else\n conf[k].gsub!(/%B/, $basedir) if conf[k].class == String\n conf[k].gsub!(/%b/, $confdir) if conf[k].class == String\n conf[k].gsub!(/%D/, @dir) if conf[k].class == String\n end\n }\n\n return conf\n end",
"title": ""
},
{
"docid": "5332f1f0436627769bf915d8cbcdbbaf",
"score": "0.55215865",
"text": "def yaml\n parse_yaml_string(yaml_string(config_file), config_file)\n end",
"title": ""
},
{
"docid": "c7bd0c430df00a31809df579de993fde",
"score": "0.5507266",
"text": "def load\n if File.exists? @file\n @main = YAML::load_file @file\n else\n self.load_defaults\n end\n end",
"title": ""
},
{
"docid": "0c9e0b2f5ad2a9fb6bc6c0f41ef802cf",
"score": "0.5497839",
"text": "def load_yaml\n if has_file? \"#{name}.yml\"\n YAML.load_file(path / \"#{name}.yml\").apply_to self\n end\n end",
"title": ""
},
{
"docid": "09f4266e6a1d25a29c61c685a1e34a62",
"score": "0.5497764",
"text": "def load\n yaml = YAML.load_file(@file_path)\n yaml.each {|k, v| interpolate_setting(yaml, v)}\n settings = OpenStruct.new\n add_hash(settings, yaml)\n\n @lock.synchronize do\n @yaml = yaml\n @settings = settings\n end\n rescue\n puts \"Failed to load file: #{@file_path}\\n#{$!}\"\n end",
"title": ""
},
{
"docid": "8f82395f505c9bc22ef85143893de89f",
"score": "0.5495965",
"text": "def set_args_from_yaml(yaml_path)\n yaml = YAML::load( File.open(yaml_path) )\n @login = yaml['login']\n @password = yaml['password']\n @client = yaml['client']\n @project = yaml['project']\n @application = yaml['application']\n @environment = yaml['environment']\n @mmd_url = yaml['mmd_url']\nend",
"title": ""
},
{
"docid": "c3dba280ebaa92d736cb1351de150605",
"score": "0.5488339",
"text": "def load_yaml(args = {})\n file = File.read(args[:file] || CMUX_YAML)\n yaml = YAML.load(file)\n args[:key] ? yaml[args[:key]] : yaml\n rescue Psych::SyntaxError\n message = \"Make sure you've written #{file} in YAML Simple Mapping.\" \\\n ' Please check README.'\n raise message.red\n end",
"title": ""
},
{
"docid": "07323874b7e832f18c449ade51c8dc69",
"score": "0.5487528",
"text": "def read_config_file()\n if File.exists?(options[:config_file])\n return YAML.load_file(options[:config_file])\n else\n @logger.error \"Config file [#{options[:config_file]}] missing!\"\n end\n end",
"title": ""
},
{
"docid": "df98573f48efbbe0625aaa6f81aa52d2",
"score": "0.5484083",
"text": "def read_config(io = nil)\n unless io\n root_path = ::Middleman::Application.root\n config_file_path = File.join(root_path, \".s3_sync\")\n\n # skip if config file does not exist\n return unless File.exists?(config_file_path)\n\n io = File.open(config_file_path, \"r\")\n end\n\n config = YAML.load(io).symbolize_keys\n\n OPTIONS.each do |config_option|\n self.send(\"#{config_option}=\".to_sym, config[config_option]) if config[config_option]\n end\n end",
"title": ""
},
{
"docid": "a3c4782b3589b41f5ba8ef8766f3cb70",
"score": "0.5474002",
"text": "def default_options=(opts); end",
"title": ""
},
{
"docid": "3829f65befee806ef1abdf260630efe4",
"score": "0.54717916",
"text": "def read_settings\n file = File.join(self.source, \"_site.yaml\")\n if File.exist?(file)\n self.settings = File.open(file) { |f| YAML::load(f) }\n else\n self.settings = {}\n end\n end",
"title": ""
},
{
"docid": "b275d9ace5a2817cba8cebd784b05adb",
"score": "0.54703385",
"text": "def bootstrap\n return if File.exist?(yaml_file)\n\n FileUtils.mkdir_p(File.split(yaml_file).first)\n FileUtils.cp(example_config, yaml_file)\n end",
"title": ""
},
{
"docid": "5ee37750e1eb08bc3ef499efb8a5acaa",
"score": "0.5467055",
"text": "def ReadConfig()\n\n # Deep copy \n puts \"Reading global config file #{$conf[:globalConfFile]}\" if $verbose\n conf = Marshal.load( Marshal.dump($conf) )\n\n if @ConfFile.nil?\n return conf\n end\n\n optfile = @ConfFile\n optfile = optfile.gsub(/%f/, @doc.filename)\n optfile = optfile.gsub(/%F/, @doc.file)\n optfile = optfile.gsub(/%D/, @doc.dir)\n optfile = optfile.gsub(/%E/, @doc.extname)\n optfile = optfile.gsub(/%R/, @doc.dir + \"/\" + @doc.file.gsub(@doc.extname, \"\"))\n optfile = optfile.gsub(/%r/, @doc.file.gsub(@doc.extname, \"\"))\n optfile = optfile.gsub(/%t/, @Type)\n optfile = optfile.gsub(/%B/, $basedir)\n optfile = optfile.gsub(/%b/, $confdir)\n\n conf[\"conffile\"] = optfile\n conf[\"filename\"] = @doc.filename\n conf[\"dir\"] = @doc.dir\n\n if File.exists?(optfile)\n begin\n puts \"Reading specific config file #{optfile}\" if $verbose\n c = YAML.load_file(optfile)\n raise \"Invalid yaml file\" if not c\n\n # surcharge d'options\n $sections.each {|s|\n next if c[s].nil?\n if c[s].class == Array\n if $sections_uniq.include?(s)\n # remove then add option\n c[s].each {|o|\n o2 = o.gsub(/=.*/, \"=\")\n conf[s].delete_if {|o3| o3.start_with?(o2)}\n conf[s].push o\n }\n else\n c[s].each {|o|\n if o[0] == \"!\"\n # delete option\n conf[s].delete o[1..-1]\n else\n # just add option\n conf[s].push o\n end\n }\n end\n else\n conf[s] = c[s]\n end\n }\n rescue\n puts \"Error loading #{optfile}\"\n end\n else\n puts \"Skip loading unknown specific config file #{optfile}\" if $verbose\n end\n\n conf.each {|k,v|\n if v.class == Array\n conf[k].each_index {|i|\n conf[k][i].gsub!(/%B/, $basedir) if conf[k][i].class == String\n conf[k][i].gsub!(/%b/, $confdir) if conf[k][i].class == String\n conf[k][i].gsub!(/%D/, @doc.dir) if conf[k][i].class == String\n }\n else\n conf[k].gsub!(/%B/, $basedir) if conf[k].class == String\n conf[k].gsub!(/%b/, $confdir) if conf[k].class == String\n conf[k].gsub!(/%D/, @doc.dir) if conf[k].class == String\n end\n }\n\n return conf\n end",
"title": ""
},
{
"docid": "fea864e2ddb6738c28232fe86b997ab3",
"score": "0.5463968",
"text": "def default_config_file\n if File.exist?(kitchen_yml) && File.exist?(dot_kitchen_yml)\n raise UserError, \"Both #{kitchen_yml} and #{dot_kitchen_yml} found. Please use the un-dotted variant: #{kitchen_yml}.\"\n end\n\n File.exist?(kitchen_yml) ? kitchen_yml : dot_kitchen_yml\n end",
"title": ""
},
{
"docid": "b19516e1228e294002b5a70c74ec8e2b",
"score": "0.54550886",
"text": "def load_yml(filename); end",
"title": ""
},
{
"docid": "4ce212603e6fa85c459131c851dd2dee",
"score": "0.54528725",
"text": "def merge!(defaults)\n @options = @options.reverse_merge(defaults)\n end",
"title": ""
},
{
"docid": "e9293e62ed9515fe3f792d48afffdef8",
"score": "0.54394394",
"text": "def resolve_defaults(options)\n options.merge(@defaults)\n end",
"title": ""
},
{
"docid": "6ba4dfb91f00a0b2344b36a7b6298e6c",
"score": "0.5430802",
"text": "def save_yaml(path=nil)\n unless path\n # Display file explorer\n path = Qt::FileDialog.getSaveFileName(self, \"Save configuration file\", \"./myconfig.yml\", \"YAML Files (*.yml *.yaml)\")\n end\n\n begin\n config_hash = Hash.new\n @container_hash.each do |pos, container|\n config_hash[pos] = container.config\n end\n File.open(path, \"w\") {|f| f.write(config_hash.to_yaml) }\n rescue Exception => e\n Vizkit.error \"A problem occured while trying to write configuration to '#{path}': \\n#{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "0ed9f15f91998afab98ff1b4f427b197",
"score": "0.54248583",
"text": "def read_options_from_file\n Shellwords.shellwords File.read(\".rspec_n\").to_s.gsub(/\\n|\\r\\n/, \" \")\n end",
"title": ""
},
{
"docid": "18164831b77cc03a1fec36525a0e332c",
"score": "0.5424418",
"text": "def load_config!\n if options[:config]\n config_inst = Config.new(options[:config])\n elsif self.class.const_defined?(:DEFAULT_CONFIGURATION_FILES)\n path = self.class.const_get(:DEFAULT_CONFIGURATION_FILES).detect do |check|\n full_check = File.expand_path(check)\n File.exists?(full_check)\n end\n config_inst = Config.new(path) if path\n end\n if config_inst\n options.delete(:config)\n defaults_inst = Smash[\n config_class.new(\n defaults.to_smash\n ).to_smash.find_all do |key, value|\n defaults.key?(key)\n end\n ]\n config_data = config_inst.data\n config_inst = Smash[\n config_inst.to_smash.find_all do |key, value|\n config_data.key?(key)\n end\n ]\n options_inst = Smash[\n config_class.new(\n options.to_smash\n ).to_smash.find_all do |key, value|\n options.key?(key)\n end\n ]\n @options = config_class.new(\n defaults_inst.to_smash.deep_merge(\n config_inst.to_smash.deep_merge(\n options_inst.to_smash\n )\n )\n ).to_smash\n else\n @options = config_class.new(\n defaults.to_smash.deep_merge(\n options.to_smash\n )\n ).to_smash\n end\n options\n end",
"title": ""
},
{
"docid": "dd1e594462d4b90c6374853c894b69a4",
"score": "0.5420428",
"text": "def merge_settings\n defaults = {\n continue: false,\n format: 135,\n output: \"#{options[:tmp_dir]}/\" +\n Time.now.strftime(\"%d-%m-%Y-%H%M%S\") +\n \".mp4\",\n no_warnings: true\n }\n\n @settings = defaults.merge!(options.select { |k, v| defaults.key?(k) && v })\n end",
"title": ""
},
{
"docid": "5cc3cf4012b7a0520a9db001cfd74a83",
"score": "0.54171735",
"text": "def config\n\tYAML.load(File.open(\"config.yaml\"))\nend",
"title": ""
},
{
"docid": "759ad61ff2dbb065ecd7b0a1a0d226d9",
"score": "0.54142624",
"text": "def update_options file, options\n options.deep_merge!(load_file(file))\n end",
"title": ""
},
{
"docid": "bc663974ff825b43afb269fe6140441e",
"score": "0.5406027",
"text": "def read_settings_file(input)\n settings_file = File.join(Dir.pwd, 'settings/default_settings.yml')\n unless input['--settings'].nil?\n settings_file = input['--settings']\n end\n\n unless File.exists?(settings_file)\n raise \"Settings file '#{settings_file}' does not exist\"\n end\n\n File.read(settings_file)\n end",
"title": ""
},
{
"docid": "fd8fe735c5583e5d31119d59b301caa2",
"score": "0.5403076",
"text": "def update_config\n if File.directory?(yolo_dir) and File.exist?(yaml_path)\n @yaml = YAML::load_file yaml_path\n update_yaml_setting(@yaml, \"deployment\", \"api_token\", \"example\")\n update_yaml_setting(@yaml, \"deployment\", \"team_token\", \"example\")\n end\n end",
"title": ""
},
{
"docid": "ce58d1a4379359c69ed97b9794239990",
"score": "0.5401611",
"text": "def recreate_default_config(test_to_run = 3)\n File.delete('config/prefs.yml') if File.exist?('config/prefs.yml')\n newPrefFile = File.new('config/prefs.yml', 'w+')\n newPrefFile.puts(\"#[1]- Operational\n#[2]- Functionnal\n#[3]- All\ntests_to_run: #{test_to_run}\")\n newPrefFile.close\nend",
"title": ""
},
{
"docid": "16b3347cd0ceb225bf8230c08fbc96fc",
"score": "0.53974766",
"text": "def yaml_config\n IceNine.deep_freeze(YAML.load_file(config_file)) if config_file.file?\n end",
"title": ""
},
{
"docid": "d4d7937fde6569a62b21db2dc7172a37",
"score": "0.53966004",
"text": "def load_config\n if params[:config].given?\n @config = File.open(File.expand_path(params[:config].value)) { |f| JSON.load(f) }\n\n @config.each do |key, value|\n if params.has_key?(key) and params[key].values == params[key].defaults\n params[key].values = [*value]\n params[key].given = true\n end\n end\n\n end\n end",
"title": ""
}
] |
5d6a02e4deed39d3757000c74e156d81
|
Find the folders that don't contain this document
|
[
{
"docid": "0bde33f3c567459bc2d1fd81d38579b2",
"score": "0.51622546",
"text": "def without_document(document)\n where(\"id not in (#{membership_query(document)})\")\n end",
"title": ""
}
] |
[
{
"docid": "986380c3b35bd010ead97b050053a624",
"score": "0.65173745",
"text": "def documents_without_folder\n documents.unfolded\n end",
"title": ""
},
{
"docid": "0b0c46596115cb57b803db00bbb84d78",
"score": "0.6392908",
"text": "def unneeded_files_in_destination\n requested_paths = files.map do |file|\n file.pkg_destination_path\n end\n\n existing_paths = FileFinders::Normal.new(destination_path).find_all('*')\n\n unnecessary_paths = existing_paths - requested_paths\n\n unnecessary_paths.select! do |path|\n !::File.directory?(File.join(destination_path, path))\n end\n\n unnecessary_paths\n end",
"title": ""
},
{
"docid": "c111936b775f8e082f3a2fe90802e039",
"score": "0.6158859",
"text": "def net_excluded_directories\n net = []\n all = self.excluded_directories.map { |dir| buildr_project._(dir.to_s) }.sort_by { |d| d.size }\n all.each_with_index do |dir, i|\n unless all[0 ... i].find { |other| dir =~ /^#{other}/ }\n net << dir\n end\n end\n net\n end",
"title": ""
},
{
"docid": "c111936b775f8e082f3a2fe90802e039",
"score": "0.6158859",
"text": "def net_excluded_directories\n net = []\n all = self.excluded_directories.map { |dir| buildr_project._(dir.to_s) }.sort_by { |d| d.size }\n all.each_with_index do |dir, i|\n unless all[0 ... i].find { |other| dir =~ /^#{other}/ }\n net << dir\n end\n end\n net\n end",
"title": ""
},
{
"docid": "521f2f43aa4c5e2124ad1d61f8bdb6e5",
"score": "0.60835546",
"text": "def detected_directories\n sub_directories.reject do |on_disk|\n children.any? { |in_db| in_db.full_path == on_disk }\n end.map do |found|\n children.new(relative_path: found.relative_path_from(disk.path), disk: disk)\n end.each(&:valid?) # build paths\n end",
"title": ""
},
{
"docid": "a45d45c7690f4f4b0a727502f10b08f9",
"score": "0.60255885",
"text": "def find_files_not(sort)\n files = []\n Find.find(sort) do |path|\n next if File.directory? path\n next if File.basename(path) =~ /^\\./\n next if (tv_file File.basename(path))\n files << path\n end\n files\nend",
"title": ""
},
{
"docid": "2055de02d2dfbbeb120facb93fd58847",
"score": "0.6010973",
"text": "def list_of_directories\n Dir.entries(\"./inspections\").select {|d| !d.start_with?(\".\") }\n end",
"title": ""
},
{
"docid": "4a9f4c6d5367e1c046f8aeb51833dd6c",
"score": "0.5983005",
"text": "def exclude_dir\n @exclude_dirs.map { |p| Pathname.new(path) + p }.select(&:exist?)\n end",
"title": ""
},
{
"docid": "f062cf221634c04567bd9d30cb3a7878",
"score": "0.59435785",
"text": "def excluded_files() = []",
"title": ""
},
{
"docid": "6862e932f769cca6f74e733b0c16fb67",
"score": "0.59219325",
"text": "def _directories wd\n $log.debug \" directories got XXX: #{wd} \"\n d = Dir.new(wd)\n ent = d.entries.reject{|e| !File.directory? File.join(wd,e)}\n $log.debug \" directories got XXX: #{ent} \"\n ent.delete(\".\");ent.delete(\"..\")\n return ent\n end",
"title": ""
},
{
"docid": "a1b3e97bf718c6de496290436e383754",
"score": "0.5918573",
"text": "def keep_dirs\n site.keep_files.flat_map { |file| parent_dirs(site.in_dest_dir(file)) }.to_set\n end",
"title": ""
},
{
"docid": "6f66f05a9566b73af2fd56f525c52c17",
"score": "0.5876635",
"text": "def folders\n html = http_request(@uri + '/wato.py', {\n folder: '',\n mode: 'folder',\n }, false)\n html.split(/\\n/).each do |line|\n next unless line =~ /class=\"folderpath\"/\n end\n res = []\n html.split(/\\n/).grep(/mode=editfolder/).each do |line|\n line =~ /folder=(.*?)'/\n res.push $1 unless $1.nil?\n end\n res\n end",
"title": ""
},
{
"docid": "d429285953f76e038c94284248768e20",
"score": "0.5857222",
"text": "def _folders\r\n Dir.glob(File.join(\"templates\", \"**/\"))\r\n end",
"title": ""
},
{
"docid": "c8650039a02d3ebefc6a48ededde640b",
"score": "0.5851422",
"text": "def folders\n wayfinder.decorated_ephemera_folders\n end",
"title": ""
},
{
"docid": "c4be1c2887179cd6a59887e275810eae",
"score": "0.58468586",
"text": "def blacklisted_dir_entries\n %w[. ..]\n end",
"title": ""
},
{
"docid": "d1e2e717c9f681f23d6eb25a95aaa7bd",
"score": "0.5809996",
"text": "def find_valid_dirs\n\t\treturn @dirs.find_all do |dir|\n\t\t\tif dir.tainted?\n\t\t\t\tself.log.info \"Discarding tainted directory entry %p\" % [ dir ]\n\t\t\t\tnext\n\t\t\tend\n\n\t\t\tpath = Pathname.new( dir )\n\n\t\t\tif ! path.exist?\n\t\t\t\tself.log.debug \"Discarding non-existant path: %s\" % [ path ]\n\t\t\t\tnext false\n\t\t\telsif ! path.directory?\n\t\t\t\tself.log.debug \"Discarding non-directory: %s\" % [ path ]\n\t\t\t\tnext false\n\t\t\telsif ! path.readable?\n\t\t\t\tself.log.debug \"Discarding unreadable directory: %s\" % [ path ]\n\t\t\t\tnext false\n\t\t\telsif( (path.stat.mode & 0002).nonzero? )\n\t\t\t\tself.log.debug \"Discarding world-writable directory: %s\" % [ path ]\n\t\t\t\tnext false\n\t\t\tend\n\t\t\t\n\t\t\ttrue\n\t\tend.map {|pn| pn.to_s }\n\tend",
"title": ""
},
{
"docid": "324af2d2695d87fe2b448222003ce7ad",
"score": "0.58093137",
"text": "def test_missing_collection\n docs = SimpleDocument.all \"missing-folder\"\n assert_equal({}, docs)\n end",
"title": ""
},
{
"docid": "b9038f94b3fb601cfeccd3dc054fece1",
"score": "0.5781293",
"text": "def removed_unmarked_paths\n #remove dirs\n dirs_enum = @dirs.each_value\n loop do\n dir_stat = dirs_enum.next rescue break\n if dir_stat.marked\n dir_stat.marked = false # unset flag for next monitoring\\index\\remove phase\n #recursive call\n dir_stat.removed_unmarked_paths\n else\n # directory is not marked. Remove it, since it does not exist.\n write_to_log(\"NON_EXISTING dir: \" + dir_stat.path)\n # remove file with changed checksum\n $local_content_data_lock.synchronize{\n $local_content_data.remove_directory(dir_stat.path, Params['local_server_name'])\n }\n rm_dir(dir_stat)\n end\n end\n\n #remove files\n files_enum = @files.each_value\n loop do\n file_stat = files_enum.next rescue break\n if file_stat.marked\n file_stat.marked = false # unset flag for next monitoring\\index\\remove phase\n else\n # file not marked meaning it is no longer exist. Remove.\n write_to_log(\"NON_EXISTING file: \" + file_stat.path)\n # remove file with changed checksum\n $local_content_data_lock.synchronize{\n $local_content_data.remove_instance(Params['local_server_name'], file_stat.path)\n }\n # remove from tree\n @files.delete(file_stat.path)\n end\n end\n end",
"title": ""
},
{
"docid": "5508a43c410fd52568ef379f712e572e",
"score": "0.577257",
"text": "def keep_dirs; end",
"title": ""
},
{
"docid": "2e5924c3f5919811cd015c371418ec57",
"score": "0.57583827",
"text": "def folders_filtering folders\n return folders unless @folder_regexp\n folders.select do |folder|\n test_name_by_date folder\n end\n end",
"title": ""
},
{
"docid": "d3bdecd832bd04ba8725cea8a0ee8cf6",
"score": "0.5696689",
"text": "def folders\n if tags\n return ['booknotes'] if tags.include?('#booknote')\n return ['links'] if tags.include?('#links')\n return ['journal'] if tags.include?('#journal')\n\n if tags.any? { |t| t.match %r{#career/} }\n return tags\n .find { |t| t.match %r{#career/} }\n .gsub('#', '')\n .split('/')\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "c0fec6f092fab39b8b70dca2b1aecbe7",
"score": "0.56865543",
"text": "def ignored_folder?(folder)\n IGNORED_FOLDERS.include?(folder.display_name)\n end",
"title": ""
},
{
"docid": "4d601d661f75ff3fdced44d66ed4eaae",
"score": "0.5680292",
"text": "def ignore_paths\n Dir.glob(\"**/*\").select { |f| File.directory? f }\n .collect { |name| \"#{name}/\" }\n - [\"app/\",\n \"app/views/\",\n \"app/views/branded/\",\n \"app/views/branded/public_pages/\",\n \"app/views/branded/home/\",\n \"app/views/branded/contact_us/\",\n \"app/views/branded/contact_us/contacts/\",\n \"app/views/branded/shared/\",\n \"app/views/branded/layouts/\",\n \"app/views/branded/static_pages/\"]\nend",
"title": ""
},
{
"docid": "65b1806350259880c44e56234d582c5d",
"score": "0.5676877",
"text": "def available_folder\n return root if flat?\n\n folders.reverse.find { |folder| folder.count < folder_limit }\n end",
"title": ""
},
{
"docid": "29cc259c0d79cab3462c433616cee2ba",
"score": "0.5643283",
"text": "def ignorable_paths\n []\n end",
"title": ""
},
{
"docid": "24f210030ab81cfa86dde02a4710b828",
"score": "0.5606781",
"text": "def exclude\n @_exclude ||= Set.new %w(test spec tmp features config public db).map{ |path| Padrino.root(path) }\n end",
"title": ""
},
{
"docid": "8a5e90c9f6405f9a7aef5d0d69d26478",
"score": "0.5602492",
"text": "def defender_additional_guarded_folders\n return @defender_additional_guarded_folders\n end",
"title": ""
},
{
"docid": "e1704657ccb2a986fda2f379f385f8a5",
"score": "0.55999005",
"text": "def ignore_includes\n ret = []\n ret << \"_includes/jekyll/**/*\"\n ret << [\"_includes/styleguide\", \"_includes/styleguide/**/*\"]\n ret << \"_includes/*.html\"\n ret << [\"_includes/atoms/figure\", \"_includes/atoms/figure/*\"]\n ret << [\"_includes/atoms/sanitize.html\", \"_includes/atoms/imagetitle.html\", \"_includes/atoms/classname.html\"]\n ret\n end",
"title": ""
},
{
"docid": "9f91910865d7fd4d2a269046363987bf",
"score": "0.55780625",
"text": "def exclude_dirs=(rval)\n @exclude_dirs = rval.map { |d| d.is_a?(Pathname) ? d : Pathname.new(d) }\n end",
"title": ""
},
{
"docid": "52393e14f26e4b47eb8155f3fb937070",
"score": "0.55402106",
"text": "def parent_folders\n parent_feed = Internal::Utils.extract_links(data, 'up', 'application/atom+xml','type' => 'feed')\n unless parent_feed.empty?\n Collection.new(repository, parent_feed.first)\n else\n parent_entry = Internal::Utils.extract_links(data, 'up', 'application/atom+xml','type' => 'entry')\n unless parent_entry.empty?\n e = conn.get_atom_entry(parent_entry.first)\n [ActiveCMIS::Object.from_atom_entry(repository, e)]\n else\n []\n end\n end\n end",
"title": ""
},
{
"docid": "07fabe82ef3a4a216fc5ea59f205e93a",
"score": "0.55216813",
"text": "def dirs; entries.find_all {|e| e.is_a? SiteDir} end",
"title": ""
},
{
"docid": "b6c249c6af1eb0fd1cba7d1feb4ead01",
"score": "0.55169934",
"text": "def find_files\n find_files_recursive(@build_result_dir, '')\n end",
"title": ""
},
{
"docid": "e37484968ac246c85e8877e426c652f0",
"score": "0.5513602",
"text": "def folders\n xpath './folder'\n end",
"title": ""
},
{
"docid": "d2132081cc3df7167442f1302cbd2d13",
"score": "0.55023736",
"text": "def skip_paths; end",
"title": ""
},
{
"docid": "ed8dd7bcb996cd622fc41ee3935b9524",
"score": "0.55006427",
"text": "def search_paths\n # NOTE: Do not cache this list, specific generators\n # will modify it with their own lookups\n create_search_paths.select { |path| File.directory?(path) }\n end",
"title": ""
},
{
"docid": "46050a65cf99c788efe5fbddebf118ca",
"score": "0.5491054",
"text": "def subfolders\n if new_record?\n raise Errors::FolderNotFound.new(@id, \"Folder does only exist locally\")\n else\n begin\n self.class.some(@conn_id, @location.path)\n rescue Errors::FolderNotFound\n []\n end\n end\n end",
"title": ""
},
{
"docid": "ac04b3e81d4af811fd516ff3a7411392",
"score": "0.5484502",
"text": "def folder\n nil\n end",
"title": ""
},
{
"docid": "46d8a4289b68cbd95da0fe8a1dc3cf19",
"score": "0.5455786",
"text": "def unmanifested_files\n mfs = manifested_files.map { |f| File.join bag_dir, f }\n bag_files.reject { |f| mfs.member? f }\n end",
"title": ""
},
{
"docid": "46d8a4289b68cbd95da0fe8a1dc3cf19",
"score": "0.5455786",
"text": "def unmanifested_files\n mfs = manifested_files.map { |f| File.join bag_dir, f }\n bag_files.reject { |f| mfs.member? f }\n end",
"title": ""
},
{
"docid": "872621478abcfb334e8d34972e2fc2a8",
"score": "0.5452083",
"text": "def directories\n directory.directoires\n end",
"title": ""
},
{
"docid": "7fb81a88f03c7b63f3db293d06df4ace",
"score": "0.5448605",
"text": "def directories; end",
"title": ""
},
{
"docid": "7fb81a88f03c7b63f3db293d06df4ace",
"score": "0.5448605",
"text": "def directories; end",
"title": ""
},
{
"docid": "fe2d804813da86922337eb3137694f7a",
"score": "0.5432845",
"text": "def excluded\n return [] if directory.empty? || directory == '*'\n @excluded ||= process_exclusions(@raw_data['exclude'])\n end",
"title": ""
},
{
"docid": "ce65bc5291d84542a51c6d8246f08ec0",
"score": "0.54289913",
"text": "def folders\n ContextIO::Folder.all(@account_id, @label)\n end",
"title": ""
},
{
"docid": "b30e40157651e946deb5cfe575816d75",
"score": "0.5428396",
"text": "def excluded_files\n # TODO: also append files marked as %{exclude} (or handle elsewhere?)\n missing_files_for(upstream_gem)\n end",
"title": ""
},
{
"docid": "fd791b0a7d7a417997136971fa74d174",
"score": "0.5408502",
"text": "def fetchUntestedProjects \r\n @logger.debug \"search untested projects: #{@workspaceFolder}\"\r\n\t\tprojectFolders = FileList.new(@workspaceFolder+\"/*/\")\r\n\t\tprojectFolders.exclude(@workspaceFolder+\"/.*/\") # no meta-data\t\t\r\n\t\tprojectFolders.each do |projectFolder|\r\n\t\t\tsourceFiles = FileList.new(projectFolder+\"/**/*.{h,hpp,c,cpp}\")\r\n\t\t\tif sourceFiles.size() > 0 then\r\n\t\t\t\r\n\t\t\t\tprojectPath = Pathname.new(projectFolder).cleanpath.to_s\r\n\t\t\t\tif @testedProjects.find{ |item| item.projectFolder.eql?(projectPath) } == nil then\r\n @logger.debug \"=> untested project: #{File.basename(projectPath)}\" \r\n\t\t\t\t\t@untestedProjects << projectPath\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "7441f0b134534a43f6d56a776f69cbca",
"score": "0.54079276",
"text": "def clearWVDirs(flacdirs)\nfinalFlacDirs = Array.new\n\n flacdirs.each { |fd| \\\n found = false\n Dir.foreach(fd) { |file| \\\n if(File.directory?(fd+\"/\"+file))\n Dir.foreach(fd+\"/\"+file) { |findwv| \\\n if(findwv[-3..-1]==\".wv\")\n found = true\n break\n end\n }\n end\n }\n if(found==false)\n finalFlacDirs << fd\n end\n }\n return finalFlacDirs\nend",
"title": ""
},
{
"docid": "f868bc317c96d25ba18cc744eb6e2947",
"score": "0.5407717",
"text": "def ignore_parent_exclusion; end",
"title": ""
},
{
"docid": "b73884ec7c7a5a58eff38881067eaee5",
"score": "0.5403087",
"text": "def find(dirs); end",
"title": ""
},
{
"docid": "59e76634280f4a2e00a4bacce887e9c2",
"score": "0.53999907",
"text": "def find_orphans\n clustered_elements = Set.new()\n @project.clusters.each {|c| c.elements.each {|e| clustered_elements << e}}\n orphans = @project.elements.select {|e| not clustered_elements.include?(e)}\n return orphans\n end",
"title": ""
},
{
"docid": "b4b5972f2b74b314d1762df3b56d09ac",
"score": "0.5385094",
"text": "def filter_out_descendants(dirs)\n return dirs if dirs.length < 2\n\n dirs_sorted_by_nparts = dirs.sort_by { |dir| dir.each_filename.to_a.length }\n descendants = []\n\n until dirs_sorted_by_nparts.empty?\n dir = dirs_sorted_by_nparts.shift\n\n dirs_sorted_by_nparts.reject! do |possible_descendant|\n ascendant_of?(dir, possible_descendant) && descendants << possible_descendant\n end\n end\n\n # Array#- preserves order.\n dirs - descendants\n end",
"title": ""
},
{
"docid": "436a8bed885d249c39561733195cfad8",
"score": "0.53779227",
"text": "def nonlink_entries(dirname=mpwd)\n simple_entries(dirname).select {|e|\n ! File.symlink?(File.join(dirname,e))\n }\n end",
"title": ""
},
{
"docid": "b9e11ad91464fe5d46802a200ab22704",
"score": "0.53775394",
"text": "def visible_files\n result = []\n for dir in @dirs\n result += visible_files_under(dir)\n end\n return result\n end",
"title": ""
},
{
"docid": "31cc3812a0173fe4e4351f5f59eda293",
"score": "0.536737",
"text": "def build_implicit_folders_list(cms_list)\n folder_list = {}\n STDERR.puts \"\\n\"\n cms_list.each do |key, entry|\n if key.include?(File::SEPARATOR)\n Pathname.new(key).dirname.descend { |directory|\n directory_name = directory.to_s\n\n if directory_name =~ /[A-Z]/\n STDERR.puts \"Warning: The #{entry[:kind]} path '#{key}' with title: '#{entry[:title]}' contains uppercase characters. Reccomend to avoid using them in CMS 'path' and 'system_names'\"\n end\n\n unless cms_list[directory_name]\n folder_list[directory_name] = directory_name\n STDERR.puts \"Warning: The #{entry[:kind]} in CMS '#{key}' with title: '#{entry[:title]}' includes a folder '#{directory_name}' that is not a section in the CMS\" unless entry[:kind] == :template && entry[:type] == 'partial'\n end\n }\n end\n end\n folder_list\n end",
"title": ""
},
{
"docid": "ed36b0f76f8e0f0f6c92553db8aba9ed",
"score": "0.5350365",
"text": "def folders\r\n @folders ||= begin\r\n request_body = <<-eos\r\n \t\t<?xml version=\"1.0\"?>\r\n \t\t\t\t<D:searchrequest xmlns:D = \"DAV:\">\r\n \t\t\t\t\t <D:sql>\r\n \t\t\t\t\t SELECT \"DAV:displayname\", \"DAV:contentclass\"\r\n \t\t\t\t\t FROM SCOPE('shallow traversal of \"#{to_s}\"')\r\n \t\t\t\t\t WHERE \"DAV:ishidden\" = false\r\n AND \"DAV:isfolder\" = true\r\n \t\t\t\t\t </D:sql>\r\n \t\t\t\t</D:searchrequest>\r\n eos\r\n\r\n response = DavSearchRequest.execute(@credentials, :body => request_body)\r\n\r\n folders = {}\r\n\r\n # iterate through folders query and add a new Folder\r\n # object for each, under a normalized name.\r\n xpath_query = \"//a:propstat[a:status/text() = 'HTTP/1.1 200 OK']/a:prop\"\r\n XML::Parser.string(response.body).parse.find(xpath_query).each do |m|\r\n displayname = m.find_first('a:displayname').content\r\n contentclass = m.find_first('a:contentclass').content\r\n folders[displayname.normalize] = Folder.new(@credentials, self, displayname, contentclass.split(':').last.sub(/folder$/, '')) \r\n end\r\n \r\n folders\r\n end\r\n end",
"title": ""
},
{
"docid": "54fc96e4e89fa0077ea198eb39a210e6",
"score": "0.5338294",
"text": "def resources_without_parents(resources)\n resources.select do |r| \n r.parent.nil? or !resources.include?(r.parent)\n end\n end",
"title": ""
},
{
"docid": "d046f4026d5550ca9dd771dc2e219d83",
"score": "0.5336122",
"text": "def parent_dirs(file); end",
"title": ""
},
{
"docid": "885d98b6e08adc227dc036acc153b884",
"score": "0.53185064",
"text": "def non_dir_files(path)\n `find -L #{path}`\n .split\n .map { |f| Pathname.new(f) }\n .reject { |f| f.directory? }\n .map { |f| f.relative_path_from(path) }\nend",
"title": ""
},
{
"docid": "e2f9042ad4e5fbcbedce8d854a8cbafa",
"score": "0.5315134",
"text": "def excludes\n return Dir.chdir( base ) {\n %w(. .. .svn .git .hg CVS Rakefile) + files_for_erb +\n Dir.glob( '*~' ) + Dir.glob( '#*#' ) + Dir.glob( '*.bak' )\n }\n end",
"title": ""
},
{
"docid": "da88765d5d9200cd23a30a714128477e",
"score": "0.531154",
"text": "def directories\n @directories ||= []\n end",
"title": ""
},
{
"docid": "da88765d5d9200cd23a30a714128477e",
"score": "0.531154",
"text": "def directories\n @directories ||= []\n end",
"title": ""
},
{
"docid": "5abeac801390e7c102a2d53464231ae7",
"score": "0.53099966",
"text": "def folders\n @folders ||= self.send(:sources).map do |s|\n s.switches\n end.flatten(1).uniq\n end",
"title": ""
},
{
"docid": "e4791ded1c4e7930ca423ec7733587f9",
"score": "0.5306121",
"text": "def excluded\n @excluded_projects.keys\n end",
"title": ""
},
{
"docid": "932452a055d1bc289451c6404f8c358b",
"score": "0.52903914",
"text": "def dirs; end",
"title": ""
},
{
"docid": "932452a055d1bc289451c6404f8c358b",
"score": "0.52903914",
"text": "def dirs; end",
"title": ""
},
{
"docid": "b744716c295299c94ce84e842b782d4e",
"score": "0.5287903",
"text": "def _potential_directories\n dirs = []\n dirs << _vim_user_dir\n dirs << _vim_system_dir\n return dirs.compact.map { |dir| File.expand_path(dir) }\n end",
"title": ""
},
{
"docid": "e4575332b1862104542b2de0c420c61d",
"score": "0.5287791",
"text": "def exclude_paths\n @source_paths ||= []\n end",
"title": ""
},
{
"docid": "9f2208aba2a2e98e53d25002aca5fc12",
"score": "0.52849114",
"text": "def clean_paths\n cached_used = used_files\n glob_options = File::FNM_DOTMATCH | File::FNM_CASEFOLD\n files = Pathname.glob(root + \"**/*\", glob_options).map(&:to_s)\n\n files.reject! do |candidate|\n candidate = candidate.downcase\n candidate.end_with?('.', '..') || cached_used.any? do |path|\n path = path.downcase\n path.include?(candidate) || candidate.include?(path)\n end\n end\n files\n end",
"title": ""
},
{
"docid": "d4c29e1b93bd9755c05a5d82b085416e",
"score": "0.5277001",
"text": "def dirs_until_dodona_dir\n dir = @pwd\n children = [dir]\n loop do\n return [] if dir.root?\n return children if dir == @dodona_dir\n children.unshift dir\n dir = dir.parent\n end\n end",
"title": ""
},
{
"docid": "47193b5634023e6b9a2a1e84bffd71cc",
"score": "0.5274778",
"text": "def new_dirs\n @new_dirs ||= new_files.flat_map { |file| parent_dirs(file) }.to_set\n end",
"title": ""
},
{
"docid": "7511d243f0e245fa2fb3a096ff931020",
"score": "0.5272404",
"text": "def bundled_files\n self.study_files.where(:id.ne => self.parent&.id)\n end",
"title": ""
},
{
"docid": "481dd16dc0c4ad4f8ab0cafef2462975",
"score": "0.52698517",
"text": "def dir_files(dir)\n Find.find(dir).to_a.reject!{|f| File.directory?(f) }\nend",
"title": ""
},
{
"docid": "0eff9327d0de1203b53a216b37aeff97",
"score": "0.52661866",
"text": "def get_important_files dir\n list = []\n l = dir.size + 1\n s = nil\n ($visited_files + $bookmarks.values).each do |e|\n if e.index(dir) == 0\n #list << e[l..-1]\n s = e[l..-1]\n next unless s\n if s.index \":\"\n s = s[0, s.index(\":\")] + \"/\"\n end\n # only insert if the file is in a deeper dir, otherwise we'll be duplicating files from this folder\n list << s if s.index \"/\"\n end\n end\n # bookmarks have : which needs to be removed\n #list1 = $bookmarks.values.select do |e|\n #e.index(dir) == 0\n #end\n #list.concat list1\n return list\nend",
"title": ""
},
{
"docid": "0ea6f8d60a2204696c18709f7c58e742",
"score": "0.52578574",
"text": "def resources_without_parents(resources)\n resources.select do |r|\n r.parent.nil? or !resources.include?(r.parent)\n end\n end",
"title": ""
},
{
"docid": "3c36d627c9266138351246bb77c36318",
"score": "0.5254063",
"text": "def event_folders events\n events.group_by {|e| dir_name(e.file_name) }.keys.sort.uniq\nend",
"title": ""
},
{
"docid": "3079ef35073f5f9a48b15c414341d72c",
"score": "0.5253745",
"text": "def removed_infections\n return [] unless prev_scan\n current_infections = scan.infections.collect{|infection| infection.file}\n prev_scan.infections.select{|infection| !current_infections.include?(infection.file)}\nend",
"title": ""
},
{
"docid": "1c69c3f02e1ada9af3a19c5b4deb4b0d",
"score": "0.5249306",
"text": "def folders\n return unless session\n session.folders.find_all_by_parent_folder_id(id)\n end",
"title": ""
},
{
"docid": "ba48bdc1928c3566f763d5f04fa3df6a",
"score": "0.5249287",
"text": "def getDirs dir\n\t\tFind.find(dir)\t\n\tend",
"title": ""
},
{
"docid": "4be0a03fa36f72691ffdd73cd6ae5d4f",
"score": "0.52358586",
"text": "def filter_directories(modified_files); end",
"title": ""
},
{
"docid": "85d8bc12b08992e2e3136f09ebd7c47b",
"score": "0.5224732",
"text": "def directory_paths\n pages.map { |p| File.dirname(p.path).split(\"/\")[0] }.uniq\n end",
"title": ""
},
{
"docid": "ec763ee6c9a91514ae625a22c68927ff",
"score": "0.5217558",
"text": "def site_files\n exclude = %r/tmp$|bak$|~$|CVS|\\.svn/o\n\n rgxp = %r/\\A#{data}\\/?/o\n paths = Hash.new {|h,k| h[k] = []}\n\n Find.find(data) do |p|\n next if exclude =~ p\n\n if test(?d, p)\n paths[p.sub(rgxp, '')]\n next\n end\n dir = ::File.dirname(p).sub(rgxp, '')\n paths[dir] << p.sub(rgxp, '')\n end\n\n paths\n end",
"title": ""
},
{
"docid": "bfdb9d9ac6215dac29c7edca1dd8d1e3",
"score": "0.5217499",
"text": "def find_dirs\n\tlog_paths = [ \"/etc/\", \"/home/log/\", \"/home/ids/log/\", \"/usr/adm/\", \"/usr/apache/\", \"/usr/apache2/\", \"/usr/httpd/\", \"/usr/local/apache/\", \"/usr/local/apache2/\", \"/usr/var/adm/\", \"/usr/var/ids/\", \"/usr/var/log/\", \"/var/adm/\", \"/var/ids/\", \"/var/log/\", \"/var/prelude/\", \"/var/run/\", \"/var/www/\", \"/root/Desktop/\" ]\n\n\t#Cycle through the Possible Log File Locations and Check for Logs if directory exists\n\tlog_paths.each do |dir|\n\t\t#Check if the log possible log file directory exists before we go and glob its content\n\t\tif File.exists?(dir) && File.directory?(dir)\n\t\t\tfind_logs(\"#{dir}\")\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "5bcc64f9fc67e7440532a2d716326a41",
"score": "0.52139115",
"text": "def get_filelist(root_path)\n array = Dir[root_path+'**/*'].reject {|fn| File.directory?(fn) }\nend",
"title": ""
},
{
"docid": "7efb717d3ca6ed41e2de17d98cb86381",
"score": "0.5212032",
"text": "def get_non_flac_paths(source_path)\n non_flac_file_paths = Find.find(source_path).reject {|f| f.end_with?(\".flac\")}\n non_flac_file_paths.reject! {|e| !File.file?(e) }\n return non_flac_file_paths\nend",
"title": ""
},
{
"docid": "6cd1b5d924c90ab277fc6631618a3080",
"score": "0.52087325",
"text": "def process_exclusions globs\n remainder = globs.select do |glob|\n if glob_is_directory?(glob)\n exdir = File.join(directory, glob_to_directory(glob))\n included.delete_if { |file| file.start_with?(exdir) }\n false\n else\n true\n end\n end\n process_globs remainder\n end",
"title": ""
},
{
"docid": "cfc61409292be800ad73691ac76fcc4d",
"score": "0.52067333",
"text": "def ignore_parent_exclusion?; end",
"title": ""
},
{
"docid": "da8f0a8033d6593ce6c1d4b5919afc58",
"score": "0.5205752",
"text": "def remove_collection_redundancy\n redundant_file_count = 0\n redundant_dir_count = 0\n redundant_files = []\n redundant_dirs = []\n\n session[@pallet.collection][:directories].each do |dir|\n session[@pallet.collection][:files].each do |file|\n if file.starts_with?(dir + '/')\n logger.debug \"\\n===> removing redundancy for file: #{file}\\n\\n\"\n redundant_file_count += 1\n redundant_files << file\n end\n end\n # find redundant dirs\n session[@pallet.collection][:directories].each do |t_dir|\n if t_dir.starts_with?(dir + '/')\n logger.debug \"\\n===> removing redundancy for dir: #{t_dir}\\n\\n\"\n redundant_dir_count += 1\n redundant_dirs << t_dir\n end\n end\n end\n\n # actually remove redundancy\n redundant_files.each { |file| session[@pallet.collection][:files].delete file }\n redundant_dirs.each { |dir| session[@pallet.collection][:directories].delete dir }\n\n return redundant_file_count, redundant_dir_count\n end",
"title": ""
},
{
"docid": "f2ce620a3f0073c1aec8e3f8ea547692",
"score": "0.5203504",
"text": "def visible_files_under(directory)\n result = []\n if File.exists?(directory)\n allFiles = Dir.entries(directory)\n dirs = allFiles.select{ |f| File.directory?(File.join(directory,f)) &&\n f != '.' && f != '..' }\n files = allFiles.reject{ |f| File.directory?(File.join(directory,f)) }\n result += files\n dirs.each do |subdir|\n result += visible_files_under(File.join(directory,subdir))\n end\n end\n return result\n end",
"title": ""
},
{
"docid": "e1d01f12564cf9d7f4ac403868768f4a",
"score": "0.5202362",
"text": "def rip_folders()\n if @version >= IOS_VERSION_9\n @database.execute(\"SELECT ZICCLOUDSYNCINGOBJECT.Z_PK \" + \n \"FROM ZICCLOUDSYNCINGOBJECT \" + \n \"WHERE ZICCLOUDSYNCINGOBJECT.ZTITLE2 IS NOT NULL\") do |row|\n rip_folder(row[\"Z_PK\"])\n end\n end\n\n # In legacy Notes the \"folders\" were \"stores\"\n if @version == IOS_LEGACY_VERSION\n @database.execute(\"SELECT ZSTORE.Z_PK FROM ZSTORE\") do |row|\n rip_folder(row[\"Z_PK\"])\n end\n end\n end",
"title": ""
},
{
"docid": "de2a3cadc9114ee7c517cbaf71d9f7f4",
"score": "0.5200755",
"text": "def file_list(full_directory_path)\r\n path = File.join(full_directory_path, '*')\r\n Dir[path].reject { |fn| File.directory?(fn) || File.basename(fn) == @folder_config }\r\n end",
"title": ""
},
{
"docid": "a907a3579c15e9422904e9af586d715b",
"score": "0.51966417",
"text": "def existing_files\n existing_dirs.each do |dir|\n Find.find(dir) do |path|\n if FileTest.directory?(path)\n if File.basename(path)[0] == '.'\n # Don't look any further into directories that start with a dot.\n Find.prune\n else\n next\n end\n elsif block_given?\n yield path\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5574d72962fe8e1e9422bc5b17f0a47f",
"score": "0.5195049",
"text": "def result_paths( pattern = '*' )\n paths = nil\n Dir.chdir(dir) {\n paths = Dir.glob(pattern).map {|x| Pathname.new(x).expand_path }\n }\n # remove directories of Analysis\n anl_dirs = analyses.map {|anl| /^#{anl.dir.to_s}/ }\n paths.reject do |path|\n anl_dirs.find {|anl_dir| anl_dir =~ path.to_s }\n end\n end",
"title": ""
},
{
"docid": "3352247067a4681a4c7ae3c6129a0148",
"score": "0.51731604",
"text": "def folders_listing path\n cmd = \"find #{path} -type d \"\n if @folder_regexp\n cmd += \"-regextype posix-extended \"\n cmd += \"-regex \\\"#{@folder_regexp}\\\"\"\n end\n folders = exec_cmd(cmd)\n folders\n end",
"title": ""
},
{
"docid": "cc566ca39b87012d0ee65d30f3ad50a8",
"score": "0.5166819",
"text": "def exclude_paths \n @exclude_paths ||= /^#{admin_prefix}$/\n end",
"title": ""
},
{
"docid": "7f135138695d9f95284103f365c72bf0",
"score": "0.51587707",
"text": "def defender_guarded_folders_allowed_app_paths\n return @defender_guarded_folders_allowed_app_paths\n end",
"title": ""
},
{
"docid": "af92ec95a0d357fad9715bfef2241c02",
"score": "0.5156237",
"text": "def check_for_inexistent_files\n inexistent_files = []\n @files.each do |file|\n inexistent_files << file unless File.exists? file\n end\n\n inexistent_files\n end",
"title": ""
},
{
"docid": "d6e691d51021dd7c5a8ed5b3bcc2987c",
"score": "0.51530623",
"text": "def existing_files\n files = Set.new\n regex = keep_file_regex\n dirs = keep_dirs\n\n Utils.safe_glob(site.in_dest_dir, [\"**\", \"*\"], File::FNM_DOTMATCH).each do |file|\n next if HIDDEN_FILE_REGEX.match?(file) || regex.match?(file) || dirs.include?(file)\n\n files << file\n end\n\n files\n end",
"title": ""
},
{
"docid": "f96fe943c135dcea9e9194e0b950ae73",
"score": "0.51483893",
"text": "def recursive_find_directories_and_files dirname\r\n base_path = self.class.lookup('ExtAdminSection').path + \"/templates/\"\r\n \r\n directories = []\r\n files = []\r\n \r\n Find.find(File.join(base_path, dirname)) do |path|\r\n if FileTest.directory?(path)\r\n directories << path.gsub(base_path, '')\r\n else\r\n files << path.gsub(base_path, '')\r\n end\r\n end\r\n \r\n return directories, files\r\n end",
"title": ""
},
{
"docid": "55a36a672c398e641ef39af9de932cf8",
"score": "0.5147861",
"text": "def files\n @files ||= Dir.glob(File.join(@root, '**/*'), GLOB_FLAGS).select do |path|\n File.file?(path) && path !~ IGNORE_REGEX\n end\n end",
"title": ""
},
{
"docid": "e4ddd7a080a0572f2caead863d271e78",
"score": "0.5139079",
"text": "def directories\n return @expanded_dirs if @expanded_dirs\n\n raw_dirs = File.readlines(settings.check_dirs).map(&:chomp)\n simple_dirs = raw_dirs.reject{ |line| line.empty? || line.start_with?('#') }\n expanded_dirs = simple_dirs.map do |line|\n expanded = Dir.glob(line)\n if expanded.empty?\n # return original line for error reporting\n line\n else\n # only return directories\n expanded.select{ |dir| File.directory?(dir) }\n end\n end\n @expanded_dirs = expanded_dirs.flatten.sort_by(&:downcase)\n end",
"title": ""
}
] |
8e03c83fe481342bfb112e57331c7d5b
|
Private, for the test suite. source://activesupport//lib/active_support/inflector/inflections.rb84
|
[
{
"docid": "fd6582765aeef195d5bd746b42b494b5",
"score": "0.0",
"text": "def initialize_dup(orig); end",
"title": ""
}
] |
[
{
"docid": "ff7ad4bba7e3559fc9519de0aa5af67e",
"score": "0.80171406",
"text": "def inflector; end",
"title": ""
},
{
"docid": "ff7ad4bba7e3559fc9519de0aa5af67e",
"score": "0.80171406",
"text": "def inflector; end",
"title": ""
},
{
"docid": "70eada24a98fb99f8b7e2ef48aa70c5b",
"score": "0.775761",
"text": "def inflector\n @inflector.()\n end",
"title": ""
},
{
"docid": "3e5451dce8c40615a9ab87ca362bfd28",
"score": "0.77036995",
"text": "def default_inflector\n ActiveSupport::Inflector\n end",
"title": ""
},
{
"docid": "a9052f1c8f37de371e533bd2844908ca",
"score": "0.7646061",
"text": "def inflect(inflections); end",
"title": ""
},
{
"docid": "a6d9a947f1aa7d2b011aa6851641e956",
"score": "0.7425887",
"text": "def inflector=(_arg0); end",
"title": ""
},
{
"docid": "b08548b43401d58dcb25704ad75b46a5",
"score": "0.69734704",
"text": "def jsonapi_inflector\n ActiveSupport::Inflector\n rescue\n Dry::Inflector.new\n end",
"title": ""
},
{
"docid": "6d82bd5d782edc0592b35cdce896f451",
"score": "0.67290187",
"text": "def titleize\n ActiveSupport::Inflector.titleize(self)\n end",
"title": ""
},
{
"docid": "5e87c5e4b1d32d033089744b950edad8",
"score": "0.67195946",
"text": "def inflections(locale = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5e87c5e4b1d32d033089744b950edad8",
"score": "0.67195946",
"text": "def inflections(locale = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "5e87c5e4b1d32d033089744b950edad8",
"score": "0.67195946",
"text": "def inflections(locale = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "bf499f210f2279a14d0be4f50dbecfd2",
"score": "0.66070575",
"text": "def demodulize\n ActiveSupport::Inflector.demodulize(self)\n end",
"title": ""
},
{
"docid": "7c9eebd7b89cb9b3c5a201fd67cf19bf",
"score": "0.65509206",
"text": "def underscore\n ActiveSupport::Inflector.underscore(self)\n end",
"title": ""
},
{
"docid": "53af0dcab783fd84218e4ba5041dae65",
"score": "0.6484385",
"text": "def classify\n singularize.camelize\n end",
"title": ""
},
{
"docid": "2b7d1811abeb912b6b7d75a109b4811a",
"score": "0.6478539",
"text": "def titleize\n Inflections.titleize(self)\n end",
"title": ""
},
{
"docid": "255dabcc97f87d95bf3216c383a181d9",
"score": "0.6450761",
"text": "def apply_inflections(word, rules, locale = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "255dabcc97f87d95bf3216c383a181d9",
"score": "0.6450761",
"text": "def apply_inflections(word, rules, locale = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "255dabcc97f87d95bf3216c383a181d9",
"score": "0.6450761",
"text": "def apply_inflections(word, rules, locale = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "0df1ed1286c3a2f8a0f6e5136e856bf7",
"score": "0.64223",
"text": "def camelize_lower(key)\n ActiveSupport::Inflector.camelize(key, false)\n end",
"title": ""
},
{
"docid": "530e83723de11dff1525d3df0e30d51d",
"score": "0.64153934",
"text": "def sort_name\n ActiveSupport::Inflector.transliterate(name.downcase)\n end",
"title": ""
},
{
"docid": "77dce5b84c6b50790b01b857a1587c64",
"score": "0.6398656",
"text": "def classify\n Inflections.classify(self)\n end",
"title": ""
},
{
"docid": "b71b2c02739acad2752e10b3422c27bf",
"score": "0.63853335",
"text": "def constantize\n\tself.split('_').collect{|i| i.capitalize}.join\nend",
"title": ""
},
{
"docid": "7bbbd2099b4cc0a3c1edfa0d1e48d330",
"score": "0.6359574",
"text": "def file_name_camel\n file_name_plural.camelize\n end",
"title": ""
},
{
"docid": "e1f73b1fcb6224b8e5576d6ac690e0ce",
"score": "0.63568056",
"text": "def downcase_i18n( name )\n SportDb::Import::Variant.downcase_i18n( name )\nend",
"title": ""
},
{
"docid": "87cfbe144f01b6f9ce91d6f793f2d337",
"score": "0.6341776",
"text": "def i18n_downcase\n @@safe_downcasing_locales = [:en, :es, :mk, :sr, :fr]\n return self unless defined?(I18n) && I18n.locale && @@safe_downcasing_locales.include?(I18n.locale.to_sym)\n return self.downcase\n end",
"title": ""
},
{
"docid": "c18b9df57e25ad4ebaf0f12a9f93e9ed",
"score": "0.6333435",
"text": "def proper_name\n name.titleize\n end",
"title": ""
},
{
"docid": "eda66b622521377fdb40055cd3e13a32",
"score": "0.63024884",
"text": "def human_resources_name\n human_name == human_name(:count => 2) ? human_name.pluralize.downcase : human_name(:count => 2).downcase\n end",
"title": ""
},
{
"docid": "7aa642e602a238ecb2792a18e4c2ef3e",
"score": "0.63015074",
"text": "def singularize(locale = :en)\n ActiveSupport::Inflector.singularize(self, locale)\n end",
"title": ""
},
{
"docid": "3d6f8175869b66e7445ae25609a7421e",
"score": "0.62962765",
"text": "def singularize\n ActiveSupport::Inflector.singularize(self)\n end",
"title": ""
},
{
"docid": "3d6f8175869b66e7445ae25609a7421e",
"score": "0.62962765",
"text": "def singularize\n ActiveSupport::Inflector.singularize(self)\n end",
"title": ""
},
{
"docid": "8df944c375bbff90bf5deedee78e8bc4",
"score": "0.6292733",
"text": "def classify\n ActiveSupport::Inflector.classify(self)\n end",
"title": ""
},
{
"docid": "8df944c375bbff90bf5deedee78e8bc4",
"score": "0.6292733",
"text": "def classify\n ActiveSupport::Inflector.classify(self)\n end",
"title": ""
},
{
"docid": "f90b4706c3098e82aa4742d321dbeff1",
"score": "0.6284961",
"text": "def default_name(inflector = Inflector)\n Name[inflector.underscore(name).tr(\"/\", \"_\").to_sym]\n end",
"title": ""
},
{
"docid": "95965fabc7ff9e357f7a6d6fff579185",
"score": "0.6273299",
"text": "def safe_constantize\n ActiveSupport::Inflector.safe_constantize(self)\n end",
"title": ""
},
{
"docid": "79ae0d1a60f5c6677bb858d2919f7f4d",
"score": "0.62687296",
"text": "def safe_constantize\n Gorillib::Inflector.safe_constantize(self)\n end",
"title": ""
},
{
"docid": "27568a2aeb3eec1199a8e03347247402",
"score": "0.622801",
"text": "def inflect(inflections)\n overrides.merge!(inflections)\n end",
"title": ""
},
{
"docid": "d4fc5d405e358a7f1aeee772325a5775",
"score": "0.62277883",
"text": "def camelize!\n titleize!\n replace(self[0, 1].downcase + self[1..-1])\n end",
"title": ""
},
{
"docid": "d4fc5d405e358a7f1aeee772325a5775",
"score": "0.62277883",
"text": "def camelize!\n titleize!\n replace(self[0, 1].downcase + self[1..-1])\n end",
"title": ""
},
{
"docid": "05e5acf420c4eaf64fdef47df79ba034",
"score": "0.6210119",
"text": "def collection_name_from_class_name(class_name)\n class_name.demodulize.underscore.pluralize.to_sym\n end",
"title": ""
},
{
"docid": "b34c873572f46f9c665271e754e0ffab",
"score": "0.6205946",
"text": "def snake_case(str)\n inflector.underscore(sym_to_str(str).tr('.', '_'))\n end",
"title": ""
},
{
"docid": "98b72243702f04e00e3fcebb1674d130",
"score": "0.619051",
"text": "def normalized_name\n name = self.name\n name.sub! ' ', '_'\n name.downcase!\n end",
"title": ""
},
{
"docid": "5350f87d12406c351a96f33c3cc0ee03",
"score": "0.61664695",
"text": "def singularize(locale = :en)\n Inflections.singularize(self, locale)\n end",
"title": ""
},
{
"docid": "5fe3e63a893b816378b25122029243c0",
"score": "0.6153255",
"text": "def humanize(options = {})\n ActiveSupport::Inflector.humanize(self, options)\n end",
"title": ""
},
{
"docid": "7f4fac4f5fa81caa56162010a31e09c5",
"score": "0.61510986",
"text": "def humanized_name\n self.class.name[/\\w+$/].gsub(/([a-z])([A-Z])/) { \"#{$1} #{$2}\" }\n end",
"title": ""
},
{
"docid": "0b3c9fdd8e0ca25ec1a47ac966127c84",
"score": "0.61469746",
"text": "def humanize(str)\n ActiveSupport::Inflector.humanize(str)\n end",
"title": ""
},
{
"docid": "5ef18632d3550119846b8ae6a1e2aae0",
"score": "0.61375105",
"text": "def decamelize\n self.gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').tr(\"-\", \"_\").downcase\n end",
"title": ""
},
{
"docid": "6be3691ddef8d00c42faa0f852a2283a",
"score": "0.61311823",
"text": "def underscore\n Inflections.underscore(self)\n end",
"title": ""
},
{
"docid": "1710cbe08620900dccdce44a85562ed3",
"score": "0.61245507",
"text": "def tableize\n ActiveSupport::Inflector.tableize(self)\n end",
"title": ""
},
{
"docid": "496964e11a9f70dd205bb07cd0176929",
"score": "0.60923356",
"text": "def constantize(name)\n name.to_s.split('_').map(&:capitalize).join\n end",
"title": ""
},
{
"docid": "847a188d980df1c9e2d2c86c563e7ff3",
"score": "0.6088969",
"text": "def singularize(word, locale = :en)\n apply_inflections(word, [])\n end",
"title": ""
},
{
"docid": "db3fc5cbe362bdcc726041be406a73b4",
"score": "0.6080845",
"text": "def split_name\n @model.name.to_s.split(\"::\").each {|n| n.gsub!(/([a-z])([A-Z])/, '\\1_\\2'); n.downcase!}\n end",
"title": ""
},
{
"docid": "54a204da0f7f2a4afd1710ec16432b4d",
"score": "0.60663295",
"text": "def deconstantize\n ActiveSupport::Inflector.deconstantize(self)\n end",
"title": ""
},
{
"docid": "b1dc439f1553080db29b2319765c89a8",
"score": "0.6064287",
"text": "def translate_model_name_pluralized(model)\n translate_model_name(model, 2)\n end",
"title": ""
},
{
"docid": "78640d4beda7e5c67b70056f604c4bb0",
"score": "0.6060062",
"text": "def normalize_app_name(app_name)\n # . or - or ' ' or _\n regexp = /\\.|-|\\s|_/\n app_name.titleize.gsub(/\\.|-|\\s|_/, \" \")\nend",
"title": ""
},
{
"docid": "c7fc2f6923efb530ef8b8e9d3ca107c2",
"score": "0.6057319",
"text": "def convert_plural(object_name)\n object_name = object_name.gsub(/([a-z])([A-Z])/, '\\1_\\2')\n pluralized_string = object_name\n\n if object_name =~ /^System$/i\n # do nothing\n elsif object_name =~ /y$/\n pluralized_string = object_name.sub(/y$/, \"ies\")\n elsif object_name =~ /s$/\n pluralized_string = object_name + \"es\"\n else\n pluralized_string = object_name + \"s\"\n end\n\n return pluralized_string.downcase\n end",
"title": ""
},
{
"docid": "7f70cf6b0e9b156855161bf227d3832d",
"score": "0.6053224",
"text": "def get_model_name(model_name)\n model_name.gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').downcase\n end",
"title": ""
},
{
"docid": "3586aa264e5a102e32718cf4c64f9e10",
"score": "0.6048988",
"text": "def safe_constantize(camel_cased_word); end",
"title": ""
},
{
"docid": "3586aa264e5a102e32718cf4c64f9e10",
"score": "0.6048988",
"text": "def safe_constantize(camel_cased_word); end",
"title": ""
},
{
"docid": "3586aa264e5a102e32718cf4c64f9e10",
"score": "0.6048988",
"text": "def safe_constantize(camel_cased_word); end",
"title": ""
},
{
"docid": "9164d6344fc042807e335e6ce3e54f75",
"score": "0.6046841",
"text": "def model_name_whitout_accents\n self.name.removeaccents\n end",
"title": ""
},
{
"docid": "b786b933819f841ce48701acb582e852",
"score": "0.6046724",
"text": "def camelize\n self.split('_').collect{|mot| mot.capitalize}.join(\"\")\n end",
"title": ""
},
{
"docid": "b786b933819f841ce48701acb582e852",
"score": "0.6046724",
"text": "def camelize\n self.split('_').collect{|mot| mot.capitalize}.join(\"\")\n end",
"title": ""
},
{
"docid": "2b00251b33131ca5794d3a28af4df0ab",
"score": "0.60436803",
"text": "def name\n inflector.underscore(namespace_name)\n end",
"title": ""
},
{
"docid": "a2fdd515aea7491b031660f423686ab6",
"score": "0.6038881",
"text": "def underscorize\n self.downcase.gsub(/\\s+/, '_')\n end",
"title": ""
},
{
"docid": "0e033b75d405fa86c4dcdca771bd52d5",
"score": "0.603065",
"text": "def path_to_name\n NameCase(tr('_-', ' ').upcase).titlecase\n end",
"title": ""
},
{
"docid": "b241f242737b80db9c2e3e938c3cb10d",
"score": "0.60243326",
"text": "def display_name\n \"#{name.to_s.demodulize.pluralize.titleize}\"\n end",
"title": ""
},
{
"docid": "1ec0d93917b635c221ff4424a5bfcc75",
"score": "0.60222185",
"text": "def friendly_name\n self.class.name.split('::').last.gsub(/([a-z])([A-Z])/, '\\\\1 \\\\2')\n .downcase\n end",
"title": ""
},
{
"docid": "a87fffacf7d41594bca7465047b9477c",
"score": "0.60049605",
"text": "def constantize( str )\n str.to_s.split(/[-_]/).map { |v| v.capitalize }.to_s\n end",
"title": ""
},
{
"docid": "a1bec58fefa7051eb16a9cf5278a5dce",
"score": "0.60047793",
"text": "def normalized_name\n I18n.transliterate(name.strip, locale: :en)\n .downcase.gsub(/[^0-9a-z_\\s\\-]/, '').gsub(/[\\s_-]+/, '_')\n end",
"title": ""
},
{
"docid": "dca5bbebf0bad3eaf4d694921af8b454",
"score": "0.5998466",
"text": "def model_name_for_translation\n model_constant.to_s.underscore\n end",
"title": ""
},
{
"docid": "e918030440093a63472ab787ed192049",
"score": "0.5997845",
"text": "def camelize_meth\n self.gsub(/_([a-z])/) { $1.upcase }\n end",
"title": ""
},
{
"docid": "b14de41aa6eccbfccc9c4d29ddf984bf",
"score": "0.5994287",
"text": "def normalized_name; end",
"title": ""
},
{
"docid": "b14de41aa6eccbfccc9c4d29ddf984bf",
"score": "0.5994287",
"text": "def normalized_name; end",
"title": ""
},
{
"docid": "38bb6e417427d908d084b6cbac5ceb30",
"score": "0.5990271",
"text": "def decamelize\n self.gsub(/(^|[a-z])([A-Z])/) do \n ($1.empty?)? $2 : \"#{$1}_#{$2}\"\n end.downcase\n end",
"title": ""
},
{
"docid": "5ac56f34c0e5dac6c699157ec59abfc2",
"score": "0.5988825",
"text": "def default_name\n Inflector.underscore(Inflector.demodulize(name)).to_sym\n end",
"title": ""
},
{
"docid": "2f76d49588480c857495cb5f65ac6a86",
"score": "0.5985496",
"text": "def underscore\n gsub(NAMESPACE_SEPARATOR, '/').\n gsub(/([A-Z\\d]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n downcase\n end",
"title": ""
},
{
"docid": "d6c62fd0be96ba67103675f31cb29410",
"score": "0.59829426",
"text": "def underscore(camel_cased_word)\n return camel_cased_word unless /[A-Z-]|::/.match?(camel_cased_word)\n word = camel_cased_word.to_s.gsub(\"::\".freeze, \"/\".freeze)\n #word.gsub!(inflections.acronyms_underscore_regex) { \"#{$1 && '_'.freeze }#{$2.downcase}\" }\n word.gsub!(/([A-Z\\d]+)([A-Z][a-z])/, '\\1_\\2'.freeze)\n word.gsub!(/([a-z\\d])([A-Z])/, '\\1_\\2'.freeze)\n word.tr!(\"-\".freeze, \"_\".freeze)\n word.downcase!\n word\nend",
"title": ""
},
{
"docid": "db33f3ec9411dfecfebb58d2a6dba1af",
"score": "0.5982031",
"text": "def camelize\n self.gsub(/(^|_)([a-z])/) { $2.upcase }\n end",
"title": ""
},
{
"docid": "b6bb58b860c3917b2377bf799cf342a1",
"score": "0.59648603",
"text": "def camelize\n self.split('_').map {|w| w.capitalize}.join\n end",
"title": ""
},
{
"docid": "5e8a1d91ac596ddd5be699a7cedf003d",
"score": "0.5962628",
"text": "def decamelize\n self.gsub(/(^|[a-z])([A-Z])/) do \n ($1.empty?)? $2 : \"#{$1}_#{$2}\"\n end.downcase\n end",
"title": ""
},
{
"docid": "2584c238220c37e7734faf5685043a11",
"score": "0.5957649",
"text": "def underscore\n self.gsub(/::/, '/').\n gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n tr(\"-\", \"_\").\n downcase\n end",
"title": ""
},
{
"docid": "f69168e88d49c0302bf92d98cab200f0",
"score": "0.59440356",
"text": "def cname\n Inflector.demodulize(self.class.name)\n end",
"title": ""
},
{
"docid": "90f463681dd7c9e144497f1c5cdff87f",
"score": "0.5942641",
"text": "def display_name\n model.name.demodulize.underscore.humanize\n end",
"title": ""
},
{
"docid": "801ec257c060f66daa0ff010c282b583",
"score": "0.5942124",
"text": "def app_name_const\n name.gsub(/\\W/, '_').gsub(/[a-z\\d]*/) { $&.capitalize }.gsub('_', '')\n end",
"title": ""
},
{
"docid": "7941c9565d3230eb1e44b692c9e1f131",
"score": "0.5940501",
"text": "def underlinize\n self.split(/(?=[A-Z])/).join('_').downcase.gsub(\"::_\", \"/\")\n end",
"title": ""
},
{
"docid": "c6363e36f235e7014cc2f2a69a813f45",
"score": "0.59366393",
"text": "def downcase_and_split\n\n str = self.name.parameterize(separator: '_')\n self.name = str\n end",
"title": ""
},
{
"docid": "2e6a0ab112e2b10c44de546f85c873d8",
"score": "0.5934089",
"text": "def name_clean\n self.name.gsub(/_/, \" \").titleize\n end",
"title": ""
},
{
"docid": "5004e879a9ab48fc6f8aede33a9d7811",
"score": "0.59327674",
"text": "def convert_name\n self.name = I18n.transliterate(self.name).upcase\n end",
"title": ""
},
{
"docid": "5004e879a9ab48fc6f8aede33a9d7811",
"score": "0.59327674",
"text": "def convert_name\n self.name = I18n.transliterate(self.name).upcase\n end",
"title": ""
},
{
"docid": "5004e879a9ab48fc6f8aede33a9d7811",
"score": "0.59327674",
"text": "def convert_name\n self.name = I18n.transliterate(self.name).upcase\n end",
"title": ""
},
{
"docid": "e3fcef9e5fd35bb6b5e874def9263c25",
"score": "0.5914092",
"text": "def mm_camelize\n to_s.mm_camelize.to_sym\n end",
"title": ""
},
{
"docid": "fd92eb10fad89d10ec96f70490df0b35",
"score": "0.59133226",
"text": "def singularize_resource\n resource_name.singularize.downcase\n end",
"title": ""
},
{
"docid": "c3a004792345d3c924fe775dab63dc5c",
"score": "0.59128165",
"text": "def add_camelization(name, camelized); end",
"title": ""
},
{
"docid": "598fd6a72e6b30c68f74739eeccc31cc",
"score": "0.59123415",
"text": "def underscore camel_cased_word\n camel_cased_word.to_s.gsub(/::/, '/').\n gsub(/([A-Z]+)([A-Z][a-z])/, '\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/, '\\1_\\2').\n tr(\"-\", \"_\").\n downcase\n end",
"title": ""
},
{
"docid": "a3ade1b236f5192d3ebc0c0a37e39239",
"score": "0.59040654",
"text": "def sti_name\n name.demodulize.underscore\n end",
"title": ""
},
{
"docid": "1ee5e7683f5958f00e8df20ab000f41e",
"score": "0.5901341",
"text": "def camelized_name\n @camelized_name ||= underscored_name.camelize\n end",
"title": ""
},
{
"docid": "bbea6cd6b28505a7d759d60dff957bf6",
"score": "0.58994025",
"text": "def demodulize\n Inflector.demodulize(self)\n end",
"title": ""
},
{
"docid": "6b83760c5f2e7654ef32afaa6ec5703d",
"score": "0.5898971",
"text": "def computerize\r\n self.underscore.downcase.gsub ' ', '_'\r\n end",
"title": ""
},
{
"docid": "4c89b63ca25d1e24d749918a1b3e55c6",
"score": "0.5897366",
"text": "def apply_inflections(word, rules)\n result = word.to_s.dup\n\n if word.empty? || inflections.uncountables.include?(result.downcase[/\\b\\w+\\Z/])\n result\n else\n rules.each { |(rule, replacement)| break if result.sub!(rule, replacement) }\n result\n end\n end",
"title": ""
},
{
"docid": "4c89b63ca25d1e24d749918a1b3e55c6",
"score": "0.58969086",
"text": "def apply_inflections(word, rules)\n result = word.to_s.dup\n\n if word.empty? || inflections.uncountables.include?(result.downcase[/\\b\\w+\\Z/])\n result\n else\n rules.each { |(rule, replacement)| break if result.sub!(rule, replacement) }\n result\n end\n end",
"title": ""
},
{
"docid": "31cffa8fb3c92cd5002a82cf6951b78a",
"score": "0.5892761",
"text": "def default_name\n return unless name\n Inflector.underscore(name).gsub('/', '_').to_sym\n end",
"title": ""
}
] |
fb263526de4cbdd79b184f9176d0ea24
|
BasicObject is so basic that this part is missing too
|
[
{
"docid": "2d18a6d28e8e1d4e7b3e1840f8417bd3",
"score": "0.0",
"text": "def class\n Proxy\n end",
"title": ""
}
] |
[
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73352844",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "6ffcbe25c8660e65fe3b24a876d58f35",
"score": "0.73342746",
"text": "def object; end",
"title": ""
},
{
"docid": "37cdba0f8108c8e03598feeca3770ded",
"score": "0.717839",
"text": "def objectish; end",
"title": ""
},
{
"docid": "a5fff4f7b65283864097f98f4aef58a8",
"score": "0.7177773",
"text": "def obj; end",
"title": ""
},
{
"docid": "99da79118e91e2758fbed111079233d2",
"score": "0.6873372",
"text": "def object(objectish); end",
"title": ""
},
{
"docid": "e62c810942847cb329d7093261774f00",
"score": "0.6692888",
"text": "def orig_object; end",
"title": ""
},
{
"docid": "8409e7e5669196df865ee38588aa42c7",
"score": "0.65769637",
"text": "def object\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "4d9aeee3a653ba88e7578916daffd138",
"score": "0.65691966",
"text": "def __getobj__\n end",
"title": ""
},
{
"docid": "1b2b099dc10147a12468086f32c8ea3d",
"score": "0.6517579",
"text": "def objectish=(_arg0); end",
"title": ""
},
{
"docid": "f858a338d05784861520c69ae1534a50",
"score": "0.64710987",
"text": "def __getobj__; end",
"title": ""
},
{
"docid": "0cea2eb0f49ebae5bf8b5c3c21a4d749",
"score": "0.64360356",
"text": "def object\r\n @obj\r\n end",
"title": ""
},
{
"docid": "b627ada556a46bce720bfa6589850ede",
"score": "0.63865405",
"text": "def initialize object\n @object = object\n end",
"title": ""
},
{
"docid": "a4ca3ff95947eefa961d4a72aaa739fa",
"score": "0.6344478",
"text": "def objects; end",
"title": ""
},
{
"docid": "a4ca3ff95947eefa961d4a72aaa739fa",
"score": "0.6344478",
"text": "def objects; end",
"title": ""
},
{
"docid": "27650e6fec5df23c66ff1f3556aec37f",
"score": "0.63363004",
"text": "def extend_object(obj); end",
"title": ""
},
{
"docid": "e149188710b514542f77a59de5f8059b",
"score": "0.6322685",
"text": "def received_object(object); end",
"title": ""
},
{
"docid": "09fc68b38b8cc6d2819e8486747eb581",
"score": "0.63185227",
"text": "def object=(_); end",
"title": ""
},
{
"docid": "09fc68b38b8cc6d2819e8486747eb581",
"score": "0.63185227",
"text": "def object=(_); end",
"title": ""
},
{
"docid": "b63157592d7c75d99cfb363c47588f71",
"score": "0.62859493",
"text": "def object=(_arg0); end",
"title": ""
},
{
"docid": "b63157592d7c75d99cfb363c47588f71",
"score": "0.62859493",
"text": "def object=(_arg0); end",
"title": ""
},
{
"docid": "b63157592d7c75d99cfb363c47588f71",
"score": "0.62859493",
"text": "def object=(_arg0); end",
"title": ""
},
{
"docid": "248a8e406032fd42e4ca10404c48e8de",
"score": "0.6285646",
"text": "def __target_object ; @target_object ; end",
"title": ""
},
{
"docid": "e1aac5d785e9f4e9e6fe01af00467022",
"score": "0.62432116",
"text": "def initialize object\n self.object = object\n end",
"title": ""
},
{
"docid": "57add0661ee3c4fd3152675e2af0cfaf",
"score": "0.6220268",
"text": "def initialize object\n\t\t\tself.object = object\n\t\tend",
"title": ""
},
{
"docid": "6a02ffd7ccc73f929e1a395938c4afba",
"score": "0.6168955",
"text": "def stubba_object; end",
"title": ""
},
{
"docid": "dc9f39879813b54a350c5d7e3047df6a",
"score": "0.6160407",
"text": "def __getobj__\n\n @_imitated_object\n\n end",
"title": ""
},
{
"docid": "2e1f969dc95fd106b3a10ba5054ac13c",
"score": "0.61428463",
"text": "def initialize(object)\n @object = object\n end",
"title": ""
},
{
"docid": "2e1f969dc95fd106b3a10ba5054ac13c",
"score": "0.61428463",
"text": "def initialize(object)\n @object = object\n end",
"title": ""
},
{
"docid": "37a0fc8fdb636587700f871474661d3a",
"score": "0.61285836",
"text": "def initialize(object, small = false)\n end",
"title": ""
},
{
"docid": "fec4ee38380924b06580ebf1137d6d95",
"score": "0.6125081",
"text": "def initialize\n\t\tself.initializeObject\n\tend",
"title": ""
},
{
"docid": "b0e2ef8b849bf538ebd271e746ed70e8",
"score": "0.6115826",
"text": "def __inside__\n @obj\n end",
"title": ""
},
{
"docid": "713d0ba5ece4b7c1016892ccddb3f992",
"score": "0.611021",
"text": "def access(obj)\n #TODO Write me!!\n end",
"title": ""
},
{
"docid": "51f5a07999eb1a872cbfb5c1d2da4ea3",
"score": "0.6083344",
"text": "def object_class; end",
"title": ""
},
{
"docid": "df7d01705cda5517b90d78a37f4295bf",
"score": "0.6081849",
"text": "def object; \"YES!\"; end",
"title": ""
},
{
"docid": "df7d01705cda5517b90d78a37f4295bf",
"score": "0.6081849",
"text": "def object; \"YES!\"; end",
"title": ""
},
{
"docid": "677f22fd49853b74870f5875bbacac31",
"score": "0.60741097",
"text": "def obj\n @obj\n end",
"title": ""
},
{
"docid": "cbe020696f996d59b9328181c6274173",
"score": "0.6038629",
"text": "def base; object[:base]; end",
"title": ""
},
{
"docid": "67c8a1f537b8c1ff4b1a5e6d8c43c4ec",
"score": "0.60221094",
"text": "def new\n @simple = SimpleObject.new\n end",
"title": ""
},
{
"docid": "701359444c3bc529044a50b60481e991",
"score": "0.6015145",
"text": "def reflection; end",
"title": ""
},
{
"docid": "701359444c3bc529044a50b60481e991",
"score": "0.6015145",
"text": "def reflection; end",
"title": ""
},
{
"docid": "701359444c3bc529044a50b60481e991",
"score": "0.6015145",
"text": "def reflection; end",
"title": ""
},
{
"docid": "701359444c3bc529044a50b60481e991",
"score": "0.6015145",
"text": "def reflection; end",
"title": ""
},
{
"docid": "701359444c3bc529044a50b60481e991",
"score": "0.6015145",
"text": "def reflection; end",
"title": ""
},
{
"docid": "701359444c3bc529044a50b60481e991",
"score": "0.6015145",
"text": "def reflection; end",
"title": ""
},
{
"docid": "701359444c3bc529044a50b60481e991",
"score": "0.6015145",
"text": "def reflection; end",
"title": ""
},
{
"docid": "701359444c3bc529044a50b60481e991",
"score": "0.6015145",
"text": "def reflection; end",
"title": ""
},
{
"docid": "ce8906acd285644249fc2d49670a505d",
"score": "0.6003696",
"text": "def for(source_obj); end",
"title": ""
},
{
"docid": "6fa34b3b572b566e7fb25e07263fb171",
"score": "0.6000824",
"text": "def instance_base_class; XfOOrthObject; end",
"title": ""
},
{
"docid": "08843ccbe402446091b0c7ce729827c8",
"score": "0.59975535",
"text": "def Method(obj); end",
"title": ""
},
{
"docid": "08843ccbe402446091b0c7ce729827c8",
"score": "0.59975535",
"text": "def Method(obj); end",
"title": ""
},
{
"docid": "a344215c3161402d928d5c07ee1e0b22",
"score": "0.59937567",
"text": "def core; end",
"title": ""
},
{
"docid": "ee77f6032c98ca04b0ac0bbc250d9882",
"score": "0.5982909",
"text": "def source_object; end",
"title": ""
},
{
"docid": "ee77f6032c98ca04b0ac0bbc250d9882",
"score": "0.5982909",
"text": "def source_object; end",
"title": ""
},
{
"docid": "b9f4b04041ec6c8520eb52e9795b6229",
"score": "0.5979103",
"text": "def object(subcommand, *arguments)\n\t\t\t\t\tcall('OBJECT', subcommand, *arguments)\n\t\t\t\tend",
"title": ""
},
{
"docid": "28ac66a82fe38728eea4a9837e3bd6ac",
"score": "0.5968821",
"text": "def child_objects; end",
"title": ""
},
{
"docid": "f450843ba507d8c29f5bf70ac05d0bd0",
"score": "0.5967148",
"text": "def initialize(object)\n self.object = object\n end",
"title": ""
},
{
"docid": "46273cf4bdbaa5e7a602e7c7fe2707c9",
"score": "0.5963869",
"text": "def Context(object); end",
"title": ""
},
{
"docid": "c618a53dead1309764b3cb4eadf0c4dc",
"score": "0.5957187",
"text": "def inspect_obj(obj); end",
"title": ""
},
{
"docid": "c618a53dead1309764b3cb4eadf0c4dc",
"score": "0.5957187",
"text": "def inspect_obj(obj); end",
"title": ""
},
{
"docid": "2c5ea0ca8c40b38995c126c44147f449",
"score": "0.5953428",
"text": "def send_object(obj); end",
"title": ""
},
{
"docid": "55f9d989d4861c21f3f845e1c63db8da",
"score": "0.5943871",
"text": "def obj_name; end",
"title": ""
},
{
"docid": "55f9d989d4861c21f3f845e1c63db8da",
"score": "0.5943871",
"text": "def obj_name; end",
"title": ""
},
{
"docid": "e0f755133356540e886e3c822494a7ed",
"score": "0.59348166",
"text": "def basics\n end",
"title": ""
},
{
"docid": "df0445c7fb63a6febc56f8c6a9d2bceb",
"score": "0.5930674",
"text": "def awesome(object); end",
"title": ""
},
{
"docid": "df0445c7fb63a6febc56f8c6a9d2bceb",
"score": "0.59302336",
"text": "def awesome(object); end",
"title": ""
},
{
"docid": "3b8ab55588217f64f0602853ccbb16c1",
"score": "0.59262246",
"text": "def method_object; end",
"title": ""
},
{
"docid": "3b8ab55588217f64f0602853ccbb16c1",
"score": "0.59262246",
"text": "def method_object; end",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.5922086",
"text": "def advanced; end",
"title": ""
},
{
"docid": "67081eb3c98dc9ab87bd978f73a10e81",
"score": "0.5922086",
"text": "def advanced; end",
"title": ""
},
{
"docid": "6a6ed5368f43a25fb9264e65117fa7d1",
"score": "0.59191823",
"text": "def internal; end",
"title": ""
},
{
"docid": "c3285b979f713395f60cf13edce8a310",
"score": "0.5918873",
"text": "def methodmissing; end",
"title": ""
},
{
"docid": "748bd7b5149abf972e7b72dfbb61e623",
"score": "0.59183013",
"text": "def initialize\t\n\t\tend",
"title": ""
},
{
"docid": "8dc43f39ee55715e77bccbc3228da323",
"score": "0.5912969",
"text": "def initialize(object)\n @object = object\n end",
"title": ""
},
{
"docid": "8dc43f39ee55715e77bccbc3228da323",
"score": "0.5912969",
"text": "def initialize(object)\n @object = object\n end",
"title": ""
},
{
"docid": "8dc43f39ee55715e77bccbc3228da323",
"score": "0.5912969",
"text": "def initialize(object)\n @object = object\n end",
"title": ""
},
{
"docid": "398ae1cc3f03c979aa105a71d0adf279",
"score": "0.5912685",
"text": "def complete\n super\n @object\n end",
"title": ""
},
{
"docid": "4c74b6705b57e3a35cabc19cd82758d3",
"score": "0.59115815",
"text": "def object_name; end",
"title": ""
},
{
"docid": "a83980d1953a1624afdb6684da64ec09",
"score": "0.58886915",
"text": "def initialize(); end",
"title": ""
},
{
"docid": "025b67ccbce46d1bba590130649168a9",
"score": "0.58807623",
"text": "def basic_info\n end",
"title": ""
},
{
"docid": "1ef6155d35e1fbdbf8049c594863e4df",
"score": "0.58745664",
"text": "def object_class=(_arg0); end",
"title": ""
},
{
"docid": "5cf2cba0ee7f9825b63b087af5363b37",
"score": "0.5872989",
"text": "def init; end",
"title": ""
}
] |
07fc68648ea4e11825e2cf1b47393e13
|
method allow_private? Generates a description of the matcher expectation.
|
[
{
"docid": "ab0f767bc63498600d84e55ee5c0fd23",
"score": "0.58308864",
"text": "def description\n \"have writer :#{@expected}\"\n end",
"title": ""
}
] |
[
{
"docid": "836ff835379405d5651d9c64bd8ce86a",
"score": "0.6567819",
"text": "def test_is_private_keyword\n verify_method :is_private_keyword?, with: [\n {param: 'private', expect: true},\n {param: ' private', expect: true},\n {param: 'private ', expect: true},\n {param: ' private ', expect: true},\n {param: 'puts \" private \"', expect: false},\n {param: 'def private_method ', expect: false},\n ]\n end",
"title": ""
},
{
"docid": "79919efa7196eca910fd3a9b49f77f5d",
"score": "0.6532184",
"text": "def include_chain_clauses_in_custom_matcher_descriptions?; end",
"title": ""
},
{
"docid": "19c0bd6f9b6c2bfb029a347d72aff880",
"score": "0.65221626",
"text": "def description\n desc = matcher_name.to_s\n\n desc << format_expected_items\n\n desc\n end",
"title": ""
},
{
"docid": "d6d5d2f53643bf314d9d3dbebc6e3ee3",
"score": "0.648604",
"text": "def matches? actual\n super\n\n responds_to_writer?(:allow_private => allow_private?)\n end",
"title": ""
},
{
"docid": "790ed16005391ddef4fc048db923ece9",
"score": "0.6387312",
"text": "def description\n result = \"should_receive(#{@sym.inspect})\"\n result << \".with(#{FlexMock.format_args(@expected_args)})\" if @expected_args\n @count_validators.each do |validator|\n result << validator.describe\n end\n if !@signature_validator.null?\n result << @signature_validator.describe\n end\n result\n end",
"title": ""
},
{
"docid": "5ed3057146ccd339bc32af1e53b741ef",
"score": "0.62785137",
"text": "def get_description_from_matcher(should_or_should_not, method, *args, &block) #:nodoc:\n verb = should_or_should_not.to_s.gsub('_', ' ')\n\n desc = Remarkable::Matchers.send(method, *args, &block).spec(self).description\n verb = Remarkable.t(\"remarkable.core.#{should_or_should_not}\", :default => verb)\n rescue\n desc = method.to_s.gsub('_', ' ')\n ensure\n verb << ' ' << desc\n end",
"title": ""
},
{
"docid": "217e45ee68fe78bb80058f43916d6030",
"score": "0.6217259",
"text": "def actual_for_matcher_text\n description_of(@actual)\n end",
"title": ""
},
{
"docid": "3e0b0bfccbc68bb62a620325a659ad5b",
"score": "0.6199071",
"text": "def include_chain_clauses_in_custom_matcher_descriptions=(_arg0); end",
"title": ""
},
{
"docid": "704ad1258c1fc9618058cc368ff905c7",
"score": "0.599945",
"text": "def respond_to_missing?(m, include_private = false)\n ChefSpec.matchers.key?(m.to_sym) || super\n end",
"title": ""
},
{
"docid": "343bf73716170e1b7e9f43b33d01b963",
"score": "0.5938651",
"text": "def private_method\n \"Private\"\n end",
"title": ""
},
{
"docid": "94c6043ad01310fbd7ec6ca24043d7e0",
"score": "0.59201837",
"text": "def expectation_description\n\t\t\tif @expected_message.is_a?( Regexp )\n\t\t\t\treturn \"finish_with %d (%s) status and a message which matches %p\" % [\n\t\t\t\t\t@expected_status,\n\t\t\t\t\tSTATUS_NAMES[@expected_status],\n\t\t\t\t\t@expected_message\n\t\t\t\t]\n\t\t\telse\n\t\t\t\treturn \"finish_with %d (%s) status and a message which is %p\" % [\n\t\t\t\t\t@expected_status,\n\t\t\t\t\tSTATUS_NAMES[@expected_status],\n\t\t\t\t\t@expected_message\n\t\t\t\t]\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "94c6043ad01310fbd7ec6ca24043d7e0",
"score": "0.59201837",
"text": "def expectation_description\n\t\t\tif @expected_message.is_a?( Regexp )\n\t\t\t\treturn \"finish_with %d (%s) status and a message which matches %p\" % [\n\t\t\t\t\t@expected_status,\n\t\t\t\t\tSTATUS_NAMES[@expected_status],\n\t\t\t\t\t@expected_message\n\t\t\t\t]\n\t\t\telse\n\t\t\t\treturn \"finish_with %d (%s) status and a message which is %p\" % [\n\t\t\t\t\t@expected_status,\n\t\t\t\t\tSTATUS_NAMES[@expected_status],\n\t\t\t\t\t@expected_message\n\t\t\t\t]\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "cb3ce27ed97070eb2e79a6846b370ee5",
"score": "0.5884577",
"text": "def method_missing(*)\n return_val = super\n return return_val unless return_val.respond_to?(:description)\n AliasedMatcher.new(return_val, @description_block)\n end",
"title": ""
},
{
"docid": "cb3ce27ed97070eb2e79a6846b370ee5",
"score": "0.5884577",
"text": "def method_missing(*)\n return_val = super\n return return_val unless return_val.respond_to?(:description)\n AliasedMatcher.new(return_val, @description_block)\n end",
"title": ""
},
{
"docid": "4a1d1d929bbbe40f02255b6d863b38a5",
"score": "0.587677",
"text": "def description\n\t\t\treturn \"the action to %s\" % self.expectation_description\n\t\tend",
"title": ""
},
{
"docid": "4a1d1d929bbbe40f02255b6d863b38a5",
"score": "0.587677",
"text": "def description\n\t\t\treturn \"the action to %s\" % self.expectation_description\n\t\tend",
"title": ""
},
{
"docid": "01fac77dc2b4096634ec15cfe19c6250",
"score": "0.58110684",
"text": "def failure_message_when_negated\n message = \"expected #{@actual.inspect} not to be constructible\"\n\n if method_signature_expectation?\n message << ' ' << method_signature_expectation.description\n end # if\n\n message\n end",
"title": ""
},
{
"docid": "2165e75e017327d61962ba9aaf6564ba",
"score": "0.5796644",
"text": "def private?; end",
"title": ""
},
{
"docid": "2165e75e017327d61962ba9aaf6564ba",
"score": "0.5796603",
"text": "def private?; end",
"title": ""
},
{
"docid": "5b947774c612164762a354a4d28f62b3",
"score": "0.57494855",
"text": "def private?(*) end",
"title": ""
},
{
"docid": "5b947774c612164762a354a4d28f62b3",
"score": "0.57494855",
"text": "def private?(*) end",
"title": ""
},
{
"docid": "5b947774c612164762a354a4d28f62b3",
"score": "0.57494855",
"text": "def private?(*) end",
"title": ""
},
{
"docid": "1383e5024accaef1f4277fb68a0cb03a",
"score": "0.5716855",
"text": "def disallow_expectations; end",
"title": ""
},
{
"docid": "0478c55213912308c5b45905726e15bc",
"score": "0.57099503",
"text": "def description\n \"have predicate :#{@expected}?\"\n end",
"title": ""
},
{
"docid": "ae45394206c90bb2188a551aa28c52b9",
"score": "0.570181",
"text": "def define_negated_matcher(negated_name, base_name, &description_override); end",
"title": ""
},
{
"docid": "4db8a4f820083abbd0be4c56de8a21e3",
"score": "0.56564206",
"text": "def description_shown?(passed, spec)\n specdoc_shown?(passed) || console_for_spec?(spec) || errors_for_spec?(spec)\n end",
"title": ""
},
{
"docid": "bc9259a57eb7dedcb3114e8017abefe6",
"score": "0.5638318",
"text": "def matchers; end",
"title": ""
},
{
"docid": "dabd3426dc9644bf45d3bb088f199b49",
"score": "0.56329507",
"text": "def respond_to_missing?(name, include_private = false)\n !(name =~ /\\A(?:be|have)_/) || super\n end",
"title": ""
},
{
"docid": "772562431d4515ea9bf0d29b9e9fbea1",
"score": "0.5598611",
"text": "def description!\n puts @__assertion__.description\n end",
"title": ""
},
{
"docid": "bff59db9a54d35ae789b36600bad5779",
"score": "0.5589006",
"text": "def respond_to_missing?(name, include_private = false)\n name !~ /\\A(?:be|have)_/ || super\n end",
"title": ""
},
{
"docid": "754ccbae72a035c84d03b990136c5402",
"score": "0.55780214",
"text": "def description\n \"be close to #{expected}\"\n end",
"title": ""
},
{
"docid": "6c62fb0eb6c6309114044949d8bdae41",
"score": "0.5576378",
"text": "def description\n \"should receive #{comparison}#{@msg_count} W3C validation #{type} in #{uri}\"\n end",
"title": ""
},
{
"docid": "5206ad8c3ddcc876a6cf3a20ea4fe634",
"score": "0.5520109",
"text": "def failure_message_when_negated\n @failing_method_names ||= []\n methods, messages = @failing_method_names, []\n\n methods.map do |method|\n message = \"expected #{@actual.inspect} not to respond to #{method.inspect}\"\n\n if method_signature_expectation?\n message << ' ' << method_signature_expectation.description\n end # if\n\n messages << message\n end # method\n\n messages.join \"\\n\"\n end",
"title": ""
},
{
"docid": "c7a3196ec97cc1d9a4dae9d4d006c6e7",
"score": "0.55146205",
"text": "def private?\n is_private\n end",
"title": ""
},
{
"docid": "94db6a899c79c55d53702e2f8246af6e",
"score": "0.550577",
"text": "def description(options={}) #:nodoc:\n message = super(options)\n message.strip!\n\n optionals = self.class.matcher_optionals.map do |optional|\n if @options.key?(optional)\n value = @options[optional]\n\n defaults = [ (value ? :positive : :negative) ]\n # If optional is a symbol and it's not any to any of the reserved symbols, search for it also\n defaults.unshift(value) if value.is_a?(Symbol) && !OPTIONAL_KEYS.include?(value)\n defaults << ''\n\n options = { :default => defaults, :inspect => value.inspect, :value => value.to_s }\n\n if self.class.matcher_optionals_splat.include?(optional)\n value = [ value ] unless Array === value\n options[:sentence] = array_to_sentence(value, true)\n end\n\n translate_optionals_with_namespace(optional, defaults.shift, options)\n else\n translate_optionals_with_namespace(optional, :not_given, :default => '')\n end\n end.compact\n\n message << ' ' << array_to_sentence(optionals)\n message.strip!\n message\n end",
"title": ""
},
{
"docid": "9cfdd84bf6881c0094a6b6272697bd14",
"score": "0.5505459",
"text": "def is_private\n self.private ? \"1\" : \"0\"\n end",
"title": ""
},
{
"docid": "9cfdd84bf6881c0094a6b6272697bd14",
"score": "0.5505459",
"text": "def is_private\n self.private ? \"1\" : \"0\"\n end",
"title": ""
},
{
"docid": "e3a8aed69bae57306d0ac776fa225846",
"score": "0.5500726",
"text": "def gets_private\n # TODO: implement gets_private\n end",
"title": ""
},
{
"docid": "50f3b820353d163b773abe93f07ff371",
"score": "0.54993784",
"text": "def description\n if description = @_proxy.description || ::Spec::Matchers.generated_description\n description\n else\n raise Spec::Example::NoDescriptionError.new(\"example\", @_proxy.location)\n end\n end",
"title": ""
},
{
"docid": "d6e36795a9afab2e06c1b9dbfcd3fb83",
"score": "0.54936135",
"text": "def description_shown?(passed, spec, options = {})\n (specdoc_shown?(passed, options) || console_for_spec?(spec, options) || errors_for_spec?(spec, options))\n end",
"title": ""
},
{
"docid": "7c76ebc1aee59a31978a8a4759fa044c",
"score": "0.54913837",
"text": "def be_like(exp)\n CompareFailure.to_matcher(exp)\n end",
"title": ""
},
{
"docid": "6856c3e2d521998eff2e6e3b8116c563",
"score": "0.5480694",
"text": "def method_missing(name, *args, &block)\n case name.to_s\n when /^is_(an?_)?(.+)$/\n @expectation_strings << \"be #{$2}\"\n @actual_proc = nil\n @actual_string = nil\n @conditions << Proc.new { |o| o.__send__(:\"#{$2}?\", *args) }\n when /^has_(.+)$/\n @expectation_strings << \"have #{$1} #{args.join(', ')}\"\n @actual_proc = nil\n @actual_string = nil\n @didnt = true\n @conditions << Proc.new { |o| o.__send__(:\"has_#{$1}?\", *args) }\n else\n @expectation_strings << \"#{$1} #{args.join(', ')}\"\n @actual_proc = nil\n @actual_string = nil\n @didnt = true\n @conditions << Proc.new { |o| o.__send__(:\"#{name}?\", *args) }\n end\n self\n end",
"title": ""
},
{
"docid": "3811d0743b1f6fcc415eed0a6a02394f",
"score": "0.5477373",
"text": "def respond_to_missing?(name, include_private = false)\n predicate_matcher_name?(name) || super\n end",
"title": ""
},
{
"docid": "d4159e7ec6270ef302d79f1ee9997193",
"score": "0.546172",
"text": "def failure_message_when_negated\n message = \"expected #{@actual.inspect} not to respond to :#{@expected}\"\n message << \" and return #{value_to_string}\" if @value_set\n\n errors = []\n errors << \"responded to :#{@expected}\" if @matches_reader\n errors << \"returned #{@actual.send(@expected).inspect}\" if @matches_reader_value\n\n message << \", but #{errors.join(\" and \")}\"\n message\n end",
"title": ""
},
{
"docid": "4e7237210f79272abe7e4a0b8d38c3f3",
"score": "0.5451183",
"text": "def desc\n if @inspected\n desc_short\n else\n @inspected = true\n desc_long\n end\n end",
"title": ""
},
{
"docid": "883485d9e7cb519e9947c19dc1df0e6f",
"score": "0.54473144",
"text": "def failure_message_when_negated\n actual = prettify_args(@actual)\n matcher = prettify_matcher(@expected.metadata[:name])\n\n if @expected.metadata[:args].count > 0\n args = prettify_args(*@expected.metadata[:args])\n\n \"'#{actual}' should not all #{matcher} '#{args}'\"\n else\n \"'#{actual}' should not all #{matcher}\"\n end\n end",
"title": ""
},
{
"docid": "4377045422364d29176dd7673518a0ca",
"score": "0.5441926",
"text": "def is_private\n is_private? ? \"1\" : \"0\"\n end",
"title": ""
},
{
"docid": "62457e995730a4c3163f647fa6599a77",
"score": "0.54285616",
"text": "def inspect\n inspected = super\n inspected.sub! @private_token, only_show_last_four_chars(@private_token) if @private_token\n inspected\n end",
"title": ""
},
{
"docid": "62457e995730a4c3163f647fa6599a77",
"score": "0.54285616",
"text": "def inspect\n inspected = super\n inspected.sub! @private_token, only_show_last_four_chars(@private_token) if @private_token\n inspected\n end",
"title": ""
},
{
"docid": "11b589b7e58250f8de4ae81b442e1ee7",
"score": "0.54256237",
"text": "def expectation\n raise NotImplementedError, 'method expectation not implemented'\n end",
"title": ""
},
{
"docid": "61349577080612b65749325e0395251b",
"score": "0.5424282",
"text": "def description\n raise NoMethodError, \"#{self.class} should override #description to describe itself, but it doesn't\"\n end",
"title": ""
},
{
"docid": "a33e1da90d0b78ed983efcc64f44d09e",
"score": "0.5423802",
"text": "def describe_additional_expectations\n\t\t\treturn self.additional_expectations.map( &:description )\n\t\tend",
"title": ""
},
{
"docid": "a33e1da90d0b78ed983efcc64f44d09e",
"score": "0.5423802",
"text": "def describe_additional_expectations\n\t\t\treturn self.additional_expectations.map( &:description )\n\t\tend",
"title": ""
},
{
"docid": "d129cc756661d2db1b6e7ead9a68728c",
"score": "0.5420025",
"text": "def in_private; end",
"title": ""
},
{
"docid": "abb665a44219f35c04282dc88bbc37ce",
"score": "0.54119414",
"text": "def description_of(object)\n Aruba::Matchers::ObjectFormatter.format(object)\n end",
"title": ""
},
{
"docid": "ee92716ba15e602787b8ce15592a51b3",
"score": "0.5411222",
"text": "def guarentee(description=\"\", &block) # this is what a method looks like that expects a block\n success = yield # keyword that calls the block\n test_name = @method.to_s.gsub(/_/, ' ') # replace underscores with spaces for printing\n test_name += \" #{description}\" unless description.empty?\n puts \"#{test_name}: #{success ? 'pass' : 'fail'}\"\n end",
"title": ""
},
{
"docid": "cd256c48632bfc36daebe787de8ed1f1",
"score": "0.5410746",
"text": "def warn_about_expectations; end",
"title": ""
},
{
"docid": "1a85b0fa0eae21db8bc4d2d52270d9d9",
"score": "0.5399239",
"text": "def failure_message_when_negated\n field_descriptions = attribute_descriptions(@scopes.keys)\n value_descriptions = value_descriptions(@scopes.values)\n\n expectation_description(\n 'Expected no emails to be sent',\n field_descriptions,\n value_descriptions\n )\n end",
"title": ""
},
{
"docid": "bf92e90603a5ee2dc0876a6d03f92775",
"score": "0.5389616",
"text": "def a_private_method\n\tend",
"title": ""
},
{
"docid": "53fdecef6ad69883a70bd7ef7687b028",
"score": "0.538542",
"text": "def failure_message_when_negated\n \"expected #{@actual.inspect} not to #{description}\"\n end",
"title": ""
},
{
"docid": "b563f9cf1fa3094b602c4ea90bae5428",
"score": "0.5350716",
"text": "def test_ignore_private_method\n # arrange\n content = '\n # This is the test for the private method extraction test\n class SingleMethod\n # The exercise\\s description\n def single_method\n puts \"single_method\"\n end\n\n private\n def other_method\n puts \"hi\"\n end\n end'\n\n expected = '\n # This is the test for the private method extraction test\n class SingleMethod\n # The exercise\\s description\n def single_method\n end\n\n end'\n # act\n # assert\n check_strip_methods content, expected\n end",
"title": ""
},
{
"docid": "e97dc3f2162bd54771992f2b2dfffc0b",
"score": "0.53505594",
"text": "def matches_reader_value? allow_private: false\n return false unless responds_to_reader?(:allow_private => allow_private)\n return true unless @value_set\n\n actual_value = @actual.send(@expected)\n\n @matches_reader_value = (@value.respond_to?(:matches?) && @value.respond_to?(:description)) ?\n @value.matches?(actual_value) :\n @value == actual_value\n end",
"title": ""
},
{
"docid": "fc5659217eaeb9c8563e7b51640426a6",
"score": "0.5348614",
"text": "def private?\n @directives['private']\n end",
"title": ""
},
{
"docid": "d81462aa63be4eccf14f51e5c8be1be7",
"score": "0.5345521",
"text": "def handlePrivately?(text)\n return false\n end",
"title": ""
},
{
"docid": "d851e3834b5cbf73a92991b33f6e5e51",
"score": "0.5334779",
"text": "def description(verify=\"\", pwhen=\"\", given=\"\")\n comment(\"test \" + self.class.name + ':' + caller[0].split(' ')[1].slice(1..-2))\n\n if (!verify.empty?)\n comment(' Verify ' + verify)\n end\n if (!pwhen.empty?)\n comment(' When ' + pwhen)\n end\n if (!given.empty?)\n comment(' Given ' + given)\n end\n end",
"title": ""
},
{
"docid": "384f0559244dc874aba71afdccdd3d55",
"score": "0.5322863",
"text": "def verify_badges_when_disallowing_private_recognitions\n if changes[:allows_private] == [true, false] && badges.with_forced_privacy.exists?\n errors.add(:allows_private, \"Cannot disable private recognitions while there are badges that force it.\")\n end\n end",
"title": ""
},
{
"docid": "1e3b02a08878dc8c56199f677516a12d",
"score": "0.53211594",
"text": "def inspect_private_methods(object_to_inspect)\n puts \"- Private methods :\"\n object_to_inspect.private_methods(false).each do |method|\n puts \"\\t- #{method}\"\n end\n puts \"#{Util::get_line_separator}\"\n end",
"title": ""
},
{
"docid": "7cc02e689e0abf9f306dfa0046c1fb19",
"score": "0.5300746",
"text": "def failure_message\n actual = prettify_args(@actual)\n matcher = prettify_matcher(@expected.metadata[:name])\n\n if @expected.metadata[:args].count > 0\n args = prettify_args(*@expected.metadata[:args])\n\n \"'#{actual}' should all #{matcher} '#{args}'\"\n else\n \"'#{actual}' should all #{matcher}\"\n end\n end",
"title": ""
},
{
"docid": "9eae976a497b12c15a662a44bf0cbd2e",
"score": "0.5281256",
"text": "def failure_message_when_negated\n\t\t\tmsg = \"expected response not to have a %s\" % [ self.describe_type_expectation ]\n\t\t\tmsg << \" and \" << self.describe_additional_expectations.join( ', ' ) unless\n\t\t\t\tself.additional_expectations.emtpy?\n\t\t\tmsg << \", but it did.\"\n\n\t\t\treturn \"\\n---\\n%s\\n---\\n\\nReason: %s\\n\" % [\n\t\t\t\tself.pretty_print_response,\n\t\t\t\tmsg\n\t\t\t]\n\t\tend",
"title": ""
},
{
"docid": "bacc9c22662acbbdfdc4760c79eed478",
"score": "0.52790594",
"text": "def description\n str = 'delegate method'\n str << \" :#{@expected}\" if @expected\n str << \" to #{@target.inspect}\" if @target\n str\n end",
"title": ""
},
{
"docid": "f6e57787b8ee52d28a8764254e5f9951",
"score": "0.526883",
"text": "def private?\n false\n end",
"title": ""
},
{
"docid": "3f8fcd1dee9d2d192e111097938c2d15",
"score": "0.5268289",
"text": "def disallowed_group_visibility_level_description(level, group)\n level_name = Gitlab::VisibilityLevel.level_name(level).downcase\n reasons = []\n instructions = []\n\n unless group.visibility_level_allowed_by_projects?(level)\n reasons << \"it contains projects with higher visibility\"\n end\n\n unless group.visibility_level_allowed_by_sub_groups?(level)\n reasons << \"it contains sub-groups with higher visibility\"\n end\n\n unless group.visibility_level_allowed_by_parent?(level)\n errors = visibility_level_errors_for_group(group.parent, level_name)\n\n reasons << errors[:reason]\n instructions << errors[:instruction]\n end\n\n reasons = reasons.any? ? ' because ' + reasons.to_sentence : ''\n \"This group cannot be #{level_name}#{reasons}.#{instructions.join}\".html_safe\n end",
"title": ""
},
{
"docid": "601cbe0ec44022985baa4388613d725e",
"score": "0.52625585",
"text": "def respond_to_missing?(method, allow_private)\n @output.respond_to?(method, allow_private)\n end",
"title": ""
},
{
"docid": "634669b3c44d2b134c3735cbf9a9548c",
"score": "0.526054",
"text": "def failure_message_when_negated\n message =\n \"expected #{@actual.inspect} not to delegate :#{@expected} to \"\\\n \"#{@target.inspect}\"\n\n message << format_arguments << format_return_values\n end",
"title": ""
},
{
"docid": "c01cc16f3d8a9b12e6b7b86bcea28195",
"score": "0.5259833",
"text": "def is_private?\n is_public == false\n end",
"title": ""
},
{
"docid": "9033a4004eb88fe2a1f0a7e5671e3d95",
"score": "0.52585906",
"text": "def private_method; end",
"title": ""
},
{
"docid": "534b0a6006944f4dc1354e7f37ee615e",
"score": "0.5254973",
"text": "def description_of(object)\n ::RSpec::Support::ObjectFormatter.format(object)\n end",
"title": ""
},
{
"docid": "5a78845698e8d903ed1ba287e823f490",
"score": "0.5253885",
"text": "def valid?\n [:public, :private, :loopback].include? describe\n end",
"title": ""
},
{
"docid": "dbb892326006dd638eb5f5ce05c7d251",
"score": "0.5248989",
"text": "def human_readable_description\n not_implemented(__method__)\n end",
"title": ""
},
{
"docid": "bb00ea7ff1b7f8cffbd803d4580b4b0f",
"score": "0.52433705",
"text": "def it_should_allow_admin_only(response = :success, spec_desc = \"\", &eval)\n it_should_require_login\n\n it_should_deny(:guest, spec_desc)\n\n it_should_deny(:director, spec_desc)\n\n it_should_deny(:staff, spec_desc)\n\n it_should_allow(:admin, spec_desc) do\n is_expected.to respond_with response\n instance_eval(&eval) if eval\n end\nend",
"title": ""
},
{
"docid": "2a3781cb9a808edac3e7d25d7c53057c",
"score": "0.52358377",
"text": "def describe; end",
"title": ""
},
{
"docid": "b39047d83f84b47d9683e1c76492afdb",
"score": "0.5234615",
"text": "def failure_message_when_negated\n \"expected #{@actual.inspect} not to be #{type_string}\"\n end",
"title": ""
},
{
"docid": "19448d920385c0e9d7f85478c1e3c88c",
"score": "0.52339584",
"text": "def expectation_fail_to_s\n \"be respond to #{@respond_to.inspect}, missing #{@failed_quacks.inspect}\"\n end",
"title": ""
},
{
"docid": "32de9d82fb582c809d13c0dc40057336",
"score": "0.52323276",
"text": "def failure_message_when_negated\n message = \"expected #{@actual.inspect} not to respond to :#{@expected}?\"\n message << \" and return #{value_to_string}\" if @value_set\n message\n end",
"title": ""
},
{
"docid": "fcbab919f3c4f1bc18ee939bbfb14e88",
"score": "0.5232214",
"text": "def failure_message_when_negated\n @description_block.call(super)\n end",
"title": ""
},
{
"docid": "84ca67ef105da19a527b3254de0bc268",
"score": "0.5207411",
"text": "def human_description(*)\n raise NotImplementedError, \"#{self.class} must override #{__method__}\"\n end",
"title": ""
},
{
"docid": "98144e841d9620e61e75ecc4ec0fc600",
"score": "0.5204523",
"text": "def descriptions\n definitions_for(:description) # .reject{|param, desc| param_definitions[param][:hide_help] }\n end",
"title": ""
},
{
"docid": "dbf052a33a6261b22f0e4375f565df1b",
"score": "0.5204195",
"text": "def private! if_metageneration_match: nil\n update_predefined_acl! \"private\", if_metageneration_match: if_metageneration_match\n end",
"title": ""
},
{
"docid": "2f1bb19aece6cc48d6c3818ad19b33c2",
"score": "0.5197866",
"text": "def is_private\n return @is_private\n end",
"title": ""
},
{
"docid": "79bac8d3f49d04241017ac6a083852c1",
"score": "0.5196865",
"text": "def description\n assert_value_existence\n\n \"be valid when #{format_message}\"\n end",
"title": ""
},
{
"docid": "b40e3338562274e4ba91c18debf86e12",
"score": "0.5194923",
"text": "def private_to_respondents\n accepts_respondents? ? \"1\" : \"0\"\n end",
"title": ""
},
{
"docid": "f6316c9355d322f9e2707db7dbc056f6",
"score": "0.5189584",
"text": "def description_matchers\n [ ['meta[@name=\"og:description\"]', lambda { |el| el.attr('content') }],\n ['meta[@name=\"description\"]', lambda { |el| el.attr('content') }],\n ['meta[@name=\"twitter:description\"]', lambda { |el| el.attr('content') }],\n ['meta[@name=\"sailthru.description\"]', lambda { |el| el.attr('content') }],\n ['meta[@name=\"dc:description\"]', lambda { |el| el.attr('content') }],\n ['meta[@name=\"parsely-description\"]', lambda { |el| el.attr('content') }],\n ['meta[@name=\"Description\"]', lambda { |el| el.attr('content') }],\n ['meta[@name=\"DESCRIPTION\"]', lambda { |el| el.attr('content') }],\n 'rdf:Description[@name=\"dc:description\"]' ]\n end",
"title": ""
},
{
"docid": "d18c0d752a68cd2fed48b5fff475b247",
"score": "0.5185332",
"text": "def failure_message_when_negated\n actual = prettify_args(@actual)\n\n \"'#{actual}' should not #{pretty_matcher} '#{@expected}'\"\n end",
"title": ""
},
{
"docid": "b10ddeadb9ecc341c43ccff53760284a",
"score": "0.5185107",
"text": "def should_not(matcher=nil, message=nil, &block)\n RSpec::Expectations::NegativeExpectationHandler.handle_matcher(self, matcher, message, &block)\n end",
"title": ""
},
{
"docid": "7c3b9ce42e454f3e5d3a6c6f1e9f9ed5",
"score": "0.51814204",
"text": "def private! if_metageneration_match: nil\n update_predefined_default_acl! \"private\", if_metageneration_match: if_metageneration_match\n end",
"title": ""
},
{
"docid": "b793ea728adb3a20dadeef6a54e2eda0",
"score": "0.51808",
"text": "def method_missing(sym, *args, &block) # :nodoc:\n return Spec::Matchers::Be.new(sym, *args) if sym.to_s.starts_with?(\"be_\")\n return has(sym, *args) if sym.to_s.starts_with?(\"have_\")\n super\n end",
"title": ""
},
{
"docid": "edb3b9e1aae508306bbd4b36507bf270",
"score": "0.5165834",
"text": "def description(opts= {})\n ret = \"Attribute '#{@attr_display_name}' has illegal value '#{@value}'\"\n ret << \"; legal values are: #{@legal_values.join(', ')}\" if @legal_values and !opts[:summary]\n ret\n end",
"title": ""
},
{
"docid": "5a8c56e4c948fd5022f0f4dbeb2076f1",
"score": "0.5159873",
"text": "def desc(description)\n # no-op\n end",
"title": ""
},
{
"docid": "722900ff45fd8e3bb5cb1e58ca5e6b53",
"score": "0.51466733",
"text": "def add_matcher(matcher_name)\n positive_name = CapybaraMiniTestSpec::PositiveTestName.new(matcher_name)\n negative_name = CapybaraMiniTestSpec::NegativeTestName.new(matcher_name)\n [positive_name, negative_name].each do |test_name|\n CapybaraMiniTestSpec.define_expectation(test_name)\n end\n end",
"title": ""
},
{
"docid": "49c5f417de542939542485c9de6e0d07",
"score": "0.51437926",
"text": "def private?\n privacy == \"private\"\n end",
"title": ""
}
] |
a88e249efdfd9af19d305dabd3e15a03
|
GET /pois/guest/1 GET /pois/guest/1.json
|
[
{
"docid": "75295532e708029a5ec5cfbd0b0440b4",
"score": "0.0",
"text": "def guest\n #get sum of all importances\n @guest = Guest.where(:id => params[:id]).first!\n\n @sum = Importance.where(:guest_id => params[:id]).sum('importance')\n\n #query all interests that have an importance for the guest\n @interests = Interest.includes(:importances).where(:importances => {:guest_id => params[:id]})\n\n #query the matching pois for each interest\n #categories\n @user_pois = []\n @interests.each_with_index do |interest, index|\n @user_pois[index] = []\n #@user_pois[index].push(Categorization.where(:interest_id => interest.id).includes(:poi))\n @user_pois[index].push(Categorization.all(:joins => :poi, :conditions => {:categorizations => {:interest_id => interest.id}}))\n #user_pois[index].push( ((Importance.where(:guest_id => params[:id]).where(:interest_id => interest.id).sum('importance').to_f / @sum) * 8).round )\n @user_pois[index].push( ((Importance.where(:guest_id => params[:id]).where(:interest_id => interest.id).sum('importance').to_f / @sum) * 8).round )\n @user_pois[index].push(interest.name)\n end\n\n #@int = Interest.includes(:importances).where(:importances => {:guest_id => params[:id]}).joins(:Categorization.where(:interest_id => interest.id))\n\n #rearrange the pois\n map_pois = []\n @user_pois.each_with_index do |cat, index|\n cat[1].times do |i|\n if cat[0].count > i\n map_pois.push(Poi.includes(:categorizations).where(:categorizations =>{:poi_id => cat[0][i-1].poi_id}))\n end\n end\n end\n\n #@map_pois = map_pois.flatten(1).to_a.uniq.to_json\n @map_pois = map_pois.flatten(1).to_a.uniq\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @map_pois }\n end\n\n\n @pois = []\n @user_pois.each_with_index do |cat, index|\n @pois[index] = [];\n @pois[index][0] = cat[2] #interest name\n @pois[index][1] = []\n cat[0].count.times do |i|\n if (i < cat[1])\n @pois[index][1].push(cat[0][i].poi.address)\n end\n end\n end\n\n\n #-----------------------------------------------------------------------\n # #query all interests that have an importance for the guest\n # @interests = Interest.includes(:importances).where(:importances => {:guest_id => params[:id]})\n\n # #query the matching pois for each interest\n # user_pois = []\n # @interests.each_with_index do |interest, index|\n # user_pois[index] = Categorization.where(:interest_id => interest.id)\n # end\n\n # #rearrange the pois\n # map_pois = []\n # user_pois.each_with_index do |cat, index|\n # cat.each_with_index do |poi, i|\n # map_pois.push(Poi.includes(:categorizations).where(:categorizations =>{:poi_id => poi.poi_id}))\n # end\n # end\n\n # @map_pois = map_pois.flatten(1).to_a.uniq.to_json\n\n # respond_to do |format|\n # format.html #index.html.erb\n # format.json { render json: @map_pois }\n # end\n end",
"title": ""
}
] |
[
{
"docid": "a62a6bf40caeda4e8af2cce0bcd95a3b",
"score": "0.7248676",
"text": "def get_a_guest(args = {}) \n get(\"/guestaccess.json/#{args[:guestId]}\", args)\nend",
"title": ""
},
{
"docid": "a62a6bf40caeda4e8af2cce0bcd95a3b",
"score": "0.7248676",
"text": "def get_a_guest(args = {}) \n get(\"/guestaccess.json/#{args[:guestId]}\", args)\nend",
"title": ""
},
{
"docid": "d47360fab09ad628e04eaa27b99de330",
"score": "0.69915164",
"text": "def show\n @guest = Guest.find(params[:id])\n @guests = Guest.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "91ca38c065ec2d53fabea15217ccec48",
"score": "0.69360304",
"text": "def show\n @guest = Guest.find(params[:id])\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "d388e94db7852e6a9023e5daad27f6c5",
"score": "0.693421",
"text": "def show\n @guest = Guest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "d388e94db7852e6a9023e5daad27f6c5",
"score": "0.693421",
"text": "def show\n @guest = Guest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "d388e94db7852e6a9023e5daad27f6c5",
"score": "0.693421",
"text": "def show\n @guest = Guest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "d388e94db7852e6a9023e5daad27f6c5",
"score": "0.693421",
"text": "def show\n @guest = Guest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "d388e94db7852e6a9023e5daad27f6c5",
"score": "0.693421",
"text": "def show\n @guest = Guest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "c22dcadab669f5064728419caa8484ea",
"score": "0.6827204",
"text": "def search_for_a_guest(args = {}) \n get(\"/guestaccess.json/search\", args)\nend",
"title": ""
},
{
"docid": "6f3ea23e7f82c51703274da167f1bbd2",
"score": "0.6812483",
"text": "def list_all_guests(args = {}) \n get(\"/guestaccess.json/all\", args)\nend",
"title": ""
},
{
"docid": "6f3ea23e7f82c51703274da167f1bbd2",
"score": "0.6812483",
"text": "def list_all_guests(args = {}) \n get(\"/guestaccess.json/all\", args)\nend",
"title": ""
},
{
"docid": "311e443d487d2debc5a34e4e072aed52",
"score": "0.6808586",
"text": "def show\n @guest = Guest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n #format.json { render :json => @guest }\n end\n end",
"title": ""
},
{
"docid": "657c405c958205969678101e6030e3d1",
"score": "0.6800374",
"text": "def show\n @admin_guest = Admin::Guest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_guest }\n end\n end",
"title": ""
},
{
"docid": "77ca875d0c5f1199013be8fd494acdd7",
"score": "0.67935747",
"text": "def list_guests_for_guest_access_portal(args = {}) \n get(\"/guestaccess.json/#{args[:portalId]}/guest\", args)\nend",
"title": ""
},
{
"docid": "8dd05f77038dce7e1ebfb704ae8b48ae",
"score": "0.67749894",
"text": "def fetch_guest\n id = params[:guest_id]\n\n @guest = Guest.where(guestId: id).first\n head :not_found unless @guest\n end",
"title": ""
},
{
"docid": "909380765bb005930246187f29a1f131",
"score": "0.67637163",
"text": "def get_guest\n @guest = Guest.find(params[:id])\n end",
"title": ""
},
{
"docid": "f7a5402e5d550c52a00d86441db081b1",
"score": "0.66463137",
"text": "def new\n @guest = Guest.new\n @guests = Guest.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "a530c32130711e9051e93bdd69ea77ea",
"score": "0.6644446",
"text": "def list_guest_access_portals(args = {}) \n get(\"/guestaccess.json/gap/\", args)\nend",
"title": ""
},
{
"docid": "a530c32130711e9051e93bdd69ea77ea",
"score": "0.6644446",
"text": "def list_guest_access_portals(args = {}) \n get(\"/guestaccess.json/gap/\", args)\nend",
"title": ""
},
{
"docid": "c12d0fb0911f67408826efcf84c3b8f6",
"score": "0.6586547",
"text": "def index\n @guests = (Invitation.for_user_and_event(User.find_by(auth_token:request.headers['AuthorizationToken'].to_s).id, Event.find_by(id:request.headers['EventId'].to_s).id)).map(&:guest)\n \n render json: @guests\n end",
"title": ""
},
{
"docid": "c9c08eb9c1b5ceb61e42bcea1780160f",
"score": "0.6532119",
"text": "def new\n @guest = Guest.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "6c24403dc3e09d5666281be63b1dd5c5",
"score": "0.6532053",
"text": "def show\n respond_to do |format|\n \tformat.html # show.html.erb\n \tformat.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "34e1e0996c000c652d92c5880cf13a75",
"score": "0.6527219",
"text": "def index\n @guest = Guest.new\n @guests = Guest.all\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @guests }\n end\n end",
"title": ""
},
{
"docid": "0f81c7572b0879b68ce282f7ded1db26",
"score": "0.64731103",
"text": "def new\n @guest = Guest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "0f81c7572b0879b68ce282f7ded1db26",
"score": "0.64731103",
"text": "def new\n @guest = Guest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "bce88aec39a029e37a1153ee8f9fcdde",
"score": "0.64613557",
"text": "def new\n @guest = Guest.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "dd746753f10d66661fa02cc8c857e265",
"score": "0.6447097",
"text": "def index\n @guests = Guest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guests }\n end\n end",
"title": ""
},
{
"docid": "f82fb8a411fe6eb9e4781c64fac6a638",
"score": "0.64298284",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "1e209ce8c02e56f695215464552a63a4",
"score": "0.64205396",
"text": "def guests\n status = 200\n result = {}\n id = params[:id].to_i\n podcast = Podcast.find_by(id: id)\n\n if podcast.present?\n result[:success] = true\n result[:guests] = podcast.guests.map { |id| Comedian.find_by(id: id).display_helper }\n result[:podcast] = podcast.display_helper\n else\n result[:success] = false\n status = 400\n result[:errors] = { podcast: 'does not exist' }\n end\n render status: status, json: result\n end",
"title": ""
},
{
"docid": "bf3cfa5acf825d804edb4b5ecc418a4d",
"score": "0.63683015",
"text": "def new\n @guest = Guest.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render :json => @guest }\n end\n end",
"title": ""
},
{
"docid": "1f18377520caa2211f0650bfdfca4c4c",
"score": "0.63680774",
"text": "def show\n @person = Person.find(params[:id])\n @guest = @person\n end",
"title": ""
},
{
"docid": "51e65bd70333d70213f65157d1d54416",
"score": "0.6305807",
"text": "def guest\n {\n id: object.guest.id,\n name: object.guest.name,\n avatar: object.guest.avatar,\n email: object.guest.email,\n }\n end",
"title": ""
},
{
"docid": "c7eb528c19b63bad8e246ca1211894b2",
"score": "0.6292178",
"text": "def show\n @guest = Guest.find(params[:id])\n\t@invitations = @guest.invitations\n end",
"title": ""
},
{
"docid": "b4564057039b3847cf26815746cbefb6",
"score": "0.6235903",
"text": "def index \n render json: Stay.where(guest_id: current_guest.id)\n end",
"title": ""
},
{
"docid": "d66a9f062f3a9eccc21ff5b33a314565",
"score": "0.6235625",
"text": "def new\n @admin_guest = Admin::Guest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_guest }\n end\n end",
"title": ""
},
{
"docid": "9c865b22b943b6f1d5732a39349feef2",
"score": "0.617154",
"text": "def guest\r\n keys = Key.is_guest\r\n render json: keys\r\n end",
"title": ""
},
{
"docid": "40db1af3f6d2fc66c4a3063efacd73a6",
"score": "0.6163223",
"text": "def get_guest_access_portal(args = {}) \n get(\"/guestaccess.json/gap/#{args[:portalId]}\", args)\nend",
"title": ""
},
{
"docid": "40db1af3f6d2fc66c4a3063efacd73a6",
"score": "0.6163223",
"text": "def get_guest_access_portal(args = {}) \n get(\"/guestaccess.json/gap/#{args[:portalId]}\", args)\nend",
"title": ""
},
{
"docid": "138363be45b6d160d9fe84510cd8a996",
"score": "0.6141299",
"text": "def guests\n @invitations = Invitation.select('id', 'email', 'status', 'is_notified').where({schedule_id: params[:id]}).order('created_at DESC').all\n render json: @invitations, status: :ok\n end",
"title": ""
},
{
"docid": "8530432ed6b0582b92b4fa06b6c3ed8e",
"score": "0.61173785",
"text": "def show\n @guest = Guest.find(params[:id]) || not_found\n @event = @guest.event\n @dashboard = params[:dashboard] \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "0debc5a7c68cebc032ef67818881e0b6",
"score": "0.6106943",
"text": "def show\n @poet = Poet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @poet }\n end\n end",
"title": ""
},
{
"docid": "ea26ee6cce4cdf63c93dacc63c7e46a5",
"score": "0.6064109",
"text": "def guest(id)\n response = Impala.connection.get(\"hotel/#{@id}/guests/#{id}\")\n Guest.new(response.body[:data])\n rescue ::Faraday::ResourceNotFound\n raise GuestNotFound, \"Guest with id #{id} not found\"\n end",
"title": ""
},
{
"docid": "847865f9f61e916dc6a95f3ccf2074d1",
"score": "0.6051619",
"text": "def show\n respond_with Guest.find(params[:id])\n end",
"title": ""
},
{
"docid": "2a30c03bbe4c7a5cc2b8422fcfacb94c",
"score": "0.60077846",
"text": "def show\n if current_user\n @poet = Poet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @poet }\n end\n else\n not_authenticated\n end\n end",
"title": ""
},
{
"docid": "a2b25f9bb4c736de8aac436ccab710ec",
"score": "0.60035616",
"text": "def show\n @party = Party.find(params[:id])\n respond_with(@party) do |format|\n format.to_json { @party.to_json(:include => :guests) }\n format.html\n end\n end",
"title": ""
},
{
"docid": "fe30ecc9620ae1b325a289cab52370ed",
"score": "0.5995052",
"text": "def show\n @guest_list = GuestList.includes( { invitations: :guest },\n :owner).find(params[:id])\n @guest_list.invitations.sort_by! do |i|\n i.guest.try(:full_name)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { respond_with_bip @guest_list }\n end\n end",
"title": ""
},
{
"docid": "00495d4f1e6abd596d978a42d8a69a54",
"score": "0.5991514",
"text": "def show\n @puesto = Puesto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puesto }\n end\n end",
"title": ""
},
{
"docid": "17a48a135aed0823505803e0b75a6804",
"score": "0.59625393",
"text": "def new\n @guest_list = GuestList.new\n\n if params[:guest_id] && (@guest = Guest.find_by_id params[:guest_id])\n @saved_selections = @guest.id_name_tuple\n else\n @saved_selections = []\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { respond_with_bip @guest_list }\n end\n end",
"title": ""
},
{
"docid": "1f038a7896f4f98b66da36f102b915cd",
"score": "0.59541166",
"text": "def show\n @guest = Guest.find(params[:id])\n @event = Event.find(@guest.event_id) \n respond_to do |format|\n format.html # show.html.erb\n format.json {}\n end\n end",
"title": ""
},
{
"docid": "c46802dfccf0c37281fdc634f8cf85c1",
"score": "0.59467727",
"text": "def show\n @guest_group = GuestGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guest_group }\n end\n end",
"title": ""
},
{
"docid": "990b7ce288fbec03c9bc41c03184843f",
"score": "0.5939611",
"text": "def show\n @guestbook_entry = GuestbookEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @guestbook_entry }\n end\n end",
"title": ""
},
{
"docid": "ebef1485f7dcaf167550f626e00cb742",
"score": "0.59220654",
"text": "def show\n @guests = @entry.guests\n end",
"title": ""
},
{
"docid": "e0c2c054babba501b82ee21110d8e649",
"score": "0.59128976",
"text": "def show\n @genotipagem = Genotipagem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genotipagem }\n end\n end",
"title": ""
},
{
"docid": "f2a15b6b49372c4351884ddf700a6809",
"score": "0.590694",
"text": "def show\n @poem = Poem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @poem }\n end\n end",
"title": ""
},
{
"docid": "f2a15b6b49372c4351884ddf700a6809",
"score": "0.590694",
"text": "def show\n @poem = Poem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @poem }\n end\n end",
"title": ""
},
{
"docid": "14d0d773566d74c0064bb04a11705305",
"score": "0.59035325",
"text": "def index\n\t\t@guests = Guest.all #page(params[:page]).per(10)\n\t\t@guests = @guests.by_name(params[:name]) if params[:name].present?\n\t\t@guests = @guests.where(user_id: params[:user_id]) if params[:user_id].present?\n\t\t@guests = @guests.page(params[:page]).per(10)\n\t\t#@guests\n end",
"title": ""
},
{
"docid": "67d4f6c62e7db88dcb9ae01bb139108b",
"score": "0.58957964",
"text": "def guest\n temp_email = \"guest_#{Time.now.to_i}#{rand(99)}@example.com\"\n user = User.new(:email => temp_email, :password => \"12345678\")\n\n user.is_guest = true\n\n if user.valid?\n user.save\n sign_in(:user, user)\n user.ensure_authentication_token!\n\n render :json => { :guest => true, :email => user.email, :id => user.id, :auth_token => user.authentication_token }\n else\n render :json => { :errors => user.errors }, :status => 420\n end\n\n end",
"title": ""
},
{
"docid": "5c04a6ea2d0f9df590d7f9fa2081762f",
"score": "0.5892974",
"text": "def index\n @guests = current_host.guests.all\n end",
"title": ""
},
{
"docid": "3fadddd9fa9a5f796905b35017f118d8",
"score": "0.5882516",
"text": "def index\n @guests = Guest.all\n end",
"title": ""
},
{
"docid": "3fadddd9fa9a5f796905b35017f118d8",
"score": "0.5882516",
"text": "def index\n @guests = Guest.all\n end",
"title": ""
},
{
"docid": "3fadddd9fa9a5f796905b35017f118d8",
"score": "0.5882516",
"text": "def index\n @guests = Guest.all\n end",
"title": ""
},
{
"docid": "3fadddd9fa9a5f796905b35017f118d8",
"score": "0.5882516",
"text": "def index\n @guests = Guest.all\n end",
"title": ""
},
{
"docid": "3fadddd9fa9a5f796905b35017f118d8",
"score": "0.5882516",
"text": "def index\n @guests = Guest.all\n end",
"title": ""
},
{
"docid": "3fadddd9fa9a5f796905b35017f118d8",
"score": "0.5882516",
"text": "def index\n @guests = Guest.all\n end",
"title": ""
},
{
"docid": "3fadddd9fa9a5f796905b35017f118d8",
"score": "0.5882516",
"text": "def index\n @guests = Guest.all\n end",
"title": ""
},
{
"docid": "35b80e1f2172b60e920a7904816cff29",
"score": "0.58817774",
"text": "def show\n @pago = Pago.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pago }\n end\n end",
"title": ""
},
{
"docid": "35b80e1f2172b60e920a7904816cff29",
"score": "0.58817774",
"text": "def show\n @pago = Pago.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pago }\n end\n end",
"title": ""
},
{
"docid": "30c684b586375fb0311235946c7b2bb0",
"score": "0.5879869",
"text": "def show\n @guest = Guest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @guest }\n end\n end",
"title": ""
},
{
"docid": "56b34baa3b79183c5db86c6d00b3f85c",
"score": "0.58761305",
"text": "def show\n @poem = Poem.find(params[:id])\n # render json: @poems\n end",
"title": ""
},
{
"docid": "d3c155592ed3fdbb2b1b2590fc6d491f",
"score": "0.5871188",
"text": "def show\n query = \"SELECT * FROM Guest WHERE guestId = #{params[:id]}\"\n @guest = Guest.find_by_sql(query).first\n end",
"title": ""
},
{
"docid": "844235431126111376873153b24a3dae",
"score": "0.5861944",
"text": "def index\n @guest_infos = GuestInfo.all\n end",
"title": ""
},
{
"docid": "af59adc34f191f0a7e37ab5ceb05b04a",
"score": "0.5857844",
"text": "def create\n @guest = Guest.new(params[:guest])\n\n if @guest.save\n render json: {:guest => @guest}, status: :ok\n else\n render json: @guest.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f9438df194da6c98949bbf3f7c637c99",
"score": "0.584118",
"text": "def show\n @poem = Poem.find(params[:id])\n @request = @poem.request\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @poem }\n end\n end",
"title": ""
},
{
"docid": "cfeaecf1da272b77e4bd0f649e78569d",
"score": "0.5819137",
"text": "def show\n @gossip = Gossip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gossip }\n end\n end",
"title": ""
},
{
"docid": "1a7739f20aaba1960c3f696fdfc4dac4",
"score": "0.58151776",
"text": "def show\n @person = Person.find(params[:id])\n @invitation = Invitation.new\n\n @doggie_report_cards = false\n @heroimage = nil\n #@heroimage = Petphoto.find(6)\n #if current_user.person.petphoto\n # @heroimage = current_user.person.petphoto.first\n #end\n @invitations = Invitation.where(:requestor_email => current_user.email, :status => 'invited')\n\n respond_to do |format|\n format.html { render action: \"show\", :layout => \"with_sidebar\" }\n format.json { render json: @person }\n end\n end",
"title": ""
},
{
"docid": "12a17ef661fdceb36a43a2a26dccd35f",
"score": "0.5811691",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { respond_with_bip @guest_lists }\n end\n end",
"title": ""
},
{
"docid": "f0b0763470a095d91f90c998e5b774da",
"score": "0.58086795",
"text": "def index\n @guests = Guests.all\n end",
"title": ""
},
{
"docid": "9a4dc6c41cdd4a5c107a919598856c27",
"score": "0.57970077",
"text": "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @puntaje }\n end\n end",
"title": ""
},
{
"docid": "7c596790480f44655ab41b9aba05c489",
"score": "0.5791165",
"text": "def show\n\t\t@pago = Pago.find_by :id_pago => params[:id]\n\t\tif @pago\n\t\t\trender :json => @pago\n\t\telse\n\t\t\trender :json => {}, status: :not_found\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1ba38ca0be3e68a0a708381ccee3adad",
"score": "0.5784116",
"text": "def new\n @guest = User.find(params[:id])\n end",
"title": ""
},
{
"docid": "10632b79ecd3f72757ba620b955a5390",
"score": "0.57697725",
"text": "def show\n @pesaje = Pesaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pesaje }\n end\n end",
"title": ""
},
{
"docid": "ed7664a8cb7bdd859a6f78cd70d0c1ac",
"score": "0.5768021",
"text": "def get_guest(guest_name)\n guest = @guests[guest_name]\n end",
"title": ""
},
{
"docid": "c7f6d027791452377f3af6c94c6f8716",
"score": "0.57590175",
"text": "def show\n @viper = Viper.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @viper }\n end\n end",
"title": ""
},
{
"docid": "c168a6ebaeeab1e4e1ffc1a97b2976ef",
"score": "0.57536536",
"text": "def show\n @gripe = Gripe.find(params[:id])\n\n @title = \"Gripebox.com | \" + @gripe.title.to_s\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gripe }\n end\n end",
"title": ""
},
{
"docid": "5a13d10749d1b444f8de59828a395223",
"score": "0.5752288",
"text": "def new\n @guest = Guest.new\n if params[:event_id].present?\n @event = Event.find(params[:event_id])\n else\n @event = Event.find(:first)\n end \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @guest }\n end\n end",
"title": ""
},
{
"docid": "f88e2ad0f4e93fff01a21aef95db9b55",
"score": "0.57237726",
"text": "def show\n @giver = Giver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @giver }\n end\n end",
"title": ""
},
{
"docid": "043035185dfd16e0d5735671c3f1b189",
"score": "0.5720502",
"text": "def index\n #se creo en consola p=Prayer.find(#prayer)\n #poner p.user\n @prayers = current_user.prayers('id').reverse_order.page params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @prayers }\n end\n \n end",
"title": ""
},
{
"docid": "0b5a079d79e92001be1dbb0477b6d662",
"score": "0.57184196",
"text": "def show\n @page = Page.find(params[:id])\n @pageboxes = @page.pageboxes\n @peebs = {}\n\n @pageboxes.each do |pb|\n url = URI.parse(pb.content)\n req = Net::HTTP::Get.new(url.path)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true if pb.content.match(/^https:/)\n @peebs[pb.content] = http.request(req).body.force_encoding('UTF-8')\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @page }\n end\n end",
"title": ""
},
{
"docid": "3351e854e528852cfb6a12d5f1d5508d",
"score": "0.5714107",
"text": "def index\n @gripes = Gripe.order(\"created_at DESC\").paginate(:page => 1, :per_page => 15)\n\n @title = \"Gripebox.com | Gripes\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gripes }\n end\n end",
"title": ""
},
{
"docid": "51ea57fcafe28ace1ac99853d21ecc72",
"score": "0.57093406",
"text": "def show\n render json: @pessoa\n end",
"title": ""
},
{
"docid": "18a58d395817763286846269b5dd538d",
"score": "0.57089823",
"text": "def index\n @trip = Trip.find_by(user_id: current_user.id)\n\n #@guest = Guest.where(trip_id: @trip.id)\n end",
"title": ""
},
{
"docid": "d6014ae60a796e1eb3f298b7fee3bb92",
"score": "0.5703341",
"text": "def index\n puts(\"> ********\")\n puts current_user.id\n\n @pegs = Peg.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pegs }\n end\n end",
"title": ""
},
{
"docid": "fee26d1f575073facd95e48e0c038ca1",
"score": "0.56948",
"text": "def get(path)\n # FAKING RESPONSE\n [{ id: 1, name: 'Jane' }, { id: 2, name: 'John' }].to_json\n end",
"title": ""
},
{
"docid": "0900191b837f48f0bae6c4daa71a9d0b",
"score": "0.5684662",
"text": "def index\n @ingredients = current_user.ingredients.page(params[:page])\n respond_to do |format|\n format.html\n format.json {render json: @ingredients}\n end\n end",
"title": ""
},
{
"docid": "d0e613e1e4842f18ef8d46bed9a24502",
"score": "0.5682514",
"text": "def set_guest\n @guest = Guest.find(params[:id])\n end",
"title": ""
},
{
"docid": "9904417e463fc05ab123fc150857fefb",
"score": "0.56778",
"text": "def index\n @guests = @guests.search(name_cont: params[:search]).result.paginate(per_page: 15, page: params[:page])\n respond_with(@guests)\n end",
"title": ""
},
{
"docid": "d1d9159e573f6b50757d0ddeb158621e",
"score": "0.5674381",
"text": "def index\n @parties = Party.all.order(:name)\n respond_with(@parties) do |format|\n format.to_json { @parties.to_json(:include => :guests) }\n format.html\n end\n end",
"title": ""
},
{
"docid": "00ea26bcc3c8ff87c22e2342a1f17c1f",
"score": "0.5665602",
"text": "def show\n respond_to do |format|\n format.json { render json: @pokemon }\n end\n end",
"title": ""
},
{
"docid": "f4d347694ee5e0d09074a55947aa16c6",
"score": "0.5655889",
"text": "def create\n @guest = Guest.new(guest_params)\n\n respond_to do |format|\n if @guest.save\n format.html { redirect_to @guest, notice: \"#{@guest.first} was successfully created.\" }\n format.json { render :show, status: :created, location: @guest }\n else\n format.html { render :new }\n format.json { render json: @guest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ed6c25fb5faa66458de96f0f2461fd5",
"score": "0.5645821",
"text": "def create\n @guest.user_id = current_user.id\n @guest.save\n respond_with(@guest, location: bnb_guests_url(@bnb))\n end",
"title": ""
}
] |
4dea0a4ec7882392ef0b08d272d4e1ec
|
This method executes on Apply Tariffs
|
[
{
"docid": "fe6baf262f02361f05c00ccdb237fb57",
"score": "0.0",
"text": "def index\n @billers = billers_dropdown\n\n if params[:bills]\n @bills = PreBill.where(pre_group_no: params[:bills]).paginate(:page => params[:page] || 1, :per_page => per_page || 10)\n else\n if session[:office] != '0'\n @bills = PreBill.joins(:project).where(projects: {office_id: session[:office].to_i}).paginate(:page => params[:page] || 1, :per_page => per_page || 10)\n # @bills = Office.find(session[:office]).subscribers.map(&:pre_bills).flatten.paginate(:page => params[:page] || 1, :per_page => per_page || 10)\n else\n @bills = PreBill.all.paginate(:page => params[:page] || 1, :per_page => per_page || 10)\n end\n end\n if @bills.empty?\n redirect_to pre_index_bills_path, alert: I18n.t(\"ag2_gest.bills.index.no_pre_group\")\n else\n @bills2 = PreBill.where(pre_group_no: params[:bills])\n @totals = @bills2.select('count(pre_bills.id) as bills, sum(r2.reading_index-r1.reading_index) as consumptions, sum(pre_invoices.totals) as totals') \\\n .joins('INNER JOIN readings r2 ON pre_bills.reading_2_id=r2.id INNER JOIN readings r1 on pre_bills.reading_1_id=r1.id INNER JOIN pre_invoices ON pre_bills.id=pre_invoices.pre_bill_id') \\\n .first\n @invoices_by_biller = PreBill.select('companies.name as company,min(invoices.invoice_no) as from_no,max(invoices.invoice_no) as to_no,sum(invoices.totals) as invoiced_total') \\\n .joins('INNER JOIN (bills INNER JOIN (invoices LEFT JOIN companies ON invoices.biller_id=companies.id) ON bills.id=invoices.bill_id) ON pre_bills.bill_id=bills.id') \\\n .where('pre_bills.pre_group_no = ? AND pre_bills.bill_id IS NOT NULL', params[:bills]) \\\n .group('invoices.biller_id')\n @bill_last_date = formatted_date(Bill.last_billed_date(@bills.first.project.company_id, @bills.first.project.office_id)) rescue \"N/A\"\n # @billing_starting_date = formatted_date(@bills.first.pre_invoices.first.try(:billing_period).try(:billing_starting_date)) rescue \"\"\n # @billing_ending_date = formatted_date(@bills.first.pre_invoices.first.try(:billing_period).try(:billing_ending_date)) rescue \"\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bills }\n format.js\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "a18186567d58d46fbcb43c48faf2ab4b",
"score": "0.58946514",
"text": "def apply\n\t\t\n\tend",
"title": ""
},
{
"docid": "a18186567d58d46fbcb43c48faf2ab4b",
"score": "0.58946514",
"text": "def apply\n\t\t\n\tend",
"title": ""
},
{
"docid": "d9857d32314645121121c185f505eb77",
"score": "0.57611114",
"text": "def post_process\n end",
"title": ""
},
{
"docid": "ed0c2f0f593129ae9de6088f792c01ee",
"score": "0.57427776",
"text": "def perform\n @extracted_files = Array.new\n @files_to_extract.each do |f|\n @extracted_files.push File.basename(@filename, '.tbz') + '/' + f\n end\n\n extract = extract_command(@basename, @extracted_files.join(' '))\n\n result = system \"cd #{@dirname} && #{extract}\"\n\n if result\n _extracted_files = @extracted_files.map{|f| File.join(@dirname, f)}\n @file_entry = FileEntry.new(@filename, Hash[@files_to_extract.zip(_extracted_files)])\n FileUtils.remove_file(@filename, true) unless keep_tbz_after_extract?\n else\n raise \"Unable to extract files '#{@files_to_extract.join(' ')}' from #{@filename}\"\n end\n\n @file_entry\n end",
"title": ""
},
{
"docid": "61710f1359e9f4eb646612f0ec04f379",
"score": "0.5735817",
"text": "def post_process; end",
"title": ""
},
{
"docid": "9c2d66dcf77926e0c1cfb4d3e7f7bec6",
"score": "0.57069415",
"text": "def apply\n end",
"title": ""
},
{
"docid": "86b5d53fb2eaf084778037da4ab3f5ec",
"score": "0.5658291",
"text": "def apply\n\t\t\t\t\n\t\t\tend",
"title": ""
},
{
"docid": "b54564bf1f9a57917e9e36ba50abe060",
"score": "0.5649166",
"text": "def run_and_transform; end",
"title": ""
},
{
"docid": "0a3d43c980c9ffb97fc63e3f0a437898",
"score": "0.5623413",
"text": "def run()\n\n # Figure out which tags actually to reset.\n if @tags.nil? or @tags == 'all'\n @tags = @@default_tags\n elsif @tags.is_a?(String)\n @tags = @tags.split(',')\n end\n\n # Create the command to delete all the metatags\n command = 'exiftool'\n parameter = ' -overwrite_original'\n @tags.each do |current_tag|\n parameter << \" -#{current_tag}=\"\n end\n parameter << ' ' \n\n `#{command} #{parameter} #{@filename}`\n self.log('info', \"Cleaning tags '#{@tags.join(', ').to_s}' from file '#{@filename}'.\")\n end",
"title": ""
},
{
"docid": "2672e74df18c9518aec1a93f32ba370e",
"score": "0.5589402",
"text": "def stage\n\n @tempdir = Dir.mktmpdir\n\n begin\n\n # Copy the assets into the temp dir.\n files = Dir.glob(\"#{File.dirname(@file_path)}/#{@file_base}.*\")\n FileUtils.cp(files, @tempdir)\n\n # Change into the temp dir.\n FileUtils.cd(@tempdir) do yield end\n\n ensure\n\n # Delete the copies.\n FileUtils.remove_entry @tempdir\n\n end\n\n end",
"title": ""
},
{
"docid": "0854bd817351b9ea0f397e664af6fec5",
"score": "0.5527762",
"text": "def do( args )\n\t\tqueue_files_for_processing( args )\n\t\tretrack\n\tend",
"title": ""
},
{
"docid": "576feb3e96d246b962efd1366a190db5",
"score": "0.55125004",
"text": "def manage_extract_file(action)\n @extract_res.user 'root'\n @extract_res.path %w(/bin /sbin /usr/bin /usr/sbin)\n @extract_res.command tar_command\n @extract_res.creates instance_binary\n @extract_res.returns 0\n @extract_res.timeout 180\n @extract_res.run_action(action)\nend",
"title": ""
},
{
"docid": "2b3e610a188ec49ed4a4be944a78f1d4",
"score": "0.5503753",
"text": "def run\n @attached.each { |item| process(item) }\n\n (@mode == :replace ? [ @add_file ] : [ @add_file, @remove_file ]).each do |file|\n file.puts(FOOTER)\n file.flush\n file.rewind\n end\n\n if @mode == :replace\n @database.resource.put(@add_file)\n elsif @mode == :update\n @database.resource[:update_method => :subtract].post(@remove_file)\n @database.resource[:update_method => :add].post(@add_file)\n end\n\n unless ENV['DIRECTEDEDGE_DEBUG']\n @add_file.unlink if @add_file\n @remove_file.unlink if @remove_file\n end\n end",
"title": ""
},
{
"docid": "fd27f80ccc6cb18813d240523a776920",
"score": "0.54774797",
"text": "def perform!\n super\n\n pipeline = Pipeline.new\n dump_ext = 'ldif'\n\n pipeline << slapcat\n\n model.compressor.compress_with do |command, ext|\n pipeline << command\n dump_ext << ext\n end if model.compressor\n\n pipeline << \"#{ utility(:cat) } > \" +\n \"'#{ File.join(dump_path, dump_filename) }.#{ dump_ext }'\"\n\n pipeline.run\n if pipeline.success?\n log!(:finished)\n else\n raise Error, \"Dump Failed!\\n\" + pipeline.error_messages\n end\n end",
"title": ""
},
{
"docid": "7953809c26f2ad7063ccd10006d13bba",
"score": "0.546989",
"text": "def run!\n report_startup\n setup_stage\n stage_operations\n managed_copy\n remove_stage\n report_complete\n end",
"title": ""
},
{
"docid": "41e888f3feb74d9a96f91bc298486c2d",
"score": "0.54663414",
"text": "def hook_add_files\n @flavor.class.after_add_files do |files, resource_action, type|\n files.each do |file|\n actions_taken << \"#{resource_action} #{type} #{file}\"\n end\n end\n end",
"title": ""
},
{
"docid": "bde2aaa43f571f549f306db4f71ef383",
"score": "0.5435311",
"text": "def package!\n Logger.message \"#{ self.class } started packaging the backup files.\"\n run(\"#{ utility(:tar) } -c -f '#{ File.join(Backup::TMP_PATH, \"#{ Backup::TIME }.#{ Backup::TRIGGER }.tar\") }' -C '#{ Backup::TMP_PATH }' '#{ Backup::TRIGGER }'\")\n end",
"title": ""
},
{
"docid": "d85806773ba177634a47aa01089abbcd",
"score": "0.5406943",
"text": "def run\n parse do\n self.current_sheet.processing!\n ss = Roo::Spreadsheet.open(self.new_file_path)\n current_uploader = Uploader.find(self.uploader_id)\n total_count = ss.last_row - 1\n current_uploader.update_total_row(total_count)\n case current_uploader.category\n when Uploader::TYPES[:default]\n upload_indicator(ss, current_uploader)\n when Uploader::TYPES[:indicator_2_0]\n upload_health_care_indicators(ss, current_uploader)\n when Uploader::TYPES[:resources]\n upload_resources(ss, current_uploader)\n when Uploader::TYPES[:indicator_map_color]\n upload_indicators_map_color(ss, current_uploader)\n else\n upload_description_template(ss, current_uploader)\n end\n end\n self.current_sheet.completed!\n end",
"title": ""
},
{
"docid": "002a3160f94646357589d64dd943e11f",
"score": "0.5397807",
"text": "def apply(dst_folder='c:\\chef\\tmp',error_log='c:\\chef\\log\\sql_patches.err' )\n \n errors = 0\n no_errors = 0\n list = @patches_to_apply.sort\n list.each do |n|\n raise(\"Patch number: #{n} doesn't exist\") unless @xml_patches.has_key?(n)\n if query_patch(n)\n @output.puts(\"Patch #{n} has already been applied (dbo.RavePatches table)\") \n next\n end\n s3_folder = @xml_patches[n][\"folder\"]\n \n sub_n = 0 \n @xml_patches[n][@role][\"sql_scripts\"].each do |sql_script|\n sub_n += 1\n if apply_sql_patch_script(sql_script,n,sub_n,dst_folder,error_log,s3_folder)\n no_errors += 1 \n else \n errors += 1\n end\n end\n \n \n update_ravepatches_table(n,1,s3_folder)\n end\n if errors > 0\n @output.puts \"There were #{errors} errors and #{no_errors} OKs\"\n @output.puts \"Check out #{error_log} for further information\"\n else\n @output.puts \"#{no_errors} Patched were applied\"\n end \n end",
"title": ""
},
{
"docid": "d353f038dfef770b263b461f872c3f6b",
"score": "0.53835565",
"text": "def compressFiles\n Dir.chdir(\"#{@outputDir}/RDPsummary\")\n #system(\"tar -zcf #{@sampleSetName1}.tar.gz * --exclude=*.log --exclude=*.sra --exclude=*.sff --exclude=*.local.metadata\")\n system(\"tar czf class.result.tar.gz class\")\n system(\"tar czf domain.result.tar.gz domain\")\n system(\"tar czf family.result.tar.gz family\")\n system(\"tar czf genus.result.tar.gz genus\")\n system(\"tar czf order.result.tar.gz order\")\n system(\"tar czf phyla.result.tar.gz phyla\")\n system(\"tar czf species.result.tar.gz species\")\n system(\"tar czf pdf.result.tar.gz 'find . -name `*.pdf`'\")\n Dir.chdir(@scratch)\n end",
"title": ""
},
{
"docid": "a6d68788333f3909100dad81eb9638cb",
"score": "0.53772545",
"text": "def untar_file(f, to)\n end",
"title": ""
},
{
"docid": "3e21a0f8cae5b44b4a02a2722e385e32",
"score": "0.5376711",
"text": "def apply\n @item.run_action(@action_name, *@action_args, current_intention: self)\n end",
"title": ""
},
{
"docid": "6f1421443b837261f5cc9c0baed585f9",
"score": "0.5360028",
"text": "def perform(filepath)\n\n end",
"title": ""
},
{
"docid": "daaa18208b952db93abd57314382ebfc",
"score": "0.53580225",
"text": "def apply!\n @hooks.values.each(&:apply!)\n @applied = true\n end",
"title": ""
},
{
"docid": "b2a9eb45e6c3faf816f70d59d15681ce",
"score": "0.5349284",
"text": "def after_processing_hook; end",
"title": ""
},
{
"docid": "cb5393f0c0549884edd9b94eaa29b011",
"score": "0.53227454",
"text": "def run_on_changes(paths)\n paths.each do |path|\n system \"theme upload #{path}\"\n end\n end",
"title": ""
},
{
"docid": "580770904172e6abd7700492736e16a8",
"score": "0.53181905",
"text": "def transfer_and_cleanup\n transfer_and_cleanup_with_block do |type|\n if type == :cover_concept\n self.update_column(:cover_concept_image_processed, true)\n end\n\n if type == :stock_cover_image\n self.update_column(:stock_cover_image_processed, true)\n end\n end\n end",
"title": ""
},
{
"docid": "95665315e61de576edf7c1750afed90d",
"score": "0.52992535",
"text": "def action_compress\n end",
"title": ""
},
{
"docid": "c69cab1b59c06d8107c06193407c62e6",
"score": "0.5278382",
"text": "def process_report(report)\n file_names = @dangerfile.git.modified_files.map { |file| File.expand_path(file) }\n file_names += @dangerfile.git.added_files.map { |file| File.expand_path(file) }\n report.targets.each do |target|\n target.files = target.files.select { |file| file_names.include?(file.location) }\n end\n\n report\n end",
"title": ""
},
{
"docid": "65bac5ac4db7400de5d207136ed75fb1",
"score": "0.5274648",
"text": "def run\n\t\tself.rsync_to_temp\n\t\tself.convert_to_mp3\n\t\tself.rsync_to_usb\n\t\tself.delete_temp_dir\n\tend",
"title": ""
},
{
"docid": "ece9e71a3771f6d9c883bd968e6e0457",
"score": "0.5266129",
"text": "def copy_actions\r\n end",
"title": ""
},
{
"docid": "1d8adcd3c835f6b9c6dbbad848fe4634",
"score": "0.5262773",
"text": "def run\n executor.run\n @files\n end",
"title": ""
},
{
"docid": "c9ce5e445d181dacd454c3d6bd4d9e8e",
"score": "0.5262162",
"text": "def main\n \n operations.each do |op|\n in_collection = op.input(INPUT).collection\n keep_plt = op.input(KEEP_PLT).val.to_s\n \n # export_filename(collection=in_collection, method='timeseries', timepoint=20) # timepoint is duration of timeseries plate reader\n filename = Item.find(in_collection.id).get('timeseries_filename')\n \n # Directs tech through biotek plate reader software in order to export time series measurements\n export_timeseries_data(filename)\n \n # Find measurements and upload\n show {\n title \"Locating Upload\"\n separator\n note \"The file you just exported should be in the <b>'_UWBIOFAB'</b> directory\"\n note \"It is called: #{filename}\"\n }\n # Show block upload button and retrieval of file uploaded\n up_show, up_sym = upload_show(filename)\n if (up_show[up_sym].nil?)\n show {warning \"No upload found for Plate Reader measurement. Try again!!!\"}\n up_show, up_sym = upload_show(filename)\n else\n upload = find_upload_from_show(up_show, up_sym)\n key = \"#{filename}\"\n associate_to_plans(key, upload)\n associate_to_item(in_collection, key, upload)\n end\n \n (keep_plt == 'No') ? (in_collection.mark_as_deleted) : (in_collection.location = 'Bench')\n in_collection.save\n if (keep_plt == 'No')\n show {\n title \"Cleaning Up...\"\n separator\n note \"Rinse out Plate <b>#{in_collection}</b> with DI H2O and bleach\"\n note \"Then rinse once more with EtOH\"\n }\n else\n show {\n title \"Cleaning Up...\"\n separator\n note \"Move <b>#{in_collection}</b> to <b>#{in_collection.location}</b>\"\n }\n end\n end\n \n end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.52480906",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "9fc5c83eacdb8b9a9fd5b127d999b463",
"score": "0.5241359",
"text": "def process_single_submitted_file(file_cfg, submission_name, current_user)\n filename = File.basename(file_cfg[:filename])\n if filename.end_with?('.tar.gz')\n tmp_folder = File.join(Dir.tmpdir, SecureRandom.alphanumeric(10))\n begin\n FileUtils.mkdir_p(tmp_folder)\n system(\"tar -zx -C #{tmp_folder.shellescape} -f #{file_cfg[:tempfile].path.shellescape}\")\n Dir.children(tmp_folder).each do |single_fn|\n submission_variant = File.basename(single_fn, File.extname(single_fn))\n content = File.read(File.join(tmp_folder, single_fn))\n schedule_submission_file(submission_variant, content, submission_name, current_user)\n end\n ensure\n FileUtils.rm_r(tmp_folder)\n end\n else\n submission_variant = File.basename(filename, File.extname(filename))\n content = file_cfg[:tempfile].read\n schedule_submission_file(submission_variant, content, submission_name, current_user)\n end\nend",
"title": ""
},
{
"docid": "ee48ed9971c9df9579c0d83fc73ae186",
"score": "0.5234296",
"text": "def apply()\n end",
"title": ""
},
{
"docid": "fc7d9a2fb45d75cd2fdd1d138690c275",
"score": "0.5226649",
"text": "def execute\n\n copiedCounter = 0\n failedCounter = 0\n skippedCounter = 0\n \n # traverse all srcfiles\n FiRe::filesys.find(@source) { |srcItem|\n \n # give some feedback\n FiRe::log.info \"searching #{srcItem}...\" if FiRe::filesys.directory?(srcItem)\n \n # skip this subtree if it matches ignored-items\n FiRe::filesys.prune if ignore?(srcItem) \n \n # transform srcpath to destpath\n destItem = srcItem.gsub(@source, @destination)\n\n # do not copy if item already exists and looks OK\n if needCopy(destItem,srcItem)\n copyWentWell = copyItem(srcItem, destItem)\n copiedCounter += 1 if copyWentWell\n failedCounter += 1 if !copyWentWell\n else\n skippedCounter += 1 \n end\n \n }\n \n # give some feedback\n FiRe::log.info \"copied #{copiedCounter} items, while #{failedCounter} items failed. #{skippedCounter} items did not need to be copied today.\"\n\n end",
"title": ""
},
{
"docid": "ebd61d59303b8ff7d579b404d94dfca9",
"score": "0.5220929",
"text": "def process(orig_file)\n end",
"title": ""
},
{
"docid": "3f3199d44e3cceccdb5189bf8a72ccd4",
"score": "0.52007717",
"text": "def extract\n for file_path in @files\n if !File.directory?(file_path)\n if file_path.downcase.index('.7zip') || file_path.downcase.index('.7z') || file_path.downcase.index('.zip')\n extension = '7zip' if file_path.downcase.index('.7zip')\n extension = '7z' if file_path.downcase.index('.7z')\n extension = 'zip' if file_path.downcase.index('.zip')\n cmd = \"7za e -o#{@dir} #{file_path}\"\n #puts \"Extracting #{file_path}: #{cmd}\"\n system(cmd)\n if cmd\n if file_path.downcase.index('att')\n file_name = File.join(@dir, \"attendance_ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.#{extension}\")\n elsif file_path.downcase.index('enroll')\n file_name = File.join(@dir, \"enrollment_ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.#{extension}\")\n elsif file_path.downcase.index('ili') || file_path.downcase.index('h1n1')\n file_name = File.join(@dir, \"ili_ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.#{extension}\")\n else\n file_name = File.join(@dir, \"ads_#{Time.now.year}_#{Time.now.month}_#{Time.now.day}.#{extension}\")\n end\n File.rename(file_path, file_name)\n FileUtils.mv(file_name, File.join(@dir, \"archive\"))\n end\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "6a77293830239572b8dbe09e7e885f3f",
"score": "0.5200444",
"text": "def apply!\n synchronize do\n if applied?\n raise Error::ApplyError,\n \"Hooks have already been applied to stack\"\n end\n actions = stack.actions.dup\n stubs = [:stub] * actions.size\n before_entries.find_all { |e| e.identifier == :all }.each do |entry|\n stubs.count.times.to_a.reverse.each do |i|\n stubs.insert(i, entry.action)\n end\n end\n after_entries.find_all { |e| e.identifier == :all }.each do |entry|\n stubs.count.times.to_a.reverse.each do |i|\n stubs.insert(i + 1, entry.action)\n end\n end\n actions = stubs.map do |item|\n item == :stub ? actions.pop : item\n end\n before_entries.find_all { |e| e.identifier != :all }.each do |entry|\n idx = actions.index { |a| a.callable == entry.identifier }\n next if idx.nil?\n actions.insert(idx, entry.action)\n end\n after_entries.find_all { |e| e.identifier != :all }.each do |entry|\n idx = actions.index { |a| a.callable == entry.identifier }\n next if idx.nil?\n actions.insert(idx + 1, entry.action)\n end\n @applied = true\n actions = prepend_entries + actions + append_entries\n end\n end",
"title": ""
},
{
"docid": "89d29f0f2a7585646ab0489c40786549",
"score": "0.51963955",
"text": "def process()\n @file_info = FileInfoFile.new(@file_info_file)\n @namespace = @file_info.default_namespace\n \n namespaces_file = NamespacesFile.new(@uploads_directory, @scan_only)\n namespaces_file.add_namespace(@namespace)\n namespaces_file.write()\n @prefix = namespaces_file.prefix(@namespace)\n \n create_image_files_where_needed()\n end",
"title": ""
},
{
"docid": "59b77b5c992e00fa3d3da1b4bcc4855e",
"score": "0.518874",
"text": "def perform(repo)\n repo.update_catalog_metadata\n repo.add_preservation_and_mets_xml\n repo.delete_clone\n repo.create_iiif_manifest if Settings.bulk_import.create_iiif_manifest\n repo.publish if repo.published\n end",
"title": ""
},
{
"docid": "190467472ec3131a14beef65e5dd7f2b",
"score": "0.5172653",
"text": "def af_perform(work)\n attribute_map = work.permissions.map(&:to_hash)\n work.file_sets.each do |file|\n # copy and removed access to the new access with the delete flag\n file.permissions.map(&:to_hash).each do |perm|\n unless attribute_map.include?(perm)\n perm[:_destroy] = true\n attribute_map << perm\n end\n end\n # apply the new and deleted attributes\n file.permissions_attributes = attribute_map\n file.save!\n end\n end",
"title": ""
},
{
"docid": "df6577b217b95cd05b378ded6b452e2b",
"score": "0.5171507",
"text": "def after_processing\n end",
"title": ""
},
{
"docid": "f7c741b4b9fe6f02e2d1dde85b366722",
"score": "0.5164492",
"text": "def tar_metrics_files\n v = (@verbose ? \"v\" : \"\")\n comm = \"tar cz#{v}f #{@output_dir}/#{@tar_file_name} -C #{@parent_staging_dir} .\"\n puts \"Tarring metrics with: #{comm}\" if @verbose\n system(comm)\n puts \"Created #{@output_dir}/#{@tar_file_name}\"\n end",
"title": ""
},
{
"docid": "e6b19d9fbc79c84b67e7393f6ac5a00e",
"score": "0.5160471",
"text": "def perform\n check_file # checks if the file uploaded is valid\n save_file_entry # Uploads the file to the server and saves a entry to database\n end",
"title": ""
},
{
"docid": "4c982bae91d80d2c8cc8326f818c0112",
"score": "0.51539344",
"text": "def post_import\n end",
"title": ""
},
{
"docid": "cf107c33990e05004a4ad140c98170e6",
"score": "0.51534086",
"text": "def pre_process\n end",
"title": ""
},
{
"docid": "40425b17f7f208926ee10816df80d792",
"score": "0.51498044",
"text": "def perform\n \n end",
"title": ""
},
{
"docid": "c93c6663b11499af03efc66aeda5c746",
"score": "0.51415384",
"text": "def compression\n \n ##Preparing directory structure for \"project\" area to display html\n system(\"mkdir -p #{@outputDir}/htmlPages/#{@studyName1}/QIIME/#{@jobName1}\")\n system(\"cp -r #{@outputDir}/QIIME_result/plots #{@outputDir}/htmlPages/#{@studyName1}/QIIME/#{@jobName1}\")\n \n Dir.chdir(\"#{@outputDir}/QIIME_result\")\n #system(\"tar -zcf #{@sampleSetName1}.tar.gz * --exclude=*.log --exclude=*.sra --exclude=*.sff --exclude=*.local.metadata\")\n system(\"tar czf raw.results.tar.gz * --exclude=filtered_aln --exclude=taxa --exclude=aln --exclude=plots\")\n system(\"tar czf phylogenetic.result.tar.gz filtered_aln\")\n system(\"tar czf taxanomy.result.tar.gz taxa\")\n system(\"tar czf fasta.result.tar.gz aln\")\n system(\"tar czf plots.result.tar.gz plots\")\n \n Dir.chdir(@scratch)\n \n end",
"title": ""
},
{
"docid": "e7eeadf6fb6001f0a48a14e771204fb8",
"score": "0.51238525",
"text": "def after_process original\n super(original)\n Wukong::Deploy.vayacondios_client.announce(vayacondios_topic, {\n success: true,\n step: 'prepare',\n path: fragment_for(original),\n size: File.size(original),\n })\n end",
"title": ""
},
{
"docid": "0029a54a830f778f0433f0ffa07d3a88",
"score": "0.5114512",
"text": "def after_process(ant)\n end",
"title": ""
},
{
"docid": "c580c6730ea65e797cc1858e7766402b",
"score": "0.5113881",
"text": "def perform!\r\n super\r\n backup\r\n log!(:finished)\r\n end",
"title": ""
},
{
"docid": "e7229de051dbcd5970260ab1bd0f771e",
"score": "0.50983524",
"text": "def run\n \n #Get Arguments\n if @name_args.size != 1\n ui.info(\"Please specify a tarPath\")\n show_usage\n exit 1\n end\n \n tar_file = Chef::TarFile.new(@name_args.first, true)\n CookbookTarDownload.download_cookbooks tar_file\n tar_file.save\n \n end",
"title": ""
},
{
"docid": "ae30133903efa69918c97f5af3a29d93",
"score": "0.5097097",
"text": "def perform\n accept(parse_file)\n end",
"title": ""
},
{
"docid": "a7a51d0a5c75f11adbb6777b92894f6e",
"score": "0.50917286",
"text": "def test_tar\n\tx = \"test_tar\"\n\t@output = @s.archive({ 'files'=> [@test_directory_1_Path], 'format'=>'tar' , 'recurse'=>false } )\n\t#puts @output['archiveFile']\n\t\n\t@testid= 1\n\tTar.open(@output['archiveFile'], File::RDONLY, 0644, Tar::GNU | Tar::VERBOSE) do |tar|\n while tar.read # or 'tar.each do ...'\n #puts tar.pathname\n\t\t\n\t\t\n # tar.print_long_ls\n\n if tar.reg? && tar.pathname!=\"test_directory_1/.DS_Store\" # regular file\n tar.extract_file('test')\n\t\t want = File.read(File.join(@testdir, tar.pathname))\n\t\t puts tar.pathname\n\t\t #asserting bar1,2,3 from tar file is same as original bar1,2,3\n\t\t assert_log( want, File.read('test'), $log, x, @testid)\n end\n end\n\n ##if extract all files\n #tar.extract_all\n end\n\n\n ##for gzip archive\n #Tar.gzopen('foo.tar.gz', ...\n\n ##for bzip2 archive\n #Tar.bzopen('foo.tar.bz2', ...\n \n \n \n end",
"title": ""
},
{
"docid": "1b2c958d0d3afac402826b838e90d703",
"score": "0.5076357",
"text": "def untar_file(f, to)\n line(\"tar\", \"-xf {file} -C {path}\").pass(file: f, path: to)\n end",
"title": ""
},
{
"docid": "c149774aacd39cef2f48f7437070321f",
"score": "0.5068148",
"text": "def tar_each(&block)\n # In case of extreme weirdness where this happens twice.\n close_file!\n open_file!\n @tar_reader.each(&block)\n ensure\n close_file!\n end",
"title": ""
},
{
"docid": "4fd6966d9090adcb7f8da4dc1a2d8930",
"score": "0.50679284",
"text": "def commit\n # TODO\n # Update ./docProps\n # app.xml slides, notes, counts, etc\n # core.xml Times\n entries.each do |path, buffer|\n path = path.to_s\n if @original_files.include? path\n @zip.replace_buffer path, buffer\n else\n @zip.add_buffer path, buffer\n end\n end\n @zip.commit\n end",
"title": ""
},
{
"docid": "c2e55b7947903c66c6e0bf22373e4615",
"score": "0.5060774",
"text": "def perform\n ProductCsvFilesHandler.call\n end",
"title": ""
},
{
"docid": "fb428b3f8d64979b29d5fa472c4caee4",
"score": "0.5056608",
"text": "def run\n assets.each do |asset|\n next if ::File.directory?(asset)\n\n compress(asset)\n checksum(asset)\n end\n\n generate_manifest\n end",
"title": ""
},
{
"docid": "3cce9f9b1802f81cc885e02a5929038a",
"score": "0.5056367",
"text": "def finished(inspected_files); end",
"title": ""
},
{
"docid": "6bfe688acb334ae3542f634ab900d810",
"score": "0.50537777",
"text": "def redo\n\t\tself.apply()\n\tend",
"title": ""
},
{
"docid": "68dcdc2ff51e9c9e4481fd399001cfb5",
"score": "0.5052385",
"text": "def perform\n\n begin\n\n # acquire lock and fetch the locked hooks\n fetch_hooks_to_be_processed\n\n # Process these Hooks\n process_hooks\n\n # Mark Hooks as processed\n update_status_to_processed\n\n rescue StandardError => se\n\n @hooks_to_be_processed.each do |hook|\n hook_id = hook.id\n # Skip if we already know that his hook was processed or failed\n next if @success_responses[hook_id].present? ||\n @failed_hook_to_be_ignored[hook_id].present? ||\n @failed_hook_to_be_retried[hook_id].present?\n @failed_hook_to_be_retried[hook_id] = {\n exception: {message: se.message, trace: se.backtrace}\n }\n end\n\n ensure\n\n # For hooks which failed, mark them as failed\n release_lock_and_update_status_for_non_processed_hooks\n\n # Notify Devs in case on Errors\n notify_devs\n\n success_with_data(processor_response)\n\n end\n\n end",
"title": ""
},
{
"docid": "6a7bbe2353c1c30946706ec3e2856cd6",
"score": "0.5030483",
"text": "def targz\n files = procedure.get_adapter_configuration.attributes['files']\n if files.is_a?(Array)\n puts system_messages[:archiving]; puts system_messages[:compressing]\n %x{ tar -czf #{File.join(tmp_path, compressed_file)} #{files.map{|f| f.gsub(' ', '\\ ')}.join(' ')} }\n elsif files.is_a?(String)\n puts system_messages[:archiving]; puts system_messages[:compressing]\n %x{ tar -czf #{File.join(tmp_path, compressed_file)} #{files.gsub(' ', '\\ ')} }\n end\n end",
"title": ""
},
{
"docid": "5069238bf6648d2925717ac079b454ae",
"score": "0.50285196",
"text": "def package_files\n Dir.mktmpdir {|tmpdir|\n @stemcell_files.flatten.each {|file| FileUtils.cp(file, tmpdir) if file && File.exists?(file) } # only copy files that are not nil\n Dir.chdir(tmpdir) do\n @logger.info(\"Package #@stemcell_files to #@target ...\")\n sh \"tar -czf #@target *\", {:on_error => \"unable to package #@stemcell_files into a stemcell\"}\n end\n }\n @target\n end",
"title": ""
},
{
"docid": "5069238bf6648d2925717ac079b454ae",
"score": "0.50285196",
"text": "def package_files\n Dir.mktmpdir {|tmpdir|\n @stemcell_files.flatten.each {|file| FileUtils.cp(file, tmpdir) if file && File.exists?(file) } # only copy files that are not nil\n Dir.chdir(tmpdir) do\n @logger.info(\"Package #@stemcell_files to #@target ...\")\n sh \"tar -czf #@target *\", {:on_error => \"unable to package #@stemcell_files into a stemcell\"}\n end\n }\n @target\n end",
"title": ""
},
{
"docid": "23c45251dbd8226432f439a758d699ba",
"score": "0.50123495",
"text": "def process_primary_files_with_changes_only\n # We get the diff only so that we know which files have changed.\n # It's ok to use the reference commits because we're dealing with\n # content AT files only.\n diff = @repository.diff(@from_git_commit, @to_git_commit, context_lines: 0)\n fwc = []\n diff.patches.each { |patch|\n file_name = patch.delta.old_file[:path]\n # Skip non content_at files\n next if !@file_list.include?(file_name)\n # next if !file_name.index('63-0728')\n unless file_name =~ /\\/content\\/.+\\d{4}\\.at\\z/\n raise \"shouldn't get here: #{ file_name.inspect }\"\n end\n\n @logger.info(\" - process #{ file_name }\")\n\n absolute_file_path = File.join(@repository.base_dir, file_name)\n # Initialize content AT file `to` with contents as of `to_git_commit`.\n # It's fine to use the reference sync commit as the sync operation\n # doesn't touch content AT files, only STM CSV ones.\n content_at_file_to = Repositext::RFile::ContentAt.new(\n '_', # Contents are initialized later via `#as_of_git_commit`\n @language,\n absolute_file_path,\n @any_content_type\n ).as_of_git_commit(@to_git_commit)\n\n compute_st_ops_attrs = {\n from_git_commit: @from_git_commit,\n to_git_commit: @to_git_commit,\n prev_last_operation_id: @prev_last_operation_id,\n execution_context: @execution_context,\n }\n\n compute_st_ops_attrs = refine_compute_st_ops_attrs(\n compute_st_ops_attrs,\n {\n from_table_release_version: @from_table_release_version,\n to_table_release_version: @to_table_release_version,\n absolute_file_path: absolute_file_path\n }\n )\n soff = SubtitleOperationsForFile.new(\n content_at_file_to,\n @repository.base_dir,\n compute_st_ops_attrs\n ).compute\n\n if soff.operations.any?\n # Only collect files that have subtitle operations\n @prev_last_operation_id = soff.last_operation_id\n fwc << soff\n end\n }\n\n # Then we add any files that have st_sync_required set to true and are\n # not in fwc already.\n @file_list.each { |content_at_filename|\n # Skip files that we have captured already\n next if fwc.any? { |soff| soff.content_at_file.repo_relative_path == content_at_filename }\n # Skip files that don't have st_sync_required set to true at to_git_commit\n dj_filename = content_at_filename.sub(/\\.at\\z/, '.data.json')\n # We use dj file contents at to_git_commit :at_child_or_ref\n dj_file = Repositext::RFile::DataJson.new(\n '_', # Contents are initialized later via #as_of_git_commit\n @language,\n dj_filename,\n @any_content_type\n ).as_of_git_commit(\n @to_git_commit,\n :at_child_or_ref\n )\n next if(dj_file.nil? || !dj_file.read_data['st_sync_required'])\n # This file is not in the list of fwc yet, and it has st_sync_required.\n # We add an soff instance with no operations. This could be a file\n # that has changes to subtitle timeslices only.\n content_at_file_from = Repositext::RFile::ContentAt.new(\n '_', # Contents are initialized later via `#as_of_git_commit`\n @language,\n content_at_filename,\n @any_content_type\n ).as_of_git_commit(@from_git_commit)\n soff = Repositext::Subtitle::OperationsForFile.new(\n content_at_file_from,\n {\n file_path: content_at_file_from.repo_relative_path,\n from_git_commit: @from_git_commit,\n to_git_commit: @to_git_commit,\n },\n [] # No operations\n )\n fwc << soff\n }\n # Return list of unique files with changes\n fwc.uniq\n end",
"title": ""
},
{
"docid": "18eb6f9e51cb2638d50948a1009753a4",
"score": "0.5011912",
"text": "def cleanup_extract_source(attrs={})\n\n execute \"cleanup_source\" do\n cwd Chef::Config[:file_cache_path]\n command \"rm -rf #{attrs['src_dir']}\"\n not_if do ! FileTest.directory?(attrs['src_dir']) end\n action :run\n end\n\n extract_flags = \"tar zxf\" if attrs['src_file'] =~ /tar\\.gz/\n extract_flags = \"tar jxf\" if attrs['src_file'] =~ /tar\\.bz2/\n extract_flags = \"7za x\" if attrs['src_file'] =~ /7z/\n\n execute \"extract_source\" do\n cwd Chef::Config[:file_cache_path]\n command \"#{extract_flags} #{Chef::Config[:file_cache_path]}/#{attrs['src_file']}\"\n action :run\n end\n\nend",
"title": ""
},
{
"docid": "1204f7a52718e2bb60498148c749359a",
"score": "0.50107336",
"text": "def run_hook(_resources)\n setup_code_deploy_s3_buckets\n end",
"title": ""
},
{
"docid": "d94ea5bdfeba1cb59a6cabe0a8d706ff",
"score": "0.50075346",
"text": "def apply!\n return if @already_applied\n pointcuts.each do |pc| pc.apply! end\n @already_applied = true\n end",
"title": ""
},
{
"docid": "37b124825f7194111ecd06a95db78c49",
"score": "0.5006372",
"text": "def hook_report_actions\n @flavor.class.after_add_resources do\n actions = actions_taken\n @recipe.send(:ruby_block, 'report_actions_taken') do\n # :nocov:\n block do\n $stdout.puts \"\\n\\nactions taken:\"\n actions.each { |a| $stdout.puts \" #{a}\" }\n end\n # :nocov:\n end\n end\n end",
"title": ""
},
{
"docid": "0101243b4e7ae17b2956221c93d4ee01",
"score": "0.5001536",
"text": "def run_on_change(paths)\n UI.info \"Templates have changed, copying over\"\n ::Forge::Guard.builder.clean_templates\n ::Forge::Guard.builder.copy_templates\n end",
"title": ""
},
{
"docid": "850dac324a5bc4e529096229f1b6589a",
"score": "0.49962392",
"text": "def proc_file_toinst(new_file_hash, root_new_files)\n new_file = new_file_hash[:src]\n dst_file = new_file_hash[:dst]\n @log.debug(\"Processing file: #{new_file}\")\n app_dir_dst = File.join(@target_app_root_path, @app_root_subfolder)\n old_dst_file = File.join(app_dir_dst, dst_file)\n src_file = File.join(root_new_files, new_file)\n # copy file\n FileUtils.cp_r(src_file, old_dst_file)\n @log.debug(\"Copy file #{src_file} to #{old_dst_file}\")\n rescue\n @log.error(\"proc_file_toinst error #{$!}\")\n end",
"title": ""
},
{
"docid": "084d15de2754a990f99027876b1090fd",
"score": "0.49888176",
"text": "def apply_diff(diff)\n diff.deltas.each do |d|\n case d.status\n when :deleted\n remove_file(d.new_file[:path])\n File.delete(File.join(path, path))\n when :added, :modified\n add_file(d.new_file[:path])\n when :renamed\n remove_file(d.old_file[:path])\n File.delete(File.join(path, path))\n add_file(d.new_file[:path])\n else\n logger.warn(\"File has a status of #{d.status}\")\n end\n end\n end",
"title": ""
},
{
"docid": "cebae67d0ada35e4f9f66c9a21fab90d",
"score": "0.49862573",
"text": "def extract\n base.say_status 'extract', @file\n if @zip_file\n base.exec(\"cd #{@temp_dir} ; unzip #{@file}\")\n else\n base.exec(\"cd #{@temp_dir} ; tar xvfpz #{@file}\")\n end\n \n # Remove the file\n base.destination_files.rm_rf(@file_path)\n end",
"title": ""
},
{
"docid": "eb1c68a5a83c83dcc092e115797662da",
"score": "0.49783948",
"text": "def transfer!\n backup = connection.backups.create\n Logger.info \"Created backup [#{backup.id}]\"\n\n package.filenames.each do |filename|\n src = File.join(Config.tmp_path, filename)\n metadata = {}\n\n [:sha512sum, :sha1sum, :cksum].each do |cmd|\n if !`which #{cmd}`.empty?\n metadata[cmd] = %x|#{cmd} #{src}|.split.first\n break\n end\n end\n\n metadata[:size] = %x|ls -sh #{src}|.split.first\n\n backup_file = backup.files.create(filename: src, metadata: metadata)\n Logger.info \"Created backup file [#{backup_file.id}]\"\n\n Logger.info \"EngineYard performing upload of '#{File.join(src)}' to '#{backup_file.upload_url}' with metadata '#{metadata.inspect}'.\"\n\n backup_file.upload(file: src)\n end\n Logger.info \"Finished uploading files for backup [#{backup.id}]\"\n\n backup.finish!\n\n Logger.info \"Finished backup [#{backup.id}]\"\n end",
"title": ""
},
{
"docid": "1649c1bcac9dcbe27173c18123cef7fc",
"score": "0.49768862",
"text": "def call\n zip_content!\n\n swatches_path\n end",
"title": ""
},
{
"docid": "2f25ff31f312157c725331fe9659a57d",
"score": "0.49760333",
"text": "def perform_file_copy\n\t\tretrieve_target_dir do |target_dir|\n\t\t\tFileUtils.mkdir_p target_dir\n\t\t\tcopy_depdencies_to target_dir\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "381693613e198bfe7dc5d00346b5e7c3",
"score": "0.4972926",
"text": "def perform_work\n return LyberCore::ReturnState.new(status: :skipped, note: 'object is not an item') unless assembly_item.item? # not an item, skip\n\n return LyberCore::ReturnState.new(status: :skipped, note: 'No contentMetadata to load from the filesystem') if !content_metadata_exists? && !assembly_item.stub_content_metadata_exists?\n\n # both stub and regular content metadata exist -- this is an ambiguous situation and generates an error\n raise \"#{Settings.assembly.stub_cm_file_name} and #{Settings.assembly.cm_file_name} both exist for #{druid}\" if assembly_item.stub_content_metadata_exists? && content_metadata_exists?\n\n structural = if assembly_item.stub_content_metadata_exists?\n assembly_item.convert_stub_content_metadata\n else\n Honeybadger.notify('NOTE: assemblyWF#content-metadata-create robot converted contentMetadata.xml to Cocina. We are not sure this should happen anymore.')\n # handle contentMetadata.xml\n xml = File.read(cm_file_name)\n # Convert the XML to cocina and save it\n Dor::StructuralMetadata.update(xml, assembly_item.cocina_model)\n end\n\n updated = assembly_item.cocina_model.new(structural:)\n assembly_item.object_client.update(params: updated)\n\n # Remove the contentMetadata.xml or stubContentMetadata.xml\n FileUtils.rm(cm_file_name) if content_metadata_exists?\n FileUtils.rm(assembly_item.stub_cm_file_name) if assembly_item.stub_content_metadata_exists?\n\n LyberCore::ReturnState.new(status: 'completed')\n end",
"title": ""
},
{
"docid": "764114007c436fbdfa15ee909aab0051",
"score": "0.4972552",
"text": "def run_reapply_blocks\n self.reapply_blocks.each do |target, block|\n context(target, &block)\n end\n end",
"title": ""
},
{
"docid": "356efdaacbcc2fc8cadbea8d427c682b",
"score": "0.4969869",
"text": "def perform_processing!\n raise \"This run is already processed!\" if run_for_processing\n update(run_for_processing: true)\n outdir = File.join(OUTPUT_DIR, \"#{id}\").shellescape\n indir = File.join(INPUT_DIR, \"#{id}\").shellescape\n Dir.mkdir(outdir, 0755) unless File.directory?(outdir)\n Dir.mkdir(indir, 0755) unless File.directory?(indir)\n\n # Stream input files to zip\n zout_in = java.util.zip.ZipOutputStream.new(File.open(File.join(indir, 'input.zip'), 'wb', 0644).to_outputstream)\n zout_out = java.util.zip.ZipOutputStream.new(File.open(File.join(outdir, 'out.zip'), 'wb', 0644).to_outputstream)\n\n finding_aid_versions\n .joins(:finding_aid, :concrete_issues => :issue)\n .select('finding_aid_versions.*,\n finding_aids.eadid,\n ARRAY_AGG(DISTINCT issues.identifier) AS identifiers')\n .group('finding_aids.eadid,finding_aid_versions.id')\n .each do |fa|\n add_to_zip(zout_in, fa.eadid, fa.file)\n\n # Preflight XML\n fa_xml = Fixes.preflights.values.reduce(fa.xml) do |xml, fix|\n apply_fix(xml, fix)\n end\n\n # Apply all relevant fixes to Finding Aid\n repaired = Fixes\n .to_h\n .select {|identifier, _| fa.identifiers.include? identifier}\n .reduce(fa_xml) do|xml, (identifier, fix)|\n pe = processing_events.create(issue_id: schematron.issues.find_by(identifier: identifier).id,\n finding_aid_version_id: fa.id)\n apply_fix(xml, fix, pe)\n\n end # end of .reduce\n\n # Any problems which have fixes that exist now should theoretically\n # be things that were shadowed by the first pass, so take additional passes\n # untill either no known issues or MAX_PASSES\n MAX_PASSES.times do\n remaining_problems = schematron.issues.where(id: @checker.check_str(repaired.serialize(encoding: 'UTF-8')).map {|el| el[:issue_id]}.uniq).pluck(:identifier) & Fixes.to_h.keys\n\n # Run a second round of fixing if there are remaining problems\n break if remaining_problems.blank?\n repaired = Fixes\n .to_h\n .select {|identifier, _| remaining_problems.include? identifier}\n .reduce(repaired) do |xml, (identifier, fix)|\n pe = processing_events.create(issue_id: schematron.issues.find_by(identifier: identifier).id,\n finding_aid_version_id: fa.id)\n apply_fix(xml, fix, pe)\n end\n end\n\n\n # Add notice of processing to revisiondesc\n today = DateTime.now.in_time_zone\n rd = repaired.at_xpath('/ead/eadheader/revisiondesc') || repaired.at_xpath('/ead/eadheader').add_child(Nokogiri::XML::DocumentFragment.new(repaired, '<revisiondesc />')).first\n rd.prepend_child(Nokogiri::XML::DocumentFragment.new(repaired, \"\\n\" + <<-FRAGMENT.strip_heredoc + \"\\n\"))\n <change>\n <date calendar=\"gregorian\" era=\"ce\" normal=\"#{today.strftime('%Y%m%d')}\">#{today.strftime('%m/%d/%Y')}</date>\n <item>This resource was modified by the ArchivesSpace Preprocessor developed by the Harvard Library (https://github.com/harvard-library/archivesspace-preprocessor)</item>\n </change>\n FRAGMENT\n\n File.open(File.join(outdir, \"#{fa.eadid}.xml\"), 'w', 0644) do |f|\n repaired.write_xml_to(f, encoding: 'UTF-8')\n end\n\n add_to_zip(zout_out, fa.eadid, File.open(File.join(outdir, \"#{fa.eadid}.xml\"), 'r'))\n end\n\n update(completed_at: DateTime.now)\n ensure\n close_zipfiles(zout_in, zout_out)\n end",
"title": ""
},
{
"docid": "033d686c705d00fa0deb3b824fbff165",
"score": "0.49698362",
"text": "def run_processor\n if @file_last_action == :file_url\n processor = WORKER_LIST.detect{|worker| worker.can_work_with_file_name?(val) }\n processor.perform_later(self)\n elsif @file_last_action == :file\n\n end\n\n end",
"title": ""
},
{
"docid": "5c3edfe967a0651a753402912c50cc65",
"score": "0.49661508",
"text": "def add_file_characterization_to_all_basic_files\n logger = Logger.new(STDOUT)\n logger.level = Logger::INFO\n logger.datetime_format = \"%H:%M:%S\"\n bfs = BasicFile.all\n bfs.each do |bf|\n if bf.datastreams['fitsMetadata1'].nil?\n logger.info \"No FITS datastream found for #{bf.pid}, going to add one...\"\n #need to create a new temp file using the content from the datastream\n temp_file = File.new('temp_content_file', 'w+')\n begin\n temp_file.puts bf.content.content\n rescue StandardError => re\n logger.error 'Got error writing BasicFile contents to file'\n logger.error re.to_s\n if re.to_s.match 'from ASCII-8BIT to UTF-8'\n logger.info 'ASCII file detected'\n temp_file.puts bf.content.content.force_encoding('UTF-8')\n end\n end\n #temp_file.puts bf.content.content.force_encoding('UTF-8')\n\n f = ActionDispatch::Http::UploadedFile.new(filename: bf.content.label, type: bf.content.profile['dsMIME'], tempfile: temp_file)\n\n begin\n logger.info 'Generating FITS metadata XML'\n fitsMetadata = Hydra::FileCharacterization.characterize(f, f.original_filename, :fits)\n rescue Hydra::FileCharacterization::ToolNotFoundError => tnfe\n logger.error tnfe.to_s\n abort 'FITS tool not found, terminating, check FITS_HOME environment variable is set and FITS is installed'\n rescue RuntimeError => re\n logger.error 'Something went wrong with extraction of file metadata using FITS'\n logger.error re.to_s\n abort 'FITS tool not found, terminating, check FITS_HOME environment variable is set and FITS is installed'\n end\n fitsDatastream = ActiveFedora::OmDatastream.from_xml(fitsMetadata)\n fitsDatastream.digital_object = bf.inner_object\n\n bf.add_datastream(fitsDatastream, {:prefix => 'fitsMetadata'})\n bf.save\n logger.info 'FITS metadata datastream added, tidying up resources used'\n temp_file.close\n FileUtils.remove_file 'temp_content_file'\n logger.info \"Finished adding FITS metadata for #{bf.pid}\"\n logger.info '********************************************'\n end\n end\n end",
"title": ""
},
{
"docid": "f3259e65c2b64283ff3d0d8b9ce4a0c4",
"score": "0.49615213",
"text": "def perform_backup\n \n add_memories_to_dropbox! if has_dropbox?\n\n # Clone the repo incase something is writing to it while we are backing up\n run \"cd #{@home} && git clone --bare #{@repo} #{@repo}.mirror\"\n output=run \"backup perform --trigger=daily_backup --log-path #{@dirs[:logs ]}\"\n run \"cd #{@home} && rm -fr #{@repo}.mirror\"\n \n get_timestamp(output)\n end",
"title": ""
},
{
"docid": "c15450020d500ce84a2070fa0e9cb085",
"score": "0.49597582",
"text": "def apply_transform(tree)\n raise \"Abstract method called\"\n end",
"title": ""
},
{
"docid": "18095c24a0afa9311c7eae1916e37a2c",
"score": "0.49573392",
"text": "def run\n threads = []\n\n filters = @f.all\n filters.each do |filter|\n threads << Thread.new(filters) do |fi|\n @i.move(\n filter[:filter],\n { \n :from => filter[:search_folder], \n :to => filter[:destination_folder]\n }\n )\n puts \"Applied filter #{filter[:name]}\"\n end\n end\n threads.each { |t| t.join }\n end",
"title": ""
},
{
"docid": "9e40df493a452c015e48049251e12cd0",
"score": "0.495423",
"text": "def perform_processing_run(faids)\n perform_analysis(faids)\n perform_processing!\n end",
"title": ""
},
{
"docid": "0360da56d9aab3fb79f1b0ccf703a9de",
"score": "0.49521205",
"text": "def tar\n @tarreader\n end",
"title": ""
},
{
"docid": "7f99389baa4f4f3bcc4bdd8f811c7db6",
"score": "0.4940142",
"text": "def after_config_update(*_)\n config[:parameters] ||= Smash.new\n config[:compile_parameters] ||= Smash.new\n config[:apply_stack] ||= []\n config[:apply_mapping] ||= Smash.new\n stack_name = arguments.first\n content = load_file_for(stack_name)\n process_information_hash(content, [])\n nil\n end",
"title": ""
},
{
"docid": "c8a90b808525bcab2471ea00228ecd39",
"score": "0.49376717",
"text": "def tar(file)\n TarTask.define_task(file)\nend",
"title": ""
},
{
"docid": "ec0acdc0257bf54d5c3084b8a364a7e2",
"score": "0.4932008",
"text": "def upload\n begin\n apicaller =ApiCaller.new(@hostOutput,\"\",@user,@pass)\n restPath = @pathOutput\n \n \n ##uplaoding otu table\n path = restPath +\"/file/MicrobiomeWorkBench/#{@studyName1}/QIIME/#{@jobName1}/otu.table/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/QIIME_result/otu_table.txt\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded otu_table.txt \"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n \n ##uplaoding phylogenetic tarred files\n path = restPath +\"/file/MicrobiomeWorkBench/#{@studyName1}/QIIME/#{@jobName1}/phylogenetic.result.tar.gz/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/QIIME_result/phylogenetic.result.tar.gz\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded phylogenetic.result.tar.gz\"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n ##uplaoding taxanomy tarred files \n path = restPath +\"/file/MicrobiomeWorkBench/#{@studyName1}/QIIME/#{@jobName1}/taxanomy.result.tar.gz/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/QIIME_result/taxanomy.result.tar.gz\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded taxanomy.result.tar.gz\"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n ##Uploading fasta files \n path = restPath +\"/file/MicrobiomeWorkBench/#{@studyName1}/QIIME/#{@jobName1}/fasta.result.tar.gz/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/QIIME_result/fasta.result.tar.gz\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded fasta.result.tar.gz \"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n ##Uploading plots files \n path = restPath +\"/file/MicrobiomeWorkBench/#{@studyName1}/QIIME/#{@jobName1}/plots.result.tar.gz/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/QIIME_result/plots.result.tar.gz\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded plots.result.tar.gz plots\"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end \n \n #uploading raw results file back\n path = restPath +\"/file/MicrobiomeWorkBench/#{@studyName1}/QIIME/#{@jobName1}/raw.results.tar.gz/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/QIIME_result/raw.results.tar.gz\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded raw.results.tar.gz \"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n #uploading metadata file back\n path = restPath +\"/file/MicrobiomeWorkBench/#{@studyName1}/QIIME/#{@jobName1}/sample.metadata/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/metadata.txt\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded metadata file \"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n ##uploading json setting file\n path = restPath +\"/file/MicrobiomeWorkBench/#{@studyName1}/QIIME/#{@jobName1}/settings.json/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@scratch}/jobFile.json\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded jsonfile file \"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n ##uploading mapping.txt file\n path = restPath +\"/file/MicrobiomeWorkBench/#{@studyName1}/QIIME/#{@jobName1}/mapping.txt/data\"\n apicaller.setRsrcPath(path)\n infile = File.open(\"#{@outputDir}/QIIME_result/mapping.txt\",\"r\")\n apicaller.put(infile)\n if apicaller.succeeded?\n $stdout.puts \"successfully uploaded mapping.txt file \"\n else\n $stderr.puts apicaller.parseRespBody()\n $stderr.puts \"API response; statusCode: #{apicaller.apiStatusObj['statusCode']}, message: #{apicaller.apiStatusObj['msg']}\"\n @exitCode = apicaller.apiStatusObj['statusCode']\n raise \"#{apicaller.apiStatusObj['msg']}\"\n end\n \n end\n \n end",
"title": ""
},
{
"docid": "ad77fc786a1f6cf357eca415e102c5d1",
"score": "0.4928905",
"text": "def perform_hooks!\n @perform_hooks = true\n end",
"title": ""
},
{
"docid": "1cbafad5316131c539a2de24f280533a",
"score": "0.49258643",
"text": "def replaced_files; end",
"title": ""
},
{
"docid": "7a4074b16a8d6269851d464cf673f75f",
"score": "0.49252138",
"text": "def run\n logger.debug(\"WORK HORSE PROCESS JOB STARTED.\")\n downloadRemotefiles\n unzipFiles\n #parsePhotoRequestReponseXMl\n #updateProducts\n zipXMLFiles\n uploadZipFiles\n logger.debug(\"JOB FINISHED.\")\n end",
"title": ""
},
{
"docid": "e66e1ac3e0b42813fbe1389872f04138",
"score": "0.49247545",
"text": "def action_compress\n # Check if the file to back up already exists\n if ::File.exists?(current_resource.name)\n\n # If the backup file exists, calculate its age\n if ::File.exists?(current_resource.backup_file)\n backup_file_age_hours = (Time.now -\n ::File.mtime(current_resource.backup_file))/60/60\n end\n\n # If the backup file is over 24 hours old (which also means \n # that it exists)\n if !::File.exists?(current_resource.backup_file) ||\n backup_file_age_hours > 24\n\n # Check if the number of backups we want to keep is > 0\n # before trying to rotate\n if @current_resource.num_backups < 0\n # Wrap changing logic in converge_by so it works in why-run mode\n converge_by(\"Rotate backup files \"+\n \"(retaining maximum #{@current_resource.num_backups})\") do\n # Rotate existing backup files\n (@current_resource.num_backups - 1).downto(1).each do |f|\n if ::File.exists?(\"#{current_resource.backup_file}-#{f}\")\n ::FileUtils.mv(\"#{current_resource.backup_file}-#{f}\",\n \"#{current_resource.backup_file}-#{f+1}\")\n end\n if ::File.exists?(current_resource.backup_file)\n # Rotate current backup file\n ::FileUtils.mv(current_resource.backup_file,\n \"#{current_resource.backup_file}-1\")\n end\n end\n end\n end\n\n # Wrap changing logic in converge_by so it works in why-run mode\n converge_by(\"Create backup file #{ new_resource.backup_file }\") do\n # Compress the specified file with the specified name\n Chef::Log.info(\"Compressing #{new_resource.name}...\")\n Zlib::GzipWriter.open(new_resource.backup_file) do |gz|\n gz.write IO.binread(new_resource.name)\n end\n end\n\n # Indicate to Chef that we updated new_resource because we \n # changed the node\n new_resource.updated_by_last_action(true)\n else\n Chef::Log.warn(\"Backup file #{new_resource.backup_file} is only \" +\n \" #{backup_file_age_hours.round(2)} hours old.\n (Action will be skipped).\")\n end\n else\n Chef::Log.warn(\"Can't find #{new_resource.name} to back up. \" +\n \" (Action will be skipped).\")\n end\n end",
"title": ""
},
{
"docid": "384de93ffc2e0dc200c91f58d30fca82",
"score": "0.49207035",
"text": "def reformat(tifs, cfg)\n # do vis\n vis = File.basename(tifs['vis'], '.tif')\n command = \" #{cfg['awips_conversion']['vis_stretch']} #{vis}.tif #{vis}.stretched.tif\"\n puts(\"INFO: stretching #{command}\")\n shell_out!(command,clean_environment: true)\n command = \"gdalwarp #{cfg['awips_conversion']['warp_opts']} -te #{cfg['awips_conversion']['extents']} #{cfg['gdal']['co_opts']} -t_srs #{cfg['awips_conversion']['proj']} #{vis}.stretched.tif #{vis}.302.tif\"\n puts(\"INFO: warping to 302.. #{command}\")\n shell_out!(command,clean_environment: true)\n end",
"title": ""
},
{
"docid": "77bdce27794ee0b4631dd085a3fbc944",
"score": "0.491949",
"text": "def hook_add_files\n @flavor.class.before_add_files do |files, resource_action|\n if :create == resource_action && fail_on_clobber\n files.each do |file|\n if File.exist?(destination_path(file))\n fail \"tried to overwrite file #{file}; pass '-a clobber' to override\"\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b76c95cac98b6eefc31df8ad1a52c70a",
"score": "0.4918433",
"text": "def post_process\n bind_files\n make_tasks\n end",
"title": ""
},
{
"docid": "91352a9b02e22ca3161d6947c76edd38",
"score": "0.49181676",
"text": "def post_perform!\n return unless perform_hooks?\n unless hooks.post_hooks.any?\n GitPusshuTen::Log.message \"No post deploy hooks to perform.\"\n return\n end\n \n ##\n # Connect to the remote environment and perform the post deploy hooks\n hooks.render_commands(hooks.post_hooks).each do |name, commands|\n adjusted_name = name.sub(/^\\d+\\)\\s/, '')\n \n GitPusshuTen::Log.message(\"Performing post deploy hook: #{y(adjusted_name)}\")\n standard environment.execute_as_user(\"cd '#{e.app_dir}'; #{commands}\")\n end\n end",
"title": ""
},
{
"docid": "23d73307a7a5af50e1dd71e4d4c61cca",
"score": "0.49173066",
"text": "def before_perform\n @outdir = job.job_dir.to_s\n @basename = File.join(job.job_dir, job.jobid)\n @infile = @basename+\".in\" \n # still has to be generated\n @outfile = @basename+\".frags\"\n params_to_file(@infile, 'sequence_input', 'sequence_file')\n @informat = params['informat'] ? params['informat'] : 'fas'\n @predict_ta = params['ta']\n reformat(@informat, \"fas\", @infile)\n @commands = []\n \n \n end",
"title": ""
}
] |
efca4a8a367b48063d1e4574f9e26ff7
|
This breaks the rails MVC pattern, but the functionality needed trumps blind adherance to the pattern, IMHO Hans for CTMRoles
|
[
{
"docid": "7cb6fc5a620a061b002ba590496ab243",
"score": "0.0",
"text": "def expose_session_to_models\n $_SESSION = session\n end",
"title": ""
}
] |
[
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6831048",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6831048",
"text": "def role; end",
"title": ""
},
{
"docid": "d15d02899f81226e726dd6e078127243",
"score": "0.6357284",
"text": "def setup_role \n if self.role_ids.empty? \n self.role_ids = [Role.find_by_name(\"User\").id] \n end\n end",
"title": ""
},
{
"docid": "c5082c70f8021273efb18658ff80786f",
"score": "0.6310732",
"text": "def manage_roles\n @user = User.first\n @organization = Organization.first\n end",
"title": ""
},
{
"docid": "f0b0a27613f3621170abbb414b9ca5d5",
"score": "0.6307408",
"text": "def set_possible_roles\n\tif User.has_role Role.ADMINISTRATOR,session[:roles]\n\t @roles=Role.all\n\t return\n\tend\n\n\t@logged_in_user_role_id = UserRoleMap.getRoleidByUserid(session[:session_user])\n\t#@roles = Role.where(:id => RoleReportTo.select(\"user_role_id\").where(:manager_role_id => @logged_in_user_role_id))\n\t@roles = Role.getRolesByRoleid(RoleReportTo.getUserRoleidByManagerRoleid(@logged_in_user_role_id))\n\thas_volunteer=false\n\[email protected] do |role|\n\t if role.role == Role.VOLUNTEER\n\t\thas_volunteer=true\n\t\tbreak\n\t end\n\tend\n\tunless has_volunteer\n\t @volunteer_role=Role.where(role:Role.VOLUNTEER)\n\t @volunteer_role.each do |role|\n\t\[email protected] role\n\t end\n\tend\n end",
"title": ""
},
{
"docid": "fd4a5e78d7a8fdcf0901ea8c76ea39d2",
"score": "0.6270151",
"text": "def setup_role\n if self.role_ids.empty?\n self.role_ids = self.roles.find_by_name(:registered).id\n end\n end",
"title": ""
},
{
"docid": "4cc3d9aee4dd761aa1b8d0824ec455f2",
"score": "0.6252313",
"text": "def index\n authorize Role\n @roles = Role.all\n end",
"title": ""
},
{
"docid": "4cb4f765475ff633c90761f26d1d2f57",
"score": "0.62517875",
"text": "def check_user_role \t \n redirect_to root_path unless current_user.roles.first.name == \"empleado\" or current_user.roles.first.name == \"supervisor\"or current_user.roles.first.name == \"admin\" \n end",
"title": ""
},
{
"docid": "a457b7e8cf41de659a38ad1ad44de094",
"score": "0.624623",
"text": "def saml_roles\r\n SAMLRolesController.instance\r\n end",
"title": ""
},
{
"docid": "3518ace6388c9da7f9c62cc64bc4f981",
"score": "0.6233862",
"text": "def display_all_roles\n # Interface method\n end",
"title": ""
},
{
"docid": "556599eb5a32bfc2da6dc2091c95866c",
"score": "0.6226103",
"text": "def get_role\n\t\tself.role\n\tend",
"title": ""
},
{
"docid": "bafc9e3fb1b47db64ad2624342f46fdf",
"score": "0.62178904",
"text": "def check_for_role\n self.role = ROLES[:user] if self.role.nil?\n end",
"title": ""
},
{
"docid": "8aaf1a6319ed2d78a4e06398cc94d197",
"score": "0.6216352",
"text": "def roles\n roles_from_users\n end",
"title": ""
},
{
"docid": "06af4170614bf6fe45cdac15fdd8a71a",
"score": "0.62133104",
"text": "def role_cls\n User\n end",
"title": ""
},
{
"docid": "8a4aa736fafbf8bb5c2183531c8bd115",
"score": "0.62097394",
"text": "def authorized_for_roles(*args)\n # From: http://stackoverflow.com/a/6076035/999973\n # args.any? { |role_name| ROLES.include? role_name }\n # ROLES = %w[admin moderator editor author banned] in user model\n # calling it:\n # before_filter(only: [:edit, :update, :destroy]) {|c| c.authorized_for_roles \"admin\", \"editor\"}\n \n # args.any? { |role_name| current_user.role == role_name }\n \n\n unless signed_in?\n self.current_user = User.create( name: \"Guest\" )\n redirect_to(root_path) unless args.any? { |role_name| current_user.role == role_name }\n self.current_user = nil\n return\n end\n\n redirect_to(root_path) unless args.any? { |role_name| current_user.role == role_name }\n end",
"title": ""
},
{
"docid": "f4c8cd4de1d1ea6a44f1778f7cd8d9a3",
"score": "0.6185568",
"text": "def check_for_role\n\t\tself.role = ROLES[:user] if !self.role.present?\n\tend",
"title": ""
},
{
"docid": "40ed66b2bb0f1a560419d149940d9006",
"score": "0.6182439",
"text": "def rails_role_user\n current_user\n end",
"title": ""
},
{
"docid": "b25bd77e878aa963279ab38c2e58b74f",
"score": "0.6176019",
"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.6176019",
"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": "a6825fe4f1a45c73725e61996ba6b3b4",
"score": "0.615283",
"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": "ab547d924c09f0afe3165b8eed3f247c",
"score": "0.6147803",
"text": "def makec\n @user.add_role :celebrity\n render nothing: true\n end",
"title": ""
},
{
"docid": "10b6a0fb5679cb381197f96e2510dc7f",
"score": "0.61439836",
"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": "370fde0604877e6655a4f71f10afa346",
"score": "0.61053884",
"text": "def user_role\n current_user.role if current_user\n end",
"title": ""
},
{
"docid": "ac635704093b2370dcea8d2aadca34fd",
"score": "0.61038095",
"text": "def set_and_authorize_role!\n @role = Role.find(params[:id])\n role.from_roles_controller = true\n authorize_role_action!\n end",
"title": ""
},
{
"docid": "df775565f32ac445be6213e0ef5005ff",
"score": "0.6098596",
"text": "def role_select\n @@Roles.list\n end",
"title": ""
},
{
"docid": "bf4858e6a610ee1565b6e994076b21c4",
"score": "0.60983807",
"text": "def display_roles\n \n @active_roles = Role.find_all_active\n \n render(:layout => false)\n \n end",
"title": ""
},
{
"docid": "9bf9d65a99fdea161c71f8e6f8c81026",
"score": "0.6094186",
"text": "def setup_role\n \tif self.role_ids.empty?\n \t self.role_ids = [3]\n \tend\n end",
"title": ""
},
{
"docid": "f38eb9fad80966d7f945afadcbdb88d0",
"score": "0.60798347",
"text": "def update_roles\r\n self.roles.create(:title => \"admin\")\r\n if self.name.eql? \"Grandor Eldoran\"\r\n self.roles.create(:title => \"admin\")\r\n elsif self.name.eql? \"Test2 Test2\"\r\n self.roles.create(:title => \"member\")\r\n end\r\n end",
"title": ""
},
{
"docid": "5a2d856e2b13653ea32ef5afeb441c95",
"score": "0.6074706",
"text": "def index\n @roles = System::Role.all\n end",
"title": ""
},
{
"docid": "2bff49e9d7953167da1e02fb06a33551",
"score": "0.60724634",
"text": "def roles\n self.class.roles.map do |name|\n __send__(name)\n end\n end",
"title": ""
},
{
"docid": "94d2b97bbcb50290f1819b85f30ba0d9",
"score": "0.607034",
"text": "def filter_access!\n treat_as get_current_role\n end",
"title": ""
},
{
"docid": "61ac68b2f9a2d0410abd44e995d718b1",
"score": "0.6061462",
"text": "def update\n @user = User.find(params[:user_id])\n @roles = Role.all\n \n if current_user.is_admin?\n @user.roles.clear\n @roles.each do |role|\n if (params[:role][:role][role.rolename][:hasrole].to_s == 1.to_s)\n @user.roles << role\n end\n end\n else\n @roles.each do |role|\n if !role.admin_only\n if @user.has_role?(role.rolename)\n @user.roles.destroy(role)\n end\n if (params[:role][:role][role.rolename][:hasrole].to_s == 1.to_s)\n @user.roles << role\n end\n end\n end\n end\n \n flash[:notice] = I18n.t(\"user.success.roles_updated\")\n reload_page\n \n end",
"title": ""
},
{
"docid": "4ce26e1797071baacf442be91ad13e72",
"score": "0.6049112",
"text": "def role_hierarchy\n [:visitor, :data_entry, :editor, :admin]\n end",
"title": ""
},
{
"docid": "6013ec382db242d2db8dcff27307d419",
"score": "0.60481554",
"text": "def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end",
"title": ""
},
{
"docid": "6013ec382db242d2db8dcff27307d419",
"score": "0.60481554",
"text": "def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end",
"title": ""
},
{
"docid": "6013ec382db242d2db8dcff27307d419",
"score": "0.60481554",
"text": "def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end",
"title": ""
},
{
"docid": "ac3f7a4bb75bae95d863421f7ae2322f",
"score": "0.60444915",
"text": "def role\n admin ? \"admin\" : \"user\"\n end",
"title": ""
},
{
"docid": "4958d31246717e2af8ec7448938d7a4e",
"score": "0.6039735",
"text": "def roles\n self.dig_for_array(\"roles\")\n end",
"title": ""
},
{
"docid": "f0dbfd7875a4fcbb6c2ada345139a81f",
"score": "0.60394084",
"text": "def protect_main_roles\n return unless (1..3).cover?(id)\n errors.add(:base, :role_is_built_in)\n throw :abort\n end",
"title": ""
},
{
"docid": "cf8fc481cbc239692daf3ad0f2737f0a",
"score": "0.6036453",
"text": "def role_object\n (APP_CONFIG[\"user_roles\"]+SYSTEM_DATA[\"user_roles\"]).select{|role| role[\"name\"] == self.role}.first\n end",
"title": ""
},
{
"docid": "b52d898f6cadb8141d08990eaf506924",
"score": "0.6031962",
"text": "def my_roles\n @my_roles ||= self.roles.map {|r| r.name}.flatten.freeze\n end",
"title": ""
},
{
"docid": "61d2f903655223749964ed03d5a028f1",
"score": "0.60302585",
"text": "def check_role\n redirect_to(root_url) unless check_role?(\"News Editor\") or check_role?(\"Site Admin\")\n end",
"title": ""
},
{
"docid": "61d2f903655223749964ed03d5a028f1",
"score": "0.60302585",
"text": "def check_role\n redirect_to(root_url) unless check_role?(\"News Editor\") or check_role?(\"Site Admin\")\n end",
"title": ""
},
{
"docid": "8e783b6545c662f8f18d1a9777fc4f23",
"score": "0.6029571",
"text": "def check_roles\n if current_user.roles.include?(Role['owner'])\n return true\n elsif request.format.symbol == :json && params[:action] == 'index'\n return true\n end\n\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "4235cb71db1571ec4045b1c5f635c1f5",
"score": "0.60246915",
"text": "def index\n return unless check_permission\n\n @roles = Role.left_joins(:user)\n end",
"title": ""
},
{
"docid": "9b8536c3acbcebad74079162589d0644",
"score": "0.6022371",
"text": "def claims\n get_all_roles\n end",
"title": ""
},
{
"docid": "9b8536c3acbcebad74079162589d0644",
"score": "0.6022371",
"text": "def claims\n get_all_roles\n end",
"title": ""
},
{
"docid": "f1acc117c4123ac2090228edaf2d60bc",
"score": "0.6013092",
"text": "def roles\n roles_as_editor + roles_as_reviewer + role_as_admin\n end",
"title": ""
},
{
"docid": "ef92e22f016d23bcd079f281556ec92d",
"score": "0.6007567",
"text": "def set_roles\n roles << Role.user unless has_role?(\"user\")\n as_seller! if @registration_as_seller.to_i == 1\n end",
"title": ""
},
{
"docid": "d921a7ba6a79f59862b1ac6e393e07c5",
"score": "0.5967707",
"text": "def check_for_role\n\t\tself.role = ROLES[:user] if self.role.nil?\n\tend",
"title": ""
},
{
"docid": "a3e350596a775b83b94ad08764d2d24f",
"score": "0.5967162",
"text": "def setup_role\n if self.role_ids.empty?\n self.role_ids = [2]\n end\n end",
"title": ""
},
{
"docid": "110d8a8205bcc3da42e01185c86e7be1",
"score": "0.5957762",
"text": "def downcase_role\n self.role.downcase\n end",
"title": ""
},
{
"docid": "64e93918a795dc52f0c3aea70e2385b7",
"score": "0.5953884",
"text": "def role_for(model, id)\n lookup_role(model.find_by_id(id))\n end",
"title": ""
},
{
"docid": "0faa6f4113bbfe5d0ea7dbfcff794ad1",
"score": "0.5948588",
"text": "def role?(role_name)\n role == role_name\n \n end",
"title": ""
},
{
"docid": "31a19152790e3ac610f916fdc6bf0a5e",
"score": "0.5942024",
"text": "def setup_role\n #get_statuses(@role)\n #set_default_status(@role)\n end",
"title": ""
},
{
"docid": "9be2f24cccf65f66f0a8821e390421db",
"score": "0.5939884",
"text": "def reverse_roles\n if @organization.reverse_roles\n flash[:notice] = 'The CEO and Contact Point roles were reversed.'\n else\n flash[:error] = @organization.errors.full_messages.to_sentence\n end\n redirect_to admin_organization_path(@organization.id)\n end",
"title": ""
},
{
"docid": "95bb74710f630c43ad44e87a3b6e3ab0",
"score": "0.5937323",
"text": "def display_role\n ROLE_LIST[self.role]\n end",
"title": ""
},
{
"docid": "b8cbd693f35a33ffc83e3dcd9acb7f29",
"score": "0.5933072",
"text": "def index\n #you dont want to set the permissions for Super Admin.\n @roles = Role.all.keep_if{|i| i.name != \"Super Admin\"}\n end",
"title": ""
},
{
"docid": "bcd9bf73237f21cad1b43e7b65e5f70b",
"score": "0.5930188",
"text": "def role\n @role ||=\n if is_admin?\n :admin\n else\n :customer\n end\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.5926874",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "85b4820d4e5affcf6b535ae6ce2c7fe1",
"score": "0.59229654",
"text": "def secondary_roles\n user.secondary_role\n end",
"title": ""
},
{
"docid": "94b56b74507719cbb689b80053e45899",
"score": "0.5920542",
"text": "def roles\r\n @roles ||= user_roles.map(&:name)\r\n end",
"title": ""
},
{
"docid": "9ef143a91857c45dc4c7ae70f3a28760",
"score": "0.591444",
"text": "def edit_roles\n if (@user = find_user(params[:id]))\n begin\n User.transaction(@user) do\n \n roles = params[:user][:roles].collect { |role_id| Role.find(role_id) }\n # add any new roles & remove any missing roles\n roles.each { |role| @user.roles << role if [email protected]?(role) }\n @user.roles.each { |role| @user.roles.delete(role) if !roles.include?(role) }\n\n @user.save\n flash[:notice] = \"Roles updated for user '#{@user.login}'.\"\n end\n rescue\n flash[:warning] = 'Roles could not be edited at this time. Please retry.'\n ensure\n redirect_to :back\n end\n else\n redirect_back_or_default :action => 'list'\n end\n end",
"title": ""
},
{
"docid": "fd5f263a083f2930cdba140da923ef8c",
"score": "0.591312",
"text": "def role?(role)\n\t self.role.name == role\n end",
"title": ""
},
{
"docid": "3cea274ede96b9a2c9c06df2806d0cae",
"score": "0.5913111",
"text": "def resource_name\n\t\t\"role\"\n\tend",
"title": ""
},
{
"docid": "237cadd4a398cbe8df1187250244eeea",
"score": "0.5910861",
"text": "def role_str\n case name\n when ROLE_ADMIN then I18n.t(\"model.role.admin\") \n when ROLE_COMPANY then I18n.t(\"model.role.company\")\n when ROLE_ENGINEER then I18n.t(\"model.role.engineer\")\n when ROLE_NORMAL then I18n.t(\"model.role.normal\")\n end\n end",
"title": ""
},
{
"docid": "a5e71f226fae9933c0be1b09feffbd56",
"score": "0.5910053",
"text": "def role?\n false\n end",
"title": ""
},
{
"docid": "821e4e9ad63ae43ab00f40030eb127b5",
"score": "0.5898739",
"text": "def set_role\n return if role?\n\n self.role = 'regular'\n end",
"title": ""
},
{
"docid": "f9840f619682392dc61105d71a768b03",
"score": "0.58970904",
"text": "def index\n @cms_roles = Cms::Role.all\n end",
"title": ""
},
{
"docid": "f6762a3b61a65ef2f0cb63108cde77cf",
"score": "0.5893889",
"text": "def active_role\n Role.find(self.active_role_id)\n end",
"title": ""
},
{
"docid": "09790657372af0370303b32ed2e0c3bd",
"score": "0.5893093",
"text": "def check_role\n redirect_to root_path unless current_user && current_user.evo_team?\n end",
"title": ""
},
{
"docid": "3d4a39178fa2ffafc16787355b1ec53f",
"score": "0.5887119",
"text": "def static_roles?\n false\n end",
"title": ""
},
{
"docid": "a51b21b66ea7dcd500c80250cc5d2af5",
"score": "0.5879289",
"text": "def check_role!\n add_role :user if roles.blank?\n if has_role?(:admin)\n add_role :editor unless has_role?(:editor)\n add_role :user unless has_role?(:user)\n end\n end",
"title": ""
},
{
"docid": "f50bee6dcf6543d8981c275bf0f103d4",
"score": "0.587857",
"text": "def accessible_roles\n #@accessible_roles = Role.accessible_by(current_ability,:read)\n @accessible_roles = User::ROLES\n end",
"title": ""
},
{
"docid": "7e6064b306699297f8ea49e290e790e8",
"score": "0.5869088",
"text": "def role_for(cdmp)\n case cdmp.role\n when 'http://credit.niso.org/contributor-roles/data-curation'\n 'DataCurator'\n when 'http://credit.niso.org/contributor-roles/formal-analysis',\n 'http://credit.niso.org/contributor-roles/validation'\n 'Researcher'\n when 'http://credit.niso.org/contributor-roles/investigation'\n 'ProjectLeader'\n when 'http://credit.niso.org/contributor-roles/methodology'\n 'DataManager'\n when 'http://credit.niso.org/contributor-roles/project-administration'\n 'ProjectManager'\n when 'http://credit.niso.org/contributor-roles/software'\n 'Producer'\n when 'http://credit.niso.org/contributor-roles/supervision'\n 'Supervisor'\n when 'http://credit.niso.org/contributor-roles/writing-review-editing'\n 'Editor'\n else\n 'ProjectMember'\n end\n end",
"title": ""
},
{
"docid": "70aac043fc608cc94fa0f4e51e083a54",
"score": "0.5866694",
"text": "def index\n if current_user.rol == 1\n @roles = Role.order(:id)\n @role = Role.new\n else\n @mensaje = \"Seccion solo para administrador\"\n end\n end",
"title": ""
},
{
"docid": "8fb67d60dd4f590349c873b3e21263ed",
"score": "0.5865548",
"text": "def role_name\n object.role_name\n end",
"title": ""
},
{
"docid": "a7c7b0fa44d2213ea3fdeacc21326084",
"score": "0.5855284",
"text": "def create_roles\n Role.create_roles(self)\n end",
"title": ""
},
{
"docid": "015f99f49a45fd25973bc1d8857dc34d",
"score": "0.5854697",
"text": "def current_role\n \tcase current_user.role\n \twhen 1 \n \t\t@current_role='Empleado'\n \twhen 2 \n \t\t@current_role='Jefe Departamento'\n \twhen 3 \n \t\t@current_role='Auditor'\n \twhen 4 \n \t\t@current_role='Administrador'\n \tend\n end",
"title": ""
},
{
"docid": "79712797681cbe1ffdcad53d53143434",
"score": "0.5851237",
"text": "def accept_role role\n self.roles.push role\n end",
"title": ""
},
{
"docid": "f4491811c37dba30deb3cff2d1e661e3",
"score": "0.5849031",
"text": "def roles_with_permission\n shift.location.loc_group.roles\n end",
"title": ""
},
{
"docid": "5ccd9b986ee48e0d35c016999dd0bb2c",
"score": "0.584814",
"text": "def initialize_roles(user)\n case user.class.to_s\n when \"AdminUser\"\n admin_user_with_role(user)\n when \"HakaUser\"\n haka_user(user)\n when \"GuestUser\"\n guest_user(user)\n else\n raise \"Current user class could not be determined. This is a bug.\"\n end\n end",
"title": ""
},
{
"docid": "417c7c5908604e55e4e15c89b5e998e5",
"score": "0.5846552",
"text": "def toggle_role\n do_toggle_role params[:role]\n end",
"title": ""
},
{
"docid": "7b6ec768f8913a9b6aa0cc256701cda8",
"score": "0.5842874",
"text": "def index\n client_application_id = current_user.client_application_id.to_s\n @roles = Role.where(client_application_id: client_application_id)\n end",
"title": ""
},
{
"docid": "ee3e3b71463e54b9b94fa5f9df6c8140",
"score": "0.58422506",
"text": "def update\n @user = User.find(params[:user_id])\n @role = Role.find(params[:id])\n unless @user.has_role?(@role.name)\n @user.roles << @role\n end\n redirect_to :action => 'index'\n end",
"title": ""
},
{
"docid": "f01d80f577ae51600910cded12d567d3",
"score": "0.58416903",
"text": "def roles\n @roles = Role.order(\"name\")\n\t@rights = Right.order(\"name\").map {|r| [r.name, r.id] }\n end",
"title": ""
},
{
"docid": "a83712c75196aad255e5e2e27198ec6e",
"score": "0.5839812",
"text": "def checkrole\n if roles_mask == 4\n 'User'\n elsif roles_mask == 6\n 'Administrator'\n end\n end",
"title": ""
},
{
"docid": "bde19bf4ac6c92f1726028989959c5ef",
"score": "0.5834019",
"text": "def add_role\n person\n end",
"title": ""
},
{
"docid": "dafc0bf946b67e8b08a1d85d779bb4af",
"score": "0.5833057",
"text": "def update\n # this action is not provided for partyroles\n end",
"title": ""
},
{
"docid": "dbc200af48c8246bb180a57f5fcefd51",
"score": "0.58255625",
"text": "def test_has_role_and_unset\n new_session do |test|\n david = test.login :david\n test.controller 'object_roles' do\n test.cannot_access 'moderate_meeting'\n david.has_role 'moderator'\n test.cannot_access 'moderate_meeting'\n david.has_role 'moderator', Meeting\n david.has_no_role 'moderator', Meeting\n test.cannot_access 'moderate_meeting'\n\n test.cannot_access 'group_members'\n david.has_role 'site_admin'\n test.can_access 'group_members'\n david.has_no_role 'site_admin'\n test.cannot_access 'group_members'\n\n hacker = Role.find_by_name('hacker')\n Role.delete(hacker.id) if hacker\n assert Role.find_by_name('hacker').nil?\n david.has_role 'hacker'\n assert !Role.find_by_name('hacker').nil?\n david.has_role 'hacker'\n assert !Role.find_by_name('hacker').nil? # Removing a role for a user shouldn't delete the actual Role record\n end\n end\n end",
"title": ""
},
{
"docid": "26ca9d70ab743c59ec737e5b54b5e3fe",
"score": "0.58200485",
"text": "def user_role\n USER_ROLE[role]\n end",
"title": ""
},
{
"docid": "458a31a81739a214ae3e0253a13d6922",
"score": "0.5810052",
"text": "def index\n @movie_roles = @movie.roles\n end",
"title": ""
},
{
"docid": "d05f0c68c5d96ebc17dd1dfaf3233a14",
"score": "0.580669",
"text": "def setup_role\n if self.role_ids.empty?\n self.role_ids = [2]\n end\n end",
"title": ""
},
{
"docid": "f2d3fbac891d12c19f7dfcbbfecbf114",
"score": "0.5806624",
"text": "def has_role(r)\n self.role == r\n end",
"title": ""
},
{
"docid": "c426bc01df022b0e1523fb34a9530150",
"score": "0.5804455",
"text": "def set_roles_privilege\n @roles_privilege = RolesPrivilege.find(params[:id])\n end",
"title": ""
},
{
"docid": "184a4970f2d7062ff4a1fe28f4950fbe",
"score": "0.5804189",
"text": "def camaleon_spree_user_roles_hook(args)\n args[:roles_list][:manager] << { key: 'spree_role', label: t('plugins.spree_cama.admin.roles.label', default: 'Spree Ecommerce'), description: t('plugins.spree_cama.admin.roles.descr', default: 'Manage all sections of Spree Ecommerce')}\n end",
"title": ""
},
{
"docid": "36f4006b0cb247a57a65097878f9e612",
"score": "0.5802229",
"text": "def role?(role)\n self.role == role.to_s ? true : false\n end",
"title": ""
},
{
"docid": "865d03f9b1f50f46382393c256f117fe",
"score": "0.5802127",
"text": "def has_role?(role) \n return self.roles.include?(role)\n end",
"title": ""
},
{
"docid": "38b8500aff2b3af8156d2026b33047a9",
"score": "0.58013004",
"text": "def determine_user_role\n if logged_in? #Then you are a member and you have a role\n if @current_user.role == \"Administrator\"\n @admin_user = true\n @superadmin_user = false\n @member = false\n elsif @current_user.role == \"Super Administrator\"\n @superadmin_user = true\n @admin_user = false\n @member = false\n #You are a member\n else\n @admin_user = false\n @superadmin_user = false\n @member = true\n end\n #else you are not a member and do not have a role\n else\n @admin_user = false\n @superadmin_user = false\n @member = false\n end\n end",
"title": ""
},
{
"docid": "edaaf75a65a344ee338ecfd2fcb276e8",
"score": "0.5799889",
"text": "def role?(r)\n self.role == r.to_s\n end",
"title": ""
},
{
"docid": "697fcf778915720af4b416e8afb495ac",
"score": "0.579806",
"text": "def index\n @roles = @vendor.roles.vendor_only # TODO change to roles\n end",
"title": ""
}
] |
91058cb3e2ab2271ab979aeb1af54200
|
Convert an xml fragment to a hash.
|
[
{
"docid": "50cde67c990f1881e3682c0957b71dc5",
"score": "0.52362275",
"text": "def from_xml(xml)\n Hash::XML.from_xml(self, xml)\n end",
"title": ""
}
] |
[
{
"docid": "08f8d18a8f608916364352f5f8ca9df5",
"score": "0.6720629",
"text": "def to_hash\n Utils.xml_to_hash xml\n end",
"title": ""
},
{
"docid": "4628683133ef3d576ab2743c900dfc93",
"score": "0.66989696",
"text": "def generate_xmlhash\n self.xmlhash = Digest::SHA256.hexdigest(self.xml)\n end",
"title": ""
},
{
"docid": "6517dd5951df114421db004a888127a0",
"score": "0.66400236",
"text": "def to_hash\n XML.to_hash xml\n end",
"title": ""
},
{
"docid": "79854bdeca677188f73f5750f179e00b",
"score": "0.6561261",
"text": "def to_hash\n Hash.from_xml(xml)\n end",
"title": ""
},
{
"docid": "6c4f99f8d3540f6ab37d50f0defca48d",
"score": "0.65538406",
"text": "def xml_to_hash(xml_string)\n dom = Nokogiri.XML(xml_string)\n hash = dom.root.element_children.each_with_object(Hash.new) do |e, h|\n h[e.name.to_sym] = e.content\n end\n\n return hash\nend",
"title": ""
},
{
"docid": "7d251f43df47997f706bbd5799509122",
"score": "0.64790744",
"text": "def xml_to_hash xml_text\n doc = SaxDocument.new\n Nokogiri::XML::SAX::Parser.new(doc).parse(xml_text)\n return doc.record\n end",
"title": ""
},
{
"docid": "44dafd2270856a58a015b956d04722d5",
"score": "0.64267653",
"text": "def hash\n fragments.hash\n end",
"title": ""
},
{
"docid": "6bd22eda8f4a41a667d7eafa92216ee3",
"score": "0.6391485",
"text": "def hash\n @hash ||= nori.parse(to_xml)\n end",
"title": ""
},
{
"docid": "045a2355209b735fcaf58e18f67412e3",
"score": "0.63518125",
"text": "def get_hash_for_file file\n contents = File.read file\n # The XML we recieve is not UTF-8 but latin-1\n # If we don't convert everything will be fine until we need non ascii\n # characters (like umlauts/french acutes etc)\n contents.encode! \"UTF-8\", \"ISO-8859-1\"\n contents.force_encoding \"UTF-8\"\n Digest::MD5.hexdigest contents\n end",
"title": ""
},
{
"docid": "ae5b4c3143069791e50b69e492bb7277",
"score": "0.6330548",
"text": "def xml_to_hash(xml)\n hash = Hash.from_xml(xml)\n convert_hex(hash, [\"DeviceMacId\", \"MeterMacId\"])\n hash\n end",
"title": ""
},
{
"docid": "e6a52fb6d69095010506c15661429070",
"score": "0.632466",
"text": "def xml2hash(xml)\n return XmlSimple.xml_in(xml, { 'KeyAttr' => 'name' })\nend",
"title": ""
},
{
"docid": "df7ae2115219af0d2fb0b675f4b441e7",
"score": "0.6275751",
"text": "def extract_hash(node); end",
"title": ""
},
{
"docid": "ab8aa217f292afb155575fb5af55e203",
"score": "0.6212175",
"text": "def hash(data)\n xml_data = xml(data)\n xml_to_hash xml_data\n end",
"title": ""
},
{
"docid": "1a6d917bd101ad8d176b4f1bda05c8a8",
"score": "0.60855746",
"text": "def hashify(raw)\n Hash.from_xml(raw)[\"Envelope\"][\"Cube\"][\"Cube\"]\n end",
"title": ""
},
{
"docid": "0f5a37fcd4fb596be59d2aaba014a030",
"score": "0.60795045",
"text": "def hash_xml(xml, params)\n params.each do |key, value|\n xml = xml_key_value(key, value, xml)\n end\n xml\n end",
"title": ""
},
{
"docid": "0f5a37fcd4fb596be59d2aaba014a030",
"score": "0.60795045",
"text": "def hash_xml(xml, params)\n params.each do |key, value|\n xml = xml_key_value(key, value, xml)\n end\n xml\n end",
"title": ""
},
{
"docid": "9f007b4439daff9bfaa029a77219389c",
"score": "0.6030907",
"text": "def get_xml_to_hash(url)\n require 'activesupport'\n doc = Nokogiri::XML get(url)\n obj = Object.new.extend(ActiveSupport::CoreExtensions::Hash::Conversions::ClassMethods)\n obj.from_xml doc.to_xml\n # (Hash.from_xml(doc.search('//rubygem').to_xml) || {})['rubygem']\n end",
"title": ""
},
{
"docid": "e2f4eb3a6ee3b5f178583eef7b6680b5",
"score": "0.5932492",
"text": "def xml_hash(xml)\n nori = Nori.new(strip_namespaces: true, :convert_tags_to => lambda { |tag| tag.snakecase.to_sym })\n nori.parse(xml)\n end",
"title": ""
},
{
"docid": "f7269f23e39ceca05e1edaeffc97b2c7",
"score": "0.56868297",
"text": "def xml_node_to_hash(node) # :doc:\n # If we are at the root of the document, start the hash\n if node.element?\n result_hash = {}\n if node.attributes != {}\n result_hash[:attributes] = {}\n node.attributes.keys.each do |key|\n result_hash[:attributes][node.attributes[key].name.to_sym] = prepare(node.attributes[key].value)\n end\n end\n if node.children.size > 0\n node.children.each do |child|\n result = xml_node_to_hash(child)\n\n if child.name == \"text\"\n unless child.next_sibling || child.previous_sibling\n return prepare(result)\n end\n elsif result_hash[child.name.to_sym]\n if result_hash[child.name.to_sym].is_a?(Array)\n result_hash[child.name.to_sym] << prepare(result)\n else\n result_hash[child.name.to_sym] = [result_hash[child.name.to_sym]] << prepare(result)\n end\n else\n result_hash[child.name.to_sym] = prepare(result)\n end\n end\n\n return result_hash\n else\n return result_hash\n end\n else\n return prepare(node.content.to_s)\n end\n end",
"title": ""
},
{
"docid": "6d7ef8cd884e3116c75781c6470bd89c",
"score": "0.5668744",
"text": "def unpack_hexdigest(hex); end",
"title": ""
},
{
"docid": "6d7ef8cd884e3116c75781c6470bd89c",
"score": "0.5668744",
"text": "def unpack_hexdigest(hex); end",
"title": ""
},
{
"docid": "42cb2a7301737c7e93c0944d136175e0",
"score": "0.56420225",
"text": "def uri_hash(uri)\n Digest::MD5.hexdigest(uri)\n end",
"title": ""
},
{
"docid": "d202ccc8c80b899d084f649e322b70c2",
"score": "0.5641332",
"text": "def hashed_url_from_fragment(url)\n url_host(url) + strip_slashes(fragment_string + normalized_url_fragment(url))\n end",
"title": ""
},
{
"docid": "2c0e721904a9eca9efc6f51a0660b092",
"score": "0.56160295",
"text": "def hashURI(uri)\n data = uri.clone\n offset = data.length < 10 ? data.length : 10\n data.insert(offset, @salt)\n hash = Digest::MD5.digest(data)\n hash = Base64.strict_encode64(hash[2..7])\n hash.gsub!(\n /[=+\\/]/,\n {\"=\" => \".\", \"+\" => \"-\", \"/\" => \"_\"},\n )\n return hash\n end",
"title": ""
},
{
"docid": "5542567904e15d03ec3231832c55c640",
"score": "0.5606697",
"text": "def to_hash\n return @hash if @hash\n @hash = parser.parse(data.to_s.gsub(/\\<!\\[CDATA\\[([^\\]]+)\\]\\]\\>/) {$1})\n end",
"title": ""
},
{
"docid": "34c10d1f1b73ebaa51c390d4d25a5794",
"score": "0.55948204",
"text": "def visit_hash(node); end",
"title": ""
},
{
"docid": "dab4a22f49c995b44f2e3a3dd480299b",
"score": "0.5557122",
"text": "def hexdigest; end",
"title": ""
},
{
"docid": "dab4a22f49c995b44f2e3a3dd480299b",
"score": "0.5557122",
"text": "def hexdigest; end",
"title": ""
},
{
"docid": "361b4a8b680dae2d0cf8b9b2940bbfae",
"score": "0.5547938",
"text": "def hash expr, algo = nil\n Expression.new(\"UNHEX(SHA1(#{expr}))\", MM::DataType::TYPE_Binary, expr.is_mandatory)\n end",
"title": ""
},
{
"docid": "ddbb94ceb684a6c63493caf8ac224366",
"score": "0.55043125",
"text": "def hash\n parts.to_s.hash\n end",
"title": ""
},
{
"docid": "87e39fdd0853387f8c02d1310f2da918",
"score": "0.5492924",
"text": "def sha1_hash\n @sha1_hash ||= Digest::SHA1.hexdigest content\n end",
"title": ""
},
{
"docid": "53b66f31eb1b0c8fca11a9ef4cde2899",
"score": "0.5473032",
"text": "def hash expr, algo = 'SHA1'\n Expression.new(\"CONVERT(BINARY(32), HASHBYTES('#{algo}', #{expr}), 2)\", MM::DataType::TYPE_Binary, expr.is_mandatory)\n end",
"title": ""
},
{
"docid": "e2f2711249a5ceb86194cd4967c17b7e",
"score": "0.54576355",
"text": "def hexdigest\n process\n @digest.unpack('H*'.freeze).first\n end",
"title": ""
},
{
"docid": "a696cf307b9c6d3df98fedddd0dd31da",
"score": "0.545126",
"text": "def hashed_url_from_fragment(url)\n url_host(url) + ('/#/' + (encode_and_parse_url(url).fragment || '')).gsub(/\\/\\//, '/')\n end",
"title": ""
},
{
"docid": "b57595534585581dcad80e28672bbf0f",
"score": "0.54454505",
"text": "def hash\n @digest.hexdigest\n end",
"title": ""
},
{
"docid": "5a74d61936f68456f217bd3e4159527c",
"score": "0.54386806",
"text": "def hash(str)\n bytes = str.chars.map(&:ord) + TAIL\n @position = 0\n @skip_size = 0\n TWIST_COUNT.times { twist(*bytes) }\n dense_hash = compress(@elements)\n hex(dense_hash)\n end",
"title": ""
},
{
"docid": "3849f75d307fb7736c12579c506306d2",
"score": "0.5436526",
"text": "def hashes\n root.value[2].value.map do |element|\n index = element.value[0].value\n hash = element.value[1].value.unpack(\"H*\").first\n [index, hash]\n end\n end",
"title": ""
},
{
"docid": "3d7d0f168145504c9b097e959feb6872",
"score": "0.54361194",
"text": "def hash\n node.hashCode\n end",
"title": ""
},
{
"docid": "255414fb17387c6ccc21bd83e3982783",
"score": "0.5428091",
"text": "def hexdigest_of(content)\n logger.debug(\"generating hexdigest for `#{content.inspect}`\")\n digest << content\n hash = digest.hexdigest\n digest.reset\n hash\n end",
"title": ""
},
{
"docid": "f0e59d8256b0f70c107d0663badcc883",
"score": "0.54267937",
"text": "def content_hash\n @content_hash ||= DIGEST.hexdigest content_normalized\n end",
"title": ""
},
{
"docid": "f0e59d8256b0f70c107d0663badcc883",
"score": "0.54267937",
"text": "def content_hash\n @content_hash ||= DIGEST.hexdigest content_normalized\n end",
"title": ""
},
{
"docid": "c07d5de54b02afd022aba0e24a51237c",
"score": "0.5417443",
"text": "def to_hash\n\t\t\treturn @result unless @result.nil?\n\t\t\troot = @doc.at(@path)\n\t\t\t@result = {}\n\t\t\tparse_node(root, @result)\n\t\t\treturn @result\n\t\tend",
"title": ""
},
{
"docid": "ffa7f835756a1d8b253d29949a30ab8b",
"score": "0.5414559",
"text": "def to_hash\n @hash ||= (Crack::XML.parse(body) rescue {}).find_soap_body\n end",
"title": ""
},
{
"docid": "e73bd9ee1cfc44e95895beb2bf7dc7d1",
"score": "0.5386987",
"text": "def hash_uri(uri)\n data = String.new\n data << uri\n offset = data.length < 10 ? data.length : 10\n data.insert(offset, @salt)\n hash = Digest::MD5.digest(data)\n hash = Base64.strict_encode64(hash[2..7])\n hash.gsub('=', '.').gsub('+', '-').gsub('/', '_')\n end",
"title": ""
},
{
"docid": "7f073c95cca933e78447e4abebc33346",
"score": "0.536727",
"text": "def unmarshal(content)\n Hash.from_xml(content)\n end",
"title": ""
},
{
"docid": "1e099e8a72e51c05b1d06d41ad7bec36",
"score": "0.53639424",
"text": "def xml_to_hash(xml)\n h = {}\n if attrs = self.class.xmlattrs\n attrs.inject(h) do |hash, attr|\n hash[attr.name] = attr.parse(xml)\n hash\n end\n end\n h\n end",
"title": ""
},
{
"docid": "a4087e2c7a6831614a40c4ce2877d0bd",
"score": "0.5357813",
"text": "def hexdigest(data); end",
"title": ""
},
{
"docid": "99188b8470caa41d932ee03b72e098e5",
"score": "0.53560233",
"text": "def pack_hexdigest(bin); end",
"title": ""
},
{
"docid": "99188b8470caa41d932ee03b72e098e5",
"score": "0.53560233",
"text": "def pack_hexdigest(bin); end",
"title": ""
},
{
"docid": "8a56140892349f04fb716e9234b9bcde",
"score": "0.53512746",
"text": "def hash(input_str)\n hash = DEFAULT_HASH_VALUE\n input_str.split(//).each do |c|\n hash = ((hash << 5) + hash) + c.ord # hash * 33 + c:\n end\n return hash\n end",
"title": ""
},
{
"docid": "c96c2c9d8b1914034ed9191c600ebffb",
"score": "0.53503025",
"text": "def hash\n href.hash\n end",
"title": ""
},
{
"docid": "aeb4c0d7b4d128264b0db03e38552bc4",
"score": "0.53493834",
"text": "def hash\n binary_components.hash\n end",
"title": ""
},
{
"docid": "45df3f6706efcc9db0e0e730bf441964",
"score": "0.53381675",
"text": "def block_hash\n data = Utils::DataWriter.new\n serialize_header data\n hash1 = Digest::SHA256.digest(data.io.string)\n hash2 = Digest::SHA256.hexdigest(hash1)\n Utils.reverse_hex_string(hash2)\n end",
"title": ""
},
{
"docid": "8a12e998720d493bacf70b3981cb1e68",
"score": "0.53292227",
"text": "def calc_hash(line)\n string_hash = 0\n\n # convert each character to its UTF-8 value\n line.each_char do |x|\n string_hash += @stored_chars[x]\n end\n\n string_hash = string_hash % 65_536 # mod the string_hash for the final hash value\n string_hash.to_s(16) # convert line hash value to hex\n end",
"title": ""
},
{
"docid": "91a0733cb8e1da951ffbc9de45487188",
"score": "0.53201777",
"text": "def actual_hash(element)\n # initialize element hash with element name\n elementHash = '-' + element.name\n\n # add element attributes to the hash\n element.attributes.each { |a| elementHash += \":\" + a[0] + \"=\" + a[1] }\n\n # add element inner text to the hash\n elementHash += ':inner_text='\n\n # append the text if any is specified\n if element.text != nil\n elementHash += element.text.strip\n end\n\n # if the element has children, append an indicator\n if element.elements.size > 0\n elementHash += '>'\n end\n\n # iterate through child elements\n element.elements.each do |childElement|\n # calculate and appent the child element hash\n elementHash += actual_hash(childElement)\n end\n\n # return final actual hash value\n elementHash\n end",
"title": ""
},
{
"docid": "607b692bca1de1b9d6f93ca4054056fd",
"score": "0.5313143",
"text": "def hash(str)\n h = Digest::MD5.new\n h.update(str)\n h.hexdigest\n end",
"title": ""
},
{
"docid": "eaf6fa4a20a500b9975e64c27c67f6b1",
"score": "0.53118163",
"text": "def hash\n digest.hash\n end",
"title": ""
},
{
"docid": "41c365a18c4ad69658495a02ed7ccbc3",
"score": "0.5310637",
"text": "def xml_to_hash(xml)\n h = {}\n if attrs = self.class.attributes\n attrs.inject(h) do |hash, attr|\n hash[attr.name] = attr.parse(xml)\n hash\n end\n end\n h\n end",
"title": ""
},
{
"docid": "9320e2bf515ad1731927fca9e8e99ed9",
"score": "0.53090346",
"text": "def digest_value(xml)\n canonical = xml.canonicalize(Nokogiri::XML::XML_C14N_EXCLUSIVE_1_0)\n digest = OpenSSL::Digest::SHA256.new.digest canonical\n Base64.encode64(digest)\n end",
"title": ""
},
{
"docid": "06146b3517e15df4629105410dad491c",
"score": "0.5308196",
"text": "def hexdigest(*) end",
"title": ""
},
{
"docid": "06146b3517e15df4629105410dad491c",
"score": "0.5308196",
"text": "def hexdigest(*) end",
"title": ""
},
{
"docid": "06146b3517e15df4629105410dad491c",
"score": "0.5308196",
"text": "def hexdigest(*) end",
"title": ""
},
{
"docid": "66e7ebdc345bf94c9569cd44ad395546",
"score": "0.53022385",
"text": "def hash expr, algo = 'sha1'\n Expression.new(\"digest(#{expr}, '#{algo}')\", MM::DataType::TYPE_Binary, expr.is_mandatory, expr.is_array)\n end",
"title": ""
},
{
"docid": "8f5866b0e324916aa7aabcdc2b800e35",
"score": "0.52605623",
"text": "def make_hash text\n Digest::MD5.hexdigest text\n end",
"title": ""
},
{
"docid": "db47927e8c15584db7b5afbfd4e7d98f",
"score": "0.5255609",
"text": "def to_hash(hash={})\r\n if text?\r\n raise LibXML::XML::Error if content.length >= LIB_XML_LIMIT\r\n hash[CONTENT_ROOT] = content\r\n else\r\n sub_hash = insert_name_into_hash(hash, name)\r\n attributes_to_hash(sub_hash)\r\n if array?\r\n children_array_to_hash(sub_hash)\r\n elsif yaml?\r\n children_yaml_to_hash(sub_hash)\r\n else\r\n children_to_hash(sub_hash)\r\n end\r\n end\r\n hash\r\n end",
"title": ""
},
{
"docid": "f7931b0aaacc1d9663397dcaecc9f45f",
"score": "0.52539957",
"text": "def hexdigest\r\n\t\tbits = Array.new(8, 0)\r\n\t\t0.upto(7) do |i|\r\n\t\t\tbits[i] = (@count >> (((7 - i) * 8) & 0xff)) & 0xff\r\n\t\tend\r\n\t\tupdate(128)\r\n\t\twhile (@blockIndex != 56)\r\n\t\t\tupdate(0)\r\n\t\tend\r\n\t\t0.upto(7) do |i|\r\n\t\t\tupdate(bits[i])\r\n\t\tend # this will accomplish a transform\r\n\r\n\t\t# output the digest\r\n\t\tdigest = \"\"\r\n\t\t0.upto(4) do |i|\r\n\t\t\tchunk = @state[i].to_s(16)\r\n\t\t\twhile(chunk.length < 8)\r\n\t\t\t\tchunk = \"0\" + chunk\r\n\t\t\tend\r\n\t\t\tdigest = digest + chunk\r\n\t\tend\r\n\t\tprepare\r\n\t\treturn digest\r\n\tend",
"title": ""
},
{
"docid": "375d2c9a81092ba387292c5ed26d2a74",
"score": "0.525021",
"text": "def hexdigest\n generate_digest if @digest.nil?\n @digest.unpack('H*')[0]\n end",
"title": ""
},
{
"docid": "5d80ca9e822ffc4053e0c1a927319e97",
"score": "0.5239677",
"text": "def get_hash(path='')\n \t Element.get_hash(@element, path)\n end",
"title": ""
},
{
"docid": "6f77c29ee65740f67ad0682927f0ee42",
"score": "0.52325696",
"text": "def get_hash_from_xml(data, type)\n hash = {}\n case type\n when :attributes\n data.attributes.each do |k, v|\n hash[name2sym(k)] = str_clean(v)\n end\n when :children\n data.each do |f|\n hash[name2sym(f[0])] = f[1]\n end\n when :element\n data.elements.each do |child|\n hash[name2sym(child.name)] = str_clean(child.children.first)\n end\n end\n hash\n end",
"title": ""
},
{
"docid": "6d3cd0d20c10159e121294dd11766f1b",
"score": "0.5232178",
"text": "def extract_hash(node)\n return {} if node.nil?\n\n if node.type == :hash\n node.children.each_with_object({}) do |pair, h|\n key = pair.children[0].children[0].to_s\n value = pair.children[1].children[0]\n h[key] = value\n end\n end\n end",
"title": ""
},
{
"docid": "e6969e93fea57b2d736dc2c23e11ff26",
"score": "0.52265424",
"text": "def get_hash(path='')\n Element.get_hash(@element, path)\n end",
"title": ""
},
{
"docid": "7fc0d3d45217a38d5b24e4667c023621",
"score": "0.52253765",
"text": "def revision_to_hash(xml_doc)\n details = {}\n\n xml_doc.root.elements['//revision'].attributes.each do |attribute|\n # Convert the value to an Int if the string is just a number\n if attribute[1] =~ /^\\d+$/\n details[attribute.first.to_sym] = attribute[1].to_i\n else\n details[attribute.first.to_sym] = attribute[1]\n end\n end\n details[:log] = xml_doc.root.elements['//log'].text\n\n details\n end",
"title": ""
},
{
"docid": "225e2c7bf9ba0e6845c9db27208b0e4f",
"score": "0.5221604",
"text": "def generate_hash_tag\n self.hash_tag = Digest::MD5.hexdigest(self.link)\n end",
"title": ""
},
{
"docid": "512bd3d96bc497ba0f170e3c905120f7",
"score": "0.52166015",
"text": "def fragment_id(jid, node)\n id = Digest::SHA1.hexdigest(\"#{node.name}:#{node.namespace.href}\")\n \"#{jid}-#{id}\"\n end",
"title": ""
},
{
"docid": "553adb68c66b5fd53bb111803a1522e7",
"score": "0.52136046",
"text": "def hash\n if @hash_value.nil?\n @hash_value = (name.hash * 53) ^ version.hash\n end\n @hash_value\n end",
"title": ""
},
{
"docid": "582d85bb12ae917035f13d9c13e2dbb4",
"score": "0.520825",
"text": "def elements_to_hash(xml_response, xpath, hash_id)\n unless xml_response\n return nil\n end\n doc = REXML::Document.new xml_response\n entries = Hash.new\n doc.elements.to_a(xpath).each do |xml_element|\n entry = Hash.new\n xml_element.elements.to_a.each do |el|\n if el.text =~ %r{^[0-9]*$} then # Integer value\n entry[el.name] = el.text.to_i\n elsif el.text =~ %r{^[0-9]+\\.[0-9]+$} then # Float value\n entry[el.name] = el.text.to_f\n else # String value\n entry[el.name] = el.text\n end\n end\n if entry[hash_id]\n entries[entry[hash_id]] = entry\n end\n end\n entries\n end",
"title": ""
},
{
"docid": "00cabc63443379606fde1c41335c5bee",
"score": "0.5197543",
"text": "def hash\n Digest::SHA1.hexdigest to_s\n end",
"title": ""
},
{
"docid": "7774d1f9a68b5fb2464d6cd3a87b8b92",
"score": "0.51878536",
"text": "def hash(s)\n total = 0\n characters = s.split('')\n characters.each do |x|\n x = x.unpack('U*')[0]\n total += ((x**3000) + (x**x) - (3**x)) * (7**x)\n end\n (total % 65_536).to_s(16)\n end",
"title": ""
},
{
"docid": "c5407ebdac11db132edf1385b689925a",
"score": "0.51872087",
"text": "def style2Hash(styleNode)\n #------------------------------------------------------------------\n # Fuer Verhashung\n # - Stringwandlung\n # - style:name auf Dummy-Wert setzen (da variabel)\n # - White-Space entfernen\n # - UND: Zeichen sortieren !!!\n # notwendig, da die Attributreihenfolge von XML-Knoten variiert !\n # (z.B. bei/nach Klonung)\n #------------------------------------------------------------------\n styleNodeString=styleNode.to_s\n styleNodeString.sub!(/style:name\\s*=\\s*('|\")\\S+('|\")/,\"style:name=\"+DUMMY)\n styleNodeString.gsub!(/\\s+/,\"\")\n sortedString=styleNodeString.split(//).sort.join\n return sortedString.hash.to_s\n end",
"title": ""
},
{
"docid": "afdb37e6972fbc634b2d0d155d93228a",
"score": "0.51627964",
"text": "def to_hash160\n Bitcoin.hash160(to_hex)\n end",
"title": ""
},
{
"docid": "f41e2e172912cdf5ff5a54768b649254",
"score": "0.5162001",
"text": "def hash160(hex)\n Digest::RMD160.hexdigest(Digest::SHA256.digest(hex.htb))\n end",
"title": ""
},
{
"docid": "f41e2e172912cdf5ff5a54768b649254",
"score": "0.5162001",
"text": "def hash160(hex)\n Digest::RMD160.hexdigest(Digest::SHA256.digest(hex.htb))\n end",
"title": ""
},
{
"docid": "a9311be15de2ea047299a558eedaa578",
"score": "0.51590466",
"text": "def checksum_to_hexdigest\n checksum.unpack1('m0').unpack1('H*')\n end",
"title": ""
},
{
"docid": "fb12a7a4cad877efb914a4b4fc88808e",
"score": "0.51486313",
"text": "def xml_fragment(*args, &block); end",
"title": ""
},
{
"docid": "fb12a7a4cad877efb914a4b4fc88808e",
"score": "0.51486313",
"text": "def xml_fragment(*args, &block); end",
"title": ""
},
{
"docid": "fb12a7a4cad877efb914a4b4fc88808e",
"score": "0.51486313",
"text": "def xml_fragment(*args, &block); end",
"title": ""
},
{
"docid": "21b92698cce8c959bf6437141e136b35",
"score": "0.51470405",
"text": "def xml_to_item_hash x\n #{ :product_id => \"#{x.search(\"./Id\")[0][\"s\"]}-#{x.search(\"./Code\").text}\",\n { :product_id => x.search(\"./Id\").text,\n :service_id => x.search(\"./Id\")[0][\"s\"],\n :name => x.search(\"./Name\").text,\n :description => x.search(\"./Description\").text,\n :price => x.search(\"./Price\").text,\n :code => x.search(\"./Code\").text,\n :jan => x.search(\"./Jan\").text,\n :isbn => x.search(\"./Isbn\").text,\n :asin => x.search(\"./Id\").text, # 後で変更\n :point => x.search(\"./Point\").text,\n :url => x.search(\"./Url\").text,\n :images => { :small => x.search(\"./Image/Small\").text,\n :medium => x.search(\"./Image/Medium\").text,\n :large => x.search(\"./Image/Large\").text },\n :category => { :id => x.search(\"./Category/Id\").text,\n :name => x.search(\"./Category/Name\").text },\n :store => { :id => x.search(\"./Store/Id\").text,\n :name => x.search(\"./Store/Name\").text,\n :url => x.search(\"./Store/Url\").text },\n :other => {} }\n end",
"title": ""
},
{
"docid": "52ef6ca2c6437cbcb9e08809ffb57810",
"score": "0.51416624",
"text": "def hash(block:)\n block_string = JSON.dump(block)\n Digest::SHA256.hexdigest(block_string)\n end",
"title": ""
},
{
"docid": "a4cfbaa0d7afee592eb8b5d1e638c0b6",
"score": "0.5138093",
"text": "def to_hash_160\n decode_base58(pubkey_hash_new)\n# return nil unless valid_address?(pubkey_hash_new)\n #decode_base58(ADDRESS_VERSION + bin_to_hex(pubkey_hash_new))#[2...42]\n end",
"title": ""
},
{
"docid": "6b4143b4cc5086f44ff14a699174ae8c",
"score": "0.512395",
"text": "def get_hash(path='.')\n Element.get_hash(@element, path)\n end",
"title": ""
},
{
"docid": "6b4143b4cc5086f44ff14a699174ae8c",
"score": "0.512395",
"text": "def get_hash(path='.')\n Element.get_hash(@element, path)\n end",
"title": ""
},
{
"docid": "71669a4221c68b6513cf607c3287f877",
"score": "0.5120909",
"text": "def xml_fragment(*args, &block)\n Loofah::XML::DocumentFragment.parse(*args, &block)\n end",
"title": ""
},
{
"docid": "71669a4221c68b6513cf607c3287f877",
"score": "0.5120909",
"text": "def xml_fragment(*args, &block)\n Loofah::XML::DocumentFragment.parse(*args, &block)\n end",
"title": ""
},
{
"docid": "fccca6ba734c97fd490615cf24801759",
"score": "0.5111592",
"text": "def to_hash(hash={})\n node_hash = {}\n\n # Insert node hash into parent hash correctly.\n insert_node_hash_into_parent(hash, name, node_hash)\n\n # Handle child elements\n children.each do |child|\n handle_child_element(child, node_hash)\n end\n\n # Remove content node if it is empty and there are child tags\n remove_blank_content_node node_hash\n\n # Handle attributes\n attribute_nodes.each { |a| node_hash[a.node_name] = a.value }\n\n hash\n end",
"title": ""
},
{
"docid": "90e25ba2df975509a037ea2f394172cc",
"score": "0.5111116",
"text": "def visit_hash(node)\n s(\n :hash,\n visit_all(node.assocs),\n smap_collection(\n srange_length(node.start_char, 1),\n srange_length(node.end_char, -1),\n srange_node(node)\n )\n )\n end",
"title": ""
},
{
"docid": "a4f02fa853c93a58529a36098b467042",
"score": "0.51064575",
"text": "def as_hash\n @hash ||= Transformer.transform(parsed_payload)\n end",
"title": ""
},
{
"docid": "0d5fd930ed8751fa9ec9d210a8a55f6f",
"score": "0.51020867",
"text": "def region_hash(content)\n Digest::SHA1.hexdigest(content)[0..6]\nend",
"title": ""
},
{
"docid": "470554fb783c2611f53d55a2ea153871",
"score": "0.50964075",
"text": "def doc_to_hash(doc, xpath = \"/\")\n h = Hash.from_xml(doc.xpath(xpath).to_xml)\n h\n end",
"title": ""
},
{
"docid": "26f6d8ec2c773f8b5fe87e46edcc158f",
"score": "0.50932914",
"text": "def hash_block(block)\n chars = block.unpack('U*') # Get array of UTF-8 values of each char in block\n hash_calc = 0\n chars.each do |c|\n temp_char_hashes = $char_hashes\n temp_char_hashes[c] = (((c**3000) + (c**c) - (3**c)) * (7**c)) % 65_536 if temp_char_hashes[c].nil?\n hash_calc += temp_char_hashes[c]\n $char_hashes = temp_char_hashes\n end\n hash_calc %= 65_536 # Modulo\n hash_calc.to_s(16) # Convert to string of hexadecimal representation\nend",
"title": ""
},
{
"docid": "d3b720c0b7af64d4bf666435ff7bb4f3",
"score": "0.50907224",
"text": "def hash_block\n hash_string = [index,timestamp,data,prev_hash].join\n sha = Digest::SHA256.new\n sha.update(hash_string)\n sha.hexdigest\n end",
"title": ""
}
] |
6a0a2fa4b8bae81f64205c15a9448184
|
Some OpenID Connect IDP change their encryption keys frequently. For example, Google rotates daily: To assure we always have current copies of the public keys, we'll force hourly reconfiguration.
|
[
{
"docid": "a50dfd664dfa343cb24df786f98d9588",
"score": "0.72321117",
"text": "def public_keys_for(provider)\n if provider.updated_at < 1.hour.ago\n logger.debug 'Forcing IDP reconfiguration to update public keys.'\n provider.reconfigure\n provider.save\n else\n logger.debug 'Using existing public keys.'\n end\n provider.public_keys\n end",
"title": ""
}
] |
[
{
"docid": "7ea8500c7b924d20327057d5545eabad",
"score": "0.68488115",
"text": "def regenerate_crypto\n info 'Regenerate crypto key'\n \n @session.configuration(:enforce_save) do\n zeroize 'crypto key'\n begin\n generate 'crypto key', 'rsa general-keys modulus 2048'\n rescue Exception => e\n generate 'crypto key', 'rsa modulus 2048'\n end\n set 'ip ssh version', 2\n end\n end",
"title": ""
},
{
"docid": "5d30cf683cc6ce61bb0c26cf0c295e46",
"score": "0.64715344",
"text": "def set_keys\n if self.private_changed? and self.private\n if self.moderator_key.blank?\n self.moderator_key = SecureRandom.hex(4)\n end\n if self.attendee_key.blank?\n self.attendee_key = SecureRandom.hex(4)\n end\n end\n end",
"title": ""
},
{
"docid": "3fa4378d1ce75b3e032a97da30af8571",
"score": "0.62984425",
"text": "def generate_key\n self.key ||= SecureRandom.urlsafe_base64 32\n end",
"title": ""
},
{
"docid": "aff565a118f42669f962a73d2acfb5eb",
"score": "0.6265887",
"text": "def regenerate_api_key\n api_keys.map(&:expire)\n api_keys.create\n end",
"title": ""
},
{
"docid": "aff565a118f42669f962a73d2acfb5eb",
"score": "0.6265887",
"text": "def regenerate_api_key\n api_keys.map(&:expire)\n api_keys.create\n end",
"title": ""
},
{
"docid": "3636ab70de4facc4dba0d91f8d575136",
"score": "0.6244194",
"text": "def regenerate_key\n self.private_key = true\n self.save\n end",
"title": ""
},
{
"docid": "864ec2629b49408046d6e99bd545e657",
"score": "0.62404776",
"text": "def local_rekey(body)\n @connection.comm.keyring.rekey!\n @var[:granted].each do |peer|\n local_grant(peer) unless @var[:revoked].include?(peer)\n end\n _notice \"New symmetric key generated \" +\n \"(#{AES3::iv_str(@connection.comm.keyring.default.iv)}).\", :crypto\nend",
"title": ""
},
{
"docid": "4b25037b8196063e25cb1f7481d11e67",
"score": "0.61754525",
"text": "def refresh_key\n refresh_session_token unless token_valid?\n @key = Digest::MD5.hexdigest( Digest::MD5.hexdigest(@toodle_password) + Babar::Base.toodle_app_token + @session_token)\n end",
"title": ""
},
{
"docid": "c5607583c8ffb4d2c266903e65a225d3",
"score": "0.61164904",
"text": "def secret_key\n encode_tz(:edsk, 32)\n end",
"title": ""
},
{
"docid": "f5d919fba2dca7531fe3bb54e8eb575a",
"score": "0.6094605",
"text": "def generate_key\n self.key = SecureRandom.hex(KEY_LENGTH / 2)\n end",
"title": ""
},
{
"docid": "01c18f1770bd57b0bb9594bf9e0f95cd",
"score": "0.60806984",
"text": "def secret_key_base; end",
"title": ""
},
{
"docid": "01c18f1770bd57b0bb9594bf9e0f95cd",
"score": "0.60806984",
"text": "def secret_key_base; end",
"title": ""
},
{
"docid": "01c18f1770bd57b0bb9594bf9e0f95cd",
"score": "0.60806984",
"text": "def secret_key_base; end",
"title": ""
},
{
"docid": "01c18f1770bd57b0bb9594bf9e0f95cd",
"score": "0.60806984",
"text": "def secret_key_base; end",
"title": ""
},
{
"docid": "f211db1750e78f89b523b2975bf8176b",
"score": "0.60656375",
"text": "def create_key\n self.key = Digest::MD5.hexdigest(self.official_id.to_s + self.sent_to_email)\n end",
"title": ""
},
{
"docid": "ae8096bb83f64bfb7941638d629a4fce",
"score": "0.60352254",
"text": "def public_key=(_); end",
"title": ""
},
{
"docid": "ae8096bb83f64bfb7941638d629a4fce",
"score": "0.60352254",
"text": "def public_key=(_); end",
"title": ""
},
{
"docid": "23c060c0df5e354870583e632d8acaa0",
"score": "0.60177034",
"text": "def pubkey_algorithms; end",
"title": ""
},
{
"docid": "ffc5749ccbaceeac0c002db657076302",
"score": "0.5993574",
"text": "def generate_key\n length = 5\n begin\n self.key = SecureRandom.urlsafe_base64 length\n end while Invite.exists?(key: self.key)\n end",
"title": ""
},
{
"docid": "8946ce75ef685fec6be1f0fed0b4f73a",
"score": "0.5990019",
"text": "def host_key_regen\n send_req(act: :host_key_regen)\n end",
"title": ""
},
{
"docid": "923ec2d8b39d94f4f1176d25267423f1",
"score": "0.59828717",
"text": "def generate_key\n SecureRandom.hex(32)\nend",
"title": ""
},
{
"docid": "f0fec52ae4a055405111bbda225fe433",
"score": "0.596087",
"text": "def set_their_public_key!(their_public_key_x, their_public_key_y, testing_my_private_key:nil)\n # Check if we're actually changing anything\n if(@keys[:their_public_key_x] == their_public_key_x && @keys[:their_public_key_y] == their_public_key_y)\n raise(Error, \"Attempted to cycle to the same key!\")\n end\n\n # We keep a copy of the previous key so we can decrypt any stragglers\n if(@keys[:shared_secret])\n @old_keys = @keys\n end\n\n # The first nonce should be 0\n @keys = {\n :my_nonce => -1,\n :their_nonce => -1,\n }\n\n if TESTING\n @l.error(\"Encryptor: Setting a fake testing key!\")\n @keys[:my_private_key] = testing_my_private_key || (1 + SecureRandom.random_number(ECDH_GROUP.order - 1))\n else\n @keys[:my_private_key] = (1 + SecureRandom.random_number(ECDH_GROUP.order - 1))\n end\n @keys[:my_public_key] = ECDH_GROUP.generator.multiply_by_scalar(@keys[:my_private_key])\n @keys[:their_public_key_x] = their_public_key_x\n @keys[:their_public_key_y] = their_public_key_y\n @keys[:their_public_key] = ECDSA::Point.new(ECDH_GROUP, their_public_key_x, their_public_key_y)\n\n @keys[:shared_secret] = @keys[:their_public_key].multiply_by_scalar(@keys[:my_private_key]).x\n\n @keys[:their_authenticator] = _create_authenticator(\"client\", @preshared_secret)\n @keys[:my_authenticator] = _create_authenticator(\"server\", @preshared_secret)\n\n @keys[:their_write_key] = _create_key(\"client_write_key\")\n @keys[:their_mac_key] = _create_key(\"client_mac_key\")\n @keys[:my_write_key] = _create_key(\"server_write_key\")\n @keys[:my_mac_key] = _create_key(\"server_mac_key\")\n\n return @keys[:my_public_key].x, @keys[:my_public_key].y\n end",
"title": ""
},
{
"docid": "3358f0012e0b782b42be1b195b05bf8f",
"score": "0.59575427",
"text": "def generate_keys\n key = OpenSSL::PKey::RSA.new 2048\n self.pubkey = key.public_key.to_s\n self.privkey = key.to_s\n self.save\n end",
"title": ""
},
{
"docid": "8c8d43f1dd2e7525d9f092be31c9ab09",
"score": "0.59509075",
"text": "def set_their_public_key(their_public_key_x, their_public_key_y)\n # Check if we're actually changing anything\n if(@keys[:their_public_key_x] == their_public_key_x && @keys[:their_public_key_y] == their_public_key_y)\n @@window.puts(\"Attempted to set the same public key!\")\n return false\n end\n\n @old_keys = @keys\n\n @keys = {\n :my_nonce => -1,\n :their_nonce => -1,\n }\n\n if(ready?())\n @@window.puts(\"Wow, this session is old (or the client is needy)! Key re-negotiation requested!\")\n end\n\n @keys[:my_private_key] = 1 + SecureRandom.random_number(ECDH_GROUP.order - 1)\n @keys[:my_public_key] = ECDH_GROUP.generator.multiply_by_scalar(@keys[:my_private_key])\n @keys[:their_public_key_x] = their_public_key_x\n @keys[:their_public_key_y] = their_public_key_y\n @keys[:their_public_key] = ECDSA::Point.new(ECDH_GROUP, their_public_key_x, their_public_key_y)\n\n @keys[:shared_secret] = @keys[:their_public_key].multiply_by_scalar(@keys[:my_private_key]).x\n\n @keys[:their_authenticator] = _create_authenticator(\"client\", @preshared_secret)\n @keys[:my_authenticator] = _create_authenticator(\"server\", @preshared_secret)\n\n @keys[:their_write_key] = _create_key(\"client_write_key\")\n @keys[:their_mac_key] = _create_key(\"client_mac_key\")\n @keys[:my_write_key] = _create_key(\"server_write_key\")\n @keys[:my_mac_key] = _create_key(\"server_mac_key\")\n\n @@window.puts(\"Setting their public key: #{CryptoHelper.bignum_to_text(@keys[:their_public_key_x])} #{CryptoHelper.bignum_to_text(@keys[:their_public_key_y])}\")\n @@window.puts(\"Setting my public key: #{CryptoHelper.bignum_to_text(@keys[:my_public_key].x)} #{CryptoHelper.bignum_to_text(@keys[:my_public_key].y)}\")\n\n return true\n end",
"title": ""
},
{
"docid": "23a305de526c89f19edff8ad0c79afa2",
"score": "0.59452045",
"text": "def regenerate_api_key!\n self.regenerate_api_key\n self.save\n end",
"title": ""
},
{
"docid": "3952195736ba24fdf2d9b920e3acf11c",
"score": "0.59445244",
"text": "def magento_encryption_key \n require 'securerandom'\n return SecureRandom.uuid.gsub('-', '')\nend",
"title": ""
},
{
"docid": "3c41c6409ba37de33a04a547ee746c9c",
"score": "0.59325254",
"text": "def regenerate_api_key\n generate_api_key\n self.save\n end",
"title": ""
},
{
"docid": "487cb67005bdfe5c48c72092d45580e1",
"score": "0.59272933",
"text": "def regenerate_apikeys\n current_path = '/api/v1/users/all/api-keys'\n @conn.delete(current_path)\n end",
"title": ""
},
{
"docid": "b9176870fcab783030eb0320a3eef09e",
"score": "0.5924312",
"text": "def regenerate_api_key\n self.api_key = Digest::SHA1.hexdigest(\"#{self._id}-#{Time.now.to_f}-#{self.created_at}\")\n end",
"title": ""
},
{
"docid": "ac0ec5f01cc58ae2fa84f133e115f4e3",
"score": "0.5910591",
"text": "def host_key_verifier; end",
"title": ""
},
{
"docid": "a517768b6408ffbf0d41a9ccb48086e7",
"score": "0.59068626",
"text": "def update_keys\n public_identity = params.require(:public)\n private_identity = params[:private]\n private_id_label = params[:label]\n\n # Check if encryption is already enabled (but not changing passphrase).\n old_identity = current_user.custom_fields[DiscourseEncrypt::PUBLIC_CUSTOM_FIELD]\n if params[:overwrite].blank? && old_identity && old_identity != public_identity\n return render_json_error(I18n.t('encrypt.enabled_already'), status: 409)\n end\n\n current_user.custom_fields[DiscourseEncrypt::PUBLIC_CUSTOM_FIELD] = public_identity\n\n if private_identity.present?\n if private_id_label.present?\n data = JSON.parse(current_user.custom_fields[DiscourseEncrypt::PRIVATE_CUSTOM_FIELD]) rescue {}\n data[private_id_label.downcase] = private_identity\n current_user.custom_fields[DiscourseEncrypt::PRIVATE_CUSTOM_FIELD] = JSON.dump(data)\n else\n current_user.custom_fields[DiscourseEncrypt::PRIVATE_CUSTOM_FIELD] = private_identity\n end\n end\n\n current_user.save_custom_fields\n\n render json: success_json\n end",
"title": ""
},
{
"docid": "786dcc2cee4f8bc8e88068422ae73957",
"score": "0.5906091",
"text": "def reset_secret_key\n r = Aws::Kms.new('saas', 'saas').decrypt(@client.api_salt)\n return r unless r.success?\n\n api_salt_d = r.data[:plaintext]\n\n client_api_secret_d = SecureRandom.hex\n\n r = LocalCipher.new(api_salt_d).encrypt(client_api_secret_d)\n return r unless r.success?\n\n client_api_secret_e = r.data[:ciphertext_blob]\n\n @client_webhook_setting.secret_key = client_api_secret_e\n @client_webhook_setting.set_decrypted_secret_key(client_api_secret_d)\n @client_webhook_setting.source = GlobalConstant::AdminActivityChangeLogger.web_source\n\n @client_webhook_setting.save! if @client_webhook_setting.changed?\n end",
"title": ""
},
{
"docid": "d3b143b58bd377c12a60fd3a1c5456ae",
"score": "0.5903786",
"text": "def generate_keys\n self.client_id = OAuth::Helper.generate_key(40)[0,40]\n self.client_secret_hash = OAuth::Helper.generate_key(40)[0,40]\n end",
"title": ""
},
{
"docid": "384ece9d455eb5802bfad3b37a3be9d4",
"score": "0.5879839",
"text": "def key_generator; end",
"title": ""
},
{
"docid": "384ece9d455eb5802bfad3b37a3be9d4",
"score": "0.5879839",
"text": "def key_generator; end",
"title": ""
},
{
"docid": "f2990d6564f2c3708ce68d933fcba532",
"score": "0.58764863",
"text": "def private_key; end",
"title": ""
},
{
"docid": "f2990d6564f2c3708ce68d933fcba532",
"score": "0.58764863",
"text": "def private_key; end",
"title": ""
},
{
"docid": "1e47fc57c3741366d9322d285fe5e399",
"score": "0.5875682",
"text": "def set_keys\n self.auth = gen_key('auth') if auth.blank?\n self.mkey = gen_key('mkey') if mkey.blank?\n end",
"title": ""
},
{
"docid": "ea1021fc6e39fc28780c7e3f741f9463",
"score": "0.5870955",
"text": "def set_otp_key(id, key)\n @otp_keys[id] = encrypt(key.to_s) unless key.to_s.empty?\n end",
"title": ""
},
{
"docid": "243cd92b40825822d6ae82ca133586c1",
"score": "0.5867886",
"text": "def generate_keys\n\t\tself.token = OAuth::Helper.generate_key(20)[0,20]\n\t\tself.expires_at = 10.minutes.from_now\n\t\tself.authorized_at = Time.now\n\tend",
"title": ""
},
{
"docid": "50f3d76ffbe63bfe0ac9390ef4f75a9b",
"score": "0.5864142",
"text": "def aes_key\n self.encrypted_data_will_change!\n \"dfdsdsfsdfsdfwefsdfds\"\n end",
"title": ""
},
{
"docid": "d6115bb33c08177ab67d8f88f9176646",
"score": "0.58578503",
"text": "def public_key; end",
"title": ""
},
{
"docid": "d6115bb33c08177ab67d8f88f9176646",
"score": "0.58578503",
"text": "def public_key; end",
"title": ""
},
{
"docid": "d6115bb33c08177ab67d8f88f9176646",
"score": "0.58578503",
"text": "def public_key; end",
"title": ""
},
{
"docid": "10bf4f38c7171d35682b55b344aaf242",
"score": "0.5851119",
"text": "def migrate_old_ssh_keys\n if migrate_old_ssh_keys?\n say \"-> migrating to cache private key for inception VM...\"\n inception_vm_private_key_path # to setup the path in settings\n settings[\"inception\"][\"key_pair\"] ||= {}\n settings[\"inception\"][\"key_pair\"][\"name\"] = \"fog_default\"\n settings[\"inception\"][\"key_pair\"][\"private_key\"] = File.read(settings[\"local\"][\"private_key_path\"]).strip\n settings[\"inception\"][\"key_pair\"][\"public_key\"] = File.read(settings[\"local\"][\"public_key_path\"]).strip\n settings.delete(\"local\")\n save_settings!\n end\n end",
"title": ""
},
{
"docid": "075a39eba91171fc8885a28190b5b4a5",
"score": "0.5839215",
"text": "def set_key\n self.key = SecureRandom.urlsafe_base64(KEY_LENGTH)\n self.set_key if Url.exists?(key: self.key)\n end",
"title": ""
},
{
"docid": "82b61951a20bf275ced3466114ae0111",
"score": "0.5830106",
"text": "def ecdh_public_key_bytes; end",
"title": ""
},
{
"docid": "4612319c78e8a8b6595541d25acb5a34",
"score": "0.58282423",
"text": "def exchange_keys; end",
"title": ""
},
{
"docid": "4612319c78e8a8b6595541d25acb5a34",
"score": "0.58282423",
"text": "def exchange_keys; end",
"title": ""
},
{
"docid": "ebf35f802f65600995c86fb55a3db6f4",
"score": "0.58255327",
"text": "def set_data_encrypting_key\n\tself.data_encrypting_key ||= DataEncryptingKey.primary\n end",
"title": ""
},
{
"docid": "413cf34513ae974770883cf04ac4912a",
"score": "0.582399",
"text": "def encryption_key\n\tself.data_encrypting_key ||= DataEncryptingKey.primary\n\tdata_encrypting_key.key\n end",
"title": ""
},
{
"docid": "4e4cffaf440e3212736fcb275c4953a8",
"score": "0.58129275",
"text": "def reset_private_key\n self.private_key = ActiveSupport::SecureRandom.hex(32)\n end",
"title": ""
},
{
"docid": "202e38c716c0e6d51f8693ae9da9cfac",
"score": "0.580488",
"text": "def secret_key\n \"\"\n end",
"title": ""
},
{
"docid": "aae0dd62c8a3641ac05f651f6337a177",
"score": "0.5794519",
"text": "def generate_key; end",
"title": ""
},
{
"docid": "04db8926d93100d3f5de87df7c386eef",
"score": "0.57893735",
"text": "def generate_access_key\n return if self.access_key.present?\n self.access_key = SecureRandom.uuid\n end",
"title": ""
},
{
"docid": "9ae404efa5f5cdaaa3c5f50dfb570d5a",
"score": "0.57784915",
"text": "def secret_key; end",
"title": ""
},
{
"docid": "207e982be20a091f2d460c42e492cf24",
"score": "0.5760022",
"text": "def reset_api_key\n key = generate_api_key\n md5 = Digest::MD5.new\n md5.update(key)\n # base64 encode md5 hash\n self.update(api_key: Base64.encode64(md5.to_s).strip)\n end",
"title": ""
},
{
"docid": "207e982be20a091f2d460c42e492cf24",
"score": "0.5760022",
"text": "def reset_api_key\n key = generate_api_key\n md5 = Digest::MD5.new\n md5.update(key)\n # base64 encode md5 hash\n self.update(api_key: Base64.encode64(md5.to_s).strip)\n end",
"title": ""
},
{
"docid": "8a256fae789f77f7caef1519d0d28144",
"score": "0.5755708",
"text": "def initialize_keys\n @key0 = 0x12345678\n @key1 = 0x23456789\n @key2 = 0x34567890\n @password.each_byte { |byte| update_keys(byte.chr) }\n nil\n end",
"title": ""
},
{
"docid": "fc784fd103a27164b01b87e8e4707b5a",
"score": "0.5740506",
"text": "def public_key\n encode_tz(:edpk, 32)\n end",
"title": ""
},
{
"docid": "5e30b41e0920e50ef6166e0ab07dc8c5",
"score": "0.5737999",
"text": "def encryption_client; end",
"title": ""
},
{
"docid": "e4148d61bde5d025ccddc1b4a01ac31a",
"score": "0.57375705",
"text": "def generate_user_key\n\t\tself.key = loop do\n random_hex = SecureRandom.urlsafe_base64\n break random_hex unless self.class.exists?(key: random_hex)\n end\n\tend",
"title": ""
},
{
"docid": "86a3c625d053c6f30cb18f93088ac48b",
"score": "0.5730114",
"text": "def gp_development_keys\n key = (0x40..0x4F).to_a.pack('C*')\n { :senc => key, :smac => key, :dek => key }\n end",
"title": ""
},
{
"docid": "f2d6eb931b6683328306cf0b15390cf5",
"score": "0.57221067",
"text": "def encryption_server; end",
"title": ""
},
{
"docid": "33bb650e04e98c58be7a7c4546a9efe4",
"score": "0.57209474",
"text": "def generate_api_key\n @user.api_key = BCrypt::Engine.generate_salt\n end",
"title": ""
},
{
"docid": "2d425bb5d446abecaf1c2c869ac01302",
"score": "0.5715947",
"text": "def keyholder()\n \tinclude ActiveCrypto::AssociationKeyHolder \n \tafter_create :save_session_key \n end",
"title": ""
},
{
"docid": "c7aefa3d788236934c93369115a5154e",
"score": "0.57154894",
"text": "def generate_registration_key\n self.registration_key = 'C'.freeze + SecureRandom.base64(8)\n end",
"title": ""
},
{
"docid": "292e02f80fe779654f4061c140f09c1b",
"score": "0.5715182",
"text": "def generate_api_key(length = 20)\n self.api_secret_key = SecureRandom.hex(length)\n end",
"title": ""
},
{
"docid": "a5e448b6cd33f254b304a50da3c69ae5",
"score": "0.57036906",
"text": "def encrypted_keys\n Array(config[:encrypted_keys]).concat(\n Array(Chef::Config[:knife][:secure_data_bag][:encrypted_keys])\n ).uniq\n end",
"title": ""
},
{
"docid": "0b2e70bac9183b4cb16c7fca92e91206",
"score": "0.57013845",
"text": "def crypto_key\n # Returns singleton object\n EmailEncryptionKey.instance.key\n end",
"title": ""
},
{
"docid": "3605cb39e3f21f2b0bec4ad67cb50da0",
"score": "0.56799805",
"text": "def generate_access_key\n access_keys.generate_new\n end",
"title": ""
},
{
"docid": "e3d7d88c0fbddd5e7c23e1bce8684a03",
"score": "0.566672",
"text": "def keycerts; end",
"title": ""
},
{
"docid": "3d63a8944cda4969d6dcb0649ad0315f",
"score": "0.5663565",
"text": "def one_time_public_key\n token = generate_token('get_encription_public_key', @public_key)\n response = commit(:pci_encryption_key, token: token)\n response.params['encryption_key']\n end",
"title": ""
},
{
"docid": "7e0d3928f45b1229683757fbd6f62d35",
"score": "0.5661981",
"text": "def handle_sync_key enc_key\n PRIVATE_KEY.private_decrypt enc_key\n end",
"title": ""
},
{
"docid": "7ff1eb600a8f393d8a4a712099bbf7f0",
"score": "0.5657022",
"text": "def key_files; end",
"title": ""
},
{
"docid": "2284f4d2eb0faba3b9b60d8621f2878b",
"score": "0.5650371",
"text": "def save_encryption_key\n namespaced_redis = self.redis_connection\n if defined?(self.user_id)\n key = self.user_id.to_s\n else\n key = self.id.to_s\n end\n #just to stay on safe side\n raise 'Encryption key already exists' if namespaced_redis.get(key)\n namespaced_redis.set(key, @encryption_key)\n end",
"title": ""
},
{
"docid": "211466af5898bb33ce75fac376f84e0b",
"score": "0.56327707",
"text": "def save_verification_key\n self.verification_key = KeyGenerator.create\n end",
"title": ""
},
{
"docid": "0ca414ce8fe33c1902829648e484c668",
"score": "0.5629385",
"text": "def generate_api_key\n api_key = new_token\n if AppSettings[:authentication][:key_based]\n Rails.cache.write( User.cached_api_key(api_key), self.authentication_token,\n expires_in: AppSettings[:authentication][:session_expiry] )\n api_key\n else\n secure_api_key = secured_key(api_key)\n update_hash = {}\n update_hash[:activation_digest] = User.digest(User.cached_api_key(secure_api_key))\n update_hash[:activated_at] = Time.now if self.activated_at < Time.now - 24.hours\n self.update(update_hash)\n secure_api_key\n end\n end",
"title": ""
},
{
"docid": "bb498785a9e50f16c864e04e13d5c6a0",
"score": "0.5624624",
"text": "def exchange_keys\n result = send_kexinit\n verify_server_key(result[:server_key])\n session_id = verify_signature(result)\n confirm_newkeys\n\n {\n session_id: session_id,\n server_key: result[:server_key],\n shared_secret: result[:shared_secret],\n hashing_algorithm: digester\n }\n end",
"title": ""
},
{
"docid": "6f152f5d432b5fde5b8a703357696d97",
"score": "0.56175816",
"text": "def verify_key; end",
"title": ""
},
{
"docid": "6f152f5d432b5fde5b8a703357696d97",
"score": "0.56175816",
"text": "def verify_key; end",
"title": ""
},
{
"docid": "78d2373e7fdd74b6145a1979fde455bb",
"score": "0.56149954",
"text": "def ssl_client_key\n super\n end",
"title": ""
},
{
"docid": "c240d2ff2fc19dd773694cae9f2e5838",
"score": "0.56127816",
"text": "def legacy_otp_secret\n nil\n end",
"title": ""
},
{
"docid": "716308f061ffc9c0c05cbae9d5901e7c",
"score": "0.55995363",
"text": "def app_key \n 'app-id-9bb5f1c77f0df722a9b1bc650a41988a'\n end",
"title": ""
},
{
"docid": "a0e71d5f40ef0e698bb87e0e07c4145f",
"score": "0.5594927",
"text": "def generate_personal_key\n self.personal_key = OaUtils.generate_random_key\n self.state = :active\n end",
"title": ""
},
{
"docid": "6d63f81bab6b0866034f0489e336912f",
"score": "0.5590675",
"text": "def generate_api_key\n begin\n self.api_key = SecureRandom.hex(16)\n end while self.class.exists?(api_key: api_key)\n self.save\n self.api_key\n end",
"title": ""
},
{
"docid": "65aac4f1d193e80caadf91f761eaa51c",
"score": "0.55882746",
"text": "def generate_api_key\n self.api_key = SecureRandom.hex(16)\n end",
"title": ""
},
{
"docid": "5d322afba3cba94de16389e4d3824399",
"score": "0.5583267",
"text": "def generate_api_key\n key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12345678).to_s)[1..10]\n self.api_key = self._id.to_s + key\n end",
"title": ""
},
{
"docid": "5d322afba3cba94de16389e4d3824399",
"score": "0.5583267",
"text": "def generate_api_key\n key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12345678).to_s)[1..10]\n self.api_key = self._id.to_s + key\n end",
"title": ""
},
{
"docid": "87cdcbd008728c71731661f0fc08f961",
"score": "0.55825216",
"text": "def reset_client_api_credentials\n\n r = Aws::Kms.new('saas', 'saas').decrypt(@client.api_salt)\n return r unless r.success?\n\n api_salt_d = r.data[:plaintext]\n\n @client_api_secret_d = SecureRandom.hex\n\n r = LocalCipher.new(api_salt_d).encrypt(@client_api_secret_d)\n return r unless r.success?\n\n api_secret_e = r.data[:ciphertext_blob]\n api_key = SecureRandom.hex\n\n @client.api_key = api_key\n @client.api_secret = api_secret_e\n @client.save!\n success\n end",
"title": ""
},
{
"docid": "5caf7bb898dcba02d99450465019ac3b",
"score": "0.5577386",
"text": "def rekey_as_needed; end",
"title": ""
},
{
"docid": "a516456033e30c7d6b00fc100bf960dc",
"score": "0.55745804",
"text": "def key_pem; end",
"title": ""
},
{
"docid": "fe6720f8ad92b985c09ac65ac51a3fd4",
"score": "0.55708104",
"text": "def compute_shared_secret(server_ecdh_pubkey); end",
"title": ""
},
{
"docid": "514db179f21e502159f31589060edbd5",
"score": "0.5570143",
"text": "def store_encryption_key_sha\n self.encryption_key_sha = ENCRYPTION_KEY_SHA\n end",
"title": ""
},
{
"docid": "bd86e56e58c9e4f14f46503676d794bd",
"score": "0.5569061",
"text": "def before_save\n encrypt_secret\n super\n end",
"title": ""
},
{
"docid": "829121e7899da5ab80536a1d05deaa2d",
"score": "0.55686456",
"text": "def public_key\n Base64.encode64(\"conversation_#{id}\").gsub(/(=|\\n)/, '') << id.to_s.last\n end",
"title": ""
},
{
"docid": "d9433fe058f92f982dfcbf1f3a4ee3dd",
"score": "0.55671203",
"text": "def key_manager; end",
"title": ""
},
{
"docid": "4ec0ec2dec908bed1ad48ecc93e10a49",
"score": "0.55506206",
"text": "def regenerate_apikey(uid)\n current_path = \"/api/v1/users/#{uid}/api-keys\"\n @conn.delete(current_path)\n end",
"title": ""
},
{
"docid": "544e1dafc1b4fce25563554639b63aff",
"score": "0.5550362",
"text": "def key_file\n super\n end",
"title": ""
},
{
"docid": "6b9bd93a888c077e124c7cc60d5bf038",
"score": "0.5519131",
"text": "def signin(valid_time)\n remove_expired_keys\n now = Time.now\n key = UserKey.new :register_time => now,\n :expired_on => now + valid_time\n key.user_key = UUID.generate\n self.add_user_key key\n self.last_signin = now\n self.save\n key\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "8254ec44eee03dfe1c9cb48920354244",
"score": "0.0",
"text": "def set_task\n @task = Task.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163754",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.6045816",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5944853",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.59169096",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58892167",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58342934",
"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.5776148",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.57057375",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.57057375",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.56534296",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.56209534",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54244673",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54101455",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54101455",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54101455",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53951085",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5378493",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.53563684",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53399915",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.5338049",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.53307265",
"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.5312121",
"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": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.5298173",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "4f9a284723e2531f7d19898d6a6aa20c",
"score": "0.5296388",
"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.52952695",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.5258086",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52430934",
"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.5237911",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237911",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237911",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237911",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237911",
"text": "def action; end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.52335346",
"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": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.5232943",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.5226392",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.52221715",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.5217978",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.52136153",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52076435",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.52067244",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.5175402",
"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.5174649",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173085",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5165201",
"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.5162052",
"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.5157932",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.5152905",
"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.5152353",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.5150909",
"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.514719",
"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.5138596",
"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.51333916",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.51139015",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5113431",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.5113431",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109581",
"text": "def action\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.51066816",
"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.5091428",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.5089407",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.5082971",
"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": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.50822043",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.50668514",
"text": "def action\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.5055155",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.50525695",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50499475",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.50499475",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.5034445",
"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.50249445",
"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.5022226",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.50167644",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.5014211",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.4999924",
"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": "791f958815c2b2ac16a8ca749a7a822e",
"score": "0.49996212",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "0cff1d3b3041b56ce3773d6a8d6113f2",
"score": "0.49978727",
"text": "def init_actions\n @select_action = SelectAction.new\n @endpoint_mouse_action = EndpointMouseAction.new\n @move_action = MoveAction.new\n end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.4989682",
"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.4989682",
"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.49851838",
"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": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49817684",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "7647b99591d6d687d05b46dc027fbf23",
"score": "0.4979687",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.49787104",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49688423",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.49664098",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.49564412",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.49561828",
"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.49547398",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.4953481",
"text": "def save_action; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.4952925",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.4946049",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.494379",
"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.49319315",
"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.49313048",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49269778",
"text": "def default_action; end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49263066",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49257493",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.4924526",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49212465",
"text": "def advice\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49173486",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "0fe8b3b5573f8eb57ec1752658a62e4e",
"score": "0.4915802",
"text": "def call\n setup_context\n super\n end",
"title": ""
},
{
"docid": "9e264985e628b89f1f39d574fdd7b881",
"score": "0.49151486",
"text": "def duas1(action)\n action.call\n action.call\nend",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.49150333",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49147308",
"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": ""
}
] |
edaa0e0808045b4bd900e4b419fda6c8
|
Returns the UID for the username on the host.
|
[
{
"docid": "ff59dccd2ec89dfa0ac5ae7293c6005e",
"score": "0.77411574",
"text": "def get_uid(username)\n Etc.passwd { |u| return u.uid if u.name == username }\n end",
"title": ""
}
] |
[
{
"docid": "d4ad0fc325570ce343150b17ac973ad1",
"score": "0.8262799",
"text": "def username\n real_uid = uids[:real]\n begin\n return Etc::getpwuid(real_uid).name\n rescue ArgumentError\n return real_uid.to_s\n end\n end",
"title": ""
},
{
"docid": "438cdef32c5a959dd2bc98ca79b8d8d2",
"score": "0.7690447",
"text": "def uid\n @namsid = open(\"|getent passwd #{@username}\").read.chomp.split(\":\")[2]\n end",
"title": ""
},
{
"docid": "9b15a35d7b26b68bc19056ac9272faab",
"score": "0.7595602",
"text": "def uid_to_username(uid)\n uid = Integer(uid)\n Etc.getpwuid(uid).name\n end",
"title": ""
},
{
"docid": "bc597f5133213be41593a30edd58d9ea",
"score": "0.7537322",
"text": "def get_username\n env[settings.uid_attr]\n end",
"title": ""
},
{
"docid": "107059e17d06687615c624a09ff96408",
"score": "0.7392806",
"text": "def get_user_id(name)\n System::User.normalize_username(name)\n end",
"title": ""
},
{
"docid": "c66b1a0560a4e5e8f237fc609f20924b",
"score": "0.7359949",
"text": "def uid\n return nil unless user\n\n user.is_a?(Integer) ? user : Etc.getpwnam(user.to_s).uid\n end",
"title": ""
},
{
"docid": "48d88834f36129e49ed3c5bd7c81d4ab",
"score": "0.71716475",
"text": "def getuid\n\t\trequest = Packet.create_request('stdapi_sys_config_getuid')\n\t\tresponse = client.send_request(request)\n\t\treturn response.get_tlv_value(TLV_TYPE_USER_NAME)\n\tend",
"title": ""
},
{
"docid": "1e63aa708ce7429dc8ad29560fb2adff",
"score": "0.71629244",
"text": "def user_port(username)\n Etc.getpwnam(username).uid + 3000 rescue nil\n end",
"title": ""
},
{
"docid": "47f9a1d47cbb45ff6783d351fe16d8d8",
"score": "0.7082334",
"text": "def name\n return Process.uid.zero? ? Etc.getpwuid(ENV['SUDO_UID'].to_i).name : ENV['USER']\n end",
"title": ""
},
{
"docid": "38014bee9d55625708880540e64e8bf4",
"score": "0.70375544",
"text": "def uid() \n @uid ||= command && [command.uid, ident].compact.join(\".\").sub(/!\\./, \".\") \n end",
"title": ""
},
{
"docid": "812f8baca7c67bfea9d9225dcd03e765",
"score": "0.70129025",
"text": "def uid\n @name.to_s.downcase.gsub(/[^a-z0-9]+/, '').gsub(/-+$/, '').gsub(/^-+$/, '').to_sym\n end",
"title": ""
},
{
"docid": "12a79b210778652738dcdef84919e53c",
"score": "0.6878231",
"text": "def uid\n if attributes[:owner] && !attributes.key?(:uid)\n require 'etc'\n attributes[:uid] = Etc.getpwnam(attributes[:owner]).uid\n end\n attributes[:uid]\n end",
"title": ""
},
{
"docid": "f4dbcd766ed9fb4ab502ed32d0e1feca",
"score": "0.68587375",
"text": "def get_user_name\n user = Etc.getpwnam(Etc.getlogin)['gecos'].split(',').first\n user = Etc.getlogin if user.nil?\n\n return user\n end",
"title": ""
},
{
"docid": "753200d6e7f3828ff0f618a83c9184f0",
"score": "0.68423885",
"text": "def username\n @account.incoming_server.authentication.username\n end",
"title": ""
},
{
"docid": "783d973debc1781e91cf2717c6cc1c8c",
"score": "0.6841203",
"text": "def nickname_to_uid(nickname) ##############\n page = request(\"/#{nickname}\",:method => :get)\n uid = nil\n unless( (page =~ /\\\"user_id\\\": (.[0-9]*)/) == nil )\n uid = $1\n end\n return uid\n end",
"title": ""
},
{
"docid": "1ea622c58eeff26eb4ae43f1a75d61e7",
"score": "0.68316853",
"text": "def uname \n return @username\n end",
"title": ""
},
{
"docid": "926ae7ca858c87976c9da5228618ce23",
"score": "0.6822517",
"text": "def get_username()\n username_gitconfig = %x(git config user.name).strip\n username_passwd = Etc.getpwnam(Etc.getlogin).gecos.gsub(/ - SBP.*/,'')\n\n username = username_gitconfig unless username_gitconfig.nil?\n username = username_passwd if username.empty?\n username\n end",
"title": ""
},
{
"docid": "4f4177fc861f9c21338dd17a52dcc563",
"score": "0.68216413",
"text": "def username\n raw_info['username']\n end",
"title": ""
},
{
"docid": "f66a9d3ae63595afbb2efd67a5457a31",
"score": "0.67654926",
"text": "def username\n parsed_uri.user\n end",
"title": ""
},
{
"docid": "3caec4ae46474d34f2d7d341f327d538",
"score": "0.6758695",
"text": "def host_uid\n \"host_#{@keep_alive.host}\"\n end",
"title": ""
},
{
"docid": "2861b2a4f652010233f3fbec5f9443e3",
"score": "0.6758178",
"text": "def uid\n proptext 'UID'\n end",
"title": ""
},
{
"docid": "9f75d4e647e13bb009604ea272acc014",
"score": "0.67543584",
"text": "def get_resource_username\n\n # Split the name into username and hostname\n unless @resource[:name] =~ /^([^@]+)@(.+)$/\n raise Puppet::Error, \"Invalid name (user@host required)\"\n end\n\treturn $1\n end",
"title": ""
},
{
"docid": "fc61b7a6c08499b7b76c3eb149659601",
"score": "0.6747842",
"text": "def username()\n\t\treturn Base64.strict_decode64(@username)\n\tend",
"title": ""
},
{
"docid": "b7f8b810633cf4846d27dc3f375c0468",
"score": "0.67175865",
"text": "def username\n Server::Helpers.username(node)\n end",
"title": ""
},
{
"docid": "259cb732b598231dc276f939807898e6",
"score": "0.67106855",
"text": "def scrape_username\n un=ENV[\"USER\"] if onUnix?;\n un=ENV[\"USERNAME\"] if onWindows?||!onUnix?;\n un=\"Great One\" if un===nil||un.index(\"root\")!=nil;\n \n return un\n \n end",
"title": ""
},
{
"docid": "259cb732b598231dc276f939807898e6",
"score": "0.67106855",
"text": "def scrape_username\n un=ENV[\"USER\"] if onUnix?;\n un=ENV[\"USERNAME\"] if onWindows?||!onUnix?;\n un=\"Great One\" if un===nil||un.index(\"root\")!=nil;\n \n return un\n \n end",
"title": ""
},
{
"docid": "dff6c8e89f582bee9c8d61d720a2b77f",
"score": "0.6696772",
"text": "def uid_user\n if node['platform'] == 'mac_os_x'\n user_uid = File.stat('/dev/console').uid\n require 'etc'\n Etc.getpwuid(user_uid).name\n else # Required to allow testing in Travis CI (Linux). Otherwise not used\n id_output = Mixlib::ShellOut.new('id -un')\n id_output.run_command\n unless id_output.error? # Will only return stdout if no error\n id_output.stdout.strip\n else\n ''\n end\n end\nend",
"title": ""
},
{
"docid": "dbc925903cf09934b1c199b14aaa32de",
"score": "0.6689498",
"text": "def get_resource_username\n\n unless @resource[:name] =~ /^([^@]+)@(.+)\\/(.+)$/\n raise Puppet::Error, \"Invalid name (user@host/db required)\"\n end\n\treturn $1\n end",
"title": ""
},
{
"docid": "7e8924d5a4c9b063f36b69f9fdc00658",
"score": "0.6687083",
"text": "def ssh_username\n data['ssh_username']\n end",
"title": ""
},
{
"docid": "4e40202a61143f8f7df7c1a543d72808",
"score": "0.66817254",
"text": "def get_userid_from_name(username)\n db = call_db()\n id = db.execute(\"SELECT (UserId) FROM users WHERE Username = ?\", username).first[\"UserId\"]\n \n return id\n end",
"title": ""
},
{
"docid": "0704406066a7d04215f5cf7f57870f3b",
"score": "0.6674603",
"text": "def uid2name(id)\n return id.to_s if id.is_a?(Symbol) or id.is_a?(String)\n return nil if id > Puppet[:maximum_uid].to_i\n\n begin\n user = Etc.getpwuid(id)\n rescue TypeError, ArgumentError\n return nil\n end\n\n if user.uid == \"\"\n return nil\n else\n return user.name\n end\n end",
"title": ""
},
{
"docid": "c09293bec476a36670a93e513285b7b2",
"score": "0.6661841",
"text": "def username\n read_attribute(:username)[0..29].gsub(/[^a-zA-Z0-9_\\-@\\.]/, '-').tr('_', '.')\n end",
"title": ""
},
{
"docid": "9da3fb737bf582cd56153a68370882d6",
"score": "0.6649939",
"text": "def uid\n pdc_id.split('/').last\n end",
"title": ""
},
{
"docid": "e3a8941c38fc45186f3f37d44fab1f17",
"score": "0.6632905",
"text": "def database_username\n data['ssh_username']\n end",
"title": ""
},
{
"docid": "00f51aa3f23ebcd523bfba0ecf01c016",
"score": "0.6632216",
"text": "def username\n _user.username || ''\n end",
"title": ""
},
{
"docid": "f499297b62dfad7fefc7fdaa64695a78",
"score": "0.6615005",
"text": "def database_username\n dna['users'][0]['username']\n end",
"title": ""
},
{
"docid": "fc6e34b33febd09ca29f5673fdd3ee4e",
"score": "0.6592197",
"text": "def username\n @username ||= path[/\\/user\\/(.*)\\/m\\//, 1]\n end",
"title": ""
},
{
"docid": "51627953339326f7e9ea4580820f12ba",
"score": "0.6591517",
"text": "def username\n unless defined?(@username)\n @username ||= user_configuration_from_key('username')\n @username ||= default_username\n end\n @username\n end",
"title": ""
},
{
"docid": "54ca4e32a56adb4fdf521e6914eb4986",
"score": "0.6578419",
"text": "def uid\n Base32::URL.encode(id, split: 4, length: 16)\n end",
"title": ""
},
{
"docid": "54ca4e32a56adb4fdf521e6914eb4986",
"score": "0.6578419",
"text": "def uid\n Base32::URL.encode(id, split: 4, length: 16)\n end",
"title": ""
},
{
"docid": "a0af53f6e5b50001388c54f4fbb28448",
"score": "0.6578261",
"text": "def uid\n Digest::MD5.hexdigest(DateTime.now.strftime(\"%m-%d-%Y:%H%M%S.%12N\")).to_s\n end",
"title": ""
},
{
"docid": "632972930188c91090ef762065393cb5",
"score": "0.65688205",
"text": "def ldap_uid\n self.properties['ldap_uid'] || self.username\n end",
"title": ""
},
{
"docid": "3317be7bb71c81d52dd79293be4bccec",
"score": "0.6558163",
"text": "def whoami\n shellpid = get_session_pid()\n statuspid = pid_uid(shellpid)\n statuspid.each_line do |line|\n split = line.split(\":\")\n if split[0] == \"Uid\"\n regex = /.*\\s(.*)\\s/\n useridtmp = split[1]\n userid = useridtmp[regex, 1]\n uid = userid.to_s\n passwd = read_file(\"/etc/passwd\")\n passwd.each_line do |line|\n parts = line.split(\":\")\n uid_passwd = parts[2].to_s\n user = parts[0].to_s\n if uid_passwd == uid\n return user\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "0506f1521ab2740330d5392fd1053eb6",
"score": "0.6534488",
"text": "def netid\n username, scope = user_key.split('@')\n username if scope == INSTITUTION_PRINCIPAL_NAME_SCOPE\n end",
"title": ""
},
{
"docid": "cd3c67362a11752d4710e0fea5a5c8fc",
"score": "0.6530354",
"text": "def username\n if match = @uri.match(/^.*:\\/\\/(.*?):.*/)\n match[1]\n end\n end",
"title": ""
},
{
"docid": "e80010f4fb3d0275b117f73981e49afe",
"score": "0.6517999",
"text": "def unix_uid; end",
"title": ""
},
{
"docid": "c95648c4f37521843516e31de2a18c73",
"score": "0.65162104",
"text": "def hoster_from_host_id # extract hoster's user_id from host_id\n return (is_host_owner? || is_host_guest?) ? host_id.split(DEV_DELIMITER).second.to_i : nil\n end",
"title": ""
},
{
"docid": "25f63746412d704569ccc1beca5bfe22",
"score": "0.6514854",
"text": "def short_uid\n self.uid.split(/\\-/).first\n end",
"title": ""
},
{
"docid": "89ce48502ef781b221fa822d29738802",
"score": "0.6500077",
"text": "def username\n if auth[:type] == :basic\n auth[:username]\n end\n end",
"title": ""
},
{
"docid": "c76c24c7a0166d9693c40d0e065d2fcc",
"score": "0.64854926",
"text": "def username\n info['username']\n end",
"title": ""
},
{
"docid": "6ea3a1e1330aff02f1a5747d08827477",
"score": "0.64817077",
"text": "def username\n username = FlexCommerceApi.config.flex_account\n username = URI.parse(site).path.split(\"/\").reject(&:empty?).first if username.nil? || username.empty?\n username\n end",
"title": ""
},
{
"docid": "bd831660f2cfe6f169312e69f034cf06",
"score": "0.644962",
"text": "def get_sys_user()\n\tuser = `echo $LOGNAME`\n\treturn user.to_s.strip\nend",
"title": ""
},
{
"docid": "3fd1a0e096e375c487c1532baad1001f",
"score": "0.6441637",
"text": "def get_userid_from_username username\n params = { 'username' => username }\n send_request 'getUserIDFromUsername', params\n end",
"title": ""
},
{
"docid": "3477cb7e9bde7b7231283a84f7887fdd",
"score": "0.6433019",
"text": "def user\n Etc.getpwuid[:gecos].delete(\",\").strip || Rubyist\n end",
"title": ""
},
{
"docid": "887e2eed7584b7895c82cfd0196aacc8",
"score": "0.64082307",
"text": "def puid_hex\n self.puid.unpack('H*').first\n end",
"title": ""
},
{
"docid": "4ab6776c94d6225c4f2dd54407f6fded",
"score": "0.64078414",
"text": "def user_name\n return @config['os']['user']['name']\n end",
"title": ""
},
{
"docid": "766e965a19f95c169589c68a6c50b71b",
"score": "0.6401479",
"text": "def unique_identifier\n Digest::SHA1.hexdigest(\"#{username}:#{password}\")\n end",
"title": ""
},
{
"docid": "124698058578175d6abc0518b857d969",
"score": "0.6399536",
"text": "def username; email.split('@')[0]; end",
"title": ""
},
{
"docid": "8b320389136606030b5153c20d581c6f",
"score": "0.63931304",
"text": "def uid(user)\n begin\n user = Integer(user)\n rescue ArgumentError\n # pass\n end\n if user.is_a?(Integer)\n return nil unless name = get_posix_field(:passwd, :name, user)\n uid = get_posix_field(:passwd, :uid, name)\n check_value = uid\n else\n return nil unless uid = get_posix_field(:passwd, :uid, user)\n name = get_posix_field(:passwd, :name, uid)\n check_value = name\n end\n if check_value != user\n return search_posix_field(:passwd, :uid, user)\n else\n return uid\n end\n end",
"title": ""
},
{
"docid": "9d7a84269944d22105eb517977362eb8",
"score": "0.6390144",
"text": "def get_username\n @user_name ||= user.username\n end",
"title": ""
},
{
"docid": "936d27131468133eb2a296169267de30",
"score": "0.63680667",
"text": "def extract_user_id(username)\n username[2..-2]\n end",
"title": ""
},
{
"docid": "936d27131468133eb2a296169267de30",
"score": "0.63680667",
"text": "def extract_user_id(username)\n username[2..-2]\n end",
"title": ""
},
{
"docid": "a52b37efad440eb9c26a9947aaeb27e1",
"score": "0.63416976",
"text": "def username\n # export GCMD_HTTP_USERNAME=http_username\n @username ||= ENV[\"GCMD_HTTP_USERNAME\"]\n end",
"title": ""
},
{
"docid": "e6c00eaf3cabd701995000720ad6f0c2",
"score": "0.63357764",
"text": "def get_username\n @gitlab.user.username\n end",
"title": ""
},
{
"docid": "26ba67412aaf285026fd45f3c58fa6c1",
"score": "0.63343817",
"text": "def get_username_from_guid(user_guid)\n uaac = get_uaa_client\n uaa_user = uaac.get(:user, user_guid)\n\n uaa_user['username']\n end",
"title": ""
},
{
"docid": "650af5013e9d6d7f0cb22c2569d924bf",
"score": "0.6329182",
"text": "def get_userid(username)\n response = get(\"http://api.fishbans.com/uuid/#{username}\")\n response['uuid']\n end",
"title": ""
},
{
"docid": "eb4b04501bde3eb86602599cc8387974",
"score": "0.6329085",
"text": "def find_homebrew_username(provided_user = nil)\n @homebrew_owner_username ||= Etc.getpwuid(find_homebrew_uid(provided_user)).name\n @homebrew_owner_username\n end",
"title": ""
},
{
"docid": "8dfcdb0311540ad59b33f09c7228a70f",
"score": "0.632716",
"text": "def username\n ENV['DNSIMPLE_USERNAME']\n end",
"title": ""
},
{
"docid": "5a5823802b4d3370cfd0ce4f0e2f06a1",
"score": "0.6322834",
"text": "def uid\n self[:uid] ||= Digest::SHA1.hexdigest(id.to_s)[0...8]\n end",
"title": ""
},
{
"docid": "ee4a1ee28fef4996a6b06ba3b233c5ec",
"score": "0.63221717",
"text": "def user\n `whoami`.strip\n end",
"title": ""
},
{
"docid": "507cee9ff24a6547adecc966ab29ae5c",
"score": "0.6316615",
"text": "def username\n raise InvalidRequest, \"Tried to get username from invalid octokey\" unless valid_auth_request?\n auth_request.username\n end",
"title": ""
},
{
"docid": "b214a050a5ddfc596697fe7453f5a678",
"score": "0.63036394",
"text": "def uid\n rslt = (user_id && team_id) ? \"#{user_id}-#{team_id}\" : nil\n debug { rslt }\n rslt\n end",
"title": ""
},
{
"docid": "5b86a17623c608b990c85c39701fa1f2",
"score": "0.63004285",
"text": "def uid_for uid\n\t\t\t\tsprintf \"#{@uid.slice(0,6)}%02X\", uid\n\t\t\tend",
"title": ""
},
{
"docid": "8a65eede645331eac6696582f3cbff2a",
"score": "0.6290432",
"text": "def getUserID(id)\n return \"EXT-#{@account}-#{id}\".upcase\n end",
"title": ""
},
{
"docid": "e0c93dc8b129ef360d030d5412b20319",
"score": "0.62789655",
"text": "def unix_uid=(_arg0); end",
"title": ""
},
{
"docid": "b88fcfe2c948db24e75eaca2ac9e784c",
"score": "0.62740266",
"text": "def program_chair_user_username\n nil\n end",
"title": ""
},
{
"docid": "2706e5e83708c966ae086758edbf730d",
"score": "0.62729627",
"text": "def username\n email.split(\"@\")[0]\n end",
"title": ""
},
{
"docid": "87b0bc3b45580336cfa82ebb2ada7f1b",
"score": "0.6270966",
"text": "def getUserName\n name = \" \" * 128\n size = \"128\"\n Win32API.new('advapi32','GetUserName', ['P','P'],'I').call(name,size)\n return name.unpack(\"A*\")\nend",
"title": ""
},
{
"docid": "87b0bc3b45580336cfa82ebb2ada7f1b",
"score": "0.6270966",
"text": "def getUserName\n name = \" \" * 128\n size = \"128\"\n Win32API.new('advapi32','GetUserName', ['P','P'],'I').call(name,size)\n return name.unpack(\"A*\")\nend",
"title": ""
},
{
"docid": "8a6b17ab3f4189991eef53a66a98f8a3",
"score": "0.62669307",
"text": "def uid_descriptor(uid)\n info = Etc.getpwuid(uid)\n \n info ? \"#{uid}:#{info.name}\" : uid.to_s\n rescue ArgumentError\n uid.to_s\n end",
"title": ""
},
{
"docid": "227752f6ea2bf4fa5878cf8f528e1a2b",
"score": "0.625923",
"text": "def username\n ENV.fetch('DNSIMPLE_USERNAME', nil)\n end",
"title": ""
},
{
"docid": "1a9f16650ffde82507adbe9d961f6bdd",
"score": "0.62534267",
"text": "def getUserName\n name = \" \" * 128\n size = \"128\"\n Win32API.new('advapi32','GetUserName',['P','P'],'I').call(name,size)\n return name.unpack(\"A*\")\nend",
"title": ""
},
{
"docid": "511c4dfb199da689c3edfa5abe472bc8",
"score": "0.6247076",
"text": "def user_id\n Cproton.pn_message_get_user_id(@impl)\n end",
"title": ""
},
{
"docid": "9189774d3e2a945c6c4670a3d666f955",
"score": "0.62408495",
"text": "def primary_userid\n string_property(:rnp_key_get_primary_uid)\n end",
"title": ""
},
{
"docid": "fa880fcd555809c093b6e013417a0b04",
"score": "0.62399596",
"text": "def ssh_username\n @environment['ssh_username']\n end",
"title": ""
},
{
"docid": "98df0ade44d89a152709d1694f430efe",
"score": "0.6239273",
"text": "def username\n '[email protected]'\n end",
"title": ""
},
{
"docid": "6bfd721fc98fd26b0869fa9a13e9a721",
"score": "0.6237825",
"text": "def current_user\n platform.include?('mswin') ? nil : `id -un`.strip\n end",
"title": ""
},
{
"docid": "d33df054339ae4276f5e85bd42339585",
"score": "0.62359524",
"text": "def getUsername\n begin\n Db.instance.get_first_value(\"SELECT value FROM #{CONFIG_TABLE} WHERE key = 'username'\")\n rescue => e\n @logger.error(e.message)\n end\n end",
"title": ""
},
{
"docid": "670a4a37cba230c5be0f804d6c9bba03",
"score": "0.6230815",
"text": "def username\n @username || @token['data']\n end",
"title": ""
},
{
"docid": "0382f7e349921cfb95a0af8b4edefe4d",
"score": "0.6230553",
"text": "def master_username\n data[:master_username]\n end",
"title": ""
},
{
"docid": "0382f7e349921cfb95a0af8b4edefe4d",
"score": "0.6230553",
"text": "def master_username\n data[:master_username]\n end",
"title": ""
},
{
"docid": "0382f7e349921cfb95a0af8b4edefe4d",
"score": "0.6230553",
"text": "def master_username\n data[:master_username]\n end",
"title": ""
},
{
"docid": "362894485a24139ea93992ba440fad75",
"score": "0.6219053",
"text": "def username\n provided? ? @auth.credentials.first : nil\n end",
"title": ""
},
{
"docid": "631189bb3054a8d71e1001bdadb030fd",
"score": "0.6218957",
"text": "def unique_identifier\n Digest::SHA1.hexdigest(\"#{user_name}:#{password}\")\n end",
"title": ""
},
{
"docid": "4091c20efdffae635a8bfe8c7f71360b",
"score": "0.6207609",
"text": "def username\n self.user_info.username\n end",
"title": ""
},
{
"docid": "ba390bb13f1a5905928ea045b70530ac",
"score": "0.62009764",
"text": "def ssh_username\n environment['ssh_username']\n end",
"title": ""
},
{
"docid": "e8c57102d2c7b6d1f151d9568da256bb",
"score": "0.6196675",
"text": "def uidnumber\n parser_for(:user_uidnumber, user_attributes)\n end",
"title": ""
},
{
"docid": "0c9fbcc295f906936cf97dd2b8cb4086",
"score": "0.6195158",
"text": "def ldap_uid() #:doc:\r\n session[:cas_user]\r\n end",
"title": ""
},
{
"docid": "5d4d7bb2857e33e221d4bfc50d46b26a",
"score": "0.6191458",
"text": "def format_username(username)\n username\n end",
"title": ""
},
{
"docid": "4b3b83b4167cf3e53ba8e5ab76585e36",
"score": "0.61847824",
"text": "def uid\n getUID\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "3c3b752ff580c6c99787a9a1dc5cf95d",
"score": "0.0",
"text": "def casket_params\n params.require(:casket).permit!\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.74959",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6957448",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69232017",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6894128",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.67854404",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.67449695",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.6683308",
"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.6637557",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.662948",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.662788",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.65641665",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.649092",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64797956",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.64552915",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.6400582",
"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.63838357",
"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.6364724",
"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.63412917",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.6337844",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.6326744",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.6322144",
"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": "5ec018b4a193bf3bf8902c9419279607",
"score": "0.63172126",
"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": "37d1c971f6495de3cdd63a3ef049674e",
"score": "0.6315604",
"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": "91bfe6d464d263aa01e776f24583d1d9",
"score": "0.6308472",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.63023496",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.62986314",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6296104",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.629288",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.629288",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62788945",
"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.6274474",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6267891",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "505e334c1850c398069b6fb3948ce481",
"score": "0.62570876",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.6255739",
"text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6252448",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6237188",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.62297666",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.6229325",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6229133",
"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": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62262005",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6201686",
"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.6192431",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.61840314",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61792326",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.61643475",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6162127",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61570275",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.61560357",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.6136865",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.6134677",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.6121851",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61188513",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.61188513",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6114514",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.61120224",
"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.6105032",
"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.6105032",
"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.609908",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.609908",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6086652",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60864824",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.6085158",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6079272",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.6076499",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.60698277",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.6069387",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6067486",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60662013",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.6064436",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.6063694",
"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.60630244",
"text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60587263",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "f78d6fd9154d00691c34980d7656b3fa",
"score": "0.6049716",
"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.6049716",
"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": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.6049526",
"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": "75b7084f97e908d1548a1d23c68a6c4c",
"score": "0.60474473",
"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.60418373",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.60359657",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.60314584",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.6027105",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.60229325",
"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.6021557",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.60177565",
"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.6016767",
"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.60098374",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60070235",
"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.60070235",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.6006955",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60051733",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.60028553",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.6002582",
"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.6002021",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6002021",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.6000165",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.6000129",
"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.6000129",
"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": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.5994901",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "a50ca4c82eaf086dcbcc9b485ebd4261",
"score": "0.59947675",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.599438",
"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.59922063",
"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.59905964",
"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": ""
}
] |
ce3f86057a9d7a3597a7f89b52485cf4
|
Set an environment variable in a user's shell instance We don't have direct access to this, so we must request it Parameters `key` : the key of the environment variable `value` : the value of the environment variable
|
[
{
"docid": "d09a0fd9ec9ad519c60ede44fc163b03",
"score": "0.7718396",
"text": "def setenv(key, value)\n @setenv ||= {}\n @setenv[key] = value\n end",
"title": ""
}
] |
[
{
"docid": "3c6a3eb3e24bbc86ed7ac814b207278e",
"score": "0.80110884",
"text": "def enviroment_set(key, value)\n cmd1 = \"set #{key}=\\\"#{value}\\\";\"\n cmd1 << \"export #{key}=\\\"#{value}\\\"\"\n # fallback\n # sash style\n cmd2 = \"setenv #{key} \\\"#{value}\\\"\"\n shell_command(cmd1)\n shell_command(cmd2)\n end",
"title": ""
},
{
"docid": "82297300c1bdc96badbc3b3ed198d1bf",
"score": "0.7600552",
"text": "def setenv(key, val)\n @environment[key] = val\n end",
"title": ""
},
{
"docid": "98ccda7d79fe711d8c9dbdd9c2655e26",
"score": "0.75433356",
"text": "def set_bash_variable(name, value)\n ENV[name] = value\n end",
"title": ""
},
{
"docid": "46cf8c057791b32c444f1bea1a3757b8",
"score": "0.75284165",
"text": "def setenv(app, key, value)\n file = env_file(app)\n\n host_exec(\"\\\"echo 'export #{key}=\\\\\\\"#{value}\\\\\\\"' >> #{file}\\\"\")\n\n # TODO: remove duplicate keys\nend",
"title": ""
},
{
"docid": "6eebd78d408944ce4f7ada5dacb4ffdf",
"score": "0.7297935",
"text": "def set(value)\n ENV[@key] = value.to_s\n end",
"title": ""
},
{
"docid": "0cd8939e79237ce12481e71e98512ac3",
"score": "0.72512317",
"text": "def set_var(app_guid, key, value)\n request_body = get(\"/v2/apps/#{app_guid}/env\").body[:environment_json]\n request_body[key] = value\n vars = put(\"/v2/apps/#{app_guid}\", body: { environment_json: request_body }).body[:entity]\n { id: key, key: key, value: vars[:environment_json][key] }\n end",
"title": ""
},
{
"docid": "b2baf646b02903c602fcf4dc80cc02c1",
"score": "0.7237606",
"text": "def environment(key, value)\n @platform.environment[key] = value\n end",
"title": ""
},
{
"docid": "bdcd29dddd75aa5fddab7fafcb8e9acc",
"score": "0.7201079",
"text": "def set_environment_variable_cmd(key, value)\n if (value.kind_of?(Hash))\n strings = []\n value.keys.each { |hash_key|\n strings.push(set_environment_variable_cmd(\"#{key}_#{hash_key}\", value[hash_key]))\n }\n strings.push(set_environment_variable_cmd(\"#{key}_length\", value.keys.join(' ')))\n strings.push(set_environment_variable_cmd(\"#{key}_json\", value.to_json))\n strings.join(';')\n\n elsif (value.kind_of?(Array))\n strings = []\n value.each_with_index { |arr_val, i|\n strings.push(set_environment_variable_cmd(\"#{key}_#{i}\", arr_val))\n }\n strings.push(set_environment_variable_cmd(\"#{key}_length\", value.length))\n strings.push(set_environment_variable_cmd(\"#{key}_json\", value.to_json))\n strings.join(';')\n else\n underscored_key = key.to_s.gsub(/[^a-zA-Z0-9_]/, '_')\n escaped_value = value.to_s.gsub(/\"/, '\\\\\\\\\\\\\\\\\\\"')\n \"echo \\\"#{underscored_key}=\\\\\\\"#{escaped_value}\\\\\\\"\\\" >> /etc/environment\"\n end\n end",
"title": ""
},
{
"docid": "f8d382d453c9e7d998efb841d15e8ba8",
"score": "0.708492",
"text": "def setvar(key, value)\n if value.nil?\n ENV.delete(key)\n else\n ENV[key] = value\n end\n true\n end",
"title": ""
},
{
"docid": "4f8681c3ded031e605c3b7cc9da783b9",
"score": "0.706661",
"text": "def add_env_var key, val\n key = key.to_s.upcase\n # see if the key/value pair already exists\n cur_val = get_env_var(key, true)\n subbed_val = cur_val.gsub(/#{Regexp.escape(val.gsub(/'|\"/, ''))}/, '')\n if cur_val.empty?\n exec(powershell(\"[Environment]::SetEnvironmentVariable('#{key}', '#{val}', 'Machine')\"))\n self.close # refresh the state\n elsif subbed_val == cur_val # not present, add it\n exec(powershell(\"[Environment]::SetEnvironmentVariable('#{key}', '#{val};#{cur_val}', 'Machine')\"))\n self.close # refresh the state\n end\n end",
"title": ""
},
{
"docid": "8397fd3778be15d33fab088ea1ef5b47",
"score": "0.7051491",
"text": "def []=(key,value)\n fetch(@environment)[key] = value\n end",
"title": ""
},
{
"docid": "95e548d30179589c685bf20e1496c9fe",
"score": "0.70462126",
"text": "def shell_env_var(name, value)\n if powershell_shell?\n shell_var(\"env:#{name}\", value)\n else\n \"#{shell_var(name, value)}; export #{name}\"\n end\n end",
"title": ""
},
{
"docid": "e7a27062ca47450aaf3323a996e189da",
"score": "0.7045997",
"text": "def set_value(key, value)\n ENV[key.to_s] = value.to_s unless value.is_a?(Hash)\n end",
"title": ""
},
{
"docid": "d8b6c8785b9699089edd0b8a7d02e057",
"score": "0.70430773",
"text": "def shell_env_var(name, value, powershell = false)\n if powershell\n shell_var(\"env:#{name}\", value, true)\n else\n \"#{shell_var(name, value)}; export #{name}\"\n end\n end",
"title": ""
},
{
"docid": "1000f88f25928cbeabe3a9e56095d48f",
"score": "0.68677974",
"text": "def set_variable(variable_name, value)\n agi \"SET VARIABLE\", variable_name, value\n end",
"title": ""
},
{
"docid": "9087468ded988698acba69d20dcedc71",
"score": "0.68033004",
"text": "def setenv(n, v)\n run_command(:setenv, n, v)\n self\n end",
"title": ""
},
{
"docid": "73523e163f77045c50e873e3968191d2",
"score": "0.6764105",
"text": "def set_env_attribute(attr, value)\n request.env[attr.to_s] = value\n end",
"title": ""
},
{
"docid": "2b3b21df51cef9906a4238319420370e",
"score": "0.676126",
"text": "def set_env(spec, key, value, container: 0)\n path = [:containers, container, :env]\n spec.set(path, update_kv(spec.get(path), key, value))\n end",
"title": ""
},
{
"docid": "00f98a40a549e74ff24d503795027b5d",
"score": "0.6751807",
"text": "def update_environment_variable!(environment_variable: nil)\n existing = find_environment_variable(environment_variable_key: environment_variable.key)\n existing.value = environment_variable.value\n end",
"title": ""
},
{
"docid": "85e7708b1cc0ef2bb104cd2b0e9206e2",
"score": "0.664428",
"text": "def setenv name, val\n name = normalize_env_name name\n name = name.to_s\n val = val.nil? ? val : val.to_s\n if env_var_prefix == ''\n _setenv \"CABAR_ENV_#{name}\", val\n end\n _setenv \"#{env_var_prefix}#{name}\", val\n end",
"title": ""
},
{
"docid": "eff99cd15bb340f4f8809abbd7e3efa1",
"score": "0.6637369",
"text": "def set(key,value)\n env[key.to_s] = begin\n case value\n when String\n value\n when Integer, Float\n value.to_s\n when FalseClass, TrueClass\n value.to_s\n when Time, Date\n value.iso8601\n when NilClass\n '~'\n else\n YAML::dump(value)\n end\n end\n end",
"title": ""
},
{
"docid": "59a7c88520b330c3623c54ee6eabe226",
"score": "0.661608",
"text": "def _setenv name, val\n # NOTHING\n end",
"title": ""
},
{
"docid": "9d688693e3425628814de71a7aa3933b",
"score": "0.6591745",
"text": "def []=(key, val)\n @env['orange.env'][key] = val\n end",
"title": ""
},
{
"docid": "6cd07904bd78a215a71fad74fbc86ee3",
"score": "0.65863067",
"text": "def env(variable_name, variable_value, &block)\n send_channel_request(\"env\", :string, variable_name, :string, variable_value, &block)\n end",
"title": ""
},
{
"docid": "cc29977aacfa578af0bfb579200e8959",
"score": "0.6538995",
"text": "def add_env_var(key, value, prefix_cloud_name = false, &blk)\n env_dir = File.join(@homedir,'.env/')\n if prefix_cloud_name\n key = \"OPENSHIFT_#{key}\"\n end\n filename = File.join(env_dir, key)\n File.open(filename,\n File::WRONLY|File::TRUNC|File::CREAT) do |file|\n file.write \"export #{key}='#{value}'\"\n end\n\n if block_given?\n blk.call(value)\n end\n end",
"title": ""
},
{
"docid": "2574426a6fde77ad0b721a015522b844",
"score": "0.6507331",
"text": "def add_environment_variable(key, value)\n self << \"#{key}=#{qualify_value(value)}\"\n end",
"title": ""
},
{
"docid": "e5b8f59bcabc29655d5a6ca122f93527",
"score": "0.6502941",
"text": "def set_value variable_name, variable_value\n sysconfig.set_value(get_sysconfig_varid(variable_name), variable_value, false, false)\n end",
"title": ""
},
{
"docid": "2a72903200aaa7b371b65acb58115636",
"score": "0.64756787",
"text": "def load!\n ENV[variable] = value\n end",
"title": ""
},
{
"docid": "7af26e264690f7d80d214a2be2b43638",
"score": "0.64170057",
"text": "def set_value(key, value, options = {})\n if $config[key].nil? || $config[key] == '' || ($config[key] != value && options[:force] != false)\n puts \"Setting #{key} to #{value}\" unless options[:silent]\n puts set_env(key, value)\n $config[key] = value\n end\n end",
"title": ""
},
{
"docid": "f63454f58869c9967efee9b2d3c5b722",
"score": "0.6372024",
"text": "def env_or_set(variable, value=nil, &block)\n value = if ENV[variable.to_s].nil?\n value\n else\n if ENV[variable.to_s] == /^:/\n ENV[variable.to_s].to_sym\n else\n ENV[variable.to_s].to_s\n end\n end\n set( variable ) {\n value = block.call if block_given? && value.nil?\n value = true if value =~ /true/i\n value = false if value =~ /false/i\n value\n }\nend",
"title": ""
},
{
"docid": "792ef30624e351ca0da8c104d3bc82f9",
"score": "0.63702464",
"text": "def clear_env_var key\n key = key.to_s.upcase\n exec(powershell(\"[Environment]::SetEnvironmentVariable('#{key}', $null, 'Machine')\"))\n exec(powershell(\"[Environment]::SetEnvironmentVariable('#{key}', $null, 'User')\"))\n exec(powershell(\"[Environment]::SetEnvironmentVariable('#{key}', $null, 'Process')\"))\n self.close # refresh the state\n end",
"title": ""
},
{
"docid": "4b459f6892e11362f205346153c522bc",
"score": "0.6350639",
"text": "def add_env_var(key, value, prefix_cloud_name = false, &blk)\n env_dir = PathUtils.join(@container_dir, '.env/')\n key = \"OPENSHIFT_#{key}\" if prefix_cloud_name\n\n filename = PathUtils.join(env_dir, key)\n File.open(filename, File::WRONLY|File::TRUNC|File::CREAT) do |file|\n file.write value.to_s\n end\n set_ro_permission(filename)\n\n if block_given?\n blk.call(value)\n end\n end",
"title": ""
},
{
"docid": "4b459f6892e11362f205346153c522bc",
"score": "0.6350639",
"text": "def add_env_var(key, value, prefix_cloud_name = false, &blk)\n env_dir = PathUtils.join(@container_dir, '.env/')\n key = \"OPENSHIFT_#{key}\" if prefix_cloud_name\n\n filename = PathUtils.join(env_dir, key)\n File.open(filename, File::WRONLY|File::TRUNC|File::CREAT) do |file|\n file.write value.to_s\n end\n set_ro_permission(filename)\n\n if block_given?\n blk.call(value)\n end\n end",
"title": ""
},
{
"docid": "310cc8841153260d96b44b4d2718abca",
"score": "0.6349168",
"text": "def set_variable(name, value)\n current_path = '/api/v1/variables'\n payload = { 'name' => name, 'value' => value }.to_json\n @conn.put(current_path, payload)\n end",
"title": ""
},
{
"docid": "f34d0f72d9b220f6be9b832701112d06",
"score": "0.634424",
"text": "def set(key, value)\n vars[key.to_s] = value\n end",
"title": ""
},
{
"docid": "18b1a2ebc5715a6dab6f7da49459d61d",
"score": "0.6291144",
"text": "def environment=(v)\n opts[:environment] = v\n end",
"title": ""
},
{
"docid": "f518e984a9bc75e8a1974d75d18d855b",
"score": "0.6289684",
"text": "def create_environment_variable!(key: nil, value: nil)\n environment_variables = self.environment_variables\n new_environment_variable = EnvironmentVariable.new(\n key: key,\n value: value\n )\n\n environment_variables.push(new_environment_variable)\n self.environment_variables = environment_variables\n logger.debug(\"Added ENV variable #{new_environment_variable.key}, \" \\\n \"writing out environment_variables.json to #{environment_file_path}\")\n return new_environment_variable\n end",
"title": ""
},
{
"docid": "326cf547e6982e4fc4ace268bc60af5b",
"score": "0.62717605",
"text": "def shell_var(name, value)\n if powershell_shell?\n %{$#{name} = \"#{value}\"}\n else\n %{#{name}=\"#{value}\"}\n end\n end",
"title": ""
},
{
"docid": "559caaf37ee110eb3c35702258252380",
"score": "0.62702525",
"text": "def set(setting, value = nil)\n if value\n command \"set #{setting}=#{value}\"\n else\n command \"set #{setting}\"\n end\n end",
"title": ""
},
{
"docid": "ec9c4c816e28f3d1198e936d551bee97",
"score": "0.6246444",
"text": "def set(key, value)\n @globals[key] = value\n end",
"title": ""
},
{
"docid": "f4642c7dc286c67b9ac750e323b8696b",
"score": "0.6210326",
"text": "def shell_set_command\n case\n when scope == :global\n \"set -g #{name} #{value}\"\n else\n raise NotImplementedError\n end\n end",
"title": ""
},
{
"docid": "2a4bc0a2c937be1abf8d38b82efeb7ee",
"score": "0.62082213",
"text": "def []=(key, value)\n @shell.system(\"git\", \"config\", \"heidi.#{key}\", value)\n end",
"title": ""
},
{
"docid": "42b0380e1f2fe1db432ea09b86ef3f45",
"score": "0.6194648",
"text": "def shell_var(name, value, powershell = false)\n if powershell\n %{$#{name} = \"#{value}\"}\n else\n %{#{name}=\"#{value}\"}\n end\n end",
"title": ""
},
{
"docid": "9d85ca06e79d2b6bd2b659bece835918",
"score": "0.61929226",
"text": "def environment=(env); end",
"title": ""
},
{
"docid": "e85225ed904998c3f2ed6be90ef2813b",
"score": "0.6156209",
"text": "def set_preference(key, value)\n session[\"preference_#{key}\"] = value\n end",
"title": ""
},
{
"docid": "7bf11ddd32f1023361294373f09da59e",
"score": "0.6155096",
"text": "def []=(name, value)\n env[name.to_s] = value.to_s\n\n self\n end",
"title": ""
},
{
"docid": "3c482f2a450891b1fa6eceebe6f6f0f6",
"score": "0.61529887",
"text": "def set_variable(k,v)\n key = k.to_s.upcase.to_sym\n variables[key] = v\n end",
"title": ""
},
{
"docid": "348364739994dada8518c42463d3ecda",
"score": "0.615009",
"text": "def env(name, value)\n requires_from!(:env)\n log_step('env', name, value)\n chain.run(\"# SET ENV #{name}\", env: [\"#{name}=#{value}\"])\n self\n end",
"title": ""
},
{
"docid": "e4230208b2bb626dfe58b18880043d86",
"score": "0.6126583",
"text": "def environment(name, value)\n @project.environment[name] = value\n end",
"title": ""
},
{
"docid": "540fa7c2448147ea5ebc3e32023eb87e",
"score": "0.6086487",
"text": "def with_env(key, value)\n old_value = ENV[key]\n ENV[key] = value\n\n yield\n ensure\n ENV[key] = old_value\n end",
"title": ""
},
{
"docid": "eb0dbf7da4decd9217503a20b5b7d48c",
"score": "0.6084539",
"text": "def set(key, value)\n string = Marshal.dump value\n @cass.insert @cf, \"globals\", { key.to_s => string }\n end",
"title": ""
},
{
"docid": "ae088c051354488afe3f1e3778cbf849",
"score": "0.608224",
"text": "def remote_env(value)\n result = \"\"\n run(\"echo $#{value}\", :once => true) do |ch, stream, data|\n raise \"could not get environment variable #{value}: #{data}\" if stream == :err\n result << data\n end\n result.chomp\n end",
"title": ""
},
{
"docid": "3d84e1d3d8625a6b098daa3f083b33f1",
"score": "0.6082106",
"text": "def set_env\n @env = Env.find(params[:id])\n end",
"title": ""
},
{
"docid": "3d84e1d3d8625a6b098daa3f083b33f1",
"score": "0.6082106",
"text": "def set_env\n @env = Env.find(params[:id])\n end",
"title": ""
},
{
"docid": "6ce504a737bac159afe3c7a27f4d7979",
"score": "0.6074766",
"text": "def set(var,val) $USER.send(\"#{var}=#{val}\"); nil; end",
"title": ""
},
{
"docid": "1b425497a6c6c3279cbceffdc2a96c72",
"score": "0.6064552",
"text": "def setenv\n @ssh_env.split.join(';')\n end",
"title": ""
},
{
"docid": "774956c8221684aa850897b933e3b301",
"score": "0.60643214",
"text": "def apikey_env_var_name=(apikey_env_var_name)\n options[:apikey_env_var_name] = apikey_env_var_name\n end",
"title": ""
},
{
"docid": "906c9f5f687c3676cd8a66fb356427de",
"score": "0.6062494",
"text": "def _setenv name, val \n if verbose\n $stderr.puts \"# #{$0} setenv #{name.inspect} #{val.inspect}\"\n end\n name = normalize_env_name name\n if (v = @env[name]) && ! @env[save_name = \"CABAR_BEFORE_#{name}\"]\n @env[save_name] = v\n end\n if val == nil\n @env.delete(name)\n else\n @env[name] = val\n end\n\n if name == 'RUBYLIB' && @env.object_id == ENV.object_id && val != nil\n $:.clear\n $:.push(*Cabar.path_split(val))\n # $stderr.puts \"Changed $: => #{$:.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "20f0089c47ada1b74d23b2e9ef8b30e1",
"score": "0.6061249",
"text": "def get_env_var key, clean = false\n self.close # refresh the state\n key = key.to_s.upcase\n val = exec(Beaker::Command.new(\"set #{key}\"), :accept_all_exit_codes => true).stdout.chomp\n return '' if val.empty?\n\n val = val.split(\"\\n\")[0] # only take the first result\n if clean\n val.gsub(/#{key}=/i, '')\n else\n val\n end\n end",
"title": ""
},
{
"docid": "c78f29d1265d2f94faf90827059c524a",
"score": "0.6054051",
"text": "def set(i) \n env = ENV[i.upcase] \n if env.nil? \n aborts(\"\\nCommand line arguments missing!,Clue : #{i}\\n\\n\") \n else \n instance_variable_set(\"@\" + i, env) \n end \n end",
"title": ""
},
{
"docid": "6e9d92d2c5b4a5e5248b3ec664e0d940",
"score": "0.603397",
"text": "def set(name, value)\n\t\t\tcommand('set', name, value)\n\t\tend",
"title": ""
},
{
"docid": "67aaa4591b862eed5315c742173a57f8",
"score": "0.60195816",
"text": "def set_without_record(value)\n ENV[key] = value\n\n self\n end",
"title": ""
},
{
"docid": "b7a096bc282c3f847fd83bf5c2a7e80f",
"score": "0.60166186",
"text": "def environment=(value)\n @environment = value\n end",
"title": ""
},
{
"docid": "b7a096bc282c3f847fd83bf5c2a7e80f",
"score": "0.60166186",
"text": "def environment=(value)\n @environment = value\n end",
"title": ""
},
{
"docid": "8cbcc1110412c20456d0408f00912037",
"score": "0.60100734",
"text": "def env!(k)\n v = ENV[k]\n if !v\n $stderr.puts(\"Must set #{k} in environment\")\n Kernel.exit(1)\n end\n v\n end",
"title": ""
},
{
"docid": "8cbcc1110412c20456d0408f00912037",
"score": "0.60100734",
"text": "def env!(k)\n v = ENV[k]\n if !v\n $stderr.puts(\"Must set #{k} in environment\")\n Kernel.exit(1)\n end\n v\n end",
"title": ""
},
{
"docid": "b62301cf33335e12db4cdad5b2afeea7",
"score": "0.6007924",
"text": "def set(var_name, value)\n \tsetting = get(var_name)\n \tif (! setting.nil?)\n \tsetting.value = value\n \tsetting.save\n else\n Settings.set(var_name, value, name)\n end\n\tend",
"title": ""
},
{
"docid": "2c41d02939b8e93971a598895140fab1",
"score": "0.59706527",
"text": "def env=(environment); end",
"title": ""
},
{
"docid": "422794829814ca0668f871113e0a5411",
"score": "0.59623086",
"text": "def _var_set key, val\n \t\tSdb[:_vars].filter(:vkey => key.to_s).update(:vval => val.to_s, :changed => Time.now)\n# \t\t_submit(:_vars, :fkv => argv, :opt => :update) unless argv.empty?\n\tend",
"title": ""
},
{
"docid": "769e3cef9bf9d2eab13e4ca99ac92a18",
"score": "0.5939945",
"text": "def set_credential(variable_name)\n if ENV[variable_name].nil?\n public_send(\"#{variable_name.downcase}=\", \"\")\n else\n public_send(\"#{variable_name.downcase}=\", ENV[variable_name])\n end\n end",
"title": ""
},
{
"docid": "cffafe03ef385df0b7794b19b9b43f60",
"score": "0.59397936",
"text": "def set_value_for_env!(*args)\n att = args.shift\n if value_env_dependent?(att)\n puts \"#{att} is env_dependent\"\n set_value_for!(att,environment,args.first)\n else\n set_value_for!(att,args.first)\n end\n end",
"title": ""
},
{
"docid": "1d523df451338770da267bf8d425e936",
"score": "0.5933962",
"text": "def set_variable _key, _value\n _key = \"rarma_var_#{_key}\"\n @variables[_key] = _value\n SQF.setVariable @this, _key, _value\n end",
"title": ""
},
{
"docid": "e3c99085880e23145d78d530626e15b5",
"score": "0.5929111",
"text": "def envvar\n CircleCi.request(\"#{base_path}/envvar\").get\n end",
"title": ""
},
{
"docid": "b9536160875064c9ae566a51e22dafd3",
"score": "0.59259033",
"text": "def test_env\n set_env('VALUE', 'value')\n assert_equal(Config.env('VALUE'), 'value')\n end",
"title": ""
},
{
"docid": "1e8971f0c96f6690fbca7952e68208cf",
"score": "0.5924878",
"text": "def set(key, value)\n vars[key.to_s.downcase] = value\n end",
"title": ""
},
{
"docid": "5ede610bd8b9023cd388f8e562dde2ee",
"score": "0.5922306",
"text": "def render r\n r.setenv(env_var, expand_string(value))\n end",
"title": ""
},
{
"docid": "5ede610bd8b9023cd388f8e562dde2ee",
"score": "0.5922306",
"text": "def render r\n r.setenv(env_var, expand_string(value))\n end",
"title": ""
},
{
"docid": "2242d007a29e33dd05fd6a85728be4b0",
"score": "0.5915498",
"text": "def environment=(value)\n super value.to_s\n end",
"title": ""
},
{
"docid": "1bc48970053eda02d96faa1cbbfa25b6",
"score": "0.5913781",
"text": "def set_variable(name, value) \r\n \t\tmsg=\"SET VARIABLE \" + name + \" \" + value\r\n \t\tsend(msg)\r\n \t\treturn get_int_result()\r\n \tend",
"title": ""
},
{
"docid": "5cf2a1114e9e76a39113a4e980b8bd5a",
"score": "0.5910052",
"text": "def set_session_setting(key, value)\n if session[:settings].nil?\n session[:settings] = {}\n end\n\n session[:settings][key.to_sym] = value\n end",
"title": ""
},
{
"docid": "216b02950818612c62e02fdf0d035e40",
"score": "0.5906055",
"text": "def put_variable(name, value)\n @driver.put_variable(@handle, name, value)\n end",
"title": ""
},
{
"docid": "9606ab8e746421485d61f5d509d18b8b",
"score": "0.590103",
"text": "def set_default_env(name, value)\n default_env[name.to_s] = value\n end",
"title": ""
},
{
"docid": "ebd1357e139012a3b65197bdda5c762f",
"score": "0.58941454",
"text": "def env_set_optional(variable)\n value = if ENV[variable.to_s] == /^:/\n ENV[variable.to_s].to_sym\n else\n ENV[variable.to_s].to_s\n end\n set(variable, value) unless value.empty?\nend",
"title": ""
},
{
"docid": "6ba65bdb47289aa45881fb499b44bb1c",
"score": "0.58825666",
"text": "def set?(var)\n @env.key?(var)\n end",
"title": ""
},
{
"docid": "ce11182056d9a75004be84d7b8d9c8a4",
"score": "0.5872684",
"text": "def value\n ENV[key]\n end",
"title": ""
},
{
"docid": "49aac92fac2a28bc6b195b2c592792f9",
"score": "0.5851909",
"text": "def environment=(env_value)\n @environment = env_value\n end",
"title": ""
},
{
"docid": "733a7de7f8a4c294890e25cdc61c30c2",
"score": "0.584744",
"text": "def set_envfile\n @envfile = Envfile.find(params[:id])\n end",
"title": ""
},
{
"docid": "0cbe9262bf240655417266fb1e022a6a",
"score": "0.58460593",
"text": "def with_env(name, value)\n saved, ENV[name] = ENV[name], value.to_s\n yield\nensure\n ENV[name] = saved\nend",
"title": ""
},
{
"docid": "73a71e15004e4706139ec14de32720ae",
"score": "0.5845004",
"text": "def set_environment(enviro)\r\n @@environment = enviro\r\n end",
"title": ""
},
{
"docid": "dd916b95f51eb278b5dcc5bf2e55e893",
"score": "0.58397233",
"text": "def __set_var(name, val)\n @args[:communicator].communicate(type: \"set_var\", id: @args[:id], name: name, val: val)\n nil\n end",
"title": ""
},
{
"docid": "4989311b7f1c3d341a84fb4020049da4",
"score": "0.5834448",
"text": "def environment=(env)\n \tenv = env.to_sym\n \traise ArgumentError, \"#{env.inspect} is not a valid environment\" unless [:sandbox, :live].include?(env)\n \t@environment = env\n \tend",
"title": ""
},
{
"docid": "e27f15ddcc8821fae040493ab3a49a0f",
"score": "0.5825578",
"text": "def rack_api_key_request_setter(env, api_key_lookup_val)\n \tenv[@options[:rack_api_key]] = api_key_lookup_val\n end",
"title": ""
},
{
"docid": "4224ebd29d07bb4eb26a85dc55b420fe",
"score": "0.5817163",
"text": "def get_envvar(name)\n CircleCi.request(\"#{base_path}/envvar/#{name}\").get\n end",
"title": ""
},
{
"docid": "46ec16d5bd86eefcbb6e03ded9ea1e4d",
"score": "0.5804685",
"text": "def set_config(var)\n raise Chaos::Error, \"Config var must be in bash format (NAME=value)\" if !var.match /^\\w*=\\w*$/\n @server.connect do\n var_name = var.split('=')[0]\n display_ \"Setting #{var}\" do\n rebuild_env_file @server, \"#{@home}/config/env\", unset: [var_name], set: [var], as: @name\n 'done'\n end\n end\n restart\n end",
"title": ""
},
{
"docid": "bb845e04cbd3a4278a950a4f3de5808d",
"score": "0.58036155",
"text": "def set_var(act, var, value)\n begin\n Twke::Conf::set(var, value)\n rescue => err\n act.say \"Failure setting variable #{var}=#{value}: #{err.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "da993a32c445994ee1375cef6bd74180",
"score": "0.5800878",
"text": "def set(key, value)\n settings[key.to_sym] = value\n end",
"title": ""
},
{
"docid": "da993a32c445994ee1375cef6bd74180",
"score": "0.5800878",
"text": "def set(key, value)\n settings[key.to_sym] = value\n end",
"title": ""
},
{
"docid": "f46f2de136595079e369bfd6cf56797a",
"score": "0.57996494",
"text": "def to_env\n %Q{#{key}=\"#{value}\" }\n end",
"title": ""
},
{
"docid": "50b946604158115c4ce5770a127378ee",
"score": "0.5796232",
"text": "def set(key, value)\n cmd = \"#{key}=\"\n\n return send(cmd, value.to_s.casecmp('true').zero?) if boolean?(key) && respond_to?(cmd)\n\n send(cmd, value.strip) if respond_to?(cmd) && value.present?\n end",
"title": ""
},
{
"docid": "d04338d62f17471eb952d5d71b5bcac5",
"score": "0.5796185",
"text": "def set key, value\n run_method(:set, key, value)\n end",
"title": ""
}
] |
db4d1560e7efb770a18df065e54aa347
|
POST /accommodation_categories POST /accommodation_categories.json
|
[
{
"docid": "911d38b0f6f6abddb18227dbe832a680",
"score": "0.72065306",
"text": "def create\n @accommodation_category = AccommodationCategory.new(accommodation_category_params)\n\n respond_to do |format|\n if @accommodation_category.save\n format.html { redirect_to @accommodation_category, notice: 'Accommodation category was successfully created.' }\n format.json { render :show, status: :created, location: @accommodation_category }\n else\n format.html { render :new }\n format.json { render json: @accommodation_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "2e413155a54df8bd90ccd162b27efc30",
"score": "0.6839374",
"text": "def CreateCategory params = {}\n \n APICall(path: 'categories.json',method: 'POST',payload: params.to_json)\n \n end",
"title": ""
},
{
"docid": "9667f5248a9d1608325dd16ffdd42c28",
"score": "0.68027866",
"text": "def index\n @accommodation_categories = AccommodationCategory.all\n end",
"title": ""
},
{
"docid": "de1019d3d161e462915d4ceb82ed94b7",
"score": "0.66106164",
"text": "def create_category payload\n\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post CATEGORIES, payload )\n\t\t\t\tend",
"title": ""
},
{
"docid": "e745a944fc75fd9d5d2dce78e9de358d",
"score": "0.6552231",
"text": "def accommodation_category_params\n params.require(:accommodation_category).permit(:name)\n end",
"title": ""
},
{
"docid": "644a7ee7e8e207936d994588c6c3c14c",
"score": "0.65380603",
"text": "def set_accommodation_category\n @accommodation_category = AccommodationCategory.find(params[:id])\n end",
"title": ""
},
{
"docid": "b35aec93ae8d0606144c97a0ec4b9ad6",
"score": "0.65131426",
"text": "def create\n @categorization = Categorization.new(params[:categorization])\n @categories = category_list\n respond_to do |format|\n if @categorization.save\n format.html { redirect_to(admin_categorization_path(@categorization), :notice => 'Categorization was successfully created.') }\n format.xml { render :xml => @categorization, :status => :created, :location => @categorization }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @categorization.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "400a06e2e7ace49ddcf6e9af9859f28f",
"score": "0.64925194",
"text": "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend",
"title": ""
},
{
"docid": "1120e906df8a6d0ffba23eb5c91d43f5",
"score": "0.6453009",
"text": "def create\n @category = Category.new(category_params)\n @category.save\n render json: { params: params, notice: 'Categoria registrada exitosamente' }\n end",
"title": ""
},
{
"docid": "86c877fcf57fac89c1161f1ad8145fcf",
"score": "0.6447237",
"text": "def create\n @categoria = Categoria.new(categoria_params)\n if @categoria.save\n render json: @categoria\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "165785be46fdb5021d066d203b97bcfa",
"score": "0.64025456",
"text": "def create\n @accessory_category = AccessoryCategory.new(accessory_category_params)\n\n if @accessory_category.save\n audit(@accessory_category, current_user)\n render json: @accessory_category, status: :created\n else\n render json: @accessory_category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9eaa8c47bf1217eac58a330c4442e8c3",
"score": "0.63462013",
"text": "def create\n @categ = Categ.new(categ_params)\n\n respond_to do |format|\n if @categ.save\n format.html { redirect_to @categ, notice: 'Categ was successfully created.' }\n format.json { render :show, status: :created, location: @categ }\n else\n format.html { render :new }\n format.json { render json: @categ.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9ac308adda6de6b8ac1dde8045f2d78",
"score": "0.6291621",
"text": "def create\n if params[:categoria_producto]\n p = Producto.find(params[:producto_id])\n c = Categoria.find(params[:categoria_id])\n\n if p.categorias << c\n render json: c, status: :created\n else\n render json: {:errors => {categoria: [\"No se ha podido agregar categoria\"]}}, status: :unprocessable_entity\n end\n\n else\n @categoria = Categoria.new(parametros_categoria)\n\n if @categoria.save\n render json: @categoria, status: :created\n else\n render json: @categoria.errors, status: :unprocessable_entity\n end\n end\n end",
"title": ""
},
{
"docid": "1185341ff27286507fc855a60e3b4a2d",
"score": "0.6288623",
"text": "def create\n category = @current_user.categories.create!(category_params)\n render json: { category: category }\n end",
"title": ""
},
{
"docid": "204018fe38114e1be73978d1fe87c110",
"score": "0.627604",
"text": "def create\n @incidentcategory = Incidentcategory.new(incidentcategory_params)\n\n if @incidentcategory.save\n json_response(@incidentcategory)\n else\n render json: @incidentcategory.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "58f100bd42ad2dfd121248de83b2fbc9",
"score": "0.62737167",
"text": "def create\n json_create(category_params, Category)\n end",
"title": ""
},
{
"docid": "cacba9b29648f5d55aa2ed4498d7e1fe",
"score": "0.6240796",
"text": "def create\n @abuse_category = AbuseCategory.new(params[:abuse_category])\n\n respond_to do |format|\n if @abuse_category.save\n format.html { redirect_to @abuse_category, notice: 'Abuse category was successfully created.' }\n format.json { render json: @abuse_category, status: :created, location: @abuse_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @abuse_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b057f6feef310937664c4f2cf2a16de",
"score": "0.62314177",
"text": "def create\n @category = current_mall.categories.new(params[:category])\n\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "643e5ba16e2ee624b213cdb00bc43aa6",
"score": "0.62063426",
"text": "def create\n @available_category = AvailableCategory.new(available_category_params)\n\n respond_to do |format|\n if @available_category.save\n format.html { redirect_to admin_available_categories_path, notice: 'Available category was successfully created.' }\n format.json { render :show, status: :created, location: @available_category }\n else\n format.html { render :new }\n format.json { render json: @available_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd608cc268d5ca83c7e3692177206744",
"score": "0.62033194",
"text": "def create\n @agendacategory = Agendacategory.new(agendacategory_params)\n\n respond_to do |format|\n if @agendacategory.save\n format.html { redirect_to @agendacategory, notice: 'Agendacategory was successfully created.' }\n format.json { render :show, status: :created, location: @agendacategory }\n else\n format.html { render :new }\n format.json { render json: @agendacategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2398a142df0082d2299652ce0ea677ac",
"score": "0.6184092",
"text": "def create\n if @category.save\n render json: @category, status: :created, location: @category\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "2878580e5f33843c517a82aafd2e23a0",
"score": "0.61840516",
"text": "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to management_categories_path }\n format.json { render json: @category, status: :created }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22142984b2c7062d0280d30955d9a6e8",
"score": "0.6173002",
"text": "def create\n @category = Category.new(category_params)\n authorize! :create, @category\n if @category.save\n render json: @category, status: :created\n else\n render json: @category.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ecf2badfca33f55423a2ca6db6a69073",
"score": "0.61586547",
"text": "def create\n @category = current_user.categories.new(name: params[:name])\n if @category.save\n render \"create.json.jbuilder\", status: :created\n else\n render json: { errors: @category.errors.full_messages }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "04779fc6a7223751fb3e79f2b7a6f82c",
"score": "0.61517936",
"text": "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end",
"title": ""
},
{
"docid": "7f7094198250528d00572ee5c7cc180c",
"score": "0.6136036",
"text": "def create\n \n @categorias_tipo = CatTipo.new(params[:cat_tipo])\n\n\t\trespond_to do |format|\n\t\t\tif @categorias_tipo.save\n \t\t\tcategories = @categorias_tipo.update_attributes(:tipo_acc_ids =>params[:tipo_accs])\n\t\t\t\t@categorias_tipo.update_attributes(:estado_ids =>params[:estados])\n\t\t\t\t\n\t\t\t\n\n format.html { redirect_to cat_tipos_path, notice: 'OK' }\n format.json { render json: @categorias_tipo, status: :created, location: @categorias_tipo }\n\t\t\telse\n format.html { render action: \"new\" }\n format.json { render json: @categorias_tipo.errors, status: :unprocessable_entity }\n \tend\t\n\t\tend\n\tend",
"title": ""
},
{
"docid": "2aee50874e20972de4574a9c5c699f6c",
"score": "0.61241716",
"text": "def budget_categories_data\n # @budget.budget_items.collect { |budget_item| budget_item.category.name.to_s }.to_json\n categories = Category.for_budget.to_a\n categories << Category.find_by_name(\"Miscellaneous\")\n return categories.collect { |category| category.name.to_s }.to_json\n end",
"title": ""
},
{
"docid": "dbeda129a02e042d34c608b028e3c1f9",
"score": "0.60980135",
"text": "def create\n @categor = Categor.new(categor_params)\n\n respond_to do |format|\n if @categor.save\n format.html { redirect_to @categor, notice: 'Categor was successfully created.' }\n format.json { render :show, status: :created, location: @categor }\n else\n format.html { render :new }\n format.json { render json: @categor.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d353cd6c6c9b10f85574f5801dd4e03c",
"score": "0.60963744",
"text": "def create\n @category = @collection.categories.new(category_params)\n\n if @category.save\n ActionCable.server.broadcast 'categories',\n title: @category.title,\n collection_id: @category.collection_id\n head :ok\n else\n\n end\n end",
"title": ""
},
{
"docid": "95b8f62938011e9a813a48639eb25f77",
"score": "0.6089841",
"text": "def create\n\n # @category = Category.new(params[:category])\n @category = current_user.categories.build(params[:category])\n\n respond_to do |format|\n if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.html { redirect_to categories_path, notice: 'Pomyślnie utworzono kategorię.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n # format.html { render action: \"new\" }\n format.html { redirect_to categories_path, :flash => { :error => 'Nie udało się utworzyć kategorii' } }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02f5619cc7b03717a3c4ed3bed11900f",
"score": "0.6086034",
"text": "def addCat()\n if(!authenticateAdmin(params[:admin_id], params[:admin_auth_key]))\n render json: {status: false, reason: \"Authentication Failed\", data: \"\"}\n return\n end\n c = Category.new(name: params[:name])\n status = c.save\n error = \"\"\n if(c.errors.full_messages.count > 0)\n error = c.errors.full_messages[0]\n end\n render json: {status: status, reason: error, data: \"\"}\n end",
"title": ""
},
{
"docid": "4611ea81f2362c862dc81179f901622e",
"score": "0.60749185",
"text": "def create\n @charity_category = CharityCategory.new(params[:charity_category])\n\n respond_to do |format|\n if @charity_category.save\n format.html { redirect_to admins_charity_categories_url, notice: 'Charity Category was successfully created.' }\n format.json { render json: @charity_category, status: :created, location: @charity_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @charity_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bf0849f42c2d7aa723ba0f780d8c1a1e",
"score": "0.6073688",
"text": "def user_category\n # byebug\n @user = User.where(contact: params[:contact]).first\n params[:category_ids].each do |category|\n @user.user_categories.create!(category_id: category, user_id: @user.id)\n end\n render json: {status: \"SUCCESS\", message: \"user-data\", data: \"category saved\"}, status: :ok\n end",
"title": ""
},
{
"docid": "2d83a5a67252eed38122490cb9a90711",
"score": "0.6069061",
"text": "def create\n @expense = @current_user.expenses.create(params[:expense])\n params[:expense][:categories].each do |category_id|\n category_id = category_id.to_i\n if category_id > 0\n @expense.categories << Category.find(category_id)\n end\n end\n respond_to do |format|\n if @expense.save\n flash[:notice] = 'Expense was successfully created.'\n format.html { redirect_to(@expense) }\n format.xml { render :xml => @expense, :status => :created, :location => @expense }\n format.iphone { redirect_to(@expense) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @expense.errors, :status => :unprocessable_entity }\n format.iphone { render :action => \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "7cd57850e5f6508847c06550a08e746b",
"score": "0.6065052",
"text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_categories_path, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03450c9ba816dfd45069e9ccdcc8e641",
"score": "0.6047143",
"text": "def create\n @categories = Category.where(validity: true)\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: t(:category_created) }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "62f2b2e3e0cb5e65d69e06a0b70fc10c",
"score": "0.60429585",
"text": "def agendacategory_params\n params.require(:agendacategory).permit(:category)\n end",
"title": ""
},
{
"docid": "b7aea78673240b9eead580d5b6d8303d",
"score": "0.6037366",
"text": "def create\n @category = Category.new(params[:category])\n @category.category_group_id ||= params[:category_group_id]\n\n respond_to do |format|\n if @category.save\n save_curated_items(@category)\n format.html { redirect_to(categories_path, notice: 'Category was successfully created.') }\n format.json { render json: @category, status: :created, location: @category }\n else\n set_flash_messages_from_errors(@category)\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e5ead5d98f655201d475d664fff8f1a",
"score": "0.6036476",
"text": "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to adminpanel_categories_path, notice: \"Категория #{@category.name} успешно создана\" }\n format.json { render :show, status: :created, location: adminpanel_categories_path }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ee22c7f3948695b85e47fba950a2fb6",
"score": "0.6031211",
"text": "def create\n @categorie_competence = CategorieCompetence.new(categorie_competence_params)\n\n respond_to do |format|\n if @categorie_competence.save\n format.html { redirect_to @categorie_competence, notice: 'Categorie competence was successfully created.' }\n format.json { render :show, status: :created, location: @categorie_competence }\n else\n format.html { render :new }\n format.json { render json: @categorie_competence.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ecf1bddecefbd4ff306151766049f8fb",
"score": "0.6027029",
"text": "def create\n @exhibitior_category = ExhibitiorCategory.new(params[:exhibitior_category])\n\n respond_to do |format|\n if @exhibitior_category.save\n format.html { redirect_to @exhibitior_category, notice: 'Exhibitior category was successfully created.' }\n format.json { render json: @exhibitior_category, status: :created, location: @exhibitior_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exhibitior_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e60a49499568d70af62da9f36c8bbd2",
"score": "0.60225785",
"text": "def create\n @contractor_category = ContractorCategory.new(contractor_category_params)\n\n respond_to do |format|\n if @contractor_category.save\n format.html { redirect_to @contractor_category, notice: 'Contractor category was successfully created.' }\n format.json { render :show, status: :created, location: @contractor_category }\n else\n format.html { render :new }\n format.json { render json: @contractor_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2db2cd9acaa67d60f732b71dbf42ccd",
"score": "0.5994242",
"text": "def create\n @categories_category_expense = manager.create(categories_category_expense_params, current_user)\n\n respond_to do |format|\n if @categories_category_expense.save\n format.html { redirect_to categories_category_expenses_path, notice: 'Category expense was successfully created.' }\n format.json { render :show, status: :created, location: @categories_category_expense }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @categories_category_expense.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48bc9a57e319eeb380bffeaf5b6b104f",
"score": "0.59911144",
"text": "def create\n category = Category.create(category_params)\n\n \n if category\n render json:{\n status: :created,\n category: category}\n else\n render json: { status: 500 }\n end\n end",
"title": ""
},
{
"docid": "e95f1f6af2bdcf1c50902fd452d21d76",
"score": "0.5986567",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to admin_dashboard_categories_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "01bb8a447a2e4b1447aa0f23c73c425a",
"score": "0.59811705",
"text": "def create\n @categoria = Categoria.new(params[:categoria])\n\n respond_to do |format|\n if @categoria.save\n format.html { redirect_to action: 'index', notice: 'Categoria was successfully created.' }\n format.json { render json: @categoria, status: :created, location: @categoria }\n else\n format.html { render action: \"new\" }\n format.json { render json: @categoria.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f9d854eb99560a286523f06e406f8fd",
"score": "0.59798706",
"text": "def create\n @category = @current_branch.categories.build(category_params)\n @category.shop = @current_shop\n respond_to do |format|\n if @category.save\n format.html { redirect_to backend_shop_branch_category_path(@current_shop.slug, @current_branch, @category), notice: t('Category was successfully created.') }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d2b996c04540904f8ce0a2b7bdaf3760",
"score": "0.59641576",
"text": "def create\n @category = Category.create(params[:category])\n respond_with(@category, location: categories_url)\n end",
"title": ""
},
{
"docid": "291e4baa17274831b9a634b29cf20fcd",
"score": "0.5954568",
"text": "def create\n @ilance_category = IlanceCategory.new(ilance_category_params)\n\n respond_to do |format|\n if @ilance_category.save\n format.html { redirect_to @ilance_category, notice: 'Ilance category was successfully created.' }\n format.json { render :show, status: :created, location: @ilance_category }\n else\n format.html { render :new }\n format.json { render json: @ilance_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4d78fa3d3dd5aa58d7909d8c8de5c46",
"score": "0.59535664",
"text": "def categories\n # @categories = Category.get_categories(@user.id)\n #@categories =Category.all.select(:id).select(:name).select(:description).select(:logo_url)\n @categories =Category.all\n user_cat= @user.categories.collect(&:id)\n categories = []\n @categories.each do |cat|\n cat_attr = cat.attributes\n user_cat.include?(cat.id) ? cat_attr.merge!('user_category' => true) : cat_attr.merge!('user_category' => false)\n categories << cat_attr\n end\n @categories = categories\n\n respond_to do |format|\n if @categories.blank?\n format.json {render json:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.xml {render xml:{:success => false, :status_code => 404, :message => \"No category found\"}}\n format.html {render json: {:success => false, :status_code => 404, :message => \"No category found\"}}\n else\n format.html {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.json {render json: {:success => true, :status_code => 200, :categories => @categories}}\n format.xml {render xml: {:success => true, :status_code => 200, :categories => @categories}}\n end\n end\n end",
"title": ""
},
{
"docid": "e94a7b33cf0f87fb69068040edf9f4a0",
"score": "0.59423095",
"text": "def create\n @categories = Category.all\n\n @category = Category.create(category_params)\n flash[:notice]=\"Catégorie créer avec succès!!!\"\n end",
"title": ""
},
{
"docid": "8eb8b1b86851cb0f5085232a561a9493",
"score": "0.5932884",
"text": "def create\n @categorium = Categorium.new(categorium_params)\n\n respond_to do |format|\n if @categorium.save\n format.html { redirect_to @categorium, notice: 'Categoría fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @categorium }\n else\n format.html { render :new }\n format.json { render json: @categorium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3098b9e3a2657f63a350eea38334012a",
"score": "0.5915181",
"text": "def create\n @category = Category.new(category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Категория была успешно создана'}\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a4d3c7929c9edd023fc989c7c45e3b42",
"score": "0.5910048",
"text": "def create\n @categorialivro = Categorialivro.new(params[:categorialivro])\n\n respond_to do |format|\n if @categorialivro.save\n format.html { redirect_to @categorialivro, :notice => 'Categorialivro was successfully created.' }\n format.json { render :json => @categorialivro, :status => :created, :location => @categorialivro }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @categorialivro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d09064b92365df6aed979e5b0a92ec77",
"score": "0.59100246",
"text": "def post_category(category_name, options={ })\n self.post('/categories.json',\n options.merge(\n :body => { :category => {\n :name => category_name\n } }.to_json\n )\n )['category']\n end",
"title": ""
},
{
"docid": "fb956fdf34d561be7bd1537679ae3bf4",
"score": "0.5909161",
"text": "def create\n @incidentcategory = Incidentcategory.new(incidentcategory_params)\n\n respond_to do |format|\n if @incidentcategory.save\n format.html { redirect_to incidentcategories_path, notice: 'Incidentcategory was successfully created.' }\n format.json { render :show, status: :created, location: @incidentcategory }\n else\n format.html { render :new }\n format.json { render json: @incidentcategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f787e5e705e414ad4cdd8dde676eecc3",
"score": "0.590587",
"text": "def create\r\n @administration_category = Category.new(params[:category])\r\n\r\n respond_to do |format|\r\n if @administration_category.save\r\n format.html { redirect_to [:administration, @administration_category], notice: 'Category was successfully created.' }\r\n format.json { render json: @administration_category, status: :created, location: @administration_category }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @administration_category.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "e0cf3903cb04a8e9276e540c7a8c9010",
"score": "0.5895833",
"text": "def create\n @accommodation = Accommodation.new(accommodation_params)\n\n respond_to do |format|\n if @accommodation.save\n format.html { redirect_to @accommodation, notice: 'Accommodation was successfully created.' }\n format.json { render :show, status: :created, location: @accommodation }\n else\n format.html { render :new }\n format.json { render json: @accommodation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d24daa80cb1877ae44c15286af91bc83",
"score": "0.5895179",
"text": "def create\n @category = Category.new(category_params)\n\n\n begin\n Category.transaction do # un ActiveRecord\n #@full_category.each do |f|\n #Category.create(f)\n #f.save!\n #end\n @category.save!\n end\n #Código de éxito\n rescue => e\n raise ActiveRecord::Rollback #Lanzamos el rollback de nuevo a saco\n #Seguimos con las acciones que queramos, como notificar, etc.\n end\n\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to api_v1_category_path(@category), notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e879b9cfb615f214e38ba85595e9092a",
"score": "0.58897835",
"text": "def create\n @category = Category.new(params[:category])\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Категория добавлена.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cc01d3076940a3c7e91a0f18004bacaf",
"score": "0.5889593",
"text": "def create\n category = Category.create!(category_params)\n render json: {\n :html => render_to_string(\n :partial => \"setups/category\",\n :layout => false,\n :locals => {:category => category})\n }\n end",
"title": ""
},
{
"docid": "32566e114fa8999b326fdfc905242df0",
"score": "0.5876995",
"text": "def create\n @organization_catagory = OrganizationCatagory.new(organization_catagory_params)\n\n respond_to do |format|\n if @organization_catagory.save\n format.html { redirect_to @organization_catagory, notice: 'Organization catagory was successfully created.' }\n format.json { render :show, status: :created, location: @organization_catagory }\n else\n format.html { render :new }\n format.json { render json: @organization_catagory.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a01f4a4692ab9441b0055c0d5e72a0f1",
"score": "0.58734244",
"text": "def meal_categories\n # API EXAMPLE: https://www.themealdb.com/api/json/v1/1/list.php?c=list\n content = api_call('list.php?c=list')\n validate(content)\n content\n end",
"title": ""
},
{
"docid": "420e0fdfcda74f57ba45adda25d46b5a",
"score": "0.5866319",
"text": "def create\n @receipe_category = ReceipeCategory.new(receipe_category_params)\n\n respond_to do |format|\n if @receipe_category.save\n format.html { redirect_to @receipe_category, notice: 'Receipe category was successfully created.' }\n format.json { render :show, status: :created, location: @receipe_category }\n else\n format.html { render :new }\n format.json { render json: @receipe_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fb20ba00ef1871fa0d058a95ed641e4c",
"score": "0.5863649",
"text": "def create\n @company_category = CompanyCategory.new(company_category_params)\n\n respond_to do |format|\n if @company_category.save\n format.html { redirect_to @company_category, notice: 'Company category was successfully created.' }\n format.json { render :show, status: :created, location: @company_category }\n else\n format.html { render :new }\n format.json { render json: @company_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2840bec978ab949e9eacf39a3b70aa15",
"score": "0.58610266",
"text": "def categ_params\n params.require(:categ).permit(:name)\n end",
"title": ""
},
{
"docid": "ccf017f3f5ddbc96e26fb2ca064a9bd8",
"score": "0.5860453",
"text": "def create\n \n category = params[:category]\n category_name = category['name']\n \n write_log(\"category.to_s: #{category.to_s}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n \n cats = []\n if category_name != nil\n cats = category_name.split(\" \")\n end\n \n write_log(\"cats.size: #{cats.size}\",\n __FILE__.split(\"/\")[-1],\n __LINE__.to_s)\n\n if cats.size > 1\n \n flag = true\n counter = 0\n \n cats.each do |cat|\n # @category = Category.new(params[:category])\n # @category = Category.new(name=cat)\n @category = Category.new({\"name\"=> cat, \"genre_id\"=> category['genre_id']})\n \n if @category.save\n else\n counter += 1\n end\n end#cats.each do |cat|\n \n respond_to do |format|\n format.html { redirect_to @category, \n notice: \"New categories: Created => #{cats.size - counter}, Failed => #{counter}\" }\n format.json { render json: @category, status: :created, location: @category }\n end\n \n else#if cats.size > 1\n @category = Category.new(params[:category])\n \n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created, location: @category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end#if cats.size > 1\n \n \n # @category = Category.new(params[:category])\n# \n # respond_to do |format|\n # if @category.save\n # format.html { redirect_to @category, notice: 'Category was successfully created.' }\n # format.json { render json: @category, status: :created, location: @category }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @category.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "4210f3fb1c6dfb494c9332942a076960",
"score": "0.5857498",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5764a0170d2f7500c118bf40f6e4a5d2",
"score": "0.5856186",
"text": "def categories\n\t\tbegin\n\t\t\t@categories = Category.select(:id, :name)\n\t\t\trender json: @categories\n\t\trescue Exception => e\n\t\t\terror_handling_bad_request(e)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ea8caaef8854e8acaa2d4c1f3da74533",
"score": "0.58538914",
"text": "def create\n @project = Project.new(project_params)\n if params[:project][:category_list].present?\n @project.category_list = []\n params[:project][:category_list].each do |cat|\n @project.category_list.add(cat)\n end \n end\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ffb432a039928d76b38b5b5975d8d279",
"score": "0.5845327",
"text": "def create\n @specialization_category = SpecializationCategory.new(specialization_category_params)\n\n respond_to do |format|\n if @specialization_category.save\n format.html { redirect_to @specialization_category, notice: 'Specialization category was successfully created.' }\n format.json { render :show, status: :created, location: @specialization_category }\n else\n format.html { render :new }\n format.json { render json: @specialization_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d8301a40facca15f126c551f306fcc6",
"score": "0.5838657",
"text": "def create\n @user = current_user\n @category = Category.new(params[:category])\n @user.categories << @category\n #TODO: error handling\n #TODO: AJAX this\n if @user.save\n redirect_to user_path(@user)\n else\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "28718c17fb0417eeb41fd72eb92e1b43",
"score": "0.58368915",
"text": "def create\n @categoria_ing = CategoriaIng.new(categoria_ing_params)\n\n respond_to do |format|\n if @categoria_ing.save\n format.html { redirect_to @categoria_ing, notice: 'Categoria ing was successfully created.' }\n format.json { render :show, status: :created, location: @categoria_ing }\n else\n format.html { render :new }\n format.json { render json: @categoria_ing.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7909b37981ca31957b4ce3e8d604627c",
"score": "0.5836491",
"text": "def create\n @service_category = ServiceCategory.new(service_category_params)\n if current_user.role_id != Role.find_by_name(\"Super Admin\").id\n @service_category.company_id = current_user.company_id\n end\n\n respond_to do |format|\n if @service_category.save\n format.html { redirect_to service_categories_path, notice: 'Categoría de Servicios creada exitosamente.' }\n format.json { render action: 'show', status: :created, location: @service_category }\n else\n format.html { render action: 'new' }\n format.json { render json: @service_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6352e6cfd64228e3aa3e08cbfcfd3286",
"score": "0.5834987",
"text": "def create\n @category = CategoryService.create(category_params)\n\n respond_to do |format|\n unless @category.errors.any?\n format.html { redirect_to backoffice_categories_path,\n notice: notification_alert('success', 'Created!', \"Category [#{@category.description}] was successfully created.\") \n }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7936576ed5eb494d88e910ff505f966f",
"score": "0.58316195",
"text": "def create\n @exercise_category = ExerciseCategory.new(params[:exercise_category].permit(:name, :organization_id))\n\n respond_to do |format|\n if @exercise_category.save\n format.html { redirect_to exercise_categories_path }\n format.json { render json: exercise_categories_path, status: :created, location: @exercise_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exercise_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cecc601e7e9c8566833bc1f08144a0",
"score": "0.5823679",
"text": "def create\n init = params[:category][:name][0]\n division = Division.find_by_name(params[:division_id].upcase)\n category_number = Category.create_number(params)\n @category = Category.new(category_params.merge(:code => (('%03d' % ((Category.last.code.to_i rescue 0)+1)))).merge(:division_id => division.id))\n if @category.save\n flash[:notice] = 'Category was successfully added'\n redirect_to categories_path\n else\n flash[:error] = @category.errors.full_messages\n render \"new\"\n end\n end",
"title": ""
},
{
"docid": "59f9e615ec232cc44c6f3917e90fdac2",
"score": "0.5820946",
"text": "def categories=(value)\n @categories = value\n end",
"title": ""
},
{
"docid": "48f745d34f5a10774f9142a0ff89df33",
"score": "0.58162266",
"text": "def explore_params\n params.permit(category:[])\n end",
"title": ""
},
{
"docid": "cb0f0b002ad74c78a6caf6ba72cfe79f",
"score": "0.58161205",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render json: @category, status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3593e923f64c1454c5309b87f95d9e4a",
"score": "0.5813858",
"text": "def create\n Category.create\n\n redirect_to admin_ads_path\n end",
"title": ""
},
{
"docid": "7dbe27f41f4e4b9f14f27de015fc90d5",
"score": "0.5812239",
"text": "def get_menu_category\n require \"rest_client\"\n require \"json\"\n\n self.categories.update_all(still_present: false)\n response = RestClient.get(\"https://api.omnivore.io/0.1/locations/#{self.omnivore_id}/menu/categories\", {:content_type => :json, :'Api-Key' => Setting.first.app_api_key})\n res = JSON.parse(response)\n res[\"_embedded\"][\"categories\"].each do |category|\n cat = self.categories.where(omnivore_id: category[\"id\"]).first_or_create\n cat.name = category[\"name\"]\n cat.still_present = true\n cat.save\n end\n\n self.categories.where(still_present: false).destroy_all\n end",
"title": ""
},
{
"docid": "5a96ca15ce46b79e7b2a7c506ebb3ab9",
"score": "0.58094406",
"text": "def create\n @exhibitor_category = ExhibitorCategory.new(params[:exhibitor_category])\n\n respond_to do |format|\n if @exhibitor_category.save\n format.html { redirect_to @exhibitor_category, notice: 'Exhibitor category was successfully created.' }\n format.json { render json: @exhibitor_category, status: :created, location: @exhibitor_category }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exhibitor_category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae1263777cf87bc218b4d2f0381d6d8d",
"score": "0.580231",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to categories_path, notice: 'Category was successfully created.' }\n format.json { render action: 'show', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78365872dc4e57667b9e56739b7a7c09",
"score": "0.58022314",
"text": "def create\n authorize Category\n @category = Category.new(staff_category_params)\n respond_to do |format|\n if @category.save\n format.html { redirect_to staff_categories_path, notice: \"Category '#{@category.name}' was successfully created.\" }\n else\n @categories = Category.order(:name)\n skip_policy_scope\n format.html { render :index }\n end\n end\n end",
"title": ""
},
{
"docid": "94c0a935531784d2e7bc4169fe5355c1",
"score": "0.5801555",
"text": "def destroy\n @accommodation_category.destroy\n respond_to do |format|\n format.html { redirect_to accommodation_categories_url, notice: 'Accommodation category was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1bf4a43c4f9e1aa8cbec97efe24d907d",
"score": "0.58007866",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to edit_dashboard_category_path(@category), notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "111d42a9ae5df62b5567e769c41c8d4e",
"score": "0.5799781",
"text": "def assign_categories_for_admin\n categories = Category.all\n @categories = []\n categories.each { |category| @categories << [category.name, category.id] }\n end",
"title": ""
},
{
"docid": "1c8b5052f536a25fcb1573110ccd6373",
"score": "0.5798697",
"text": "def create\n admins_only do\n @category = Category.new(category_params)\n @category.name = params[:category][:name].to_s.camelcase\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to category_index_path, notice: 'Category was successfully created.' }\n format.json { render action: 'index', status: :created, location: @category }\n else\n format.html { render action: 'new' }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d41908fd9a8b276a8ec5f7274a7fd1f9",
"score": "0.5798205",
"text": "def create\r\n @category = Category.new(params[:category])\r\n @category.alphabet = @category.name[0,1]\r\n @businesses = Business.find(:all, :order => :name)\r\n respond_to do |format|\r\n if @category.save\r\n flash[:notice] = 'Category was successfully created.'\r\n format.html { redirect_to new_admin_category_path }\r\n format.xml { render :xml => @category, :status => :created, :location => @category }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @category.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "360097a389fa7e4edccab70c2e19eaa8",
"score": "0.57948077",
"text": "def create\n @category = Category.new(category_params)\n\n respond_to do |format|\n if @category.save\n format.html { redirect_to @category, notice: 'Category was successfully created.' }\n format.json { render :show, status: :created, location: @category }\n else\n format.html { render :new }\n format.json { render json: @category.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
17b6865bdf8f4da664ad148fc200c97c
|
End Method: Update Method: Delete
|
[
{
"docid": "c501b0d574850fbf28a03bfe6ef840ec",
"score": "0.0",
"text": "def delete\n\t\tTaxcategory.find(params[:id]).destroy\n\t\tredirect_to :action => 'list'\n\tend",
"title": ""
}
] |
[
{
"docid": "85731848a0e037564c3713a67c422435",
"score": "0.80373126",
"text": "def delete\n #TODO\n end",
"title": ""
},
{
"docid": "039a8c1fd873a2c0705fb7babbb73702",
"score": "0.80103457",
"text": "def delete\n end",
"title": ""
},
{
"docid": "65cb60250dcc6a92e0846e7d6fc2cd6b",
"score": "0.79373664",
"text": "def Delete\n\n end",
"title": ""
},
{
"docid": "2f0df61f9fb4ef9b10bea9b7f0160b0b",
"score": "0.7893274",
"text": "def delete\n end",
"title": ""
},
{
"docid": "2f0df61f9fb4ef9b10bea9b7f0160b0b",
"score": "0.7893274",
"text": "def delete\n end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.7889795",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.7889795",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.7889795",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.7889795",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.7889795",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.7889795",
"text": "def delete; end",
"title": ""
},
{
"docid": "36887f2b24d31f98fbb51687409e73f6",
"score": "0.7889795",
"text": "def delete; end",
"title": ""
},
{
"docid": "2b8edda29b7b3177d821dbad7a896abf",
"score": "0.78402483",
"text": "def delete?; end",
"title": ""
},
{
"docid": "2b8edda29b7b3177d821dbad7a896abf",
"score": "0.78402483",
"text": "def delete?; end",
"title": ""
},
{
"docid": "2b8edda29b7b3177d821dbad7a896abf",
"score": "0.78402483",
"text": "def delete?; end",
"title": ""
},
{
"docid": "89268a6ec13a5a681962b227c3d9fb42",
"score": "0.781437",
"text": "def delete\n\n end",
"title": ""
},
{
"docid": "89268a6ec13a5a681962b227c3d9fb42",
"score": "0.781437",
"text": "def delete\n\n end",
"title": ""
},
{
"docid": "89268a6ec13a5a681962b227c3d9fb42",
"score": "0.781437",
"text": "def delete\n\n end",
"title": ""
},
{
"docid": "89268a6ec13a5a681962b227c3d9fb42",
"score": "0.781437",
"text": "def delete\n\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "a860d99cfb28f6db9530a66dbcd28e3c",
"score": "0.7790055",
"text": "def delete\n end",
"title": ""
},
{
"docid": "77c742322d16bbccac07ab52cc2f42db",
"score": "0.77100927",
"text": "def delete\n # TODO\n end",
"title": ""
},
{
"docid": "60fc4fad15b8d733c086321ef28143a4",
"score": "0.7616248",
"text": "def delete\n deleted\n save\n end",
"title": ""
},
{
"docid": "02cf4a606e735669f2bc6503a817a814",
"score": "0.76086116",
"text": "def delete\n update(:status => 'DELETED') \n end",
"title": ""
},
{
"docid": "689294b375ab7ac2ad5d1e9fca21a699",
"score": "0.75159836",
"text": "def delete\n @deleted = true\n # XXX BUG: prevent further modification\n end",
"title": ""
},
{
"docid": "689294b375ab7ac2ad5d1e9fca21a699",
"score": "0.75159836",
"text": "def delete\n @deleted = true\n # XXX BUG: prevent further modification\n end",
"title": ""
},
{
"docid": "0e87fc3ff4027ce0108c9b4d8622ee04",
"score": "0.74956065",
"text": "def delete\n # Well, nothing here, really.\n end",
"title": ""
},
{
"docid": "5f95b6104abfac1e4ceb20e0b19f33d7",
"score": "0.74591386",
"text": "def delete\n self.class.complain(\"deleted\")\n end",
"title": ""
},
{
"docid": "8117aac8d35bdd0584e10ef6a8e1fc9f",
"score": "0.7449018",
"text": "def delete; update(:status => 'DELETED'); end",
"title": ""
},
{
"docid": "390fd7891965c05d3cdeae9058670ef1",
"score": "0.7417404",
"text": "def delete\n # Fill this in\n end",
"title": ""
},
{
"docid": "fa262f3cb85272167c6ae39536940c26",
"score": "0.7414444",
"text": "def del\n delete\n end",
"title": ""
},
{
"docid": "dc7978b571fa1af94fbce826dcf38dc1",
"score": "0.739453",
"text": "def destroy; delete end",
"title": ""
},
{
"docid": "dab4b1f0d4a4b8ac635a56eeb172b33f",
"score": "0.7383267",
"text": "def delete!\n deleted\n save!\n end",
"title": ""
},
{
"docid": "93d0be8dca6ae0cc8c146d0113752161",
"score": "0.737339",
"text": "def delete\n super\n nil\n end",
"title": ""
},
{
"docid": "93d0be8dca6ae0cc8c146d0113752161",
"score": "0.737339",
"text": "def delete\n super\n nil\n end",
"title": ""
},
{
"docid": "6c25f97276fd5ad69907d14d01b3a170",
"score": "0.7361573",
"text": "def delete\n @delete = true\n end",
"title": ""
},
{
"docid": "010438c6de61514971be51393f2c08c6",
"score": "0.7335928",
"text": "def delete\n OK\n end",
"title": ""
},
{
"docid": "741daa8786e84aae71e9ac36160cd559",
"score": "0.7314733",
"text": "def destroy\r\n\r\n end",
"title": ""
},
{
"docid": "80ed8db0c7b900e0ace4bb11c085f441",
"score": "0.731083",
"text": "def destroy\r\n\r\n super\r\n\r\n\r\n end",
"title": ""
},
{
"docid": "daa56604e9c3c631eca2ca4067c09d33",
"score": "0.7300895",
"text": "def delete\n @delete = true\n end",
"title": ""
},
{
"docid": "45a3b6b24ab908a5f5a9e269925749cd",
"score": "0.72639006",
"text": "def delete\n self.replace('_id'=> self['_id'], '_rev'=> self['_rev'], '_deleted'=> true)\n end",
"title": ""
},
{
"docid": "2ee4f130e4e10d2e5c0f04e227b5d1b8",
"score": "0.72216374",
"text": "def destroy\n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "f56f9d41032ea183239d41cecafed62e",
"score": "0.7217496",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "db759fd35b037f18b7347c9f4d9f3ce0",
"score": "0.72144574",
"text": "def delete(id); end",
"title": ""
},
{
"docid": "0392fe8269b59254b02118608b643361",
"score": "0.7200066",
"text": "def destroy\r\n end",
"title": ""
},
{
"docid": "9aa5b10b044730fe32dd947cf7cc2119",
"score": "0.7188658",
"text": "def destroy\n end",
"title": ""
},
{
"docid": "9aa5b10b044730fe32dd947cf7cc2119",
"score": "0.7188658",
"text": "def destroy\n end",
"title": ""
},
{
"docid": "b746d3256924824d5aeff7d0eb1d7705",
"score": "0.718285",
"text": "def delete\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b746d3256924824d5aeff7d0eb1d7705",
"score": "0.718285",
"text": "def delete\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b746d3256924824d5aeff7d0eb1d7705",
"score": "0.718285",
"text": "def delete\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "10546f4c8a1da872c289017cf3fd00d4",
"score": "0.7155638",
"text": "def destroy\n\t end",
"title": ""
},
{
"docid": "375353c618e7c9aef57d0bffcd7078e9",
"score": "0.71513206",
"text": "def destroy\n #\n end",
"title": ""
},
{
"docid": "de7f384513a6817840eac111d2ad0846",
"score": "0.71506965",
"text": "def\tupdate\n\t\tdestroy()\n\tend",
"title": ""
},
{
"docid": "345fdd239631cdcbef12ba511c239b23",
"score": "0.71500576",
"text": "def destroy\n # TODO: Fill this in and add functionality\n end",
"title": ""
},
{
"docid": "5bb5e4414b42364dccb5ef507fce6151",
"score": "0.7118197",
"text": "def delete\n destroy\n end",
"title": ""
},
{
"docid": "81658a24da453245b2fc20fbdbe3c521",
"score": "0.7107523",
"text": "def delete\n self.deleted = true\n self.save\n end",
"title": ""
},
{
"docid": "5259443bd877dec200b6e40ff8c0f6ee",
"score": "0.71033597",
"text": "def delete\n\t\tis_record_marked_for_deletion = true\n\tend",
"title": ""
},
{
"docid": "b965aa2e76649b84623ed925811f4794",
"score": "0.7102432",
"text": "def delete(_path)\n end",
"title": ""
},
{
"docid": "8bf572aeb3078343aeae8c0f6b093758",
"score": "0.7093529",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "8bf572aeb3078343aeae8c0f6b093758",
"score": "0.7093529",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "8bf572aeb3078343aeae8c0f6b093758",
"score": "0.7093529",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "8bf572aeb3078343aeae8c0f6b093758",
"score": "0.7093529",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "8bf572aeb3078343aeae8c0f6b093758",
"score": "0.7093529",
"text": "def destroy\n \n end",
"title": ""
},
{
"docid": "5a2d783ef0b9a13525c5b43ead3234b6",
"score": "0.7086626",
"text": "def delete\n @sql = 'DELETE'\n\n self\n end",
"title": ""
},
{
"docid": "91d55b34a3799d5de3508b0d49690195",
"score": "0.7080969",
"text": "def delete\n remove\n end",
"title": ""
},
{
"docid": "1b275875722f40d4a6f566e6f2035bde",
"score": "0.7074998",
"text": "def delete\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "57d9b4fe1f20621c8b078353b4996d15",
"score": "0.70729035",
"text": "def destroy\r\n \r\n end",
"title": ""
},
{
"docid": "0a1c9aadfd29927394697c34b4cea778",
"score": "0.7072102",
"text": "def destroy\n\n \n\n \t\tend",
"title": ""
},
{
"docid": "e8dea55334a0b3caee6471a8c8ca1c5f",
"score": "0.7072027",
"text": "def deleted?; end",
"title": ""
},
{
"docid": "e8dea55334a0b3caee6471a8c8ca1c5f",
"score": "0.7072027",
"text": "def deleted?; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.7061324",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.7061324",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.7061324",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.7061324",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.7061324",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.7061324",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.7061324",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.7061324",
"text": "def destroy; end",
"title": ""
},
{
"docid": "a13064351ebc598281b451509b59953f",
"score": "0.7061324",
"text": "def destroy; end",
"title": ""
}
] |
ea5819c769e00d9c341d667376e0a7b2
|
Extract data from the RSS feed
|
[
{
"docid": "be9bb98ae0e52f42fdcfcb8cd7a7328e",
"score": "0.7065321",
"text": "def scrape\n open(@url) do |rss|\n feed = RSS::Parser.parse(rss)\n\n feed.items.each do |item|\n # Remove the p tag and retrieve image url from the description\n # if it exists\n p_tag = item.description[%r{<p>.*</p>}]\n if p_tag\n item.description.slice! p_tag\n img_url = p_tag.match(/src=\"(?<img>[^\"]*)\"/)[:img]\n else\n img_url = nil\n end\n\n # Sanitize HTML\n item.title = CGI.unescapeHTML(item.title)\n item.description = CGI.unescapeHTML(item.description)\n\n @articles.push(\n title: item.title,\n summary: item.description,\n image_url: img_url,\n source: @source,\n url: item.link,\n pub_date: item.pubDate.to_s,\n guid: item.guid.content\n )\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "a0d07425ade2b2e9903fe50960ddddfa",
"score": "0.7480618",
"text": "def loadRSSFeeds \n @raw_data = RSS::Parser.parse('http://www.nachrichten.at/storage/rss/rss/weltspiegel.xml', false)\n end",
"title": ""
},
{
"docid": "819477ca26d99edc3f048689ce0938b3",
"score": "0.73745155",
"text": "def read_rss\n query = \"http://news.google.ru/news?hl=ru&topic=#{@topic}&output=rss&ned=ru_ru&num=30&&scoring=n\"\n feed = Feedjira::Feed.fetch_and_parse(query)\n feed.entries.map do |entry|\n {\n uuid: SecureRandom.uuid,\n title: entry.title,\n url: entry.url.match(GOOGLE_URI_REGEX)[0],\n published_datetime: entry.published,\n published_unixtime: entry.published.to_i\n }\n end\n end",
"title": ""
},
{
"docid": "a4b9246c945fda536c55ce0de8b12931",
"score": "0.73364675",
"text": "def parse_feed\n remove_previous_entries\n @items = @content[\"rss\"][\"channel\"][\"item\"]\n if [email protected]?\n for item in @items do\n item[\"pubDate\"] ||= \"\"\n item[\"creator\"] ||= \"\"\n item[\"guid\"] ||= \"\"\n item[\"title\"] ||= \"\"\n item[\"description\"] ||= \"\"\n clean_content(item[\"encoded\"] ||= \"\")\n item[\"link\"] ||= \"\"\n params = { \n :pubdate => item[\"pubDate\"], \n :creator => item[\"creator\"], \n :guid => relative_link(item[\"guid\"]), \n :title => item[\"title\"], \n :description => item[\"description\"], \n :content => @content, \n :link => relative_link(item[\"link\"])\n }\n insert_entry(params)\n end\n end\n end",
"title": ""
},
{
"docid": "90d078bfd4d21df93c94e52ee3a69881",
"score": "0.72145665",
"text": "def parse_rss\n parser = Parsers::RSS.new\n noko_sax = Nokogiri::XML::SAX::Parser.new(parser)\n noko_sax.parse(@data)\n parser.feed\n end",
"title": ""
},
{
"docid": "960e31e1a193367236fdc89f32ead12c",
"score": "0.71780014",
"text": "def scrape\n articles = []\n url = 'http://feeds.news.com.au/heraldsun/rss/heraldsun_news_sport_2789.xml'\n\n open(url) do |rss|\n feed = RSS::Parser.parse(rss)\n feed.items.each do |item|\n articles << (interpret item)\n end\n end\n articles\n end",
"title": ""
},
{
"docid": "67c6e6323e28724f1f97cbc9713ce0bb",
"score": "0.7106208",
"text": "def parse(str)\n # Dirty hack: some feeds contain the & char. It must be changed to &\n str.gsub!(/&(\\s+)/, '&\\1')\n doc = REXML::Document.new(str)\n @xml = doc.root\n # get feed info\n @encoding = doc.encoding\n @title,@link,@description,@creator = nil\n @items = []\n if doc.root.elements['channel'] || doc.root.elements['rss:channel']\n @type = \"rss\"\n # We have a RSS feed!\n # Title\n if (e = doc.root.elements['channel/title'] ||\n doc.root.elements['rss:channel/rss:title']) && e.text\n @title = e.text.unescape_html.toUTF8(@encoding).rmWhiteSpace!\n end\n # Link\n if (e = doc.root.elements['channel/link'] ||\n doc.root.elements['rss:channel/rss:link']) && e.text\n @link = e.text.rmWhiteSpace!\n end\n # Description\n if (e = doc.root.elements['channel/description'] || \n doc.root.elements['rss:channel/rss:description']) && e.text\n @description = e.text.toUTF8(@encoding).rmWhiteSpace!\n end\n # Creator\n if ((e = doc.root.elements['channel/dc:creator']) && e.text) ||\n ((e = doc.root.elements['channel/author'] ||\n doc.root.elements['rss:channel/rss:author']) && e.text)\n @creator = e.text.unescape_html.toUTF8(@encoding).rmWhiteSpace!\n end\n # Items\n if doc.root.elements['channel/item']\n query = 'channel/item'\n elsif doc.root.elements['item']\n query = 'item'\n elsif doc.root.elements['rss:channel/rss:item']\n query = 'rss:channel/rss:item'\n else\n query = 'rss:item'\n end\n doc.root.each_element(query) { |e| @items << RSSItem::new(e, self) }\n\n elsif doc.root.elements['/feed']\n # We have an ATOM feed!\n @type = \"atom\"\n # Title\n if (e = doc.root.elements['/feed/title']) && e.text\n @title = e.text.unescape_html.toUTF8(@encoding).rmWhiteSpace!\n end\n # Link\n doc.root.each_element('/feed/link') do |e|\n if e.attribute('type') and (\n e.attribute('type').value == 'text/html' or\n e.attribute('type').value == 'application/xhtml' or\n e.attribute('type').value == 'application/xhtml+xml')\n if (h = e.attribute('href')) && h\n @link = h.value.rmWhiteSpace!\n end\n end\n end\n # Description\n if e = doc.root.elements['/feed/info']\n e = e.elements['div'] || e\n @description = e.to_s.toUTF8(@encoding).rmWhiteSpace!\n end\n # Items\n doc.root.each_element('/feed/entry') do |e|\n @items << AtomItem::new(e, self)\n end\n else\n raise UnknownFeedTypeException::new\n end\n end",
"title": ""
},
{
"docid": "b36f8d611552af507be0603ff4545aa4",
"score": "0.707451",
"text": "def retrieve_data\n # Define the url\n url = 'http://www.abc.net.au/radionational/feed/3771046/rss.xml'\n\n # Open the url and parse the rss feed\n open(url) do |rss|\n # Start parsing\n feed = RSS::Parser.parse(rss, false)\n\n # Iterate each item and scrape information\n feed.items.each do |item|\n # If the title of thie article matches the title of the last saved article,\n # stop scraping to avoid from saving duplicates in database\n break if !@last_title.nil? && @last_title.eql?(item.title.to_s)\n\n # If thie article is already stored then ignore\n next if Article.find_by(title: item.title.to_s)\n\n # Get the author\n regex_author = /<dc:creator>(.*)<\\/dc:creator>/\n regex_author.match(item.to_s)\n author = Regexp.last_match(1)\n\n author = nil if author.eql? ''\n\n # Get categories values\n regex_category = /<category>(.*)<\\/category>/\n\n categories = []\n item.categories.each do |category|\n regex_category.match(category.to_s)\n categories.push(Regexp.last_match(1))\n end\n\n # Make a template dictionary to put @articles\n temp = {\n author: author,\n title: item.title,\n summary: item.description.to_s,\n image: nil,\n date_time: DateTime.parse(item.pubDate.to_s),\n link: item.link,\n categories: categories.join(',')\n }\n\n # Put the object into articles array\n @articles << temp\n end\n end\n end",
"title": ""
},
{
"docid": "76a4ad415c07c5aabd29cbfd18581322",
"score": "0.7052806",
"text": "def parse_feed\n feed = self.download_feed\n Nokogiri::XML(feed).xpath(\"//item\").map do |item|\n enclosure = item.xpath(\"enclosure\").first\n\n title = CGI::unescapeHTML(item.xpath(\"title\").text.chomp)\n publish_date = Time.parse(item.xpath(\"pubDate\").inner_html.chomp)\n type = enclosure ? enclosure[:type] : nil\n url = enclosure ? enclosure[:url] : nil\n Podcast.new title, publish_date, type, url, self\n end\n end",
"title": ""
},
{
"docid": "80352312b1217d4946c20ed66cb051e6",
"score": "0.70368785",
"text": "def scrape\r\n @article_arr = []\r\n\t\turl = 'http://feeds.news.com.au/heraldsun/rss/heraldsun_news_technology_2790.xml'\r\n open(url) do |rss|\r\n \tfeed = RSS::Parser.parse(rss, false)\r\n \tputs \"Title: #{feed.channel.title}\"\r\n puts \"*********************************\"\r\n puts \" \"\r\n feed.items.each do |item|\r\n \t@article_arr << HSArticle.new(author: \"nil\", title: item.title.to_s.gsub(/,/,' ').gsub(/\"/,' ').gsub(/'s/,'s').gsub(/'/, ''), \r\n summary: item.description.to_s.gsub(/,/,' ').gsub(/\\\"/,'\\'').gsub(/'s/,''), images: item.enclosure.url, source: item.link,\r\n date: item.pubDate.to_s.gsub(/,/,'').gsub(/\\\"/,'\\'').gsub(/'s/,''))\r\n end\r\n end\r\n @articles.concat(@article_arr)\r\n end",
"title": ""
},
{
"docid": "ebe4fb305daa54612418cde1500db598",
"score": "0.7029308",
"text": "def parse(feed_data)\n @hub_url = REXML::XPath.first(feed_data, 'link[@rel=\"hub\"]').attributes['href']\n @id = feed_data.elements['id'].text\n @title = feed_data.elements['title'].text\n @updated_at = Time.parse(feed_data.elements['updated'].text)\n @url = REXML::XPath.first(feed_data, 'link[@rel=\"self\"]').attributes['href']\n\n feed_data\n end",
"title": ""
},
{
"docid": "aeeb79e48b38045bf0b48fc37def355a",
"score": "0.70102173",
"text": "def scrape\n\t\turl = 'http://www.wsj.com/xml/rss/3_7455.xml'\n open(url) do |rss|\n \tfeed = RSS::Parser.parse(rss, false)\n puts \" \"\n puts \"*********************************\"\n \tputs \"Title: #{feed.channel.title}\"\n puts \"--------------------------------\"\n feed.items.each do |item|\n tags = tag_article(item.title.to_s)\n \tarticle = Article.new(title: item.title.to_s, \n summary: item.description.to_s.gsub(/\\\"/,''), \n link: item.link, \n date: item.pubDate.to_s.gsub(/,/,''),\n tag_list: tags, \n source: \"Wall Street Journal\")\n article.save\n end\n end\n end",
"title": ""
},
{
"docid": "3f72871738c75398657d4386c41447d0",
"score": "0.6979719",
"text": "def rss\r\n Nokogiri::XML(body)\r\n end",
"title": ""
},
{
"docid": "60f5a51c0965b3587386c751c26de06d",
"score": "0.69174546",
"text": "def retrieve_data\n # Define the url\n url = 'http://www.sbs.com.au/news/rss/news/science-technology.xml'\n\n # Open the url and parse the rss feed\n open(url) do |rss|\n # Start parsing\n feed = RSS::Parser.parse(rss, false)\n\n # Iterate each item and scrape information\n feed.items.each do |item|\n # If the title of thie article matches the title of the last saved article,\n # stop scraping to avoid from saving duplicates in database\n break if !@last_title.nil? && @last_title.eql?(item.title.to_s)\n\n # If thie article is already stored then ignore\n next if Article.find_by(title: item.title.to_s)\n\n # Make a template dictionary to put @articles\n temp = {\n author: nil,\n title: item.title,\n summary: item.description,\n image: nil,\n date_time: DateTime.parse(item.pubDate.to_s),\n link: item.link,\n categories: nil\n }\n\n # Put the object into articles array\n @articles << temp\n end\n end\n end",
"title": ""
},
{
"docid": "ab07032068c7598deaffde8e0d2ba8fe",
"score": "0.6916503",
"text": "def parse_by_feedzirra(feed_text, src)\n if @src.uri =~ /citeulike/\n Feedzirra::Feed.add_common_feed_entry_element('dc:source', :as => :source)\n #Feedzirra::Feed.add_common_feed_entry_element('dc:creator', :as => :authors)\n Feedzirra::Feed.add_common_feed_entry_element('prism:publicationYear', :as => :pub_year)\n end\n feed_data = Feedzirra::Feed.parse feed_text\n #debugger\n feed_data.entries.map do|e|\n metadata = {}\n metadata[:author] = e.author if e.author\n #metadata[:author] = e.authors if e.respond_to?(:authors)\n metadata[:pub_year] = e.pub_year if e.respond_to?(:pub_year)\n metadata[:source] = e.source if e.respond_to?(:source)\n metadata[:tag_list] = e.categories.join(\",\") unless e.categories.blank?\n #debugger\n {:did=>(e.id || e.url), :title=>e.title,:content=>(e.content || e.summary),:basetime=>e.published, \n :metadata=>metadata, :uri=>e.url}\n end \n end",
"title": ""
},
{
"docid": "fd20c2a5fba387036b9c53e5bfe6f775",
"score": "0.69090843",
"text": "def parse_rss(rss_feed)\n rss_content = \"\"\n\n #Get feed information\n open (rss_feed) do |f|\n rss_content = f.read\n end\n\n RSS::Parser.parse(rss_content, false)\n end",
"title": ""
},
{
"docid": "2858e06c5d6fb61ec530bfdee9271eb9",
"score": "0.6880274",
"text": "def scrape\n\t\topen(@url) do |rss|\n\t\t\tfeed = RSS::Parser.parse(rss)\n\t\t\t@source_name = feed.channel.title\n\t\t\tfeed.items.each do |item|\n\t\t\t\tif date_valid?(item.pubDate) and item.title\n\t\t\t\t\tcreate_article(item.dc_creator, item.title, item.description,\\\n\t\t\t\t\t\t\"\", @source_name, item.pubDate.to_date, item.link)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@articles\n\tend",
"title": ""
},
{
"docid": "719ea1fa9b39af64de527adb9a2c52af",
"score": "0.6817354",
"text": "def scrape\r\n @article_arr = []\r\n\t\turl = 'http://www.theage.com.au/rssheadlines/technology-news/article/rss.xml'\r\n open(url) do |rss|\r\n \tfeed = RSS::Parser.parse(rss, false)\r\n puts \" \"\r\n puts \"*********************************\"\r\n \tputs \"Title: #{feed.channel.title}\"\r\n puts \"--------------------------------\"\r\n feed.items.each do |item|\r\n \t@article_arr << AgeArticle.new(author: \"nil\", title: item.title.to_s.gsub(/,/,''), \r\n summary: (item.description).match(/\\<\\/p\\>[\\w ?,''\"\"]+/).to_s.gsub(/\\<\\/p\\>/,'').gsub(/,/,'').gsub(/\\\"/,''), \r\n images: (item.description).match(/http.+\\.(jpg|png)/), source: item.link, date: item.pubDate.to_s.gsub(/,/,''))\r\n end\r\n end\r\n @articles.concat(@article_arr)\r\n end",
"title": ""
},
{
"docid": "b55422da268d2647d596eb9a0386e263",
"score": "0.67737204",
"text": "def scrape\n\t\topen(@url) do |rss|\n\t\t\tfeed = RSS::Parser.parse(rss)\n\t\t\t@source_name = feed.channel.title\n\t\t\tfeed.items.each do |item|\n\t\t\t\tif date_valid?(item.pubDate) and item.title\n\t\t\t\t\tcreate_article(get_author(item), item.title, item.description,\\\n\t\t\t\t\t\tget_images(item), @source_name, item.pubDate.to_date,\\\n\t\t\t\t\t\titem.link, get_image_length(item))\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@articles\n\tend",
"title": ""
},
{
"docid": "cdb59e3acffdda97291a9da26043ba37",
"score": "0.67668223",
"text": "def rss_entries(url)\n\t\tresponse = fetch(url)\n\t\tresponse[\"feed\"][\"entry\"]\n\tend",
"title": ""
},
{
"docid": "7f6e72521f1ebfe0553a33ca338211a9",
"score": "0.6736355",
"text": "def scrape\n @articles = []\n url = 'http://feeds.news.com.au/heraldsun/rss/heraldsun_news_technology_2790.xml'\n open(url) do |rss|\n feed = RSS::Parser.parse(rss, false)\n feed.items.each do |item|\n article = Article.create(title: item.title.to_s.tr('\"', '\\''),\n summary: item.description.to_s\n .gsub(/’/, '\\'').gsub(/\\\"/, '\\''),\n imageURL: item.enclosure.url,\n link: item.link,\n pubDate: DateTime.parse(item.pubDate.to_s),\n source: HSImporter.source_name)\n @articles << article\n end\n end\n @articles\n end",
"title": ""
},
{
"docid": "27dced0a8db0a563176b78bbc48a4672",
"score": "0.6728974",
"text": "def scrape\n\t\topen(@url) do |rss|\n\t\t\tfeed = RSS::Parser.parse(rss)\n\t\t\tfeed.items.each do |item|\n\t\t\t\tif date_valid?(item.pubDate) and item.title\n\t\t\t\t\tcreate_article(@default_author, item.title, item.description,\\\n\t\t\t\t\t\t\"\", @source_name, item.pubDate.to_date, item.link)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t@articles\n\tend",
"title": ""
},
{
"docid": "0120afb9540ee7647926e07fc6d7280c",
"score": "0.67234445",
"text": "def feed\n @data.feed ||= parsed_document.xpath(\"//link\").select{ |link|\n link.attributes[\"type\"] && link.attributes[\"type\"].value =~ /(atom|rss)/\n }.map { |link|\n absolutify_url(link.attributes[\"href\"].value)\n }.first rescue nil\n end",
"title": ""
},
{
"docid": "e123b651e974e7ca1ec929355afd0dea",
"score": "0.6721908",
"text": "def feed\n @feed ||= (parsed_feed('rss') || parsed_feed('atom'))\n end",
"title": ""
},
{
"docid": "e123b651e974e7ca1ec929355afd0dea",
"score": "0.6721908",
"text": "def feed\n @feed ||= (parsed_feed('rss') || parsed_feed('atom'))\n end",
"title": ""
},
{
"docid": "df919b5ba658dcd12e95b33dae6655f3",
"score": "0.6702537",
"text": "def feed\n cached = Rails.cache.read(\"rss\")\n return cached unless cached.nil?\n\n resp = HTTParty.get(Rails.configuration.x.application.blog_rss)\n return [] unless resp.code == 200\n\n rss = RSS::Parser.parse(resp.body, false).items.first(5)\n cache_content(\"rss\", rss)\n rss\n rescue StandardError => e\n # If we were unable to connect to the blog rss\n logger.error(\"Caught exception RSS parse: #{e}.\")\n []\n end",
"title": ""
},
{
"docid": "06ccbb738b5ba73376c33c5b98bfd77b",
"score": "0.67022085",
"text": "def get_rss_feed( rss_url )\n\t\tfeed = false\n\t\tuntil feed.class == Feedzirra::Parser::RSS\n\t\t\tfeed = Feedzirra::Feed.fetch_and_parse( rss_url )\n\t\tend\n\t\tfeed\n\tend",
"title": ""
},
{
"docid": "5a6c4b6238ac3aab1a722a1abbb14dcd",
"score": "0.66798174",
"text": "def get_feed(url)\n source = URI.open(url, 'User-Agent' => 'Mozilla/5.0')\n feed = RSS::Parser.parse(source)\nend",
"title": ""
},
{
"docid": "477903bd332bba1a7b18289ac3a70e68",
"score": "0.66300076",
"text": "def rss\n @rss ||= build_rss\n end",
"title": ""
},
{
"docid": "6044c23890d92f61e8412d72556ad301",
"score": "0.6597346",
"text": "def get_rss\n #version = \"1.0\" # [\"0.9\", \"1.0\", \"2.0\"]\n version = @version\n\n content = RSS::Maker.make(@version) do |m|\n m.channel.title = @title\n m.channel.description = @description \n m.channel.link = @link \n m.channel.language = @language\n m.channel.about = @about\n m.items.do_sort = true # sort items by date\n m.channel.updated = Time.now.to_s\n m.channel.author = NAME\n\n if @image != nil\n m.image.url = @image\n m.image.title = @title\n end\n\n for mp3 in @mp3s \n item = m.items.new_item\n item.title = mp3\n ## add a base url \n if base != ''\n link = base + '/' + URI::escape(mp3.path)\n else \n link = URI::escape(mp3.path)\n end\n item.link = link\n item.date = mp3.mtime\n item.enclosure.url = link\n item.enclosure.length = mp3.length\n item.enclosure.type = mp3.type\n end\n end\n\n return content\n end",
"title": ""
},
{
"docid": "6d8c6997c94d814206fb7d4c4de5d70c",
"score": "0.6591779",
"text": "def feed\n @feeddata\n end",
"title": ""
},
{
"docid": "47aee2c779d1495c072c29784ac3025d",
"score": "0.6589593",
"text": "def retrieve_posts\n # Get posts\n rss = RSS::Parser.parse(AWL_RSS_URL)\n\n # Grab shortened URLs\n links = rss.items.map(&:guid).map(&:content)\n\n @articles = []\n\n links.each do |link|\n @articles << Article.new(link)\n end\n\n # TODO: Only grab the tags for articles that haven't already be tweeted\n @articles.map(&:retrieve_tags)\n end",
"title": ""
},
{
"docid": "40f73cd9b34c61d146229aa72f465f71",
"score": "0.64586526",
"text": "def readrss(name, t) # finds url from database, parses it and returns an array\n if (t>5); return [\"http://www.justfuckinggoogleit.com\"]; end\n\n s = []\n url = $db.execute( \"select link from rss where name = ?\", name )\n i = RSS::Parser.parse(open(url.flatten.to_s), false)\n i.items.first(t).each do |it|\n s.push(it.title+\" - \"+it.link)\n end\n return s\nend",
"title": ""
},
{
"docid": "c77dccfbfca6f1ec80cd25cfb2c22972",
"score": "0.6447302",
"text": "def parse_by_rss_feed(url,rss_link_id)\n feeds = RssFeed::RssFeed.parse_rss_url(url)\n feeds.entries.each do |item|\n params = {\n :title => item.title,\n :description => ActionController::Base.helpers.strip_tags(item.description),\n :link => item.link,\n :author => item.author,\n :publication_date => item.published,\n :media_contents => (item.media_image ? [{:url => item.media_image}] : []),\n :media_description => item.media_description,\n :media_credit => item.media_credit,\n :keywords => (item.categories.present? ? item.categories.join(\",\") : \"\"),\n :rss_link_id => rss_link_id\n }\n f = Feed.new(params)\n if f.save\n activity = Activity.new({:action => \"Create\", :parent_id => rss_link_id, :parent_type => \"RssLink\", :data => params}) \n activity.save\n puts \"*\" * 50\n puts \"Title: \" + f.title + \" parsed and saved\"\n end\n end if feeds && feeds.entries\n end",
"title": ""
},
{
"docid": "a88f948e41e80818ea34c3090f76610f",
"score": "0.64284647",
"text": "def feed\n\t\t\tpost = { \"token\" => @token }\n\t\t\tdocxml = nil\n\t\t\tdocxml = nessus_request('feed', post)\n\t\t\tif docxml.nil?\n\t\t\t\treturn\n\t\t\tend\n\t\t\tfeed = docxml.root.elements['contents'].elements['feed'].text\n\t\t\tversion = docxml.root.elements['contents'].elements['server_version'].text\n\t\t\tweb_version = docxml.root.elements['contents'].elements['web_server_version'].text\n\t\t\treturn feed, version, web_version\n\t\tend",
"title": ""
},
{
"docid": "dc23c0bca65dcb82667c9e75d18c7c5d",
"score": "0.6407917",
"text": "def read\n begin\n title = @current_feed.keys.first\n content = @cache[@current_feed.keys.first] || fetch_feed\n @current_feed_link = content[0]&.dig('link')\n decoded_content = HTMLEntities.new.decode(content&.shift&.dig('title'))\n @cache[@current_feed.keys.first] = nil if content.empty?\n rescue StandardError => e\n # Error while parsing, something weird during feed fetch/parse, not read (as in pulling off queue), probably\n # TODO: maybe move this into a util class if we want this to be the way to log errors (because of how CLI works)\n File.open('errors.log', 'w') { |file| file.write(\"Error while parsing feed <#{title}>: #{e}\\n\") }\n end\n next_feed\n \"<#{title}>: #{decoded_content || Rss::NO_VALUE}\"\n end",
"title": ""
},
{
"docid": "5a6087c7b18755f4c63e89e6f807c86a",
"score": "0.6392834",
"text": "def rss\n @title = t('titles.news', brand: website.brand_name)\n @description = website.value_for(\"default_meta_tag_description\")\n @news = News.all_for_website(website)\n respond_to do |format|\n format.xml # render rss.xml.builder\n end\n end",
"title": ""
},
{
"docid": "faf459ed3442a6eeff555a89544c1e11",
"score": "0.63865",
"text": "def retrieve_feed\n uri = URI.parse(@feed_url)\n Net::HTTP.get_response(uri).body\n end",
"title": ""
},
{
"docid": "10a6f39269471216aa8017b3095a364a",
"score": "0.63839144",
"text": "def parse_xml(result)\n #puts \"getting title #{result['title']}\"\n @title = result['title']\n @description = result['description']\n @url = result['url']\n @display_url = result['display_url']\n @date_time = result['date_time']\n end",
"title": ""
},
{
"docid": "800299b2139ae11585bcc2debee1baa9",
"score": "0.6375227",
"text": "def parse_rss_alt(year, month, feed)\n file_paths = Array.new\n xbrlFilings = filter_feed_alt(Nokogiri::XML(feed), get_ciks)\n\n xbrlFilings.each do |xbrlFiling|\n cik = xbrlFiling.children[7].text\n xbrlFiles = xbrlFiling.children[23] != nil ? xbrlFiling.children[23].children : xbrlFiling.children[21].children\n file_path = Array.new\n\n (1..(xbrlFiles.length - 1)).step(2) do |j|\n url = xbrlFiles[j].attributes[\"url\"].value\n\n file_path << url if (url =~ /.(xml|xsd)$/) != nil\n end\n file_paths << [cik, [year.to_s, month.to_s], file_path]\n end\n file_paths\nend",
"title": ""
},
{
"docid": "b68202e012cc6099de556771d07fb499",
"score": "0.6362162",
"text": "def xml_data(xml)\n return unless xml = Objectify::Xml.first_element(xml)\n # There is something wrong with Nokogiri xpath/css search with\n # namespaces. If you are searching a document that has namespaces,\n # it's impossible to match any elements in the root xmlns namespace.\n # Matching just on attributes works though.\n feed, entry = xml.search('//*[@term][@scheme]', xml.namespaces)\n feed_self, entry_self = xml.search('//*[@rel=\"self\"][@type=\"application/atom+xml\"]', xml.namespaces)\n feed_scheme = feed['term'] if feed\n entry_scheme = entry['term'] if entry\n feed_href = feed_self['href'] if feed_self\n entry_href = entry_self['href'] if entry_self\n [xml, feed_scheme, entry_scheme, feed_href, entry_href]\n end",
"title": ""
},
{
"docid": "bd152506c823097ae9386b33f6728144",
"score": "0.6347757",
"text": "def fetch\n feed_data = REXML::Document.new(open(@url, :proxy => true)).root\n parse(feed_data)\n end",
"title": ""
},
{
"docid": "5a916d973f1f24458fa7501812aa4484",
"score": "0.6333179",
"text": "def parse_feed url=rss_url, now = Time.now\n\n options = {\n user_agent: 'Geolinguist Test',\n max_redirects: 2,\n compress: true\n }\n\n\n f = Feedjira::Feed.fetch_and_parse url, options\n if f.url != rss_url.sub(RSS_SUFFIX,'')\n self.base_url = f.url.sub(RSS_SUFFIX,'').sub(SUFFIX,'')\n url = rss_url\n save\n f = Feedjira::Feed.fetch_and_parse url, options\n end\n\n\n if f.last_modified.blank?\n save_and_update_last_fetched now if self.last_fetched.blank?\n return\n end\n if last_fetched.blank? || f.last_modified > last_fetched\n puts f.inspect\n f.entries.each do |entry|\n if last_fetched.blank? || last_fetched < entry.published\n self.total_entries += 1\n body = [entry.title,entry.summary].join(\"\\n\")\n matches = LanguageRecognizer.recognize body\n if matches.blank?\n self.no_matches += 1\n else\n matches.each {|match| self[match] += 1}\n end\n end\n end\n save_and_update_last_fetched now\n end\n end",
"title": ""
},
{
"docid": "104c236150f0d02cc7fa2b34875b216f",
"score": "0.6310534",
"text": "def from_rss(agent, rss)\n mp3_url = rss.search('//item/enclosure').attribute('url').value\n\n files = []\n data, filename = download_file(agent, mp3_url)\n dest_file = save_to_disk(data, filename)\n files << dest_file if dest_file\n\n files\n end",
"title": ""
},
{
"docid": "b6649f75fe94753a94d111ad33b31618",
"score": "0.6280687",
"text": "def get_urlposts( url )\n urlposts = []\n urlcode = Digest::MD5.hexdigest(url)\n url = \"http://feeds.delicious.com/rss/url/#{urlcode}\"\n\n response = Net::HTTP.get_response(URI.parse(url)).body\n doc = REXML::Document.new(response)\n\n doc.elements.each(\"//item\") do |item|\n urlposts << { \"user\" => item.elements[\"dc:creator\"].text }\n end\n\n sleep 1\n return urlposts\n end",
"title": ""
},
{
"docid": "ab97e54e92fb36f82b72bf9ed1380743",
"score": "0.62742877",
"text": "def parse rss_item, index, proxy = nil, parse_desc = true\n item = FeedItem.new\n item.title = encoding(html_to_txt(rss_item.title), @encode)\n item.link = rss_item.link\n item.date = rss_item.date if rss_item.respond_to?(:date)\n item.date = rss_item.dc_date if rss_item.respond_to?(:dc_date)\n if parse_desc\n plugin = get_content_plugin(item.link)\n begin\n content_and_link = plugin.fetch rss_item, proxy\n rescue Exception => e\n unless plugin.instance_of? Rss::Plugin::DefaultContentPlugin\n log_info \"Can't parse #{item.link}! Reason: #{e.message} Try DefaultContentPlugin.\"\n content_and_link = get_default_plugin().fetch rss_item, proxy\n\t end\n\tend\n content = Nokogiri::HTML(content_and_link[:content])\n parsed = parse_html_and_download_images(content_and_link[:link], content, index, proxy)\n \titem.description = parse_description parsed[:doc], parsed[:images], index\n end\n item\n end",
"title": ""
},
{
"docid": "52221be8e7f9ed1f3fb827eb60af4f25",
"score": "0.62684023",
"text": "def parse(xml)\n @id = xml.xpath('//xmlns:feed/xmlns:id').first.text\n @title = xml.xpath('//xmlns:feed/xmlns:title').first.text\n\n @author_email =\n xml.xpath('//xmlns:feed/xmlns:author/xmlns:email').first.text\n @author_name = xml.xpath('//xmlns:feed/xmlns:author/xmlns:name').first.text\n\n xml.xpath('//xmlns:feed/xmlns:entry').each do |entry|\n title = entry.xpath('.//xmlns:title').first.text\n emails = []\n primary = entry.xpath('.//gd:email[@primary]')\n next unless primary.first\n emails << primary.first['address']\n alternates = entry.xpath('.//gd:email[not(@primary)]')\n\n emails.push(*alternates.map { |e| e['address'] })\n\n ims = []\n entry.xpath('.//gd:im').each do |im|\n ims << [im['address'], im['protocol']]\n end\n\n phones = []\n entry.xpath('.//gd:phoneNumber').each do |phone|\n phones << [phone.text, phone['rel']]\n end\n\n addresses = []\n entry.xpath('.//gd:postalAddress').each do |address|\n addresses << [address.text, address['rel']]\n end\n\n photo_link = entry.xpath('.//xmlns:link[@rel=\"http://schemas.google.com/contacts/2008/rel#photo\"]').first\n photo_url = photo_link['href'] if photo_link\n\n contact = Contact.new title, emails, ims, phones, addresses, photo_url\n\n @contacts << contact\n end\n\n self\n end",
"title": ""
},
{
"docid": "32717ead4e17402906bb24798c5f7c18",
"score": "0.62276137",
"text": "def collect_news_item(node, data)\n h = Hash[data.keys[2..5].map { |x| [x, node.xpath(data[x]).to_s] }]\n h[\"title\"] = h[\"title\"].gsub(/[^a-zA-Z0-9\\- ]/, \"\")\n h[\"header\"] = h[\"header\"].gsub(/[^a-zA-Z0-9\\- ]/, \"\")\n get_extras(h, node, data)\n end",
"title": ""
},
{
"docid": "00c4bc8999e49c500af7da9add89ea5d",
"score": "0.62245154",
"text": "def news\n do_scrape\n @posts = UbuEntry.all(:order => \"id DESC\", :limit => 400)\n render :layout => false, :content_type => Mime::RSS\n end",
"title": ""
},
{
"docid": "6fdf3844d365167cb4227e090108956d",
"score": "0.62132907",
"text": "def get_rss\n all( :conditions => ['published_at IS NOT NULL'], :order => 'published_at DESC', :limit => per_page )\n end",
"title": ""
},
{
"docid": "955877c14ef3a80412b4413581811c10",
"score": "0.6209022",
"text": "def get_blog_feed\n # fetching a single feed\n @feed = []# Feedzirra::Feed.fetch_and_parse(\"http://norastable.wordpress.com/feed/\")\n end",
"title": ""
},
{
"docid": "a6570b2da536dcdddf3246c5b429ebab",
"score": "0.6198274",
"text": "def fetch_data\n rss_provider = RssProvider.find(params[:format])\n unless rss_provider.rss_url.include?(\"indiatvnews\" ) || rss_provider.rss_url.include?(\"hindu\" ) || rss_provider.rss_url.include?(\"zee\" )\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n feeds = xml[\"rss\"][\"channel\"][\"item\"]\n feeds.each do |feed|\n if rss_provider.rss_url.include?(\"indiatoday\" )\n title = News.find_by(title: feed[\"title\"])\n unless title.present?\n\n\n index_of_summary = feed[\"description\"].index(\"</a>\")\n summary = feed[\"description\"][index_of_summary..].delete_prefix(\"</a> \")\n index_of_image = feed[\"description\"].index(\"src\")\n image_url = feed[\"description\"][(index_of_image+5)..(index_of_summary-4)]\n News.create(title: feed[\"title\"], summary: summary, \n published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: image_url,\n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n\n end\n\n \n elsif rss_provider.rss_url.include?(\"news18\")\n title = News.find_by(title: feed[\"title\"])\n unless title.present?\n index_of_image = feed[\"description\"].index(\"https\")\n summary_index = feed[\"description\"].index(\" />\")\n last_index_of_image = feed[\"description\"].index(\"jpg\")\n image_url = feed[\"description\"][(index_of_image)..(last_index_of_image)] + \"pg\"\n summary = feed[\"description\"][(summary_index+3)..]\n News.create(title: feed[\"title\"], summary: summary,published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: image_url, rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n\n\n elsif rss_provider.rss_url.include?(\"bbc\")\n title = News.find_by(title: feed[\"title\"])\n unless title.present?\n News.create(title: feed[\"title\"], summary: feed[\"description\"], \n published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: feed[\"fullimage\"], \n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n\n\n elsif rss_provider.rss_url.include?(\"ndtv\")\n title = News.find_by(title: feed[\"title\"])\n unless title.present?\n News.create!(title: feed[\"title\"], summary: feed[\"description\"], \n published_on: feed[\"updatedAt\"], url: feed[\"link\"], media_url: feed[\"fullimage\"], \n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id,provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n\n\n \n elsif rss_provider.rss_url.include?(\"timesofindia\")\n title = News.find_by(title: feed[\"title\"])\n\n unless title.present?\n\n if rss_provider.category.category_name == \"Top Story\" \n News.create(title: feed[\"title\"], summary: feed[\"description\"], \n published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: \"\", \n rss_provider_id: rss_provider.id,category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime) \n else\n unless feed[\"description\"] == nil \n index_of_image = feed[\"description\"].index(\"src\")\n last_index_of_image = feed[\"description\"][index_of_image..].index(\"/>\")+index_of_image\n image_url = feed[\"description\"][(index_of_image+5)..(last_index_of_image-3)]\n summary_index = feed[\"description\"].index(\"</a>\")\n summary = feed[\"description\"][(summary_index+4)..]\n News.create(title: feed[\"title\"], summary: summary, \n published_on: feed[\"pubDate\"], url: feed[\"link\"], media_url: image_url, \n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n end\n end\n \n\n end\n\n end\n end\n\n unless rss_provider.rss_url.include?(\"timesofindia\" ) || rss_provider.rss_url.include?(\"ndtv\" ) || rss_provider.rss_url.include?(\"bbc\" ) ||\n rss_provider.rss_url.include?(\"news18\") || rss_provider.rss_url.include?(\"indiatoday\") \n\n\n if rss_provider.rss_url.include?(\"indiatvnews\" )\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n\n xml = xml.body\n feeds = Feedjira.parse(xml)\n feeds.entries.each do |feed|\n index_of_summary = feed.summary.index(\"</a>\")\n summary = feed.summary[index_of_summary+4..]\n index_of_image = feed.summary.index(\"src\")\n image_url = feed.summary[(index_of_image+5)..(index_of_summary-5)]\n title = News.find_by(title: feed.title)\n unless title.present?\n News.create(title: feed.title, summary: summary, \n published_on: feed.published, url: feed.url, media_url: image_url, \n rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n end\n\n end\n rss_provider.update(news_updated_at: Time.now.localtime)\n\n elsif rss_provider.rss_url.include?(\"thehindu\")\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n xml = xml.body\n feeds = Feedjira.parse(xml)\n feeds.entries.each do |feed|\n title = News.find_by(title: feed.title)\n unless title.present?\n News.create(title: feed.title, summary: feed.summary.strip, \n published_on: feed.published, url: feed.url,rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n end\n\n end\n rss_provider.update(news_updated_at: Time.now.localtime)\n\n elsif rss_provider.rss_url.include?(\"zee\")\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n xml = xml.body\n feeds = Feedjira.parse(xml)\n feeds.entries.each do |feed|\n title = News.find_by(title: feed.title)\n unless title.present?\n News.create(title: feed.title, summary: feed.summary.strip, \n published_on: feed.published, url: feed.url,rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n end\n\n end\n rss_provider.update(news_updated_at: Time.now.localtime)\n end\n\n end\n\n unless rss_provider.rss_url.include?(\"timesofindia\" ) || rss_provider.rss_url.include?(\"ndtv\" ) || rss_provider.rss_url.include?(\"bbc\" ) ||\n rss_provider.rss_url.include?(\"news18\") || rss_provider.rss_url.include?(\"indiatoday\") ||\n rss_provider.rss_url.include?(\"indiatvnews\") || rss_provider.rss_url.include?(\"thehindu\") ||\n rss_provider.rss_url.include?(\"zee\")\n\n xml = HTTParty.get(rss_provider.rss_url)\n ProviderContent.create(xml: xml, rss_provider_id: rss_provider.id)\n xml = xml.body\n feeds = Feedjira.parse(xml)\n feeds.entries.each do |feed|\n title = News.find_by(title: feed.title)\n unless title.present?\n News.create(title: feed.title, summary: feed.summary.strip, \n published_on: feed.published, url: feed.url,rss_provider_id: rss_provider.id, category_id: rss_provider.category.id, \n provider_id: rss_provider.provider.id, media_credit: rss_provider.provider.provider_name)\n end\n\n end\n rss_provider.update(news_updated_at: Time.now.localtime)\n\n end\n redirect_to admin_rss_providers_path, alert: \"Fetched Successfully \"\n\n end",
"title": ""
},
{
"docid": "c51ee7137128195148926336079c3d09",
"score": "0.61820114",
"text": "def build_rss\n ::RSS::Maker.make('2.0') do |maker|\n maker.channel.link = @wiki.settings.url\n maker.channel.title = @wiki.settings.title\n maker.channel.description = @wiki.settings.description.to_s\n maker.channel.author = @wiki.settings.author.to_s\n maker.channel.updated = Time.now.to_s\n maker.items.do_sort = true\n\n posts.each do |post|\n html = post.content\n date = Time.parse(post.post_date)\n\n next if date > Time.now unless @wiki.settings.future\n\n if i = html.index('</p>')\n text = html[0..i+4]\n else\n text = html\n end\n\n maker.items.new_item do |item|\n item.title = post.title\n item.link = File.join(@wiki.settings.url, post.href)\n item.date = date\n item.description = text\n end\n end\n end\n end",
"title": ""
},
{
"docid": "be5395f4d93f7fc25a4d6a2bba0b3765",
"score": "0.61809367",
"text": "def rss\n @logs = RssLog.includes(:name, :species_list, observation: :name).\n where(\"datediff(now(), updated_at) <= 31\").\n order(updated_at: :desc).\n limit(100)\n\n render_xml(layout: false)\n end",
"title": ""
},
{
"docid": "629858669ba392d2b0308ce25a189e7a",
"score": "0.6178586",
"text": "def parse_items(feed)\n items = ExtractData.list_same_tag_data(feed, 'item').map { |item| \"<item>#{item}</item>\"}\n parsed_items = []\n\n items.each do |item|\n parsed_item = parse_tag('item', RssSpecification::ITEM_TAGS, item)\n parsed_items << parsed_item unless parsed_item.empty?\n end\n\n parsed_items\n end",
"title": ""
},
{
"docid": "9f1d9e20d509ae06ae18005be4660b73",
"score": "0.6159777",
"text": "def title() @feed.read_attribute( :title ); end",
"title": ""
},
{
"docid": "d7b30a38c162f1eeb729a3e8f409db53",
"score": "0.6158987",
"text": "def get_new_articles\n # Download the RSS feed and save to self.doc\n get_source\n \n # Keep track of which articles are in the feed \n articles = []\n \n article_links = (self.doc/'li.mjItemMain').collect do |mjItem|\n mjItem.at('a.mjLinkItem')\n end\n \n # For each item in the RSS feed \n article_links.each_with_index do |link, index|\n \n # Create or update the article in the db\n articles << Article.factory(\n :category => self.category,\n :description => '',\n :feed => self,\n :url => \"http://online.wsj.com#{link.attributes['href']}\",\n :priority => index\n )\n end\n \n articles\n end",
"title": ""
},
{
"docid": "cc26d1bd00c01daed751e9dad86bdcbc",
"score": "0.6139126",
"text": "def rss\n render_rss_feed_for Announcement.find(:all, :order => 'created_at DESC',\n :limit => 10), {\n :feed => {\n :title => 'OpenMind New Announcements',\n :link => announcements_url,\n :pub_date => :created_at\n },\n :item => {\n :title => :headline,\n :description => :formatted_description,\n :link => Proc.new{|announcement| \"#{announcements_url}##{announcement.id}\" }\n }\n }\n end",
"title": ""
},
{
"docid": "94e21331035d84c3019915c2cf4bdfd9",
"score": "0.6138035",
"text": "def xml_feed_entries(feed_url, locale, offset)\r\n p \"Feed #{feed_url}\"\r\n doc = Nokogiri::XML(open(feed_url))\r\n doc.xpath(\"//item\").count.times do |n|\r\n \r\n # process dates\r\n sdt = DateTime.parse(doc.xpath(\"//item//xCal:dtstart\")[n].text) rescue nil\r\n edt = doc.xpath(\"//item//xCal:dtend\")[n].text\r\n edt.blank? ? enddt = sdt.advance(:hours => 2) : enddt = DateTime.parse(edt)\r\n \r\n # get event title and url\r\n etitle = doc.xpath(\"//item//title\")[n].text.split(' at ')[0]\r\n url = doc.xpath(\"//item//link\")[n].text \r\n sid = doc.xpath(\"//item//id\")[n].text \r\n\r\n # get county based on coordinates\r\n lat = doc.xpath(\"//item//geo:lat\")[n].text\r\n lng = doc.xpath(\"//item//geo:long\")[n].text\r\n county = Schedule.chk_geocode(lat, lng) rescue nil\r\n \r\n # add only current events \r\n if sdt >= Date.today\r\n \r\n # find correct channel and location\r\n cid = LocalChannel.select_channel(etitle, county, locale).flatten 1\r\n# cid.map {|channel| p \"Channel: #{channel.channelID}\" }\r\n\r\n # add event to calendar\r\n cid.map {|channel| add_event(doc, n, sid, etitle[0..199], sdt, enddt, channel.channelID, url, offset)} if cid\r\n# add_event(doc, n, sid, etitle[0..199], sdt, enddt, cid[0].channelID, url, offset) if cid\r\n end\r\n end \r\n end",
"title": ""
},
{
"docid": "ebac503eb05517720d8cf3b439bb7cb7",
"score": "0.613701",
"text": "def extract_items(content)\n GnewsItemsExtractor.new.get_gnews_items(content)\nend",
"title": ""
},
{
"docid": "a91d0efc76e0f8a646bef77c9058bb4a",
"score": "0.6105487",
"text": "def entries\n settings.inject([]) do |rss_entries, url|\n rss_entries + parse_rss_entries(url)\n end\n end",
"title": ""
},
{
"docid": "ff8b2f73ec0c0d1576978acca41a7f5f",
"score": "0.60821307",
"text": "def find_feed\n @feed = @node.content\n end",
"title": ""
},
{
"docid": "5c74729922be60e778f6a16a2a19b4da",
"score": "0.6067463",
"text": "def scrape_article\n\n url=\"http://sbs.feedsportal.com/c/34692/f/637303/index.rss\"\n open(url) do |rss|\n feed = RSS::Parser.parse(rss)\n feed.items.each do |item|\n temp_article=Article.new\n temp_article.author=item.author\n temp_article.title=item.title\n\n # input was in form of several paragraphs in html format\n # the code splits the paragraphs to arrays so only the relevent\n # text is displayed\n temp_article.summary=item.description.split('<')[0]\n temp_article.images=get_http(item.description)\n temp_article.source=SbsImporter.source_name\n temp_article.link=item.link\n temp_article.date=item.pubDate.to_date\n\n\n\n\n\n if(temp_article.date <= @end && temp_article.date>=@start && is_unique(temp_article))\n #if article is with the start and end date insert into array and is unique\n\n temp_article.save\n\n\n end\n\n end\n\n\n\n\n end\n end",
"title": ""
},
{
"docid": "60e058f4b127b27feaab741a13a074d6",
"score": "0.6051944",
"text": "def scrape_article\n\n url='http://www.theage.com.au/rssheadlines/political-news/article/rss.xml'\n puts url\n open(url) do |rss|\n\n feed = RSS::Parser.parse(rss)\n\n #For each article gather the relevent information and put it in the article\n feed.items.each do |item|\n\n temp_article=Article.new\n temp_article.author=item.author\n temp_article.title=item.title\n # input was in form of several paragraphs in html format\n # the code splits the paragraphs to arrays so only the relevent\n # text is displayed\n temp_article.summary = item.description.split('</p>')[1]\n temp_article.images=get_http(item.description.split('</p>')[0].split('><')[1])\n\n temp_article.source=AgeImporter.source_name\n temp_article.link=item.link\n temp_article.date=item.pubDate.to_date\n\n\n\n if(temp_article.date <= @end && temp_article.date>=@start && is_unique(temp_article))\n # if article is with the start and end date insert into array and is unique\n\n temp_article.save\n\n\n end\n\n end\n\n\n\n\n end\n end",
"title": ""
},
{
"docid": "1bae5f28231f4d956db863988d589d1d",
"score": "0.6048739",
"text": "def extract_data(subject, query)\n result = subject.xpath(query).text\n if result == \"\"\n nil\n else\n result\n end\n end",
"title": ""
},
{
"docid": "7d9c8b7b1e816f6763de94a08c8d6e68",
"score": "0.60457855",
"text": "def parse_list\n doc = REXML::Document.new(list)\n root = doc.root\n list_items = []\n root.elements.each(\"//atom:feed\") do |entry|\n item = {}\n entry.elements.each do |e|\n case e.name\n when \"id\", \"link\", \"updated\"\n item[e.name] = e.text\n when \"author\"\n item[e.name] ||= []\n e.elements.each(\"atom:name\") do |author|\n item[e.name] << author.text\n end\n end\n end\n list_items << item unless item.empty?\n end\n list_items\n end",
"title": ""
},
{
"docid": "df3dd8c01af62ee43b985a2a01d32114",
"score": "0.6037097",
"text": "def get_raw_posts\n if @settings[:feed_url].present?\n return Feedzirra::Feed.fetch_and_parse(@settings[:feed_url]).entries\n end\n nil\n end",
"title": ""
},
{
"docid": "2754c5ebb3a71565a6a883ac94f9910a",
"score": "0.6034425",
"text": "def parse(feed_data)\n super\n\n @buzzes = []\n feed_data.elements.each('entry') do |buzz_data|\n @buzzes << Buzz.new(@user, buzz_data)\n end\n\n true\n end",
"title": ""
},
{
"docid": "3af7a4b28d4472a84687cd6cdd48e31f",
"score": "0.60254145",
"text": "def parse_by_feednormalizer(feed_text)\n feed_data = FeedNormalizer::FeedNormalizer.parse feed_text\n feed_data.entries.map do|e|\n metadata = {:author => e.author} if e.author\n {:did=>(e.id || e.urls.join(\" \")), :title=>e.title,:content=>e.content,:basetime=>e.date_published, \n :metadata=>metadata, :uri=>e.urls.join(\" \"), :tag_list=>e.categories.join(\",\")}\n end\n end",
"title": ""
},
{
"docid": "c55a8a8124af10b179a0a818e64b8168",
"score": "0.6003947",
"text": "def parse_feed(feed_body)\n Hash.from_xml(feed_body)\n .yield_self { |feed_hash| rate_array_from(feed_hash) }\n end",
"title": ""
},
{
"docid": "167f61621c62f1004767468d0f84c7e7",
"score": "0.6001504",
"text": "def fetch_feed\n endpoint = @current_feed.values.first\n\n begin\n document = SimpleRSS.parse(URI.open(endpoint, 'User-Agent' => 'Ruby-wget'))\n rescue StandardError => e\n puts \"Error: <#{e}> while trying to call <#{@current_feed_link}>\"\n # effectively skip document\n document = { title: Rss::NO_VALUE, items: {} }\n end\n\n # Ensuring string access instead of symbol access.\n # I know there's probably a better way to do this...\n # but I can't remember if with_indifferent_access is\n # a rails thing...\n @cache[@current_feed.keys.first] = JSON.parse(document.items.to_json)\n end",
"title": ""
},
{
"docid": "928b4c5137ae0f51749ca1d4a1cacbf0",
"score": "0.5997689",
"text": "def retrieve(rss)\n\n #pp rss\n if rss.is_a?(RSS::Rss)\n channel=rss.channel\n\n self.name=channel.title\n self.description=channel.description\n\n self.state=\"retrieving\"\n self.save\n children=0\n rss.items.each{|item|\n updateOrCreate(item)\n children+=1\n break if children>MAX_CHILDREN\n }\n\n else\n\n self.name=rss.title\n self.description=rss.subtitle if rss.respond_to?(:subtitle)\n\n self.state=\"retrieving\"\n children=0\n rss.items.each{|item|\n updateOrCreate(item)\n children+=1\n break if children>MAX_CHILDREN\n }\n end\n self.state=\"retrieved\"\n save\n end",
"title": ""
},
{
"docid": "b1c8a7be69db1bdd2b30564a6b100c8c",
"score": "0.5996816",
"text": "def rss # :nologin:\n @logs = RssLog.all(conditions: \"datediff(now(), updated_at) <= 31\",\n order: \"updated_at desc\", limit: 100,\n include: [:name,\n :species_list,\n { observation: :name }\n ])\n render_xml(layout: false)\n end",
"title": ""
},
{
"docid": "d25ec68d1c9600f31bcb84028d71d16b",
"score": "0.59947014",
"text": "def xml\n @feed ||= FeedzirraPodcast::Parser::Podcast.parse(open(self.url))\n end",
"title": ""
},
{
"docid": "0a0c13735512aa31213576a57d50b275",
"score": "0.59849244",
"text": "def main\n\n feedlist = File.foreach('parselist') do |wholeline|\n\n wholeline.strip!\n\n next if wholeline.empty?\n\n line = wholeline.split(\",\")\n url = line[0].strip\n tag = line[1].strip\n\n #parse each feed\n\n rss = SimpleRSS.parse(open(url).read)\n\n puts ' '\n puts rss.feed.title\n puts ' '\n\n rss.items[0..2].each do|i|\n puts \"Date: #{i.pubDate or i.published}\"\n puts \"Title: #{i.title}\"\n puts \"Link: #{i.link}\"\n puts \"=\" * 80\n end\n\n end\n\nend",
"title": ""
},
{
"docid": "fe69d5903eb84f73ccb7448be710182a",
"score": "0.596398",
"text": "def get_feed(params)\n\n #Rails.logger.info(\" [RAILS] [LIB] [SCREEN_SCRAP] [GET_FEED] Entering\")\n\n url = process_node(params)\n\n if url && String === url && url !~ /^http/ && params[:url]\n url = URI.join(params[:url] , url).to_s\n elsif url && Array === url\n url.map! do |u|\n if u !~ /^http/ && params[:url]\n URI.join(params[:url], u).to_s\n else\n u\n end\n end\n url.uniq!\n end\n\n #Rails.logger.info(\" [RAILS] [LIB] [SCREEN_SCRAP] [GET_FEED] Leaving\")\n params[:output][\"feed\"] = url\n\n rescue => e\n Rails.logger.error(\"[RAILS] [LIB] [SCREEN_SCRAP] [GET_FEED] **** RESCUE **** #{e.message} \")\n nil\n end",
"title": ""
},
{
"docid": "e77652f85e02ac7fe3f24cfd9890a130",
"score": "0.59556705",
"text": "def extract_data(subject, query)\n result = subject.at_xpath(query)\n if result.nil? || result.content.empty?\n nil\n else\n result.content\n end\n end",
"title": ""
},
{
"docid": "a472873b680f73056e6a5347b1e92edc",
"score": "0.5942957",
"text": "def process_feed(url, limit=200)\n rss = SimpleRSS.parse open(url)\n rss.items.each_with_index do |item, index|\n puts \"Parsing RSS item #{item.title}\"\n screenshoot(item.link, to_filename(item.title, IMG_FILENAME_SIZE))\n puts \"... donez\"\n puts \"\"\n break if index == limit-1\n end \nend",
"title": ""
},
{
"docid": "50ffd49636857a9c154bac02e6561dfe",
"score": "0.5938042",
"text": "def parse_feed_line line\n # Return [url, category, title]\n Feed.new(*line.split(' ', 3).map(&:strip))\nend",
"title": ""
},
{
"docid": "db25fb0a3f8a0f976fc4ee45c4f8cae9",
"score": "0.59331304",
"text": "def feed_items\n feed_item\n end",
"title": ""
},
{
"docid": "73829bcbf32c1a2548114fec1b186873",
"score": "0.5909806",
"text": "def feed!\n http_fetch(feed_url)\n end",
"title": ""
},
{
"docid": "432ff00e550725d3a5a51e5017347467",
"score": "0.59095037",
"text": "def content_for_rss_title\n rss_title = content_descriptions.detect { |c| c['rss_title'] }\n contents.find_by_name(rss_title['name'])\n end",
"title": ""
},
{
"docid": "6a9dabd50644264ed59542af1a885b84",
"score": "0.5906871",
"text": "def get_userposts( user )\n posts = []\n url = \"http://feeds.delicious.com/rss/#{user}\"\n\n response = Net::HTTP.get_response(URI.parse(url)).body\n doc = REXML::Document.new(response)\n\n doc.elements.each(\"//item\") do |item|\n posts << { \"href\" => item.elements[\"link\"].text }\n end\n\n sleep 1\n return posts\n end",
"title": ""
},
{
"docid": "773aacc04ac3cab92c7890d7c2e83e89",
"score": "0.5894949",
"text": "def parse(content,browser=nil)\n\t\t\t@ret=Nokogiri::XML(content)\n\t\t\t@sniffed_type=sniff(@ret)\n\t\t\tcase @sniffed_type\n\t\t\twhen :acquisition then return OPDS::AcquisitionFeed.from_nokogiri(@ret,browser)\n\t\t\twhen :navigation then return OPDS::NavigationFeed.from_nokogiri(@ret,browser)\n\t\t\twhen :entry then return OPDS::Entry.from_nokogiri(@ret,nil,browser)\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "1694cfced07e3ab05ce3b7996a49163c",
"score": "0.5886867",
"text": "def initialize(feed, item)\n if (feed.feed_type == \"rss\")\n @feed_title = feed.channel.title\n @title = item.title\n @link = item.link\n @date = parse_time(item.date)\n @content = item.description\n @content = item.content_encoded if item.content_encoded\n @guid = item.guid.content\n @audio = nil\n if item.enclosure\n if item.enclosure.type == \"audio/mpeg\"\n @audio = item.enclosure.url\n elsif item.enclosure.type.start_with? \"image/\" # If there is an image in the enclosure\n unless @content.include? \"<img \" # and no images in the content\n # then include the enclosure image\n @content = \"<img src=\\\"#{item.enclosure.url}\\\" /><br/>\" + @content\n end\n end\n end\n elsif (feed.feed_type == \"atom\")\n @feed_title = feed.title.content\n @title = item.title.content\n @link = item.link.href\n if !item.published.nil?\n @date = parse_time(item.published.content)\n else\n @date = parse_time(item.updated.content)\n end\n if !item.content.nil?\n @content = CGI.unescapeHTML(item.content.to_s)\n else\n @content = CGI.unescapeHTML(item.summary.to_s)\n end\n @guid = item.id.to_s\n @audio = nil # TODO podcast support for Atom feeds?\n end\n end",
"title": ""
},
{
"docid": "fc7ce849488a4696bcff8ef79db66bd4",
"score": "0.58786476",
"text": "def entries\n if @entries.nil?\n raw_entries = FeedTools::XmlHelper.select_not_blank([\n FeedTools::XmlHelper.try_xpaths_all(self.channel_node, [\n \"atom10:entry\",\n \"atom03:entry\",\n \"atom:entry\",\n \"entry\"\n ]),\n FeedTools::XmlHelper.try_xpaths_all(self.root_node, [\n \"rss10:item\",\n \"rss11:items/rss11:item\",\n \"rss11:items/item\",\n \"items/rss11:item\",\n \"items/item\",\n \"item\",\n \"atom10:entry\",\n \"atom03:entry\",\n \"atom:entry\",\n \"entry\",\n \"story\"\n ]),\n FeedTools::XmlHelper.try_xpaths_all(self.channel_node, [\n \"rss10:item\",\n \"rss11:items/rss11:item\",\n \"rss11:items/item\",\n \"items/rss11:item\",\n \"items/item\",\n \"item\",\n \"story\"\n ])\n ])\n\n # create the individual feed items\n @entries = []\n unless raw_entries.blank?\n for entry_node in raw_entries.reverse\n new_entry = FeedItem.new\n new_entry.feed_data = entry_node.to_s\n new_entry.feed_data_type = self.feed_data_type\n new_entry.root_node = entry_node\n if new_entry.root_node.namespace.blank?\n new_entry.root_node.add_namespace(self.root_node.namespace)\n end\n @entries << new_entry\n end\n end\n end\n \n # Sort the items\n if self.configurations[:entry_sorting_property] == \"time\"\n @entries = @entries.sort do |a, b|\n (b.time or Time.utc(1970)) <=> (a.time or Time.utc(1970))\n end\n elsif self.configurations[:entry_sorting_property] != nil\n sorting_property = self.configurations[:entry_sorting_property]\n @entries = @entries.sort do |a, b|\n eval(\"a.#{sorting_property}\") <=> eval(\"b.#{sorting_property}\")\n end\n else\n return @entries.reverse\n end\n return @entries\n end",
"title": ""
},
{
"docid": "207858a066c1590a8b569137f90eb6e5",
"score": "0.58749235",
"text": "def content_for_rss_description\n rss_title = content_descriptions.detect { |c| c['rss_description'] }\n contents.find_by_name(rss_title['name'])\n end",
"title": ""
},
{
"docid": "9e82f29d42af91e03aa7a21e995eaf53",
"score": "0.5870719",
"text": "def fetch\n options = {:on_success => method(:success), :on_failure => method(:failure), :timeout => 30}\n feed = Feedzirra::Feed.fetch_and_parse(self.feed_url, options)\n rescue Exception => e\n puts \"Failure fetching feed: #{e.message}\" \n end",
"title": ""
},
{
"docid": "a7b71c2bbbc9954f012035c907593d13",
"score": "0.58645546",
"text": "def parse_feed_url\n url = sanitize_url(self.url)\n Feedbag.find(url)[0]\n end",
"title": ""
},
{
"docid": "afe2e6cd131860bf758e294a34615633",
"score": "0.58585453",
"text": "def scrape_article\n url=\"http://www.abc.net.au/radionational/feed/3777540/rss.xml\"\n open(url) do |rss|\n feed = RSS::Parser.parse(rss)\n feed.items.each do |item|\n temp_article=Article.new\n temp_article.author=item.author\n temp_article.title=item.title\n temp_article.summary = item.description\n temp_article.images=nil #note no image provided on this RSS field\n temp_article.source=AbcImporter.source_name\n temp_article.link=item.link\n temp_article.date=item.pubDate.to_date\n\n\n\n\n\n if(temp_article.date <= @end && temp_article.date>=@start && is_unique(temp_article))\n #if article is with the start and end date insert into array and is unique\n\n temp_article.save\n\n\n end\n\n end\n\n\n\n\n end\n end",
"title": ""
},
{
"docid": "dcab2e5f74737ca5f88e086e4530fba9",
"score": "0.5851231",
"text": "def aviator \n aviator_output = {}\n source = \"Aviator-aero\"\n url = 'https://newsroom.aviator.aero/rss/'\n open(url) do |rss|\n feed = RSS::Parser.parse(rss)\n\n feed.items.each_with_index {|item, index|\n title = item.title\n description = item.description.gsub(/<\\/?[^>]*>/, \"\")\n category = item.category\n link = item.link \n \n aviator_output[index] = {\n :title => title,\n :description => description,\n :link => link,\n :source => source\n }\n }\n end\n aviator_output\n end",
"title": ""
},
{
"docid": "2abbdeb7d1bfc1e238ac42ccd8abb500",
"score": "0.58475435",
"text": "def rss \n @vote_topics = VoteTopic.rss\n respond_to do |format|\n format.rss\n end\n end",
"title": ""
},
{
"docid": "317f2a808d9271a8c6e281d258ca028c",
"score": "0.5847199",
"text": "def get_feed(url, opts)\n\n opts.extra = Hash.new\n opts.extra[\"Connection\"] = \"close\"\n # some sites need User-Agent field\n opts.extra[\"User-Agent\"] = \"RSSClient/2.0.9\"\n\n # Ask for changes (get 304 code in response)\n # opts.since is Time::\n if not opts.forceUpdate and opts.since\n time = Time.parse(opts.since.to_s)\n opts.extra[\"If-Modified-Since\"] = time.httpdate() if time\n end\n\n begin\n @rssc_raw = get_url(url, opts)\n return nil unless @rssc_raw\n\n case @rssc_raw.status\n when 200 # good\n when 301, 302 # follow redirect ...\n @rssc_raw = get_url(@rssc_raw.header[\"Location\"], opts)\n return nil unless @rssc_raw\n\n when 304 # Not modified - nothing to do\n return nil\n\n # errors\n when 401\n raise RuntimeError, \"access denied, \" + @rssc_raw.header['WWW-Authenticate'].to_s\n when 404\n raise RuntimeError, \"feed [ #{url} ] not found\"\n else\n raise RuntimeError, \"can't fetch feed (unknown response code: #{@rssc_raw.status})\"\n end\n\n return nil unless @rssc_raw.content\n\n # Parse the raw RSS\n begin\n FeedNormalizer::FeedNormalizer.parse(@rssc_raw.content, :try_others => true)\n rescue NoMethodError\n # undefined method `channel' for #<RSS::Atom::Feed:0x9f03b70>\n # try a simpler parser ...\n FeedNormalizer::FeedNormalizer.parse(@rssc_raw.content,\n :try_others => true, :force_parser => FeedNormalizer::SimpleRssParser\n )\n end\n rescue RuntimeError => error\n @rssc_error = error\n return nil\n end \n end",
"title": ""
},
{
"docid": "2974f2e209fc6c08660c35a0b659effa",
"score": "0.5844887",
"text": "def fetch_articles\n current_feed = get_rss_feed( self.url )\n current_feed.entries.each do |article|\n unless self.array_of_article_urls.include?(article.url)\n a = Article.new(title: article.title, url: article.url, clicks: 0)\n a.title ||= article.summary\n self.articles.push a \n end\n end\n\tend",
"title": ""
},
{
"docid": "2ddfdf8649721aa7203716e889a8cada",
"score": "0.5827423",
"text": "def xml\n xml = Builder::XmlMarkup.new(indent: 2)\n\n xml.instruct! :xml, encoding: 'UTF-8'\n xml.rss version: '2.0' do |rss|\n rss.channel do |channel|\n channel.title 'Haxpressen'\n\n last_ten_days.each do |day|\n summary = summary_for day\n\n if summary.present?\n channel.item do |item|\n item.title \"Sammanfattning för #{day}\"\n item.pubDate day\n item.description summary\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9744a15b80217697e740eda082fb8850",
"score": "0.58268833",
"text": "def import_xml(raw)\n doc = Nokogiri::XML(raw)\n\n @events = []\n doc.css('entry').each do |entry|\n fields = {\n :id => entry.css('id').text,\n :published => entry.css('published').text,\n :title => entry.css('title').text,\n :summary => entry.css('content').text,\n :start => DateTime.parse(entry.xpath('gd:when').first['startTime']),\n :end => DateTime.parse(entry.xpath('gd:when').first['endTime']),\n :where => entry.xpath('gd:where').first['valueString'],\n :url => entry.css('link').first['href']\n }\n \n @events << Event.new(fields)\n end\n\n return @events\n end",
"title": ""
},
{
"docid": "b6d127f129ba341fb3ddb9bf829898fe",
"score": "0.58132285",
"text": "def news_for_feed(feed_id)\n news = []\n\n where(:user_id => User.current_user_id, :feed_id => feed_id).each do |news_item|\n news.push news_item.attributes\n end\n\n news\n end",
"title": ""
},
{
"docid": "58a4a71b542a10537fc4e76dbe6dba1b",
"score": "0.5801582",
"text": "def initialize(data)\n @data = data\n @content_type = :rss # TODO: make this dynamic\n end",
"title": ""
},
{
"docid": "7d95f3c7dcb8ed56f498b527e037c2b9",
"score": "0.58011556",
"text": "def get_feed(feed_url = nil)\n unless feed_url.blank?\n # trim the url element\n feed_url.strip!\n begin\n feed = Atom::Feed.load_feed(URI.parse(feed_url))\n rescue\n feed = nil\n end\n feed\n end\n end",
"title": ""
},
{
"docid": "00d2632590016cb710aac068a5586ce2",
"score": "0.5800519",
"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\n\tend",
"title": ""
},
{
"docid": "3317c92badbcc502f2b739ccaf7ebf95",
"score": "0.57981926",
"text": "def httpdownload_callback\r\n Emergency.delete_all()\r\n file = File.new(@@feedPath)\r\n doc = REXML::Document.new(file)\r\n firstLoop = true\r\n #Parse each item element in this XML document.\r\n doc.elements.each(\"*/channel/item\")do |elm|\r\n title = elm.elements[\"title\"].text\r\n desc = elm.elements[\"description\"].text\r\n date_time = elm.elements[\"pubDate\"].text\r\n category = elm.elements[\"category\"].text\r\n # We want the \"fulltime\" element in our database to be a UNIX time-stamp because comparisons are easier.\r\n alertTime = Time.parse(date_time)\r\n nixTimeStamp = alertTime.to_i\r\n date_array = \"PlaceHolder\", \"PlaceHolder\"\r\n # Convert the RSS pubDate to an easily readable format\r\n date_array[0] = alertTime.month.to_s + \"/\" + alertTime.day.to_s + \"/\" + alertTime.year.to_s\r\n if alertTime.hour > 12\r\n hours = alertTime.hour - 12\r\n pm = true\r\n else\r\n hours = alertTime.hour\r\n pm = false\r\n end\r\n date_array[1] = hours.to_s + \":\" + alertTime.min.to_s\r\n if pm == true\r\n date_array[1] = date_array[1] + \" PM\"\r\n else\r\n date_array[1] = date_array[1] + \" AM\"\r\n end\r\n # Create this Emergency object in the database.\r\n Emergency.create({ \"title\" => title, \"description\" => desc, \"time\" => date_array[1], \"date\" => date_array[0], \"fullTime\" => nixTimeStamp, \"category\" => category})\r\n end\r\n file.close\r\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "0ee62ba45ca6ffe9a72e93c03370c7f2",
"score": "0.0",
"text": "def set_item_unit\n @item_unit = ItemUnit.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 [email protected]?(: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": ""
}
] |
a9f33d1ab83951633bbe0bab96ec913e
|
Return the most recent move.
|
[
{
"docid": "4d7ca7aac4beff4eb88e7d6c46924793",
"score": "0.77240956",
"text": "def last_move\n move_queue.last\n end",
"title": ""
}
] |
[
{
"docid": "dce9826d0dc60706d61a85d8e78f2bd5",
"score": "0.7947677",
"text": "def last_move\n #the last line is always returned... Learn your shiz.\n self.moves.first(:conditions => [\"move = ?\", self.moves.maximum(\"move\")])\n end",
"title": ""
},
{
"docid": "2a8de491d04bad1a07bfc741769b95e3",
"score": "0.7857379",
"text": "def last_move\n @moves[-1]\n end",
"title": ""
},
{
"docid": "77249c24f4d05419b66b2e5e16ca4b1a",
"score": "0.774293",
"text": "def last_entry\n return Move.new(from: nil, to: nil, piece: nil) if @moves.empty?\n\n @moves.last\n end",
"title": ""
},
{
"docid": "cbf1d312a039c590575d3cc2e80e285b",
"score": "0.7649973",
"text": "def last\n go_to_move_and_return_board(moves)\n end",
"title": ""
},
{
"docid": "e37cf9c315e19e530934e81e78bae1a8",
"score": "0.758437",
"text": "def last_move\n self.rr.d.d.r.f.d.d.fr.ur.f.d.d.fr.rr.d.d.r.u\n self\n end",
"title": ""
},
{
"docid": "554afc35ef76e69e7a6c0d527ed88d92",
"score": "0.7391569",
"text": "def last_move\r\n log[-1]\r\n end",
"title": ""
},
{
"docid": "a4e99d9a58f854a4df24eb0d4be9fb3e",
"score": "0.7329515",
"text": "def last_move\n\t\tmove[-1, 1]\n\tend",
"title": ""
},
{
"docid": "567729e7752b7c8e2c04056bcd912581",
"score": "0.72024935",
"text": "def last_piece_moved\n game.pieces.order(:updated_at).last \n end",
"title": ""
},
{
"docid": "c7d90296ae58f4560564f0dd259401fa",
"score": "0.6846707",
"text": "def last_position\n return position(last_time)\n end",
"title": ""
},
{
"docid": "8c5dd8e6be807d5b8bd6abe588e5e139",
"score": "0.678291",
"text": "def last_piece\n self.game_pieces.order(:updated_at).last\n end",
"title": ""
},
{
"docid": "0a95b277e94166fccc3f1af551da5bdc",
"score": "0.6646499",
"text": "def bestmove\n\t\t\tif @bestmoves\n\t\t\t\treturn @bestmoves[Kernel.rand(@bestmoves.size)]\n\t\t\tend\n\t\t\tnil\n\t\tend",
"title": ""
},
{
"docid": "099af007b7f981f5c5d7a2a6464c15e1",
"score": "0.66345996",
"text": "def next_move\n moves.max{ |a, b| a.rank <=> b.rank }\n end",
"title": ""
},
{
"docid": "286503bf298c93d0a8343414980f1e2b",
"score": "0.6597763",
"text": "def latest \n sort().last\n end",
"title": ""
},
{
"docid": "a0cd2a6b538b91ce254d9899b18e2c55",
"score": "0.65496",
"text": "def update_last_move(move)\n @last_move = move\n end",
"title": ""
},
{
"docid": "483d0ec4c337148edb0549f964f35e1e",
"score": "0.65108395",
"text": "def get_move\n get_move if move(get_input).nil?\n end",
"title": ""
},
{
"docid": "d35ff1b88d46595b1679519a79a6b9d6",
"score": "0.651051",
"text": "def newest(name)\n oldest(name).reverse\n end",
"title": ""
},
{
"docid": "d02add4b89155af78bfa48c6cf702a4c",
"score": "0.64967096",
"text": "def getBestMove()\n # Get the highest row (closest to 0) with a non-empty\n # block. This is the top of the reward area.\n \n # Iterate through all options for the tetromino with\n # each rotation considered.\n \n # Must be done without the Tetromino on the board because it will mess it up.\n start = Time.now\n \n # Figure out how many orientations we have to try for this tetromino.\n rotation = 1\n case (@tetromino.getRotationType())\n when Tetromino::NO_ROTATION\n rotation = 1\n when Tetromino::TWO_ROTATION\n rotation = 2\n when Tetromino::FOUR_ROTATION\n rotation = 4\n else\n abort(\"No rotation type specified for type #{@type} tetromino\")\n end\n \n # We have to check every possible rotation of the tetromino.\n for rot in 0...rotation\n tryMoves(rot)\n @tetromino.rotateLeft()\n end\n \n elapsed_time = Time.now - start\n return @best_move, elapsed_time\n end",
"title": ""
},
{
"docid": "51db006bd80ad97176d1cf2af129dd67",
"score": "0.64469856",
"text": "def most_recent_shot\n @recent_shot ||= shots.order('created_at').last\n end",
"title": ""
},
{
"docid": "9500fc70ecd8399079c4b3853a3b0504",
"score": "0.6445952",
"text": "def current_move\n moves[@current_move_index]\n end",
"title": ""
},
{
"docid": "9500fc70ecd8399079c4b3853a3b0504",
"score": "0.6445952",
"text": "def current_move\n moves[@current_move_index]\n end",
"title": ""
},
{
"docid": "b90f76e4f8cb95245ca9e2ec6c9149b5",
"score": "0.6432858",
"text": "def last_finished_game\n archived_games.sort_by {|g| g.finished_at }.last\n end",
"title": ""
},
{
"docid": "b90f76e4f8cb95245ca9e2ec6c9149b5",
"score": "0.6432858",
"text": "def last_finished_game\n archived_games.sort_by {|g| g.finished_at }.last\n end",
"title": ""
},
{
"docid": "2561f3610ef811356daade97cac4f7ca",
"score": "0.64201736",
"text": "def newest(n=1)\n @history[0, n]\n end",
"title": ""
},
{
"docid": "ed834c77c8c0e043c682d3a02192bd2f",
"score": "0.6400279",
"text": "def best_move\n possible_moves.send(change_turn(:max_by, :min_by)) {|idx| move(idx).minimax}\n end",
"title": ""
},
{
"docid": "c4a58a4cadb5aa191aa91170487119c2",
"score": "0.6361297",
"text": "def recent\n results.last\n end",
"title": ""
},
{
"docid": "032269f8446184e41dcc553575d5b4a7",
"score": "0.6345955",
"text": "def choose\n last_move = move_history[-1]\n if move_history[-2] == last_move\n super\n else\n @move = Move.initialize_move_type(last_move)\n move_history << last_move\n end\n end",
"title": ""
},
{
"docid": "c380aeba4975b4b367c182ca08c931c2",
"score": "0.62859184",
"text": "def previous_turn()\n return @turns.last()\n end",
"title": ""
},
{
"docid": "413c3c8c8a96e32ed7b39b50ad4f3158",
"score": "0.6266549",
"text": "def most_recent_flight\n all_flights = Flight.plane_is(self).in_order_of_creation\n if all_flights.length > 0\n return all_flights.last.update_status_and_location\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "96965e12037cb6d1f2920d6244191d11",
"score": "0.6265964",
"text": "def latest\n @next_position ||= (read_position || 0)\n end",
"title": ""
},
{
"docid": "96965e12037cb6d1f2920d6244191d11",
"score": "0.6265964",
"text": "def latest\n @next_position ||= (read_position || 0)\n end",
"title": ""
},
{
"docid": "8e537df6e988e099e105d5ed273efe8d",
"score": "0.6265163",
"text": "def previous_move_reference\n previous_move&.reference\n end",
"title": ""
},
{
"docid": "031a1ead5fcdcc5f38fb9959dae261f7",
"score": "0.62575",
"text": "def next_move(game)\n min_max(game)[1]\n end",
"title": ""
},
{
"docid": "1e79c6f2fb935a9bfd66a589da7d5ee9",
"score": "0.62495154",
"text": "def most_recent_commit\n return git.log.first\n end",
"title": ""
},
{
"docid": "4b7d3bc6e77071e8db42e81a5a1747e6",
"score": "0.62270504",
"text": "def test_last_move\n\t\tplayer = Player.new(name: \"shawn\", move: \"abcdefg\", number_of_wins: \"10\")\n\t\tassert(\"g\", player.last_move)\n\tend",
"title": ""
},
{
"docid": "a95afa08562c5035a94d3940bd2f5aba",
"score": "0.6226488",
"text": "def last_location\n waypoints.order(sent_at: :desc).first\n end",
"title": ""
},
{
"docid": "a3925ca882e250b7ef14adb7c5ca2285",
"score": "0.6217067",
"text": "def find_best_move\n return 3 if @board.turn_count == 1\n\n moves = {}\n cutoff_depth = CUTOFF_DEPTHS[@board.legal_moves.length]\n\n @board.legal_moves.each do |move|\n copy = Marshal.load(Marshal.dump(@board))\n copy.move(move, @value)\n score = -minimax(copy, -@value, cutoff_depth)\n moves[move] = score\n end\n\n best_moves = moves.select { |_move, score| score == moves.values.max }.keys\n move = best_moves.sample # if there are multiple best moves with the same value, choose a random one\n log(moves, move) if LOG_MOVES\n move\n end",
"title": ""
},
{
"docid": "41b79aa7b4b40a284124402610d503b8",
"score": "0.6216179",
"text": "def most_recent_event\n recent_events.first\n end",
"title": ""
},
{
"docid": "1416381607be9215a52a05c769db11c3",
"score": "0.6214128",
"text": "def last\r\n history.last\r\n end",
"title": ""
},
{
"docid": "50d498014262dcad24dc5c68940adb5b",
"score": "0.6190272",
"text": "def calc_last_tournament\n return if !rorder || rorder <= 1\n Tournament.where(rorder: rorder - 1).first\n end",
"title": ""
},
{
"docid": "851dd2afcc49102f3936fab6cd97efd0",
"score": "0.6182075",
"text": "def latest\n result = nil\n each do |revision|\n result = revision if result.nil? || result.time < revision.time\n end\n result\n end",
"title": ""
},
{
"docid": "5a9271d2be2c003c386bc01de076918f",
"score": "0.617312",
"text": "def latest_build\n builds[-1]\n end",
"title": ""
},
{
"docid": "c03dc090c95959abf6491d977af45067",
"score": "0.617213",
"text": "def last_time\n return @position.keys.max\n end",
"title": ""
},
{
"docid": "6998e03f85ac2b75cd2846cdf7c318fd",
"score": "0.6158063",
"text": "def last; history.last end",
"title": ""
},
{
"docid": "e55089de7006c2f67ad39037cdda7b24",
"score": "0.61521983",
"text": "def last\n sort.reverse.first\n end",
"title": ""
},
{
"docid": "e55089de7006c2f67ad39037cdda7b24",
"score": "0.61521983",
"text": "def last\n sort.reverse.first\n end",
"title": ""
},
{
"docid": "5cfa5b273b7582998acf675692af04fb",
"score": "0.6145203",
"text": "def most_recent_recipe\n recipe_cards[-1].recipe\n end",
"title": ""
},
{
"docid": "e509ca786285f6e110b3a645b50f5a0d",
"score": "0.6134658",
"text": "def previous_move\n i = @current_move_index - 1\n i = 0 if i < 0\n @current_move_index = i\n moves[i]\n end",
"title": ""
},
{
"docid": "e509ca786285f6e110b3a645b50f5a0d",
"score": "0.6134658",
"text": "def previous_move\n i = @current_move_index - 1\n i = 0 if i < 0\n @current_move_index = i\n moves[i]\n end",
"title": ""
},
{
"docid": "7205e780fafa6d7269cff296dda09409",
"score": "0.61334",
"text": "def get_next_move\n\t\t\t\tto_act = nil\n\t\t\t\tloop do\n\t\t\t\t\tto_act = player_to_act\n\t\t\t\t\tif to_act\n\t\t\t\t\t\tbreak\n\t\t\t\t\telse\n\t\t\t\t\t\t# We don't have enough players, or the game hasn't started. Wait for more.\n\t\t\t\t\t\tFiber.yield\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tmove = nil\n\t\t\t\tif to_act.yields_for_move\n\t\t\t\t\tmove = to_act.get_move\n\t\t\t\telse\n\t\t\t\t\tmove = defer_move\n\t\t\t\tend\n\t\t\t\treturn move\n\t\t\tend",
"title": ""
},
{
"docid": "4d926a90e21cc345c794ceb485b6c5b8",
"score": "0.61070657",
"text": "def find_best_move\n return 3 if @board.turn_count == 1\n\n moves = {}\n @cutoff_depth = calculate_cutoff_depth(@board.legal_moves.length)\n\n @board.legal_moves.each do |move|\n copy = Marshal.load(Marshal.dump(@board))\n copy.make_move(move, @value)\n score = -minimax(copy, -@value)\n moves[move] = score\n end\n\n best_moves = moves.select { |_move, score| score == moves.values.max }.keys\n move = best_moves.sample # if there are multiple best moves with the same value, choose a random one\n log(moves, move) if LOG_MOVES\n move\n end",
"title": ""
},
{
"docid": "b6a9f24beef3e013dcb25b14125abf92",
"score": "0.60965014",
"text": "def latest\n sorted_tomatoes.first\n end",
"title": ""
},
{
"docid": "de0329d2dc39ed1ffe49746a52fa65d7",
"score": "0.609623",
"text": "def oldest(n=1)\n @history[-n..-1].reverse!\n end",
"title": ""
},
{
"docid": "fb18d49d72fcdda649b3bebd233715e4",
"score": "0.608152",
"text": "def newest_snapshot\n snapshots.sort_by(&:created_at).last\n end",
"title": ""
},
{
"docid": "bd9556aa7083214f88006314c0315b68",
"score": "0.60813165",
"text": "def milestone\n milestones.sort_by{|m| m.updated_at }.last || sanitize!\n end",
"title": ""
},
{
"docid": "53369491a5cd4b496bf935567b4f315b",
"score": "0.6067717",
"text": "def set_most_recent\n @recent = House.order(\"created_at\").last\n end",
"title": ""
},
{
"docid": "0b797708f93107be35f49e61ec776eb5",
"score": "0.6057421",
"text": "def last\n history.last\n end",
"title": ""
},
{
"docid": "28a5bed91c8439f1aef2e83002c773d8",
"score": "0.60537106",
"text": "def newest\n\t\t@deltas[@deltas.keys.sort.last]\n\tend",
"title": ""
},
{
"docid": "9f8e25174b6ffe6e3ed281a5aae73109",
"score": "0.6039523",
"text": "def latest_move_time(time)\n interval = self.turn_interval * SECONDS_PER_MINUTE\n midnight = time.midnight.to_i\n elapsed = time.to_i - midnight\n Time.at(midnight + interval * (elapsed / interval))\n end",
"title": ""
},
{
"docid": "6d36a54d0746e56321415a1e05118e11",
"score": "0.6030182",
"text": "def next_move\n last_move = total_moves - 1\n i = @current_move_index + 1\n i = last_move if i >= last_move\n @current_move_index = i\n moves[i]\n end",
"title": ""
},
{
"docid": "b706e91963df39622ac4d982ddd4edc8",
"score": "0.6021524",
"text": "def most_recent_commit\n `git log | head -n 1 | cut -d \" \" -f 2`\n end",
"title": ""
},
{
"docid": "16b37695e0b51076ad9cbdae694db905",
"score": "0.6014925",
"text": "def most_recent_travel\n if spouse\n spouse_travel = Travel.not_future.where(\"member_id = ? and with_spouse = ?\", spouse_id, true)\n else\n spouse_travel = []\n end\n return (Travel.not_future.where(\"member_id = ?\", self.id) + spouse_travel).sort.last\n end",
"title": ""
},
{
"docid": "bc2affb93aa8cc00f281be054a5a2c43",
"score": "0.6013524",
"text": "def last\n get(-1)\n end",
"title": ""
},
{
"docid": "4051cac21dd8819c7a659a107ed2708e",
"score": "0.60106254",
"text": "def last\n all(:limit => 1, :descending => true).first\n end",
"title": ""
},
{
"docid": "94b9092b1df211d64c5bc5f5b544e132",
"score": "0.60075754",
"text": "def oldest_commit\n commits.last\n end",
"title": ""
},
{
"docid": "1da3fe2d4b1259060c5c96f5a2790b97",
"score": "0.60049635",
"text": "def last\n return nil unless @history.last\n @history.last.dup\n end",
"title": ""
},
{
"docid": "080961ec63bdfbba78201c33c382e183",
"score": "0.6003414",
"text": "def get_move(board)\n puts board.to_s\n until board.valid_move?(move = prompt)\n print \"#{move} is not valid. \"\n end\n return move\n end",
"title": ""
},
{
"docid": "bb89b62841f8a4192265d9d89a1544ec",
"score": "0.5988368",
"text": "def most_recent_work\n Work.find(recent_work_id)\n end",
"title": ""
},
{
"docid": "36bca6fd165111defa448c2180880d7f",
"score": "0.59754103",
"text": "def get_recent_paste\n self.get_recent_pastes(1).first\n end",
"title": ""
},
{
"docid": "66be809fe1e24d31beb270080dcb426c",
"score": "0.5969352",
"text": "def last_transition\n\n transitions.last\n end",
"title": ""
},
{
"docid": "17bfbc2940c6dc76ba30997887247a03",
"score": "0.59662366",
"text": "def get_move(game_board) \n\n\t\t\tposition = game_board.index(\"\") # get the index of the first open position \n\t\t\n\t\t\tmove = @moves[position] # get the corresponding location for the index \n\tend",
"title": ""
},
{
"docid": "817b285760cb562c15545e670002f5e1",
"score": "0.59660417",
"text": "def move\n return @move\n end",
"title": ""
},
{
"docid": "a4e558638bf4ed47bcaf4246bcb55718",
"score": "0.596069",
"text": "def last_game\n set_games.last\n end",
"title": ""
},
{
"docid": "9b21f3c171df628c3115e6e816239fd1",
"score": "0.5960468",
"text": "def most_recent\n reverse_order(:created_at)\n end",
"title": ""
},
{
"docid": "9b21f3c171df628c3115e6e816239fd1",
"score": "0.5960468",
"text": "def most_recent\n reverse_order(:created_at)\n end",
"title": ""
},
{
"docid": "7c4ff6eeff8272ca71e53242e26f8122",
"score": "0.59568864",
"text": "def getLast\n return @store[-1]\n end",
"title": ""
},
{
"docid": "6b824a8301a2fc985587e37e8c64ed7e",
"score": "0.5952095",
"text": "def latest\n order(\"version_from desc\").first\n end",
"title": ""
},
{
"docid": "1e25d6dd0937b11a2e51472e78f3f0c6",
"score": "0.5943354",
"text": "def latest_location\n self.all_locations.last\n end",
"title": ""
},
{
"docid": "6a4722138af9228c287b043f0a52e309",
"score": "0.5941775",
"text": "def newest_change\r\n @student.repo.last_change( @folder )\r\n end",
"title": ""
},
{
"docid": "228a247ed580ba88c27a7a37de6b6b97",
"score": "0.5938669",
"text": "def last\n @@last ||= self.commits.last\n end",
"title": ""
},
{
"docid": "d9c825d17ae05319b028d7b7ae1b1dff",
"score": "0.59359056",
"text": "def get_best_move(board, next_tile)\n max_score = 0\n max_path = []\n \n mult_arr = [0,1,2,3]\n\n # Set up all possible paths to take.\n paths = @moves_ahead==1 ? mult_arr : mult_arr.product(*[mult_arr]*(@moves_ahead-1))\n \n all_scores = []\n paths.each{|path|\n path_score = get_path_score(path, board, next_tile)\n all_scores << path_score\n }\n \n ind_of_max = all_scores.index(all_scores.max)\n max_path = paths[ind_of_max]\n \n while valid_path?(max_path, board) do\n all_scores.delete_at(ind_of_max)\n paths.delete_at(ind_of_max)\n ind_of_max = all_scores.index(all_scores.max)\n max_path = paths[ind_of_max]\n end\n \n MOVES[max_path[0]]\n end",
"title": ""
},
{
"docid": "9e75b7fdbabf23845aa1ad80ed1396ed",
"score": "0.5926493",
"text": "def last_posted_chapter\n self.chapters.posted.order('position DESC').first\n end",
"title": ""
},
{
"docid": "514a4d8cd9737b90e3ceca6256211669",
"score": "0.59242153",
"text": "def last_command\n history.last\n end",
"title": ""
},
{
"docid": "164e8c1e9a075c3ad8299288c2ba44a1",
"score": "0.5918872",
"text": "def last\n self.find(:last)\n end",
"title": ""
},
{
"docid": "ff892c9fca899a91e6e22422db5407ae",
"score": "0.5915705",
"text": "def last_modified\n timestamps = [updated_at]\n latest_position = positions.reorder('updated_at DESC').first\n timestamps.append(latest_position.updated_at) unless latest_position.nil?\n latest_media = media.original.order('updated_at DESC').first\n timestamps.append(latest_media.updated_at) unless latest_media.nil?\n return timestamps.max\n end",
"title": ""
},
{
"docid": "41c8db7c822b12c04ad54f7117c98ebb",
"score": "0.59132445",
"text": "def get_latest(num) self.get(-1); end",
"title": ""
},
{
"docid": "41c8db7c822b12c04ad54f7117c98ebb",
"score": "0.59132445",
"text": "def get_latest(num) self.get(-1); end",
"title": ""
},
{
"docid": "27566645e04a60b4f1edd320cbe99a0e",
"score": "0.59089166",
"text": "def current_movie\n m = Movie.last\n return m\n end",
"title": ""
},
{
"docid": "0600da0e4470406018f054c963160fb8",
"score": "0.59081197",
"text": "def get_move(board, logic)\n if @best_move[board.board_state].nil?\n # Have not examined this board_state yet\n return get_game_ending_move(board, logic) unless get_game_ending_move(board, logic).nil?\n # Game will not be ended this turn, look for outcomes from all possible moves\n return get_next_move(board, logic)\n else\n # Have already examined this state, make the stored move\n return @best_move[board.board_state].fields\n end\n end",
"title": ""
},
{
"docid": "6b738c5d36a3c8cd1851875df55953f3",
"score": "0.59012693",
"text": "def latest_result\n\t\t\treturn @stack[-1]\n\t\tend",
"title": ""
},
{
"docid": "74c556ef86ace811046aa90e949d9b4e",
"score": "0.5889706",
"text": "def position_of_last\n reversed.retrieve_position || Position::MIN\n end",
"title": ""
},
{
"docid": "dbfe1f3f26334d40bd8e16d5c3da75cb",
"score": "0.5888587",
"text": "def parse_last_move\n return [] if @last_move.nil?\n\n moves = @last_move.split(', ')\n moves.map! { |move| move.split(' to ') }\n moves.map! do |move|\n move.map! do |coord|\n if Board.valid_coordinate?(coord[-2..-1])\n if Board::COLUMN_TO_INDEX.key?(coord[0].to_sym)\n [Board.location_vector(coord[-2..-1])]\n else\n [Board.location_vector(coord[-2..-1]), coord[0]]\n end\n end\n end\n end\n moves.map { |move| move.reject(&:nil?) }\n end",
"title": ""
},
{
"docid": "47b8f16d67247e5e3f18b5709eea20c9",
"score": "0.58662724",
"text": "def last_insert\n if @history.was_restored?\n @history.was_restored = false # reset the flag\n return @history.last_tag.without_tags\n end\n buffer.extract_string(\n [@history.line_number, @history.start_pos], window.cursor\n )\n end",
"title": ""
},
{
"docid": "6607f2c4dae2ea759344d8857c3f66e7",
"score": "0.58593655",
"text": "def best_way\n if self.state == 'max'\n way = moves.max{ |a, b| a.rank <=> b.rank }\n elsif self.state == 'min'\n way = moves.min{ |a, b| a.rank <=> b.rank }\n end\n end",
"title": ""
},
{
"docid": "c7f29d4a9dcc0c2e1e2854a3a76f8909",
"score": "0.5857024",
"text": "def last\n at(-1)\n end",
"title": ""
},
{
"docid": "c7f29d4a9dcc0c2e1e2854a3a76f8909",
"score": "0.5857024",
"text": "def last\n at(-1)\n end",
"title": ""
},
{
"docid": "c7f29d4a9dcc0c2e1e2854a3a76f8909",
"score": "0.5857024",
"text": "def last\n at(-1)\n end",
"title": ""
},
{
"docid": "ca13884e88290ab7a3b4e9d17f77996f",
"score": "0.585313",
"text": "def latest\n @photos.sort_by { |photo| photo.taken_at }[-1]\n end",
"title": ""
},
{
"docid": "b940f4e1abc54010b1c55fcb37fe775e",
"score": "0.58521163",
"text": "def last_command\n @command_history.last\n end",
"title": ""
},
{
"docid": "ef2e8f717f349d7afd7e699747468af4",
"score": "0.58495283",
"text": "def last(repo)\n find(repo, nil)\n end",
"title": ""
},
{
"docid": "99a59a3d6eaba284ef916809a37b42f5",
"score": "0.58465934",
"text": "def get_move\n\tend",
"title": ""
}
] |
0079daf29b4e46b788abc7c076e8a3e8
|
DELETE /user_account_apps/1 DELETE /user_account_apps/1.json
|
[
{
"docid": "6904e7a0c8fc4515dc2904a4a51b478d",
"score": "0.7671787",
"text": "def destroy\n @user_account_app = User.find(params[:id])\n @user_account_app.destroy\n\n respond_to do |format|\n format.html { redirect_to user_account_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "d6fb45090adacee8da4ca9c486c981eb",
"score": "0.7375535",
"text": "def destroy\n @user_app = UserApp.find(params[:id])\n @user_app.destroy\n\n respond_to do |format|\n format.html { redirect_to user_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "532f951eb50d1ea39f9449bb80500353",
"score": "0.7104328",
"text": "def destroy(name)\n\t\tdelete(\"/apps/#{name}\")\n\tend",
"title": ""
},
{
"docid": "532f951eb50d1ea39f9449bb80500353",
"score": "0.7104328",
"text": "def destroy(name)\n\t\tdelete(\"/apps/#{name}\")\n\tend",
"title": ""
},
{
"docid": "b111dc07c3a3edac9deb599515b19d18",
"score": "0.702765",
"text": "def destroy(name)\n delete(\"/apps/#{name}\").to_s\n end",
"title": ""
},
{
"docid": "f35cfd6b358f2131ff1263972a0e6bdb",
"score": "0.7011768",
"text": "def destroy\n @client.app_destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6589f1b81bbfc486125db7376c0327ff",
"score": "0.69509083",
"text": "def delete_application(client, options)\n if !options[:application].nil?\n application = client.applications.get options[:application]\n application.delete\n puts \"Application deleted.\"\n return\n else\n puts \"Missing arguments\"\n return\n end \nend",
"title": ""
},
{
"docid": "e4ffb8d029341eaf3344741112f682e6",
"score": "0.69388765",
"text": "def destroy\n @userapp = Userapp.find(params[:id])\n @userapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(userapps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9089c0b05b260a898baad823dd7a5c5c",
"score": "0.69011676",
"text": "def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend",
"title": ""
},
{
"docid": "654f5d7b85cd934501b0a607b859aea1",
"score": "0.6877552",
"text": "def destroy\n @app = current_user.apps.find(params[:id])\n @app.destroy\n flash[:notice] = \"The #{@app.name} app was successfully deleted\"\n respond_to do |format|\n format.html { redirect_to apps_path }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "76eeaf7c89c642b47e0ffe620d23d7d2",
"score": "0.6862627",
"text": "def destroy\n @app_user.destroy\n\n respond_to do |format|\n format.html { redirect_to app_users_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7f613ab9f7960c1f042d3f25227cbd12",
"score": "0.6843637",
"text": "def delete_appdata\n @restv9.delete_appdata(person_id, appId, field)\n end",
"title": ""
},
{
"docid": "c85c937bd8f1f2dc73981fa3a1343455",
"score": "0.67973816",
"text": "def webhelper_delete_all_apps (username, password, base_url = @base_url)\r\n private_resource = RestClient::Resource.new base_url + \"/api/v1/apps\" , {:user => username , :password => password , :timeout => 30}\r\n response = private_resource.get :accept => :json\r\n json = JSON.parse(response)\r\n json['apps'].each do |i|\r\n url = base_url + i['link']\r\n private_resource = RestClient::Resource.new url , {:user => username , :password => password , :timeout => 30}\r\n response = private_resource.delete \r\n puts response.to_str\r\n end\r\n end",
"title": ""
},
{
"docid": "edfbee9c91b8599c670db7da1a364a55",
"score": "0.6740841",
"text": "def admin_delete_app\n\n # Get Current App\n app = MailfunnelsUtil.get_app\n\n # If the User is not an admin redirect to error page\n if !app.is_admin or app.is_admin === 0\n response = {\n success: false\n }\n\n render json: response and return\n end\n\n # Get App to be deleted\n del_app = App.find(params[:app_id])\n\n unless del_app\n response = {\n success: false\n }\n\n render json: response and return\n end\n\n\n # Delete App\n del_app.destroy\n\n\n response = {\n success: true\n }\n\n render json: response and return\n\n\n end",
"title": ""
},
{
"docid": "286c8202a3522717ed7eabbb7237fbe3",
"score": "0.66988343",
"text": "def remove\n get_credentials\n begin\n response = resource[\"/remove/#{app}\"].post(:apikey => @credentials[1])\n rescue RestClient::InternalServerError\n display \"An error has occurred.\"\n end\n display response.to_s\n end",
"title": ""
},
{
"docid": "5d4d6bcf3fadba45bd33da9388006ca0",
"score": "0.66730875",
"text": "def destroy\n @app_user.destroy\n respond_to do |format|\n format.html { redirect_to app_users_url, notice: 'App user was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "87ef01848307b9683224fa3cfcb40c08",
"score": "0.66569173",
"text": "def delete\n appctrl_delete( 'User' )\n end",
"title": ""
},
{
"docid": "df0c4f433b8a5c85faf0417a17407a24",
"score": "0.6629615",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "df0c4f433b8a5c85faf0417a17407a24",
"score": "0.6629615",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0914b357805cefc2624b7bbfcf94972a",
"score": "0.6616374",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0914b357805cefc2624b7bbfcf94972a",
"score": "0.6616374",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0914b357805cefc2624b7bbfcf94972a",
"score": "0.6616374",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9a6f76c34f2fabfe392fb7237d584120",
"score": "0.6570242",
"text": "def destroy \n Services::OpenIdConnectionService.new(@app).destroy \n\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1e8e8be6c881b543a54e1fe4ede0a699",
"score": "0.6500812",
"text": "def destroy\n @qy_app.destroy\n respond_to do |format|\n format.html { redirect_to qy_apps_url, notice: 'Qy account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3673f5b4865916f6278654b20718ce9e",
"score": "0.6461837",
"text": "def delete_account\n @connection.request({\n :method => 'DELETE'\n }) \n end",
"title": ""
},
{
"docid": "1e16ac9b50d1118260b77dc6fcb0becd",
"score": "0.6456171",
"text": "def destroy\n @registered_app.destroy\n respond_to do |format|\n format.html { redirect_to registered_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "eaf19cac92e9460750b82fe9ea515bb1",
"score": "0.64499164",
"text": "def destroy\n authorize! :destroy, @app\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8993e2bbd7c0019bfb3ca48197163935",
"score": "0.64330375",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to admin2017_apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0c7e5904e92d69745e09dc4e5c0b288",
"score": "0.63712186",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0c7e5904e92d69745e09dc4e5c0b288",
"score": "0.63712186",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0c7e5904e92d69745e09dc4e5c0b288",
"score": "0.63712186",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0c7e5904e92d69745e09dc4e5c0b288",
"score": "0.63712186",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "85f75fa87a735d6adea643b100ac7d02",
"score": "0.6369645",
"text": "def delete_account\n @connection.request({\n :method => 'DELETE'\n })\n end",
"title": ""
},
{
"docid": "67242d4fb3c7c986ca3f140013669f79",
"score": "0.6357328",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n format.json { head :ok } \n end\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.6353937",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "77977e9bac24f13f55e010b81f41091f",
"score": "0.633685",
"text": "def delete!\n execute_as_user(\"rm -rf #{app_dir}\")\n end",
"title": ""
},
{
"docid": "0e3e1a0c0d17275aa8f86e61596552cd",
"score": "0.63336855",
"text": "def delete\n @exists = apps.include?(params[:app])\n @app = params[:app] unless @exists == false\n\n if @exists\n `rm #{File.expand_path(\"~/.pow/#{@app}\")}`\n redirect_to root_path, :notice => \"Pow app deleted\"\n else\n render :text => \"Given app is not a Pow app\"\n end\n end",
"title": ""
},
{
"docid": "218992aa919f21ebee8dc0eb07894349",
"score": "0.63272464",
"text": "def destroy\n @app.destroy\n redirect_to apps_url, notice: 'app was successfully deleted.'\n end",
"title": ""
},
{
"docid": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.6326208",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "01281b57ea3194727e3d3009fd18be28",
"score": "0.6325586",
"text": "def delete_app_request!\n logger.debug(\"Deleting Facebook U2U app request #{full_request_id}\")\n # destroy appears to return true for any delete attempt on an already-deleted request\n Mogli::AppRequest.new(id: full_request_id, client: client).destroy\n true\n rescue MultiJson::DecodeError => e\n # we seem to get `MultiJson::DecodeError: \"757: unexpected token at 'true'\"` from this request upon success, so just\n # let it go\n true\n end",
"title": ""
},
{
"docid": "6981b96cf63ae6a935df9aa7a03fa746",
"score": "0.6323684",
"text": "def destroy\n @dev = @app.developers.first.id\n @app.destroy\n respond_to do |format|\n format.html { redirect_to developer_path(@dev), notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "66ab52be0b221ace1a7c4e506419aa70",
"score": "0.6316975",
"text": "def destroy\n @admin_app.destroy\n respond_to do |format|\n format.html { redirect_to admin_apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2bb53fdeabc3e9cdfefea3bbde93b86f",
"score": "0.63018",
"text": "def destroy\n @version.destroy\n respond_to do |format|\n format.html { redirect_to user_app_path(@user, @app), notice: 'Version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9f952872bb743d492a6d19ce9c955e00",
"score": "0.62972105",
"text": "def destroy\n @app_list.app_resouces.destroy\n @app_list.destroy\n respond_to do |format|\n format.html { redirect_to app_lists_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "052aa5cd90c8fe20af01842d439cdbf1",
"score": "0.6296171",
"text": "def destroy(name)\n deprecate # 07/26/2012\n delete(\"/apps/#{name}\").to_s\n end",
"title": ""
},
{
"docid": "ad3a6841e00f16ab4af1d490d6d333ed",
"score": "0.6281782",
"text": "def delete_accounts\n end",
"title": ""
},
{
"docid": "50104fbe289e4fca230fda61bef1ec90",
"score": "0.62719417",
"text": "def destroy\n @papp = Rapns::Apns::App.find(params[:id])\n @papp.destroy\n\n respond_to do |format|\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "aca63913ef11975f23908092aa4262aa",
"score": "0.6265781",
"text": "def destroy\n @test_app.destroy\n respond_to do |format|\n format.html { redirect_to test_apps_url, notice: 'Test app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dbefe0a266cc407398993d1846a2f1ef",
"score": "0.6258086",
"text": "def destroy\n @test_app.destroy\n respond_to do |format|\n format.html { redirect_to test_apps_url, notice: \"Test app was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "33e867859b1a1119ae34cef9a9b98856",
"score": "0.6237899",
"text": "def destroy\n @user_application.destroy\n respond_to do |format|\n format.html { redirect_to user_applications_url, notice: 'User application was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d3664a6f38310ffd6b2bac3ef98cb952",
"score": "0.62060046",
"text": "def destroy\n @userapplication = Userapplication.find(params[:id])\n @userapplication.destroy\n respond_to do |format|\n format.html { redirect_to users_path(:id), info: 'Aplicación usuario a sido destruida correctamente.'}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c8f6b10b2ec0fd04fb213c64368e9466",
"score": "0.62048984",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c8f6b10b2ec0fd04fb213c64368e9466",
"score": "0.62048984",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c8f6b10b2ec0fd04fb213c64368e9466",
"score": "0.62048984",
"text": "def destroy\n @app = App.find(params[:id])\n @app.destroy\n\n respond_to do |format|\n format.html { redirect_to(apps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ae22de85c57547714460d94ccb0128d5",
"score": "0.6200691",
"text": "def destroy\n @app.destroy\n respond_to do |format|\n flash[:success] = 'App was successfully destroyed.'\n format.html { redirect_to apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2dd7c4e54e725e010e899abb5be3409d",
"score": "0.61922747",
"text": "def destroy\n @api_user.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "8833ea66c4e8ba2f90b9bb805a4f0b0b",
"score": "0.61787474",
"text": "def destroy\n @app_config = AppConfig.find(params[:id])\n @app_config.destroy\n\n respond_to do |format|\n format.html { redirect_to app_configs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "696c6b3fb4c11a3dbc2c0476feddf012",
"score": "0.61785465",
"text": "def destroy\n @account = current_user.person.gmail_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "afc4ff72c4ec82cf84976b53d6f21ad0",
"score": "0.6178194",
"text": "def destroy\n @newapp = Newapp.find(params[:id])\n @newapp.destroy\n\n respond_to do |format|\n format.html { redirect_to newapps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8d1b9086b6c7fb90006d5f49c622f3fb",
"score": "0.61725205",
"text": "def delete(user_id:)\n path = '/users/{userId}'\n .gsub('{userId}', user_id)\n\n if user_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"userId\"')\n end\n\n params = {\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'DELETE',\n path: path,\n headers: headers,\n params: params,\n )\n end",
"title": ""
},
{
"docid": "e66c992dbc0dc3e26e1fba67f8a269cd",
"score": "0.61578727",
"text": "def destroy\n @account = current_user.person.iphone_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c6f8a88be1332112cec634bab66f1c63",
"score": "0.6152685",
"text": "def destroy\n\t\tapp_api_key = ApiKey.find_by_application_id(params[:id])\n\n\t\tif app_api_key\n\t\t\tapp_api_key.destroy\n\t\t\tflash[:developer] = \"The app was successfully deleted.\"\n\t\telse\n\t\t\tflash[:developer] = \"Something went wrong and the app is not deleted\"\n\t\tend\t\n\t\tredirect_to developer_home_path\t\t\t\n\tend",
"title": ""
},
{
"docid": "9d4f3f17f19a6b39faa5c339ae30e9e0",
"score": "0.6151813",
"text": "def delete_array_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/arrays/#{args[:arrayId]}\", args)\nend",
"title": ""
},
{
"docid": "8e69eb3ff3374e0db6fa9eb17958df65",
"score": "0.6149613",
"text": "def DeleteUser id\n \n APICall(path: \"users/#{id}.json\",method: 'DELETE')\n \n end",
"title": ""
},
{
"docid": "5a3402d004bd7ee4a72604c5f3472c3a",
"score": "0.6149568",
"text": "def destroy\n @app_instance.destroy\n respond_to do |format|\n format.html { redirect_to app_instances_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "02ff3ce385bb423f1e33ccf273507657",
"score": "0.6136914",
"text": "def user_management_delete_user id\n # the base uri for api requests\n query_builder = Configuration.BASE_URI.dup\n\n # prepare query string for API call\n query_builder << \"/v1/users\"\n\n # process optional query parameters\n query_builder = APIHelper.append_url_with_query_parameters query_builder, {\n \"id\" => id,\n \"client_id\" => @client_id,\n \"client_secret\" => @client_secret,\n }\n\n # validate and preprocess url\n query_url = APIHelper.clean_url query_builder\n\n # prepare headers\n headers = {\n \"user-agent\" => \"IAMDATA V1\",\n \"accept\" => \"application/json\"\n }\n\n # invoke the API call request to fetch the response\n response = Unirest.delete query_url, headers:headers\n\n # Error handling using HTTP status codes\n if response.code == 404\n raise APIException.new \"Not found\", 404, response.raw_body\n elsif response.code == 401\n raise APIException.new \"Unauthorized\", 401, response.raw_body\n elsif !(response.code.between?(200,206)) # [200,206] = HTTP OK\n raise APIException.new \"HTTP Response Not OK\", response.code, response.raw_body\n end\n\n response.body\n end",
"title": ""
},
{
"docid": "3a0d2cabdeb7a751981e318d3088b02b",
"score": "0.6135771",
"text": "def destroy\n @app.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "e88d3dc87e8555f1f82e059d8edb57b1",
"score": "0.6122452",
"text": "def remove_user\n query_api '/rest/user', nil, 'DELETE'\n end",
"title": ""
},
{
"docid": "ff4f8259e2efc0fb590427f1cc07cf4e",
"score": "0.6120218",
"text": "def delete_account(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return\n end\n\n account = find_account(accounts, options[:email])\n if !account.nil?\n account.delete\n puts \"Account deleted.\"\n else\n puts \"Account not found.\"\n return\n end\nend",
"title": ""
},
{
"docid": "863cc00cd1d0e89e520675dc385f3b94",
"score": "0.6111807",
"text": "def destroy\n @application = Application.find(params[:id])\n User.allow_to_all(@application.id) # перед удалением снимаем все запреты для данного приложения.\n @application.destroy\n respond_to do |format|\n format.html { redirect_to applications_url, notice: 'Приложение удалено.' }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b3d42a2db2c834821fa03f79a258300b",
"score": "0.6107521",
"text": "def destroy\n current_user.destroy\n json_response({ message: Message.account_deleted }.to_json)\n end",
"title": ""
},
{
"docid": "176fc9504b3a8c1d591ea8455657551d",
"score": "0.6104908",
"text": "def destroy\n @application = Application.find(params[:id])\n return unless appAccess?(@application.job.id)\n id = @application.job.id\n @application.destroy\n\n respond_to do |format|\n format.html { redirect_to show_apps_path(:id=>id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "06d827a10059f76aa0158ce692608f08",
"score": "0.610135",
"text": "def destroy\n @api_v1_account.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "107a72850f6fe2fe94f58944121571ac",
"score": "0.60956687",
"text": "def delete_app_members(owner:, platform:, app_id:, users:)\n endpoint = \"/api/users/#{owner}/platforms/#{platform}/apps/#{app_id}/members\"\n res = api.delete endpoint do |request|\n request.headers['Content-Type'] = 'application/x-www-form-urlencoded'\n request.body = URI.encode_www_form(\n users: users\n )\n end\n Response.new(res)\n end",
"title": ""
},
{
"docid": "689d5a07a403c4b765ba178e4aff08a3",
"score": "0.60907733",
"text": "def delete\n client.delete(\"/#{id}\")\n end",
"title": ""
},
{
"docid": "7f0ae1b5b95fcb97b6a079410b065423",
"score": "0.60709035",
"text": "def destroy\n @parent_app.destroy\n respond_to do |format|\n format.html { redirect_to parent_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6f74a32c6fdb67babd4a903e37b5baa4",
"score": "0.6069823",
"text": "def delete\n render json: User.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "95f7909f2d660a9b4f3be6031cc3886e",
"score": "0.60669",
"text": "def delete(id)\n request(:delete, \"/users/#{id}.json\")\n end",
"title": ""
},
{
"docid": "578639de61f83b89d55da9b317a063af",
"score": "0.60639524",
"text": "def destroy\n @customer_app.destroy\n end",
"title": ""
},
{
"docid": "9b96be4a7c01cc19645cc3411415824e",
"score": "0.6057979",
"text": "def destroy\n @mobileapp = Mobileapp.find(params[:id])\n @mobileapp.destroy\n \n respond_to do |format|\n format.html { redirect_to mobileapps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bd6b0735d0b7e70cb062d617042afc1e",
"score": "0.60521793",
"text": "def destroy\n @cotiz_app.destroy\n respond_to do |format|\n format.html { redirect_to cotiz_apps_url, notice: 'Cotiz app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ae941b8bd6e76382ad0a30770ced4616",
"score": "0.6048007",
"text": "def destroy\n #@jobapp = Jobapp.find(params[:id])\n @jobapp.destroy\n\n respond_to do |format|\n format.html { redirect_to jobapps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0c4b88a6804fc0f2bbb713ded94bd0bf",
"score": "0.6044675",
"text": "def destroy\n @phone_app.destroy\n respond_to do |format|\n format.html { redirect_to phone_apps_url, notice: 'Phone app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cccee9c88bb969e023855ce145728923",
"score": "0.60420346",
"text": "def destroy\n @payment_app.destroy\n respond_to do |format|\n format.html { redirect_to payment_apps_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9fee66f380331795073ae67e7df6e4ef",
"score": "0.60282606",
"text": "def destroy\n @mobile_app.destroy\n respond_to do |format|\n format.html { redirect_to mobile_apps_url, notice: 'Mobile app was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6025138",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6025138",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6025138",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "9410f5d5c06a5d4acee3b61e4f080658",
"score": "0.6025138",
"text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end",
"title": ""
},
{
"docid": "30babf8c22a20d477ae55917bdb693c8",
"score": "0.6024427",
"text": "def destroy\n @account = current_user.person.blackberry_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8e01ab4fc419eacecd0ef0766d2a5d61",
"score": "0.60180545",
"text": "def delete_app_data\n command = P::DeleteCustomerAppDataCommand.new(**id_or_number)\n send_command(:delete_customer_app_data, command)\n end",
"title": ""
},
{
"docid": "8245a247bb9fa8210a774d1216b2c79f",
"score": "0.6003041",
"text": "def destroy\n @manage_app_version.destroy\n respond_to do |format|\n format.html { redirect_to manage_app_versions_url, notice: 'App version was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "319071b3dcac9d3ed137d1c2571a0058",
"score": "0.6002717",
"text": "def destroy\n @alapp.destroy\n respond_to do |format|\n format.html { redirect_to alapps_url, notice: 'Alapp was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1c214a29c52bb24450934428f3df07d2",
"score": "0.5997026",
"text": "def delete_account_user(id)\n post(\"accountuser/#{id}?_method=DELETE\")\n end",
"title": ""
},
{
"docid": "626f806a1d988c1269c8c2efb381adfb",
"score": "0.5974272",
"text": "def destroy\n @memberapp = Memberapp.find(params[:id])\n @memberapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(memberapps_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d2f2b7e27bbbe134661361074c399275",
"score": "0.59719956",
"text": "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end",
"title": ""
},
{
"docid": "ffedd9dd1de99b52f426d79bf7cbc958",
"score": "0.59715605",
"text": "def destroy\n @user_account = UserAccount.find(params[:id])\n @user_account.destroy\n\n respond_to do |format|\n format.html { redirect_to user_accounts_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "365bb1c36d508427b362a277baf4988e",
"score": "0.59618175",
"text": "def destroy\n @user = User.find(params[:id])\n Rauth::Bridge.destroy_account(@user)\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "467b36bbe374a25d143529ec54405503",
"score": "0.5958422",
"text": "def destroy\n ELASTIC_SEARCH_CLIENT.delete index: 'mobile_apps', type: 'mobile_app', id: @mobile_app.id\n @mobile_app.destroy!\n respond_to do |format|\n format.html { redirect_to admin_mobile_apps_url, notice: 'Mobile Product was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3069083fbc4888dffc46a79418de8a9b",
"score": "0.5951908",
"text": "def destroy\n @account = current_user.person.phone_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7828b3fb8a1ef86ccce5521ac671386e",
"score": "0.59517145",
"text": "def destroy\n authorize_action_for @app\n\n if @app.deletable_by?(current_user)\n @notification.destroy if @notification\n @app.destroy\n respond_to do |format|\n format.html { redirect_to apps_url, notice: 'App was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to apps_url, danger: 'You cannot delete this application.' }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
}
] |
3990a86c5c181e5d8b83355c5a4438cc
|
add migration class definition and up migration
|
[
{
"docid": "b1a30eec591c98eb86f2cc79057c37a2",
"score": "0.0",
"text": "def individual_header(view, stream)\n stream.puts <<HEADER\nclass Create#{view.camelcase} < ActiveRecord::Migration\n def self.up\nHEADER\n end",
"title": ""
}
] |
[
{
"docid": "1350df962a3dae5b43513faa3a5221b1",
"score": "0.7617033",
"text": "def schema_migration; end",
"title": ""
},
{
"docid": "4853d7c5f5d4f8ccd71178af47db6e83",
"score": "0.7292758",
"text": "def run_migration; end",
"title": ""
},
{
"docid": "248c2985c5beb7181dc13a051d50565b",
"score": "0.7190336",
"text": "def run(*migration_classes); end",
"title": ""
},
{
"docid": "3274f8e3a9260ebf17b9c73b660baaf3",
"score": "0.717518",
"text": "def up(&block)\n migration.up = block\n end",
"title": ""
},
{
"docid": "1e025efae5f393a31ed36ac32b58bccc",
"score": "0.71513635",
"text": "def create_migration_file; end",
"title": ""
},
{
"docid": "79e63e9d895859a36d200cb70a9bf9fc",
"score": "0.70721763",
"text": "def migrate(klass)\n # Validate\n raise \"Unable to perform migrations, class must be specified!\" unless klass.class == Class\n raise \"Unable to perform migrations for core class!\" if CORE.include?(klass)\n raise \"Class cannot be migrated!\" unless klass.respond_to?(:auto_migrate!)\n # Execute auto migrations for now\n klass.auto_migrate!\n end",
"title": ""
},
{
"docid": "fa1ac2fb29ff7da41f84a3d154accd2f",
"score": "0.6987276",
"text": "def migration_class_name; end",
"title": ""
},
{
"docid": "b604e4f0dba08f2f571ff492532c1ec7",
"score": "0.6981186",
"text": "def migrate\n migration_classes.each do |(version, migration_class)|\n Base.logger.info(\"Reached target version: #{@target_version}\") and break if reached_target_version?(version)\n #next if irrelevant_migration?(version) # this line removed\n\n Base.logger.info \"Migrating to #{migration_class} (#{version})\"\n migration_class.migrate(@direction)\n update_schema_history(version, migration_class.name) # this line added\n set_schema_version(version)\n end\n end",
"title": ""
},
{
"docid": "bf59d6d83b2782bd649081d035b9ce8b",
"score": "0.6976792",
"text": "def migration_code_up\n # NOTE: Have to include a block in create_table, due to Rails bug #2221 (up through 2.3.5).\n result = table_exists? ? [] : [\" create_table(:#{table_name}) {}\"] # TODO: Determine if we need :id, :primary_key, or :options.\n result << added_columns.collect do |name|\n \" add_column :#{table_name}, :#{name}, #{migration_options_from_attribute_or_association(name)}\"\n end\n result << changed_columns.collect do |name|\n \" change_column :#{table_name}, :#{name}, #{migration_options_from_attribute_or_association(name)}\"\n end\n result << removed_columns.collect do |name|\n \" remove_column :#{table_name}, :#{name}\"\n end\n result.reject{|x| x.empty?}\n end",
"title": ""
},
{
"docid": "5bee198fdba2a0eab09b185aa2350268",
"score": "0.68354493",
"text": "def up\n\n end",
"title": ""
},
{
"docid": "6ee4c0c02dfabeaa32d6f4346360005b",
"score": "0.68119043",
"text": "def up\n wrap :up\n end",
"title": ""
},
{
"docid": "06f8dc9ac348d866e553fe077cded8fd",
"score": "0.6761047",
"text": "def generate_migrations\n versions = []\n versions << generate_migration(\"create_users\", <<-EOF\nHanami::Model.migration do\n change do\n create_table :users do\n primary_key :id\n column :name, String\n end\n end\nend\nEOF\n)\n\n versions << generate_migration(\"add_age_to_users\", <<-EOF\nHanami::Model.migration do\n change do\n add_column :users, :age, Integer\n end\nend\nEOF\n)\n versions\n end",
"title": ""
},
{
"docid": "c8f3ce1a723cf80eb2af808396dadc83",
"score": "0.6746182",
"text": "def migration_code\n return '' if attribute_declarations_match_model_columns?\n result = [\"class #{migration_name} < ActiveRecord::Migration\"]\n result << ' def self.up'\n result << migration_code_up\n result << ' end'\n result << ' def self.down'\n result << migration_code_down\n result << ' end'\n result << 'end'\n result.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "41930003ba9c8f81337045cc7ce6432e",
"score": "0.67239535",
"text": "def migrations(org, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "d6124aecf0a60f3acf1802727b225161",
"score": "0.6712624",
"text": "def create!; migrate!(version: 1); end",
"title": ""
},
{
"docid": "954f81a4b91ac105f70ca6e65b9b8e73",
"score": "0.66353124",
"text": "def migrate(*klasses)\n klasses.each do |klass|\n klass.auto_migrate!\n end\nend",
"title": ""
},
{
"docid": "03a3560df830783f5527c02777c93c60",
"score": "0.663094",
"text": "def up\n end",
"title": ""
},
{
"docid": "06127a1a381603f112552b19df074d7f",
"score": "0.66302454",
"text": "def up\n end",
"title": ""
},
{
"docid": "06127a1a381603f112552b19df074d7f",
"score": "0.66302454",
"text": "def up\n end",
"title": ""
},
{
"docid": "06127a1a381603f112552b19df074d7f",
"score": "0.66302454",
"text": "def up\n end",
"title": ""
},
{
"docid": "06127a1a381603f112552b19df074d7f",
"score": "0.66302454",
"text": "def up\n end",
"title": ""
},
{
"docid": "06127a1a381603f112552b19df074d7f",
"score": "0.66302454",
"text": "def up\n end",
"title": ""
},
{
"docid": "94b4d13f7e7c01dd1ce8047c8c0098f3",
"score": "0.66208875",
"text": "def add_migrations\n output 'Next come migrations.', :magenta\n rake 'message_train:install:migrations'\n end",
"title": ""
},
{
"docid": "cde13fc4a5a4985ee8d9423921df86e8",
"score": "0.6601315",
"text": "def up\n component.create\n component.dependent_models.each do |model|\n next if model.table_exists?\n\n message = \"create_#{model.table_name}\".to_sym\n send(message) if respond_to?(message, true)\n end\n handler = component[nil]\n handler.create_roles\n handler.seed if handler.respond_to?(:seed)\n end",
"title": ""
},
{
"docid": "75bb3216e9d4c944e1fea3c1f1450f22",
"score": "0.6582956",
"text": "def run_migration\n find_fixture\n migration_class.new\n end",
"title": ""
},
{
"docid": "46d84471450d034d332a516f59cbfb55",
"score": "0.6574025",
"text": "def create_migration_file\n if self.class.orm_has_migration?\n migration_template 'migration.rb', 'db/migrate/acts_as_taggable_simple_migration'\n end\n end",
"title": ""
},
{
"docid": "a8fbadbd5bcd06cb8071cb6f887d1e3f",
"score": "0.6558298",
"text": "def migration(&block)\n Class.new(Migration, &block)\n end",
"title": ""
},
{
"docid": "19a9ea918672d73a8581310af6204355",
"score": "0.65105",
"text": "def run_default_migration\n load File.expand_path('../../../../lib/generators/partisan/templates/migration.rb', __FILE__)\n AddFollowsMigration.new.up\n end",
"title": ""
},
{
"docid": "2708f296ad2e0b6c1b92ffacfc9771db",
"score": "0.65073836",
"text": "def migrate(direction)\n puts \"Will migrate #{direction}\"\n migration_directory = File.expand_path \"../dummy/db/migrate\", __FILE__\n migration_files = Dir[\"#{migration_directory}/[0-9]*_*.rb\"]\n migration_files.each {|migration_file| require migration_file} # require them so we can execute them\n case direction\n when :up\n migration_files.each { |file_name| $1.camelize.constantize.up if file_name =~ /[\\w\\/\\.]*\\/\\d*_(.*)\\.rb$/ }\n when :down\n # Originally: migration_files.sort.reverse.each { |file_name| $1.camelize.constantize.down if file_name =~ /[\\w\\/\\.]*\\/\\d*_(.*)\\.rb$/ }\n # But better to just drop all tables\n ActiveRecord::Base.connection.tables.each do |table_name|\n ActiveRecord::Base.connection.execute(\"DROP TABLE IF EXISTS '#{table_name}'\")\n end\n end\nend",
"title": ""
},
{
"docid": "1a27edb8a662dda79f9db9ef560cfba3",
"score": "0.6506817",
"text": "def add_migration\n builder.rc(\"dotnet ef migrations add #{ef_migrations.migration_name} --context MsDbContext\") if project_flag.use_sql_server\n builder.rc(\"dotnet ef migrations add #{ef_migrations.migration_name} --context PgDbContext\") if project_flag.use_pgsql\n end",
"title": ""
},
{
"docid": "327244f532d58102b86c918c169dc7c6",
"score": "0.6500093",
"text": "def migrate_up\n # Create the mole_features table if it doesn't exist\n unless ActiveRecord::Schema.tables.include?('mole_features')\n ActiveRecord::Schema.create_table('mole_features') do |t|\n t.column :name, :string \n t.column :context, :string\n t.column :app_name, :string\n t.column :created_at, :datetime\n t.column :updated_at, :datetime\n end\n ActiveRecord::Schema.add_index( 'mole_features', \n ['name', 'context', 'app_name'], \n :name => 'feature_idx')\n end\n # Create the mole_logs table if it doesn't exist\n unless ActiveRecord::Schema.tables.include?('mole_logs')\n ActiveRecord::Schema.create_table('mole_logs') do |t|\n t.column :mole_feature_id, :integer\n t.column :user_id, :integer\n t.column :params, :string, :limit => 1024 \n t.column :ip_address, :string\n t.column :browser_type, :string \n t.column :host_name, :string\n t.column :created_at, :datetime\n t.column :updated_at, :datetime\n end \n ActiveRecord::Schema.add_index( 'mole_logs', \n ['mole_feature_id','user_id'], \n :name => \"log_feature_idx\" )\n ActiveRecord::Schema.add_index( 'mole_logs', \n ['mole_feature_id','created_at'], \n :name => \"log_date_idx\",\n :unique => true )\n end\n end",
"title": ""
},
{
"docid": "023450f35222f23d51a0ca6f7230f00d",
"score": "0.6477396",
"text": "def migration_classes\n sql = \"SELECT * FROM #{ActiveRecord::Migrator.schema_info_history_table_name}\"\n already_ran = Base.connection.select_all(sql).index_by{|row| row['version'] + row['name']}\n migrations = migration_files.inject([]) do |migrations, migration_file|\n load(migration_file)\n version, name = migration_version_and_name(migration_file)\n already_ran_key = version.to_i.to_s + migration_class(name, version.to_i).name\n migrations << [ version.to_i, migration_class(name, version.to_i) ] if (up? and !already_ran.has_key?(already_ran_key)) or \\\n (down? and already_ran.has_key?(already_ran_key))\n migrations\n end\n down? ? migrations.sort_by{|e| [e[0], e[1].name]}.reverse : migrations.sort_by{|e| [e[0], e[1].name]}\n end",
"title": ""
},
{
"docid": "5ca0fea648df528e68fb3c02c4795c00",
"score": "0.64699286",
"text": "def create_migrations\n @migration_name = name\n @migration_tables = options[:tables] || MIGRATION_TABLES\n migration_template 'migration.rb', \"db/migrate/#{name.underscore}.rb\"\n end",
"title": ""
},
{
"docid": "b490f0664b10574306ee201973ed19b5",
"score": "0.6458989",
"text": "def add_migration name\n argument_error(name)\n FileUtils.touch filename(name)\n end",
"title": ""
},
{
"docid": "7686b8a2f3ca5e130aee7a0d5702ed8a",
"score": "0.6450241",
"text": "def create_migration\n migration_template(\"migrations/add_cabalist.rb.erb\",\n \"db/migrate/add_cabalist_to_#{name.tableize}.rb\")\n end",
"title": ""
},
{
"docid": "83c2eed5a13589a3961505a4c81f2ea3",
"score": "0.64418733",
"text": "def departure_migrate(direction)\n reconnect_with_percona\n include_foreigner if defined?(Foreigner)\n\n ::Lhm.migration = self\n active_record_migrate(direction)\n end",
"title": ""
},
{
"docid": "1f6c05c03e30549491b72ec96553510b",
"score": "0.6433773",
"text": "def migrate_commands; end",
"title": ""
},
{
"docid": "c126844d4f1a8836f36dff62c690b67c",
"score": "0.6432415",
"text": "def migrate_db\n run_migrations\n end",
"title": ""
},
{
"docid": "29d3ac2b13efccbd9b3414e98cf9fab7",
"score": "0.6431769",
"text": "def start_migration(org, repositories, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "6de2427f0f15e0834bc947c334354269",
"score": "0.6420221",
"text": "def migration\n @migration ||= begin\n migration_class_name.constantize.new\n rescue NameError\n nil\n end\n end",
"title": ""
},
{
"docid": "ffd97770aba3d1b8667740dbd5ed6d58",
"score": "0.64058113",
"text": "def after_create_table\n\t\t\tsuper\n\t\t\tself.register_existing_migrations\n\t\tend",
"title": ""
},
{
"docid": "77641174a02a317fa9b47420ffa44bce",
"score": "0.63947445",
"text": "def migration_railties; end",
"title": ""
},
{
"docid": "627d0bf5824383f14abd0a47d56c476b",
"score": "0.6393815",
"text": "def migration\n @migration\n end",
"title": ""
},
{
"docid": "627d0bf5824383f14abd0a47d56c476b",
"score": "0.6392643",
"text": "def migration\n @migration\n end",
"title": ""
},
{
"docid": "627d0bf5824383f14abd0a47d56c476b",
"score": "0.6392643",
"text": "def migration\n @migration\n end",
"title": ""
},
{
"docid": "627d0bf5824383f14abd0a47d56c476b",
"score": "0.6392643",
"text": "def migration\n @migration\n end",
"title": ""
},
{
"docid": "627d0bf5824383f14abd0a47d56c476b",
"score": "0.6392643",
"text": "def migration\n @migration\n end",
"title": ""
},
{
"docid": "627d0bf5824383f14abd0a47d56c476b",
"score": "0.6392643",
"text": "def migration\n @migration\n end",
"title": ""
},
{
"docid": "0676c62518731d8342829210f3dbcf60",
"score": "0.6391882",
"text": "def apply #:nodoc:\n setup\n @direction == :up ? migrate_up : migrate_down\n end",
"title": ""
},
{
"docid": "40ff66abf48e873b769c81d1149405c5",
"score": "0.63847286",
"text": "def migration( name, description=nil, &block )\n\t\t\traise ScriptError, \"invalid migration name %p\" % [ name ] unless\n\t\t\t\tMIGRATION_NAME_PATTERN.match( name )\n\n\t\t\t@migrations ||= {}\n\t\t\tmigration_obj = Sequel::MigrationDSL.create( &block )\n\t\t\tmigration_obj.extend( MigrationIntrospection )\n\t\t\tmigration_obj.name = name\n\t\t\tmigration_obj.model_class = self\n\t\t\tmigration_obj.description = description\n\n\t\t\t@migrations[ name ] = migration_obj\n\t\tend",
"title": ""
},
{
"docid": "e4ac465087e26c5e42bcf5b8e0742334",
"score": "0.63841236",
"text": "def migrate!\n invoke [:migrate]\n end",
"title": ""
},
{
"docid": "1a7da07d935871956b4f3b760b25dde1",
"score": "0.637562",
"text": "def up\n # Make sure the seeds already exist, break if not because this is done in the seeds.rb already\n return if Role.find_by_name('Author').nil?\n\n project_type = get_project_type\n\n RoleAdditions.each do |role_hash|\n role = Role.create!(role_hash)\n\n RequiredRole.create!({\n :role_id => role.id,\n :project_type_id => project_type.id,\n :suggested_percent => 0.0\n })\n end\n end",
"title": ""
},
{
"docid": "86bde6155655253b4b6aea17e96e88d9",
"score": "0.63743865",
"text": "def migrate(version = nil)\n @logger.fine('Running web migrations...')\n super(File.join(Automation::FRAMEWORK_ROOT, Automation::FET_DIR, 'web/database/migrations'), version)\n end",
"title": ""
},
{
"docid": "9898af214361ab417817298162cffcd2",
"score": "0.6371028",
"text": "def migrate(direction); end",
"title": ""
},
{
"docid": "fb01fd2521a7ee46b68a8bd6213a008b",
"score": "0.6363705",
"text": "def up\n true\n end",
"title": ""
},
{
"docid": "f4a71db2c417ad824b0c9742ef07007c",
"score": "0.63504654",
"text": "def generate\n Rails.logger.info(\"Arguments: #{table_name},#{column_name}\")\n migration_template('migration.rb',\n \"#{db_migrate_path}/add_#{column_name}_column_to_#{table_name}.rb\")\n end",
"title": ""
},
{
"docid": "5e9567e9d596c3f913bf7703d4820539",
"score": "0.6337969",
"text": "def migrate\n self.class.pending_migration_files.each do |file|\n # clear migrations array before loading\n @migrations = nil\n # load last migration for rollback\n load file\n # migration class will be loaded to @migrations\n migration = @migrations.last\n next unless migration\n\n # apply migration if can be rolled UP\n if migration.can_rollup?\n Sequel::Model.db.transaction(savepoint: true) {\n migration.up.apply\n report_with.applied(migration)\n }\n end\n # create log entry in data migrations table\n TradeTariffBackend::DataMigration::LogEntry.log!(file)\n end\n end",
"title": ""
},
{
"docid": "78e87342124959585ea474f7ac7e952a",
"score": "0.63263303",
"text": "def create_migrations_and_models\n src = \"#{@gem_path}/lib/modules/migrations\"\n dest = \"#{@target_dir}/db/migrate\"\n copy_files(src,dest,AUTH_MIGRATE)\n if @module_name == \"oauth\"\n copy_files(src,dest,OAUTH_MIGRATE)\n end\n src_path = \"#{@gem_path}/lib/modules/models\"\n dest_path = \"#{@target_dir}/app/models\" \n copy_files(src_path,dest_path,AUTH_MODELS)\n if @module_name == \"oauth\"\n copy_files(src_path,dest_path,OAUTH_MODELS)\n end\n end",
"title": ""
},
{
"docid": "854c164044e9c51ea4b6a3803533f45a",
"score": "0.6313214",
"text": "def migrate!\n DataMapper.auto_migrate!\n end",
"title": ""
},
{
"docid": "694aaa29dda4425c488c23ea33551ce4",
"score": "0.6311582",
"text": "def generate_files\n puts 'BetterDataMigration::Setup invoked'\n puts \"Creating table-migration for Rails#{migration_version}\"\n migration_template 'table_migration.rb', \"db/migrate/#{name}.rb\"\n end",
"title": ""
},
{
"docid": "72678d670a4b7f80397fa184e67f9217",
"score": "0.63079095",
"text": "def migrator\n ActiveRecord::Migration.verbose = ENV[\"VERBOSE\"] ? ENV[\"VERBOSE\"] == \"true\" : true\n version = ENV[\"VERSION\"] ? ENV[\"VERSION\"].to_i : nil\n do_schemas_iterating_migrations {|path| ActiveRecord::Migrator.run(:up, path, version) } \n end",
"title": ""
},
{
"docid": "8811c6c834ac82dff46900735c2fad1f",
"score": "0.6306279",
"text": "def up\n up_components!\n end",
"title": ""
},
{
"docid": "d4aaed8678dbd7615aa17bc63928290c",
"score": "0.6298882",
"text": "def up(*_args)\n\n end",
"title": ""
},
{
"docid": "d3b7b996e6946219afa88e06b56d4d38",
"score": "0.627655",
"text": "def migrate\n attrs = @db_setup_attributes || {}\n Ecore::db.create_table table_name do\n String :id, :size => 8, :primary_key => true\n attrs.each_pair do |name, arr|\n column name, :text, arr[1] if arr[0] == :text\n String name, arr[1] if arr[0] == :string || arr[0] == String\n Fixnum name, arr[1] if arr[0] == :integer || arr[0] == Fixnum\n DateTime name, arr[1] if arr[0] == :datetime || arr[0] == DateTime\n Date name, arr[1] if arr[0] == :date || arr[0] == Date\n Time name, arr[1] if arr[0] == :time || arr[0] == Time\n Float name, arr[1] if arr[0] == :float || arr[0] == Float\n TrueClass name, arr[1] if arr[0] == :boolean || arr[0] == TrueClass || arr[0] == FalseClass\n TrueClass name, arr[1] if arr[0] == :bool\n end\n end unless Ecore::db.table_exists?(table_name)\n end",
"title": ""
},
{
"docid": "ea2b7e78065192c4da354dc446363ee4",
"score": "0.6261478",
"text": "def migration_class_name\n \"Migration_#{major}_#{minor}_#{patch}_#{build}\"\n end",
"title": ""
},
{
"docid": "814cf362fd5c6907e488b200a605f57a",
"score": "0.62578714",
"text": "def create_migration_file\n f = File.open File.join(File.dirname(__FILE__), 'templates', 'schema.rb')\n schema = f.read; f.close\n \n schema.gsub!(/ActiveRecord::Schema.*\\n/, '')\n schema.gsub!(/^end\\n*$/, '')\n\n f = File.open File.join(File.dirname(__FILE__), 'templates', 'migration.rb')\n migration = f.read; f.close\n migration.gsub!(/SCHEMA_AUTO_INSERTED_HERE/, schema)\n \n tmp = File.open \"tmp/~migration_ready.rb\", \"w\"\n tmp.write migration\n tmp.close\n\n migration_template '../../../tmp/~migration_ready.rb',\n 'db/migrate/create_gmaps4rails_tables.rb'\n remove_file 'tmp/~migration_ready.rb'\n end",
"title": ""
},
{
"docid": "694e918f96e358e40b4841061bbcc691",
"score": "0.6255611",
"text": "def migrate!( node )\n # TODO: implement migrate!\n end",
"title": ""
},
{
"docid": "543e86522028dd5cec25604812c6d5d7",
"score": "0.6253443",
"text": "def generate_migration\n @description = options.description?\n migration_template 'rails31_migration.rb.erb', \"db/migrate/create_enum_#{table_name}.rb\" if options.migration?\n end",
"title": ""
},
{
"docid": "8eabf6ab343bfb62cfc541fa4d88c37a",
"score": "0.6249749",
"text": "def add_user_columns_migration\n # ensure migration timestamps are different\n sleep(2)\n\n generate 'migration AddNameToUsers name:string'\n\n gsub_file 'app/models/user.rb', /:registerable\\,/, ''\n end",
"title": ""
},
{
"docid": "01f11a8451dd306df374c49537e5c95f",
"score": "0.6244066",
"text": "def migrate(direction)\n @dir = direction\n super\n end",
"title": ""
},
{
"docid": "6bad707d10481f098b77752b056da5c2",
"score": "0.6226235",
"text": "def auto_migrate_up!(args=nil)\n DataMapper.logger.warn(\"Skipping auto_migrate_up! for remixable module (#{self.name})\")\n end",
"title": ""
},
{
"docid": "561012fc953d41dfcf3a33c807d2c21d",
"score": "0.62257355",
"text": "def migrations_paths; end",
"title": ""
},
{
"docid": "561012fc953d41dfcf3a33c807d2c21d",
"score": "0.62257355",
"text": "def migrations_paths; end",
"title": ""
},
{
"docid": "561012fc953d41dfcf3a33c807d2c21d",
"score": "0.62257355",
"text": "def migrations_paths; end",
"title": ""
},
{
"docid": "85947f239d5e0fe320023eec55f80797",
"score": "0.62232083",
"text": "def migrate\n return unless options.migrate?\n\n rake 'api_sampler:install:migrations'\n rake 'db:migrate SCOPE=api_sampler'\n end",
"title": ""
},
{
"docid": "f581f04a1a4c833f1c554fca75ca54ac",
"score": "0.6219227",
"text": "def create!\n migrate! version: 1\n end",
"title": ""
},
{
"docid": "c8c7d29f4fdd179b25b159b64cc5775c",
"score": "0.6215206",
"text": "def create_main_migration\n return if options['skip-migration']\n migration_template 'migration.rb', 'db/migrate/create_seorel.rb'\n end",
"title": ""
},
{
"docid": "5b673c6f166782ad4ebf1277083569fc",
"score": "0.61964726",
"text": "def up\n # noop\n end",
"title": ""
},
{
"docid": "9515fd30cd5be0e25c4a261fb7ec8111",
"score": "0.619253",
"text": "def up(migrator = Migrator, &block)\n @up_block = block\n @up_migrator = migrator\n end",
"title": ""
},
{
"docid": "f18dd131387d58a625c08de5dd3f9ebd",
"score": "0.6176709",
"text": "def schema_migration # :nodoc:\n ClickhouseActiverecord::SchemaMigration\n end",
"title": ""
},
{
"docid": "ad105b2526e6941b964c3736a79a4a32",
"score": "0.6174592",
"text": "def create_migration_file\n f = File.open File.join(File.dirname(__FILE__), 'templates', 'schema.rb')\n schema = f.read; f.close\n \n schema.gsub!(/ActiveRecord::Schema.*\\n/, '')\n schema.gsub!(/^end\\n*$/, '')\n\n f = File.open File.join(File.dirname(__FILE__), 'templates', 'migration.rb')\n migration = f.read; f.close\n migration.gsub!(/SCHEMA_AUTO_INSERTED_HERE/, schema)\n \n tmp = File.open \"tmp/~migration_ready.rb\", \"w\"\n tmp.write migration\n tmp.close\n\n migration_template '../../../tmp/~migration_ready.rb',\n \"db/migrate/create_#{plural_name}.rb \"\n remove_file 'tmp/~migration_ready.rb'\n end",
"title": ""
},
{
"docid": "4dde74d1eb24c64a251b8cb2830db84c",
"score": "0.6172204",
"text": "def migrate(version = nil)\n @logger.fine('Running core migrations...')\n super(File.join(FRAMEWORK_ROOT, 'automation/results_database/migrations'), version)\n end",
"title": ""
},
{
"docid": "8195115c5c47559f29b93126a153e7d9",
"score": "0.61613727",
"text": "def user_migrations(options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "64557b99760877b9acf334c9a45ae5cf",
"score": "0.6157307",
"text": "def create_migration_file\n #migration_template 'migration.rb', 'db/migrate/create_beta_invite_model_data.rb'\n #pulling all the migration templates and generating migartion file for each\n \n migration_template 'create_beta_invites.rb', 'db/migrate/create_beta_invites.rb' if (Dir.glob(\"db/migrate/[0-9]*_*.rb\").grep(/\\d+_create_beta_invites.rb$/).first).nil?\n migration_template 'create_delayed_jobs.rb', 'db/migrate/create_delayed_jobs.rb' if (Dir.glob(\"db/migrate/[0-9]*_*.rb\").grep(/\\d+_create_delayed_jobs.rb$/).first).nil?\n end",
"title": ""
},
{
"docid": "a3cc7a1a9088873986206958a1fc5b6e",
"score": "0.6153595",
"text": "def copy_migrations\n # Can't get this any more DRY, because we need this order.\n better_migration_template \"create_atrium_collections.rb\"\n better_migration_template \"create_atrium_search_facets.rb\"\n better_migration_template \"create_atrium_exhibits.rb\"\n better_migration_template \"create_atrium_showcases.rb\"\n better_migration_template \"create_atrium_showcase_items.rb\"\n better_migration_template \"create_atrium_showcase_facet_selections.rb\"\n better_migration_template \"create_atrium_browse_levels.rb\"\n better_migration_template \"create_atrium_descriptions.rb\"\n better_migration_template \"create_atrium_essays.rb\"\n end",
"title": ""
},
{
"docid": "774fb4a9d84d8974f71e5e8249bdaee8",
"score": "0.6153559",
"text": "def create_migration_file\n # Grab all existing versions\n migrations_path = File.join(Rails.root, \"snowflake/schema/migrations/*.rb\")\n @versions = Dir[migrations_path].collect do |m|\n m.split('_').first.to_i\n end.sort\n\n @migration_version = @versions.empty?? 1 : @versions.last + 1\n\n template \"migration.rb\", \"snowflake/schema/migrations/#{@migration_version}_#{title}.rb\"\n end",
"title": ""
},
{
"docid": "f0415d135295568ed1c393c2eb83594e",
"score": "0.61533034",
"text": "def migrate_up!(level = nil)\n migrations.sort.each do |migration|\n if level.nil?\n migration.perform_up()\n else\n migration.perform_up() if migration.position <= level.to_i\n end\n end\n end",
"title": ""
},
{
"docid": "16bf051cc67b978a255660570dca38e8",
"score": "0.6151862",
"text": "def execute_migrations!\n migrations = [MakeStandardTables, FixAttachmentsPolymorphicTable]\n existing = SchemaMigration.all.collect{ |el| el.version }\n\n migrations.reject!{ |e| existing.include? e.to_s}\n\n migrations.each do |migration|\n ActiveRecord::Migration.run(migration)\n SchemaMigration.create(:version => migration.name)\n end\n end",
"title": ""
},
{
"docid": "6e67eafa8fc98febd3882790386853f2",
"score": "0.6133544",
"text": "def call\n return unless migration\n apply # defined in a subclass\n register # defined in a subclass\n log # defined in a subclass\n end",
"title": ""
},
{
"docid": "c7f36657713761d75b46d9cc9592fa14",
"score": "0.6129341",
"text": "def migration_base_class_name\n 'ActiveRecord::Migration'\n end",
"title": ""
},
{
"docid": "a516b6f20b5703e51e20ec827c60ee8c",
"score": "0.61111116",
"text": "def migrate(quiet=false)\n migrate_files = \"#{File.dirname(File.expand_path(__FILE__))}/../migrate/*.rb\"\n Dir[migrate_files].sort.each do |x|\n require x\n obj = File.basename(x).sub(/^\\d+/, '').sub(/\\.rb$/, '').camelize.constantize.new\n if quiet\n obj.suppress_messages { obj.up }\n else\n obj.up\n end\n end\n end",
"title": ""
},
{
"docid": "529293ebec2279d7270922da5103eca3",
"score": "0.61064494",
"text": "def after_migrate_record() end",
"title": ""
},
{
"docid": "c06214fb01a420aa08f10a873119037d",
"score": "0.6102352",
"text": "def create_migration_file\n migration_template 'migration.rb', 'db/migrate/create_paysto_tables.rb'\n end",
"title": ""
},
{
"docid": "fa1967a60cd8568f905b9aba9d18defa",
"score": "0.6101381",
"text": "def install\n migration_template 'migration.rb',\n 'db/migrate/create_ruby_rabbitmq_janus_tables.rb'\n end",
"title": ""
},
{
"docid": "b5fe0051bd4115c2b3cf07b0c196df20",
"score": "0.60981125",
"text": "def generate_table_helper\n source = File.expand_path(find_in_source_paths(\"app/migrations/create_table_migration.rb\"))\n destination = File.expand_path(\"db/migrate/create_#{plural_table_name}.rb\", self.destination_root)\n\n migration_dir = File.dirname(destination)\n @migration_number = Time.now.utc.strftime(\"%Y%m%d%H%M%S\")\n @migration_file_name = File.basename(destination, '.rb')\n @migration_class_name = @migration_file_name.camelize\n\n context = instance_eval('binding')\n\n dir, base = File.split(destination)\n numbered_destination = File.join(dir, [\"%migration_number%\", base].join('_'))\n\n create_migration numbered_destination, nil, {} do\n ERB.new(::File.binread(source), nil, '-', '@output_buffer').result(context)\n end\n end",
"title": ""
},
{
"docid": "ebb6eab9503573c1ff3408eef713853b",
"score": "0.6081883",
"text": "def migrate(direction)\n reconnect_with_percona\n include_foreigner if defined?(Foreigner)\n\n ::Lhm.migration = self\n original_migrate(direction)\n end",
"title": ""
},
{
"docid": "eb4ffda6f2b5e4feb953f2f7eb4a9b1f",
"score": "0.6078652",
"text": "def copy_ants_admin_libraries_migration\n template \"ants_admin_libraries/migration.rb\", \"db/migrate/#{Time.zone.now.strftime(\"%Y%m%d%H%M%S\")}_ants_admin_create_ants_admin_libraries.rb\" if !migration_exists?\n end",
"title": ""
},
{
"docid": "701918b344b79b491e5d8ccb3e4c3331",
"score": "0.6063632",
"text": "def auto_migrate!\n DataMapper.auto_migrate!(name)\n end",
"title": ""
},
{
"docid": "701918b344b79b491e5d8ccb3e4c3331",
"score": "0.6063632",
"text": "def auto_migrate!\n DataMapper.auto_migrate!(name)\n end",
"title": ""
},
{
"docid": "5a4f9b23c7d1b200d30c8396714e86d1",
"score": "0.6063087",
"text": "def up\n self.class.new( self.join(\"..\") ).expand\n end",
"title": ""
},
{
"docid": "e4a7403d43441b184656bcfe8d3f46aa",
"score": "0.6058994",
"text": "def start_user_migration(repositories, options = T.unsafe(nil)); end",
"title": ""
}
] |
a24eea1fee6da65df8a9421ec0d83fe0
|
=begin Role assignment related =end
|
[
{
"docid": "37285fb26afc4506e85b20d7f38d4b90",
"score": "0.0",
"text": "def has_role?(role_sym)\n roles.any? { |r| r.name.underscore.to_sym == role_sym }\n end",
"title": ""
}
] |
[
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6888322",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6888322",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6888322",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6888322",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6888322",
"text": "def role; end",
"title": ""
},
{
"docid": "7ea77ef4df9d77bb9aedc07514adfd1b",
"score": "0.675617",
"text": "def role_assigned(object, *params)\n end",
"title": ""
},
{
"docid": "7a2f589ca3dbf66827ab88cdb1d07be0",
"score": "0.6663818",
"text": "def role=(_arg0); end",
"title": ""
},
{
"docid": "7a2f589ca3dbf66827ab88cdb1d07be0",
"score": "0.6663818",
"text": "def role=(_arg0); end",
"title": ""
},
{
"docid": "576db8d1cfbdb0a682b2f9644c16b824",
"score": "0.6507377",
"text": "def define_role\n if self.role == nil \n self.role ||= (self.email.include?(\"dwight.edu\") ? \"faculty\" : \"parent\")\n self.save!\n end \n end",
"title": ""
},
{
"docid": "7bb0cfae8d530d7ca0792aaa4b43c9cf",
"score": "0.65022266",
"text": "def roles; end",
"title": ""
},
{
"docid": "7bb0cfae8d530d7ca0792aaa4b43c9cf",
"score": "0.65022266",
"text": "def roles; end",
"title": ""
},
{
"docid": "7ea2c52ca9f0226809429f170ea90b8b",
"score": "0.64852774",
"text": "def role_assignments=(value)\n @role_assignments = value\n end",
"title": ""
},
{
"docid": "7ea2c52ca9f0226809429f170ea90b8b",
"score": "0.64852774",
"text": "def role_assignments=(value)\n @role_assignments = value\n end",
"title": ""
},
{
"docid": "b1cbbd7ca21787be2255fe507ee92acb",
"score": "0.6468248",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "1d26e5fb989c34cf7ceb66d1a521d7f3",
"score": "0.6405577",
"text": "def assign_role\n self.role = Role.find_by name: \"Student\" if self.role.nil?\n end",
"title": ""
},
{
"docid": "17bde255429627263c8a82dd5f6148d4",
"score": "0.6314096",
"text": "def mass_assignment_context\n current_user.role\n end",
"title": ""
},
{
"docid": "72b96d9cd3c7126486926b774b8a5189",
"score": "0.63012433",
"text": "def role\n ''\n end",
"title": ""
},
{
"docid": "6013ec382db242d2db8dcff27307d419",
"score": "0.62854654",
"text": "def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end",
"title": ""
},
{
"docid": "6013ec382db242d2db8dcff27307d419",
"score": "0.62854654",
"text": "def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end",
"title": ""
},
{
"docid": "6013ec382db242d2db8dcff27307d419",
"score": "0.62854654",
"text": "def setup_role \n if self.role_ids.empty? \n self.role_ids = [2] \n end\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.6267546",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.6266055",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.6266055",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "8097f9a4057928eb22d7173b864e5671",
"score": "0.6227191",
"text": "def set_role(target) \n self.role = target\n self.save\n end",
"title": ""
},
{
"docid": "a3e59bb47831f59f28344542f0ccdaf6",
"score": "0.6222092",
"text": "def assign_role\n self.role = Role.find_by name: 'general' if role.nil?\n end",
"title": ""
},
{
"docid": "ff2bb82fd32b3cc5c7349ce39e5fac55",
"score": "0.62035483",
"text": "def setup_role\n if self[:role_id].nil? || self[:role_id].empty? \n self[:role_id] = Role.find_by(:name => \"Hauler\").id\n end\n end",
"title": ""
},
{
"docid": "38f85bbf2cef902979d96797cdd4bf72",
"score": "0.62016535",
"text": "def assign_role\n self.role = Role.find_by(name: \"Regular\") if self.role.nil?\n end",
"title": ""
},
{
"docid": "110a45090a0d50fe098db8b9eca5851b",
"score": "0.61984044",
"text": "def role\n Employee.find(self.employee_id).role\n end",
"title": ""
},
{
"docid": "0448e9388b152bd550ef5c70fd7990ac",
"score": "0.6180994",
"text": "def role_assignment_origin_id\n return @role_assignment_origin_id\n end",
"title": ""
},
{
"docid": "3165ddc4c1b7b908be4732ab1a13f8a4",
"score": "0.6172719",
"text": "def set_role_assignment\n @role_assignment = RoleAssignment.find(params[:id])\n end",
"title": ""
},
{
"docid": "a3e350596a775b83b94ad08764d2d24f",
"score": "0.61689734",
"text": "def setup_role\n if self.role_ids.empty?\n self.role_ids = [2]\n end\n end",
"title": ""
},
{
"docid": "a3e350596a775b83b94ad08764d2d24f",
"score": "0.61689734",
"text": "def setup_role\n if self.role_ids.empty?\n self.role_ids = [2]\n end\n end",
"title": ""
},
{
"docid": "39c7c58b3df8758730ad44172ab1dcc4",
"score": "0.6168195",
"text": "def assign_role\n \tself.role = \"company_staff\" if self.role.nil?\n end",
"title": ""
},
{
"docid": "e38825209abf8132f698be2ee3e42156",
"score": "0.61486155",
"text": "def assignment_association; :thinkspace_casespace_assignments; end",
"title": ""
},
{
"docid": "26c0b1fcc95a5f89fdda297c7ec74c39",
"score": "0.61443645",
"text": "def mass_assignment_context\n user.role if user\n end",
"title": ""
},
{
"docid": "8b6dcdd3b1e086a6ceab5d2d7d0f541f",
"score": "0.61375225",
"text": "def assign_supervisor_role\n\n end",
"title": ""
},
{
"docid": "c5504c9aaa2be134f8f15ad8cdf82adf",
"score": "0.61094576",
"text": "def assignrole\n @userad = Useradmin.where(:user_id => params[:id])\n @userad.each do |x|\n if x.adminaccess == \"n\"\n x.attributes = {:adminaccess => \"y\"} # if the admin role is not available to the user, then adminRole is granted to the user\n else\n x.attributes = {:adminaccess => \"n\"} # if the user already is granted with a admin role, then it is revoked.\n end\n x.save\n end\n @useradlist = Useradmin.all #The list of users is make available to the admin again\n respond_to do |format|\n format.html {\n render :template => \"/homepages/assignrole\"\n }\n end\n end",
"title": ""
},
{
"docid": "52e61cacb101ad7165f81387943203fe",
"score": "0.6108425",
"text": "def set_role\n @role = Role.find_by_actor_id_and_project_id(current_actor.id, @project.id)\n if @role\n @role_level = (RoleLevel.find(@role.role_level_id)).name\n else\n @role_level = ''\n end\n end",
"title": ""
},
{
"docid": "fc5b69a1f3b5990f302c1682b5a3bcff",
"score": "0.6085059",
"text": "def set_role\n\t\tself.add_role self.role_enum\n\tend",
"title": ""
},
{
"docid": "99c20791c96f989f80232fbdee336398",
"score": "0.60832787",
"text": "def assign\n navigate\n on Permissions do |add|\n # See the roles method defined below...\n roles.each do |inst_var, role|\n get(inst_var).each do |username|\n unless add.user_row(username).present? && add.assigned_role(username).include?(role)\n add.user_name.set username\n add.role.select role\n add.add\n add.user_row(username).wait_until_present\n end\n end\n end\n add.save\n # TODO: Add some logic here to use in case the user is already added to the list (so use add_roles)\n end\n end",
"title": ""
},
{
"docid": "f7c2ed963b1bbf2a9cd90641278e3176",
"score": "0.6080913",
"text": "def role=(value)\n @role = value\n end",
"title": ""
},
{
"docid": "f7c2ed963b1bbf2a9cd90641278e3176",
"score": "0.6080913",
"text": "def role=(value)\n @role = value\n end",
"title": ""
},
{
"docid": "f7c2ed963b1bbf2a9cd90641278e3176",
"score": "0.6080913",
"text": "def role=(value)\n @role = value\n end",
"title": ""
},
{
"docid": "f7c2ed963b1bbf2a9cd90641278e3176",
"score": "0.6080913",
"text": "def role=(value)\n @role = value\n end",
"title": ""
},
{
"docid": "9717857a0961b703cc15c95138779009",
"score": "0.6075742",
"text": "def role=(value)\n self.role_id = value.id \n end",
"title": ""
},
{
"docid": "cd1a64a6bd32d06ff03c4b1ee1007d7b",
"score": "0.6047449",
"text": "def role_assignments\n return @role_assignments\n end",
"title": ""
},
{
"docid": "cd1a64a6bd32d06ff03c4b1ee1007d7b",
"score": "0.6047449",
"text": "def role_assignments\n return @role_assignments\n end",
"title": ""
},
{
"docid": "d100312c8e14aa3db7eba61bc6e1ae21",
"score": "0.60456336",
"text": "def role\n\t\t\t\t\t\tself.current_role\n\t\t\t\t\tend",
"title": ""
},
{
"docid": "d100312c8e14aa3db7eba61bc6e1ae21",
"score": "0.60456336",
"text": "def role\n\t\t\t\t\t\tself.current_role\n\t\t\t\t\tend",
"title": ""
},
{
"docid": "51d4642b8adc618e0da6c740e79109e5",
"score": "0.6031285",
"text": "def add_roles\n self.roles << Role.where(:critical_process_id => self.cp_secondary_id, :edit => true)\n self.roles << Role.where(:critical_process_id => self.cp_secondary_id, :review => true)\n end",
"title": ""
},
{
"docid": "47fcb4a2b5e20edb0cbb6d661b1620ca",
"score": "0.60310894",
"text": "def fetch_role_assignments\n @role_assignments ||= self.role_assignments.all\n end",
"title": ""
},
{
"docid": "2bddd5e1f0f5fe75c6b805d990443172",
"score": "0.6023888",
"text": "def addrole\n User.last.role_ids = [ Role.find_by_name('regular').id ]\n end",
"title": ""
},
{
"docid": "33870e0b62bc74c61e5d9553481402d2",
"score": "0.6017474",
"text": "def other_roles\n []\n end",
"title": ""
},
{
"docid": "ac441386732d9262d9245197fbb9f502",
"score": "0.60169613",
"text": "def relevant_roles\n {}\n end",
"title": ""
},
{
"docid": "44a97c131e2cd433c0920ef4604bead5",
"score": "0.6012963",
"text": "def upgrade_role\n self.role = self.requestedRole\n self.requestedRole = \"\"\n end",
"title": ""
},
{
"docid": "416f83a4090c7bae6cc9df5e99950f1d",
"score": "0.60114634",
"text": "def setup_role \r\n if self.role_ids.empty? \r\n self.role_ids = Role.where(name: 'Customer').first.id\r\n end\r\n end",
"title": ""
},
{
"docid": "d9441b6a7cf818b1681210ecbd489859",
"score": "0.6011108",
"text": "def set_mdl_role_assignment\n @mdl_role_assignment = MdlRoleAssignment.find(params[:id])\n end",
"title": ""
},
{
"docid": "9211c77903b5ba87760a217afa8f6519",
"score": "0.60084766",
"text": "def update_roles\n # clear out old roles\n #self.roles = [];\n\n # add a role representing your position in the company.\n # default to an agent if none otherwise specified\n if !self.employee_title\n self.employee_title = EmployeeTitle.agent\n self.save\n end\n\n # right now, agents should have access to all the basic listing types\n self.add_role :agent unless self.roles.any?\n end",
"title": ""
},
{
"docid": "0bb3ac19534aa93813eabeea7f4a85f5",
"score": "0.6004863",
"text": "def role_at school\r\n school.record_of(self).role rescue nil\r\n end",
"title": ""
},
{
"docid": "3af4db9bce85b38c498bda5f829a5c0f",
"score": "0.59873086",
"text": "def role=(new_role)\n @role = new_role\n end",
"title": ""
},
{
"docid": "0973e43094644ccdc1125679ed5f11e2",
"score": "0.5983491",
"text": "def role\n return Role.find(:first, :conditions => {:id => (RolesPerson.find(:first, :conditions => {:person_id => self.id})).role_id}).name\n end",
"title": ""
},
{
"docid": "606a67a229c2345970ec935279223e71",
"score": "0.59711957",
"text": "def set_role\r\n @role = Role.find_by_actor_id_and_project_id(current_actor.id, @project.id)\r\n end",
"title": ""
},
{
"docid": "ef2628fe423a56ac4f39b60deebc5828",
"score": "0.59634674",
"text": "def role_on(node)\n self.role_assignments.first(conditions: { node_id: node.path_ids })\n end",
"title": ""
},
{
"docid": "69e7bf54af20a626ab5e26907988220f",
"score": "0.59596056",
"text": "def assign_role! role, skip_save=false\n self.roles << role\n self.roles.uniq!\n self.save(false) unless (skip_save==:skip_save)\n self.roles\n end",
"title": ""
},
{
"docid": "11813ce2fec240146f66eb33ab5717c7",
"score": "0.594714",
"text": "def assigned_roles\n roles.all :id.gt => 2\n end",
"title": ""
},
{
"docid": "c882db99e7f6b9a06a42c79c12650d5f",
"score": "0.59444517",
"text": "def extend_chain_relinkrole\n @block_roles.each_with_index do |o, i|\n @block_roles[i].lesson_id = @block_lessons[i].id\n end\n return \"\"\n end",
"title": ""
},
{
"docid": "734d4deeb575d7b07d3e9cd313990f87",
"score": "0.59441555",
"text": "def role=(new_role)\n self.role_id = new_role.id\n end",
"title": ""
},
{
"docid": "8bed602ae0bad0123474bee982894c45",
"score": "0.5935717",
"text": "def add_panding_role\n self.user.add_role :faculty_admin\n self.user.role_pending = true\n self.user.save\n end",
"title": ""
},
{
"docid": "128f7a267e7ce3a3fdd875ac48a896e3",
"score": "0.59312373",
"text": "def rankup\n if self.score > 10\n self.role = \"Novice\"\n end\n if self.score > 20\n self.role = \"Adept\"\n end\n if self.score > 30\n self.role = \"Apprentice\"\n end\n if self.score > 40\n self.role = \"Expert\"\n end\n if self.score > 50\n self.role = \"Master\"\n end\n self.save\n end",
"title": ""
},
{
"docid": "856a435c1fa083d1936f7d71df932bde",
"score": "0.59222925",
"text": "def rule_set\n self.class.roles_n_privileges_hash[\"role_#{@role_name}\".to_sym]\n end",
"title": ""
},
{
"docid": "be8b49965ac5d20180416e5729581a37",
"score": "0.59191704",
"text": "def role\n ActiveSupport::StringInquirer.new(self[:role]) if self[:role]\n end",
"title": ""
},
{
"docid": "b6caf7607f557378d474275c86f09e00",
"score": "0.58946747",
"text": "def assign_workflow_role(user, study, role)\n self.add_new.click\n select_user.click\n select_from_dropdown(:user, user)\n select_study.click\n select_from_dropdown(:study, study)\n select_role.click\n select_from_dropdown(:role, role)\n page.first('.dxgvCommandColumnItem_Main_Theme').click\n sleep 3\n end",
"title": ""
},
{
"docid": "4037a0898fcef54a271e67d7de8282db",
"score": "0.5892587",
"text": "def role_declare\n @role = ROLES.has_key?(self[\"role\"].to_i) ? ROLES[self[\"role\"].to_i] : ROLES[0]\n end",
"title": ""
},
{
"docid": "57d579c67033f91a75e25a33abf16317",
"score": "0.5890759",
"text": "def role_list\n self.role_ids\n end",
"title": ""
},
{
"docid": "4d72bf66e93b4fc636bf14306d3bd0de",
"score": "0.5890266",
"text": "def create_roles\n Role.create :name => \"#{self.cp_title} edit\", :critical_process_id => self.id, :edit => true, :review => false\n Role.create :name => \"#{self.cp_title} review\", :critical_process_id => self.id, :edit => false, :review => true\n end",
"title": ""
},
{
"docid": "257efd053fa2483723ef44d8d29d6736",
"score": "0.5880518",
"text": "def current_role\n self.roles[0].toString\n end",
"title": ""
},
{
"docid": "7ca2bc10339e2d1870c24e12ddc8d82f",
"score": "0.5873085",
"text": "def role_key\n super\n end",
"title": ""
},
{
"docid": "67403a429325c0420098f52acce8a59b",
"score": "0.586666",
"text": "def print_role\n ROLES[self.role_id]\n end",
"title": ""
},
{
"docid": "aa7553d46df8b12eb064bd63669bd0fb",
"score": "0.58662504",
"text": "def set_roles_from_requirements\n # Check Extra role\n count = 0\n @unused_count = 0\n if $roles.nil?\n $log.error \"Missing $roles\"\n else\n $roles.each do |name, defs|\n if defs.nil?\n $log.error \"no defs\"\n elsif is_unused_role?(name, defs['level'], defs['categories']) # TODO\n defs['unused'] = true\n @unused_count += 1\n else\n defs['unused'] = false\n end\n @roles[name] = defs\n count += 1\n end\n end\n\n # Check Missing role (level, categories) (assets)\n @missing_role_count = 0\n $abst_states.each do |d, s|\n if s.type == 'controller' && is_undefined_role(s)\n @missing_role_count += 1\n end\n end\n\n # Overall score\n if @unused_count > 0 && @missing_role_count > 0\n print \"\\e[31m\" # red\n puts \" set PDP : #{count} roles (#{@unused_count} unused, #{@missing_role_count} missing)\"\n print \"\\e[0m\" # reset\n elsif @unused_count > 0\n print \"\\e[31m\" # red\n puts \" set PDP : #{count} roles (#{@unused_count} unused)\"\n print \"\\e[0m\" # reset\n elsif @missing_role_count > 0\n print \"\\e[31m\" # red\n puts \" set PDP : #{count} roles (#{@missing_role_count} missing)\"\n print \"\\e[0m\" # reset\n else\n print \"\\e[32m\" # green\n puts \" set PDP : #{count} roles (all used)\"\n print \"\\e[0m\" # reset\n end\n end",
"title": ""
},
{
"docid": "d3b41832204739b983c0858e9e0889c8",
"score": "0.58652955",
"text": "def assign_study_role(user, study, role)\n self.add_new.click\n assign_user user\n assign_study study\n assign_role role\n assign_to_user.click\n end",
"title": ""
},
{
"docid": "149c88f77183d45e1e3b2f24203857fd",
"score": "0.5850023",
"text": "def roles_working_with\n find_related_frbr_objects( :works_with, :which_roles?) \n end",
"title": ""
},
{
"docid": "fb17ba2dfb00dbbbf73b981feea06c80",
"score": "0.5845979",
"text": "def is_assignable_to_role=(value)\n @is_assignable_to_role = value\n end",
"title": ""
},
{
"docid": "4b48925cecdfe41765b75ec631b56721",
"score": "0.5837247",
"text": "def translated_role\n I18n.t( role, :scope => :roles )\n end",
"title": ""
},
{
"docid": "d648f1345f017a7625864e1482e0d24f",
"score": "0.5830044",
"text": "def assign_role_to_user\n self.users.first.make_account_holder(false)\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.5819538",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.5819538",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.5819538",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.5819538",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "aa7f60a3f1ca82980e543680d5325dba",
"score": "0.5814873",
"text": "def setup_role \n if self.role.to_s.empty? \n self.role = 'member' \n end\n end",
"title": ""
},
{
"docid": "80bc3a93160a71bfc3f62b828a5d831b",
"score": "0.58135414",
"text": "def roles\n {\n :@aggregators=>'Aggregator',\n :@viewers=>'Viewer',\n :@budget_creators=>'Budget Creator',\n :@narrative_writers=>'Narrative Writer',\n :@approvers=>'approver',\n :@deleters=>'Delete Proposal'\n }\n end",
"title": ""
},
{
"docid": "c5467fb94e6e4458faacd1b08521f68c",
"score": "0.5809085",
"text": "def rbac_role_set_form_vars\n @edit = {}\n @edit[:role_id] = @record.id if @sb[:typ] != \"copy\"\n @edit[:new] = {}\n @edit[:current] = {}\n @edit[:key] = \"rbac_role_edit__#{@edit[:role_id] || \"new\"}\"\n\n @edit[:new][:name] = @record.name\n vmr = @record.settings.fetch_path(:restrictions, :vms) if @record.settings\n @edit[:new][:vm_restriction] = vmr || :none\n str = @record.settings.fetch_path(:restrictions, :service_templates) if @record.settings\n @edit[:new][:service_template_restriction] = str || :none\n @edit[:new][:features] = rbac_expand_features(@record.miq_product_features.map(&:identifier)).sort\n\n @edit[:current] = copy_hash(@edit[:new])\n\n @role_features = @edit[:new][:features]\n @rbac_menu_tree = build_rbac_feature_tree\n\n @right_cell_text = if @edit[:role_id]\n _(\"Editing Role \\\"%{name}\\\"\") % {:name => @record.name}\n else\n _('Adding a new Role')\n end\n end",
"title": ""
},
{
"docid": "5f5330f47e3d24ce5914de263ba9a4f3",
"score": "0.5805565",
"text": "def role\n the_role = self.read_attribute(:role)\n if the_role \n the_role.to_sym\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "6ccd6e83436d38045a2b5609f16047ff",
"score": "0.58037275",
"text": "def roles_anchor_collection_id; end",
"title": ""
},
{
"docid": "5e5d348b6ffb8299deb86235dbfeb28b",
"score": "0.5793375",
"text": "def role\n self[:role].to_sym\n end",
"title": ""
},
{
"docid": "09804bb0e71441f331d575167aedff87",
"score": "0.57924306",
"text": "def edit_role \n if self.roles.blank?\n self.roles << Role.find_by_name('user') \n end\n end",
"title": ""
},
{
"docid": "6067e9855887b64579d3b642b55651d2",
"score": "0.57908595",
"text": "def set_role\n @role = Role.find_by_actor_id_and_project_id(current_actor.id, @project.id)\n end",
"title": ""
},
{
"docid": "947b05bcef4b98774bb7f5ab5870efbb",
"score": "0.5788947",
"text": "def role\n super\n end",
"title": ""
},
{
"docid": "56e8743b0fedc6813996dea7e3226d18",
"score": "0.57889193",
"text": "def role\n user.role\n end",
"title": ""
},
{
"docid": "a43490ca34811e0118226bd5066c8e1b",
"score": "0.57873017",
"text": "def role role_name\n run_list << \"role[#{role_name}]\"\n run_list.uniq!\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end",
"title": ""
},
{
"docid": "71bff0173d62766a89ccdc8e1902d5c0",
"score": "0.5786973",
"text": "def set_role! role, should_assign, skip_save=false\n if should_assign\n assign_role! role, skip_save\n else\n remove_role! role, skip_save\n end\n end",
"title": ""
},
{
"docid": "2803dc6ee0710489b39545d0abb52c30",
"score": "0.57839984",
"text": "def set_role\n self.role ? self.add_role(self.role) : self.add_role(\"Guest\")\n end",
"title": ""
}
] |
954c2ed9e295775cd63c4115a133fdd7
|
POST /seller_goals POST /seller_goals.json
|
[
{
"docid": "b17c75cd9e0fd6c8fd7b492b8dde7789",
"score": "0.7580957",
"text": "def create\n @seller_goal = SellerGoal.new(seller_goal_params)\n\n respond_to do |format|\n if @seller_goal.save\n format.html { redirect_to @seller_goal, notice: 'Seller goal was successfully created.' }\n format.json { render :show, status: :created, location: @seller_goal }\n else\n format.html { render :new }\n format.json { render json: @seller_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "4cdf9260cfefa8f301926f1bf7d19be8",
"score": "0.6616069",
"text": "def index\n @seller_goals = SellerGoal.all\n end",
"title": ""
},
{
"docid": "b865b39314d7fcc16b295d3ae93c3ddd",
"score": "0.65742755",
"text": "def create\n @goals = goals_for_current_user\n @goal = Goal.new(params[:goal])\n @goal.user = current_user\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to({action: 'index'}, notice: 'Goal was successfully created.') }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: 'index' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8c8f6277d10de0684058b38b50cacc9f",
"score": "0.6457519",
"text": "def create\n @goal = @todo.goals.create(goal_params)\n render json: @goal\n end",
"title": ""
},
{
"docid": "df347d3e739fe41a94414a0d0aa9a218",
"score": "0.64346015",
"text": "def create\n # @goal = Goal.new(params[:goal])\n @goal = @group.goals.new(params[:goal])\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to group_goal_path(@group, @goal), notice: 'Goal was successvol aangemaakt.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fda84d0f7e3637f60fa123da1015c437",
"score": "0.64120585",
"text": "def goals_add\n @goal = Goal.create(goal_params)\n goal = GoalsUser.create({user_id:@user.id,goal_id:@goal.id})\n respond_to do |f|\n f.html {redirect_to goals_path(@user)}\n f.json {render json: {new_goal:goal,success: true}}\n end\n end",
"title": ""
},
{
"docid": "5c26b680b0833b349b904015a1138478",
"score": "0.63816255",
"text": "def create\n @goal = Goal.new(goal_params)\n @goal.user = current_user\n @goals = current_user.goals\n respond_to do |format|\n if @goal.save\n format.html { redirect_to home_index_path, notice: 'Goal was successfully created.' }\n # format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new, notice: \"There was an error updating your goal.\" }\n # format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8853eb4efa4c983758760cba19cfa8a0",
"score": "0.63783634",
"text": "def create\n @goal = current_user.goals.new(goal_params)\n\n if @goal.save\n flash[\"notice\"] = 'Goal was successfully created.'\n end\n\n respond_with @goal, location: [current_user, :goals]\n end",
"title": ""
},
{
"docid": "53f2d96fc6e9c97b8ebbcc25acc621a0",
"score": "0.6315219",
"text": "def set_seller_goal\n @seller_goal = SellerGoal.find(params[:id])\n end",
"title": ""
},
{
"docid": "28240941fbb42db1d69debc99fc7e353",
"score": "0.6231734",
"text": "def create\n @goal = Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to goals_url, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7dac087e8f0d77fe003139066dc2ff0e",
"score": "0.6206282",
"text": "def create\n @sgda_seller_goal_day = SgdaSellerGoalDay.new(sgda_seller_goal_day_params)\n\n respond_to do |format|\n if @sgda_seller_goal_day.save\n format.html { redirect_to @sgda_seller_goal_day, notice: 'Sgda seller goal day was successfully created.' }\n format.json { render :show, status: :created, location: @sgda_seller_goal_day }\n else\n format.html { render :new }\n format.json { render json: @sgda_seller_goal_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "733bc37e4574a31802c36be96111049d",
"score": "0.61980265",
"text": "def create\n @goal = Goal.new(goal_params)\n\n if (current_user.has_role? :admin) \n @personalGoals = Goal.all\n elsif (current_user.has_role? :athlete)\n @personalGoals = Goal.where(:user_id => current_user.id, :active => true, :team_id => nil).order(:goalEndDate)\n @teamGoals = Goal.where(:user_id => current_user.id, :active => true).where.not(:team_id => nil).order(:goalEndDate)\n end\n\n respond_to do |format|\n if @goal.save\n ActiveTest.perform_async(@goal.id)\n format.js \n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dff921ba1c5dfde6d1d7eee166f82361",
"score": "0.617479",
"text": "def create\n @goal = Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dff921ba1c5dfde6d1d7eee166f82361",
"score": "0.617479",
"text": "def create\n @goal = Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "31fff90bba3b0d41f748c76ab598c3d0",
"score": "0.6171331",
"text": "def create_solo\n @goal = Goal.new(params[:goal])\n @goal.user = current_user\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: 'new' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3801fe42f3e664402e32f08dcaacd4b",
"score": "0.6153401",
"text": "def create\n # Copy this method for creating other, user specific things.\n @goal = current_user.goals.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "771f42894f1be262ab27d0ca29ab3a36",
"score": "0.6128547",
"text": "def seller_goal_params\n params.fetch(:seller_goal, {})\n end",
"title": ""
},
{
"docid": "6f825a59e06e9e2a25b7857f5f853da8",
"score": "0.61190915",
"text": "def create\n @financial_objects_goal = FinancialObjects::Goal.new(financial_objects_goal_params)\n\n respond_to do |format|\n if @financial_objects_goal.save\n format.html { redirect_to @financial_objects_goal, notice: \"Goal was successfully created.\" }\n format.json { render :show, status: :created, location: @financial_objects_goal }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @financial_objects_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3b8fb7a211a13e47be4ee6db035c047e",
"score": "0.6099793",
"text": "def create\n @goal = Goal.new(goal_params)\n @goal.client_id = params[:client_id]\n @goal.status = 'active'\n\n if @goal.save\n flash[:message] = \"Goal saved\"\n render json: @goal.to_json\n else\n end\n end",
"title": ""
},
{
"docid": "f85a08b758be28bbde967e51534d8376",
"score": "0.6082733",
"text": "def create\n @level_goal = LevelGoal.new(params[:level_goal])\n\n respond_to do |format|\n if @level_goal.save\n format.html { redirect_to @level_goal, notice: 'Level goal was successfully created.' }\n format.json { render json: @level_goal, status: :created, location: @level_goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @level_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "159b26a228cf1ba764c64d151c95dc71",
"score": "0.6080577",
"text": "def create\n @goal = Goal.new(goal_params)\n @goal.user = current_user # associate the new goal to the current_user\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to user_goals_path(current_user), notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6378328746765f4227380b60ea106a9b",
"score": "0.6050183",
"text": "def create\n @goal = Goal.new(goal_params)\n @goal.user_id = current_user.id\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fea68a6f789cd83d7b88d43b3afd0f3d",
"score": "0.5995892",
"text": "def create\n @show_sales_overlay = false\n\n\n if current_user and params[:first_name]\n\t current_user.first_name = params[:first_name]\n \n ### having periods in the first name kills the attempts to email that person, so remove periods\n current_user.first_name = current_user.first_name.gsub(\".\", \"\")\n current_user.save\n end \n\n @goal = Goal.new(params[:goal])\n\n if @goal.template_owner_is_a_template\n @goal.status = \"hold\"\n end\n\n\n\n ### remove question marks because:\n ### people keep incorrectly adding their own question marks to the end of their question\n ### which messes up phrasings in the rest of the program and never is needed\n @goal.response_question = @goal.response_question.gsub(\"?\", \"\")\n\n @goal.title = @goal.response_question\n\n if [email protected]_allowed_per_day\n @goal.pushes_allowed_per_day = 1\n end \n\n\n\n\n ################################\n #Status Creation Business Rules\n ################################\n #start (create the goal starting today stopping after goal.days_to_form_a_habit days)\n #monitor (create the goal starting today stopping after goal.days_to_form_a_habit days)\n #hold (just create the goal and a default dummy date of 1/1/1900 for start and stop)\n \n respond_to do |format|\n\n tracker_data_missing_error = false\n if @goal.tracker\n\n\n\n missing = false\n if [email protected]_question or @goal.tracker_question == \"\"\n missing = true\n logger.debug(\"sgj:goals_controller:1\")\n end\n if [email protected]_units or @goal.tracker_units == \"\"\n missing = true\n logger.debug(\"sgj:goals_controller:2\")\n end\n\n\n ### these will never be null b/c they're in forced pulldowns\n ### plus these checks were not working right\n # if [email protected]_type_starts_at_zero_daily\n # missing = true\n # logger.debug(\"sgj:goals_controller:3\")\n # end\n # if [email protected]_target_higher_value_is_better\n # missing = true\n # logger.debug(\"sgj:goals_controller:4\")\n # end\n\n # if [email protected]_standard_deviation_from_last_measurement\n # missing = true\n # logger.debug(\"sgj:goals_controller:5\")\n # end\n # if [email protected]_target_threshold_bad1\n # missing = true\n # logger.debug(\"sgj:goals_controller:6\")\n # end\n # if [email protected]_target_threshold_bad2\n # missing = true\n # logger.debug(\"sgj:goals_controller:7\")\n # end\n # if [email protected]_target_threshold_bad3\n # missing = true\n # logger.debug(\"sgj:goals_controller:8\")\n # end\n # if [email protected]_target_threshold_good1\n # missing = true\n # logger.debug(\"sgj:goals_controller:9\")\n # end\n # if [email protected]_target_threshold_good2\n # missing = true\n # logger.debug(\"sgj:goals_controller:10\")\n # end\n # if [email protected]_target_threshold_good3\n # missing = true\n # logger.debug(\"sgj:goals_controller:11\")\n # end\n\n if missing\n tracker_data_missing_error = true\n @goal.errors.add(:base, \"All 'Tracker' fields are required if the 'Tracker' is enabled.\")\n end ### end if missing\n\n end ### end if @goal.tracker\n\n\n\n if !tracker_data_missing_error and @goal.save\n\n\n pmo = false\n\n if @goal.title.include? \"fapping\"\n pmo = true\n end\n\n if @goal.title.include? \"porn\"\n pmo = true\n end\n\n if @goal.title.include? \"masturb\"\n pmo = true\n end\n if @goal.title.include? \"pmo\"\n pmo = true\n end\n if @goal.title.include? \"jerking off\"\n pmo = true\n end\n if @goal.title.include? \"jerk off\"\n pmo = true\n end\n if @goal.title.include? \"touching myself\"\n pmo = true\n end\n if @goal.title.include? \"touching yourself\"\n pmo = true\n end\n if @goal.title.include? \"XXX\"\n pmo = true\n end\n if @goal.title.include? \"xxx\"\n pmo = true\n end\n\n\n if pmo\n @goal.category = \"PMO\"\n end\n\n if @goal.template_owner_is_a_template\n flash[:notice] = 'Template was successfully created.'\n\n ### if this new template was created to be part of an existing program\n if params[:program_id]\n program = Program.find(params[:program_id])\n\n program_template = ProgramTemplate.new()\n program_template.program_id = program.id\n program_template.template_goal_id = @goal.id\n\n ### you can't do this anymore now that 'next_listing_position' depends on the track\n ### because right now we don't know which track this will be in\n #program_template.listing_position = program.get_next_listing_position\n\n program_template.save\n end\n\n else\n flash[:notice] = 'Goal was successfully created.'\n\n ### show my PMO homies\n if @goal.category == \"PMO\"\n @goal.user.feed_filter_hide_pmo = false\n end\n\n ### if this is my first ever goal, record it in user for marketing\n if [email protected]_first\n @goal.user.category_first = @goal.category\n @goal.user.goal_first = @goal.title\n end\n if [email protected]_goals\n @goal.user.categories_goals = \"\"\n end\n\n if [email protected]\n @goal.category = \"Other\"\n end\n\n if [email protected]\n @goal.title = \"none\"\n end\n @goal.user.categories_goals += @goal.category + \"_:_\" + @goal.title + \"::\"\n\n\n if params[:sign_up_for_lyphted] and params[:sign_up_for_lyphted] == \"1\"\n @goal.user.lyphted_subscribe = @goal.user.dtoday\n\n\n # ####https://labs.aweber.com/snippets/subscribers\n # oauth = AWeber::OAuth.new('Ak1WLosRSScHQL6Z3X3WfV3F', 'utsxWW2PuCrWWGdUpGy1nLlFkXr1Hr2pRL7TomdR')\n\n # auth_url = oauth.request_token.authorize_url\n # logger.info(\"sgj:aweber: \" + auth_url)\n\n ### got all of the accesstoken info by following the account verifications instructions\n ### while using irb (require 'rubygems' and require 'aweber')\n ### based on: https://github.com/aweber/AWeber-API-Ruby-Library\n\n #<OAuth::AccessToken:0xb76fea70 @params={}, @consumer=#<OAuth::Consumer:0xb72e00d8 @http_method=:post, @secret=\"utsxWW2PuCrWWGdUpGy1nLlFkXr1Hr2pRL7TomdR\", @options={:access_token_path=>\"/1.0/oauth/access_token\", :oauth_version=>\"1.0\", :scheme=>:query_string, :signature_method=>\"HMAC-SHA1\", :proxy=>nil, :http_method=>:post, :request_token_path=>\"/1.0/oauth/request_token\", :authorize_path=>\"/1.0/oauth/authorize\", :site=>\"https://auth.aweber.com\"}, @key=\"Ak1WLosRSScHQL6Z3X3WfV3F\", @http=#<Net::HTTP auth.aweber.com:443 open=false>>, @secret=\"DmCMwlQWL4a2NHCrCTGaAu5u5EwaH06P5e4MLcYp\", @token=\"AgeEEz2LxKSd8zNpr602Bfyd\"> \n \n # App Name; HabitForge\n # App ID: 8765b416 \n # Consumer Key: Ak1WLosRSScHQL6Z3X3WfV3F\n # Consumer Secret: utsxWW2PuCrWWGdUpGy1nLlFkXr1Hr2pRL7TomdR\n\n ####https://labs.aweber.com/snippets/subscribers\n oauth = AWeber::OAuth.new('Ak1WLosRSScHQL6Z3X3WfV3F', 'utsxWW2PuCrWWGdUpGy1nLlFkXr1Hr2pRL7TomdR')\n oauth.authorize_with_access('AgeEEz2LxKSd8zNpr602Bfyd', 'DmCMwlQWL4a2NHCrCTGaAu5u5EwaH06P5e4MLcYp')\n aweber = AWeber::Base.new(oauth)\n new_subscriber = {}\n new_subscriber[\"email\"] = @goal.user.email\n new_subscriber[\"name\"] = @goal.user.name\n\n #### again, this one is custom and was not able to figure out how to update it\n # new_subscriber[\"YOB\"] = \"1976\"\n\n\n ##### was not able to get the updating of these custom fields to work after several different method tries\n ##### but that's OK we're now just using the built-in \"misc_notes\" \n # new_subscriber[\"custom_fields\"][\"first_category\"] = \"exercise\"\n # new_subscriber[\"custom_fields\"][\"first_goal\"] = \"run for 20 minutes\"\n # new_subscriber[\"custom_fields\"][\"categories_goals\"] = \"exercise:.:run for 20 minutes;\"\n\n begin\n new_subscriber[\"misc_notes\"] = \"first_category=\" + @goal.user.category_first\n rescue\n logger.error(\"sgj:could not add subscriber misc_note to aweber\")\n end\n\n # new_subscriber[\"misc_notes\"] = \"first_category=\" + @goal.user.category_first + \";first_goal='\" + @goal.user.goal_first + \"'\"\n\n ## The Lyphted list_id is = 3702705\n ## The Lyphted list_name is = awlist3702705\n list = aweber.account.lists.find_by_id(3702705)\n\n begin\n list.subscribers.create(new_subscriber)\n rescue\n logger.error(\"sgj:could not add subscriber to aweber (perhaps they have a role-based email address like admin@something\")\n ###https://help.aweber.com/entries/97662366\n end\n\n # aweber.account.lists.each do |list|\n # logger.info(\"sgj:aweber:\" + list.name)\n # end\n # logger.info(\"sgj:aweber:\" + aweber.account.lists.to_s)\n # logger.info(\"sgj:aweber:\" + aweber.account.lists[0].name.to_s)\n #aweber.account.lists.find_by_id(3702705).subscribers.create(new_subscriber)\n\n\n end\n\n\n\n ### update last activity date\n @goal.user.last_activity_date = @goal.user.dtoday\n @goal.user.deletion_warning = nil\n @goal.user.save\n \n ###############################################\n ###### START IF SFM_VIRGIN\n if session[:sfm_virgin] and session[:sfm_virgin] == true\n session[:sfm_virgin] = false\n @show_sales_overlay = true\n\n @user = current_user\n\n ### existing_user will be true if coming from an infusionsoft email invite\n ### in that case, do not send them another welcome email\n if !session[:existing_user]\n #### now that we have their first name, we can send the email \n the_subject = \"Confirm your HabitForge Subscription\"\n begin\n #if Rails.env.production?\n logger.error(\"sgj:goals_controller:about to send user confirmation to user \" + @user.email)\n Notifier.deliver_user_confirm(@user, the_subject) # sends the email\n #end\n rescue\n logger.error(\"sgj:email confirmation for user creation did not send\")\n end\n end\n\n\n # begin\n # #####################################################\n # #####################################################\n # #### UPDATE THE CONTACT FOR THEM IN INFUSIONSOFT ######\n # ### SANDBOX GROUP/TAG IDS\n # #112: hf new signup funnel v2 free no goal yet\n # #120: hf new signup funnel v2 free created goal\n # #\n # ### PRODUCTION GROUP/TAG IDS\n # #400: hf new signup funnel v2 free no goal yet\n # #398: hf new signup funnel v2 free created goal\n # if Rails.env.production?\n # Infusionsoft.contact_update(session[:infusionsoft_contact_id].to_i, {:FirstName => current_user.first_name, :LastName => current_user.last_name})\n # Infusionsoft.contact_add_to_group(session[:infusionsoft_contact_id].to_i, 398)\n # Infusionsoft.contact_remove_from_group(session[:infusionsoft_contact_id].to_i, 400)\n # end\n # #### END INFUSIONSOFT CONTACT ####\n # #####################################################\n # #####################################################\n # rescue\n # logger.error(\"sgj:error updating contact in infusionsoft\")\n # end\n end ### END IF SFM_VIRGIN\n ###### END IF SFM_VIRGIN\n ###############################################\n\n\n current_user.goal_temp = \"\"\n current_user.save\n end ### end if goal != a template\n\n \n if @goal.usersendhour == nil\n\t @goal.usersendhour = 20 ### 8pm\n end\n\n Time.zone = @goal.user.time_zone\n utcoffset = Time.zone.formatted_offset(false)\n offset_seconds = Time.zone.now.gmt_offset \n send_time = Time.utc(2000, \"jan\", 1, @goal.usersendhour, 0, 0) #2000-01-01 01:00:00 UTC\n central_time_offset = 21600 #add this in since we're doing UTC\n server_time = send_time - offset_seconds - central_time_offset\n puts \"User lives in #{@goal.user.time_zone} timezone, UTC offset of #{utcoffset} (#{offset_seconds} seconds).\" #Save this value in each goal, and use that to do checkpoint searches w/ cronjob\n puts \"For them to get an email at #{send_time.strftime('%k')} their time, the server would have to send it at #{server_time.strftime('%k')} Central time\"\n @goal.serversendhour = server_time.strftime('%k')\n @goal.gmtoffset = utcoffset \n #############\n \n \n\n if @goal.daym == nil \n @goal.daym = true\n end\n if @goal.dayt == nil \n @goal.dayt = true\n end\n if @goal.dayw == nil \n @goal.dayw = true\n end\n if @goal.dayr == nil \n @goal.dayr = true\n end\n if @goal.dayf == nil \n @goal.dayf = true\n end\n if @goal.days == nil \n @goal.days = true\n end\n if @goal.dayn == nil \n @goal.dayn = true\n end\n\n if [email protected]_owner_is_a_template\n if @goal.status != \"hold\" and @goal.daym and @goal.dayt and @goal.dayw and @goal.dayr and @goal.dayf and @goal.days and @goal.dayn and (@goal.goal_days_per_week == nil or @goal.goal_days_per_week == 7)\n @goal.status = \"start\"\n else\n @goal.status = \"monitor\"\n end\n end\n\n\n #########\n ### Once the goal is saved, set the start and stop dates\n\n \n dnow = get_dnow\n\n if @goal.status == \"hold\"\n @goal.start = Date.new(1900, 1, 1)\n @goal.stop = @goal.start \n end\n @goal.established_on = Date.new(1900, 1, 1)\n if (@goal.status == \"start\" or @goal.status == \"monitor\")\n start_day_offset = 1\n if params[:delay_start_for_this_many_days] \n start_day_offset = params[:delay_start_for_this_many_days].to_i\n end\n ### Set the standard dates\n @goal.start = dnow + start_day_offset\n @goal.stop = @goal.start + @goal.days_to_form_a_habit\n \t @goal.first_start_date = @goal.start \n @goal.save\n end\n\n ### save date changes\n @goal.save\n\n\n ####################################################################\n ####################################################################\n ##### ACCEPT AN INVITE\n ####################################################################\n ### if we are responding to an invitation to join a team\n if params[:invitation_id]\n begin\n attempt_to_join_team = false\n\n invite = Invite.find(params[:invitation_id].to_i)\n if invite and invite.purpose_join_team_id\n\n team = Team.find(invite.purpose_join_team_id)\n if team\n\n ### what kind of team?\n if team.goal_template_parent_id\n\n ### template based team\n if @goal.template_user_parent_goal_id and (@goal.template_user_parent_goal_id == team.goal_template_parent_id)\n attempt_to_join_team = true\n end\n\n else\n\n ### category-based team\n if team.category_name and @goal.category and (team.category_name == @goal.category)\n attempt_to_join_team = true\n end\n\n end\n\n if attempt_to_join_team\n if @goal.join_goal_to_a_team(team.id)\n logger.info(\"sgj:goals_controller.rb:success adding goal to team when responding to invitation\")\n\n\n ### we actually want to delete the invite, not save it\n ### that way if the new team member removes their goal and then\n ### changes their mind later, we can send them another invite\n #invite.accepted_on = current_user.dtoday\n #invite.save\n invite.destroy\n\n\n #### SEND INVITE ACCEPTANCE TO OWNER\n begin\n if Notifier.deliver_to_team_owner_invite_accepted(@goal, team.owner) # sends the email \n logger.info(\"sgj:goals_controller.rb:create:SUCCESS SENDING INVITE ACCEPTANCE EMAIL\") \n else\n logger.error(\"sgj:goals_controller.rb:create:FAILURE SENDING INVITE ACCEPTANCE EMAIL:goal_id = \" + @goal.id.to_s)\n end\n rescue\n logger.error(\"sgj:goals_controller.rb:create:(rescue)FAILURE SENDING INVITE ACCEPTANCE EMAIL:goal_id = \" + @goal.id.to_s)\n end\n #### END SEND INVITE ACCEPTANCE TO OWNER\n\n\n else\n logger.error(\"sgj:goals_controller.rb:failed to add goal to team when responding to invitation\")\n end\n else\n logger.error(\"sgj:goals_controller.rb:the team invite was a mis-match for either this goal category or this goal parent template .. not trying to join team\") \n end\n\n end ### if team\n\n end ### if invite and invite.purpose_join_team_id\n\n rescue\n logger.error(\"sgj:goals_controller.rb:error trying to add goal to team when responding to invitation\")\n end\n\n end ### if session[:accepting_invitation_id]\n ####################################################################\n ##### END ACCEPT AN INVITE\n ####################################################################\n ####################################################################\n\n\n\n ####################################################################\n ####################################################################\n ##### PROGRAM ENROLLMENT\n ####################################################################\n\n ### create a program enrollment record if a program is involved\n ### goal and program are linked via goal.goal_added_through_template_from_program_id\n if @goal.program\n\n ### check to see if an enrollment exists... if not, create one\n enrollment = ProgramEnrollment.find(:first, :conditions => \"program_id = '#{@goal.program.id}' and user_id = '#{@goal.user.id}'\")\n if !enrollment\n enrollment = ProgramEnrollment.new()\n # t.integer \"program_id\"\n # t.integer \"user_id\"\n # t.boolean \"active\"\n # t.boolean \"ongoing\"\n # t.integer \"program_session_id\"\n # t.date \"personal_start_date\"\n # t.date \"personal_end_date\"\n enrollment.program_id = @goal.program.id\n enrollment.user_id = @goal.user.id\n enrollment.active = true\n enrollment.ongoing = true\n\n enrollment.save\n\n end ### end if !enrollment\n end ### end if @goal.program\n\n ####################################################################\n ##### END PROGRAM ENROLLMENT\n ####################################################################\n ####################################################################\n\n\n\n ### we don't need/want these anymore\n ### destroy them so that they don't mess up a future new goal\n session[:goal_added_through_template_from_program_id] = nil\n session[:template_user_parent_goal_id] = nil\n session[:goal_template_text] = nil\n session[:category] = nil\n session[:accepting_invitation_id] = nil\n\n \n if @goal.status == \"hold\"\n ### don't send an email if it's on hold\n else\n begin \n if session[:sponsor] == \"clearworth\"\n #Notifier.deliver_goal_creation_notification_clearworth(@goal) # sends the email\n elsif session[:sponsor] == \"forittobe\"\n #Notifier.deliver_goal_creation_notification_forittobe(@goal) # sends the email\n elsif session[:sponsor] == \"marriagereminders\"\n #Notifier.deliver_goal_creation_notification_marriagereminders(@goal) # sends the email\n else\n #Notifier.deliver_goal_creation_notification(@goal) # sends the email\n end\n rescue\n puts \"Error while sending goal notification email from Goal.create action.\"\n end\n end\n\n\n\n ### if this new template was created to be part of an existing program\n if params[:program_id] or params[:return_to_program_view]\n if params[:return_to_program_view]\n format.html {redirect_to(\"/programs/#{params[:return_to_program_view]}/view\")}\n else\n\n ### if the program is a \"structured program\" you're going to want to go directly to edit mode\n p = Program.find(params[:program_id].to_i)\n if p and p.structured\n\n pt = ProgramTemplate.find(:first, :conditions => \"program_id = '#{p.id}' and template_goal_id = '#{@goal.id}'\")\n format.html {redirect_to(\"/program_templates/#{pt.id.to_s}/edit\")}\n\n else\n format.html {redirect_to(\"/programs/#{params[:program_id]}#action_items\")}\n end\n\n\n end\n\n else\n\n begin \n ### attempt to add to encourage_items\n\n\n # when a goal is created,\n # if username != unknown,\n # if the goal is public,\n # then enter it into encourage_items\n\n # --- encourage_item ---\n # encourage_type_new_checkpoint_bool (index)\n # encourage_type_new_goal_bool (index)\n # checkpoint_id\n # checkpoint_status\n # checkpoint_date (index)\n # checkpoint_updated_at_datetime\n # goal_id (index)\n # goal_name\n # goal_category\n # goal_created_at_datetime\n # goal_publish\n # goal_first_start_date (index)\n # goal_daysstraight\n # goal_days_into_it\n # goal_success_rate_percentage\n # user_id (index)\n # user_name\n # user_email\n\n logger.debug \"sgj:goals_controller.rb:consider adding to encourage_items\"\n if @goal.user.first_name != \"unknown\"\n if @goal.is_public\n logger.debug \"sgj:goals_controller.rb:candidate for encourage_items\"\n\n encourage_item = EncourageItem.new\n logger.debug \"sgj:goals_controller.rb:new encourage_items instantiated\"\n\n encourage_item.encourage_type_new_checkpoint_bool = false\n encourage_item.encourage_type_new_goal_bool = true\n\n #encourage_item.checkpoint_id = nil\n encourage_item.checkpoint_id = @goal.id ### a workaround to the validation that checkpoint_id is unique\n\n encourage_item.checkpoint_status = nil\n encourage_item.checkpoint_date = nil\n encourage_item.checkpoint_updated_at_datetime = nil\n encourage_item.goal_id = @goal.id\n encourage_item.goal_name = @goal.title\n encourage_item.goal_category = @goal.category\n encourage_item.goal_created_at_datetime = @goal.created_at\n encourage_item.goal_publish = @goal.publish\n encourage_item.goal_first_start_date = @goal.first_start_date\n encourage_item.goal_daysstraight = @goal.daysstraight\n encourage_item.goal_days_into_it = @goal.days_into_it\n encourage_item.goal_success_rate_percentage = @goal.success_rate_percentage\n encourage_item.user_id = @goal.user.id\n encourage_item.user_name = @goal.user.first_name\n encourage_item.user_email = @goal.user.email\n\n logger.debug \"sgj:goals_controller.rb:about to save encourage_items\"\n\n if encourage_item.save\n logger.info(\"sgj:goals_controller.rb:success saving encourage_item\")\n else\n logger.error(\"sgj:goals_controller.rb:error saving encourage_item\")\n end\n logger.debug \"sgj:goals_controller.rb:new encourage_item.id = \" + encourage_item.id.to_s\n\n end\n end\n\n rescue\n logger.error \"sgj:error adding to encourage_items\"\n end\n\n\n if @show_sales_overlay\n ### format.html { render :action => \"edit\" }\n\n if Rails.env.production?\n\n ### show the sales page and eventually kick back to optimize when they cancel\n #format.html {redirect_to(\"https://www.securepublications.com/habit-gse3.php?ref=#{current_user.id.to_s}&email=#{current_user.email}\")}\n\n ### do not show the sales page first, just kick to optimize\n format.html {redirect_to(\"/goals?optimize_my_first_goal=1&email=#{current_user.email}&single_login=1\")}\n\n else\n session[:dev_mode_just_returned_from_sales_page] = true\n format.html {redirect_to(\"/goals?optimize_my_first_goal=1&email=#{current_user.email}&single_login=1\")}\n end\n\n format.xml { render :xml => @goals }\n else\n\n\n ##### SUCCESSFULLY SAVED A NEW GOAL ... REDIRECT TO ???\n\n # if session[:sfm_virgin]\n # format.html { redirect_to(\"/goals/#{@goal.id}/edit?just_created_new_habit=1&just_created_first_habit=1\")}\n # else \n # format.html { redirect_to(\"/goals/#{@goal.id}/edit?just_created_new_habit=1\")}\n # end\n\n\n # if !current_user.is_habitforge_supporting_member\n # format.html {redirect_to(\"/goals?too_many_active_habits=1&just_created_new_habit=1\")} \n # else\n # format.html { render :action => \"index\" } # index.html.erb\n # end\n \n # if !current_user.is_habitforge_supporting_member\n # format.html { redirect_to(\"https://habitforge.com/widget/upgrade\")}\n # else\n format.html { redirect_to(\"/goals/#{@goal.id}/edit?just_created_new_habit=1\")}\n # end\n\n\n\n format.xml { render :xml => @goals }\n end\n\n end \n\n\n\n \n\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @goal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3080081dd0211796ba6bf4a0e033289e",
"score": "0.5979524",
"text": "def create\n @goal = current_user.goals.build(goal_params)\n\n # iterate throught dates\n puts goal_params[:start_date]\n puts goal_params[:duration]\n\n if goal_params[:start_date] != \"\" && goal_params[:duration] != \"\"\n start_date = Date.parse(goal_params[:start_date])\n end_date = start_date + goal_params[:duration].to_i - 1\n\n start_date.upto(end_date) do |date|\n @goal.activities.build({done: false, due_date: date})\n end\n end\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to goals_path, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8087f1bed5e5389f2b4ba748fdb2a419",
"score": "0.5969827",
"text": "def create\n @goal = @goalable.goals.new(goal_params)\n respond_to do |format|\n if @goal.save\n format.html { redirect_to [@goalable, @goal], notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n format.js { }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n format.js { render layout: false, content_type: 'text/javascript' }\n end\n end\n end",
"title": ""
},
{
"docid": "0afd29b7998e81aa7e494f4936dd69e1",
"score": "0.5960332",
"text": "def update\n respond_to do |format|\n if @seller_goal.update(seller_goal_params)\n format.html { redirect_to @seller_goal, notice: 'Seller goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @seller_goal }\n else\n format.html { render :edit }\n format.json { render json: @seller_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a057c9a3191b46532532816cc0f96051",
"score": "0.59601635",
"text": "def create\n @weekly_goal = WeeklyGoal.new(weekly_goal_params)\n\n respond_to do |format|\n if @weekly_goal.save\n format.html { redirect_to @weekly_goal, notice: 'Weekly goal was successfully created.' }\n format.json { render :show, status: :created, location: @weekly_goal }\n else\n format.html { render :new }\n format.json { render json: @weekly_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "74106ecfc9e4c47ce84d1859fc21d98b",
"score": "0.5944876",
"text": "def create\n @global_goal = GlobalGoal.new(params[:global_goal])\n\n respond_to do |format|\n if @global_goal.save\n format.html { redirect_to @global_goal, notice: 'Goal was successfully created.' }\n format.json { render json: @global_goal, status: :created, location: @global_goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @global_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d04bf60c2a195ffa88c6dfe6ee4c79d5",
"score": "0.5921769",
"text": "def create\n @goal = @user.goals.new(params[:goal])\n=begin \n if params[:goal_amount].blank?\n @goal.errors[:base] << \"Select score or duration for setting goal.\"\n elsif params[:goal_amount] == \"score\"\n if @goal.goal_amount_score.blank?\n @goal.errors[:goal_amount_score] << \"should be set.\"\n end\n \n if [email protected]_amount_duration.blank?\n @goal.goal_amount_duration = nil\n end\n elsif params[:goal_amount] == \"duration\"\n if @goal.goal_amount_duration.blank?\n @goal.errors[:goal_amount_duration] << \"should be set.\"\n end\n \n if [email protected]_amount_score.blank?\n @goal.goal_amount_score = nil\n end\n end\n=end \n if @goal.goal_type == 'recurring'\n case params[:goal_frequency]\n when \"daily\"\n @goal.goal_frequency = 1\n @goal.goal_frequency_unit = \"day\"\n when \"weekly\"\n @goal.goal_frequency = 1\n @goal.goal_frequency_unit = \"week\"\n when \"bi-monthly\"\n @goal.goal_frequency = 2\n @goal.goal_frequency_unit = \"week\"\n when \"monthly\"\n @goal.goal_frequency = 1\n @goal.goal_frequency_unit = \"month\"\n when \"other\"\n @goal.goal_frequency = params[:goal_frequency].to_i\n @goal.goal_frequency_unit = params[:frequency][:other_frequency_unit]\n end\n \n end\n \n if [email protected]?\n render action: \"new\"\n else\n respond_to do |format|\n if @goal.save\n format.html { redirect_to [@user,@goal], notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "debc5ea39d509156b61faf38761e1e8e",
"score": "0.5920396",
"text": "def goals\n assessment_type = params[:assessment_type]\n country_name = params[:country_name]\n technical_area_ids = params[:areas].to_s.split(\"-\")\n @disease_ids = params[:diseases]\n country = Country.find_by_name country_name\n @publication = AssessmentPublication.find_by_named_id assessment_type\n if country.present? && @publication.present?\n @assessment =\n Assessment.deep_load(country.try(:alpha3), @publication.try(:id))\n end\n if @assessment.blank?\n render \"assessment_not_found\"\n return\n end\n @plan =\n Plan.new_from_assessment(\n assessment: @assessment,\n technical_area_ids: technical_area_ids,\n is_5_year_plan: params[:plan_term]&.start_with?(\"5\")\n )\n end",
"title": ""
},
{
"docid": "b235c1d0605d1e5511e76ab23f81f836",
"score": "0.5914979",
"text": "def create\n @product = Product.find(params[:product_id])\n @goal = Goal.new(params[:goal])\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal.product, notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02711b11ca0ca80959fbed8c466c8754",
"score": "0.5909814",
"text": "def create\n @goal_reward = GoalReward.new(params[:goal_reward])\n\n respond_to do |format|\n if @goal_reward.save\n format.html { redirect_to [@goal_reward.user, GoalReward], notice: 'Goal reward was successfully created.' }\n format.json { render json: @goal_reward, status: :created, location: @goal_reward }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal_reward.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "143dac6b34bde203634f1d93eecd17ad",
"score": "0.5902574",
"text": "def create\n @goal = Goal.new(goal_params)\n @goal.user_id=current_user.id\n \n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae5f3be681bc35f13294c13a13853067",
"score": "0.5867704",
"text": "def create\n @goal = Mg::Goal.new(params[:goal])\n\n if @goal.save\n flash[:notice] = 'Goal was successfully created.'\n redirect_to mg_goal_url :id => @goal.id\n else\n render :action => \"new\"\n end\n end",
"title": ""
},
{
"docid": "08d5daf7a4748984071e5149897e70e0",
"score": "0.58572793",
"text": "def index\n @goals = @user.goals\n \n render json: @goals\n end",
"title": ""
},
{
"docid": "145a898f450dc7430cfa8d51be1dd085",
"score": "0.58463335",
"text": "def index\n @goals = goals_for_current_user\n @goal = Goal.new\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @goals }\n end\n end",
"title": ""
},
{
"docid": "18b84218f71ab1ec223c11472719a611",
"score": "0.58288455",
"text": "def give_goals_to_user\n self.goals.create(category: \"Use my own bags at the store\", point_value: 12, frequency: 0, weekly_points_goal: 0, weekly_results: 0)\n self.goals.create(category: \"Carpool instead of use my car\", point_value: 100, frequency: 0, weekly_points_goal: 0, weekly_results: 0)\n self.goals.create(category: \"Air dry a load of laundry\", point_value: 70, frequency: 0, weekly_points_goal: 0, weekly_results: 0)\n self.goals.create(category: \"Adjust the thermostat up 1 degree in summer\", point_value: 40, frequency: 0, weekly_points_goal: 0, weekly_results: 0)\n self.goals.create(category: \"Install a compact fluorescent light bulb\", point_value: 60, frequency: 0, weekly_points_goal: 0, weekly_results: 0)\n self.goals.create(category: \"Ride a bike instead of car 1 mile\", point_value: 20, frequency: 0, weekly_points_goal: 0, weekly_results: 0)\n self.goals.create(category: \"Take a shorter shower (5 min or less)\", point_value: 4, frequency: 0, weekly_points_goal: 0, weekly_results: 0)\n self.goals.create(category: \"Turn off my engine instead of idleing\", point_value: 15, frequency: 0, weekly_points_goal: 0, weekly_results: 0)\n self.goals.create(category: \"Buy or eat local\", point_value: 15, frequency: 0, weekly_points_goal: 0, weekly_results: 0)\n\n\n end",
"title": ""
},
{
"docid": "e8e59f482ae84fed5b7904048b2ea54a",
"score": "0.5821488",
"text": "def create\n @goal = Goal.new :name => params[:name], :user => current_user, :position => params[:position], :archived => params[:archived]\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84519c202d0f472fc30b2a051832979f",
"score": "0.5817577",
"text": "def create\n @goal = Goal.goal_data(goal_params, current_user.id)\n\[email protected](goal_params)\n redirect_to @goal, notice: 'Goal was successfully updated.'\n end",
"title": ""
},
{
"docid": "e091e0f7619f85c7d6588bdad904586d",
"score": "0.57831335",
"text": "def create\n @goal = Goal.new(goal_params)\n @list = @goal.list\n respond_to do |format|\n if @goal.save\n format.js {render :action => 'update_goals.js.haml', :locals => {:goals => @list.goals}}\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c73cdcaca5dbd1d04be124408a515739",
"score": "0.5775483",
"text": "def create\n @goal = Goal.new(params[:goal])\n @goal.set_goal_user current_user\n\n # on the wizard path, steps guarantee that this goal preceeds the plan and reward. Create empty objects for next step.\n is_wizard = (params[:user_context] == 'wizard')\n\n respond_to do |format|\n if @goal.save\n if is_wizard \n @reward = @goal.plan.reward\n puts \"reward #{@reward}\"\n format.html { render action: \"wizard_prize\" }\n else\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n end\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f778b79ee7c007c25e521f21ebd0bb09",
"score": "0.5764818",
"text": "def add_goals\n end",
"title": ""
},
{
"docid": "61a0e3a11fd99b118157e00802518ce8",
"score": "0.5754652",
"text": "def create\n @goal_step = GoalStep.new(goal_step_params)\n\n respond_to do |format|\n if @goal_step.save\n format.html { redirect_to @goal_step, notice: \"Goal step was successfully created.\" }\n format.json { render :show, status: :created, location: @goal_step }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @goal_step.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a52a1d522e6638a3391ff4de044de01",
"score": "0.5750198",
"text": "def destroy\n @seller_goal.destroy\n respond_to do |format|\n format.html { redirect_to seller_goals_url, notice: 'Seller goal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4473a10c407cc4b3346df91098c3e9e1",
"score": "0.57331485",
"text": "def create_goal(p_name, p_matchAttribute, p_pattern, p_patternType, metrics_site_id)\n set_param(:idSite, metrics_site_id)\n set_param(:method, 'Goals.addGoal')\n set_param(:name, p_name)\n set_param(:matchAttribute, p_matchAttribute)\n set_param(:pattern, p_pattern)\n set_param(:patternType, p_patternType)\n url_string = @metrics_admin_url + @metrics_params.slice(:module, :method, :idSite, :name, :matchAttribute,\n :pattern, :patternType, :token_auth).to_query\n response_string = api_call(url_string)\n metrics_goal_id = response_string.xpath('//result/text()').map(&:text)[0]\n metrics_goal_id.to_i\n end",
"title": ""
},
{
"docid": "ce92f90fa048445f8fb8d9f988c0782d",
"score": "0.5726635",
"text": "def create\n @goal_to_be = GoalToBe.new(goal_to_be_params)\n\n respond_to do |format|\n if @goal_to_be.save\n format.html { redirect_to @goal_to_be, notice: 'Goal to be was successfully created.' }\n format.json { render :show, status: :created, location: @goal_to_be }\n else\n format.html { render :new }\n format.json { render json: @goal_to_be.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c2e6ec124f719ff0b50a8e64952e9ede",
"score": "0.569283",
"text": "def create\n @goal = Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to patient_path(@patient), notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: patient_goals_path(@patient)}\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d7c80622ec224fca4e756d93c8bd6a03",
"score": "0.5670497",
"text": "def goals(*args)\n @client.get \"#{@path}/goals\", Hash[*args]\n end",
"title": ""
},
{
"docid": "bf42f9d7f1f1e9599a068298954fc117",
"score": "0.5668877",
"text": "def goal_params\n params.require(:goal).permit(:user_id, :name, :description, :amount, :posted, :public, :deleted)\n end",
"title": ""
},
{
"docid": "d4fd6794050befc2a078643f8288a575",
"score": "0.56627697",
"text": "def create\n \n @user.profile = Profile.new(params[:profile])\n if params[:goal_worth]\n @goal = @user.goals.create do |g|\n g.goal_type = \"recurring\"\n g.started_on = Date.today\n g.name = \"What my time is worth\"\n g.goal_amount_score = params[:goal_worth].to_i\n end\n else\n @goal = nil\n end\n \n respond_to do |format|\n \n if @user.profile && @goal\n \n format.html { redirect_to user_profiles_path, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8afa0fb965131812d8a8f0f9634dd963",
"score": "0.565606",
"text": "def create\n @v_goal = VGoal.new(params[:v_goal])\n\n respond_to do |format|\n if @v_goal.save\n format.html { redirect_to @v_goal, notice: 'V goal was successfully created.' }\n format.json { render json: @v_goal, status: :created, location: @v_goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @v_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e41539e4db0e8b3e9a268cd5a67d72d2",
"score": "0.5638954",
"text": "def goal_params\n params.require(:goal).permit(:title, :description, :target_amount, :penalty_amount, :deadline, :user_id, :is_goal_validated, :beneficiary_id)\n end",
"title": ""
},
{
"docid": "3306c2b5028ee2e795f2f4bdbea10211",
"score": "0.5622742",
"text": "def create\n @strategy = Strategy.new(strategy_params)\n @strategy.uuid = SecureRandom.uuid\n authorize @strategy\n\n respond_to do |format|\n if @strategy.save\n team_ids = params[:strategy][:team_ids]\n create_strategy_team(team_ids) if team_ids\n format.html { redirect_to strategies_path}\n format.json { render :show, status: :created, location: strategies_path }\n else\n format.html { render :new }\n format.json { render json: @strategy.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aeeb94c98d722afb917d0ac4e892cd11",
"score": "0.5608568",
"text": "def create\n @goal = current_user.goals.build(params[:goal])\n if @goal.save\n flash[:success] = \"Goal saved successfully\"\n #redirect_to :action => \"index\", :id => current_user.id\n render :partial => \"goal\", :object => @goal\n else\n #redirect_to :action => \"index\", :id => current_user.id\n render :text => @goal.errors.full_messages, :status => 403\n end\n end",
"title": ""
},
{
"docid": "c0b44101450159fe058efdee59dae1ce",
"score": "0.5599571",
"text": "def create\n @longterm_goal = LongtermGoal.new(longterm_goal_params)\n\n respond_to do |format|\n if @longterm_goal.save\n format.html { redirect_to @longterm_goal, notice: 'Longterm goal was successfully created.' }\n format.json { render :show, status: :created, location: @longterm_goal }\n else\n format.html { render :new }\n format.json { render json: @longterm_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6b242a6b2fac24378fabefb7258b64a",
"score": "0.5577558",
"text": "def add datapoints, opts={}\n datapoints = [*datapoints]\n\n datapoints.each do |dp|\n # we grab these datapoints for ourselves\n dp.goal = self\n \n data = {\n \"sendmail\" => opts[:sendmail] || false\n }.merge(dp.to_hash)\n\n # TODO create_all doesn't work because Ruby's POST encoding of arrays is broken.\n @user.post \"users/me/goals/#{@slug}/datapoints.json\", data\n end\n end",
"title": ""
},
{
"docid": "b37c7d463c8da9598a7bd7281126743a",
"score": "0.5567768",
"text": "def create\n @goal_entry = GoalEntry.new(goal_entry_params)\n\n respond_to do |format|\n if @goal_entry.save\n format.html { redirect_to @goal_entry, notice: 'Goal entry was successfully created.' }\n format.json { render action: 'show', status: :created, location: @goal_entry }\n else\n format.html { render action: 'new' }\n format.json { render json: @goal_entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0250273d21f89e2155e11fa802cfd9e4",
"score": "0.5556778",
"text": "def create\n not_regist_palyer_id_when_this_goal_is_your_goal\n @goal = Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to :controller => :games, :action => 'show', \n :id => @goal.game.id, notice: 'Goal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @goal }\n else\n format.html { render action: 'new' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa3364f77e21480b662a282946aa71ee",
"score": "0.55505455",
"text": "def goal_params\n params.require(:goal).permit(:user_id, :goals, :status, :notes)\n end",
"title": ""
},
{
"docid": "91efa7bd04fe782d85d6b580fc1bee60",
"score": "0.55483407",
"text": "def create\n @sale = Sale.new(sale_params)\n\n if @sale.save\n render json: @sale, status: :created, location: @sale\n else\n render json: @sale.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ffae5f2e544b1c887f8115d7863431aa",
"score": "0.5545216",
"text": "def create\n @agency = Agency.new(agency_params)\n\n if @agency.save\n render json: @agency, status: :created, location: @agency\n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "9af83469ad518e2326647da4dbdebbeb",
"score": "0.55401367",
"text": "def create\n @appearance = Appearance.find(params[:appearance_id])\n @goal = @appearance.goals.create(params[:goal])\n @goal.player = @goal.appearance.player\n @goal.team = @goal.appearance.team\n\n respond_to do |format|\n if @goal.save\n flash[:notice] = 'Goal was successfully created.'\n format.html { redirect_to(@goal.appearance) }\n format.xml { render :xml => @goal, :status => :created, :location => @goal }\n format.js {}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @goal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bcdd7431960835b62b3c83605e17272b",
"score": "0.5537255",
"text": "def sleep_goals\n get_json(path_user_version('/sleep/goal'))\n end",
"title": ""
},
{
"docid": "63a51c31a029b773512890898bb7339b",
"score": "0.5529029",
"text": "def create\n @seller = Seller.new(params[:seller])\n\n respond_to do |format|\n if @seller.save\n format.html { redirect_to @seller, :notice => 'Seller was successfully created.' }\n format.json { render :json => @seller, :status => :created, :location => @seller }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @seller.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ec7a08d0bcf381705b681034fe0dd7e6",
"score": "0.5514418",
"text": "def create\n @seller = Seller.new(params[:seller])\n \n respond_to do |format|\n if @seller.save\n format.html { redirect_to @seller, notice: 'Seller was successfully created.' }\n format.json { render json: @seller, status: :created, location: @seller }\n else\n format.html { render action: \"new\" }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8164678ef323afd3f3a0f7193d92815b",
"score": "0.5509201",
"text": "def create\n @goal = Goal.new(goal_params)\n @case = @goal.case\n respond_to do |format|\n if @goal.save\n set_link_to_appointment(@goal)\n format.html { redirect_to back_index_case_url, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "890337e76e80092c9ded85eedff4b3a1",
"score": "0.5489243",
"text": "def new\n @goal = @user.goals.new\n\n if params[:project_id]\n @goal.project_id = params[:project_id]\n @goal.goal_type = \"project-based\"\n end\n \n @goal.started_on = Date.today\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end",
"title": ""
},
{
"docid": "dfa70b16e80423920612ede704d0bff6",
"score": "0.5488348",
"text": "def goal_params\n params.require(:goal).permit(:title, :due_date, :completed)\n end",
"title": ""
},
{
"docid": "cba7aaaca06d804f6b66108013a1b4bd",
"score": "0.54866964",
"text": "def goals_complete\n # goal = Goal.find(params[:id])\n @goals_user = GoalsUser.where(user_id:@user.id).where(goal_id: params[:id])\n @goals_user.map do |goal, index|\n goal.update_attributes(completed_today: true)\n goal.gu_update\n goal.save\n end\n # goals_user.save_all\n update_awards\n respond_to do |f|\n f.html {redirect_to goals_path(@user)}\n f.json {render json: {success: true}}\n end\n\n end",
"title": ""
},
{
"docid": "92c273d17db4697ab21e2bbe1a7a847b",
"score": "0.5486207",
"text": "def goal_params\n params.require(:goal).permit(:name, :deadline, :achievability,\n :measurement, :person_responsible, :achieved, :completed_at,\n :version, :slug)\n end",
"title": ""
},
{
"docid": "505f44057dc5af4280aa90efff1cbeb4",
"score": "0.54837775",
"text": "def goal_params\n params.require(:goal).permit(:name, :team_id, :user_id, :group_id, :parent_id, :deadline, :sdp, :start_date)\n end",
"title": ""
},
{
"docid": "f6e932a3c3bbb38e8e8712698ca4d3c1",
"score": "0.54814017",
"text": "def goal_params\n params.require(:goal).permit(:goalName, :timeFrame, :goalAmount)\n end",
"title": ""
},
{
"docid": "6f75ffd4a6672e64ebcc7475dbf2009e",
"score": "0.5481005",
"text": "def create\n @title = t('view.sellers.new_title')\n @seller = Seller.new(params[:seller])\n\n respond_to do |format|\n if @seller.save\n format.html { redirect_to @seller, notice: t('view.sellers.correctly_created') }\n format.json { render json: @seller, status: :created, location: @seller }\n else\n format.html { render action: 'new' }\n format.json { render json: @seller.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a02ef5b0fcc509c9722a6425785432ea",
"score": "0.54805833",
"text": "def goals\n get(\"/user/#{@user_id}/activities/goals/daily.json\")\n end",
"title": ""
},
{
"docid": "a02ef5b0fcc509c9722a6425785432ea",
"score": "0.5479548",
"text": "def goals\n get(\"/user/#{@user_id}/activities/goals/daily.json\")\n end",
"title": ""
},
{
"docid": "96d352b4fa3bfa011c344dd6b13a8b04",
"score": "0.54630566",
"text": "def goal_params\n params.require(:goal).permit(:description, :done, :current_user, :user_id, :assigned_date, :due_date, :category_id, :category, :schedule, :recurring_rules)\n end",
"title": ""
},
{
"docid": "1dbfd867f20d24eb025a59bbb57624fc",
"score": "0.5457635",
"text": "def create\n @ally = Ally.new(ally_params)\n\n respond_to do |format|\n if @ally.save\n format.html { redirect_to @ally, notice: 'Ally was successfully created.' }\n format.json { render :show, status: :created, location: @ally }\n else\n format.html { render :new }\n format.json { render json: @ally.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a5a54fa0ab742659071410d48fa9445",
"score": "0.54472136",
"text": "def create\n # @seller = Seller.new(seller_params)\n\n # respond_to do |format|\n # if @seller.save\n # format.html { redirect_to sellers_url, notice: \"Seller #{@seller.name} was successfully created.\"}\n # format.json { render action: 'show', status: :created, location: @seller }\n # else\n # format.html { render action: 'new' }\n # format.json { render json: @seller.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "a32253fb453ede3e792cd9cfc8e8b769",
"score": "0.5442845",
"text": "def create\n @goal = Goal.new(goal_params)\n set_owner\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal.parent.nil? ? @goal : @goal.parent, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "35498639eda6fb678573dfb7b2c61078",
"score": "0.54418784",
"text": "def update\n data = {\n \"slug\" => @slug,\n \"title\" => @title,\n \"ephem\" => @ephem || false,\n \"panic\" => @panic || 86400,\n \"secret\" => @secret || false,\n \"datapublic\" => @datapublic || false,\n }\n data['roadall'] = @roadall if @roadall\n\n @user.put_document \"users/me/goals/#{@slug}.json\", data\n end",
"title": ""
},
{
"docid": "236824b5df27f3920140191ab0a18c3c",
"score": "0.5436022",
"text": "def body_goals(goal_type, options = {})\n get_json(path_user_version(\"/body/log/#{goal_type}/goal\", options))\n end",
"title": ""
},
{
"docid": "95f6848bfc681ef983b9902f3303da68",
"score": "0.5435627",
"text": "def new\n @goal = @group.goals.new\n # @goal = Goal.new\n # @goal.group = @group\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end",
"title": ""
},
{
"docid": "16ae68e2c3d2b67a8c1c7fddf0657e9c",
"score": "0.54326516",
"text": "def goal_params\n params.require(:goal).permit(:title, :type_id, :user_id, :value)\n end",
"title": ""
},
{
"docid": "f3a95f605083ef952461becb2418a402",
"score": "0.54303926",
"text": "def create\n @sales_seller = Sales::Seller.new(sales_seller_params)\n\n respond_to do |format|\n if @sales_seller.save\n\n format.html { redirect_to @sales_seller, notice: \"Vendedor adicionado com sucesso!\" }\n format.json { render :show, status: :created, location: @sales_seller }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @sales_seller.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95ff9c264d5450c62b20eca5b14b02a5",
"score": "0.5429377",
"text": "def goal_params\n params.require(:goal).permit(:user_id, :startdate, :enddate, :name, :details, :complete, :completed_at)\n end",
"title": ""
},
{
"docid": "bc3072e32714a53cecd7fda763a8f17d",
"score": "0.5429256",
"text": "def goals_update\n @goal = Goal.find(params[:id])\n goal = GoalsUser.find_or_create_by({user_id:@user.id,goal_id:@goal.id})\n if !goal.active\n goal.update_attribute(\"active\", true)\n end\n update_awards\n respond_to do |f|\n f.html {redirect_to goals_path(@user)}\n f.json {render json: {success: true}}\n end\n end",
"title": ""
},
{
"docid": "7e7d00221c22d84a904e8a842817e808",
"score": "0.54185516",
"text": "def create\n @rally = current_user.rallies.build(rally_params)\n\n respond_to do |format|\n if @rally.save\n format.html { redirect_to @rally, notice: 'Rally was successfully created.' }\n format.json { render :show, status: :created, location: @rally }\n else\n format.html { render :new }\n format.json { render json: @rally.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b21ccb82548e5d048b5c6c50517cb2a",
"score": "0.54183644",
"text": "def create\n @auction = Auction.new(auction_params)\n @auction.seller = @user\n\n if @auction.save\n render json: @auction, status: :created, location: seller_auction_url(@auction)\n else\n render json: @auction.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0499485ccc552d7eba98e11600878b7a",
"score": "0.5403665",
"text": "def create\n @long_term_goal = LongTermGoal.new(params[:long_term_goal])\n\n respond_to do |format|\n if @long_term_goal.save\n format.html { redirect_to(@long_term_goal, :notice => 'Long term goal was successfully created.') }\n format.xml { render :xml => @long_term_goal, :status => :created, :location => @long_term_goal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @long_term_goal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27ea5375dd912583e1e2c5c1f3c06ce9",
"score": "0.53937227",
"text": "def body_goals(user_id: '-', goal_type:)\n return get(\"#{API_URI}/#{BODY_API_VERSION}/user/#{user_id}/body/log/#{goal_type}/goal.json\")\n end",
"title": ""
},
{
"docid": "f3b14c17473eb36a8e96f6885a222bfc",
"score": "0.5393371",
"text": "def goal_params\n params.require(:goal).permit(:name, :sport, :goalType, :goalStartDate, :goalEndDate, :recurringEndDate, :training, :recurring, :goalInterval, :goalNumber, :trainingType, :description, :percentComplete, :trainingTimeInterval, :active, :complete, :parent_id, :user_id, :team_id, :journal_entry_ids => [])\n end",
"title": ""
},
{
"docid": "7584097ab7bea782d0b1ad7c6e80c5e4",
"score": "0.53828096",
"text": "def create\n assessment = Assessment.find(plan_create_params.fetch(:assessment_id))\n disease_ids = plan_create_params.fetch(:disease_ids).to_s.split(\"-\")\n\n if plan_create_params[:indicators].values.map(&:to_i).any?(&:zero?)\n flash[:alert] = \"Every score and goal must be 1 or higher.\"\n return redirect_back fallback_location: root_path\n end\n\n @plan =\n Plan.create_from_goal_form(\n indicator_attrs: plan_create_params.fetch(:indicators),\n assessment: assessment,\n is_5_year_plan: plan_create_params.fetch(:term).start_with?(\"5\"),\n plan_name: \"#{assessment.country.name} draft plan\",\n disease_ids: disease_ids,\n user: current_user\n )\n unless @plan.persisted?\n flash[:notice] = \"Could not save your plan, something went wrong.\"\n redirect_back fallback_location: root_path\n return\n end\n session[:plan_id] = @plan.id unless current_user\n redirect_to @plan\n rescue Exceptions::InvalidDiseasesError => e\n flash[:notice] = e.message\n redirect_back fallback_location: root_path\n end",
"title": ""
},
{
"docid": "2d068631d57ff97c142bcc1ff1552bcb",
"score": "0.5379684",
"text": "def create\n @student_goal_evaluation = StudentGoalEvaluation.new(student_goal_evaluation_params)\n\n respond_to do |format|\n if @student_goal_evaluation.save\n format.html { redirect_to root_path, notice: 'Evalueringen er gemt.' }\n format.json { render :show, status: :created, location: @student_goal_evaluation }\n else\n format.html { render :new }\n format.json { render json: @student_goal_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c9e3033c6d12eb08f1391223f6f202d",
"score": "0.53692126",
"text": "def test_post_shipments\n test_url = \"https://test.panel.olzalogistic.com/api/v1\"\n test_login = 'your test login'\n test_pwd = 'your test password'\n test_language = 'cs'\n\n data = {payload: {shipmentList: [123456]}} #use real Shipment ID\n\n client = OlzaApi::Client.new(test_login, test_pwd, test_url, test_language)\n response = client.post_shipments(data)\n\n assert_instance_of Hash, response\n end",
"title": ""
},
{
"docid": "040b428f2afc75e8262eb06f82c6777f",
"score": "0.53684783",
"text": "def goal_params\n params.require(:goal).permit(:name, :description, :user_id, :fixed, :personal, :start_date, :goal, :sort_order, :priority_id)\n end",
"title": ""
},
{
"docid": "c4e95458f1421ae43d27ab0ab5dfcd09",
"score": "0.536593",
"text": "def create\n @tally = Tally.new(tally_params)\n respond_to do |format|\n if @tally.save\n format.html { redirect_to @tally, notice: 'Tally was successfully created.' }\n format.json { render :show, status: :created, location: @tally }\n else\n format.html { render :new }\n format.json { render json: @tally.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2b8a97c6aad539ec229b72e3d8577ffc",
"score": "0.53622967",
"text": "def change_goals\n User.find_by(id: session[:user_id])\n @client = current_user.fitbit\n\[email protected]_or_update_daily_goal(@opts)\n\trender 'goals'\n end",
"title": ""
},
{
"docid": "eec1c9b63095de6df569f237685923cb",
"score": "0.5361674",
"text": "def create\n @planner = Planner.new(params[:planner])\n\n respond_to do |format|\n if @planner.save\n format.html { redirect_to @planner, notice: 'Planner was successfully created.' }\n format.json { render json: @planner, status: :created, location: @planner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @planner.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f5e32a1a5a61967aa066afec992d51e",
"score": "0.5352913",
"text": "def create\n @goal = current_user.goals.new(goal_params)\n if @goal.category_id == 1 \n @goal.recurring_rules = \"{\\\"interval\\\":1,\\\"until\\\":null,\\\"count\\\":null,\\\"validations\\\":null,\\\"rule_type\\\":\\\"IceCube::DailyRule\\\"}\"\n @goal.due_date = Date.tomorrow \n elsif @goal.category_id == 2\n @goal.recurring_rules = nil\n @goal.assigned_date = @goal.due_date\n elsif @goal.category_id == nil\n @goal.recurring_rules = \"{\\\"interval\\\":1,\\\"until\\\":null,\\\"count\\\":null,\\\"validations\\\":null,\\\"rule_type\\\":\\\"IceCube::DailyRule\\\"}\"\n @goal.due_date = Date.tomorrow \n\n\n\n\n end\n\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to action: \"index\" }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30104e78c139b7629c7f68252bcdf39c",
"score": "0.53478974",
"text": "def create\n @goal_removed = GoalRemoved.new(params[:goal_removed])\n\n respond_to do |format|\n if @goal_removed.save\n flash[:notice] = 'GoalRemoved was successfully created.'\n format.html { redirect_to(@goal_removed) }\n format.xml { render :xml => @goal_removed, :status => :created, :location => @goal_removed }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @goal_removed.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a81c151e573f0020e2a73f78eccbd5d0",
"score": "0.5339328",
"text": "def create\n @agency = Agency.new(agency_params)\n\n if @agency.save\n render json: @agency, status: :created, location: @agency\n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end",
"title": ""
}
] |
0b1b0ba4fa2dd2192e46e2015df6e9c7
|
Get information about loggedin user. The permissions parameter of the NsxRole has been deprecated. Get information about loggedin user. The permissions parameter of the NsxRole has been deprecated.
|
[
{
"docid": "15b40732da3362445d1105847249200f",
"score": "0.0",
"text": "def get_current_user_info_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiAaaApi.get_current_user_info ...'\n end\n # resource path\n local_var_path = '/aaa/user-info'\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 => 'UserInfo')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiAaaApi#get_current_user_info\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "86974926393e4c9b598346561687a695",
"score": "0.706729",
"text": "def get_user_info\n response = send_method(:get_user_info)\n user_from(response)\n end",
"title": ""
},
{
"docid": "0c2e1fb243ef0c2a58078e150424c831",
"score": "0.6808185",
"text": "def info()\n get(:session, {:method => \"user.getInfo\"})\n end",
"title": ""
},
{
"docid": "b870a4cca269b84fb5aadc5d35f0cea8",
"score": "0.65266544",
"text": "def get_user_info\n get(\"/api/v1/oauth_user_info.json\")\n end",
"title": ""
},
{
"docid": "1b9cccf58515bb646ffa45a02fde9d57",
"score": "0.6518151",
"text": "def info()\n _params = {}\n return @master.call 'users/info', _params\n end",
"title": ""
},
{
"docid": "9a14a163e249e986825d4ef39cc27711",
"score": "0.6390446",
"text": "def show\n {\n id: @current_user.id,\n first_name: @current_user.first_name,\n last_name: @current_user.last_name,\n email: @current_user.email,\n role_name: @current_user.super_admin ? 'Super Admin' : @current_user.role.try(:name),\n permissions: Permissions::Builder.user_permissions(@current_user)\n }\n end",
"title": ""
},
{
"docid": "6a7073aa3bc93cbb3184864aab952922",
"score": "0.6321704",
"text": "def user_info\n response = from_server \"api/user.json\"\n response.data\n end",
"title": ""
},
{
"docid": "36e8810c9926e694d8dc200027c1dbaf",
"score": "0.6315893",
"text": "def get_user_info\n userTokenInfo = request.env['oauth.token']\n @user = userTokenInfo.user\n end",
"title": ""
},
{
"docid": "dd2991d9e82b05cf2622cc51dba0ad8f",
"score": "0.63097996",
"text": "def hubssolib_current_user\n hubssolib_get_user_data\n end",
"title": ""
},
{
"docid": "faea54608a62765b780ea2b3401887e4",
"score": "0.6257372",
"text": "def info\n oauth_response = access_token.get \"/api/v1/users/current.json\"\n JSON.parse(oauth_response.body)\n end",
"title": ""
},
{
"docid": "cd6f3187df2f4c00bdf8f113eba7458e",
"score": "0.6223781",
"text": "def get_current_user\n request(Route.new(:GET, '/users/@me'))\n end",
"title": ""
},
{
"docid": "645eb60978251d39278987cc75d7ddac",
"score": "0.6206974",
"text": "def user\n\t\t\treturn nil if ! logged_in?\n\n\t\t\tPicombo::Session.instance.get('user')\n\t\tend",
"title": ""
},
{
"docid": "f09db44c78f8400543610154a0fa768d",
"score": "0.6162697",
"text": "def user()\n return @data[\"access\"][\"user\"]\n end",
"title": ""
},
{
"docid": "5e3f24c3439fc361a8b3ffa25a4d8c44",
"score": "0.61610806",
"text": "def get_current_user_info(opts = {})\n data, _status_code, _headers = get_current_user_info_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "83f22cd27bb0a149ee4962ba0126372c",
"score": "0.6158706",
"text": "def show_current_user\n return \"\" unless logged_in?\n \"User: #{current_user.display_name} - (#{current_user.role.display_name})\"\n end",
"title": ""
},
{
"docid": "5bc057886c0eefefd67c83d73ef6c85a",
"score": "0.6154306",
"text": "def current_user(**args)\n params = parameters(args) do\n optional_params\n end\n request(:get, 'users/me', params)\n end",
"title": ""
},
{
"docid": "1a105b212fe1bc2ee1e3998322ed5d0f",
"score": "0.6079622",
"text": "def userinfo\n if @user.nil?\n nil\n elsif @password.nil?\n @user\n else\n @user + ':' + @password\n end\n end",
"title": ""
},
{
"docid": "e82ed493d33e6ae19d25f2a239b6c783",
"score": "0.6054343",
"text": "def get_user(request, params)\n # --- Get the USER ---\n user = UserOCCI.new(\n User.build_xml(params[:id]),\n @client)\n\n # --- Prepare XML Response ---\n rc = user.info\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return to_occi_xml(user, :code=>200)\n end",
"title": ""
},
{
"docid": "c0636ad024d6cbe86d948b7f805f9114",
"score": "0.60510904",
"text": "def hubssolib_get_user_data\n user = self.hubssolib_current_session ? self.hubssolib_current_session.session_user : nil\n\n if (user && user.user_id)\n return user\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "c5b38f29ef9f156b82201a8ba9a4f714",
"score": "0.60364693",
"text": "def user\n return Etc.getlogin\n end",
"title": ""
},
{
"docid": "399e1492ddb7f09706d2e171ee437a19",
"score": "0.60334396",
"text": "def user_info\n\t\t@user_info ||= fetch_latest_user_info\n\tend",
"title": ""
},
{
"docid": "53c0d93ad9c9f2408861353d93eaf583",
"score": "0.60167885",
"text": "def current_user\n get(\"/v1/users/me\")\n end",
"title": ""
},
{
"docid": "cf17b9be6f147b0f4d76b257c5804c54",
"score": "0.60139364",
"text": "def user_info(access_token:, user_id:)\n query = {\n user: user_id\n }.compact\n response = HTTParty.get(\"https://slack.com/api/users.info\",\n query: query,\n headers: { 'Authorization': \"Bearer #{access_token}\" })\n JSON.parse(response.body, symbolize_names: true)\n end",
"title": ""
},
{
"docid": "7a31b22a6689f803e137e0f689ccae0e",
"score": "0.6000081",
"text": "def getUser\n render json: @current_user, status: 200\n end",
"title": ""
},
{
"docid": "95cbf717d7703f75734f9e969b6487b2",
"score": "0.5995863",
"text": "def user_info\n auth_hash['user_info']\n end",
"title": ""
},
{
"docid": "051bc1f64447b1ee34dfaf4c79960afb",
"score": "0.5965356",
"text": "def user_info\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n\n respond_to do |format|\n name = @current_user.name\n username = @current_user.username\n format.json {\n render json: {\n :name => name,\n :username => username,\n }.to_json, status: 200\n }\n end\n end",
"title": ""
},
{
"docid": "fb7aa68ab2bf6ade5de74d2cb8949dd2",
"score": "0.5947335",
"text": "def get_cur_user\n @user = nil\n if is_logged_in session\n @user = User.find_by_sunet(session[:user_hash][\"username\"])\n end\n render json: @user\n end",
"title": ""
},
{
"docid": "fb7aa68ab2bf6ade5de74d2cb8949dd2",
"score": "0.5947335",
"text": "def get_cur_user\n @user = nil\n if is_logged_in session\n @user = User.find_by_sunet(session[:user_hash][\"username\"])\n end\n render json: @user\n end",
"title": ""
},
{
"docid": "d93cf6abdd38bde9e85aca9816d2c0d3",
"score": "0.5936423",
"text": "def get_current_user_name\n return @name if @name\n name = get_current_user_meta\n name = name['query']['userinfo']['name'] if name\n\n name\n end",
"title": ""
},
{
"docid": "06259a5a2adcb782480f52e10f6f87fc",
"score": "0.59266686",
"text": "def get_connected_user_info\n session[:sos_note_usr_info]\n end",
"title": ""
},
{
"docid": "7c2589657318a4c4a9909b80b9e3fa3a",
"score": "0.5899485",
"text": "def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"title": ""
},
{
"docid": "7c2589657318a4c4a9909b80b9e3fa3a",
"score": "0.5899485",
"text": "def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"title": ""
},
{
"docid": "9f80eca3a6191d8bf42522cf1bbe6772",
"score": "0.5880063",
"text": "def get_user\n @user = current_user\n @is_logged_in = user_signed_in? #true fals\n @is_user = @is_logged_in && @user.role =='user'\n @is_admin = @is_logged_in && @user.role =='admin'\n end",
"title": ""
},
{
"docid": "3cab7d4d66c007c3fd48d5ade302e7bd",
"score": "0.58716685",
"text": "def info(refresh = false)\n return @info if @info and not refresh\n\n begin\n cache_info(nil) # reset existing info\n info = @api.get_account_info['user']\n cache_info(info)\n rescue Api::NotAuthorized, Api::InvalidInput\n nil\n end\n end",
"title": ""
},
{
"docid": "5bea2572e715f32fad55d83281a2bc71",
"score": "0.5870952",
"text": "def user_info\n @user_info ||= raw_info\n end",
"title": ""
},
{
"docid": "a3c6ac75cbda1307ba89015b6724f685",
"score": "0.5861338",
"text": "def get_user_logged_in\n\t\tif current_user != nil\n\t\t\treturn 'Currently signed in as: ' + current_user.forename + ' ' + current_user.surname\n\t\telse\n\t\t\treturn 'You are not logged in!'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7df1ae8750fc398cdf167f8e8cfd752d",
"score": "0.58595324",
"text": "def status_getuser!()\n @status = TAC_PLUS_AUTHEN_STATUS_GETUSER\n end",
"title": ""
},
{
"docid": "381f2a492406c5ec0efa4fa9d2fc4711",
"score": "0.58527166",
"text": "def get_current_user(opts = {})\n data, _status_code, _headers = get_current_user_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "79c0d2b355a17983bbd474e6dc49a625",
"score": "0.5852561",
"text": "def get_user_info user\n unless user.known_user.nil?\n known_user = user.known_user\n is_me = known_user.is_current_user || false\n return is_me ? \"people/me\" : known_user.person_name\n end\n get_one_of user\nend",
"title": ""
},
{
"docid": "d45b2f63488a2865cc3b895393b4fa70",
"score": "0.5851264",
"text": "def get_user_info(user)\n if user.respond_to? :id\n username = Digest::MD5.hexdigest(user.id.to_s)\n else\n username = user\n end\n\n begin\n url = \"#{DOMAIN}/#{ORG}/#{APP}/users/#{username}\"\n response = RestClient.get(url, \"Authorization\" => \"Bearer #{access_token}\", content_type: :json, accept: :json)\n res = JSON.parse(response.body)\n p res[\"entities\"]\n rescue => e\n puts e.response\n end\n end",
"title": ""
},
{
"docid": "6484296abd4cf50c552e3c79b5006f03",
"score": "0.5842367",
"text": "def raw_info\n @raw_info ||= access_token.get('/api/me', :headers => {'Accept' => \"application/json; version=1\" }).parsed['payload']['users'].first || {}\n end",
"title": ""
},
{
"docid": "e5635a72047c8f18bbb49e48dd6bd762",
"score": "0.5835853",
"text": "def get_user_info(user)\n soapmsg = build_soap_envelope do |type, builder|\n if(type == :header)\n else\n builder.GetUserInfo {\n builder.parent.default_namespace = @default_ns\n builder.userLoginName(user)\n }\n end\n end\n soaprsp = Nokogiri::XML(send_soap_request(soapmsg.doc.to_xml))\n ns = {'xmlns' => @default_ns}\n user = soaprsp.xpath('//xmlns:GetUserInfo/xmlns:User', ns).first\n Types::User.new(self,user)\n end",
"title": ""
},
{
"docid": "43ec4f71ac0da8a608872c5608695a86",
"score": "0.5831332",
"text": "def whoami\n if logged_in?\n render :xml => current_user.to_xml(:base_url => request.host_with_port)\n else\n render :nothing => true, :status => 401\n end \n end",
"title": ""
},
{
"docid": "5232a462bb090267bb9164f7edb06ec6",
"score": "0.5827156",
"text": "def current_user\n auth_token = request.headers['HTTP_AUTH_TOKEN']\n puts auth_token\n @current_user ||= User.find_by(auth_token: auth_token)\n #puts @current_user.name + \" is logged in\"\n end",
"title": ""
},
{
"docid": "3ddc27b73efb3f9923d4b016d648b922",
"score": "0.5825832",
"text": "def userinfo\n unless defined?(@userinfo)\n @userinfo = solr_url.userinfo if solr_url\n user = user_configuration_from_key('solr', 'user')\n pass = user_configuration_from_key('solr', 'pass')\n @userinfo ||= [ user, pass ].compact.join(\":\") if user && pass\n @userinfo ||= default_userinfo\n end\n @userinfo\n end",
"title": ""
},
{
"docid": "90cab8c052da50f223dedde6146036d2",
"score": "0.58248407",
"text": "def get(context)\n res = context.transport.get_request(context, 'security/users')\n\n context.err(res.body) unless res.success?\n\n Puppet::Util::Json.load(res.body).map do |user|\n keys_to_snake_case(user.merge({ 'ensure' => 'present' }))\n end\n end",
"title": ""
},
{
"docid": "931f550980fe83a7cf945503ef0c1ec5",
"score": "0.58114207",
"text": "def check\n api.get_user\n end",
"title": ""
},
{
"docid": "2401c0ada550ab6dae685b3824d74b99",
"score": "0.58086485",
"text": "def current_user\n get_from_options_or_controller(:current_user)\n end",
"title": ""
},
{
"docid": "b31056f9c8ffeb86cc6c14d5737d4696",
"score": "0.5804124",
"text": "def get_user\n \n # Retrieve user id if stored in a cookies\n # @TODO Secure ID when stored in cookies\n if cookies[:user]\n return User.find(cookies[:user])\n\n # Retrieve user id if stored in session\n elsif session[:user]\n return User.find(session[:user])\n\n # No user logged in\n else\n return nil\n end\n\n end",
"title": ""
},
{
"docid": "e061df06a4b955af33d24be000c10b21",
"score": "0.5788146",
"text": "def get_user\n unless session[:drupal_user_id].nil?\n uid = session[:drupal_user_id]\n @user = User.find_by_uid(uid)\n end\n\n @user || nil\n end",
"title": ""
},
{
"docid": "63bb9900038e4ad94072d1ca4e13edcf",
"score": "0.5781998",
"text": "def currentUser(extras=nil)\n method = 'currentUser'\n type = User\n args = {}\n args[:extras] = extras if extras\n return_object type,method,args,true\n end",
"title": ""
},
{
"docid": "331390a58f12fc379954854fa0d7d6fc",
"score": "0.57402563",
"text": "def logged_in_user\n if (!logged_in?)\n return User.logged_out_user\n end\n #return nil if !logged_in?\n return session[\"app_user\"]\n end",
"title": ""
},
{
"docid": "a9c48d6b18d51b09e059981563dd946f",
"score": "0.57345474",
"text": "def get_user_from_session\n authorize()\n @user = @current_user\n end",
"title": ""
},
{
"docid": "4a7956cb3aba7525576e3d8d94e1d731",
"score": "0.5726845",
"text": "def get_user\n @user\n end",
"title": ""
},
{
"docid": "4a7956cb3aba7525576e3d8d94e1d731",
"score": "0.5726845",
"text": "def get_user\n @user\n end",
"title": ""
},
{
"docid": "57453ebdaf59bc5041425f79f579d7af",
"score": "0.5709096",
"text": "def getLoggedInUser\n if session[:user_id]\n return User.find(session[:user_id])\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "7bd0670a5169ea9bbca6d5c0fe9e23dd",
"score": "0.5698314",
"text": "def get_role_info()\n make_call(NO_TIMEOUT, ABORT_ON_FAIL) { \n @conn.get_role_info(@secret) \n }\n end",
"title": ""
},
{
"docid": "01fddf05d640fe40b53410742c81bcfe",
"score": "0.56950307",
"text": "def get_user(access_token_str)\r\n @access_token = get_access_token_by(access_token_str)\r\n resp = get_userinfo\r\n case resp\r\n when Net::HTTPSuccess\r\n @userinfo = JSON.parse(resp.body)\r\n parse_user_id(@userinfo)\r\n else\r\n err = \"Can't get user info: <br/>#{resp.body}\"\r\n end\r\n err\r\n end",
"title": ""
},
{
"docid": "ea8998c98f6cb87dd2f3ea0aab1084fa",
"score": "0.5689368",
"text": "def list_current_user\n abort \"You have no current user set!\".yellow unless current_user_exists?\n puts \"\\nCurrent User\"\n config.current_user.each do |k,v|\n if k == 'password'\n puts \"#{k.yellow}: ** HIDDEN **\".yellow\n else\n puts \"#{k.yellow}: #{v}\".yellow unless v.nil?\n end\n end\n end",
"title": ""
},
{
"docid": "32c0cc20cb8ceb5e0e4891592f809a0b",
"score": "0.56785375",
"text": "def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info['query']['results'][\"profile\"]\n end",
"title": ""
},
{
"docid": "76472a2e776650071e437ac9fe613957",
"score": "0.5672816",
"text": "def temporary_logged_in_user\n @logged_in_user\n end",
"title": ""
},
{
"docid": "02705057479c4d321a47d9af410ed5df",
"score": "0.5662201",
"text": "def client_side_current_user\n if session[:user_id]\n User.select([:first_name, :last_name, :email]).find session[:user_id]\n end\n end",
"title": ""
},
{
"docid": "48b40fcdf166b63d0aebcd9e3568b61a",
"score": "0.56521976",
"text": "def current_user\n @current_user ||=\n if security.current_user? || !defined? super\n instance_exec(&security.current_user)\n else\n Logger.deprecated 'Wallaby will use `wallaby_user` instead of `current_user` from 6.2.'\n super\n end\n end",
"title": ""
},
{
"docid": "0b53b78fde4cca9b9eb436a24bf4b07c",
"score": "0.56516236",
"text": "def current_user\n User.get_user(session[:user_id]) if session[:user_id]\n end",
"title": ""
},
{
"docid": "b1cda370e065ac3dec4735e7d9956cc6",
"score": "0.56505024",
"text": "def getUser login\n return false if !@usrData\n @usrData[login]\n end",
"title": ""
},
{
"docid": "25e61da40907af570052cb6d7e44ffa4",
"score": "0.564316",
"text": "def get_logged_in_user\n if logged_in?\n user = User.find(session[:current_user_id])\n if user\n return user\n else\n return nil\n end\n end\n \n #default return nil\n nil\n end",
"title": ""
},
{
"docid": "f99722288a7e6d258ab32b2f13eff918",
"score": "0.5642008",
"text": "def get_current_user\n @user = User.find(params[:user_id])\n # @user = current_user\n end",
"title": ""
},
{
"docid": "bf73c8257846d21545c14b4aefe390a1",
"score": "0.5639118",
"text": "def list_current_users *args\r\n puts \"not implemented yet\"\r\n end",
"title": ""
},
{
"docid": "e084cb1ee22960c618bde803cc5e32b7",
"score": "0.56384075",
"text": "def get_user_details\n\t\tid = params[:id]\n\t\tTheCityAdmin::AdminApi.connect(Rcplugin::CITY_ADMIN_SECRET,Rcplugin::CITY_USER_TOKEN)\n\t\t@user = TheCityAdmin::User.load_by_id(id)\n\tend",
"title": ""
},
{
"docid": "083e35cbc5c106119377a9f0124a9ccb",
"score": "0.5635657",
"text": "def users_with_permissions()\n\t return LiveStreamSeriesPermission.where(:live_stream_series_id => self.id).collect{|p| p.user}\n end",
"title": ""
},
{
"docid": "2b23aa598930de02f93a9be28057ba1a",
"score": "0.5629636",
"text": "def logged_in_user\n return nil if !logged_in?\n return session[\"app_user\"]\n end",
"title": ""
},
{
"docid": "e41a07ab73e142dae7390d268ab8b032",
"score": "0.562946",
"text": "def get_user_info(*fields)\n str_fields = fields.map(&:to_s).join(',')\n url = GRAPH_URL + @user.id + '?fields=' + str_fields + '&access_token=' +\n ENV['ACCESS_TOKEN']\n begin\n return call_graph_api(url)\n rescue => e\n return false\n end\n end",
"title": ""
},
{
"docid": "ec7b7132587a0316cfd8bd2e0e147166",
"score": "0.5629275",
"text": "def get_logged_user()\n begin\n #logger.warn \"session[:logged_user_id]=#{session[:logged_user_id].inspect}\"\n if session[:logged_user_id]\n @current_user ||= User.find(session[:logged_user_id])\n end\n rescue\n logger.warn \"Oups I'can't find user with id=#{session[:logged_user_id].inspect}\"\n nil\n end\n end",
"title": ""
},
{
"docid": "ce5db8792193b8ce1916cae9a8fc088d",
"score": "0.5623227",
"text": "def current_user\n user_id = get_log_in_session\n if user_id\n get_user(user_id)\n else\n user = get_user(cookies.signed['user_id'])\n if user&.authenticated?(:remember, cookies[:remember_token])\n set_log_in_session user\n user\n end\n end\n end",
"title": ""
},
{
"docid": "773f96ed0768f276e28bd9829a1e0c5b",
"score": "0.5619667",
"text": "def show\n @client = basic_connect\n @user_info = @client.user_info['user']\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_token }\n end\n end",
"title": ""
},
{
"docid": "801372e85bfcad35d13157d9dda0af68",
"score": "0.56113845",
"text": "def current_user\n User.find_by(uid: session[:user]) if logged_in?\n end",
"title": ""
},
{
"docid": "7c88ad59a77013401543d8d09ac7b6de",
"score": "0.56109565",
"text": "def current_user\n User.find_by_netid session[:cas_user] if User.find_by_netid session[:cas_user]\n end",
"title": ""
},
{
"docid": "e20a57eb99b28c96ca28884557e5f1a8",
"score": "0.560987",
"text": "def current_user\n user = FastlaneCI::Services.user_service.find_user(id: env[:user])\n if user.nil?\n halt 500\n else\n return user\n end\n end",
"title": ""
},
{
"docid": "7d55b6a507750128a143f7099922ec54",
"score": "0.56082535",
"text": "def current_user\n current_user_for_profile_management\n end",
"title": ""
},
{
"docid": "cadca9adb97e5a322e5c22aebc6bff42",
"score": "0.56073695",
"text": "def get_user_name client, event\n # calls users_info on slack\n info = client.users_info(user: event.user_id ) \n info['user']['name']\n end",
"title": ""
},
{
"docid": "9a16602ea23a449ee06d9626ada84169",
"score": "0.56066483",
"text": "def current_user\n session[:name] #all i need here (looked at some other solutions to get this)\n end",
"title": ""
},
{
"docid": "3625b98cc9ac600a82af3655d485852c",
"score": "0.5605006",
"text": "def current_user\n session[:usr_id]\n end",
"title": ""
},
{
"docid": "ef14a7005ca9b58c928b8aab42f8bbb6",
"score": "0.560475",
"text": "def get_user(username)\n Chef::Log.info username\n user = @node[:users][username]\n Chef::Log.info user.inspect\n user\nend",
"title": ""
},
{
"docid": "0561ad2908807b0a1964809ef7fb271d",
"score": "0.5603316",
"text": "def user_information\n { \"username\": @user.username, \"email\": @user.email, \"id\": @user.id }\n end",
"title": ""
},
{
"docid": "57352b8e5264981a4b5526611087b4df",
"score": "0.560046",
"text": "def current_user_info\n\t\trespond_to do |format|\n\t\t\tif !current_user\n\t\t\t\tformat.json { render json: { 'User' => 'not logged in' } }\n\t\t\telse\n\t\t\t\tformat.json { render json: { 'Name' => current_user.name, 'Image' => getFacebookPicURL(current_user) } }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "e46cd8e9fcd4e129e3ad7b0807dcc254",
"score": "0.55977196",
"text": "def getUser()\n\t\treturn @user\n\tend",
"title": ""
},
{
"docid": "11fbf5cfbf77e0a16fa0e335d8fad490",
"score": "0.5585057",
"text": "def current_user\n\n sql = \"SELECT * FROM users WHERE id = $1;\"\n \n results = run_sql(sql, [session[:user_id]]) \n return results.first\n end",
"title": ""
},
{
"docid": "f26e97f17e4688fa5700b482c80573bf",
"score": "0.55823696",
"text": "def user\n {user_id: self.object.user.id,\n user_name: self.object.user.name\n }\n end",
"title": ""
},
{
"docid": "927f08a3456d6f6c3191a8b353b48532",
"score": "0.55798703",
"text": "def get_current_user\n if session[:user_id].blank?\n redirect_to :login\n else\n @current_user = User.find(session[:user_id])\n end\n end",
"title": ""
},
{
"docid": "d9110b1cdc249c7059bcc59eacf49e48",
"score": "0.5576281",
"text": "def user_details(login, authenticated = false)\n result = nil\n if authenticated\n auth_connection(HTTP_GET, \"/api/users/#{login}.xml\") do |xml|\n result = User.new xml\n end\n else\n public_connection(HTTP_GET, \"/api/users/#{login}.xml\") do |xml|\n result = User.new xml\n end\n end\n result\n end",
"title": ""
},
{
"docid": "ea8ccf6b93724d0e75101c46ea744ca5",
"score": "0.55757207",
"text": "def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info\n end",
"title": ""
},
{
"docid": "ea8ccf6b93724d0e75101c46ea744ca5",
"score": "0.55757207",
"text": "def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info\n end",
"title": ""
},
{
"docid": "3262fcc53c6079ba6d96ac34ab6d4723",
"score": "0.55740654",
"text": "def user\r\n return for_context(nil, false) { |c| c.user }\r\n end",
"title": ""
},
{
"docid": "441215b2a59c40e67ff3b2c8d9ea78db",
"score": "0.5573791",
"text": "def show\n @user = User.find(params[:id]) \n @user_me = retrieve_authenticated_user\n end",
"title": ""
},
{
"docid": "6e53f08817d8c955e321ac19c2875c2b",
"score": "0.557064",
"text": "def whoami\n result = nil\n auth_connection(HTTP_GET, '/api/test/whoami') do |xml|\n doc = REXML::Document.new xml\n result = doc.elements['vzaar-api/test/login'].text\n end\n result\n end",
"title": ""
},
{
"docid": "1ea0353eafee32a39e82e5337281ffcb",
"score": "0.55704397",
"text": "def hubssolib_get_user_name\n user = self.hubssolib_current_user\n user ? user.user_real_name : nil\n end",
"title": ""
},
{
"docid": "680a4b20c94a854112a11979299c2ebd",
"score": "0.5565699",
"text": "def current_user\n if decoded_token\n user_id = decoded_token[0]['user_id']\n @user = User.find_by(id: user_id)\n # Returns nil if not found\n end\n end",
"title": ""
},
{
"docid": "6aedaa38808164974924b16904087a70",
"score": "0.5562245",
"text": "def get_user_name(role)\n get_user(role).full_name\n end",
"title": ""
},
{
"docid": "6fb3c3d3719d4100c7fb02da7e2d8438",
"score": "0.5558347",
"text": "def user_data\n User.user_data login\n end",
"title": ""
},
{
"docid": "23cec5e40251bd4ea7bb5cc72cede2bb",
"score": "0.55565315",
"text": "def get_user_name client, event\n # calls users_info on slack\n info = client.users_info(user: event.user_id )\n info['user']['name']\n end",
"title": ""
},
{
"docid": "28591b42f8c5481fae3e2e4090ff8e26",
"score": "0.55559653",
"text": "def show\n r = @api.get_user(params[:id])\n response = JSON.parse(r.body)\n if r.code == 200\n @user = response\n else\n redirect_to login_sign_in_admin_path, alert: response['message']\n end\n end",
"title": ""
},
{
"docid": "969c89ea348bc687dc5433636517fcae",
"score": "0.5555964",
"text": "def get_user\n return if @user # no extra http calls\n url = URI.escape(\"#{@options[:cas_server]}/#{@options[:uid]}.#{@options[:format]}\")\n response = Casport.get(url)\n if response.success?\n @user = response.parsed_response\n else\n @user = nil\n end\n end",
"title": ""
}
] |
c75a8544986d53d318c5e6c957cff412
|
GET /rewards/1 GET /rewards/1.json
|
[
{
"docid": "b83568c1af52e5fa08ad1f04efe20be1",
"score": "0.7137614",
"text": "def show\n @reward = Reward.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
}
] |
[
{
"docid": "020aef71b87f0ddcd0322c32ab233f7c",
"score": "0.7578631",
"text": "def show\n @reward = current_user.rewards.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "6be241587a3edce6f7f34238ee73c42f",
"score": "0.73861104",
"text": "def index\n\n @rewards = Reward.all\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rewards }\n end\n end",
"title": ""
},
{
"docid": "032d96e34b34f50094826cccb00edba3",
"score": "0.7248104",
"text": "def index\n @api_v1_user_rewards = Api::V1::UserReward.all\n end",
"title": ""
},
{
"docid": "215a3f46f847b283ff86217069d63e5f",
"score": "0.71138495",
"text": "def show\n @reward = Reward.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @reward }\n end\n end",
"title": ""
},
{
"docid": "b517888ab9b853afabeb2c5624d86797",
"score": "0.711027",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "307fbdfc6ef4aa4832f7e209403bc5a1",
"score": "0.71069026",
"text": "def won_rewards(options={})\n response = connection.get do |req|\n req.url \"won_rewards\", options\n end\n return_error_or_body(response)\n end",
"title": ""
},
{
"docid": "0a4675b760f9156f36b4156291104964",
"score": "0.7088474",
"text": "def index\n if user_signed_in?\n @rewards = current_user.rewards.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rewards }\n end\n end\n end",
"title": ""
},
{
"docid": "ca58c427c425a36d28503f0bc8c154eb",
"score": "0.7082387",
"text": "def index\n @rewards = Reward.all\n end",
"title": ""
},
{
"docid": "ca58c427c425a36d28503f0bc8c154eb",
"score": "0.7082387",
"text": "def index\n @rewards = Reward.all\n end",
"title": ""
},
{
"docid": "ca58c427c425a36d28503f0bc8c154eb",
"score": "0.7082387",
"text": "def index\n @rewards = Reward.all\n end",
"title": ""
},
{
"docid": "4708b8b7571acb9e3c618b18ab4d7c07",
"score": "0.70764136",
"text": "def get_reward(options={})\n # make the GET call\n path = '/reward'\n\n options.merge!({:access_token => @access_token})\n raw_response = Punchtab::API.get(path, :query => options)\n Punchtab::Utils.process_response(raw_response)\n end",
"title": ""
},
{
"docid": "93398ce28c437d541858c5d2adecec0f",
"score": "0.7067909",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rewards }\n end\n end",
"title": ""
},
{
"docid": "93398ce28c437d541858c5d2adecec0f",
"score": "0.7067909",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rewards }\n end\n end",
"title": ""
},
{
"docid": "ed1039f535b92c8b3f637ff6eb233f33",
"score": "0.7062622",
"text": "def rewards(type=nil)\n if type.nil?\n results = self.class.get(\"/rewards/search\", :body => {:client_key => CLIENT_KEY})\n else\n results = self.class.get(\"/rewards/search?type=type\", :body => {:client_key => CLIENT_KEY})\n end\n results.collect{|r| Hashie::Mash.new(r['reward'])}\n end",
"title": ""
},
{
"docid": "af6f6b7fe422ba9225414624d6fc362c",
"score": "0.7012451",
"text": "def new\n @reward = current_user.rewards.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "cffa74e49f9e7bc99eb237ce6bc4155c",
"score": "0.692406",
"text": "def show\n @fund_reward = FundReward.find(params[:id])\n\n render json: @fund_reward\n end",
"title": ""
},
{
"docid": "f9e3b2d50223773485d464ef9e5ebbdc",
"score": "0.6816885",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "53ba1f5878647eeadbbbd7c4bba36cdd",
"score": "0.6775032",
"text": "def index\n @tournament_rewards = TournamentReward.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tournament_rewards }\n end\n end",
"title": ""
},
{
"docid": "0084e5aa9c7d0a7a23c0138cc8e89b1a",
"score": "0.6735693",
"text": "def show(reward_id)\r\n\r\n # Validate required parameters\r\n if reward_id == nil\r\n raise ArgumentError.new \"Required parameter 'reward_id' cannot be nil.\"\r\n end\r\n\r\n # the base uri for api requests\r\n _query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n _query_builder << '/rewards/{reward_id}'\r\n\r\n # process optional query parameters\r\n _query_builder = APIHelper.append_url_with_template_parameters _query_builder, {\r\n 'reward_id' => reward_id\r\n }\r\n\r\n # validate and preprocess url\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'Authorization' => 'Bearer %s' % (Configuration.o_auth_access_token)\r\n }\r\n\r\n # Create the HttpRequest object for the call\r\n _request = @http_client.get _query_url, headers: _headers\r\n\r\n # Call the on_before_request callback\r\n @http_call_back.on_before_request(_request) if @http_call_back\r\n\r\n # Invoke the API call and get the response\r\n _response = @http_client.execute_as_string(_request)\r\n\r\n # Wrap the request and response in an HttpContext object\r\n _context = HttpContext.new(_request, _response)\r\n\r\n # Call the on_after_response callback\r\n @http_call_back.on_after_response(_context) if @http_call_back\r\n\r\n # Global error handling using HTTP status codes.\r\n validate_response(_context)\r\n\r\n # Return appropriate response type\r\n decoded = APIHelper.json_deserialize(_response.raw_body) if not (_response.raw_body.nil? or _response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end",
"title": ""
},
{
"docid": "9c01404891d814bf101143823513b446",
"score": "0.66227573",
"text": "def index\n @user_rewards = UserReward.all\n end",
"title": ""
},
{
"docid": "cb2a9500ab1ec10a40dd8a0f614a8b2d",
"score": "0.6619937",
"text": "def index\n @scratch_card_rewards = ScratchCardReward.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @scratch_card_rewards }\n end\n end",
"title": ""
},
{
"docid": "04fc004e665ce33e3c9cca5f46e30802",
"score": "0.66012055",
"text": "def show\n @project = Project.find(params[:id])\n @rewards = @project.rewards.includes(:pledges, :backers)\n end",
"title": ""
},
{
"docid": "4b30b50af6ac74d72ba437f9b690b2d9",
"score": "0.6600496",
"text": "def new\n @reward = Reward.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "d175ad766242a3bb8990a85e4a619563",
"score": "0.6542081",
"text": "def index\n @api_v1_reward_actions = Api::V1::RewardAction.all\n end",
"title": ""
},
{
"docid": "deb5f667074c7b6a501f4cce38611322",
"score": "0.6509277",
"text": "def new\n @reward = Reward.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "7bf7093ce47b224c7c88c8dde3dcda50",
"score": "0.6496785",
"text": "def residual_bonus\n render json: {\n rewards: @current_user.rewards.where(reward_type_id:15).order(created_at: :desc).map { |x| referral_filter(x) }.compact\n }\n end",
"title": ""
},
{
"docid": "2b443747948d5ef5a68c185db0b1c751",
"score": "0.6404063",
"text": "def show\n @ca_reward = CaReward.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ca_reward }\n end\n end",
"title": ""
},
{
"docid": "34c19b89788d3710c0fddc06cc97fdbc",
"score": "0.63801605",
"text": "def index\n if @user\n @rewards = Reward.where(enabled: true)\n render :json => {rewards:@rewards,hearts:@user.hearts}.to_json\n else \n render text: \"Token failed verification\", status: 422\n end\n end",
"title": ""
},
{
"docid": "583f16c00c15becc0c246375ec9da341",
"score": "0.6355282",
"text": "def rewards\n if @subscriptions.any? && account_qualified?\n @reward_repository.rewards_for(@subscriptions)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "e0b7e964380a16c2d48db247861f7400",
"score": "0.62985766",
"text": "def destroy\n @reward = current_user.rewards.find(params[:id])\n @reward.destroy\n\n respond_to do |format|\n format.html { redirect_to rewards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1e4c4abf7ad07c7934125f00018b3d7b",
"score": "0.6297937",
"text": "def index\n @rewards = Reward.order(\"name\")\n\t@fraction = ''\n\t@quantity = 1\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rewards }\n end\n end",
"title": ""
},
{
"docid": "9251b3955e3c45111e2f17885407937e",
"score": "0.6274465",
"text": "def blocks_get_reward\n reward = @client.query_get \"blocks/getReward\"\n end",
"title": ""
},
{
"docid": "1c81b025f316d88fe6ec286f05b5d54a",
"score": "0.62627",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tournament_reward }\n end\n end",
"title": ""
},
{
"docid": "616fd6a04cd4383e9abd343dbd522950",
"score": "0.6249815",
"text": "def show\n authorize :reminder, :show?\n\n respond_to do |format|\n format.html\n format.json { render :json => @reward, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "6d4b87f06b4a6cd4751ff6046613a753",
"score": "0.62375087",
"text": "def retrieve_loyalty_reward(reward_id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/loyalty/rewards/{reward_id}',\n 'default')\n .template_param(new_parameter(reward_id, key: 'reward_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'accept'))\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": "03bc60ace3a266def391fc178c754f7d",
"score": "0.6232015",
"text": "def show\n @reward_type = RewardType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @reward_type }\n end\n end",
"title": ""
},
{
"docid": "3526af056769cc25330ad4e79de87680",
"score": "0.6218401",
"text": "def show\n @history = RewardHistory.find_by_id(params[:id])\n if (@history)\n Rabl.render(@history, 'api/reward_histories/show', view_path: 'app/views')\n else\n render status: 401, json: {error: \"Invalid account\"}\n end\n end",
"title": ""
},
{
"docid": "68ab0f74c39973eeee1ce588b2af872d",
"score": "0.619901",
"text": "def show\n \n @current_date = DateTime.now\n @skills = Skill.all\n @request_selection = RequestSelection.find(params[:request_selection_id])\n \n \n @reward = Reward.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "573804e73d6cf5f6165d640e9e9ab9f0",
"score": "0.61810046",
"text": "def rewards\n\t\t\tcustomer = Customer.find([:customer_id])\n\t\t\t@rewards = Reward.get_reward_for_category(customer.rewards, params[:customer][:reward_category])\n\t\tend",
"title": ""
},
{
"docid": "0515456e20a6179a1a1296d01223c308",
"score": "0.6174161",
"text": "def update\n @reward = current_user.rewards.find(params[:id])\n\n respond_to do |format|\n if @reward.update_attributes(rewards_params)\n format.html { redirect_to @reward, notice: 'Reward was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reward.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2443db81a40172c30f3cf51e2a36b51b",
"score": "0.61685216",
"text": "def destroy\n @reward = Reward.find(params[:id])\n @reward.destroy\n\n respond_to do |format|\n format.html { redirect_to rewards_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "59456ff433ab55abed81f1b2947fc248",
"score": "0.615242",
"text": "def rewards\n case @name\n when \"wood\"\n if (@current > 200 && @rewarded == 0)\n @rewarded = 1\n return [Resource.new(\"stone\", 200, 1, 5)]\n elsif (@current > 500 && @rewarded == 1)\n @rewarded = 2\n return [Resource.new(\"iron\", 100, 0.2, 0)]\n end\n when \"iron\"\n if (@current > 100 && @rewarded == 0)\n @rewarded = 1\n return [Resource.new(\"oil\", 100, 0.2, 0)]\n end\n end\n return []\n end",
"title": ""
},
{
"docid": "1f87584374fbf7ec9f8f98fbdd4c9ae5",
"score": "0.6138027",
"text": "def rewards\n card.rewards.order(record_date: :asc)\n end",
"title": ""
},
{
"docid": "8c5355b2f232da0eb547d98259f809cb",
"score": "0.6135628",
"text": "def index\n @rewards_pals = RewardsPal.all\n \n end",
"title": ""
},
{
"docid": "a5ca7f67996029ceeaf7af2488d37a26",
"score": "0.61334753",
"text": "def child_rewards\n @rewards = Child.find(params[:id]).rewards\n package = []\n @rewards.each do |reward|\n package.push({date: reward.date})\n end\n render json: package\n end",
"title": ""
},
{
"docid": "7a02fee11d62a308ef300ce9bb439e69",
"score": "0.6132698",
"text": "def create\n @reward = current_user.rewards.new(params[:reward])\n\n respond_to do |format|\n if @reward.save\n format.html { redirect_to @reward, notice: 'Reward was successfully created.' }\n format.json { render json: @reward, status: :created, location: @reward }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reward.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "288b7a8ad92bdef65b4399e860871d30",
"score": "0.61237967",
"text": "def reward_for rewardable\n rewards.find_by rewardable: rewardable\n end",
"title": ""
},
{
"docid": "8093538bb10214091b3c2dc7dba08f7e",
"score": "0.6120363",
"text": "def destroy\n @reward = Reward.find(params[:id])\n @reward.destroy\n\n respond_to do |format|\n format.html { redirect_to rewards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8093538bb10214091b3c2dc7dba08f7e",
"score": "0.6119771",
"text": "def destroy\n @reward = Reward.find(params[:id])\n @reward.destroy\n\n respond_to do |format|\n format.html { redirect_to rewards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9d11c36e8e93e6261822c6ea1fd5e057",
"score": "0.6106379",
"text": "def retract_won_reward(id)\n response = connection.post(\"won_rewards/#{id}/retract\")\n return_error_or_body(response)\n end",
"title": ""
},
{
"docid": "abd29442d103db24c56218a131600c41",
"score": "0.60584706",
"text": "def set_api_v1_user_reward\n @api_v1_user_reward = Api::V1::UserReward.find(params[:id])\n end",
"title": ""
},
{
"docid": "2a037e170db4b32327eaec9f7ab9f639",
"score": "0.6042354",
"text": "def set_reward\n @reward = Reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "9b64e1b5c329341b672800f81cd996e6",
"score": "0.6037275",
"text": "def set_api_v1_reward_action\n @api_v1_reward_action = Api::V1::RewardAction.find(params[:id])\n end",
"title": ""
},
{
"docid": "2ad0452fe0911ddbaaaeaaea2608c9df",
"score": "0.60212934",
"text": "def index\n rewards = []; image_url = \"\"\n Reward.all.each do |reward|\n image_url = url_for(reward.image) if reward.image.attached?\n rewards << { id: reward.id, title: reward.title, category: reward.category, image: image_url }\n end\n render json: rewards, status => 200\n rescue StandardError => e # rescu if any exception occure\n render json: { message: \"Error: Something went wrong... \" }, status: :bad_request\n end",
"title": ""
},
{
"docid": "a16648c8c1a72f1dec8df80b26631abd",
"score": "0.6007308",
"text": "def set_reward\n @reward = Reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "a16648c8c1a72f1dec8df80b26631abd",
"score": "0.6007308",
"text": "def set_reward\n @reward = Reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "a16648c8c1a72f1dec8df80b26631abd",
"score": "0.6007308",
"text": "def set_reward\n @reward = Reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "a16648c8c1a72f1dec8df80b26631abd",
"score": "0.6007308",
"text": "def set_reward\n @reward = Reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "a16648c8c1a72f1dec8df80b26631abd",
"score": "0.6007308",
"text": "def set_reward\n @reward = Reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "a16648c8c1a72f1dec8df80b26631abd",
"score": "0.6007308",
"text": "def set_reward\n @reward = Reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "f3f1bc7dd9169179493d3c1f2e2fc58e",
"score": "0.6001908",
"text": "def list_rewards\n Beintoo::Vgood.showbyuser(self)\n end",
"title": ""
},
{
"docid": "36e393ed48288c353c75ebbc8d5ae8f0",
"score": "0.5974196",
"text": "def new\n @reward = @restaurant.rewards.build\n @reward.share_link = SecureRandom.hex(5)\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "2852b4b220d57a2bc3d041d00241f9c8",
"score": "0.59734213",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @scratch_card_reward }\n end\n end",
"title": ""
},
{
"docid": "c79a43374675f4fb3e2f038b959a4657",
"score": "0.59705436",
"text": "def set_reward\n @reward = Reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "a0be0e60a6226f7f748ca1a9601944bb",
"score": "0.5965608",
"text": "def set_reward\n @reward = Reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "b04c8ccee9dce2cdee02829d8848ca66",
"score": "0.59575105",
"text": "def show\n if @user\n render :json => @reward.as_json.merge({:hearts => @user.hearts})\n else \n render text: \"Token failed verification\", status: 422\n end\n end",
"title": ""
},
{
"docid": "9f7dedbc95fad619a0cfe3e46e99e453",
"score": "0.595384",
"text": "def draw_rewards\n y = @objective_bot_y\n unless QuestData::VOCAB[:rewards].empty?\n draw_heading(:rewards, y)\n y += line_height\n end\n for i in [email protected] do draw_reward(i, y + i*line_height) end\n end",
"title": ""
},
{
"docid": "944665056bf115d101c53f27953a2f78",
"score": "0.59315425",
"text": "def new\n @ca_reward = CaReward.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ca_reward }\n end\n end",
"title": ""
},
{
"docid": "1a811098f12422bd56e12be80de1747f",
"score": "0.5908517",
"text": "def show\n\t\t@rewards = current_user.rewards.order(created_at: :desc)\n\t\t@total_points = current_user.total_points\n\tend",
"title": ""
},
{
"docid": "ed94b41ef3bfcbf56eb2a90200831875",
"score": "0.5881942",
"text": "def show\n @reward = params[:reward]\n @balance = get_balance @player\n @unconfirmed_balance = get_unconfirmed_balance @player\n end",
"title": ""
},
{
"docid": "d0347a24edf1f6d940018b471c0248f2",
"score": "0.5862634",
"text": "def new\n @reward = Reward.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reward }\n end\n end",
"title": ""
},
{
"docid": "a9cdca93205cf5bd88664b48177d4569",
"score": "0.58431923",
"text": "def new\n @reward_type = RewardType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reward_type }\n end\n end",
"title": ""
},
{
"docid": "754bd7eb95ccbdc4c350335c05a6ace2",
"score": "0.5827408",
"text": "def new\n @reward = Reward.new\n @point_kinds = PointKind.all.collect {|p| [p.name, p.id] }\n @users = User.all.collect {|p| [p.login, p.id] }\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @reward }\n end\n end",
"title": ""
},
{
"docid": "ad9bfb0be75f0290e2d8178fb6dc905f",
"score": "0.5821755",
"text": "def referrals\n render json: {\n rewards: @current_user.rewards.where(reward_type_id:12).order(created_at: :desc).map { |x| referral_filter(x) }.compact,\n counter: User.all.where(sponsor_uuid: @current_user.uuid).count\n }\n end",
"title": ""
},
{
"docid": "debf1ff585372c2c3bfdb79d0be70d3b",
"score": "0.5814131",
"text": "def show\n @award = Award.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @award }\n end\n end",
"title": ""
},
{
"docid": "b427e83f4594781f5290569bfba54851",
"score": "0.58105254",
"text": "def set_reward\n @reward = reward.find(params[:id])\n end",
"title": ""
},
{
"docid": "c90a0e09e7794fa375de1fdafeaba97e",
"score": "0.58003396",
"text": "def draw_reward(r_id, y)\n reward = @quest.rewards[r_id]\n case reward[0]\n when :item, 0 # Item\n draw_item_reward(y, $data_items[reward[1]], reward[2] ? reward[2] : 1)\n when :weapon, 1 # Weapon\n draw_item_reward(y, $data_weapons[reward[1]], reward[2] ? reward[2] : 1)\n when :armor, 2 # Armor\n draw_item_reward(y, $data_armors[reward[1]], reward[2] ? reward[2] : 1)\n when :gold, 3 # Gold\n draw_basic_data(y, QuestData::ICONS[:reward_gold], \n QuestData::VOCAB[:reward_gold], (reward[1] ? reward[1] : 0).to_s)\n when :exp, 4 # Exp\n draw_basic_data(y, QuestData::ICONS[:reward_exp], \n QuestData::VOCAB[:reward_exp], (reward[1] ? reward[1] : 0).to_s)\n when :string, 5 # String\n draw_basic_data(y, reward[1] ? reward[1] : 0, reward[3] ? reward[3].to_s : \"\", \n reward[2] ? reward[2].to_s : \"\")\n end\n end",
"title": ""
},
{
"docid": "d5412ffe2414fb100e82152c52f6662d",
"score": "0.5796278",
"text": "def update\n @reward = Reward.find(params[:id])\n\n respond_to do |format|\n if @reward.update_attributes(params[:reward])\n format.html { redirect_to @reward, :notice => 'Reward was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @reward.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "882f7e5f51e4fb6e325c8a054e279a05",
"score": "0.5792551",
"text": "def index\n @reward_types = RewardType.all\n end",
"title": ""
},
{
"docid": "1d06e84cc41526d2433a9a1dd663a785",
"score": "0.57907575",
"text": "def destroy\n @reward.destroy\n respond_to do |format|\n format.html { redirect_to admin_rewards_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5afafd13be1b54b7680e08fdcd63c27e",
"score": "0.5782029",
"text": "def new\n @reward = Reward.new\n @rewardID = 'new'\n @total_donation = Pledger.find(params[:pledger_id])\n .total_donation(current_user == User.where(\"username = 'dd'\")[0])\n respond_to do |format|\n format.html { render layout: !request.xhr? }\n format.json { render json: @reward }\n end\n end",
"title": ""
},
{
"docid": "4fe955f3dc47c0e6d8966b59adf9d329",
"score": "0.57816637",
"text": "def destroy\n @reward = Reward.find(params[:id])\n @reward.destroy\n\n respond_to do |format|\n format.html { redirect_to(rewards_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a2deff255c2522cd43d8cc91e0d9ebc0",
"score": "0.575382",
"text": "def index\n @reward_tiers = RewardTier.all\n end",
"title": ""
},
{
"docid": "c24f36a5cb4132f0a226f42f98d3e983",
"score": "0.57430303",
"text": "def index\n @reward_orders = RewardOrder.all\n end",
"title": ""
},
{
"docid": "dbd830e68833707e3e3f24693a4e7b5f",
"score": "0.56995624",
"text": "def new\n @appeal = Appeal.new\n @rewards = 2.times {@appeal.rewards.build}\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appeal }\n end\n end",
"title": ""
},
{
"docid": "fa68bb3d92a85836b1d992510f58dd27",
"score": "0.56801873",
"text": "def show\n @worth = Worth.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @worth }\n end\n end",
"title": ""
},
{
"docid": "c21d650a7573931c57a5c6731bd5f200",
"score": "0.5665204",
"text": "def index\n @earned_rewards_joins = EarnedRewardsJoin.all\n end",
"title": ""
},
{
"docid": "068d736c59d3dd2af159e121cc2c0cda",
"score": "0.5651523",
"text": "def show\n @award = @student.awards.find(params[:id])\n # was Award.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @award }\n end\n end",
"title": ""
},
{
"docid": "7584cc83750a3e7fa47386e36063e39a",
"score": "0.5648412",
"text": "def show\n @player_award = PlayerAward.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_award }\n end\n end",
"title": ""
},
{
"docid": "7799d9bda1f15db2e0a00050e0dcfba6",
"score": "0.5643295",
"text": "def show\n @title = \"#{@user.full_name} | Bike Commuter Challenge\"\n if @user.team_id != nil\n @award = Award.where(:company_type => @user.team.company_type,\n :company_size_range => @user.team.company_size_range,\n :goal => 'Participation Rate')\n logger.debug \"Award is #{@award}\"\n logger.debug \"Award ID is #{@award[0].id}\"\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "90ce103fb0b9da12e3f5d456a19168a5",
"score": "0.56320316",
"text": "def rewards\n rewards = []\n if check_validity\n case check_eligibility\n when EligibilityService::CUSTOMER_ELIGIBLE\n rewards = RewardLookup.find(@tariff)\n end\n else\n errors << 'Account details are not valid'\n end\n rewards\n end",
"title": ""
},
{
"docid": "dbcfb04bf5ac3733d7dd982a9882fec2",
"score": "0.56253314",
"text": "def index\n @histories = RewardHistory.all\n Rabl.render(@histories, 'api/reward_histories/index', view_path: 'app/views')\n end",
"title": ""
},
{
"docid": "6f4f941bfe54d9f655b0ab6f5f6b940f",
"score": "0.5617819",
"text": "def retrieve(id)\n @client.make_request(:get, \"refunds/#{id}\", MODEL_CLASS)\n end",
"title": ""
},
{
"docid": "018faecb3536d7a20bde8267e7c0b750",
"score": "0.56139517",
"text": "def reward\n @reward ||= matching_rewards.first_or_create!(started_at: Time.now)\n end",
"title": ""
},
{
"docid": "8ec0bc729ac26130a4492c5e7c41eff9",
"score": "0.5608176",
"text": "def update\n @reward = Reward.find(params[:id])\n\n respond_to do |format|\n if @reward.update_attributes(params[:reward])\n format.html { redirect_to(rewards_path, :notice => 'Reward was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @reward.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90edbfd9534655079ad0793dfdaf7024",
"score": "0.56037164",
"text": "def show\n @person_award = PersonAward.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person_award }\n end\n end",
"title": ""
},
{
"docid": "4a2721c6c8908fbf29c47b4ed0d4970f",
"score": "0.5584025",
"text": "def get_reward_sets_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CampaignsRewardsApi.get_reward_sets ...\"\n end\n # resource path\n local_var_path = \"/rewards\"\n\n # query parameters\n query_params = {}\n query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'order'] = opts[:'order'] if !opts[:'order'].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 => 'PageResourceRewardSetResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CampaignsRewardsApi#get_reward_sets\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
1d1df44e376ca7b2e23d4ee24dcb3540
|
PUT /messages/1 PUT /messages/1.json
|
[
{
"docid": "a2b4268690003fcc255d620365e9a2d9",
"score": "0.664994",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, :notice => 'Message was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "0721a62a337f3985296b73ef8cc0c937",
"score": "0.71835774",
"text": "def update\n respond_to do |format|\n @message.update!(message_params)\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "86404a152661843b6ec98c0576bc26c3",
"score": "0.7099723",
"text": "def update\n message = Message.find_by(id: params[:id])\n message.update(message_params)\n render json: message\n end",
"title": ""
},
{
"docid": "b5d285a6b2883a793eaa80fb9c11b660",
"score": "0.69843495",
"text": "def update\n @message.update(message_params)\n if @message.errors.any?\n render json: @message.errors, status: :unprocessable_entity\n else\n render json: @message, status: 200 \n end\n end",
"title": ""
},
{
"docid": "1a7d448d84ec7d1276de5adc72421a2f",
"score": "0.6937695",
"text": "def update\n sent_message = Message.find(params[:id])\n if sent_message.update(message_params)\n render json: sent_message\n else\n render json: sent_message.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "33aae7211fc2ce4ca83b34edeab170c5",
"score": "0.6864097",
"text": "def update\n @message = Message.find(params[:id])\n\n if @message.update(params[:message])\n head :no_content\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4278b127deeb5466a5aa82a748e4dba3",
"score": "0.6823982",
"text": "def update\n @message = Message.where(id: params[:id])\n if @message.exists?\n # puts(\"Are we here?\")\n @message.update(message_params)\n render json: @message, status: :created\n else\n render json: {status: \"error\", message: \"Can't find message\"}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "502ba072b95bf9c9832e99ec0c347198",
"score": "0.6807755",
"text": "def update\n @message = authenticate!.messages.find_by(id: message_params[:id])\n if @message\n @message.update_attributes(message_params.except!(:client_id, :token, :id))\n render json: success('Update Success', 202), status: 202\n else\n render json: error('Error', 400), status: 400\n end\n end",
"title": ""
},
{
"docid": "9d94c8573264de3a8e95aef94bc65ea5",
"score": "0.67922664",
"text": "def update\n @message = Message.find(params[:id])\n\n if @message.update(message_params)\n head :no_content\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0a4ea7129e65f5e49b37202b471825e5",
"score": "0.66595256",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50a0f928669b79c9406a34e44b07588b",
"score": "0.6648885",
"text": "def update\n @message = Message.find(params[:id])\n\t\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f2e95214a6c3d36a75631b964c0adac",
"score": "0.6645185",
"text": "def update\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8ccff03fb51ec8ecf7ae052164a4db1",
"score": "0.6626494",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8ccff03fb51ec8ecf7ae052164a4db1",
"score": "0.6626494",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8ccff03fb51ec8ecf7ae052164a4db1",
"score": "0.6626494",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3839c9e8991461d32bbf96b2fb4da349",
"score": "0.6622711",
"text": "def update\n @message = @user.messages.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n flash[:notice] = 'Message was successfully updated.'\n format.html { redirect_to(@message) }\n format.json { head :ok }\n format.js {render :status => :created}\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @message.errors, :status => :unprocessable_entity }\n formate.js\n end\n end\n end",
"title": ""
},
{
"docid": "82c62a37f22d74da1005f3e55f459ec6",
"score": "0.6612513",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, :notice => 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82c62a37f22d74da1005f3e55f459ec6",
"score": "0.6612513",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, :notice => 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @message.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "40b910184f3514eccfa001d52ef1dc1e",
"score": "0.6605491",
"text": "def update\n # Modifica il testo di un messaggio\n if [email protected](message_params)\n flash.now[:error] = 'Il messaggio non è stato modificato'\n respond_to do |format|\n format.json { render :json => { :error => 'Il messaggio non è stato modificato' }, status: 422 }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c2a26da33bb9302281f0e6a9f09fc2d",
"score": "0.66054654",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6103785911f6ff93916c70abb249828b",
"score": "0.6594889",
"text": "def update_messenger(messenger_id, request)\n start.uri('/api/messenger')\n .url_segment(messenger_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "b4518aad848d41c2a943023f4b69b2d0",
"score": "0.6584608",
"text": "def update\n if @message.update(message_params)\n render :show, status: :ok, location: @message\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b4518aad848d41c2a943023f4b69b2d0",
"score": "0.6584608",
"text": "def update\n if @message.update(message_params)\n render :show, status: :ok, location: @message\n else\n render json: @message.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1f07567e49a4a5bb2439d44e7a6a659c",
"score": "0.65818894",
"text": "def update\n @msg = Msg.find(params[:id])\n\n respond_to do |format|\n if @msg.update_attributes(params[:msg])\n\tformat.html { redirect_to @msg, notice: 'Msg was successfully updated.' }\n\tformat.json { head :no_content }\n else\n\tformat.html { render action: \"edit\" }\n\tformat.json { render json: @msg.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a89b19d3c46e132bb6765e3145888a3",
"score": "0.6578579",
"text": "def update\n respond_to do |format|\n if message.update(message_params)\n format.html { redirect_to message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: message.errors, status: ':unprocessable_entity' }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0bee135748eac2dbb52d871ce8657d96",
"score": "0.6565402",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17a7524f8fe48fdae623a366ce689729",
"score": "0.6559652",
"text": "def update\n @message = Message.find(params[:id])\n\n if @message.update(message_params)\n head :no_content\n else\n render json: @message.errors, status: :unprocessable_entity, callback: params[:callback]\n end\n end",
"title": ""
},
{
"docid": "0fcc66a373d0fd74490f04fa0e98983c",
"score": "0.6558537",
"text": "def update\n @message = current_user.received_messages.find(params[:id])\n\n if @message.update_attributes(params[:message])\n format.html { redirect_to @message, :notice => t('controller.successfully_updated', :model => t('activerecord.models.message')) }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @message.errors, :status => :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "36c89a8424749551f7faa3fb6999ae6f",
"score": "0.6557574",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(params[:message])\n flash[:notice] = 'Message was successfully updated.'\n format.html { redirect_to(@message)}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "109dcd19c9ca377a2da3fc35328b1a49",
"score": "0.65515435",
"text": "def update\n @message = Message.find_by_uuid(params[:id])\n @message.raw_message = params[:message][:raw_message]\n\n respond_to do |format|\n if @message.save\n flash[:notice] = 'Message was successfully updated.'\n format.html { redirect_to(message_path(params[:domain], params[:endpoint], @message)) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"title": ""
},
{
"docid": "cd581287cfbd419ae6bc6e09ef41861f",
"score": "0.6550911",
"text": "def update\n @message = Message.find(params[:id])\n\n respond_to do |format|\n if @message.update_attributes(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2668fbe7d764527dd991b361ab7a8f0d",
"score": "0.6518559",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2020ab2d7d5dbf36485de57721920fe",
"score": "0.6513537",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n ### format.json { render :show, status: :ok, location: @message }\n format.json { render plain:'OK|', status: 201, layout: false }\n else\n format.html { render :edit }\n ### format.json { render json: @message.errors, status: :unprocessable_entity }\n format.json { render plain:'Error|', status: 501, layout: false }\n end\n end\n end",
"title": ""
},
{
"docid": "4de596c9667d241ab58071d8e3157958",
"score": "0.65114987",
"text": "def update\n @message = current_user.received_messages.find(params[:id])\n\n if @message.update(message_params)\n format.html { redirect_to @message, notice: t('controller.successfully_updated', model: t('activerecord.models.message')) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "6f9650460d1876063324f1b65d07632a",
"score": "0.6508869",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @message }\n else\n format.html { render action: 'edit' }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65084517",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b50a8a63f591af2cdf5a6d4a2025a973",
"score": "0.65083444",
"text": "def update\n respond_to do |format|\n if @message.update(message_params)\n format.html { redirect_to @message, notice: 'Message was successfully updated.' }\n format.json { render :show, status: :ok, location: @message }\n else\n format.html { render :edit }\n format.json { render json: @message.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
4b8aa8f135b3f11edd025a2fc7416ed0
|
Converts degrees, minutes and seconds to a Rational.
|
[
{
"docid": "395e129b6b483207d85e93097e77a7b1",
"score": "0.8074667",
"text": "def dms_to_rational(sign, degrees, minutes, seconds = nil)\n degrees = degrees.to_i\n minutes = minutes.to_i\n sign = sign == '-'.freeze ? -1 : 1\n\n if seconds\n Rational(sign * (degrees * 3600 + minutes * 60 + seconds.to_i), 3600)\n else\n Rational(sign * (degrees * 60 + minutes), 60)\n end\n end",
"title": ""
}
] |
[
{
"docid": "c891c1efad82f1d4ad526a2dfc80c6f5",
"score": "0.7963859",
"text": "def dms_to_rational(sign, degrees, minutes, seconds = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "cdba8c2015c450bf43c921ba3ae231b9",
"score": "0.78841656",
"text": "def dms_to_rational(sign, degrees, minutes, seconds = nil)\n result = degrees.to_i + Rational(minutes.to_i, 60)\n result += Rational(seconds.to_i, 3600) if seconds\n result = -result if sign == '-'\n result\n end",
"title": ""
},
{
"docid": "cefd59a40dcb888a6df0ecf9ff75aaed",
"score": "0.62645006",
"text": "def degrees_minutes_seconds(d, m, s)\n DegreeMinuteSecond.new(d, m, s)\n end",
"title": ""
},
{
"docid": "f5562c46084e6d4280a4a47c2ddc633a",
"score": "0.6178904",
"text": "def rational\n Rational(integer, integer(0..INTMAX))\n end",
"title": ""
},
{
"docid": "719a50be88c5700e1f1fc45004395cd8",
"score": "0.613385",
"text": "def to_r\n Rational(self, 1)\n end",
"title": ""
},
{
"docid": "e61e2e43c374a055a83fb3bccf7c36b6",
"score": "0.6107791",
"text": "def to_r\n return @scalar.to_r if self.unitless?\n raise RuntimeError, \"Cannot convert '#{self.to_s}' to Rational unless unitless. Use Unit#scalar\"\n end",
"title": ""
},
{
"docid": "aaf8c3b97d42d83de1d83cfc0c42f603",
"score": "0.6029707",
"text": "def rad(degrees)\n\t\t\treturn degrees * Math::PI / 180 \n\t\tend",
"title": ""
},
{
"docid": "f8bc7e104719fe7194dc1f00c3cae38d",
"score": "0.59169686",
"text": "def rational\n denom_gen = such_that(fixnum) { |f| not f == 0 }\n\n fmap(tuple(fixnum, denom_gen)) do |(n, d)|\n Rational(n, d)\n end\n end",
"title": ""
},
{
"docid": "e66b45a4d18e5d3f30fcaf23de1746dd",
"score": "0.5870275",
"text": "def to_r\n Rational(object.last) / (24 * 3600)\n end",
"title": ""
},
{
"docid": "f34baff3a135b377d24f898b19cb04ca",
"score": "0.5855204",
"text": "def on_rational(value)\n RationalLiteral.new(\n value: value,\n location:\n Location.token(\n line: lineno,\n char: char_pos,\n column: current_column,\n size: value.size\n )\n )\n end",
"title": ""
},
{
"docid": "ca027c0f777af0d9806170a99cf2b160",
"score": "0.5825357",
"text": "def shift_to_rad\n Rational(Math::PI, 180)\n end",
"title": ""
},
{
"docid": "78e205156d7797b099bbfc497a2d2b9c",
"score": "0.582216",
"text": "def convert_lat_or_lon_to_radiant(degrees, min, s)\n decimal_degrees = convert_angle_minutes_to_decimal(degrees, min, s)\n radiant = convert_decimal_degrees_to_radiant(decimal_degrees)\n return radiant\n end",
"title": ""
},
{
"docid": "76d6c7d4a4963786989bda90aea16921",
"score": "0.58146685",
"text": "def as_minutes\r\n (@period/A_MINUTE.to_r).to_f\r\n end",
"title": ""
},
{
"docid": "00dc639b03ab2fc825d0705b0d410c00",
"score": "0.57810086",
"text": "def rationalize_numerator_and_denominator_units!(*units)\n @base_units.rationalize_numerator_and_denominator!(*units)\n initialize_attributes\n end",
"title": ""
},
{
"docid": "8428682c77206f204109dd84303d885a",
"score": "0.57768977",
"text": "def normalize\n q, r = @seconds.divmod(60.0)\n @seconds = r\n @minutes += q\n q, r = @minutes.divmod(60)\n @minutes = r\n @degrees += q\n end",
"title": ""
},
{
"docid": "61828f6b0ad8dffd058b51028a99fc53",
"score": "0.57760346",
"text": "def to_rational\n e = biased_exponent\n if e.negative?\n sign * mantissa_fraction * Rational(1, 2**-e)\n else\n sign * mantissa_fraction * 2**e\n end\n end",
"title": ""
},
{
"docid": "7a813bdcd674ae9a84aaea5b1c82f54f",
"score": "0.57329154",
"text": "def jd_r(t)\n if false\n # This computes JD with precision of seconds and yields smaller denominators\n t.to_date.ajd + Rational(t.hour,24) + Rational(t.min,1440) + Rational(t.sec,86_400)\n else\n # This preserves the internal precision of t (which we probably don't need)\n # and produces larger denominators in general\n t.to_datetime.ajd\n end\n end",
"title": ""
},
{
"docid": "26b5b2be26cd8ce5a402a1c48f83ac12",
"score": "0.5718626",
"text": "def to_rad degrees\n degrees * Math::PI / 180\n end",
"title": ""
},
{
"docid": "26b5b2be26cd8ce5a402a1c48f83ac12",
"score": "0.5718626",
"text": "def to_rad degrees\n degrees * Math::PI / 180\n end",
"title": ""
},
{
"docid": "f0cb1bf268577db66107d1cb211e5fb2",
"score": "0.5672735",
"text": "def minutes(degree)\n ((degree - degree.floor) * 60).round\n end",
"title": ""
},
{
"docid": "54130cc190c25a2f739908aa1ff06268",
"score": "0.567262",
"text": "def stringToRational\n return $str1.to_r\nend",
"title": ""
},
{
"docid": "1e1540a0b28ea76d41626aa32a1e3eeb",
"score": "0.5649205",
"text": "def in_minutes\n @seconds / RelativeTime.units_in_seconds[:minute]\n end",
"title": ""
},
{
"docid": "dbcc1a919575383251f24c926175daf1",
"score": "0.5622344",
"text": "def rational_number\r\n RationalNumber.new(self.rational_number_nv, self.rational_number_dv, self.rational_number_snv, self.rational_number_sdv)\r\n end",
"title": ""
},
{
"docid": "1eed8cd9a77238f981abcc99128b26c5",
"score": "0.5621168",
"text": "def rational_hour(seconds)\n seconds.to_r / 3600\n end",
"title": ""
},
{
"docid": "9ca6ecbee2afebf1e0157c17d4043dd3",
"score": "0.5575459",
"text": "def deg2rad (degrees)\n degrees * PI / 180\nend",
"title": ""
},
{
"docid": "9009d5e735e7ffca13713a5e23a29392",
"score": "0.5574961",
"text": "def visit_rational(node)\n s(:rational, [node.value.to_r], smap_operator(nil, srange_node(node)))\n end",
"title": ""
},
{
"docid": "c8a0e826343bd0df2a225d17c268aa3a",
"score": "0.55658656",
"text": "def to_rad(degree)\n degree * Math::PI / 180\n end",
"title": ""
},
{
"docid": "90f32aa1292db21f71e04f38d485c85e",
"score": "0.5563894",
"text": "def simplify_rational_number\n self\n end",
"title": ""
},
{
"docid": "0ff5c3466c675e7abca75422efc4470f",
"score": "0.55604506",
"text": "def test_to_rational\r\n assert_equal(Rational(13,10), (1.3).to_foorth_r)\r\n end",
"title": ""
},
{
"docid": "5113873dc2475684c96f1ba672c7d6d2",
"score": "0.5560085",
"text": "def to_rad(*degrees)\n rtn = degrees.map do |v|\n v = to_bigdec(v)\n to_bigdec(v / 180.0 * Math::PI)\n end\n rtn.length < 2 ? rtn.first : rtn\n end",
"title": ""
},
{
"docid": "ac4eba1cdbf9a25abe70a63898d6dc82",
"score": "0.5533482",
"text": "def rationalize_numerator_and_denominator!(*units)\n replace(numerator_units.rationalize!(*units) + denominator_units.rationalize!(*units))\n end",
"title": ""
},
{
"docid": "0f3c3e07642e83dce1fe3fe4dacc1911",
"score": "0.54996526",
"text": "def rad(deg)\n return (deg.to_f*Math::PI)/180.0\nend",
"title": ""
},
{
"docid": "55a95c855fcd6e763dce00cf06dd9b80",
"score": "0.5493229",
"text": "def +(rational)\n new_numerator = self.numerator * rational.denominator + self.denominator * rational.numerator\n new_denominator = self.denominator * rational.denominator\n RationalNumber.new(new_numerator, new_denominator)\n end",
"title": ""
},
{
"docid": "1d6312e727e885ff92ddee99e41c4b96",
"score": "0.546685",
"text": "def to_R\n case self.units\n when \"F\" then return self.f2r\n when \"C\" then return self.c2r\n when \"K\" then return self.k2r\n when \"R\" then return self\n end\n end",
"title": ""
},
{
"docid": "00e5c835c5af55faa78b7685576fe348",
"score": "0.5464312",
"text": "def test_to_rational\r\n rat = '1/2'.to_r\r\n assert_equal(rat.to_foorth_r, rat)\r\n end",
"title": ""
},
{
"docid": "343ca09204356c6592012ee48f851b13",
"score": "0.5461739",
"text": "def f(degrees, minutes = 0)\n degrees >= 0 ? degrees + (minutes / 60.0) : degrees - (minutes / 60.0)\n end",
"title": ""
},
{
"docid": "fb50588e5083dd947f6efad3fd5bde6f",
"score": "0.5461649",
"text": "def to_radian(r)\n r % 180.0 if r >= 180.0 || r <= -180.0\n r * Math::PI / 180.0\n end",
"title": ""
},
{
"docid": "2b358d68239ff439617885f8536cf248",
"score": "0.54485893",
"text": "def deg_to_rad(deg)\n deg.to_f * 2 * Math::PI / 360.0\nend",
"title": ""
},
{
"docid": "64acd96d8c963db7fa5023e147ddcbb4",
"score": "0.5440805",
"text": "def on_rational(value); end",
"title": ""
},
{
"docid": "8d23a36c4f25e973bb11987776eae54e",
"score": "0.54331243",
"text": "def radian(degree)\n degree*(Math::PI/180)\n end",
"title": ""
},
{
"docid": "eded5e345aeb47e1529912ff238b54e0",
"score": "0.5413175",
"text": "def /(rational)\n new_numerator = self.numerator * rational.denominator\n new_denominator = self.denominator * rational.numerator\n RationalNumber.new(new_numerator, new_denominator)\n end",
"title": ""
},
{
"docid": "6e48ec8c12063f492c2d1e36b51bc483",
"score": "0.53967935",
"text": "def rounded_time\n number_to_add = magic_number\n seconds_to_remove = (time.sec + (minutes * 60))\n self.time -= seconds_to_remove\n self.time += number_to_add\n time\n end",
"title": ""
},
{
"docid": "275b87fa577b3092d235d22e7e01e371",
"score": "0.5391629",
"text": "def to_rad\n self * Math::PI / 180\n end",
"title": ""
},
{
"docid": "275b87fa577b3092d235d22e7e01e371",
"score": "0.5391629",
"text": "def to_rad\n self * Math::PI / 180\n end",
"title": ""
},
{
"docid": "8913df6c25dce37ea0817a140f17dcde",
"score": "0.53899306",
"text": "def radians(degrees) return degrees/180 * PI end",
"title": ""
},
{
"docid": "05cd7865d731b4f5f964c02c7d10d99d",
"score": "0.5381577",
"text": "def duration_rounded(seconds = 60)\n duration = (self.end.to_f - self.start.to_f)\n\tduration = (duration / seconds).round * seconds\n end",
"title": ""
},
{
"docid": "9c0b259d9f2488cc141b6ab23424ba3b",
"score": "0.537921",
"text": "def deg2rad(deg)\n return deg * RAD_PER_DEG\nend",
"title": ""
},
{
"docid": "a23282fa8ab3658d7e16e096958eab17",
"score": "0.53782016",
"text": "def radians_to_degrees(); end",
"title": ""
},
{
"docid": "9604100073f76d6c1d8af196cd35a6d8",
"score": "0.53407043",
"text": "def deg_to_rad(deg)\n deg * Math::PI / 180\nend",
"title": ""
},
{
"docid": "8062fd97363aaf58c987c381ced9e90f",
"score": "0.5319965",
"text": "def deg2rad(deg)\n # deg.to_f * Math::PI / 180.0\n deg.to_f * PI / 180.0\nend",
"title": ""
},
{
"docid": "641289a9744c24ede06e0984103457e7",
"score": "0.5319595",
"text": "def RationalLiteral(value)\n RationalLiteral.new(value: value, location: Location.default)\n end",
"title": ""
},
{
"docid": "78589439a273572e4126b06cc7579575",
"score": "0.5318757",
"text": "def degrees_with_minutes(degrees_float)\n if degrees_float < 0\n degrees_float += 360.0\n end\n degrees = degrees_float.floor\n minutes = (60 * (degrees_float - degrees)).round\n \n '%03d°%02d′' % [degrees, minutes]\n end",
"title": ""
},
{
"docid": "d916681ae40a1ba455c36e92ab67343e",
"score": "0.5312516",
"text": "def *(rational)\n new_numerator = self.numerator * rational.numerator\n new_denominator = self.denominator * rational.denominator\n RationalNumber.new(new_numerator, new_denominator)\n end",
"title": ""
},
{
"docid": "4776d271db8017cd24f506eae1e328f9",
"score": "0.53103894",
"text": "def to_rad\n self * Math::PI / 180\n end",
"title": ""
},
{
"docid": "52135dedb16c972391225495088f086c",
"score": "0.528861",
"text": "def rad2rad(rad)\n remt(rad, PI2)\n end",
"title": ""
},
{
"docid": "5c474db15d6e6748d9184b67c7983912",
"score": "0.52796954",
"text": "def utc_total_offset_rational\n # Thread-safety: It is possible that the value of \n # @utc_total_offset_rational may be calculated multiple times in \n # concurrently executing threads. It is not worth the overhead of locking\n # to ensure that @zone_identifiers is only calculated once.\n \n unless @utc_total_offset_rational\n result = OffsetRationals.rational_for_offset(utc_total_offset)\n return result if frozen?\n @utc_total_offset_rational = result\n end\n @utc_total_offset_rational\n end",
"title": ""
},
{
"docid": "28182e630be18b60e2b3b3f54af68110",
"score": "0.52736515",
"text": "def single_radical\n c = b = 1\n prime_factors.each do |p, e|\n q, r = e.mixed_fraction\n c *= p**q\n b *= p**(r*rational_degree)\n end\n [c, b, rational_degree]\n end",
"title": ""
},
{
"docid": "42eb134900117393beafc3b65935b1c4",
"score": "0.5273622",
"text": "def to_rads(deg)\n deg * ARC\n end",
"title": ""
},
{
"docid": "2b13388ea3acf998af2b90f9115bb817",
"score": "0.5259582",
"text": "def to_rd\n return @moment.floor\n end",
"title": ""
},
{
"docid": "14d298051cb56cc4a34cead2632707b3",
"score": "0.52590907",
"text": "def utc_total_offset_rational\n unless @utc_total_offset_rational\n @utc_total_offset_rational = OffsetRationals.rational_for_offset(utc_total_offset) \n end\n @utc_total_offset_rational\n end",
"title": ""
},
{
"docid": "cd445ae50608f169744e6acaa08091df",
"score": "0.52538794",
"text": "def to_rad\n\t\tself * Math::PI / 180\n\tend",
"title": ""
},
{
"docid": "85b8868299cfe0ccdb1a3001f78e45ad",
"score": "0.5251999",
"text": "def seconds_to_minutes(seconds)\n seconds / 60\nend",
"title": ""
},
{
"docid": "8cc78fd06080bd5dce51c2ff717583a1",
"score": "0.5250188",
"text": "def degrees_to_radians(); end",
"title": ""
},
{
"docid": "1fb8a058b5e5b847dbd9dbc6f121a0b4",
"score": "0.52471966",
"text": "def rad\r\n Math::PI / 180.0\r\nend",
"title": ""
},
{
"docid": "36669079385af112d1b0ef10fc4ab573",
"score": "0.5227306",
"text": "def in_minutes\n in_seconds / SECONDS_PER_MINUTE.to_f\n end",
"title": ""
},
{
"docid": "e88eca8773c0e14abc30c3ca1f6d6ca2",
"score": "0.5226019",
"text": "def deg2rad(deg)\n\t\tdeg*Math::PI/180\n\tend",
"title": ""
},
{
"docid": "4ee608b19988c7f992a0e8feb7db3231",
"score": "0.5219659",
"text": "def duration_in_minutes\n @duration/60.0 #force floating point\n end",
"title": ""
},
{
"docid": "95c8ccd206107a99f890fe6a1cfc43a2",
"score": "0.52110356",
"text": "def use_rationals\n r1 = MyRational.new(3,4)\n r2 = r1 + r1 + MyRational.new(-5,2)\n puts r2.to_s\n (r2.add! r1).add! (MyRational.new(1,-4))\n puts r2.to_s\n puts r2.to_s2\n puts r2.to_s3\nend",
"title": ""
},
{
"docid": "f42df15e0b72b48050ac3b2f3b6d522e",
"score": "0.5210749",
"text": "def dms(num)\n until DEGREES_RANGE.include?(num.to_i)\n num < 0 ? (num += 360) : (num -= 360)\n end\n \n num = num.to_f.to_s\n \n degrees = num.match(/^\\d+/).to_s.to_i\n minutes = ((num.match(/\\.\\d+$/).to_s.to_f) * 60)\n seconds = ((minutes.to_s.match(/\\.\\d+$/).to_s.to_f) * 60)\n \n format(%(#{degrees}#{DEGREE}%02d'%02d\"), minutes, seconds)\nend",
"title": ""
},
{
"docid": "f9bbdfa1d389654628a806e9553ecd07",
"score": "0.5205643",
"text": "def time\n Rational(@@number, @@divider)\n end",
"title": ""
},
{
"docid": "941e57ed784d8632e7dd31a2c2688344",
"score": "0.519696",
"text": "def deg2rad(angle)\n (angle * Math::PI) / 180.0\n end",
"title": ""
},
{
"docid": "ecca65b2c6730353ff2a18ce21605d3d",
"score": "0.51899767",
"text": "def to_radians (degrees)\n degrees * $TO_RADIANS\n end",
"title": ""
},
{
"docid": "c1354cc6cd960156b32de80088c0b72e",
"score": "0.5188811",
"text": "def inspect\n sprintf(\"Rational(%s, %s)\", @numerator.inspect, @denominator.inspect)\n end",
"title": ""
},
{
"docid": "000322767d4f880445257e83c86ccc37",
"score": "0.51827675",
"text": "def seconds\r\n ((@period % A_MONTH.to_r) % A_MINUTE.to_f)\r\n end",
"title": ""
},
{
"docid": "80fed552fd6a79608d13607833c60479",
"score": "0.5177559",
"text": "def deg2rad; end",
"title": ""
},
{
"docid": "80b6849532125c3beb7d0971aa84967e",
"score": "0.5169423",
"text": "def rad2deg(r)\n (r/Math::PI)*180\n end",
"title": ""
},
{
"docid": "d4946ab17224942dd1f854660d838da1",
"score": "0.5167735",
"text": "def rad2deg; end",
"title": ""
},
{
"docid": "a34b6da51592b16dacc309438d7e9893",
"score": "0.5159505",
"text": "def duration\n @resolution / @rate\n end",
"title": ""
},
{
"docid": "debd2a7f65526fe58e07fb88c11ebce5",
"score": "0.5143936",
"text": "def units_to_time(units)\n units * 15 * 60\n end",
"title": ""
},
{
"docid": "bbe9c2fae715184fcfae7c6ee97c794f",
"score": "0.5143806",
"text": "def RationalLiteral(value); end",
"title": ""
},
{
"docid": "2cf105d030ade578d9df36c12fbf3ab7",
"score": "0.51340985",
"text": "def minutes\n (duration / 1000 / 60) % 60\n end",
"title": ""
},
{
"docid": "df0e5911d190366e474199d1f1a838e8",
"score": "0.51255447",
"text": "def pi_div_rad \n 0.0174\n end",
"title": ""
},
{
"docid": "c44da1533f2aaf789e693e3f039da510",
"score": "0.51174974",
"text": "def degrees(rad)\n rad * (180 / Math::PI)\n end",
"title": ""
},
{
"docid": "02325a0fe2c4c5a6c8cc05c67b117309",
"score": "0.5116691",
"text": "def normalize_values\n @degrees = degrees.to_i\n @minutes = minutes.to_i\n @seconds = seconds.to_f\n end",
"title": ""
},
{
"docid": "ce256cbf1a42f025dee61dc378e77be0",
"score": "0.5112132",
"text": "def rational_number(opts = {})\n if !!opts[:force] or @rational_number == nil\n @rational_number = RationalNumber.new(self[tree_nv_field], self[tree_dv_field], self[tree_snv_field], self[tree_sdv_field])\n end\n @rational_number\n end",
"title": ""
},
{
"docid": "b0ef4a2dcdebcd9be0ab1a38b36478ca",
"score": "0.51121104",
"text": "def rationalize(eps = nil)\n eps ? base_amount.rationalize(eps) : base_amount.rationalize\n end",
"title": ""
},
{
"docid": "bd84f76306d4e6b53749c98123e1cf9b",
"score": "0.5111284",
"text": "def degrees_to_radians(degrees)\n\treturn degrees / (360 / (2 * Math::PI))\n end",
"title": ""
},
{
"docid": "2b4ecc1817f9f464ce322fee5e0ae618",
"score": "0.51067084",
"text": "def radians( value )\r\n value * 0.0174533\r\n end",
"title": ""
},
{
"docid": "0f4a53ef9b63960089940d02368cc20e",
"score": "0.51022106",
"text": "def dms(num)\n if num > 360\n num = num % 360\n elsif num < 0\n num = 360 - (num.abs % 360)\n end\n degree = num.to_i\n minutes = 0\n seconds = 0\n if degree != 0\n minutes = num % num.to_i * 60\n if minutes != 0\n seconds = minutes % minutes.to_i * 60\n end\n end\n \n %(#{degree}\\xC2\\xB0#{sprintf(\"%02d\", minutes)}'#{sprintf(\"%02d\", seconds)}\\\")\nend",
"title": ""
},
{
"docid": "e5f4cfb92420f93c639a316110a6f0c2",
"score": "0.50980896",
"text": "def dms(degrees_float)\n degrees_float < 0 ? multiplier = -1 : multiplier = 1\n degrees_float = degrees_float.abs\n if degrees_float > DEGREES_IN_A_CIRCLE\n degrees_float = degrees_float % DEGREES_IN_A_CIRCLE\n end \n total_seconds = (degrees_float * SECONDS_PER_DEGREE).round\n degrees, remaining_seconds = total_seconds.divmod(SECONDS_PER_DEGREE)\n minutes, seconds = remaining_seconds.divmod(SECONDS_PER_MINUTE)\n puts \"#{multiplier * degrees}#{DEGREE} #{minutes}' #{seconds.round(3)}\\\" \"\nend",
"title": ""
},
{
"docid": "b32b136ae03e5bd9d616d7fe435ca2e0",
"score": "0.50933784",
"text": "def rad_to_deg(rad)\n rad * 180 / Math::PI\nend",
"title": ""
},
{
"docid": "2de128138a4dda6e4bf2d5dbfc1c7834",
"score": "0.5092486",
"text": "def duration\n (minutes*60)+seconds\n end",
"title": ""
},
{
"docid": "c42dcf866a3169ca93d215edcff56e21",
"score": "0.50844544",
"text": "def round(options={})\n seconds = 60\n Time.at((self.to_f / seconds).round * seconds)\n end",
"title": ""
},
{
"docid": "affc9601a690a7537ed15e5dcfe1a2d5",
"score": "0.5081022",
"text": "def jruby_scale_down_rational(rat)\n return rat if rat.numerator <= java.lang.Long::MAX_VALUE\n [10, 100, 1000].each do |scale_by|\n new_numerator = rat.numerator / scale_by\n if new_numerator <= java.lang.Long::MAX_VALUE\n return Rational(new_numerator, rat.denominator / scale_by)\n end\n end\n end",
"title": ""
},
{
"docid": "52a66e44366b857474271f276b97bc0b",
"score": "0.5065745",
"text": "def to_degrees\n degrees = (((@hour * 30) + (@min * 0.5)) - (@min * 6)).abs.to_i\n degrees > 180 ? (360 - degrees) : degrees\n end",
"title": ""
},
{
"docid": "04da46237d4bf60faf815b0dcf714701",
"score": "0.50566024",
"text": "def deg2rad(deg)\n deg.to_f * Math::PI / 180.0\n end",
"title": ""
},
{
"docid": "1cfa18ec826b10901fa5f16c12710f0c",
"score": "0.50403935",
"text": "def value_in_minutes\n to_i / 1.minute.to_f\n end",
"title": ""
},
{
"docid": "c2e26335c5a583658f93418069762acb",
"score": "0.50314844",
"text": "def to_radians(degrees)\n\tdegrees * Math::PI / 180\nend",
"title": ""
},
{
"docid": "ed8b348042a372dc82e4eeb36b4407dc",
"score": "0.5026403",
"text": "def degrees_to_radians(degrees)\n return degrees * Math::PI / 180\nend",
"title": ""
},
{
"docid": "ef6cfd5ab7fa4df1a40d889ccec75ffc",
"score": "0.50189286",
"text": "def minutes\n\t\t\t(@seconds + @seconds_in_months).quo(60)\n\t\tend",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "ac5c2898bbf25e449534d61b781372c2",
"score": "0.0",
"text": "def set_juese\n @juese = Juese.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 [email protected]?(: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": ""
}
] |
2a778c1eba38da2aa55d54f2a1285e6b
|
Creates a new account associated with a user
|
[
{
"docid": "d7cf5a904332887fd33de56a4cd04308",
"score": "0.0",
"text": "def create_account(user)\n account = Account.to_adapter.get!(user.id)\n update_status = account.update_with_password({ \"email\" => user.email, \"name\" => user.username })\nend",
"title": ""
}
] |
[
{
"docid": "47a075acad456a76ca2b72b74cbe7748",
"score": "0.8249613",
"text": "def create_account_user(options = {})\n post('accountuser?_method=PUT', options)\n end",
"title": ""
},
{
"docid": "9057a97cf9a1f347310d32bb331848bd",
"score": "0.8177913",
"text": "def create\n user = User.new(user_params)\n if user.save\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n else\n response = { message: Message.account_not_created}\n json_response(response)\n end\n\n end",
"title": ""
},
{
"docid": "834a3de9bf3c2e184e60b76edc8372af",
"score": "0.8169718",
"text": "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.username, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end",
"title": ""
},
{
"docid": "b265e93d415522e265d2a4b88bda1f60",
"score": "0.8167203",
"text": "def create_user user={}, account={}\n\n req = {}\n req.merge!({ :user => user }) unless user.empty?\n req.merge!({ :account => account }) unless account.empty?\n\n request('create-user', req)\n\n end",
"title": ""
},
{
"docid": "ca0338ec5540d6218048150b384b6be0",
"score": "0.81080574",
"text": "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.username, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end",
"title": ""
},
{
"docid": "9a5bf67edb29c39b3372a7183e03787d",
"score": "0.8106919",
"text": "def create\n response = UserAccount::Create.call(user_account_params)\n if response.success?\n success_response(message: response.status_message, http_status: 202, data: response.data)\n else\n error_response(message: response.status_message, data: response.data)\n end\n end",
"title": ""
},
{
"docid": "5cc195cf29d54ada32999c2002c3b4ef",
"score": "0.80858177",
"text": "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end",
"title": ""
},
{
"docid": "5cc195cf29d54ada32999c2002c3b4ef",
"score": "0.80858177",
"text": "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end",
"title": ""
},
{
"docid": "5cc195cf29d54ada32999c2002c3b4ef",
"score": "0.80858177",
"text": "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n json_response(response, :created)\n end",
"title": ""
},
{
"docid": "86a96be4cd09d142cc72208a9bac043e",
"score": "0.8024215",
"text": "def create\n user = User.create!(user_params)\n response = { message: Message.account_created }\n json_response(response, :created)\n end",
"title": ""
},
{
"docid": "fb67c9039fc8e660706a8f0993559ea5",
"score": "0.7987127",
"text": "def create\n user = User.new(user_params)\n if user.save\n auth_token = AuthenticateUser.new(user.email, user.password)\n .call\n # send email using welcome template\n UserMailer.welcome_email(user).deliver_now\n response = { message: Message.account_created, token: auth_token }\n json_response(response, :created)\n else\n json_response(user.errors, :unprocessable_entity)\n end\n end",
"title": ""
},
{
"docid": "e5badfcb3efee24175dba2dd3f44de12",
"score": "0.7946853",
"text": "def create_account\n unless authenticated?\n payload = encode( { :user => { :github_account => github_user } } )\n response = site['users.json'].post payload, :content_type => :json\n !response.nil?\n end\n end",
"title": ""
},
{
"docid": "208c554344ad23020994c291c7dc76e6",
"score": "0.7906529",
"text": "def create\n user = User.create!(user_params) # will raise an error if creation fails\n # call the authentication service\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token}\n json_response(response, :created)\n end",
"title": ""
},
{
"docid": "65e7bd97067202dea3dbe196fc8152a5",
"score": "0.7906014",
"text": "def create\n @user = User.new(username: params[:username], email: params[:email], password: params[:password])\n\n if @user.save\n render json: {status: 'SUCCESS', message: 'Account successfully created', accessToken: @user.access_token}.to_json\n else\n render json: {errors: [\"Sign up failed!\"], status: 422}.to_json\n end\n\n end",
"title": ""
},
{
"docid": "3f3be284dfb42ea73ffb377d468b4bc3",
"score": "0.79030114",
"text": "def create(body = {})\n @client.account.create(body)\n end",
"title": ""
},
{
"docid": "ff9a99af4cafaa0816527d033b637245",
"score": "0.7872508",
"text": "def create\n # Note this is different to the usual situation where anybody can create\n # an account. Here, only administrators can create accounts for others;\n # and doing so does not log them out.\n unless current_user.admin?\n flash[:error] = \"Users can only be created by administrators.\"\n redirect_to (request.env[\"HTTP_REFERER\"] || root_path) and return\n end\n \n @user = User.new(params[:user])\n success = @user && @user.save\n if success && @user.errors.empty?\n # Protects against session fixation attacks, causes request forgery\n # protection if visitor resubmits an earlier form using back\n # button. Uncomment if you understand the tradeoffs.\n # reset session\n redirect_to users_path\n flash[:notice] = \"The account #{ERB::Util.h @user.login} has been setup for #{ERB::Util.h @user.name}.\"\n else\n flash.now[:error] = \"We couldn't set up that account, sorry.\"\n render :action => 'new'\n end\n end",
"title": ""
},
{
"docid": "f6e0b1042b010dcceb914c6da708bcfd",
"score": "0.78147525",
"text": "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token , uid: user.id }\n json_response(response, :created)\n end",
"title": ""
},
{
"docid": "3a7783c4a720e5d06d938292bb345395",
"score": "0.7814468",
"text": "def create\n @account = Account.create(params[:account])\n @user = User.create(params[:user])\n @user.password = params[:user][:password] # Because we don't mass assign password\n @user.password_confirmation = params[:user][:password_confirmation]\n @user.account_admin = true # Account creator is always account administrator\n Account.transaction do\n @account.save! \n @account.users << @user\n @user.save!\n end\n flash[:notice] = I18n.t('accounts.new_account.created')\n redirect_to the_new_account_url\n \n rescue ActiveRecord::RecordInvalid\n flash.now[:error] = I18n.t('accounts.new_account.creation_error')\n render :new\n end",
"title": ""
},
{
"docid": "78b318d7de887e81fc8fa1a6555d9d03",
"score": "0.7783149",
"text": "def create\n @account_user = AccountUser.new(account_user_params)\n respond_to do |format|\n if @account_user.save\n format.html { redirect_to @account_user, notice: 'Account user was successfully created.' }\n format.json { render :show, status: :created, location: @account_user }\n else\n format.html { render :new }\n format.json { render json: @account_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44168cc0275b66e6b6acb7863c78e5e5",
"score": "0.7780288",
"text": "def create\n @user_account = UserAccount.new(user_account_params)\n\n respond_to do |format|\n if @user_account.save\n format.html { redirect_to @user_account, notice: 'User account was successfully created.' }\n format.json { render :show, status: :created, location: @user_account }\n else\n format.html { render :new }\n format.json { render json: @user_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3cfa4d9b9b3fa597c8e7306e3ff692ea",
"score": "0.7758448",
"text": "def create_account\n set_user\n set_payer\n set_user_sport\n save_account\n end",
"title": ""
},
{
"docid": "9ec2588cc918e8a242ba6e03a4f6b245",
"score": "0.77281773",
"text": "def create\n @user.account = Account.new if @user.account.nil?\n\n if @user.account.save_with_stripe(params)\n redirect_to user_url(@user), notice: 'Account was successfully created.'\n else\n handle_account_errors(@user, params)\n render :new\n end\n end",
"title": ""
},
{
"docid": "54d86236b45925b659326b28b210cf99",
"score": "0.77163696",
"text": "def create\n @account = Account.new(account_params)\n @account.user = @user\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c236a158a8ffc63fed15d0a7f7716158",
"score": "0.76774514",
"text": "def create\n args = user_params\n user = User.create!(args)\n token_str = AuthenticateUser.new(user.email, user.password).call\n token = Token.new\n token.token = token_str\n token.save!\n user.token_id = token.id\n user.save!\n response = { message: Message.account_created, token: token_str }\n json_response(response, :created)\n end",
"title": ""
},
{
"docid": "4be9cb52af17b2bbc01ef3ff2a48380e",
"score": "0.7663429",
"text": "def create_user_account\n User.create!(email: self.email, password: self.customer)\n # user = User.new do |u|\n # u.email = email\n # u.password = customer\n # u.save\n # end\n end",
"title": ""
},
{
"docid": "66f3869cb989d23e4c1541f8ec6d5dc6",
"score": "0.76415825",
"text": "def create_user_account\n Account.cache_or_create_by! @current_user\n rescue => e\n log_error(e, account: 'cannot_create_unique_account_record')\n end",
"title": ""
},
{
"docid": "4b51925583631c342789a5d537453c32",
"score": "0.76310045",
"text": "def create\n @account = current_user.accounts.new(account_params)\n if @account.save\n redirect_to @account, notice: 'Account was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "87746ff5de863046dde77b9bf7730aa8",
"score": "0.7630069",
"text": "def create\n @account = Account.new(account_params)\n @account.user_id = current_user.id\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "393506bc73bf1f48a2167cafdfc9a757",
"score": "0.7624032",
"text": "def create\n @account = Account.new(account_params)\n @account.user_created_id = current_user.id\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_path, notice: I18n.t('account.controller.create') }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "064dd15a0962302257667f2190a3da75",
"score": "0.7588766",
"text": "def create\n @user = User.new(user_params)\n\n if @user.save\n @user.reset_perishable_token\n flash[:notice] = t(\"users.create.flash.success\")\n UserMailer.account_created(@user).deliver\n\n begin\n redirect_to :back\n rescue ActionController::RedirectBackError\n redirect_to root_path\n end\n\n else\n flash[:error] = t(\"scaffolds.generic.flash.error\")\n redirect_to new_user_path\n end\n end",
"title": ""
},
{
"docid": "0ca14f202b86917ac636752c5f28c307",
"score": "0.7563125",
"text": "def new_user_create\n @user = User.create_user(user_params, current_user.account_id) # New User\n begin\n @user.save!\n @users = User.get_all(current_user.account_id)\n flash[:success] = \"User was created successfully!\"\n rescue => e\n flash[:alert] = \"User creation failed!\"\n end \n end",
"title": ""
},
{
"docid": "a551d7e209fb40271749bae58f5871ea",
"score": "0.755141",
"text": "def create_account(options)\n form_data = options.merge({ 'action' => 'createaccount' })\n res, dummy = make_api_request(form_data)\n res\n end",
"title": ""
},
{
"docid": "cc577a3da4056f022699372dd91e39b2",
"score": "0.75452906",
"text": "def create\n user = User.find_by(email: user_params['email'])\n if !user\n dataToRegister = {\n username: user_params['username'],\n balance: user_params['balance'],\n password: Base64.decode64(user_params['password']),\n password_confirmation: Base64.decode64(user_params['password_confirmation']),\n email: user_params['email'],\n }\n user = User.create!(dataToRegister)\n auth_token = AuthenticateUser.new(user.email, Base64.encode64(user.password)).call\n response = {\n data: {\n message: Message.account_created,\n token: auth_token,\n user: {\n username: user.username,\n email: user.email\n }\n }\n }\n json_response(response, :created)\n\n else\n raise(ExceptionHandler::AuthenticationError, Message.email_Already_used)\n end\n end",
"title": ""
},
{
"docid": "f5e866648c114d8c6859e49637b248fd",
"score": "0.7541458",
"text": "def create\n @user = User.new_user(params[:user])\n @user.attributes.each do |attr, val|\n logger.debug(\"attr: #{attr}, val: #{val}\")\n end\n\n if @user.save\n flash[:success] = \"Successfully created account, please sign in\"\n redirect_to login_path\n else\n flash[:warning] = \"Couldn't process the user\"\n render action: \"new\"\n end\n\n end",
"title": ""
},
{
"docid": "cc22fe2b8daf32f1f13dd4787a5997fd",
"score": "0.75132304",
"text": "def create\n user = User.create!(user_params)\n auth_token = AuthenticateUser.new(user.email, user.password).call\n response = { message: Message.account_created, auth_token: auth_token }\n @api_response[:code] = @response_codes[:success]\n @api_response[:result] = response\n\n rescue Exception => e\n @errors, @api_response = api_exception_handler(e)\n ensure\n send_response(@api_response, @errors)\n #json_response(response, :created)\n end",
"title": ""
},
{
"docid": "df7fbb11167da21928169f8dd70dadc7",
"score": "0.75118977",
"text": "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to signin_path, notice: 'Account successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17f589fae21cb74bde7cc11a150b1ea2",
"score": "0.7503806",
"text": "def create\n @user_account = UserAccount.new(params[:user_account])\n\n respond_to do |format|\n if @user_account.save\n format.html { redirect_to user_account_url(@user_account.user, @user_account), notice: 'User account was successfully created.' }\n format.json { render json: @user_account, status: :created, location: @user_account }\n format.xml { render xml: @user_account, status: :created, location: @user_account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_account.errors, status: :unprocessable_entity }\n format.xml { render xml: @user_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ccd606a17c3230d56b87959d0dfa0ce",
"score": "0.7502385",
"text": "def create_account\n\n end",
"title": ""
},
{
"docid": "3cf064c4e6f28f7b58103e89e7fb56a3",
"score": "0.7500287",
"text": "def create\n user = User.find_by_email(params[:email])\n if !user.present?\n user = User.create!(user_params)\n user.account_active = false\n user.save!\n accountHash = AccountHash.create(:hashcode => create_hashcode, :user_id => user.id, :password => user.password, :temp_email => nil)\n AppropMailer.account_created(user, accountHash).deliver\n render json: { message: Message.account_created, hashcode: accountHash.hashcode }\n else\n json_response({error: 'El email ya se encuentra registrado en Approp'}, :unprocessable_entity)\n end\n end",
"title": ""
},
{
"docid": "f23a8768ebe76b46263b63f2397f31eb",
"score": "0.74650025",
"text": "def create\n @account = current_user.accounts.new(params[:account])\n\n respond_to do |format|\n if @account.save\n flash[:notice] = 'Account was successfully created.'\n format.html { redirect_to([current_user, @account]) }\n format.xml { render :xml => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db64d13a9b0ea1729f119ecb93da06fb",
"score": "0.7459186",
"text": "def create\n\t\t\n\t\treg_params = params.require(:user).permit(\n\t\t\t:name, :email, :password, :password_confirmation\n\t\t)\n\n\t\tname = reg_params[:name]\n\t\temail = reg_params[:email]\n\t\tpassword = reg_params[:password]\n\t\tpassword_confirmation = reg_params[:password_confirmation]\n\n\t\tnew_user = User.new(\n\t\t\tname: name,\n\t\t\temail: email,\n\t\t\tpassword: password,\n\t\t\tpassword_confirmation: password_confirmation\n\t\t)\n\n\t\tif new_user.valid?\n\t\t\tnew_user.save(validate: false)\n\t\t\tflash[:success] = \"Account successfully created.\"\n\t\telse\n\t\t\tflash[:error] = new_user.errors.full_messages\n\t\tend\n\t\tredirect_to root_path\n\tend",
"title": ""
},
{
"docid": "900eb619d9c10444f06ce578809a90ab",
"score": "0.7458271",
"text": "def create\n @t_user_account = TUserAccount.new(t_user_account_params)\n\n respond_to do |format|\n if @t_user_account.save\n format.html { redirect_to @t_user_account, notice: 'T user account was successfully created.' }\n format.json { render :show, status: :created, location: @t_user_account }\n else\n format.html { render :new }\n format.json { render json: @t_user_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f377781343a1867178f3a2ade8a98d9",
"score": "0.7452987",
"text": "def create\n @user_account = UserAccount.new(params[:user_account])\n\n respond_to do |format|\n if @user_account.save\n format.html { redirect_to(@user_account, :notice => 'User account was successfully created.') }\n format.xml { render :xml => @user_account, :status => :created, :location => @user_account }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_account.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a9ebd66484975ffdec7f4c17bb94dea",
"score": "0.7437095",
"text": "def create\n @user = Account.new(user_params)\n if @user.save\n session[:user_id] = @user.id\n redirect_to @user\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "c96beaf6df2c3a38d57df6af1909b16d",
"score": "0.74251735",
"text": "def create_account\n if new_record? && !self.account_id\n account = Account.new\n account.name = \"Preecha o nome da sua empresa\"\n account.save\n self.account_id = account.id\n self.admin = true\n end\n end",
"title": ""
},
{
"docid": "c19c890fa2116375620dbaab72420284",
"score": "0.74033225",
"text": "def create\n # authorize @accounts\n @account = Account.new(account_params)\n @account.user_id=current_user.id\n if @account.save\n redirect_to @account, notice: \"Account was successfully created.\" \n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "9001a1e7cf8986de1cac261f343d1d34",
"score": "0.73977166",
"text": "def create_user\n params = {\n :client_id => Swiftype.platform_client_id,\n :client_secret => Swiftype.platform_client_secret\n }\n post(\"users.json\", params)\n end",
"title": ""
},
{
"docid": "67a066c73730a986193d2ff38108f3d3",
"score": "0.7350758",
"text": "def create\n if user_params[:password_confirmation]\n user = User.create!(user_params)\n\n session[:user_id] = user.id\n session[:expiration_time] = Time.now + 6*60*60 # 6 hours until expiration\n \n response = { message: Message.account_created }\n json_response(response, :created)\n else\n response = { message: Message.password_confirmation_missing}\n json_response(response, :not_acceptable)\n end\n end",
"title": ""
},
{
"docid": "aced030ab94fe5d61c018041a8c80d92",
"score": "0.7337925",
"text": "def create\n\t@user = User.create(user_params)\n\tif @user.save\n\t\tflash[:notice] = \"Your account has been created.\"\n\telse\n\t\tflash[:notice] = \"There was an error creating your account.\"\n\tend\n\tredirect_to root_path\nend",
"title": ""
},
{
"docid": "4650d73a3f2cc99e806787b497a70fc4",
"score": "0.733292",
"text": "def create\n @account = Account.new(account_params.merge({ user_id: @current_user.id }))\n\n if @account.save\n render :show, status: :created, location: @account\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fad3a74110cfb3d22c55347ed2db467d",
"score": "0.7331778",
"text": "def create(params)\n put('v1/account', params)\n end",
"title": ""
},
{
"docid": "594dedf51114eb4d77e1986b96e5e2c0",
"score": "0.7310003",
"text": "def create(user)\n @user = User.new(user)\n # Encrypt password and immediately delete the cleartext version\n @user.encrypt_password\n @user.password = nil\n if @user.save\n redirect \"/\",\n :message => {:notice => \"Account created\"}\n else\n message[:error] = \"Registration failed\"\n render :new\n end\n end",
"title": ""
},
{
"docid": "ba3646495a2d1ca5bfdda3f35e599bae",
"score": "0.73001254",
"text": "def create_new_user_and_identity(auth, params)\n user = User.create!(\n first_name: auth.info[:first_name],\n last_name: auth.info[:last_name],\n email: auth.info[:email],\n oauth_signup: true,\n # referred_by_user_id => params.andand[\"rid\"]\n )\n user.confirm!\n create_new_identity(user, auth)\n end",
"title": ""
},
{
"docid": "08271349d810217416ac0277753726d9",
"score": "0.7285966",
"text": "def create_user\n params = {\n client_id: @client_id,\n email: @email\n }\n @user = User.using_client_shard(client: @client).create!(params)\n end",
"title": ""
},
{
"docid": "c1efcb2b01bf414a19916680dd5eb39f",
"score": "0.72792536",
"text": "def register\n\t\t@user = User.new(user_params)\n\n\t\trespond_to do |format|\n\t\t\tif @user.save\n\n\t\t\t\tformat.html { redirect_to login_path, notice: \"Account created successfully!\" }\n\t\t\telse\n\t\t\t\tformat.html { render action: :create_account }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "542b142dd9e7366ef81150fc7aaeb808",
"score": "0.7277551",
"text": "def create\n\t\t\t\t@user = User.create!(create_user_params)\n\t\t\tend",
"title": ""
},
{
"docid": "808135375b38d1dca67591c4e04fe4ee",
"score": "0.72774065",
"text": "def create_user(attributes)\n BrickFTP::API::User.create(attributes)\n end",
"title": ""
},
{
"docid": "808135375b38d1dca67591c4e04fe4ee",
"score": "0.7277108",
"text": "def create_user(attributes)\n BrickFTP::API::User.create(attributes)\n end",
"title": ""
},
{
"docid": "35039007213779fba596e40ea7fd4dc3",
"score": "0.72685266",
"text": "def create\n user = AuthenticationManager.new(\n params.slice(%i[email first_name last_name password]).merge(is_profile_owner: true, password_confirmation: params[:password], tos_accepted: params.bool(:tos_accepted))\n ).register\n user = session_manager.login(user.email, params[:password], use_api_token: true)\n json_success user: api_response.current_user_data(user)\n end",
"title": ""
},
{
"docid": "2bd44f155d6f90fa3fdd6b1cd33fd85c",
"score": "0.72540706",
"text": "def create\n cookies.delete :auth_token\n @user = User.new(params[:user])\n @user.save!\n self.current_user = @user\n redirect_back_or_default('/')\n flash[:notice] = 'Your account has been created. Please check your email.'\n rescue ActiveRecord::RecordInvalid\n render :action => 'new'\n end",
"title": ""
},
{
"docid": "99475e3c4ae3f8e979e49bc56be14a31",
"score": "0.7252135",
"text": "def create_user(options = {})\n post \"/users\", options\n end",
"title": ""
},
{
"docid": "b2fc95daec940727bf63597c51718886",
"score": "0.7246635",
"text": "def create_account\n @customer = Customer.find params[:id]\n fail unless @customer.email == params[:customer][:email]\n @customer.update_attributes!(customer_params)\n @customer_session = Authentication::CustomerSession.new(\n email: @customer.email,\n password: customer_params[:password]\n )\n @customer_session.save!\n end",
"title": ""
},
{
"docid": "aca8b622d0d96b7ab4e3ebc01ce24a00",
"score": "0.72403544",
"text": "def create\n @user = User.new(user_params)\n #@user.profile_picture = \"/assets/images/default_profile.jpg\"\n if @user.save\n UserMailer.registration_confirmation(@user).deliver\n auth_token = AuthenticateUser.new(@user.email, @user.password).call\n response = {status: 'SUCCESS', message: Message.account_created, auth_token: auth_token }\n render json: response, status: :created\n else\n render json: {status: 'FAIL', message: \"Email already taken or passwords don\\'t match\"}, status: :ok\n end\n end",
"title": ""
},
{
"docid": "4cfa74ef155113b8727a1aa01ca263ba",
"score": "0.72379255",
"text": "def newaccount\n if params[:commit] == \"Cancel\"\n session[:authhash] = nil\n session.delete :authhash\n redirect_to root_url\n else # create account\n @newuser = User.new\n @newuser.name = session[:authhash][:name]\n @newuser.email = session[:authhash][:email]\n @newuser.services.build(:provider => session[:authhash][:provider], :uid => session[:authhash][:uid], :uname => session[:authhash][:name], :uemail => session[:authhash][:email])\n \n if @newuser.save!\n # signin existing user\n # in the session his user id and the service id used for signing in is stored\n session[:user_id] = @newuser.id\n session[:service_id] = @newuser.services.first.id\n \n flash[:notice] = 'Your account has been created and you have been signed in!'\n\tif session[:authhash][:provider] == 'facebook'\n\t\tredirect_to services_facebook_redirect_path\n\telse\n \tredirect_to services_path\n\tend\n else\n flash[:error] = 'This is embarrassing! There was an error while creating your account from which we were not able to recover.'\n redirect_to root_url\n end \n end\n end",
"title": ""
},
{
"docid": "e5c013c824049ea724eb0aa2dcef5e5a",
"score": "0.72331816",
"text": "def create_new_account(email, full_name=nil, password=nil)\n return call('User.create', {'email' => email, 'full_name' => full_name,\\\n 'password' => password})\n end",
"title": ""
},
{
"docid": "546447803d27a801871075a9d7f971e0",
"score": "0.7231746",
"text": "def create\n @account = Account.new(:name=>params[:account_name].downcase, :password=>params[:password], :password_confirmation =>params[:password_confirmation], :account_type=>params[:account_type])\n user = User.new\n user.nick_name = params[:nick_name]\n @account.user = user\n\n respond_to do |format|\n if @account.save\n session[:user_id] = @account.user.id\n format.html { redirect_to(:controller=>'yueyue_objects', :action => \"index\") }\n format.xml { render :xml => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd14ea4cc268f9280dc031bb071699b7",
"score": "0.72313774",
"text": "def create\n megam_rest.post_accounts(to_hash)\n end",
"title": ""
},
{
"docid": "b9bc72c10c22fddc214216439b829a16",
"score": "0.72263587",
"text": "def create_account(account_name)\r\n\t\taccount = Account.new\r\n\t\taccount.name = account_name\r\n\t\taccount.user = self\r\n\r\n\t\tif account.valid?\r\n\t\t\taccount.save\r\n\t\t\treload\r\n\t\tend\r\n\r\n\t\treturn account\r\n\tend",
"title": ""
},
{
"docid": "85586e25dc6feaca652b72ab8979f753",
"score": "0.7220564",
"text": "def create\n @account = Account.new(params[:account])\n @account.owner = current_user\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c6cdebf418ce42f3b6a202a0bb83a24",
"score": "0.7202273",
"text": "def create\n @account = Account.new(name: account_params[:name])\n \n respond_to do |format|\n if @account.save\n user = @account.users.build(account_params[:users_attributes])\n if user.save\n session[:user_id] = user.id\n format.html { redirect_to samples_path, notice: 'account was successfully created.' }\n format.json { render samples_path, status: :created, location: @account }\n else\n format.html { redirect_to register_path, notice: 'Error, in user save' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :new, notice: 'Error, in account save' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c19b479dabd05a04837a2ac3529f2813",
"score": "0.71949506",
"text": "def create( params )\n params.delete( :id ) # Prevent overwriting ID\n Account.new( params ).save\n end",
"title": ""
},
{
"docid": "98aa0b0c9997dbaccbb2dd813ba123f4",
"score": "0.71940345",
"text": "def create_user(**args)\n params = parameters(args) do\n required_params :name, :email, :active_flag\n optional_params :name, :email, :active_flag\n end\n request(:post, 'users', params)\n end",
"title": ""
},
{
"docid": "a6500dd0deff639946792df50ab0b1af",
"score": "0.7187396",
"text": "def create\n @account = Account.new(account_params)\n\n if @account.save\n redirect_to root_path, notice: 'Account was successfully created.'\n else\n redirect_to root_path, alert: 'Some thing went wrong! try more...'\n end\n end",
"title": ""
},
{
"docid": "28024810fc31ffb6c62cf708ba430bdb",
"score": "0.7178136",
"text": "def create_user(user_hash={})\n @user = User.new(user_hash)\n @user.save\n end",
"title": ""
},
{
"docid": "28024810fc31ffb6c62cf708ba430bdb",
"score": "0.7178136",
"text": "def create_user(user_hash={})\n @user = User.new(user_hash)\n @user.save\n end",
"title": ""
},
{
"docid": "f9c23e0827aae5c5987fff4b5bbd3188",
"score": "0.71767503",
"text": "def create_account(account_create_model, fields = '')\n if account_create_model.blank?\n raise LoginRadius::Error.new, getValidationMessage('account_create_model')\n end\n\n query_parameters = {}\n query_parameters['apiKey'] = @api_key\n query_parameters['apiSecret'] = @api_secret\n unless isNullOrWhiteSpace(fields)\n query_parameters['fields'] = fields\n end\n\n resource_path = 'identity/v2/manage/account'\n post_request(resource_path, query_parameters, account_create_model)\n end",
"title": ""
},
{
"docid": "c1a1a815d306aa41e59c1213c17cb21f",
"score": "0.7168586",
"text": "def create_account(body, opts = {})\n data, _status_code, _headers = create_account_with_http_info(body, opts)\n data\n end",
"title": ""
},
{
"docid": "282f5de721718ccb91b7815916b2da5c",
"score": "0.7166533",
"text": "def create\n user = User.new(user_params)\n if user.save\n payload = { user_id: user.id }\n\n hmac_secret = 'my$ecretK3ys'\n\n auth_token = JWT.encode(payload, hmac_secret)\n\n render json: { message: 'Account created successfully', auth_token: auth_token }\n else\n render json: { message: 'Something went wrong', errors: user.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "891e45751e0229e93d4ee54154f0d264",
"score": "0.7165168",
"text": "def create\n\t\t@user = User.new(user_params)\n\t\t# If user was save with succes, then sign in automaticly, else, render new.\n\t\tif @user.save\n\t\t\tsign_in @user\n\t\t \tflash[:sucess] = \"Seja bem-vindo!\"\n\t\t\tredirect_to :action => :show, :id => @user.id\n\t\t\tCUSTOM_LOGGER.info(\"Created and associated user to params #{@user.to_yaml}\")\n\t\telse\n\t\t\trender 'new'\n\t\t\tCUSTOM_LOGGER.error(\"Not created and associated user to params #{@user.to_yaml}\")\n\t\tend\n\tend",
"title": ""
},
{
"docid": "be65fb95b79b1056f394796555826383",
"score": "0.7145696",
"text": "def create\n\t\tcookies.delete 'auth_token'\n\t\treset_session\n\t\t\n\t\tself.new\n\t\t# User model doesn’t require email, but web login does\n\t\[email protected]_required = true\n\t\[email protected]_at = Time.current\n\t\t# anti-spam\n\t\tunless (params[:user].nil? or params[:user][:login].blank?) and (params[:user].nil? or params[:user][:url].blank?)\n\t\t\t# looks like a non-human is trying to auto-fill the form\n\t\t\traise Wayground::SpammerDetected\n\t\tend\n\t\[email protected]!\n\t\tself.current_user = @user\n\t\t\n\t\t# send email confirmation\n\t\tif @user.email_addresses[0] and Notifier.deliver_signup_confirmation(@user.email_addresses[0])\n\t\t\tflash[:notice] = \"Thanks for signing up! A confirmation email has been sent to you at #{@user.email}. Please look for a message from #{(WAYGROUND['SENDER'].gsub(/[><]/){|x|{'>'=>'>','<'=>'<'}[x]})}.\"\n\t\telse\n\t\t\tflash[:error] = \"Your new user account has been created, but there was an error when trying to send an email confirmation. Please contact the website administrator about this problem. #{WAYGROUND['EMAIL']}\"\n\t\tend\n\t\t\n\t\tredirect_to '/users/account'\n\trescue Wayground::SpammerDetected\n\t\tblock_spammer\n\t\t# skip the save, but let them think it was saved\n\t\tflash.now[:notice] = \"Thanks for signing up! A confirmation email has been sent to you at #{@user.email}. Please look for a message from #{(WAYGROUND['SENDER'].gsub(/[><]/){|x|{'>'=>'>','<'=>'<'}[x]})}.\"\n\t\t@page_title = 'User Account'\n\t\trender :action=>:account\n\trescue ActiveRecord::RecordInvalid\n\t\trender :action=>'new'\n\tend",
"title": ""
},
{
"docid": "d1c3fe1eefb4e728a571b5747c310359",
"score": "0.7141192",
"text": "def create\n @user = User.new(params[:user])\n respond_to do |format|\n if @user.save\n sign_in @user\n format.html { redirect_to @user, notice: 'Account created - welcome to StoryStore!' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4587eebb0b43ff1da95780220aecf235",
"score": "0.7134615",
"text": "def create\n @account = Account.new(account_params)\n\n if @account.save\n AccountMailer.welcome(@account).deliver_later\n\n if current_user && @account.owner == current_user\n # User is already signed in and owns the account\n redirect_to @account, notice: 'Welcome to your new account!'\n else\n # User is not signed in or specified another user as the account owner\n redirect_to account_created_path\n end\n else\n @plans = Plan.all\n render :new\n end\n end",
"title": ""
},
{
"docid": "b2f4091e6d891db9711bc9e6f8c5705c",
"score": "0.7119723",
"text": "def create\n @user = User.new(params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to(@user, :notice => 'Account registered!') }\n format.json { render :json => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "710d6c6e047537342e45cfdf9519e16e",
"score": "0.71111506",
"text": "def create_new_user\n username = find_username\n @user = User.new(\n email: auth_email,\n username: username,\n password: Devise.friendly_token[0, 20]\n )\n @user.skip_confirmation!\n @user.save!\n\n @user\n end",
"title": ""
},
{
"docid": "b5ee59726956fbd02b3c073ea127f836",
"score": "0.7099562",
"text": "def create\n respond_to do |format|\n if @user.save(account_update_params)\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9cdff60a31fa643a4dd8ebf0b415c6b",
"score": "0.70994717",
"text": "def create\n @user = User.create! user_params\n logger.info \"New User with id #{@user.id} has been saved.\"\n #\n # log-in the user immediately after sign-up\n # issue a refresh token with that the\n # user will request an access token.\n set_refresh_token @user\n render :show, status: :created\n end",
"title": ""
},
{
"docid": "71d4ce23424967b5aa36dcaa1b2da993",
"score": "0.70978856",
"text": "def create_user\n User.create name: \"test\", email: \"[email protected]\", password: \"123456\"\n end",
"title": ""
},
{
"docid": "b9153c4a5c454d148a46ad10fa635653",
"score": "0.70955753",
"text": "def create\n @user = User.new(user_params)\n\n # save was requested by either current_user or else must be a new registration\n if @user.save(current_user)\n redirect_to users_path\n else\n render('new', status: :unprocessable_entity)\n end\n end",
"title": ""
},
{
"docid": "8561b6dc598b2e6ff2352b86b5e0b307",
"score": "0.7095241",
"text": "def create_user(options = {})\n post :create, {:user => { :name => 'quire', :point_value => \"2\", :login => 'quire', :email => '[email protected]',\n :password => 'quire', :password_confirmation => 'quire' }.merge(options)}, {:user_id => \"1\"}\n end",
"title": ""
},
{
"docid": "58eb298ac6c299d918f70a130fb51730",
"score": "0.7092956",
"text": "def create\n @user = User.new(user_params)\n User.create_with_omniauth\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "380d7dde9ffbf29059ecc0545a04cff8",
"score": "0.7083056",
"text": "def create\n @user = User.new(safe_params[:user])\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to \"/\", notice: \"Account registered!\" }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad56e9ced3bdfe1b1e89296167bbe6a2",
"score": "0.7082565",
"text": "def create\n extuser = User.find_by(username: user_params[:username])\n if(extuser.nil?)\n @user = User.new(user_params)\n @user.high_score = 0\n @user.save!\n auth_token = AuthenticateUser.new(user_params[:username], user_params[:password]).call\n response = { message: Message.account_created, auth_token: auth_token, high_score: 0 }\n json_response(response, :created)\n else\n response = { message: Message.dublicate_user }\n json_response(response, :bad_request)\n end \n end",
"title": ""
},
{
"docid": "b4a2be93be0e7682eca8b4e59102c473",
"score": "0.7079675",
"text": "def create_account\n account = Account.new(:email => email, :subdomain => subdomain)\n account.save!\n end",
"title": ""
},
{
"docid": "85534439146d2c51b9964a2e549f38cc",
"score": "0.70758176",
"text": "def create\n omniauth = request.env['omniauth.auth']\n authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid'])\n if authentication\n flash[:notice] = \"Signed in successfully\"\n sign_in_and_redirect(:account, authentication.account)\n else\n user = Account.new(password: Devise.friendly_token) # If you create an account with twitter/fb, we don't need a passwod\n user.apply_omniauth(omniauth)\n user.email = get_email_from_omniauth omniauth\n if user.save\n flash[:notice] = \"Successfully registered\"\n sign_in_and_redirect(:account, user)\n else\n session[:omniauth] = omniauth.except('extra')\n session[:omniauth_email] = omniauth['extra'] && omniauth['extra']['user_hash'] && omniauth['extra']['user_hash']['email']\n\n # Check if email already taken. If so, ask user to link_accounts\n if user.errors[:email][0] =~ /has already been taken/ # omniauth? TBD\n # fetch the user with this email id!\n user = Account.find_by_email(user.email)\n return redirect_to link_accounts_url(user.id)\n end\n redirect_to new_account_registration_url\n end\n end\n end",
"title": ""
},
{
"docid": "60d827537ad74169b0f9a7e95007981d",
"score": "0.7073454",
"text": "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n\n # sign in user\n user = @account.users.first\n sign_in(:user, user)\n @account.update_attributes(user_id: user.id)\n\n format.html { redirect_to prism_root_path(@account), notice: 'Welcome to Satiisfy!' }\n format.json { render action: 'show', status: :created, location: @account }\n else\n format.html { render action: 'new' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a8095cf091dff4d0d15c2a4d9fe86942",
"score": "0.70726186",
"text": "def create\n @account = Account.new(account_params)\n @account.zip = Account.random_zip\n @account.user_id = @current_user.id if @current_user\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d867f3cc5dbeb97bd019127efe59771",
"score": "0.7071793",
"text": "def create\n user = User.new(user_params)\n msg = if user.save\n 'User has successfully created.'\n else\n set_error(:unprocessable_entity, user)\n end\n common_response(msg, user: user)\n end",
"title": ""
},
{
"docid": "c56c9d44508f70ddfa5a52e32c44d118",
"score": "0.7068455",
"text": "def create\n logout_keeping_session!\n\n\t\t# create a new user with the parameters provided\n @user = User.new(params[:user])\n\t\t\n\t\t# if creation of @user is successful and if it was written to the database successfully\n success = @user && @user.save\n\t\t\n\t\t# if success is TRUE and if there were no errors\n if success && @user.errors.empty?\n\t\t\t# redirect back and flash a pop up regarding successful creation \n redirect_back_or_default('/')\n gflash :success => \"Thanks for signing up! We're sending you an email with your activation code.\"\n else\n\t\t\t# else display pop up error and redirect back to the page\n gflash :error => \"We couldn't set up that account, sorry. Please try again, or contact an admin (link is above).\"\n render :action => 'new'\n end\n end",
"title": ""
},
{
"docid": "efec561d641e4ccc204c5d34ce5783b9",
"score": "0.70682377",
"text": "def create\n @user = User.new(user_params)\n if @user.save\n UserMailer.account_activation(@user).deliver_now\n flash[:info] = \"Proszę sprawdź swój email, aby aktywować konto\"\n redirect_to root_url\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "a7dc2e73fefb46ccf97cefb7569a2beb",
"score": "0.70661896",
"text": "def create\n @user = User.new(user_params)\n @user.tenant_id = current_tenant.id\n if @user.save\n render json: {\n message: 'User was successfully created.',\n user: @user\n }\n else\n render json: {message: 'User Not Created'}\n end\n end",
"title": ""
},
{
"docid": "4b98524bce03b509020462edcb780050",
"score": "0.70638347",
"text": "def open_user_account\n Account.create(user_id: self.id) \t\n end",
"title": ""
}
] |
5a946bab6e095b2261317d594905af50
|
show works that are in the active state.
|
[
{
"docid": "24e207d04767f877d9e042907d70407e",
"score": "0.0",
"text": "def show_only_active_records(solr_parameters)\n solr_parameters[:fq] ||= []\n solr_parameters[:fq] << '-suppressed_bsi:true'\n end",
"title": ""
}
] |
[
{
"docid": "1061492db8acb1bc910e37c53d1d44ea",
"score": "0.62816906",
"text": "def show\n @task_items = @task_list.items.active\n end",
"title": ""
},
{
"docid": "dfa55c3b8d1e89ee1a4d3b1c20fc41b7",
"score": "0.6179334",
"text": "def show\n\t\t@works = @anthology.works.decorate\n\tend",
"title": ""
},
{
"docid": "024bbd7c1124966d80f971bfd64b11c3",
"score": "0.6110633",
"text": "def active\n active?\n end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.6098524",
"text": "def active; end",
"title": ""
},
{
"docid": "8d19c5a7ff773bf998fad8e175eb5b88",
"score": "0.6098524",
"text": "def active; end",
"title": ""
},
{
"docid": "1f69eac1f2685ee420c74b539fc375b7",
"score": "0.6077614",
"text": "def show_works_widget\n @show_works_widget = true\n end",
"title": ""
},
{
"docid": "04fca4a78431588b7d5af3b4cec72834",
"score": "0.6047154",
"text": "def show; @showing = false; end",
"title": ""
},
{
"docid": "ca097545995bba092374cf5ab88c48b3",
"score": "0.59927857",
"text": "def active?; end",
"title": ""
},
{
"docid": "11cbe1dcec09e52caaa98eb8e2e205c1",
"score": "0.5973632",
"text": "def active?\n active\n end",
"title": ""
},
{
"docid": "1b0ddc80c967bdf112a2741914266958",
"score": "0.5970704",
"text": "def active?; @active; end",
"title": ""
},
{
"docid": "1b0ddc80c967bdf112a2741914266958",
"score": "0.5970704",
"text": "def active?; @active; end",
"title": ""
},
{
"docid": "b8a8865ab2e37bbe505fc593355443ed",
"score": "0.5933372",
"text": "def active\n @active.flatten.compact\n end",
"title": ""
},
{
"docid": "8b07acebc2f0b7713b8e604ee5ef6187",
"score": "0.59023684",
"text": "def active?\n true\n end",
"title": ""
},
{
"docid": "0341c1efb56af19877649491da759fb9",
"score": "0.5877514",
"text": "def show\n @noise_indicators = NoiseIndicator.where(staff_worker_id: @staff_worker.id)\n @total_vibration_indicators = TotalVibrationIndicator.where(staff_worker_id: @staff_worker.id)\n @local_vib_f_indicators = LocalVibFIndicator.where(staff_worker_id: @staff_worker.id)\n @local_vib_s_indicators = LocalVibSIndicator.where(staff_worker_id: @staff_worker.id)\n @working_operations = WorkingOperation.where(staff_worker_id: @staff_worker.id)\n end",
"title": ""
},
{
"docid": "9e5718711ecd94eb3c6aa6f5e4ac6414",
"score": "0.58656657",
"text": "def active_label\n self.active? ? 'active' : 'inactive'\n end",
"title": ""
},
{
"docid": "2f8aa5977c9f1ecba50ef7a5a12c63d7",
"score": "0.586041",
"text": "def show_trainer\n\t\t@inactive_trainer = Trainer.where(active: false).joins(:user)\n\t\t@active_trainer = Trainer.where(active: true).joins(:user)\n\tend",
"title": ""
},
{
"docid": "62b679cabad63efaf44cab73f6850796",
"score": "0.58339155",
"text": "def active?\n self.active\n end",
"title": ""
},
{
"docid": "62b679cabad63efaf44cab73f6850796",
"score": "0.58339155",
"text": "def active?\n self.active\n end",
"title": ""
},
{
"docid": "e453150287c3654be30c1263239f0906",
"score": "0.582343",
"text": "def active?\n @state.active?\n end",
"title": ""
},
{
"docid": "9a44fe3fb83d575c147cc17e53e8a363",
"score": "0.5822389",
"text": "def active?\n end",
"title": ""
},
{
"docid": "9a44fe3fb83d575c147cc17e53e8a363",
"score": "0.5822389",
"text": "def active?\n end",
"title": ""
},
{
"docid": "6fe3fb106239d0e58562e2f31214779b",
"score": "0.5815072",
"text": "def active?\n active\n end",
"title": ""
},
{
"docid": "9786f2c2de59a6c34bccd7847618a2b6",
"score": "0.58022803",
"text": "def active?\n active\n end",
"title": ""
},
{
"docid": "9786f2c2de59a6c34bccd7847618a2b6",
"score": "0.58022803",
"text": "def active?\n active\n end",
"title": ""
},
{
"docid": "9786f2c2de59a6c34bccd7847618a2b6",
"score": "0.58022803",
"text": "def active?\n active\n end",
"title": ""
},
{
"docid": "9786f2c2de59a6c34bccd7847618a2b6",
"score": "0.58022803",
"text": "def active?\n active\n end",
"title": ""
},
{
"docid": "8bc3a35b4f6752f014e330f003f881a0",
"score": "0.5792576",
"text": "def show_stages_of_project(project)\n a_stage_active = false\n \n # check each stage\n project.stages.each do |stage|\n a_stage_active = true unless active_link_class(stage).blank?\n end\n \n # check project\n a_stage_active = true unless active_link_class(project).blank?\n \n a_stage_active ? '' : 'display:none;'\n end",
"title": ""
},
{
"docid": "87a88fdeeba4be9d60ae726370a1f97a",
"score": "0.57730436",
"text": "def show_list\n process_show_list\n end",
"title": ""
},
{
"docid": "889bc8feab802b42efefc275c68bde17",
"score": "0.5748457",
"text": "def active?\n true\n end",
"title": ""
},
{
"docid": "2d89f8e99b2acc2a2ac036d294211529",
"score": "0.5734578",
"text": "def show\n @teammembers = Teammember.where(member_id: params[:id]).includes(:team)\n @teams = Team.active().where(member_id: params[:id])\n\n @courses = Course.active().where(member_id: params[:id]).includes(:topic).order(:title) \n @interests = Interest.where(member_id: params[:id]).includes(:topic)\n @programs = NamedList.where(list_name: 'program').select(:entry_name).order(\"id DESC\")\n\n @subscriptions = Subscription.where(member_id: params[:id]).includes(:course).order(\"status DESC\", :due)\n\n @subscriptions.each do |m| \n m.credits = m.course.credits.present? ? m.course.credits : 0;\n if m.status == \"Completed\" or m.status == \"Certified\"\n m.complete = true\n elsif m.status == \"Exempted\" or m.status == \"Dropped\"\n m.ignore = true\n elsif m.due != nil && m.due < Date.today()\n m.overdue = true\n end\n end\n\n end",
"title": ""
},
{
"docid": "274e6d98d83614cc1965c9437ce72ee0",
"score": "0.5730874",
"text": "def show\n @visible = true\n self\n end",
"title": ""
},
{
"docid": "5103cc463a92a4a35838dae745001d83",
"score": "0.57291704",
"text": "def active?\n @active != false\n end",
"title": ""
},
{
"docid": "abd2b152014f01323700aeded8978fcb",
"score": "0.5720416",
"text": "def show\n self.visible = true\n end",
"title": ""
},
{
"docid": "b6e76d084002ac18fe2b5f35cf498242",
"score": "0.57202166",
"text": "def active_cells; @cells.select(&:active?) end",
"title": ""
},
{
"docid": "11c6a2e0e78be5f803d57f2c0b7b505d",
"score": "0.57158935",
"text": "def show!\n visible(true)\n end",
"title": ""
},
{
"docid": "11c6a2e0e78be5f803d57f2c0b7b505d",
"score": "0.57158935",
"text": "def show!\n visible(true)\n end",
"title": ""
},
{
"docid": "9a3b0d0403778e6471ba247999d2b53b",
"score": "0.5707821",
"text": "def display_featured_works?\n Flipflop.show_featured_works?\n end",
"title": ""
},
{
"docid": "1fe054f6472dd0c25f3a8c0a5ba006a1",
"score": "0.5704047",
"text": "def active?\n\t\t\tstate == 'active'\n\t\tend",
"title": ""
},
{
"docid": "69d210730918bd7d93e5b8d14bd85654",
"score": "0.57034224",
"text": "def show\n\t\t#no need b/c we just show all at once\n\tend",
"title": ""
},
{
"docid": "a138210f4c9654eff4d83346dc1e11f4",
"score": "0.57019365",
"text": "def active?\n @active\n end",
"title": ""
},
{
"docid": "a138210f4c9654eff4d83346dc1e11f4",
"score": "0.57019365",
"text": "def active?\n @active\n end",
"title": ""
},
{
"docid": "a138210f4c9654eff4d83346dc1e11f4",
"score": "0.57019365",
"text": "def active?\n @active\n end",
"title": ""
},
{
"docid": "5b596884fd7abc54f617f47e9adf7976",
"score": "0.57013696",
"text": "def active?\n @active\n end",
"title": ""
},
{
"docid": "0b6b0f3a070c9b9465b644db5ffc154c",
"score": "0.5695232",
"text": "def active?\n activated == true\n end",
"title": ""
},
{
"docid": "cc54f66eb93f7a6542b55343f519376c",
"score": "0.5689263",
"text": "def active?\n @active\n end",
"title": ""
},
{
"docid": "cc54f66eb93f7a6542b55343f519376c",
"score": "0.5689263",
"text": "def active?\n @active\n end",
"title": ""
},
{
"docid": "cc54f66eb93f7a6542b55343f519376c",
"score": "0.5689263",
"text": "def active?\n @active\n end",
"title": ""
},
{
"docid": "b7d945b9a0a89d3e11668e9802cf01b6",
"score": "0.5684699",
"text": "def show_state\n puts \"#{name} a #{life_points} points de vie !!\"\n end",
"title": ""
},
{
"docid": "178b10c18f229f7521d5cdacf73ff3d3",
"score": "0.5682232",
"text": "def active?; status == :active; end",
"title": ""
},
{
"docid": "afd77f4bc331044ae6ae13a35e924ce4",
"score": "0.56797826",
"text": "def show\n @show = Show.find(params[:id])\n @products = @show.products.active.uniq\n @characters = @show.characters.active\n @outfits = @show.outfits.approved.uniq\n end",
"title": ""
},
{
"docid": "b50fd4b38652ba64a01129c9d68e2d0b",
"score": "0.5666519",
"text": "def show_state\n\t\tputs \"#{self.name} a #{self.life_points} points de vie et une arme de niveau #{self.weapon_level}.\"\n\tend",
"title": ""
},
{
"docid": "11886c1bfa5d89c357ebb9a541c1cca8",
"score": "0.566572",
"text": "def found_show_all\n showing_all_items?\n end",
"title": ""
},
{
"docid": "ca99776ee94ea72eab06cf20158be455",
"score": "0.56570935",
"text": "def show_state\n\t\tputs \"#{@name} a #{@life_points} points de vie.\"\n\tend",
"title": ""
},
{
"docid": "ab308370c56d3cf385f16dc85f80424f",
"score": "0.5654908",
"text": "def active_tasks\n @tasks.select { | task | task.active }\n end",
"title": ""
},
{
"docid": "14753c621017ad61f20bf43c46b71fd0",
"score": "0.56528854",
"text": "def forFriendfunctions\n @status = false\n self.hide\n showElements\n end",
"title": ""
},
{
"docid": "f67e852235511772fd9c16b95b31d1e7",
"score": "0.5646867",
"text": "def show_state\n puts \"#{self.name} a #{self.life_points} points de vie.\"\n end",
"title": ""
},
{
"docid": "cf608273e11fb9f8686cdb97e7403703",
"score": "0.56465214",
"text": "def show_state\n puts \"#{@name} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end",
"title": ""
},
{
"docid": "a4c29ed4492d7ec7da14f6c7a38fe9db",
"score": "0.56407624",
"text": "def is_visible?\n setup.show_all? || Date.today >= start_at\n end",
"title": ""
},
{
"docid": "3151730379497d69e61e180fde582460",
"score": "0.56404686",
"text": "def active?\n true\n end",
"title": ""
},
{
"docid": "3151730379497d69e61e180fde582460",
"score": "0.56404686",
"text": "def active?\n true\n end",
"title": ""
},
{
"docid": "3151730379497d69e61e180fde582460",
"score": "0.56404686",
"text": "def active?\n true\n end",
"title": ""
},
{
"docid": "0830fe3bb7e3a4cba2482131a8af0f0c",
"score": "0.5637645",
"text": "def show_state\n puts \"#{name} a #{life_points} points de vie!\"\n end",
"title": ""
},
{
"docid": "9990284430deceb330f67c996e4f9efe",
"score": "0.56324565",
"text": "def show \r\n end",
"title": ""
},
{
"docid": "4f6dd3de1af8235e087b65cac147f57c",
"score": "0.5629962",
"text": "def show_state\n puts \"#{@name} a #{@life_points} points de vie.\"\n end",
"title": ""
},
{
"docid": "fb4d5466ebe6d46c53770b3c2dc6762a",
"score": "0.5627953",
"text": "def show() end",
"title": ""
},
{
"docid": "fb4d5466ebe6d46c53770b3c2dc6762a",
"score": "0.5627953",
"text": "def show() end",
"title": ""
},
{
"docid": "fb4d5466ebe6d46c53770b3c2dc6762a",
"score": "0.5627953",
"text": "def show() end",
"title": ""
},
{
"docid": "37b61b261b293334fae2c4d764165846",
"score": "0.56191415",
"text": "def show\n @tasks = @assignment.tasks\n @assignment.is_ready\n end",
"title": ""
},
{
"docid": "2464d11eea597d714d99792cd88b2e9a",
"score": "0.56148815",
"text": "def active\n base.image_for(\"#{name}_active\")\n end",
"title": ""
},
{
"docid": "9749c5626981f746e8d1c255841661e0",
"score": "0.5613866",
"text": "def active?\n self.status == \"Active\"\n end",
"title": ""
},
{
"docid": "d0b402c75336b6bc9e541710726b6d54",
"score": "0.5612238",
"text": "def active?\n return @active\n end",
"title": ""
},
{
"docid": "1f248b1294d4bca74d8e930b13d10362",
"score": "0.56056315",
"text": "def active?\n head.active?\n end",
"title": ""
},
{
"docid": "96a76de1f2b5ea2bd0a7f770a35f7a60",
"score": "0.56044436",
"text": "def display_all_waiaria_states\n # Interface method\n end",
"title": ""
},
{
"docid": "2912863fe4980b14901012702816384a",
"score": "0.55991197",
"text": "def show\n @hackathons = @idea.hacker == current_hacker ? Hackathon.all : []\n end",
"title": ""
},
{
"docid": "eb01e3bf7abeadee308a5163c42c5937",
"score": "0.55978173",
"text": "def show_state\n puts \"#{self.name} a #{self.life_points} points de vie et son arme est de niveau #{self.weapon_level}.\"\n end",
"title": ""
},
{
"docid": "04bcb52f7aaccb4826f98fa4e50379cc",
"score": "0.5595496",
"text": "def current \n find_by_active(true)\n end",
"title": ""
},
{
"docid": "1406b7506751eba713c8dd7faf6ccb10",
"score": "0.5594478",
"text": "def show_state\n puts \"#{@name} a #{@life_points} de vie\"\n end",
"title": ""
},
{
"docid": "d5ada5ab499a13ce0497e07437c4d500",
"score": "0.5587248",
"text": "def active?\n @active.value\n end",
"title": ""
},
{
"docid": "897d4f4b98de90306a30ba0172b62a77",
"score": "0.558019",
"text": "def show_list\n\t\t\t@my_list.show\n\t\tend",
"title": ""
},
{
"docid": "c597a8db4aa44595194a489eb30f1bde",
"score": "0.5580073",
"text": "def show_state\n puts \"#{@name} a #{@life_points} points de vie\"\n end",
"title": ""
},
{
"docid": "54e9a8b4291a9162c76be8df3af10223",
"score": "0.557076",
"text": "def show?\n user.active?\n end",
"title": ""
},
{
"docid": "139ac8f522af5d7ce6c6868572d8842e",
"score": "0.5570022",
"text": "def show\n @components = @project.components\n @for_bidding = @components.where(status: 1).order('created_at desc')\n @ongoing = @components.where(status: 2).order('created_at desc')\n @completed = @components.where(status: 3).order('created_at desc')\n @funding = @components.where(status: 4).order('created_at desc')\n end",
"title": ""
},
{
"docid": "900f4e210eefe88b021ec939e57b37e5",
"score": "0.55684644",
"text": "def show_state\n puts \"#{@names} a #{@life_points} points de vie et une arme de niveau #{@weapon_level}\"\n end",
"title": ""
},
{
"docid": "b7cc8c7855c2c7187493a48cd5cb1e29",
"score": "0.5555684",
"text": "def is_active \n\t\tif self.servings == 0\n\t\t\tself.active = false\n\t\tend\n\t\tactive\n\tend",
"title": ""
},
{
"docid": "6c19532da6c9f4c5312e6f42a8c8404c",
"score": "0.5555197",
"text": "def show_state\n \tputs \"#{@name} a #{life_points} points de vie\"\n end",
"title": ""
},
{
"docid": "97c2c6078d143eab5855466f6b386185",
"score": "0.5547772",
"text": "def show_state\n\t\treturn \"#{self.name} a #{self.life_points} points de vie.\"\n\tend",
"title": ""
},
{
"docid": "7e54187170f7e87a2247e1a1674cf9bd",
"score": "0.5545712",
"text": "def show\n @other_tools = @tool.others_from_this_owner\n @collaborators = @tool.collaborators\n end",
"title": ""
},
{
"docid": "5f9e08ec177f2e6932a390eb36e12dfb",
"score": "0.5543076",
"text": "def show_state \n puts \"#{@name} a #{@life_points} points de vie.\"\n end",
"title": ""
},
{
"docid": "51ccfee486e53b7f0f878766690b87d8",
"score": "0.55389947",
"text": "def activate\n @hidden = 0 # Active worksheet can't be hidden.\n @selected = 1\n set_activesheet(@index)\n end",
"title": ""
},
{
"docid": "035f05d3d644971fc282b9cbc2c8b0a0",
"score": "0.55374986",
"text": "def state_has_items\n\t\t\[email protected](0)\n\t\tend",
"title": ""
},
{
"docid": "2b8bfb8a1d8b9d79fe5347f3245cd2ac",
"score": "0.5534677",
"text": "def show\n self.checklabo?\n self.checkspatioport?\n self.checkministere?\n end",
"title": ""
},
{
"docid": "d003c94ff74652c16bf22ade1c37585a",
"score": "0.5530896",
"text": "def show_players\n puts \"Il reste #{players_left} enemies\"\n player1.show_state\n puts \"\\n\"\n end",
"title": ""
},
{
"docid": "47cb22cd6a4fed3410be36f79f618b2c",
"score": "0.552813",
"text": "def show\n @templates = SkinTemplate.where(active: true)\n end",
"title": ""
},
{
"docid": "16ca385c82dc00490a974a770568d9aa",
"score": "0.55232996",
"text": "def show_state\n puts \"#{names} a #{life_points} points de vie\"\n end",
"title": ""
},
{
"docid": "fd57ba43645d27d7b5bdb5653b352484",
"score": "0.55222034",
"text": "def active?\n @data[:active]\n end",
"title": ""
},
{
"docid": "c4c81b8add35743fb909543b871cdfdd",
"score": "0.5518515",
"text": "def show_state\n\t\tputs \"#{@name} a #{life_points} de points de vie et une arme de niveau #{weapon_level}\"\n\tend",
"title": ""
},
{
"docid": "dc0a780a865e26147b281694cbde4d78",
"score": "0.55156404",
"text": "def active?\n !inactive\n end",
"title": ""
},
{
"docid": "e13d5a2d39d80de2816ee39718030ba8",
"score": "0.5514879",
"text": "def activate\n @hidden = 0 # Active worksheet can't be hidden.\n @selected = 1\n @activesheet = @index\n end",
"title": ""
},
{
"docid": "4a84db37bb76fd1e0fa881f8fb76234d",
"score": "0.5513533",
"text": "def show_state\n puts \"#{@name} a #{@life_points} de PV\"\n end",
"title": ""
},
{
"docid": "bca5b9fe47932e249ba083b9ddeb1aa2",
"score": "0.55134755",
"text": "def show\n @closed = false\n bomb?\n end",
"title": ""
},
{
"docid": "2c421e060b06cf27918a585b8cc0600c",
"score": "0.5510034",
"text": "def show_tasks\n\t\tputs \"here are the tasks on the #{self.name} list...\"\n\t\[email protected]_index {|task, i| puts \"#{i.next}. \" + task.description + \" | complete: \" + task.status.to_s}\n\t\tputs \"\\n\"\n\tend",
"title": ""
}
] |
68b22053b76f6c9d76caaebbed29382b
|
Adds form field to paragraph, returns added form field's data.
|
[
{
"docid": "727c52dbd22257b3e36a313e9c999624",
"score": "0.0",
"text": "def put_form_field(request)\n data, _status_code, _headers = put_form_field_with_http_info(request)\n request_token if _status_code == 401\n data\n end",
"title": ""
}
] |
[
{
"docid": "caed7e14af74916ced34508960c8480e",
"score": "0.63744414",
"text": "def add_field\n if request.get?\n @info = Hash.new\n @field_hash = Hash.new\n session[:count] = 1\n else\n @fields = []\n @field_hash = Hash.new\n session[:field_hash] = @field_hash\n form = DynamicForm.find(session[:form_id])\n @info = params[:info]\n if form.fields == \"To be Filled\"\n logger.info 'FIELDS TO BE FILLED'\n form.fields = {}\n else\n @fields = YAML::load(form.fields)\n logger.info \"Loading YAML {line 92}\"\n end \n @fields << @info\n form.fields = @fields.to_yaml\n form.save\n logger.info \"Returned: #{@info}\"\n redirect_to :action => 'add_fields'\n end\n end",
"title": ""
},
{
"docid": "854a710a2d5045556c2f0de2fa80a015",
"score": "0.61833346",
"text": "def form_field_data\n @attributes[:form_field_data]\n end",
"title": ""
},
{
"docid": "802a0c373125773dfc96d538a8b8ba13",
"score": "0.60766774",
"text": "def add_field(field)\n\t\tend",
"title": ""
},
{
"docid": "21540c6e5046eb9b5172d95d0259b3a5",
"score": "0.6057603",
"text": "def add_field(name, value, type, required, validation, label_text, options = nil, size = nil )\n f = active_form\n f << { :name => name, :value => value, :type => type, :required => required, :validation => validation, :label_text => label_text, :options => options, :size => size }\n return f\n end",
"title": ""
},
{
"docid": "0e3aec2d6b294e1ec83377a397e76ac7",
"score": "0.6014328",
"text": "def data\n @field.widget.value_from_formdata(@form.data, @html_name)\n end",
"title": ""
},
{
"docid": "97f9d6c4f6790244d1e49a3f9f1bcbba",
"score": "0.58551157",
"text": "def add_field(params = {})\n post(\"/fields\", params)\n end",
"title": ""
},
{
"docid": "6697e25c8dfc0f79950e635b010b51db",
"score": "0.58276176",
"text": "def appendField (name, value, formName=\"\", frameName=\"\")\n \n setField(name, value, formName, frameName, true)\n end",
"title": ""
},
{
"docid": "963a5d0a6647bd2417183d49c100814e",
"score": "0.57630396",
"text": "def append(field)\n @fields.push(field)\n @fields.clean = false\n end",
"title": ""
},
{
"docid": "79cb87670ce7b4bb5451ce24eefd8816",
"score": "0.56959444",
"text": "def field(label = nil, note = nil, &contents)\n @fields << Field.new(:label => label, :note => note, &contents)\n end",
"title": ""
},
{
"docid": "063b0cbf3ae296db1cc88b715abc0fda",
"score": "0.56036747",
"text": "def link_to_add_field(name, f, association)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n render(association.to_s + \"_form\", :f => builder)\n end\n link_to_function(name, (\"add_field(this, '#{association}', '#{escape_javascript(fields)}')\"))\n end",
"title": ""
},
{
"docid": "70db4fe719b96496f571336799bfa606",
"score": "0.5560326",
"text": "def pp_text_field(object_name, method, options={})\n return pp_tag_helper(:text_field, object_name, method, options)\n end",
"title": ""
},
{
"docid": "dbb962df2cef1007d9fa836f2bd2c204",
"score": "0.55565363",
"text": "def add_field name, value\n @params << \"Content-Disposition: form-data; name=\\\"#{name}\\\"\\n\" + \n \"\\n\" + \n \"#{value}\\n\"\n end",
"title": ""
},
{
"docid": "598157e9789d4848437ce8f7bf925657",
"score": "0.5532609",
"text": "def link_to_add_fields(name, f, association, additional_params={})\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render(association.to_s.singularize + \"_fields\", f: builder)\n end\n data = {id: id, fields: fields.gsub(\"\\n\", \"\")}\n data[:insertion_point] = additional_params[:insertion_point] unless additional_params[:insertion_point].nil?\n link_to(name, '#', class: \"add_fields \" + (additional_params[:class].nil? ? \"\" : additional_params[:class]), data: data)\n end",
"title": ""
},
{
"docid": "c0f4cc60c280e56d0809dce7e1927aa7",
"score": "0.552784",
"text": "def custom_field_text(field, text)\n frm.text_field(:name=>field).set(text)\n end",
"title": ""
},
{
"docid": "a0da219ce41157d2ffec3bc285434cb7",
"score": "0.55225056",
"text": "def add(name, value)\n form_data << [name.to_s, value]\n end",
"title": ""
},
{
"docid": "5af424906577fdd854380d9255cb5b3c",
"score": "0.5444332",
"text": "def add(form_field_element)\n touch()\n if form_field_element.is_a?(Fieldset) then\n form_field_element.field_decorator = @field_decorator\n form_field_element.content_decorator = @content_decorator\n @element_map.update(form_field_element.element_map)\n @elements << form_field_element\n @fieldsets[form_field_element.name.to_s] = form_field_element\n elsif form_field_element.respond_to?(:is_form_button) then\n @buttons ||= []\n @buttons << form_field_element\n elsif form_field_element.respond_to?(:is_form_field) then\n field_name = form_field_element.name.to_s\n form_field_element.value = @values[field_name] if (form_field_element.value.nil? || form_field_element.value == '')\n form_field_element.hint = @hints[field_name] if (@hints && !form_field_element.hint)\n if !form_field_element.dom_id then\n form_field_element.dom_id = field_name.gsub('.','_')\n end\n delegated_to_fieldset = false\n @fieldsets.values.each { |fieldset|\n if fieldset.has_field?(field_name) then\n fieldset.add(form_field_element)\n delegated_to_fieldset = true\n end\n }\n @element_map[field_name] = form_field_element unless delegated_to_fieldset\n @elements << form_field_element\n else\n raise ArgumentError.new(\"Only instances of Aurita::GUI::Fieldset, Aurita::GUI::Form_Button or Aurita::GUI::Form_Field[_Widget] can be added to a form (Given: #{form_field_element.inspect} \")\n end\n end",
"title": ""
},
{
"docid": "7856df6378efcfa139f13e88439394ad",
"score": "0.54370856",
"text": "def add_field!(field_name, value = nil)\n fields << Field.new({'name' => field_name}, value)\n end",
"title": ""
},
{
"docid": "7e7b9f9042002a0d1c2a62464a7a2f0b",
"score": "0.54356575",
"text": "def link_to_add_fields(name, f, type)\n new_object = f.object.send \"build_#{type}\"\n id = \"new_#{type}\"\n fields = f.send(\"#{type}_fields\", new_object, child_index: id) do |builder|\n render(type.to_s + \"_fields\", f: builder)\n end\n link_to(name, '#', class: \"add_fields\", data: {id: id, fields: fields.gsub(\"\\n\", \"\")})\n end",
"title": ""
},
{
"docid": "0837abc63bcec7421591c45fddb060e3",
"score": "0.5347826",
"text": "def add(field)\n if field.is_a? String\n field = FormField.new(field)\n end\n\n return self if @fields_by_index.include? field\n\n @fields_by_index << field\n @fields[field.label] = field\n self\n end",
"title": ""
},
{
"docid": "7ca05b7517e942b8a7294dd0827ddc92",
"score": "0.5339801",
"text": "def single_item_action_add_form_fields(form, document)\n single_item_action_form_fields(form, document, 'add')\n end",
"title": ""
},
{
"docid": "c35bbcb979b819464f01e46b1f4adef8",
"score": "0.531568",
"text": "def add_text_field(form, model, field, not_null=check_null?(model, field))\n html = <<-HTML\n <div class=\"form-group\">\n #{form.label field, class: 'col-sm-3 control-label no-padding-right'}\n <div class=\"col-sm-9\">\n #{form.text_field field, class: 'form-control'}\n #{not_null_field if not_null}\n </div>\n </div>\n HTML\n html.html_safe\n end",
"title": ""
},
{
"docid": "b1d85996b0a5501e62b44d6a22d34c93",
"score": "0.5307041",
"text": "def append_para\n last_para = @main_doc.xpath('.//w:p')[-1]\n last_para.add_next_sibling(@para_ele.clone)\n end",
"title": ""
},
{
"docid": "476c7c6f34363a428961305db3a8bdc8",
"score": "0.5306271",
"text": "def add_field\n params.inspect\n #@textos = Array.new(1+1) { Texto.new } # Generate index+1 objects\n #respond_with(@textos)\n end",
"title": ""
},
{
"docid": "3346f56e11082a28ddc26dc4749398a6",
"score": "0.53010815",
"text": "def add_fields\n session[:count] = 0\n @fields = []\n if params[:dynamic_form] #Get information from form before\n logger.info \"Params[:form]\"\n form_hash = params[:dynamic_form]\n if(params[:id]) #If Editing\n logger.info \"Editing\"\n form = DynamicForm.find(params[:id])\n form.update_attributes(form_hash)\n session[:form_id] = form.id\n logger.info \"FIELDS: #{form.fields}\"\n if form.fields == \"To be Filled\"\n @message = \"<p>No fields</p>\"\n else\n @fields = YAML::load(form.fields)\n end\n else #Creating New Form\n logger.info \"Creating a new form: #{form_hash.to_s}\"\n form = DynamicForm.create(form_hash)\n form.save!\n session[:form_id] = form.id\n end\n else #Handle field updating and list creation\n form = DynamicForm.find(session[:form_id])\n #logger.info \"Fields Hash: #{YAML::load(form.fields).to_s}\"\n unless form.fields == \"To be Filled\"\n @fields = YAML::load(form.fields)\n end \n end\n end",
"title": ""
},
{
"docid": "f80695d3421bec2aed460f6a39ae1245",
"score": "0.529765",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n render(association.to_s.singularize + \"_fields\", :f => builder, :obj => nil)\n end\n link_to_function(name, h(\"add_fields(this, \\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\"))\n end",
"title": ""
},
{
"docid": "9888df362a979f2b11622f4fde94bfbf",
"score": "0.5297399",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render(association.to_s.singularize + \"_fields\", f: builder)\n end\n link_to(name, '#', class: \"add_fields\", data: { id: id, fields: fields.gsub(\"\\n\", \"\") })\n end",
"title": ""
},
{
"docid": "0c1704aad5f5af70684337db3790f8a2",
"score": "0.5286554",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render(association.to_s.singularize + \"_fields\", f: builder)\n end\n link_to(name, '#', class: \"add_fields btn btn-success btn-block\", data: {id: id, fields: fields.gsub(\"\\n\", \"\")})\n end",
"title": ""
},
{
"docid": "c9d4920288b70e4a9b9d7cf6f677c671",
"score": "0.5271332",
"text": "def link_to_add_fields(name=nil, ff=nil, association=nil, options=nil,\n html_options=nil, attributes={}, &block)\n # If a block is provided there is no name attribute and the arguments are\n # shifted with one position to the left. This re-assigns those values.\n f, association, options, html_options = name, ff, association, options if block_given?\n\n options ||= {}\n html_options ||= {}\n\n locals = options[:locals] || {}\n partial = options[:partial] || association.to_s.singularize + '_fields'\n\n # Render the form fields from a file with the association name provided\n new_object = ff.object.class.reflect_on_association(association).klass.new(attributes)\n fields = ff.fields_for(association, new_object, child_index: 'new_record') do |builder|\n render(partial, locals.merge!( ff: builder))\n end\n\n # The rendered fields are sent with the link within the data-form-prepend attr\n html_options['data-form-prepend'] = raw CGI::escapeHTML( fields )\n html_options['href'] = '#'\n\n content_tag(:a, name, html_options, &block)\n end",
"title": ""
},
{
"docid": "af2e2919c1dff3831a7066a4dc8613ad",
"score": "0.52618176",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n render(association.to_s.singularize + \"_fields\", :f => builder)\n end\n link_to_function(name, \"add_fields(this, \\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\")\n end",
"title": ""
},
{
"docid": "af2e2919c1dff3831a7066a4dc8613ad",
"score": "0.52618176",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n render(association.to_s.singularize + \"_fields\", :f => builder)\n end\n link_to_function(name, \"add_fields(this, \\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\")\n end",
"title": ""
},
{
"docid": "ae912f0296267771c6cb07e85a9ad8cb",
"score": "0.5243365",
"text": "def fills_in(field, options = {})\n value = options[:with]\n return flunk(\"No value was provided\") if value.nil?\n input = find_field_by_name_or_label(field)\n return flunk(\"Could not find input #{field.inspect}\") if input.nil?\n add_form_data(input, value)\n # TODO - Set current form\n end",
"title": ""
},
{
"docid": "91f557860d389e8485837089efdcf2f8",
"score": "0.5238745",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render('shared/' + association.to_s.singularize + '_fields', f: builder)\n end\n link_to(name, '#', class: \"add_fields\", data: {id: id, fields: fields.gsub(\"\\n\", \"\")})\n end",
"title": ""
},
{
"docid": "b8ff84dfc59a01a9c4f5616bbc385738",
"score": "0.5238172",
"text": "def link_to_add_fields(name, f, association, params={})\n\t\tnew_object = f.object.class.reflect_on_association(association).klass.new\n\t\tfields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n\t\t\t#merge the params hash with the form builder being sent as a local variable to the partial\n\t \t\trender(association.to_s.singularize + \"_fields\", {:f => builder}.merge(params))\n\t\tend\n\t\tlink_to_function(name, \"add_fields(this, '#{association}', '#{escape_javascript(fields)}')\")\n\tend",
"title": ""
},
{
"docid": "b8ff84dfc59a01a9c4f5616bbc385738",
"score": "0.5238172",
"text": "def link_to_add_fields(name, f, association, params={})\n\t\tnew_object = f.object.class.reflect_on_association(association).klass.new\n\t\tfields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n\t\t\t#merge the params hash with the form builder being sent as a local variable to the partial\n\t \t\trender(association.to_s.singularize + \"_fields\", {:f => builder}.merge(params))\n\t\tend\n\t\tlink_to_function(name, \"add_fields(this, '#{association}', '#{escape_javascript(fields)}')\")\n\tend",
"title": ""
},
{
"docid": "f44dc7acde6e6ac10d3ca3381ffb13c8",
"score": "0.52369595",
"text": "def description_input\n adding_field do |f|\n view_context.render \"questions/editor\", :f => f\n end\n end",
"title": ""
},
{
"docid": "d775c64605abe7179c09ea230ee94e5f",
"score": "0.5211014",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association, new_object,\n :child_index => \"new_#{association}\") do |builder| \n render(\"form_\" + association.to_s, :f => builder)\n end\n link_to_function(name, h(\"add_fields(this, \\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\"))\n end",
"title": ""
},
{
"docid": "390b4a7e7071613910062e7116d21206",
"score": "0.5206337",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.send(association).klass.new\n id = new_object.object_id\n fields = f.fields_for(association, new_object, child_index: id) do |builder|\n render(association.to_s.singularize + \"_partial\", f: builder)\n end\n link_to(name, '#', class: \"add_fields\", data: {id: id, fields: fields.gsub(\"\\n\", \"\")})\n end",
"title": ""
},
{
"docid": "465ec71ae9557ae48b0f7a6a6e16fa08",
"score": "0.5175795",
"text": "def add_field(identifier, value = nil)\n @fields << build_field(identifier, value)\n end",
"title": ""
},
{
"docid": "ff78478305f12e0c5200f4f443b6c209",
"score": "0.51538014",
"text": "def add_custom_field(name, value)\n add_field name, value\n end",
"title": ""
},
{
"docid": "b5c5f17514237b233a2ee4e430417861",
"score": "0.5151365",
"text": "def link_to_add_fields(name, f, association, parent_container_query)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n render(association.to_s.singularize + \"_fields\", :f => builder)\n end\n link_to_function(name, \"add_fields(\\\"#{parent_container_query}\\\", \\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\")\n end",
"title": ""
},
{
"docid": "1345c7c7f0b924ab40dee807816bc0fe",
"score": "0.51461565",
"text": "def custom_field(label, contents)\r\n render_field(label, {}, contents)\r\n end",
"title": ""
},
{
"docid": "8a873c0bfd1c900f99be1f964b6255e0",
"score": "0.51449275",
"text": "def set_field\n @field = @nested_form.fields.find(params[:id])\n end",
"title": ""
},
{
"docid": "199fe39286ce0a341698fed009b8a243",
"score": "0.514009",
"text": "def add_field(name, options = {})\n # aliased = options[:as]\n # aliased_fields[aliased.to_s] = name if aliased\n field = field_for(name, options)\n fields[name] = field\n # add_defaults(field)\n create_accessors(name, name, options)\n # process_options(field)\n # create_dirty_methods(name, name)\n # create_dirty_methods(name, aliased) if aliased\n field\n end",
"title": ""
},
{
"docid": "1bdefbcbf9c918e859324ba216b0ca96",
"score": "0.51393867",
"text": "def field(name, options={}, &block)\n field = AppKit::Field.new(model, name, options, &block)\n fields << field\n end",
"title": ""
},
{
"docid": "1e60f090ffff2d944702159e257daf61",
"score": "0.5135037",
"text": "def field_content\n value\n end",
"title": ""
},
{
"docid": "aa9fb0156afbfc5695a10451cc1bad1d",
"score": "0.51222795",
"text": "def append_field_value(value)\n return unless current_field && value\n current_value << value.gsub(/\\s+/, ' ')\n end",
"title": ""
},
{
"docid": "920f14eb7182b4ab236369b2721de6d2",
"score": "0.5076835",
"text": "def field(rec, form_drawer)\n form_drawer.draw_field(rec, self)\n end",
"title": ""
},
{
"docid": "1db597ff61fd09f7cb549d668fc6aac8",
"score": "0.50694484",
"text": "def form_field\n case self.column_type\n when \"text\"\n %{<textarea name=\"#{self.form_element_name}\" id=\"#{self.form_element_id}\" cols=\"60\" rows=\"20\"><%= @#{self.model_name}.#{self.column_name} %></textarea>}\n else\n %{<input type=\"text\" name=\"#{self.form_element_name}\" id=\"#{self.form_element_id}\" size=\"30\" value=\"<%= @#{self.model_name}.#{self.column_name} %>\" />}\n end\n end",
"title": ""
},
{
"docid": "0a9469731a9f58b53110a61993828d4c",
"score": "0.5065881",
"text": "def add_field(name, value, options = {})\n @fields << RSolr::Message::Field.new(options.merge({:name=>name}), value)\n end",
"title": ""
},
{
"docid": "e7b6d8032e49127d7b4b6396f1cea928",
"score": "0.50605637",
"text": "def add_field(name, val)\n @data[name] = val\n self\n end",
"title": ""
},
{
"docid": "e7b6d8032e49127d7b4b6396f1cea928",
"score": "0.50605637",
"text": "def add_field(name, val)\n @data[name] = val\n self\n end",
"title": ""
},
{
"docid": "56b0e67869312de774669f186080df57",
"score": "0.50559",
"text": "def link_to_add_fields(name,f,association)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association,new_object, :child_index=>\"new_#{association}\") do |builder|\n render(association.to_s.pluralize+\"/\"+association.to_s.singularize + \"_fields\", :f => builder)\n end\n ui_link_to_function('add',name,\"add_fields(this,\\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\")\n end",
"title": ""
},
{
"docid": "56b0e67869312de774669f186080df57",
"score": "0.50559",
"text": "def link_to_add_fields(name,f,association)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association,new_object, :child_index=>\"new_#{association}\") do |builder|\n render(association.to_s.pluralize+\"/\"+association.to_s.singularize + \"_fields\", :f => builder)\n end\n ui_link_to_function('add',name,\"add_fields(this,\\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\")\n end",
"title": ""
},
{
"docid": "34597ae9188f872056b7ef6c8e672081",
"score": "0.5040878",
"text": "def set_form_field\n @form_field = FormField.find(params[:id])\n end",
"title": ""
},
{
"docid": "302ccef72e6bbd310866153bd02e5334",
"score": "0.503914",
"text": "def field(name)\n unless @fields.include? name\n @fields.push name.to_s\n end\n end",
"title": ""
},
{
"docid": "5d25294e065b4ea506e17d946145bbf5",
"score": "0.50378805",
"text": "def input(wrapper_options)\n @builder.text_field(attribute_name, input_html_options) + \\\n @builder.hidden_field(attribute_name, value: input_html_options[:value], class: attribute_name.to_s + \"-alt\")\n end",
"title": ""
},
{
"docid": "52ceb25454355ed6f464c97fb2b64f89",
"score": "0.50372773",
"text": "def add_field(var_name, type, xml_tag, value=nil)\n @fields[var_name] = Field.new(var_name, type, xml_tag, value)\n end",
"title": ""
},
{
"docid": "26c271d6b1424c2afcc1d3acd1f66258",
"score": "0.5026679",
"text": "def link_to_add_fields(name, f, association, partial = nil, options = {})\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n render((partial.nil? ? association.to_s.singularize + \"_fields\" : partial), :f => builder)\n end\n link_to_function(name, (\"add_fields(this, \\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\").html_safe, add_html_classes(options, \"btn btn-success\") )\n end",
"title": ""
},
{
"docid": "714a4fe211e5017e9879cd0c02a3d67b",
"score": "0.5025117",
"text": "def add_field(field_defn)\n own_fields[field_defn.name] = field_defn\n if !method_defined?(field_defn.method_sym)\n # Only add the super method if there isn't one already.\n add_super_method(field_defn.name.inspect, field_defn.method_sym)\n end\n nil\n end",
"title": ""
},
{
"docid": "840ff2430477d0c8d112106f80fde3d5",
"score": "0.50215626",
"text": "def link_to_add_fields(name, association, *args)\n options = args.extract_options!\n\n new_object = object.class.reflect_on_association(association).klass.new\n fields = fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n @template.render(association.to_s.singularize + \"_fields\", :f => builder)\n end\n\n options.merge!(:class => \"add_fields btn\", :data => { :association => association, :content => CGI::escapeHTML(fields.gsub(/\\t|\\n|\\r/, \"\")) })\n @template.link_to(name, \"#\", options)\n end",
"title": ""
},
{
"docid": "3075888dc7f193990c1bfecb7db52118",
"score": "0.5018482",
"text": "def process_field(builder, field)\n builder.send(field.field_type.to_sym,\n field.field_name.to_sym,\n\n # Homespree Project Type Optional params\n {\n label: field.label,\n data: field.field_data,\n default: field.default,\n required: field.required,\n position: field.position,\n size: field.size,\n toggleable: field.toggleable\n }\n )\n end",
"title": ""
},
{
"docid": "9c65cb402e922027bb5d2cfe17ed57a7",
"score": "0.50025845",
"text": "def link_to_add_fields(name, form, association, this = nil)\n new_object = form.object.send(association).klass.new\n id = new_object.object_id\n\n fields = form.fields_for(association, new_object, child_index: id) do |builder|\n render(\"admin/partials/\" + association.to_s.singularize + \"_fields\", f: builder, resource: this)\n end\n\n link_to(name, \"#\", class: \"add-fields\", data: { id: id, fields: fields.gsub(\"\\n\", \"\")})\n end",
"title": ""
},
{
"docid": "cfb26e775c2ad07213f80278a90a69e4",
"score": "0.49984437",
"text": "def pulp_special_field(field,options={})\n pulp_locked_field(field,options)\n special_fields << field\n end",
"title": ""
},
{
"docid": "0daf6b1a345a47093e670570345f125f",
"score": "0.49819311",
"text": "def html_postprocess(field,html)\n html\n end",
"title": ""
},
{
"docid": "6ca95ae8a2b5ba9a93d7a2dd4eaabbf1",
"score": "0.49730068",
"text": "def create\n @form_field = FormField.new(form_field_params)\n\n respond_to do |format|\n if @form_field.save\n format.html { redirect_to @form_field, notice: 'Form field was successfully created.' }\n format.json { render :show, status: :created, location: @form_field }\n else\n format.html { render :new }\n format.json { render json: @form_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d1dd4bd98d23c7b92100b1fad5564558",
"score": "0.49668086",
"text": "def field(ffield, length, sourcetag, default = nil, &block)\n @fields << {\n afield: ffield,\n length: length, \n stag: sourcetag,\n default: default,\n block: block\n }\n end",
"title": ""
},
{
"docid": "9d3783c04f7fe2f68d1414aaa1fbfdd8",
"score": "0.4958902",
"text": "def form_field_params\n params[:form_field]\n end",
"title": ""
},
{
"docid": "11ad98b957106a2f29dff85c273a0283",
"score": "0.4949038",
"text": "def link_to_add_fields(name, f, association, divname, count_range, max_len, add_class)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n render(association.to_s.singularize + \"_fields\", :f => builder)\n end\n link_to_function(name, \"add_fields(this, \\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\", \\\"#{divname}\\\", \\\"#{count_range}\\\")\", :class => \"add_fields \"+ add_class, 'data-max_len'=> max_len )\n\n end",
"title": ""
},
{
"docid": "493f9310686c632ec206db0ed12610e8",
"score": "0.49417034",
"text": "def get_field_edit_html\n '<HTML NOT IMPLEMENT YET>'\n end",
"title": ""
},
{
"docid": "0ed231129f5e36e7b4ee9a52e9a32ed4",
"score": "0.4927304",
"text": "def add_fields(fields)\n\t\tend",
"title": ""
},
{
"docid": "65d375c14b6202b521a02202150e9198",
"score": "0.49264774",
"text": "def push(fieldlet)\n \t\tfield = @fields[fieldlet.class::FIELD_ID].last\n \t\tif field && field.instance_id == fieldlet[:instance_id]\n \t\t\treturn field << fieldlet\n \t\tend \n \n \t\tfield = fieldlet.class::FIELD.new(@entity)\n \t\tfield << fieldlet\n \n \t\t@fields[fieldlet.class::FIELD_ID] << field\n \n return field\n \tend",
"title": ""
},
{
"docid": "17d511abd200e6e6f26ec57aca8532ea",
"score": "0.49239898",
"text": "def field_content\n f = ''\n subfields.each do |sf|\n f += \"|#{sf.code}#{sf.value}\"\n end\n f\n end",
"title": ""
},
{
"docid": "b3f9395ecb7e08fdfad831c43da2e3f4",
"score": "0.49136513",
"text": "def html_for_non_date_field(object, field)\n \"<p>\n <label for = '#{field}' >\n Select your #{field}:\n </label>\n <input type = 'text' \n name = create_form[#{field}]\n placeholder = 'Type in the #{field}'\n value = '#{object.send(field)}'>\n </input>\n </p>\"\n end",
"title": ""
},
{
"docid": "c8618d507c99f17d59f529aaf20cfcc6",
"score": "0.49127138",
"text": "def input_description(f, name, id = nil)\n f.input name, as: :text, input_html: { 'data-parsley-trigger': 'keyup',\n 'data-parsley-minlength': 3,\n 'data-parsley-maxlength': 512,\n 'data-parsley-validation-threshold': 0,\n id: id}\n end",
"title": ""
},
{
"docid": "c8618d507c99f17d59f529aaf20cfcc6",
"score": "0.49127138",
"text": "def input_description(f, name, id = nil)\n f.input name, as: :text, input_html: { 'data-parsley-trigger': 'keyup',\n 'data-parsley-minlength': 3,\n 'data-parsley-maxlength': 512,\n 'data-parsley-validation-threshold': 0,\n id: id}\n end",
"title": ""
},
{
"docid": "a745edaba226ef035f00b9aab02e3d24",
"score": "0.49014756",
"text": "def field_extras\r\n return @field_extras\r\n end",
"title": ""
},
{
"docid": "5a24edf29b08393741df054b4c461389",
"score": "0.4892097",
"text": "def set_custom_form_field\n @custom_form_field = CustomFormField.find(params[:id])\n end",
"title": ""
},
{
"docid": "2bb3278f131edaa1b037b66d5e3d12ae",
"score": "0.48885491",
"text": "def build_get_pallet_number_form()\n\n#\t---------------------------------\n#\t Define fields to build form from\n#\t---------------------------------\n\tfield_configs = Array.new\n\n field_configs[0] = {:field_type => 'TextField',\n\t\t\t\t\t\t:field_name => 'pallet_number'}\n\n\n\n\tbuild_form(nil,field_configs,'submit_mixed_pallet_id','pallet_number','submit')\n\nend",
"title": ""
},
{
"docid": "cfc23849ea08627b347abbc8a2c86f51",
"score": "0.48884824",
"text": "def render_custom_field(field, form)\n highlighted = field._id == field._parent.label_field_id\n default_options = default_custom_field_options(field, form, highlighted)\n field_options = custom_field_options(field, form)\n\n return '' if field_options.nil?\n\n options = default_options.merge(field_options)\n\n form.input options.delete(:name), options\n end",
"title": ""
},
{
"docid": "a66a5113d04e5d8d61a194ee96a3b5f3",
"score": "0.48826656",
"text": "def new_data_field(field)\n datafield = MARC::DataField.new(field['2'],\n field.indicator1,\n field.indicator2)\n field.subfields.each do |sf|\n unless %w[0 2 3].include?(sf.code)\n datafield.append(MARC::Subfield.new(sf.code, sf.value))\n end\n end\n datafield\n# puts \"DATAFIELD: #{datafield.inspect}\"\n end",
"title": ""
},
{
"docid": "31a6162250b85eea642868fbb4bfbbb6",
"score": "0.48791754",
"text": "def file_form_field\n @attributes[:file_form_field]\n end",
"title": ""
},
{
"docid": "0b71300dc6458d6ebf623ae19bd9d5c5",
"score": "0.48764667",
"text": "def wrapped_field(field, options = {})\n required_flag = options.delete(:required) ? true : false\n text = \"\"\n\n field_text = content_tag(\"span\", field,{:class => \"form-field\"}, false)\n\n required_text = content_tag(\"span\",\"\",{:class => \"form-field-required-flag\"}, false)\n\n info_image = \"\"\n\n if options.delete(:info)\n info_text = content_tag(:img, \"\", :src => \"/images/s.gif\", :class => \"form-field-info\", :title => info_t, :alt => info_t)\n info_image = content_tag(:span, info_text,false)\n end\n\n error_message_text = error_message(options.delete(:error))\n\n field_class = [\"form-field-wrapped\"]\n field_class << \"form-field-required\" if required_flag\n field_class << \"form-field-error\" if error_message_text.present?\n\n content_tag(\"div\", required_text+field_text + info_image + error_message_text,{:class => field_class.join(\" \")}, false)\n\n end",
"title": ""
},
{
"docid": "b23ea6f4306ef894cd5ab792ef7ef8c8",
"score": "0.48738897",
"text": "def field(p,field_name)\n f = p.fields.find {|f| f.name == field_name}\n if f.nil? then\n return nil\n else\n return f.value\n end\nend",
"title": ""
},
{
"docid": "aa835ed5416f3a59001d54f68eb1df18",
"score": "0.48677963",
"text": "def get_field_edit_html\n '<HTML NOT IMPLEMENTED YET>'\n end",
"title": ""
},
{
"docid": "088a16cbdd5dd0437fb76b894ff5ed4b",
"score": "0.4860182",
"text": "def field_content(name)\n if field_exists?(name)\n value_by_key(@fields, name)\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "5da1e61fa9089e1cc20b9464784c20c6",
"score": "0.48600918",
"text": "def insert_text\n attributes.fetch(:insertText)\n end",
"title": ""
},
{
"docid": "7f4062295ce1779b92f25a3123e93f85",
"score": "0.48596868",
"text": "def form_data?; end",
"title": ""
},
{
"docid": "19f1b9e9d29a57f180d9a3e1e677f05a",
"score": "0.48505068",
"text": "def new_text\n attributes.fetch(:newText)\n end",
"title": ""
},
{
"docid": "a72ff66c221405d345006daa37577d93",
"score": "0.48401016",
"text": "def link_to_add_fields(name, f, association)\n new_object = f.object.class.reflect_on_association(association).klass.new\n fields = f.fields_for(association, new_object, :child_index => \"new_#{association}\") do |builder|\n\t\trender(association.to_s.singularize + \"_fields\", :f => builder)\n\tend\n\t#Rails 3 doesn't need the h method\n #link_to_function(name, h(\"add_fields(this, \\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\"))\n\tlink_to_function(name, (\"add_fields(this, \\\"#{association}\\\", \\\"#{escape_javascript(fields)}\\\")\"))\n end",
"title": ""
},
{
"docid": "9dc8fb6b1e04da3d7b2dd706395217ba",
"score": "0.48392493",
"text": "def field( field_helper, method, options, html_options = {})\n content = wrapper.value( field_helper,\n # invoke a Rails built-in control generator\n send( \"#{field_helper}_without_buds\", method, options), :class => 'value')\n wrapper.field( field_helper, \n label_element(method, options, html_options) +\n content +\n addendum_element(options) +\n hint_element(options),\n attributes_for(method, field_helper) )\n end",
"title": ""
},
{
"docid": "46ac13f993ba34deff981512cf76cdd5",
"score": "0.48209038",
"text": "def post_detail( post, field )\n d = \"data-field='details[#{field}]'\"\n k = \"<p>#{field.to_s.humanize}:</p>\"\n\n if post.new_record?\n value = \"Edit this\"\n else\n value = post.details.send :[], field\n end\n v = \"<p #{d} class='post-field input'>#{value}</p>\"\n\n \"<div class='detail'>#{k} #{v}</div>\".html_safe\n end",
"title": ""
},
{
"docid": "c6ab8fb9c525c92317e8482e306f14d7",
"score": "0.48166743",
"text": "def create\n @extra_field = ExtraField.new(extra_field_params)\n\n respond_to do |format|\n if @extra_field.save\n format.html { redirect_to @extra_field, notice: 'Extra field was successfully created.' }\n format.json { render :show, status: :created, location: @extra_field }\n else\n format.html { render :new }\n format.json { render json: @extra_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8901875ac94dd08ee3393a045e997b76",
"score": "0.48117873",
"text": "def configure_field\n end",
"title": ""
},
{
"docid": "a69a6d5ba755d0dffa7e012ac119495c",
"score": "0.48098525",
"text": "def text_field_for( form, field,\n size = HTML_TEXT_FIELD_SIZE,\n maxlength = DB_STRING_MAX_LENGTH)\n label = content_tag(\"label\", \"#{field.humanize}:\", :for => field)\n form_field = form.text_field field, :size => size, :maxlength => maxlength\n content_tag(\"div\", \"#{label} #{form_field}\", :class => \"form_row\")\n end",
"title": ""
},
{
"docid": "1e1a62f2fbccd3d360a8d0f433c01b0c",
"score": "0.4807755",
"text": "def read_only_field(form_name, field_name, html_options)\n \"<span #{attributes(html_options)}>#{instance_variable_get('@' + form_name)[field_name]}</span>\"\n end",
"title": ""
},
{
"docid": "50328a97e7dd6b0ba4b528c6b979a1c8",
"score": "0.4801147",
"text": "def set_PADD(value)\n set_input(\"PADD\", value)\n end",
"title": ""
},
{
"docid": "f8d13e81a51848b9d74c13a068681f9c",
"score": "0.4794511",
"text": "def field=(updated_field)\n self.field_data = updated_field.flatten.join\n end",
"title": ""
},
{
"docid": "04f269cabb608853a30a5424acbe0b9a",
"score": "0.47904503",
"text": "def paragraph_params\n params.require(:paragraph).permit(:content)\n end",
"title": ""
},
{
"docid": "7fe56984d947630f154274398190cc2c",
"score": "0.47865313",
"text": "def ptag1; catdet.form(:name, 'rpcControlApsSettingForm').text_field(:name, 'assetTag1'); end",
"title": ""
},
{
"docid": "25e6e4b3c4f03f30edc3d7de8fb6cae0",
"score": "0.47716504",
"text": "def input(field, opts={})\n if opts.has_key?(:obj)\n opts = opts.dup\n obj = opts.delete(:obj)\n else\n obj = self.obj\n end\n input = if obj\n if obj.respond_to?(:forme_input)\n obj.forme_input(self, field, opts.dup)\n else\n opts = opts.dup\n opts[:key] = field unless opts.has_key?(:key)\n unless opts.has_key?(:value)\n opts[:value] = if obj.is_a?(Hash)\n obj[field]\n else\n obj.send(field)\n end\n end\n _input(:text, opts)\n end\n else\n _input(field, opts)\n end\n self << input\n input\n end",
"title": ""
},
{
"docid": "a2faed00c6cf9e3c3833e3fa3c7912ff",
"score": "0.47661397",
"text": "def add_field!(field_name, value = T.unsafe(nil)); end",
"title": ""
}
] |
6e139f584d26fc7e0a73d87d990d3768
|
Set the value of the RowEnd input for this Choreo.
|
[
{
"docid": "2e05cce681780dd5577d004f6e0026f3",
"score": "0.7819764",
"text": "def set_RowEnd(value)\n set_input(\"RowEnd\", value)\n end",
"title": ""
}
] |
[
{
"docid": "2ea80ab79ed6e3fc760516a06ae69462",
"score": "0.60769826",
"text": "def end_cell=(value)\n @end_cell = value\n end",
"title": ""
},
{
"docid": "2f427f91ba782c875bac6fffddc0e6ba",
"score": "0.5777982",
"text": "def endRow; @row + @height - 1; end",
"title": ""
},
{
"docid": "49ad66193a0f3a4958c4b23c9937f538",
"score": "0.5729248",
"text": "def set_end_line_from_range\n @end_line = start_line.last\n @end_line -= 1 if start_line.exclude_end?\n @start_line = start_line.first\n end",
"title": ""
},
{
"docid": "ca87cd1b14bbd8ca5b9ab3b4c6f77453",
"score": "0.5595742",
"text": "def force_set_end_line\n if start_line.is_a?(Range)\n set_end_line_from_range\n else\n @end_line ||= start_line\n end\n end",
"title": ""
},
{
"docid": "9fe02c64c43b2017777685daa768fbbe",
"score": "0.5585868",
"text": "def end_rows\n end",
"title": ""
},
{
"docid": "fe6f145b7a2cfc9f09ea5f9435136083",
"score": "0.5497749",
"text": "def _end=(_end)\n if _end.nil?\n fail ArgumentError, 'invalid value for \"_end\", _end cannot be nil.'\n end\n @_end = _end\n end",
"title": ""
},
{
"docid": "fe6f145b7a2cfc9f09ea5f9435136083",
"score": "0.54966736",
"text": "def _end=(_end)\n if _end.nil?\n fail ArgumentError, 'invalid value for \"_end\", _end cannot be nil.'\n end\n @_end = _end\n end",
"title": ""
},
{
"docid": "60394e5f2fee94b90edffd95e7ee2420",
"score": "0.53639096",
"text": "def set_RowStart(value)\n set_input(\"RowStart\", value)\n end",
"title": ""
},
{
"docid": "60394e5f2fee94b90edffd95e7ee2420",
"score": "0.53639096",
"text": "def set_RowStart(value)\n set_input(\"RowStart\", value)\n end",
"title": ""
},
{
"docid": "60394e5f2fee94b90edffd95e7ee2420",
"score": "0.53639096",
"text": "def set_RowStart(value)\n set_input(\"RowStart\", value)\n end",
"title": ""
},
{
"docid": "60394e5f2fee94b90edffd95e7ee2420",
"score": "0.53639096",
"text": "def set_RowStart(value)\n set_input(\"RowStart\", value)\n end",
"title": ""
},
{
"docid": "60394e5f2fee94b90edffd95e7ee2420",
"score": "0.53639096",
"text": "def set_RowStart(value)\n set_input(\"RowStart\", value)\n end",
"title": ""
},
{
"docid": "60394e5f2fee94b90edffd95e7ee2420",
"score": "0.53639096",
"text": "def set_RowStart(value)\n set_input(\"RowStart\", value)\n end",
"title": ""
},
{
"docid": "bd789b414d2aef2a821181a99941fb27",
"score": "0.53626937",
"text": "def end=(array)\n raise ArgumentError if array.nil?\n raise ArgumentError if array.length != 2\n self.line_end = array[0]\n self.column_end = array[1]\n end",
"title": ""
},
{
"docid": "6898f3dd2044ba0809f8d82e993ae062",
"score": "0.51352894",
"text": "def end(end_key)\n KeyValueList.new(self).end(end_key)\n end",
"title": ""
},
{
"docid": "51d2241c40fceee4bf2d91fa1532c64b",
"score": "0.5132878",
"text": "def finalize\n @row << ROW_END_CHAR\n end",
"title": ""
},
{
"docid": "e8be9ef53222a420dfe106be4c38d208",
"score": "0.5130893",
"text": "def set_end_line_from_range; end",
"title": ""
},
{
"docid": "e8be9ef53222a420dfe106be4c38d208",
"score": "0.5130893",
"text": "def set_end_line_from_range; end",
"title": ""
},
{
"docid": "8ebdb7288b29717593f0983d21b177c2",
"score": "0.50633425",
"text": "def set_MaxRow(value)\n set_input(\"MaxRow\", value)\n end",
"title": ""
},
{
"docid": "8ebdb7288b29717593f0983d21b177c2",
"score": "0.50633425",
"text": "def set_MaxRow(value)\n set_input(\"MaxRow\", value)\n end",
"title": ""
},
{
"docid": "ba4fd432394f9b41b6a364604f8d1822",
"score": "0.50293636",
"text": "def end_of_line\n blen = current_value.rstrip.length\n set_form_col blen\n end",
"title": ""
},
{
"docid": "8add1fd7b19bdfd05e3c27eb0fffb704",
"score": "0.5022031",
"text": "def end_line\n @end_line ||= find_end_line\n end",
"title": ""
},
{
"docid": "51af2d838db6d7d5ce71aa5d6ee2f63b",
"score": "0.49781662",
"text": "def end_cell\n return @end_cell\n end",
"title": ""
},
{
"docid": "12ec6330c6f7389c722fd51cc88c5a3a",
"score": "0.48599184",
"text": "def end_of_line(event)\n self.cursor = :end\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "da1253ffd7917db79f9eced48d63934c",
"score": "0.48465413",
"text": "def set_end(fbe_begin)\n @_buffer.unshift(fbe_begin)\n end",
"title": ""
},
{
"docid": "565d25e9ef9f4ca83828c57416e93397",
"score": "0.48456174",
"text": "def end(end_key)\n self.class.new(collection, range.merge({end: end_key, end_inclusive: true}))\n end",
"title": ""
},
{
"docid": "033a2c8228f42dde010f5c77396c70c3",
"score": "0.484471",
"text": "def bottom_row=(row)\n self.top_row = row - (page_row_max - 1)\n end",
"title": ""
},
{
"docid": "10bc2cab562c16815a66dd2a520cee8a",
"score": "0.48398557",
"text": "def set_Row(value)\n set_input(\"Row\", value)\n end",
"title": ""
},
{
"docid": "8e119038e9e1fe4cd5c4b65013ed9592",
"score": "0.48080546",
"text": "def set_form_row\n r,c = rowcol\n @rows_panned ||= 0\n\n # when the toprow is set externally then cursor can be mispositioned since \n # bounds_check has not been called\n if @current_index < @toprow\n # cursor is outside table\n @current_index = @toprow # ??? only if toprow 2010-10-19 12:56 \n end\n\n row = r + (@current_index-@toprow) + @rows_panned \n # row should not be < r or greater than r+height TODO FIXME\n\n setrowcol row, nil\n\n end",
"title": ""
},
{
"docid": "36a6f5655ab681ec5446301404848eb9",
"score": "0.4781544",
"text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end",
"title": ""
},
{
"docid": "36a6f5655ab681ec5446301404848eb9",
"score": "0.4781544",
"text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end",
"title": ""
},
{
"docid": "36a6f5655ab681ec5446301404848eb9",
"score": "0.4781544",
"text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end",
"title": ""
},
{
"docid": "36a6f5655ab681ec5446301404848eb9",
"score": "0.4781544",
"text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end",
"title": ""
},
{
"docid": "36a6f5655ab681ec5446301404848eb9",
"score": "0.4781544",
"text": "def set_EndTimestamp(value)\n set_input(\"EndTimestamp\", value)\n end",
"title": ""
},
{
"docid": "2eee8f5c8b7263cd9d620de8ac1afb9f",
"score": "0.47117442",
"text": "def force_set_end_line; end",
"title": ""
},
{
"docid": "2eee8f5c8b7263cd9d620de8ac1afb9f",
"score": "0.47117442",
"text": "def force_set_end_line; end",
"title": ""
},
{
"docid": "6ba7d9d3751f8ab2542cee6d36441679",
"score": "0.46923518",
"text": "def new_loop_end()\n myLoopEnd = LoopEnd.new(@batch)\n @rowManager.insert_row(myLoopEnd)\n @rowManager.draw()\n end",
"title": ""
},
{
"docid": "97c77ce68db211a241dafad0f4208241",
"score": "0.4691252",
"text": "def set_to_end\n wrapped_stream.set_to_begin\n end",
"title": ""
},
{
"docid": "e2c500789998d4c2691d837624df62f7",
"score": "0.46498764",
"text": "def set_row(*args)\n return unless args[0]\n\n row = args[0]\n height = args[1] || @default_height\n xf = args[2]\n hidden = args[3] || 0\n level = args[4] || 0\n collapsed = args[5] || 0\n\n # Get the default row height.\n default_height = @default_row_height\n\n # Use min col in check_dimensions. Default to 0 if undefined.\n min_col = @dim_colmin || 0\n\n # Check that row and col are valid and store max and min values.\n check_dimensions(row, min_col)\n store_row_col_max_min_values(row, min_col)\n\n height ||= default_height\n\n # If the height is 0 the row is hidden and the height is the default.\n if height == 0\n hidden = 1\n height = default_height\n end\n\n # Set the limits for the outline levels (0 <= x <= 7).\n level = 0 if level < 0\n level = 7 if level > 7\n\n @outline_row_level = level if level > @outline_row_level\n\n # Store the row properties.\n @set_rows[row] = [height, xf, hidden, level, collapsed]\n\n # Store the row change to allow optimisations.\n @row_size_changed = true\n\n # Store the row sizes for use when calculating image vertices.\n @row_sizes[row] = [height, hidden]\n end",
"title": ""
},
{
"docid": "8f846c0161698d9b5fdb09bdb1e821fb",
"score": "0.4630936",
"text": "def set_RowId(value)\n set_input(\"RowId\", value)\n end",
"title": ""
},
{
"docid": "8f846c0161698d9b5fdb09bdb1e821fb",
"score": "0.4630936",
"text": "def set_RowId(value)\n set_input(\"RowId\", value)\n end",
"title": ""
},
{
"docid": "8f846c0161698d9b5fdb09bdb1e821fb",
"score": "0.4630936",
"text": "def set_RowId(value)\n set_input(\"RowId\", value)\n end",
"title": ""
},
{
"docid": "6dcae141d44d64fabe5529e059ddbe1a",
"score": "0.46198308",
"text": "def line_end([email protected])\n\t\t\te = self.end i\n\t\t\te -= 1 if @buffer.data[e-1] == \"\\r\"\n\t\t\te\n\t\tend",
"title": ""
},
{
"docid": "7f701d79ab9ecb8fe16c4c61b3442de9",
"score": "0.45981872",
"text": "def last_row\n row(last_row_index)\n end",
"title": ""
},
{
"docid": "07dbe55d01439e469e6b2345fa79e8da",
"score": "0.45807374",
"text": "def end=(arg)\n end",
"title": ""
},
{
"docid": "eeb01fe61f2dbede0e2e339ee4877f7c",
"score": "0.4580459",
"text": "def dtend=(ruby_value)\n self.dtend_property= RiCal::PropertyValue::DateTime.convert(self, ruby_value)\n end",
"title": ""
},
{
"docid": "eeb01fe61f2dbede0e2e339ee4877f7c",
"score": "0.4580459",
"text": "def dtend=(ruby_value)\n self.dtend_property= RiCal::PropertyValue::DateTime.convert(self, ruby_value)\n end",
"title": ""
},
{
"docid": "2fb5bf66760567611d5fdefaf1d75e19",
"score": "0.45793474",
"text": "def stop_at_row(row_number=nil)\n @stop_at_row = row_number if row_number\n @stop_at_row\n end",
"title": ""
},
{
"docid": "881058c33ba34df3c1eef03b5d3b0070",
"score": "0.45779943",
"text": "def next_row\n if self.last_row\n row, self.last_row = self.last_row, nil\n else\n row = cursor.next_row\n end\n row\n end",
"title": ""
},
{
"docid": "28176a8f2efc088ab7535ae212f96b69",
"score": "0.45767745",
"text": "def end_node\n @_end_node ||= _java_rel && _java_rel.end_node.wrapper\n end",
"title": ""
},
{
"docid": "91418fb661b6a509cb570aba339d0a34",
"score": "0.45748004",
"text": "def cursor_end\n blen = current_row().length\n if blen < self.width\n set_col_offset blen # just after the last character\n @panned_cols = 0\n else\n @panned_cols = blen-self.width #+2 # 2 is due to mark and space XXX could be a problem with textbox\n set_col_offset blen # just after the last character\n end\n @curpos = blen # this is position in array where editing or motion is to happen regardless of what you see\n # regardless of panned_cols (panning)\n end",
"title": ""
},
{
"docid": "b6cb9fc2f65ee96b1fe7f54665b5165c",
"score": "0.45746177",
"text": "def rows=(value)\n @rows = value\n end",
"title": ""
},
{
"docid": "cde8d7553ae894240f82e87425f4dace",
"score": "0.4513842",
"text": "def end\n self.records.objects.find { |o| o.name == \"end\" }.val\n end",
"title": ""
},
{
"docid": "7fb808c74daefcba0ae03a5835c0e04a",
"score": "0.4502916",
"text": "def goto_end\n @oldindex = @current_index\n @current_index = @content_rows-1\n @prow = @current_index - @scrollatrows\n end",
"title": ""
},
{
"docid": "76d9f1a883deb12fb45b0f15ec63bd88",
"score": "0.44889086",
"text": "def set_end(lon, lat)\n\t\tfactory = Trip.rgeo_factory_for_column(:end_location)\n\t\tself.end_location = factory.point(lon,lat)\n\tend",
"title": ""
},
{
"docid": "eb92b1b1b2bedf5101f530b43e6b15dd",
"score": "0.44876173",
"text": "def last_row(sheet = nil)\n sheet_for(sheet).last_row\n end",
"title": ""
},
{
"docid": "229e94532bda300834fd7a4236a55388",
"score": "0.44768032",
"text": "def end(value)\n merge(rcend: value.iso8601)\n end",
"title": ""
},
{
"docid": "4b6c55e42dcb54a804c500d56600600e",
"score": "0.44670957",
"text": "def end_node\n id = getEndNode.getId\n Neo4j::Node.load(id)\n end",
"title": ""
},
{
"docid": "5e9674266016e5b62f86648250c031c1",
"score": "0.44640622",
"text": "def move_cursor_to_end_of_line(params) \n\t\texecute_command(model.cursor_row, model.cursor_col, model.cursor_row, model.line(model.cursor_row).length, params)\n\tend",
"title": ""
},
{
"docid": "92dbfd752777a564310b650ac8319b71",
"score": "0.44447827",
"text": "def range_end\n @range_end ||= formated_value.split(delimiter)[1]\n end",
"title": ""
},
{
"docid": "75d9dcde9d5affccc10634cbc9c1ec91",
"score": "0.44343472",
"text": "def end\n offset value.end\n end",
"title": ""
},
{
"docid": "ed86ee49a8906c836c38564ab3c6b89e",
"score": "0.4434276",
"text": "def close_row\n @table.rows.body << @current_row\n # don't have to account for active rowspans here\n # since we know this is first row\n @col_count = @col_visits if @col_count == -1\n @col_visits = 0\n @current_row = []\n @active_rowspans.shift\n @active_rowspans[0] ||= 0\n nil\n end",
"title": ""
},
{
"docid": "aa9f8146e63c2451da2dc6cf676236c0",
"score": "0.4429568",
"text": "def set_Rows(value)\n set_input(\"Rows\", value)\n end",
"title": ""
},
{
"docid": "cf78f3d03994caee611e631c2c75ec7a",
"score": "0.44244543",
"text": "def end\n [self.line_end, self.column_end]\n end",
"title": ""
},
{
"docid": "813b5526d0f63ad16b39d4545ac008c2",
"score": "0.44157195",
"text": "def add_row(values=[], options={})\n Row.new(self, values, options)\n update_auto_fit_data @rows.last.cells, options.delete(:widths) || []\n yield @rows.last if block_given?\n @rows.last\n end",
"title": ""
},
{
"docid": "c519f3bae58b4f012e87dcc837c39491",
"score": "0.4392781",
"text": "def set_end_date(end_date)\n @end_date = end_date\n end",
"title": ""
},
{
"docid": "115a550524c5a3cae4e348d1c364334d",
"score": "0.43918225",
"text": "def row_index=(value)\n @row_index = value\n end",
"title": ""
},
{
"docid": "4a19df750a0ca3b7fdfb189a8b908045",
"score": "0.4390824",
"text": "def _Endline\n\n begin # choice\n _tmp = apply(:_LineBreak)\n break if _tmp\n _tmp = apply(:_TerminalEndline)\n break if _tmp\n _tmp = apply(:_NormalEndline)\n end while false # end choice\n\n set_failed_rule :_Endline unless _tmp\n return _tmp\n end",
"title": ""
},
{
"docid": "af675e6ce211e01d67c8e4cefffff72e",
"score": "0.43786818",
"text": "def set_max_row(options, max_row)\n options.each do |option, value|\n case option\n when \"r\", :r, \"row\", :row\n options[option] = options[option].sub(/EOF/i, max_row.to_s) if options[option] =~ /EOF/i\n end\n end\nend",
"title": ""
},
{
"docid": "f18eca9939431302134e3380b6388422",
"score": "0.43587753",
"text": "def end_node\n id = getEndNode.getId\n Neo4j.load_node(id)\n end",
"title": ""
},
{
"docid": "edc693e72b137de482ec829c9af4b4db",
"score": "0.4349983",
"text": "def end_date=(value)\n @end_date = value\n end",
"title": ""
},
{
"docid": "edc693e72b137de482ec829c9af4b4db",
"score": "0.4349983",
"text": "def end_date=(value)\n @end_date = value\n end",
"title": ""
},
{
"docid": "2a4b05eb86abe680711116de40ff08fb",
"score": "0.43494606",
"text": "def position_at_end(block)\n raise \"Block must not be nil\" if block.nil?\n C.LLVMPositionBuilderAtEnd(self, block)\n self\n end",
"title": ""
},
{
"docid": "34d27b93849d4de1fd4bf0d4f693b50d",
"score": "0.43455455",
"text": "def max_rows=(rows)\n @max_rows = rows\n @meta_modified = true\n end",
"title": ""
},
{
"docid": "d6d565658296a5be43e60faaedb8d2bf",
"score": "0.43428624",
"text": "def end_block #selection\n @last_index = current_index\n lower = [@first_index, @last_index].min\n higher = [@first_index, @last_index].max\n #lower.upto(higher) do |i| @list.toggle_row_selection i; end\n add_row_selection_interval(lower, higher)\n @repaint_required = true\n end",
"title": ""
},
{
"docid": "80ef844808782324485690daa34a2d8c",
"score": "0.4341669",
"text": "def end(value)\n merge(iiend: value.iso8601)\n end",
"title": ""
},
{
"docid": "abb9510b12fc01f2fd2e897b25ad335e",
"score": "0.43409726",
"text": "def fix_end\n\t\t\tself.class.new(@begin, @end, :end)\n\t\tend",
"title": ""
},
{
"docid": "b1a27366e075adbea11cedd5b81e788e",
"score": "0.4337729",
"text": "def end_vertex\n @_end_vertex ||= __java_obj && __java_obj.end_vertex.wrapper\n @_end_vertex \n end",
"title": ""
},
{
"docid": "9ba578ef4603cb9304aaf3e8b8c149c3",
"score": "0.4331045",
"text": "def last_row(sheet=nil)\n sheet = @default_sheet unless sheet\n return @last_row[sheet] if @last_row[sheet]\n fr, lr, fc, lc = get_firsts_lasts(sheet)\n lr\n end",
"title": ""
},
{
"docid": "e04de87590c6a224c5e4bedf24fce48a",
"score": "0.43256912",
"text": "def range=(_range)\n _end = _range.exclude_end? ? _range.end - 1 : _range.end\n @range = LineRange.new(self, _range.begin, _end)\n end",
"title": ""
},
{
"docid": "ee1a3ae9a7e9d71cdcbe686b637b036f",
"score": "0.43208945",
"text": "def end_escaped=(value)\n @end_escaped = value\n end",
"title": ""
},
{
"docid": "ee1a3ae9a7e9d71cdcbe686b637b036f",
"score": "0.43208945",
"text": "def end_escaped=(value)\n @end_escaped = value\n end",
"title": ""
},
{
"docid": "658557d467339680681696979a66089d",
"score": "0.4305039",
"text": "def table_end\n @io << @templates[:table_end].result(binding)\n end",
"title": ""
},
{
"docid": "b22ce17040ad1c8f6c2052e2f2b8655f",
"score": "0.4300598",
"text": "def row_type=(row_type)\n if row_type.nil?\n fail ArgumentError, 'invalid value for \"row_type\", row_type cannot be nil.'\n end\n @row_type = row_type\n end",
"title": ""
}
] |
49010d84e365151df643cf164ccaab8f
|
PUT /warmups/1 PUT /warmups/1.xml
|
[
{
"docid": "cbfd0573c4245f5ac3e600457dda19bf",
"score": "0.71528786",
"text": "def update\n @warmup = Warmup.find(params[:id])\n\n respond_to do |format|\n if @warmup.update_attributes(params[:warmup])\n format.html { redirect_to(@warmup, :notice => 'Warmup was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @warmup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "2b84dec63886ffea9aeaa0a7a353ad23",
"score": "0.6523417",
"text": "def create\n @warmup = Warmup.new(params[:warmup])\n\n respond_to do |format|\n if @warmup.save\n format.html { redirect_to(@warmup, :notice => 'Warmup was successfully created.') }\n format.xml { render :xml => @warmup, :status => :created, :location => @warmup }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @warmup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "674eb000a3ff718caaf6ea17de8092c9",
"score": "0.61672187",
"text": "def destroy\n @warmup = Warmup.find(params[:id])\n @warmup.destroy\n\n respond_to do |format|\n format.html { redirect_to(warmups_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e0fc636b0ec464b1e3939cb02d4ff10f",
"score": "0.59743047",
"text": "def show\n @warmup = Warmup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @warmup }\n end\n end",
"title": ""
},
{
"docid": "378316cf49d6edd569edb307ac366394",
"score": "0.58811337",
"text": "def new\n @warmup = Warmup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @warmup }\n end\n end",
"title": ""
},
{
"docid": "9ddf960eb3f437e62b9b99d34992bc0f",
"score": "0.54225326",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.5276747",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "0aed2a3bc8773635a0d5cf16229aaabd",
"score": "0.5258692",
"text": "def warmup(value)\n @warmup = value\n self\n end",
"title": ""
},
{
"docid": "0aed2a3bc8773635a0d5cf16229aaabd",
"score": "0.5258692",
"text": "def warmup(value)\n @warmup = value\n self\n end",
"title": ""
},
{
"docid": "0aed2a3bc8773635a0d5cf16229aaabd",
"score": "0.5258692",
"text": "def warmup(value)\n @warmup = value\n self\n end",
"title": ""
},
{
"docid": "1d610129a318833bcd6f326c295617ae",
"score": "0.52151597",
"text": "def update\n @swarm_request = SwarmRequest.find(params[:id])\n\n respond_to do |format|\n if @swarm_request.update_attributes(params[:swarm_request])\n format.html { redirect_to(@swarm_request, :notice => 'Swarm request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @swarm_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1d610129a318833bcd6f326c295617ae",
"score": "0.52151597",
"text": "def update\n @swarm_request = SwarmRequest.find(params[:id])\n\n respond_to do |format|\n if @swarm_request.update_attributes(params[:swarm_request])\n format.html { redirect_to(@swarm_request, :notice => 'Swarm request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @swarm_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3fe5414cc08288f5a28ba852f2585026",
"score": "0.51939005",
"text": "def start_warmup(ip)\n _params = {:ip => ip}\n return @master.call 'ips/start-warmup', _params\n end",
"title": ""
},
{
"docid": "a060c0fd2fb80f6d8a7614e453e9d468",
"score": "0.5111476",
"text": "def start_warmup(ip)\n _params = {:ip => ip}\n return @master.call 'ips/start-warmup', _params\n end",
"title": ""
},
{
"docid": "238fd956be713471aa406c76bf19254a",
"score": "0.5089589",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :status_post => {:body => 'API Status Post 1' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "d7c4f69e69f30c7bcd86b67f5506231b",
"score": "0.5060369",
"text": "def set_group_performed_warmup\n @group_performed_warmup = GroupPerformedWarmup.find(params[:id])\n end",
"title": ""
},
{
"docid": "0f828e39ac6c0cb39ceb456b5ed44912",
"score": "0.50472474",
"text": "def warmup; end",
"title": ""
},
{
"docid": "3072e18ed709ea4f1b4946411b956e82",
"score": "0.5045757",
"text": "def update\n if @group_performed_warmup.warmup_id != params[:group_performed_warmup][:warmup_id]\n @group_performed_warmup.update_ex(group_performed_warmup_params)\n @group_routine = @group_performed_warmup.group_routine\n render 'group_routines/show'\n else\n render json: @group_performed_warmup.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.5040422",
"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": "2db8510634a8588feaf130b0ace4c384",
"score": "0.50228417",
"text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :api_key => 'testapikey',\r\n :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "d413d56ff92ef98c8eb61c826c7d8862",
"score": "0.49551955",
"text": "def set_api_v1_monster\n @api_v1_monster = Monster.find(params[:id])\n end",
"title": ""
},
{
"docid": "89f26f5dfeb16383913989fdd1e0f222",
"score": "0.49348736",
"text": "def group_performed_warmup_params\n params.require(:group_performed_warmup).permit(:warmup_id)\n end",
"title": ""
},
{
"docid": "93ee7444d9a6ce1df47ddc5dbf0f5122",
"score": "0.49250203",
"text": "def warm(name, suffix)\n puts \"warming.. #{name} from #{name}#{suffix}\"\n begin\n view_name = get_first_view(name + suffix)\n src = @db.view('_design/' + name + suffix + '/_view/' + view_name)\n rescue RestClient::RequestTimeout => e\n puts \"working hard....\"\n end\n\n msg = \"still active..\"\n counter = 1\n while is_active?\n print '.' if counter % 5 == 0\n sleep 1\n counter += 1\n end\n puts \"copying..\"\n after_warm(name + suffix, name)\n puts \"warming #{name} from #{name}#{suffix} done!!!\"\n end",
"title": ""
},
{
"docid": "c6e72de920484ad983cbb15826602d6a",
"score": "0.48884973",
"text": "def set_wheat\n @wheat = Wheat.find(params[:id])\n end",
"title": ""
},
{
"docid": "01580144b2dff5916a91bf7ba2116dc5",
"score": "0.48715514",
"text": "def update\n metric = Metric.first(:conditions => ['name=? AND enabled=? AND user_managed=?', params[:id], true, true])\n if metric\n metric.attributes = params.merge({:name => params[:id], :short_name => params[:name]})\n metric.save!\n Metric.clear_cache\n\n respond_to do |format|\n format.json { render :json => jsonp(metrics_to_json([metric])) }\n format.xml { render :xml => metrics_to_xml([metric]) }\n end\n else\n render_not_found('Unable to update manual metric: '+ params[:id])\n end\n end",
"title": ""
},
{
"docid": "7508bdb0a888a704fc2936d22596f73d",
"score": "0.48688617",
"text": "def update\n set_wine\n if @wine.update(wine_params)\n render status: 204, :json => @wines, :include =>[{:wine_taste_profile =>{:except =>[:id, :created_at, :updated_at]}}], :except => [:created_at, :updated_at]\n else\n render status: 404, json: { message: @wine.errors}.to_json\n end\n end",
"title": ""
},
{
"docid": "6cbbddc73e7fbb152fae713f712777b3",
"score": "0.4865731",
"text": "def update\n update_resource(@tomato)\n end",
"title": ""
},
{
"docid": "d0fba1bf3c5e1dc0008c27994e1dabe4",
"score": "0.48652562",
"text": "def test_should_update_blog_post_via_API_XML\r\n get \"/logout\"\r\n put \"/blog_posts/1.xml\", :blog_post => {:title => 'API Test Post',\r\n :body => 'API Test Body',\r\n :published => true,\r\n :featured => false,\r\n :summary => 'Blog Post Summary',\r\n :url => 'http://www.apiblogpost.com',\r\n :guid => '22222' }\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "11c250978f4d45503bb1ed5e8887729e",
"score": "0.48270598",
"text": "def flush\n Puppet.debug(\"Calling flush method of serviceprovider: \")\n if @property_hash != {}\n login_instance = Login.new\n auth_header = login_instance.get_auth_header\n service_instance = SwaggerClient::ServiceApi.new\n svcName=@resource[:name]\n Puppet.debug(\"WAF service name in manifest: #{svcName}\") \n response= service_instance.services_web_application_name_put(auth_header,svcName,message(resource),{})\n Puppet.debug(\"WAF services PUT response: #{response}\")\n end \n return response\nend",
"title": ""
},
{
"docid": "1c8484a8480f3ea22af3d572d7532e9e",
"score": "0.48228806",
"text": "def update\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.attributes = params[:physical_rack]\n @physical_rack.audits << Audit.new(source: 'controller', action: 'update', admin_user: current_user)\n respond_to do |format|\n if @physical_rack.save\n format.html { redirect_to @physical_rack, notice: 'Physical rack was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @physical_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0695f927ec99c50909c433d5240c91d",
"score": "0.4816289",
"text": "def earmuff(id)\n update(id, action: 'earmuff')\n end",
"title": ""
},
{
"docid": "dd1b2da7b04f9b651efe6f37abc5ae08",
"score": "0.4805444",
"text": "def flush\n if @property_hash != {}\n Puppet.debug(\"Calling flush method of serviceprovider: \")\n login_instance = Login.new\n auth_header = login_instance.get_auth_header\n service_instance = SwaggerClient::ServiceApi.new\n svcName=@resource[:name]\n Puppet.debug(\"WAF service name in manifest: #{svcName}\") \n response= service_instance.services_web_application_name_put(auth_header,svcName,message(resource),{})\n Puppet.debug(\"WAF services PUT response: #{response}\")\n end\n return response\nend",
"title": ""
},
{
"docid": "6849278acb6143dd874a96ceae902caa",
"score": "0.47988737",
"text": "def update\n @lift_set = LiftSet.find(params[:id])\n\n if @lift_set.update(lift_set_params)\n head :no_content\n else\n render json: @lift_set.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "57546096e65765413e2ea833b2eee0f2",
"score": "0.47696403",
"text": "def rebuild\n EngineyardAPI::API.put(\"#{@path}/update_instances\",{:body => \"\"})\n end",
"title": ""
},
{
"docid": "376770d4daf61e7c7c7d4873be1c38b4",
"score": "0.47674674",
"text": "def test_should_update_status_post_via_API_JSON\r\n get \"/logout\"\r\n put \"/status_posts/1.json\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.4764255",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "afacaec6961b8886c7ed9fb146511783",
"score": "0.4760005",
"text": "def create\n @mushers = Musher.all\n @checkpoints = Checkpoint.all\n @update = Update.new(params[:update])\n \n if params[:update][:dogsin]\n respond_to do |format|\n @update.timeout = \"\"\n if @update.save\n format.html { redirect_to(@update, :notice => 'Update was successfully created.') }\n format.xml { render :xml => @update, :status => :created, :location => @update }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @update.errors, :status => :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n @updateOUT = Update.find(:all, :conditions => \"musher_id = #{@update.musher_id} and\n checkpoint_id = #{@update.checkpoint_id}\")\n if @updateOUT.save\n format.html { redirect_to(@update, :notice => 'Update was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @updateOUT.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9ebb43ee634b6152e782720f0f58cb12",
"score": "0.47408348",
"text": "def apply\n update\n rescue Kubeclient::ResourceNotFoundError\n create\n end",
"title": ""
},
{
"docid": "9ebb43ee634b6152e782720f0f58cb12",
"score": "0.47408348",
"text": "def apply\n update\n rescue Kubeclient::ResourceNotFoundError\n create\n end",
"title": ""
},
{
"docid": "5f041435cad196554adf632144ecbdc3",
"score": "0.47395426",
"text": "def update params = {}, body = {}\n @connection.request(method: :post, path: build_path(\"/swarm/update\", params), headers: {\"Content-Type\": \"application/json\"}, body: body.to_json)\n end",
"title": ""
},
{
"docid": "d61a25d69ed10b03601d4f17ba7d9ef3",
"score": "0.4723266",
"text": "def update\n #RAILS_DEFAULT_LOGGER.debug(\"******** REST Call to CRMS: Updating #{self.class.name}:#{self.id}\")\n #RAILS_DEFAULT_LOGGER.debug(caller[0..5].join(\"\\n\")) \n response = connection.put(element_path(prefix_options), to_xml, self.class.headers)\n save_nested\n load_attributes_from_response(response)\n merge_saved_nested_resources_into_attributes\n response\n end",
"title": ""
},
{
"docid": "bb879598e3b1d4618660ffb7ad737b42",
"score": "0.46987566",
"text": "def warm_up\n __update__(build)\n end",
"title": ""
},
{
"docid": "1be44c3e0ba097e5e9e3383b5907538c",
"score": "0.4693277",
"text": "def update(id, member=\"Default member\", rating=\"9\", venue_Name=\"Default Venue_Name\", address=\"Default Address\", city=\"Default City\", phone=\"9999999999\" , date=\"\" , comment= \"Default Comment\")\r\n\t\txml_req =\r\n\t\t\"<?xml version='1.0' encoding='UTF-8'?>\r\n\t\t\t<review>\r\n\t\t\t\t<Member>#{member}</Member>\r\n\t\t\t\t<Rating>#{rating}</Rating>\r\n\t\t\t\t<Venue-Name>#{venue_Name}</Venue-Name>\r\n\t\t\t\t<Address>#{address}</Address>\r\n\t\t\t\t<City>#{city}</City>\r\n\t\t\t\t<Phone>#{phone}</Phone>\r\n\t\t\t\t<Date-of-Visit>date</Date-of-Visit>\r\n\t\t\t\t<Comment>#{comment}</Comment>\t\t\t\t\t\r\n\t\t\t</review>\"\r\n\r\n\t\trequest = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n\t\trequest.add_field \"Content-Type\", \"application/xml\"\r\n\t\trequest.body = xml_req\r\n\r\n\t\thttp = Net::HTTP.new(@uri.host, @uri.port)\r\n\t\tresponse = http.request(request)\r\n\r\n\t\t# no response body will be returned\r\n\t\tcase response\r\n\t\twhen Net::HTTPSuccess\r\n\t\t\treturn \"#{response.code} OK\"\r\n\t\telse\r\n\t\t\treturn \"#{response.code} ERROR\"\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "31b8c3e8d7ec7626b0216e7e563aa850",
"score": "0.46822023",
"text": "def update\n @statuses = Status.all\n @musher = Musher.find(params[:id])\n\n respond_to do |format|\n if @musher.update_attributes(params[:musher])\n ##format.html { redirect_to(@musher, :notice => 'Musher was successfully updated.') }\n ##format.xml { head :ok }\n format.html { redirect_to(:action => :index) }\n format.xml { redirect_to(:action => :index) }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @musher.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "545dadbe32aa3d9d0edf1d22293783fc",
"score": "0.46697763",
"text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('bar')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "520ba9f9e0c03a25cf08dc19f4d8a996",
"score": "0.46641797",
"text": "def update\n @washer_dryer = WasherDryer.find(params[:id])\n\n respond_to do |format|\n if @washer_dryer.update_attributes(params[:washer_dryer])\n flash[:notice] = 'WasherDryer was successfully updated.'\n format.html { redirect_to(@washer_dryer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @washer_dryer.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b855c5a760ab0420d815f0f990373cf5",
"score": "0.46619117",
"text": "def update\n @hat = Hat.find(params[:id])\n\n respond_to do |format|\n if @hat.update_attributes(params[:hat])\n flash[:notice] = 'Hat was successfully updated.'\n format.html { redirect_to(@hat) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @hat.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05261bb445f79a8dfbd7703275c39428",
"score": "0.46590874",
"text": "def freshen_on_warm\n false\n end",
"title": ""
},
{
"docid": "5bf75c80b6c1afd029c4bd2222278299",
"score": "0.46557206",
"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": "96c2c4ca74afa5a26914fb582062f271",
"score": "0.46534267",
"text": "def test_should_update_event_via_API_XML\r\n get \"/logout\"\r\n put \"/events/1.xml\", :event => {:name => 'Test API Event 1',\r\n :start_time => Time.now.to_s(:db),\r\n :end_time => Time.now.to_s(:db),\r\n :user_id => 1,\r\n :description => 'Test API Event 1 Desc',\r\n :event_type => 'API Type',\r\n :location => 'Testville, USA',\r\n :street => 'Testers Rd.',\r\n :city => 'TestTown',\r\n :website => 'http://www.test.com',\r\n :phone => '555-555-5555',\r\n :organized_by => 'API Testers of America'}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "78a24df116678322ef160fdc15eaea4c",
"score": "0.46506172",
"text": "def update\n update_scale\n update_location\n update_trauma\n end",
"title": ""
},
{
"docid": "428001907422826161d47ea0ac222382",
"score": "0.46473226",
"text": "def bump_karma\n puts \"karma up for #{name}\" # This should not be part of the public api \n end",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.46404412",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "15b4eaae00b1de6b46ffcf340eb00751",
"score": "0.46377438",
"text": "def update\n @wagon = Wagon.find(params[:id])\n\n respond_to do |format|\n if @wagon.update_attributes(params[:wagon])\n flash[:notice] = 'Wagon was successfully updated.'\n format.html { redirect_to(@wagon) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @wagon.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03c87bf0bff6302e8f6b741e226ec9c9",
"score": "0.4632599",
"text": "def put_vm(xmlfile)\n xml=File.read(xmlfile)\n vm_info=REXML::Document.new(xml).root.elements\n\n url = URI.parse(@endpoint+'/compute/' + vm_info['ID'].text)\n\n req = Net::HTTP::Put.new(url.path)\n req.body = xml\n\n req.basic_auth @occiauth[0], @occiauth[1]\n\n res = CloudClient::http_start(url) do |http|\n http.request(req)\n end\n\n if CloudClient::is_error?(res)\n return res\n else\n return res.body\n end\n end",
"title": ""
},
{
"docid": "da2846aad4e2149a4d5d2a3bdc5b0c09",
"score": "0.46256638",
"text": "def update\n params[:id].each{|id|\n blog = Blog.find(id.to_i)\n blog.update_attribute(:collected, 1)\n }\n\n respond_to do |format|\n format.html { redirect_to :action => 'index' }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a528317366678b62c884e85d36bb199a",
"score": "0.4611116",
"text": "def update\n @mini = Mini.find(params[:id])\n\n respond_to do |format|\n if @mini.update_attributes(params[:mini])\n format.html { redirect_to(@mini, :notice => 'Mini was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mini.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab05d2d3850ab650bb86caa53f0130b7",
"score": "0.46093717",
"text": "def update\n headers = self.class.headers.merge 'Accept' => 'application/xml'\n connection.post(element_path(prefix_options.merge(:action_hack => :update)), encode, headers).tap do |response|\n load_attributes_from_response(response)\n end\n end",
"title": ""
},
{
"docid": "3c63f8ed75cedf4adf28a329cf56ca9d",
"score": "0.460904",
"text": "def setresource\n @resource = Resourceweightage.update(params[:id],:cpu => params[:cpu], :ram => params[:ram], :nic => params[:nic])\n \n end",
"title": ""
},
{
"docid": "3b79d6fa29f06e73b02b032a4612b4a3",
"score": "0.46080896",
"text": "def assign_ssids_to_portal(args = {}) \n put(\"/guestaccess.json/gap/#{args[:portalId]}/ssids\", args)\nend",
"title": ""
},
{
"docid": "cd5c496cac05b3a5238b11e40d2a5073",
"score": "0.46013024",
"text": "def flush\n if @monitoringserver_json\n @updated_json = @monitoringserver_json.dup\n else\n @updated_json = default_monitoringserver\n end\n \n @updated_json[\"nodes\"] = []\n if @property_hash[:nodes]\n @property_hash[:nodes].each do |n|\n @updated_json[\"nodes\"] << { :name => n }\n end\n end\n\n if not @property_hash[:passive].to_s.empty?\n @updated_json[\"passive\"] = @property_hash[:passive]\n end\n\n if not @property_hash[:ssh_tunnel].to_s.empty?\n @updated_json[\"ssh_forward\"] = @property_hash[:ssh_tunnel]\n end\n\n if not @property_hash[:activated].to_s.empty?\n @updated_json[\"activated\"] = @property_hash[:activated]\n end\n\n @updated_json[\"name\"] = @resource[:name]\n \n # Flush changes:\n put @updated_json.to_json\n\n if defined? @resource[:reload_opsview]\n if @resource[:reload_opsview].to_s == \"true\"\n Puppet.notice \"Configured to reload opsview\"\n do_reload_opsview\n else\n Puppet.notice \"Configured NOT to reload opsview\"\n end\n end\n\n @property_hash.clear\n @monitoringserver_properties.clear\n\n false\n end",
"title": ""
},
{
"docid": "1a70151d1b548969f237388e7429b150",
"score": "0.4601202",
"text": "def update_rest\n @v1_page_usage = V1PageUsage.find(params[:id])\n\n respond_to do |format|\n if @v1_page_usage.update_attributes(params[:v1_page_usage])\n flash[:notice] = 'V1PageUsage was successfully updated.'\n format.html { redirect_to(@v1_page_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @v1_page_usage.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1beccac6902f321ddf1c129d7bee8c84",
"score": "0.4600241",
"text": "def assign_ssids_to_portal(args = {}) \n id = args['id']\n temp_path = \"/guestaccess.json/gap/{portalId}/ssids\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"portalId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "f6018bfebe02fd19d8e4c850bb2ef58f",
"score": "0.45960748",
"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": "94af5ceabebf1cd723509aed22d499d4",
"score": "0.45949924",
"text": "def update\n @more_power_ups_request = MorePowerUpsRequest.find(params[:id])\n\n respond_to do |format|\n if @more_power_ups_request.update_attributes(params[:more_power_ups_request])\n format.html { redirect_to @more_power_ups_request, notice: 'More power ups request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @more_power_ups_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2752d857d53f4c5454f55b3a7f2aa54c",
"score": "0.45918137",
"text": "def test_update_stat\n\t\tput '/stats/8', {json: '{\"statkey\":\"m\", \"statvalue\": \"i\"}'}\n\t\tassert_equal 'm', @j[:name]\n\t\tassert_equal 'i', @j[:value]\n\t\tput '/stats/99', {json: '{\"statkey\":\"m\"}'}\n\t\tassert_equal 'Not Found', @j[:title]\n\t\tput '/stats/8', {json: '{\"person_id\":\"boop\"}'}\n\t\tassert @j[:title].include? 'invalid input syntax'\n\tend",
"title": ""
},
{
"docid": "45cad7c5aee9fadb2d004ec9f0a14d67",
"score": "0.45749766",
"text": "def update(conn, datahexstr)\n data = hexToBytes(datahexstr)\n resp = conn.put do |req|\n req.url \"/sensor.json\"\n req.headers['Content-Type'] = 'application/json'\n req.headers['Accept'] = 'application/json'\n req.body = DecodeElsysPayload(data).to_json\n end\n puts resp.status\nend",
"title": ""
},
{
"docid": "4905dcc90d222e149baae27f543c3fa6",
"score": "0.45744535",
"text": "def upsert()\n self.class.post('upsert', {}, self.to_xml())\n end",
"title": ""
},
{
"docid": "54473145c97755636d2c9b9828cc55fe",
"score": "0.45702308",
"text": "def update\n @train = Train.find(params[:id])\n\n if @train.update(train_params)\n head :no_content\n else\n render json: @train.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "4945db436ac4dcbe39e5147ad4208f0d",
"score": "0.45657328",
"text": "def update\n @wiggle = Wiggle.find(params[:id])\n\n respond_to do |format|\n if @wiggle.update_attributes(params[:wiggle])\n format.html { redirect_to(@wiggle, :notice => 'Wiggle was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @wiggle.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bed765d78b2e44298d0c22204f762fb4",
"score": "0.45601487",
"text": "def flush\n Puppet.debug(\"Calling flush method of serverprovider: \")\n if @property_hash != {}\n Puppet.debug(\"Property Hash check passed\")\n login_instance = Login.new\n auth_header = login_instance.get_auth_header\n server_instance = SwaggerClient::ServerApi.new\n serverName=@resource[:name]\n serviceName=@resource[:service_name]\n Puppet.debug(\"WAF server name in manifest: #{serverName}\")\n params = message(resource)\n data,status_code,headers = server_instance.services_web_application_name_servers_server_name_put(auth_header,serviceName,serverName,message(resource),{})\n\n if status_code == 200\n return data\n else\n Puppet.debug(\"There is some problem to process the request. status_code is #{status_code}\")\n return\n end\n end\nend",
"title": ""
},
{
"docid": "0d5394f593640030071695673723a924",
"score": "0.455911",
"text": "def put_vm(xmlfile)\n xml=File.read(xmlfile)\n vm_info=Crack::XML.parse(xml)\n \n url = URI.parse(@endpoint+'/compute/' + vm_info['COMPUTE']['ID'])\n \n req = Net::HTTP::Put.new(url.path)\n req.body = xml\n \n req.basic_auth @occiauth[0], @occiauth[1]\n \n res = CloudClient::http_start(url) do |http|\n http.request(req)\n end\n \n if CloudClient::is_error?(res)\n return res\n else\n return res.body\n end\n end",
"title": ""
},
{
"docid": "7bdf74f9da6635048220bf6b56d80425",
"score": "0.4544023",
"text": "def up_replicate_chunk(chunk_key,to_server); request(:put,\"server/up_replicate_chunk/#{ue chunk_key}\", :params => {:to_server => to_server.to_s})[:status]; end",
"title": ""
},
{
"docid": "91d02c0325ffa593fbda1867725b8e5f",
"score": "0.45354193",
"text": "def update\n if @measure.update(measure_params)\n head :no_content, status: 204\n else\n render json: @measure.errors, status: 422\n end \n end",
"title": ""
},
{
"docid": "882c8317370987b86425c0adbf5bfe8c",
"score": "0.4534972",
"text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "5ab4388ff8a45a2fa9cf444f10ed5939",
"score": "0.45272708",
"text": "def oneoff_yaml_rewrite(path)\n run_opts = new_resource.run_opts\n return if run_opts[:entrypoint].nil?\n\n data = YAML.load(::IO.read(path))\n data.each do |svc, hash|\n next unless svc == Array(new_resource.service).first\n data[svc]['entrypoint'] = run_opts[:entrypoint]\n end\n\n ::File.open(path, 'w+') { |f| f.write(data.to_yaml) }\nend",
"title": ""
},
{
"docid": "0d5270f3b1931b9ab76b8b0f42406dec",
"score": "0.4515649",
"text": "def perform_warmup(context, warmup)\n warmup_target = Time.now + warmup\n\n while Time.now < warmup_target\n context.instance_eval(&@block)\n end\n end",
"title": ""
},
{
"docid": "74a4ac5f67af4608962535b1f74ba023",
"score": "0.45146587",
"text": "def update\n @mini_map = MiniMap.find(params[:id])\n\n respond_to do |format|\n if @mini_map.update_attributes(params[:mini_map])\n format.html { redirect_to @mini_map, notice: 'Mini map was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mini_map.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "660901e333a60c0972d5ab28ae72a67d",
"score": "0.4514389",
"text": "def update\n @hot_water_consumption = HotWaterConsumption.find(params[:id])\n\n respond_to do |format|\n if @hot_water_consumption.update_attributes(params[:hot_water_consumption])\n format.html { redirect_to @hot_water_consumption, notice: 'Hot water consumption was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hot_water_consumption.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba5a882c8b2dbce1dc8153798b2594c2",
"score": "0.45141134",
"text": "def update\n head :ok\n end",
"title": ""
},
{
"docid": "ba5a882c8b2dbce1dc8153798b2594c2",
"score": "0.45141134",
"text": "def update\n head :ok\n end",
"title": ""
},
{
"docid": "64fd476b63d3ecc5aa8a8bd33299edb6",
"score": "0.45140433",
"text": "def set_moopeep\n @moopeep = Moopeep.find(params[:id])\n end",
"title": ""
},
{
"docid": "24757a5dece095bbd1091bc6c0ac11d1",
"score": "0.45125976",
"text": "def test_josm_upload\n basic_authorization create(:user).email, \"test\"\n\n # create a temporary changeset\n content \"<osm><changeset>\" \\\n \"<tag k='created_by' v='osm test suite checking changesets'/>\" \\\n \"</changeset></osm>\"\n put :create\n assert_response :success\n changeset_id = @response.body.to_i\n\n diff = <<OSMFILE.strip_heredoc\n <osmChange version=\"0.6\" generator=\"JOSM\">\n <create version=\"0.6\" generator=\"JOSM\">\n <node id='-1' visible='true' changeset='#{changeset_id}' lat='51.49619982187321' lon='-0.18722061869438314' />\n <node id='-2' visible='true' changeset='#{changeset_id}' lat='51.496359883909605' lon='-0.18653093576241928' />\n <node id='-3' visible='true' changeset='#{changeset_id}' lat='51.49598132358285' lon='-0.18719613290981638' />\n <node id='-4' visible='true' changeset='#{changeset_id}' lat='51.4961591711078' lon='-0.18629015888084607' />\n <node id='-5' visible='true' changeset='#{changeset_id}' lat='51.49582126021711' lon='-0.18708186591517145' />\n <node id='-6' visible='true' changeset='#{changeset_id}' lat='51.49591018437858' lon='-0.1861432441734455' />\n <node id='-7' visible='true' changeset='#{changeset_id}' lat='51.49560784152179' lon='-0.18694719410005425' />\n <node id='-8' visible='true' changeset='#{changeset_id}' lat='51.49567389979617' lon='-0.1860289771788006' />\n <node id='-9' visible='true' changeset='#{changeset_id}' lat='51.49543761398892' lon='-0.186820684213126' />\n <way id='-10' action='modiy' visible='true' changeset='#{changeset_id}'>\n <nd ref='-1' />\n <nd ref='-2' />\n <nd ref='-3' />\n <nd ref='-4' />\n <nd ref='-5' />\n <nd ref='-6' />\n <nd ref='-7' />\n <nd ref='-8' />\n <nd ref='-9' />\n <tag k='highway' v='residential' />\n <tag k='name' v='Foobar Street' />\n </way>\n </create>\n </osmChange>\nOSMFILE\n\n # upload it\n content diff\n post :upload, :params => { :id => changeset_id }\n assert_response :success,\n \"can't upload a diff from JOSM: #{@response.body}\"\n\n get :download, :params => { :id => changeset_id }\n assert_response :success\n\n assert_select \"osmChange\", 1\n assert_select \"osmChange>create>node\", 9\n assert_select \"osmChange>create>way\", 1\n assert_select \"osmChange>create>way>nd\", 9\n assert_select \"osmChange>create>way>tag\", 2\n end",
"title": ""
},
{
"docid": "eab3faa4e6a97b130ff5718d6ca6d620",
"score": "0.45076403",
"text": "def update\n @overhead = Overhead.find(params[:id])\n\n respond_to do |format|\n if @overhead.update_attributes(params[:overhead])\n format.html { redirect_to @overhead, notice: 'Overhead was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @overhead.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30bc0e4af8d1bad94d47f644ff14650d",
"score": "0.4503308",
"text": "def update\n dpl = find_item(params[:id])\n dpl.base_uri = api_path()\n dpl.user = 'root' # Ugly hack since no auth is needed for this method on theg5k API\n\n begin\n dpl.touch! if dpl.active?\n rescue Exception => e\n raise ServerError, e.message\n end\n\n location_uri = uri_to(\n resource_path(dpl.uid),\n :in, :absolute\n )\n\n render :text => \"\",\n :head => :ok,\n :location => location_uri,\n :status => 204\n end",
"title": ""
},
{
"docid": "7c7461528bdd1cd453c70ae5cb3e0faa",
"score": "0.45004493",
"text": "def update\n @mouse_rack = @mouse_racks.find(params[:id])\n respond_to do |format|\n if @mouse_rack.update_attributes(params[:mouse_rack])\n format.json { render json: @mouse_rack }\n else\n format.json { render json: @mouse_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1884b7b3feea9ab648608e7592fd608f",
"score": "0.4498958",
"text": "def freshen(args)\n Athenry::freshen.update(*args)\n end",
"title": ""
},
{
"docid": "12bb3d306a8703d084dd47073f74b83a",
"score": "0.44963622",
"text": "def update\n @mini_url = MiniUrl.find(params[:id])\n\n respond_to do |format|\n if @mini_url.update_attributes(params[:mini_url])\n format.html { redirect_to(@mini_url, :notice => 'Mini url was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mini_url.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f8bc8b5aa099b12715f109a15815ee4",
"score": "0.4492642",
"text": "def update\n respond_to do |format|\n if @shard.update(shard_params)\n format.html { redirect_to @shard, notice: 'Shard was successfully updated.' }\n format.json { render :show, status: :ok, location: @shard }\n else\n format.html { render :edit }\n format.json { render json: @shard.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "866189ec60d5c0c5b37bea5baebf4406",
"score": "0.4491057",
"text": "def save_floorplan_settings(args = {}) \n put(\"/userproperties.json/floorplan/#{args[:floorplanId]}\", args)\nend",
"title": ""
},
{
"docid": "3b216440d755055bcafc8c2e65d0dbbf",
"score": "0.44878215",
"text": "def update\n @punch = Punch.find(params[:id])\n\n respond_to do |format|\n if @punch.update_attributes(params[:punch])\n flash[:notice] = 'Punch was successfully updated.'\n format.html { redirect_to(@punch) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @punch.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6fc8c20056c03c8cb9ea145765709a43",
"score": "0.44866246",
"text": "def up(number = 2)\n puts \"Starting #{number} load testing servers...\"\n\n digitalocean.create number\n\n success \"Succesfully created #{number} new sharks!\"\n end",
"title": ""
},
{
"docid": "2701deba7bce4965d5769e47c1b82985",
"score": "0.44856125",
"text": "def cheater\n puts(\"YOU HAVE TRIED TO CHEAT ME!\")\n RESTful.put(\"#{URL_MICROSERVICE_PLAYER}/cheater\", {'id' => @idPlayer}.to_json, 'application/json')\n sleep(2)\n end",
"title": ""
},
{
"docid": "1b1f6ea19a7787b59dfedca17aecc442",
"score": "0.44845793",
"text": "def save!\n WireMockMapper.create_mapping do |request, respond|\n request.with_url_path.equal_to(endpoint)\n request.with_query_param('api-key').matching(/\\w{32}/)\n respond.with_body(self.response)\n respond.with_header('Content-Type', 'application/json')\n end\n end",
"title": ""
},
{
"docid": "75c0918be89d7d5b78459795c0253a61",
"score": "0.44817662",
"text": "def start uid\n response = call_api method: :put, id: uid, action: '/start'\n ap JSON.parse(response.body)\n return response\n end",
"title": ""
},
{
"docid": "2562194eda10f9e580b3a59267fb73b2",
"score": "0.44817132",
"text": "def update!\n request_ids.shift\n return unless request_ids.empty?\n\n node = @root.render\n `PATCHER(#{root.node}, #{node})`\n @root.node = node\n end",
"title": ""
},
{
"docid": "05fb1ade797ba3d0343df5a4cc0f580d",
"score": "0.44813615",
"text": "def test_changeset_limits\n basic_authorization create(:user).email, \"test\"\n\n # open a new changeset\n content \"<osm><changeset/></osm>\"\n put :create\n assert_response :success, \"can't create a new changeset\"\n cs_id = @response.body.to_i\n\n # start the counter just short of where the changeset should finish.\n offset = 10\n # alter the database to set the counter on the changeset directly,\n # otherwise it takes about 6 minutes to fill all of them.\n changeset = Changeset.find(cs_id)\n changeset.num_changes = Changeset::MAX_ELEMENTS - offset\n changeset.save!\n\n with_controller(NodeController.new) do\n # create a new node\n content \"<osm><node changeset='#{cs_id}' lat='0.0' lon='0.0'/></osm>\"\n put :create\n assert_response :success, \"can't create a new node\"\n node_id = @response.body.to_i\n\n get :read, :params => { :id => node_id }\n assert_response :success, \"can't read back new node\"\n node_doc = XML::Parser.string(@response.body).parse\n node_xml = node_doc.find(\"//osm/node\").first\n\n # loop until we fill the changeset with nodes\n offset.times do |i|\n node_xml[\"lat\"] = rand.to_s\n node_xml[\"lon\"] = rand.to_s\n node_xml[\"version\"] = (i + 1).to_s\n\n content node_doc\n put :update, :params => { :id => node_id }\n assert_response :success, \"attempt #{i} should have succeeded\"\n end\n\n # trying again should fail\n node_xml[\"lat\"] = rand.to_s\n node_xml[\"lon\"] = rand.to_s\n node_xml[\"version\"] = offset.to_s\n\n content node_doc\n put :update, :params => { :id => node_id }\n assert_response :conflict, \"final attempt should have failed\"\n end\n\n changeset = Changeset.find(cs_id)\n assert_equal Changeset::MAX_ELEMENTS + 1, changeset.num_changes\n\n # check that the changeset is now closed as well\n assert(!changeset.is_open?,\n \"changeset should have been auto-closed by exceeding \" \\\n \"element limit.\")\n end",
"title": ""
},
{
"docid": "4be308bc2043e4bd07a10da28456e16c",
"score": "0.44801936",
"text": "def update\n respond_to do |format|\n if @strap.update(strap_params)\n format.html { redirect_to @strap, notice: \"Strap was successfully updated.\" }\n format.json { render :show, status: :ok, location: @strap }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @strap.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.44788173",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "5a709be54da030e531e9297b7bde699d",
"score": "0.44754028",
"text": "def check_update_feed\n puts \"\\r\\n\\r\\nUpdate Feed:\"\n uri = URI.parse(\"http://0.0.0.0:8080/feed.json\")\n Net::HTTP.start(uri.host, uri.port) do |http|\n headers = {'Content-Type' => 'application/x-www-form-urlencoded'}\n put_data = \"key=1&uid=1&title=SomethingDifferent\"\n res = http.send_request('PUT', uri.request_uri, put_data, headers) \n puts res.body\n end\nend",
"title": ""
},
{
"docid": "a6eaddde60ad0ad290c11346400ad414",
"score": "0.44690397",
"text": "def put\n request = Net::HTTP::Put.new(endpoint_uri.request_uri)\n request.basic_auth Unfuzzle.username, Unfuzzle.password\n request.content_type = 'application/xml'\n \n Response.new(client.request(request, @payload))\n end",
"title": ""
}
] |
8ebfe7e208fa14203eded373c276be97
|
If user is logged in, returns them as json object else returns null TODO: (performance) don't need to return full user object
|
[
{
"docid": "fb7aa68ab2bf6ade5de74d2cb8949dd2",
"score": "0.7386238",
"text": "def get_cur_user\n @user = nil\n if is_logged_in session\n @user = User.find_by_sunet(session[:user_hash][\"username\"])\n end\n render json: @user\n end",
"title": ""
}
] |
[
{
"docid": "a0103122c5e780e06e24c462b16e5a37",
"score": "0.75193197",
"text": "def logged_in\n #checks to see if a current user is available \n \n if @current_user\n render json: {\n logged_in: true,\n user: @current_user\n }\n else \n render json: {\n logged_in: false\n }\n end \n\n end",
"title": ""
},
{
"docid": "abbbc44b9642c45f691eb707448ff813",
"score": "0.73531914",
"text": "def check_for_user\n if current_user\n @user = current_user\n else\n @user = {}\n end\n render json: @user\n end",
"title": ""
},
{
"docid": "d8ae0aed7b00703910cab2366ee6e70e",
"score": "0.7243217",
"text": "def user\n hash = {\n provider: 'josh_id',\n id: current_user.id.to_s,\n info: {\n email: current_user.email,\n username: current_user.username,\n #first_name: current_user.first_name,\n }\n }\n\n render json: hash.to_json\n end",
"title": ""
},
{
"docid": "f1085dac2929d7556131d8d76b2316b3",
"score": "0.7226272",
"text": "def logged_in\n if @current_user\n #this does not return a http status because this is a get request not a post. \n render json:{\n logged_in: true, \n user: @current_user\n }\n else \n render json: {\n logged_in: false\n }\n end\n end",
"title": ""
},
{
"docid": "c8fc4819575ca4badea51ab32c023944",
"score": "0.7189483",
"text": "def user_hack\n user.as_json\n end",
"title": ""
},
{
"docid": "051bc1f64447b1ee34dfaf4c79960afb",
"score": "0.7155826",
"text": "def user_info\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n\n respond_to do |format|\n name = @current_user.name\n username = @current_user.username\n format.json {\n render json: {\n :name => name,\n :username => username,\n }.to_json, status: 200\n }\n end\n end",
"title": ""
},
{
"docid": "1b912f310b6a942fce03633b48e38299",
"score": "0.7095808",
"text": "def get_user\n if params[:email].nil?\n render json: current_user,\n except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ]\n }\n }\n else\n user = User.find_by email:(params[:email])\n unless user.nil?\n if current_user.has_admin_permission? AdminPermission::ALL\n render json: user,\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n }\n }\n elsif current_user.has_admin_permission? AdminPermission::ORCHESTRA_ADMIN\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n }\n }\n\n elsif current_user.has_admin_permission? \\\n AdminPermission::LIST_CORTEGE_APPLICATIONS || AdminPermission::APPROVE_CORTEGE_APPLICATIONS\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n }\n elsif current_user.has_admin_permission? AdminPermission::LIST_FUNKIS_APPLICATIONS\n render json: user, except: [\n :created_at,\n :updated_at,\n :admin_permissions\n ],\n include: {\n case_cortege: {},\n cortege: {},\n orchestra: {},\n orchestra_signup: {\n include: [\n :orchestra\n ]\n },\n funkis_application: {\n include: [\n funkis_shift_applications: {\n include: [\n funkis_shift: {\n include: [\n :funkis_category\n ],\n except: [\n :maximum_workers\n ]\n }\n ]\n }\n ],\n }\n }\n else\n render json: user, except: [\n :created_at,\n :updated_at,\n :permissions\n ]\n end\n else\n render :status => '404', :json => {:message => 'Användare kunde inte hittas'}\n end\n end\n end",
"title": ""
},
{
"docid": "129aa8112f692a289704a858c6c79c92",
"score": "0.70825005",
"text": "def json_show_signed_user\n\n @current_user = current_user\n respond_to do |format|\n #format.json { render json: @current_user.as_json(only:[:id,:username]), status: :ok}\n if @current_user.nil?\n format.json { render json: 'user not found' , status: :not_found }\n else\n format.json { render json: @current_user.as_json(only:[:id,:username]), status: :ok}\n end\n\n\n end\n end",
"title": ""
},
{
"docid": "caebd81c2e406a520a0e68c6a9765f6c",
"score": "0.70557064",
"text": "def me\n user = current_user\n render :json => user.to_json(:only => [:id, :name, :email, :avatar_url])\n end",
"title": ""
},
{
"docid": "0cc4597e6d6fde7afc58111afe15ed69",
"score": "0.70433116",
"text": "def show\n\tuser_completed = @user.as_json(:only => [:id, :username, :login, :email, :guild_id, :otp_secret, :otp_required_for_login])\n\t\t\t\t\t\t.merge(guild: @user.guild, achievments: @user.achievments)\n\tif self.user_owner?\n \trender json: user_completed, status: :ok\n\telse\n \trender json: user_completed.except(:email, :otp_required_for_login), status: :ok\n\tend\n end",
"title": ""
},
{
"docid": "5138ca168daf4c8c3ee0d5cb870d27d5",
"score": "0.7018541",
"text": "def user\n render json: current_user\n end",
"title": ""
},
{
"docid": "57352b8e5264981a4b5526611087b4df",
"score": "0.6986694",
"text": "def current_user_info\n\t\trespond_to do |format|\n\t\t\tif !current_user\n\t\t\t\tformat.json { render json: { 'User' => 'not logged in' } }\n\t\t\telse\n\t\t\t\tformat.json { render json: { 'Name' => current_user.name, 'Image' => getFacebookPicURL(current_user) } }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7a31b22a6689f803e137e0f689ccae0e",
"score": "0.6966792",
"text": "def getUser\n render json: @current_user, status: 200\n end",
"title": ""
},
{
"docid": "1f8bb71a81e9d3642300b0e1c9b99e45",
"score": "0.69597805",
"text": "def get_current_user\n respond_to do |format|\n format.json {\n\n if @current_user \n render :json => @current_user\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end",
"title": ""
},
{
"docid": "7c2589657318a4c4a9909b80b9e3fa3a",
"score": "0.6919595",
"text": "def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"title": ""
},
{
"docid": "7c2589657318a4c4a9909b80b9e3fa3a",
"score": "0.6919595",
"text": "def get_current_logged_in_user \n get(\"/users.json/current\")\nend",
"title": ""
},
{
"docid": "3330b4e3b1fe6f4eb137076c3e2e2b8b",
"score": "0.6900745",
"text": "def logged_in\n return bad_request unless request.format.json? or request.format.js?\n @response = {:logged_in => logged_in?}\n json_response\n end",
"title": ""
},
{
"docid": "9e4832a2a4b2a13a92bf6ddcf291beb6",
"score": "0.68041307",
"text": "def logged_in_user\n unless logged_in?\n render json: false, status: :unauthorized\n # store_location\n end\n end",
"title": ""
},
{
"docid": "a8bb78c9e57d64c8511d1855aca0c1e5",
"score": "0.6800998",
"text": "def auto_login\n render json: logged_in_user\n end",
"title": ""
},
{
"docid": "37a93206598899373aa2a4622c5f0825",
"score": "0.67803276",
"text": "def my_current_user\n render json: current_user\n end",
"title": ""
},
{
"docid": "fb9f3e6c865efa6b738d78c3c7c1b060",
"score": "0.6724934",
"text": "def user\n {\n id: object.user.id,\n email: object.user.email,\n birthday: object.user.birthday,\n first_name: object.user.first_name,\n middle_name: object.user.middle_name,\n last_name: object.user.last_name,\n phone: object.user.phone,\n gender: object.user.gender,\n neighborships: object.user.neighborships\n }\n end",
"title": ""
},
{
"docid": "895b7d99cfae1592aa5b2595af713892",
"score": "0.6709344",
"text": "def logged_in\n\n puts @current_user.inspect\n\n \n\n if @current_user && @current_user.email_confirmed\n\n \n \n render json: {\n \n logged_in: true,\n user: @current_user\n }\n else\n render json: {\n logged_in: false\n }\n end\n end",
"title": ""
},
{
"docid": "8f246e79a20bbb929201963e5ae080db",
"score": "0.66982126",
"text": "def user\n {id: object.user.id, username: object.user.username, avatar: object.user.avatar}\n end",
"title": ""
},
{
"docid": "12f69e4963ce43a400ff72996ef7d0b2",
"score": "0.6647838",
"text": "def show\n if create_user\n logger.debug @user.inspect\n render json: @user\n else\n render json: { error: 'User is not logged in!' }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0561ad2908807b0a1964809ef7fb271d",
"score": "0.6639372",
"text": "def user_information\n { \"username\": @user.username, \"email\": @user.email, \"id\": @user.id }\n end",
"title": ""
},
{
"docid": "201d3e7f399e8a793f46c18d22b04293",
"score": "0.6634609",
"text": "def me\n render json: current_user\n end",
"title": ""
},
{
"docid": "c9b85f0478ccc544f3bd8f083ef3180b",
"score": "0.6625951",
"text": "def get_user_info\n id = params[\"id\"]\n error_list = []\n status = 1\n json_response = {}\n user = User.find_by(id: id)\n\n if user.nil?\n error_list.append(\"Error: The specified user doesn't exist.\")\n status = -1\n else\n json_response[\"user\"] = user.get_user_json_data\n end\n\n if status == -1\n json_response[\"errors\"] = error_list\n end\n\n json_response[\"status\"] = status\n\n # Format the json_response into proper JSON and respond with it\n json_response = json_response.to_json\n\n respond_to do |format|\n format.json { render json: json_response }\n end\n end",
"title": ""
},
{
"docid": "d1a7392866b1e2dab3840361eb35dcac",
"score": "0.6621684",
"text": "def auth\n\n @user = current_user\n render json: @user\n \n end",
"title": ""
},
{
"docid": "643d0d4f9852240a772f6faadc28049d",
"score": "0.6621352",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n if @current_user and @current_user == @user\n format.json { render json: @user }\n else\n format.json { render :json => @user, :except => [:perishable_token, :persistence_token, :email, :single_access_token, :last_login_ip, :current_login_ip, :crypted_password, :password_salt] }\n end\n end\n end",
"title": ""
},
{
"docid": "43d84bd195f44ff4c36dfbe99db1609d",
"score": "0.66158724",
"text": "def show \n render json: @current_user\n end",
"title": ""
},
{
"docid": "dc26bae827586f16cdff20a71dbc21c5",
"score": "0.66100746",
"text": "def show_current_user\n render json: current_user\n end",
"title": ""
},
{
"docid": "1d3ebb01046bc488701a506904ee2c97",
"score": "0.6609637",
"text": "def auto_login\n render json: @user\n end",
"title": ""
},
{
"docid": "3e2f2f46854bf918c226f719a9acbe0a",
"score": "0.65978485",
"text": "def user_check\n if user_signed_in?\n render status: :ok, json: current_user\n else\n render status: :forbidden, nothing: true\n end\n end",
"title": ""
},
{
"docid": "69a5e53fe5c2ce73a4a7a49060869d3e",
"score": "0.65875167",
"text": "def login \n render json: User.first\n end",
"title": ""
},
{
"docid": "4a344ea8f3270471539dbeefb272c355",
"score": "0.65776974",
"text": "def is_logged_in?\n if logged_in? && current_user\n render json: {\n logged_in: true,\n user: current_user\n }\n else\n render json: {\n logged_in: false,\n message: 'no such user'\n }\n end\n end",
"title": ""
},
{
"docid": "68369951b3f7caabf7c51526068676e0",
"score": "0.6568451",
"text": "def logged_in_user\n unless logged_in?\n render json: { error: 'Log in to access this page'}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "7f132fd4985e6199b7909f28ab132290",
"score": "0.6537531",
"text": "def user_info\n @user = @github.users.get user: params[:username]\n render json: Hash[@user]\n end",
"title": ""
},
{
"docid": "e816cfe0edccc7fbd0c1526dc5b53540",
"score": "0.6526157",
"text": "def user1\n if user = User.where(\"lower(users.login) = ?\", params[:login].downcase).first\n result = {\n :id => user.id,\n :username => user.login,\n :name => user.name,\n :avatar_url => user.avatar_url,\n :location => user.location\n }\n render json: result\n else\n head :not_found\n end\n end",
"title": ""
},
{
"docid": "6621f7406247e5903870e9709f34ec6d",
"score": "0.6510793",
"text": "def user\n @user = current_user\n\n respond_to do |format|\n format.json { render :json => {:user => @user.as_json(:json => 'wall') }}\n end\n end",
"title": ""
},
{
"docid": "d08b1d267b31b96ecf11a252053d925d",
"score": "0.6499823",
"text": "def show\n render json: @currentUser\n end",
"title": ""
},
{
"docid": "d7339d8c0b86189599b0b38017e3fd94",
"score": "0.64997464",
"text": "def show \n user=current_user\n user={name: user.name,email: user.email ,phone: user.phone,avatar: user.avatar}\n json_response(user)\n end",
"title": ""
},
{
"docid": "1a164da23a60058589a3a4a7ecd577e0",
"score": "0.6499126",
"text": "def auto_login\n render json: @user\n end",
"title": ""
},
{
"docid": "f26e97f17e4688fa5700b482c80573bf",
"score": "0.64867187",
"text": "def user\n {user_id: self.object.user.id,\n user_name: self.object.user.name\n }\n end",
"title": ""
},
{
"docid": "39d59c8ca643d3f65e8a21cff04312fc",
"score": "0.6483053",
"text": "def auto_login\n render json: @user\n end",
"title": ""
},
{
"docid": "39d59c8ca643d3f65e8a21cff04312fc",
"score": "0.6483053",
"text": "def auto_login\n render json: @user\n end",
"title": ""
},
{
"docid": "a026a15ba220baeede771a13bd15236c",
"score": "0.6478039",
"text": "def check_sign\n user = @current_user\n render :json => { login:true , admin: user.admin, user: {login:user.login, type:user.user_type, id: user.id}}\n end",
"title": ""
},
{
"docid": "bed32767ee454421f0ad2a9ced580622",
"score": "0.6477637",
"text": "def show\n json_response(current_user.decorate, :ok)\n end",
"title": ""
},
{
"docid": "24eba556aa31bf43c06fc2dcdafbb76c",
"score": "0.6476857",
"text": "def user_data\n {\n user_id: @user.id,\n email: @user.email\n }\n end",
"title": ""
},
{
"docid": "8b8b21e007ac535baa211b8d8f2fe9ca",
"score": "0.6464495",
"text": "def show\n # Will only reach this method if current_user is defined\n render json: { user: @current_user }\n end",
"title": ""
},
{
"docid": "2b23aa598930de02f93a9be28057ba1a",
"score": "0.64621174",
"text": "def logged_in_user\n return nil if !logged_in?\n return session[\"app_user\"]\n end",
"title": ""
},
{
"docid": "331390a58f12fc379954854fa0d7d6fc",
"score": "0.6454032",
"text": "def logged_in_user\n if (!logged_in?)\n return User.logged_out_user\n end\n #return nil if !logged_in?\n return session[\"app_user\"]\n end",
"title": ""
},
{
"docid": "f2d1fac53f78144d6c308734ebb98423",
"score": "0.6443828",
"text": "def get_user_info()\n return_map = nil\n if session[:google_unique] != nil && user_credentials.access_token != nil\n return_map = {}\n return_map['email'] = session[:googleemail]\n return_map['sub'] = session[:google_unique]\n return_map['useralias'] = session[:useralias]\n end\n return return_map\nend",
"title": ""
},
{
"docid": "19b5e93f30df39b387fbc0326854f80e",
"score": "0.64421767",
"text": "def current\n if current_user\n current_user.update!(last_login: Time.zone.now)\n render json: current_user\n else\n not_auth\n end\n end",
"title": ""
},
{
"docid": "cd5e2bff516c70c9342edeb8eeeed67f",
"score": "0.64392173",
"text": "def profile\n render json: @current_user\n end",
"title": ""
},
{
"docid": "0c10421a954f1477946a34f080190cce",
"score": "0.6436008",
"text": "def show \n user = User.find_by(id: session[:user_id])\n if user\n render json: user\n else \n render {error: \"Not authorized\"}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "2fa641be4adba977eb77a260270fd4c3",
"score": "0.6428827",
"text": "def get_session\n if session[:user_id].present? && session[:user_name].present?\n @result = {flag:true , session_id: session[:user_id] , :user_name=> session[:user_name]}\n render :json=>@result\n else \n @result = {flag:false}\n render :json=>@result\n end\n end",
"title": ""
},
{
"docid": "fa0451a3b90da7bad9919dfd40f50a89",
"score": "0.6423876",
"text": "def logged_in\n return bad_request unless request.format.json? or request.format.js?\n @response = { logged_in: logged_in? }\n render_cross_origin_json\n end",
"title": ""
},
{
"docid": "6fb3c3d3719d4100c7fb02da7e2d8438",
"score": "0.64185673",
"text": "def user_data\n User.user_data login\n end",
"title": ""
},
{
"docid": "014157e0815bda662ce9a7de8421e1eb",
"score": "0.64178574",
"text": "def index\n @users = User.all\n\n @user = User.find_by_id(session[:user_id])\n @logged_in = true if @user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users }\n end\n end",
"title": ""
},
{
"docid": "cf40f99fd84beaac1549c843926400c7",
"score": "0.63976437",
"text": "def current\n render json: current_user\n end",
"title": ""
},
{
"docid": "f7e4e37aecba3f2e556f5c95bb507adc",
"score": "0.63817453",
"text": "def get_profile_info\n res = {}\n res[:user] = User.select(:login, :city_id, :email, :admin).where(id: session[:user_id]).take\n res[:character] = Character.select(:id, :title).where(id: @current_user.character_id).take\n render json: res\n end",
"title": ""
},
{
"docid": "c0636ad024d6cbe86d948b7f805f9114",
"score": "0.63798106",
"text": "def hubssolib_get_user_data\n user = self.hubssolib_current_session ? self.hubssolib_current_session.session_user : nil\n\n if (user && user.user_id)\n return user\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "bdbf3f92d56293569a586361e6ae8157",
"score": "0.63784677",
"text": "def show\n # byebug\n user = User.find_by(id: session[:user_id])\n render json: user\n end",
"title": ""
},
{
"docid": "bb01821e9acb9ea13270c98b5608f033",
"score": "0.6377348",
"text": "def show\n {\n id: @current_user.id,\n email: @current_user.email,\n access_token: @current_user.access_token\n }\n end",
"title": ""
},
{
"docid": "4503a796ee245a9b195acc25f99d254d",
"score": "0.63768077",
"text": "def user_hash\n response_hash.key?(:user) ? response_hash[:user] : {}\n end",
"title": ""
},
{
"docid": "9a14a163e249e986825d4ef39cc27711",
"score": "0.63760227",
"text": "def show\n {\n id: @current_user.id,\n first_name: @current_user.first_name,\n last_name: @current_user.last_name,\n email: @current_user.email,\n role_name: @current_user.super_admin ? 'Super Admin' : @current_user.role.try(:name),\n permissions: Permissions::Builder.user_permissions(@current_user)\n }\n end",
"title": ""
},
{
"docid": "76fbb28f119a259fd2407c858bd512ea",
"score": "0.63748777",
"text": "def show\n if current_api_user.id == @user.id\n render json: @user.as_json(except: [:updated_at])\n else\n render json: @user.as_json(except: [:google_id, :updated_at])\n end\n end",
"title": ""
},
{
"docid": "6a5ecf22640c9b5672f3a674f49ac93f",
"score": "0.63728964",
"text": "def userinfo\n object.fetch(:userinfo) {\n @object[:userinfo] = (format_userinfo(\"\") if @object[:user])\n }\n end",
"title": ""
},
{
"docid": "ea8ccf6b93724d0e75101c46ea744ca5",
"score": "0.636472",
"text": "def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info\n end",
"title": ""
},
{
"docid": "ea8ccf6b93724d0e75101c46ea744ca5",
"score": "0.636472",
"text": "def user_info\n @user_info ||= raw_info.nil? ? {} : raw_info\n end",
"title": ""
},
{
"docid": "ea17277afb8a375099746a879a7293f1",
"score": "0.6362114",
"text": "def get_user_data\n user_data = nil\n \n if cookies.has_key?(:user_data) && cookies[:user_data].to_s != ''\n user_data = string_to_hash(cookies[:user_data])\n end\n user_data\n end",
"title": ""
},
{
"docid": "73104318f3230fad7dcfe011e0a2f472",
"score": "0.63619995",
"text": "def to_json\n attrs = attributes\n if attrs['user'] && attrs['user']['id'] == '$current'\n attrs.delete 'user'\n end\n attrs.to_json\n end",
"title": ""
},
{
"docid": "d63fddf37768a99c352ccf7c98b9c1dd",
"score": "0.6352443",
"text": "def user_data\n {:username => self.username,\n :pic_url => self.user_pic,\n :profile_url => self.profile_url\n }\n end",
"title": ""
},
{
"docid": "5a9ce249474af6c0186738244047ea0c",
"score": "0.6350654",
"text": "def getUserInfo\n login_user_id = params[:my_id].to_i\n login_user = User.find(login_user_id)\n\n target_user_id = params[:target_id].to_i\n target_user = User.find(target_user_id)\n\n # target_userをフォローしているか\n login_user_follow = login_user.follows_of_from_user.pluck(:id).include?(target_user_id)\n\n # target_userの記事一覧を取得\n articles_hash = make_articles_hash(target_user.articles, target_user)\n\n if articles_hash.blank?\n res = {\n result: false,\n data: nil\n }\n else\n res = {\n result: true,\n data: {\n user_id: target_user_id,\n name: target_user.name,\n follow: login_user_follow,\n profile_image: target_user.profile_image_path,\n articles: articles_hash\n }\n }\n end\n\n render json: res\n end",
"title": ""
},
{
"docid": "e38bb30d82d97e5b9823bd288fd34e16",
"score": "0.63477135",
"text": "def user_show_data\n user = User.find(params[:user])\n\n @data = {\n name: user.full_name,\n email: user.email,\n title: user.title,\n school_name: user.organization.name,\n logo_link: user.organization.logo_link,\n points: user.points,\n reviews: reviews_from_user(user),\n protips: protips_from_user(user),\n receives_weekly_digest: user.receives_weekly_digest,\n active: user.active\n }\n\n render json: @data\n end",
"title": ""
},
{
"docid": "4f2b8b8b1db0a1e2784568df53c86415",
"score": "0.63477117",
"text": "def sign_in_json\n {\n id: pretty_id,\n email: email,\n firstname: firstname,\n lastname: lastname,\n }\n end",
"title": ""
},
{
"docid": "abbb4d015fea32e097564863446eb662",
"score": "0.63474816",
"text": "def no_call_current_user\n token = get_token\n decoded_token = decode_token(token)\n user = User.find(decoded_token['user_id'])\n {\n name: user[:name],\n email: user[:email],\n user_id: user[:id]\n }\n end",
"title": ""
},
{
"docid": "5e84c12a9bec0ce07273cffcec578e2a",
"score": "0.63463223",
"text": "def current_user\n if session[:user_id] == nil\n return {}\n end\n\n # ruby - implicit return\n return run_sql(\"SELECT * FROM users WHERE id = #{session[:user_id]};\")[0]\nend",
"title": ""
},
{
"docid": "57453ebdaf59bc5041425f79f579d7af",
"score": "0.63405335",
"text": "def getLoggedInUser\n if session[:user_id]\n return User.find(session[:user_id])\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "bdfe3c21691618b5a216929cd37694ad",
"score": "0.6323515",
"text": "def current_user\n unless request.format.json?\n @current_user ||= User.find_by_auth_token(cookies[:auth_token]) if cookies[:auth_token]\n end\n @current_user\n end",
"title": ""
},
{
"docid": "37350c28072347bd30b1661b65400856",
"score": "0.6322557",
"text": "def json_show_user_profile_by_user_id\n @user = User.find(params[:user_id])\n\n respond_to do |format|\n format.json { render json: @user.as_json(only:[:email,:username]) }\n end\n end",
"title": ""
},
{
"docid": "ab3a493ff809322b7873fd7e4d5780bd",
"score": "0.6314661",
"text": "def show\n render json: UserSerializer.render(\n object: current_user,\n include_root: true\n )\n end",
"title": ""
},
{
"docid": "262a54de59ffe619fe616287ce86264e",
"score": "0.63139963",
"text": "def get_logged_in_user\n if @logged_in\n if Student.exists?(session[:id])\n @logged_in_user = Student.find(session[:id])\n elsif Marker.exists?(session[:id])\n @logged_in_user = Marker.find(session[:id])\n end\n end\n end",
"title": ""
},
{
"docid": "9a2b2d99528d58e0fa74a89a0461d5b3",
"score": "0.630996",
"text": "def my_profile\n render json: { user: current_user}\n end",
"title": ""
},
{
"docid": "680ec326137d800b4b10b68f70a349bd",
"score": "0.6306539",
"text": "def current\n # mynamejeff = current_user.as_json(:methods => [user_requests])\n user_requests = current_user.pto_requests\n .where(is_deleted: nil)\n .or(current_user.pto_requests.where(is_deleted: 0))\n .to_a\n render json: {\n id: current_user.id,\n email: current_user.email,\n name: current_user.name,\n ten_hour_shift: current_user.ten_hour_shift,\n position: current_user.position,\n team: current_user.team,\n start_time: current_user.start_time,\n end_time: current_user.end_time,\n work_days: current_user.work_days,\n on_pip: current_user.on_pip,\n pto_requests: user_requests\n }\n end",
"title": ""
},
{
"docid": "89fde093755c75f9c5b08c01aab02c12",
"score": "0.6294631",
"text": "def sign_in_user\n \tresult = {success: false, status_code: 403, message:\"Unprocessable Entity\"}\n\n \tunless params[:email].blank? && params[:password].blank?\n \t\tuser = User.find_for_authentication(email: params[:email])\n\n \t\tif user && user.active == true\n \t\t\tif user.valid_password?(params[:password])\n \t\t\t\tresult = {\n success: true,\n status_code: 200,\n user_name: user.name_with_surname,\n user_email: user.email,\n token: user.token_pass,\n code: user.rol.code\n }\n \t\t\tend\n else\n result[:status_code] = 401\n result[:message] = 'Unauthorized, The user is inactive.'\n \t\tend\n \tend\n\n \trender json: result.to_json(except:[:created_at, :updated_at, :active])\n end",
"title": ""
},
{
"docid": "d5bb9132f6682eadc3788a6f4dd7ff72",
"score": "0.62929887",
"text": "def show\n render json: current_user, except: [:id]\n end",
"title": ""
},
{
"docid": "90864095684225bada227648498e2bdf",
"score": "0.62850785",
"text": "def show\n user = User.find_by(id: session[:user_id])\n if user\n render json: user, status: :ok\n else\n render json: {errors: \"Not authorized\"}, status: :unauthorized\n end\n end",
"title": ""
},
{
"docid": "3e7ea189af259c73e5d79ea4326b1c30",
"score": "0.6273686",
"text": "def current_user_signed_in\n respond_to do |format|\n format.js { render :json => current_user }\n end\n end",
"title": ""
},
{
"docid": "ad81e93bc8c92b66e89267bc74bf8034",
"score": "0.62600994",
"text": "def to_json(arg = nil)\n self.as_json(include: [:authentications]).to_json\n end",
"title": ""
},
{
"docid": "61459f63c0d7383fd85ddbd5e0a158ab",
"score": "0.6247427",
"text": "def show\n @user = User.find(params[:id])\n @authorized_user = User.find(session[:user_id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "ea463ed97b702e644f15c87602de0c9d",
"score": "0.6238674",
"text": "def logged_in?\n \trespond_to do |format|\n\t format.html { session[:currentUser].present? } \n\t format.json {\n\n begin\n if (not params[:token].nil?)\n @token = Token.where(:Value => params[:token]).first\n else\n @theparameters = JSON.parse(request.raw_post)\n @token = Token.where(:Value => @theparameters.fetch(\"token\")).first\n end\n @userr = @token.user\n\n if is_admin(@userr)\n return true\n \n elsif not @userr.events.select{ |ev| not ev.Completed and ev.EventDate.to_date + 2 >= Date.today}.empty?\n return true\n else\n raise Exception, \"There are no events currently active for this user.\"\n end\n rescue Exception => e\n raise Exception, \"can't find the user\"\n end\n }\n\t end\n end",
"title": ""
},
{
"docid": "ce4c2cc7c074da01f89d0847e92e5d1e",
"score": "0.62379515",
"text": "def prefill_if_logged_in(data)\n return if Person.current.anonymous?\n data.name ||= Person.current.name\n data.email ||= Person.current.email\n end",
"title": ""
},
{
"docid": "15826619acbd0e086c8454c61e8854c4",
"score": "0.6237726",
"text": "def showUser\n render :json =>{message: @current_user}\n end",
"title": ""
},
{
"docid": "d661f7f2c8875ba73da21beab152ea41",
"score": "0.62268364",
"text": "def show\n json_response(@user)\n end",
"title": ""
},
{
"docid": "76294131386e56bfc7a124efb6ed9ccd",
"score": "0.62186855",
"text": "def user_from_session\n user = user_from_claims\n return user unless session[:auth0_json]\n raw = JSON.parse(session[:auth0_json] || '{}').with_indifferent_access.fetch(:extra, {}).fetch(:raw_info, {})\n user.email = raw.fetch(:email, user.email)\n user.picture = raw.fetch(:picture, user.picture)\n user.user_metadata = raw.fetch(:user_metadata, user.user_metadata)\n user\n end",
"title": ""
},
{
"docid": "8bb0d4dcc3fd2a5931eba88d37d255e4",
"score": "0.62106586",
"text": "def me\n render status: 200, json: current_user.db_user.as_json(only: [:id, :email], include: { discord_identity: { }, roles: { include: { nested_roles: { include: { role_nested: { } } } } } }, methods: [:main_character])\n end",
"title": ""
},
{
"docid": "25e61da40907af570052cb6d7e44ffa4",
"score": "0.6203236",
"text": "def get_logged_in_user\n if logged_in?\n user = User.find(session[:current_user_id])\n if user\n return user\n else\n return nil\n end\n end\n \n #default return nil\n nil\n end",
"title": ""
},
{
"docid": "adc5abbe85be07f29203a6e5addb095a",
"score": "0.619146",
"text": "def user_from_json\n json = JSON.parse request.body\n\n username = json['authentication']['email']\n password = json['authentication']['password']\n\n if user = User.authenticate(email, password)\n user\n else\n nil\n end\n end",
"title": ""
}
] |
7c8143a25ed065b39e708fa98c853274
|
Add a note Adds a new note
|
[
{
"docid": "10314c8739ebb4b180eaa4a6730a8b04",
"score": "0.0",
"text": "def notes_post(content, opts = {})\n notes_post_with_http_info(content, opts)\n end",
"title": ""
}
] |
[
{
"docid": "0c2305a0f781540ff064d469b7658e99",
"score": "0.8902171",
"text": "def addNote(note)\n @note = note\n end",
"title": ""
},
{
"docid": "5ad358b10197aef260f2aeaa3128651e",
"score": "0.86830425",
"text": "def add_note(note)\n notes << note\n end",
"title": ""
},
{
"docid": "9d0c330222b8fd1c6a374af2be0183ea",
"score": "0.8451824",
"text": "def add_note(note)\n @notes.push(note)\n end",
"title": ""
},
{
"docid": "9d0c330222b8fd1c6a374af2be0183ea",
"score": "0.8451824",
"text": "def add_note(note)\n @notes.push(note)\n end",
"title": ""
},
{
"docid": "9d0c330222b8fd1c6a374af2be0183ea",
"score": "0.8451824",
"text": "def add_note(note)\n @notes.push(note)\n end",
"title": ""
},
{
"docid": "3a1aceb399ab60f281675da5513dd73a",
"score": "0.8317413",
"text": "def add_note(note)\n response = self.class.put(url(self.id), :query => {:notes => note}, :body => \"\") # nginx reject requests without body\n raise response.response.to_s unless response.code == 200\n\n puts green(\"Note added to Issue ##{self.id}: #{note}\")\n end",
"title": ""
},
{
"docid": "b46cff6dac5a818b468cdfd00d72e043",
"score": "0.8019732",
"text": "def add_note(note)\n conn = Connection.new\n path = \"/projects/#{@project_id}/stories/#{@id}/notes\"\n\n note_xml = Nokogiri::XML::Builder.new { |xml|\n xml.note {\n xml.text_ note\n }\n }.to_xml\n\n conn.class.post(\n path,\n :headers => {\n \"Content-type\" => \"application/xml\",\n \"X-TrackerToken\" => conn.config.pivotal.token\n },\n :body => note_xml\n )\n end",
"title": ""
},
{
"docid": "7ff4f81571eda84727eaa21806cfa945",
"score": "0.80029947",
"text": "def add_note(note)\n @card << Vpim::DirectoryInfo::Field.create( 'NOTE', Vpim.encode_text(note) );\n end",
"title": ""
},
{
"docid": "51d52cb851621f07b4a62061603966d8",
"score": "0.7826789",
"text": "def create_note",
"title": ""
},
{
"docid": "fc261d5b2a9cc8eaecd1d7ce24cb15dc",
"score": "0.7798556",
"text": "def add_note(note)\n @card << ::Vcard::DirectoryInfo::Field.create( \"NOTE\", ::Vcard.encode_text(note) );\n end",
"title": ""
},
{
"docid": "fc261d5b2a9cc8eaecd1d7ce24cb15dc",
"score": "0.7798556",
"text": "def add_note(note)\n @card << ::Vcard::DirectoryInfo::Field.create( \"NOTE\", ::Vcard.encode_text(note) );\n end",
"title": ""
},
{
"docid": "fc261d5b2a9cc8eaecd1d7ce24cb15dc",
"score": "0.7798556",
"text": "def add_note(note)\n @card << ::Vcard::DirectoryInfo::Field.create( \"NOTE\", ::Vcard.encode_text(note) );\n end",
"title": ""
},
{
"docid": "fc261d5b2a9cc8eaecd1d7ce24cb15dc",
"score": "0.7798556",
"text": "def add_note(note)\n @card << ::Vcard::DirectoryInfo::Field.create( \"NOTE\", ::Vcard.encode_text(note) );\n end",
"title": ""
},
{
"docid": "d65cf46fe13765a1cf0f29d61e0505bb",
"score": "0.77570933",
"text": "def add_note note, note_idx=nil\n if note_idx.nil?\n @notes << note\n else\n @notes[note_idx] = (@notes[note_idx].nil? ? '' :\n (@notes[note_idx]+' || ')) + note\n end\n end",
"title": ""
},
{
"docid": "3af11c515303f099344c55d933cd1fd5",
"score": "0.7753508",
"text": "def create_note(note)\n post(\"/notes\", :query => note)\n end",
"title": ""
},
{
"docid": "6e5a85b8427f08e6975780af0847e300",
"score": "0.7744311",
"text": "def add_note_to_task(task_id, note)\n log(Logger::DEBUG) do\n \"add_note_to_task: task_id: #{task_id}, note: [#{note}]\"\n end\n @clnt.post('/task/addNoteToTask.do',\n data: { workOrderId: task_id, note: note })\n end",
"title": ""
},
{
"docid": "abc7c33b49b2e995f6faca3f9d76885b",
"score": "0.77422583",
"text": "def add_note(note, x, y)\n end",
"title": ""
},
{
"docid": "051bb6acee443380076eb78bd706b31c",
"score": "0.77307695",
"text": "def add_note note, note_idx=nil\n if note_idx.nil?\n\t @notes << note\n else\n\t @notes[note_idx] = (@notes[note_idx].nil? ? '' : (@notes[note_idx]+' || ')) + note\n end\n end",
"title": ""
},
{
"docid": "773ea17c0468e7f720d501ea2883d214",
"score": "0.7577164",
"text": "def add_note(sender, message)\n raise OrderBotException.new(\"Improper format: 'note [item]' (rageguy)\") if message.nil? || message.length < 2\n\n note = message[1..-1].join(\" \")\n add_to_hash(sender, note, store['notes_hash'])\n\n reply \"Adding note #{note} from #{sender}\"\n end",
"title": ""
},
{
"docid": "e766dc6baebe0c131a3b66c8a51d1386",
"score": "0.75664324",
"text": "def note(note)\n\t\t@note = note\n\tend",
"title": ""
},
{
"docid": "d523f5ef5aa20403b2bf9198ab92fe54",
"score": "0.7561515",
"text": "def create_note(title,contents)\n Resource.client.create_note(self, title, contents)\n end",
"title": ""
},
{
"docid": "91290b2d0d709ac5c7e56dfbc237f5f6",
"score": "0.75607425",
"text": "def create_note(title,contents)\n Dropio::Client.instance.create_note(self, title, contents)\n end",
"title": ""
},
{
"docid": "6151ebd7015251015d25398009035f83",
"score": "0.7549903",
"text": "def create_note(input)\n self.note = input\n end",
"title": ""
},
{
"docid": "f70f7bd2d6dd8d071e8b5c40df4c27ac",
"score": "0.75398105",
"text": "def add_note(contents, options={})\n note = Blocks::Note.new(contents.first, contents[1..-1].join(\"\\n\"))\n post_block(note)\n end",
"title": ""
},
{
"docid": "b6b19257d14e1ebea34d19d1284b8592",
"score": "0.7538829",
"text": "def add_note(id, options = {})\n options = {\n type: :spec\n }.update(options)\n # Create the Note instance and add to the notes attribute\n @notes[id] = Origen::Specs::Note.new(id, options[:type], options)\n end",
"title": ""
},
{
"docid": "036afaa61ccda71ebd0b62a150c82899",
"score": "0.7489274",
"text": "def new_notes=(note)\n if !note.blank? then\n time = Time.now.strftime(\"%m-%d-%y %I:%M %p\")\n new_note = \"<p>#{note}<br/>\"\n new_note << \"<span class=\\\"info\\\">\"\n new_note << \"[#{time}]\"\n new_note << \"</span></p>\"\n if self.notes.blank? then\n self.notes = new_note\n else\n self.notes << new_note\n end\n end\n end",
"title": ""
},
{
"docid": "97cba517e5a6c608259a0a679fe53fa4",
"score": "0.73902756",
"text": "def add_note\n note = Note.new(:type_id => params[:id],:content => params[:note][:content])\n note.owner = :property\n if note.save\n flash[:notice] = \"Note succesfully added\"\n else\n flash[:notice] = \"Note save failed\"\n end \n redirect_to :action => 'detail', :id => params[:id]\n end",
"title": ""
},
{
"docid": "5335ca022953dd8e07ffba1a5497082a",
"score": "0.737329",
"text": "def create_note\n\n end",
"title": ""
},
{
"docid": "3b3eb63419efc18eb7ea977cf236464b",
"score": "0.73605484",
"text": "def create\n\t\t@note = @book.notes.new(note_params)\n\t\tif @note.save\n\t\t\tredirect_to @book, notice: \"Note succesfully added!\"\n\t\telse\n\t\t\tredirect_to @book, alert: \"Unable ro add note!\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a2f8c31693687d297176ea0a8cf1f442",
"score": "0.7356041",
"text": "def create_note(contents, title = nil, description = nil)\n Dropio::Resource.client.create_note(self, contents, title, description)\n end",
"title": ""
},
{
"docid": "396cb5587c630340b4fa85cd85d6f9ef",
"score": "0.73398745",
"text": "def add_journal_note(journal_note)\n message = \"\\n============================\\n\" + \\\n \"Comment added #{journal_note.mod_s} by #{journal_note['CreatedBy']}: \" + \\\n journal_note['Details'].to_s + \"\\n\\n\"\n self['CompletionDetails'] = self['CompletionDetails'] + message\n end",
"title": ""
},
{
"docid": "1b24a52a7a9198235852c44ca432cb24",
"score": "0.72962624",
"text": "def add_notes(*notes)\n notes.each { |note| add_note(note) }\n end",
"title": ""
},
{
"docid": "6b8a05a9e12bb69901e5d64475d5eac0",
"score": "0.7293725",
"text": "def create_note(**args)\n params = parameters(args) do\n required_params :content\n optional_params :content, :deal_id, :person_id, :org_id, :add_time, :pinned_to_deal_flag, :pinned_to_organization_flag, :pinned_to_person_flag\n end\n request(:post, 'notes', params)\n end",
"title": ""
},
{
"docid": "c6bd2f00bdd6fe1a06e2452ac8318ae2",
"score": "0.72854227",
"text": "def new_note\n if params.has_key? 'note_id' then\n @replay = true\n Note.find(params['note_id'])\n else\n Note.new({\n :body=>\"Click to enter a new note...\",\n :view=>action_name,\n # timestamp will be rendered by ActiveSupport::TimeWithZone.to_param\n :view_at=> @at,\n :user_id=>session[:user_id]\n })\n end\n end",
"title": ""
},
{
"docid": "09462260c6f085e95a98685c94b16198",
"score": "0.72191155",
"text": "def add_note(type, summary, *expect_by)\n case type\n when :action\n @actions << Action.new(summary, expect_by)\n end\n @notes << Note.new(summary, @actions, @topic)\n end",
"title": ""
},
{
"docid": "33f47cf94561e84809a218ea2d2816d1",
"score": "0.72094244",
"text": "def note(note)\r\n # no-op currently\r\n end",
"title": ""
},
{
"docid": "2bfd497cf47745c4ebda8505b59a2f7f",
"score": "0.72007567",
"text": "def note=(note)\n @note = note\n end",
"title": ""
},
{
"docid": "e122fac2d67f45064f51b27f29ae1a16",
"score": "0.7199598",
"text": "def add_note(message, x, y, w, h)\n @flickr.send_request('flickr.photos.notes.add', {:photo_id => self.id, :note_x => x, :note_y => y, :note_w => w, :note_h => h, :note_text => message}, :post)\n true\n end",
"title": ""
},
{
"docid": "e122fac2d67f45064f51b27f29ae1a16",
"score": "0.7199598",
"text": "def add_note(message, x, y, w, h)\n @flickr.send_request('flickr.photos.notes.add', {:photo_id => self.id, :note_x => x, :note_y => y, :note_w => w, :note_h => h, :note_text => message}, :post)\n true\n end",
"title": ""
},
{
"docid": "ebc1e475dcc0baeb1ac4e4cafaaf6561",
"score": "0.71559185",
"text": "def note(entry)\n end",
"title": ""
},
{
"docid": "46546f7d3e5019dd0c6fd5d4d109aeb7",
"score": "0.7154036",
"text": "def add_note(note, back = false)\n temp_note = Cache.picture(CP::OCARINA::SETTINGS::NOTE_GFX)\n nwi = temp_note.width\n nhe = temp_note.height\n if CP::OCARINA::SETTINGS::NOTE_SHEET\n rect = Rect.new(nwi / 8 * (note - 1), 0, nwi / 8, nhe)\n else\n rect = Rect.new(0, 0, nwi, nhe)\n end\n xa = CP::OCARINA::SETTINGS::X_OFFSET * @note\n ya = CP::OCARINA::SETTINGS::Y_OFFSET * (note - 1)\n xa -= rect.width/2\n ya -= rect.height/2\n xn = @first_note_x + xa\n yn = @first_note_y + ya\n unless back\n @note_sprites.bitmap.blt(xn, yn, temp_note, rect)\n else\n @note_sprites.bitmap.blt(xn, yn, temp_note, rect, 128)\n end\n end",
"title": ""
},
{
"docid": "108a5750bba8c1c57d2dafee4878b2b6",
"score": "0.7144574",
"text": "def create_note(message)\n notes.create(:content => message)\n end",
"title": ""
},
{
"docid": "b8be0e0948dda8610b90d42ee18d5a54",
"score": "0.71123284",
"text": "def create\n @note = current_user.notes.new(note_params)\n @note.note = view_context.markdown(@note.note).gsub(\"\\n\",\"\").gsub(\"\\r\",\"\")\n @note.save\n $statsd.increment 'animal.note.created'\n respond_with(@note)\n end",
"title": ""
},
{
"docid": "ae9990e563c09540b52bfd564b90a16c",
"score": "0.7107869",
"text": "def add(note, replace: false)\n clear if replace\n case note\n when String\n append_string(note)\n when Array\n append(note)\n end\n end",
"title": ""
},
{
"docid": "c706580f55ddd86d7d14b96ed0f6b9f8",
"score": "0.7091456",
"text": "def create_notes\n end",
"title": ""
},
{
"docid": "c706580f55ddd86d7d14b96ed0f6b9f8",
"score": "0.7091456",
"text": "def create_notes\n end",
"title": ""
},
{
"docid": "364a078f09268417faff1427ad906c8d",
"score": "0.7029683",
"text": "def add_notes\n @obs.notes.each do |key, val|\n next if val.blank?\n\n if key == Observation.other_notes_key\n label(\"Notes\")\n else\n label(key.to_s.tr(\"_\", \" \"))\n end\n @para << val\n @para.line_break\n end\n end",
"title": ""
},
{
"docid": "8a83138f652129cc6af8be3048f3468c",
"score": "0.6975195",
"text": "def create\n if defined?(@noteable) && @noteable.present?\n @new_note = @noteable.notes.new(note_params)\n unless @new_note.save\n respond_with_notify(\"Error while creating the note\", \"alert\")\n end\n else\n respond_with_notify(\"Error while creating the note\", \"alert\")\n end\n end",
"title": ""
},
{
"docid": "0a6939fd5d801d10dfcc0a682cdfa678",
"score": "0.69699097",
"text": "def notify(params)\n\t\tnote = self.notes.create!(params)\n\t\tnote\n\tend",
"title": ""
},
{
"docid": "8239fa0dae398a7e3ce72b4085c5a0ac",
"score": "0.69599736",
"text": "def add_note\n #cria uma variavel nota e busca através do id enviado pela URL a nota do usuario logado\n @note = current_user.notes.find params[:note_id]\n #adiciona a nota a um usuario convidado\n @user.guest_notes << @note\n\n #Metodo da função de email Mailers que envia para o metodo new_note_permission como parametro os objetos note e user.\n #função deliver_now envia o email na mesma hora que esta função for execultada\n NoteMailer.new_note_permission(@note, @user).deliver_now\n render json: {message: \"Compartilhamento bem sucedido!\"}, status: :ok\n end",
"title": ""
},
{
"docid": "f30c1f540edbab6329b0376fe8e551a2",
"score": "0.6954813",
"text": "def create_note\n @note = new_note(param(:note))\n\n if @note.save\n trigger :content_changed\n invoke :update_form\n else\n replace :view => 'shown'\n end\n end",
"title": ""
},
{
"docid": "c5278624ef8a4ac6daeb3fbce3eec1e2",
"score": "0.69541484",
"text": "def add_note(channel, note, velocity, delta_time, start_time=nil)\n if include_win? or include_mac?\n \n self.channel(channel) if channel_nil?(channel)\n note_length = @seq.length_to_delta(seconds_to_beats(delta_time))\n # NOTE: Attempts to write notes from multiple players to same channel at absolute start times\n # that didn't just append forward in time all failed\n # Tried using the Track#recalc_times() but that didn't set absolute times. Tried to write\n # notes in with actual start times (not 0 for NoteOnEvent#new arg4) and that gave null pointer\n # errors in midilib code. Only reliable way was to pass 0 and let it append notes\n # So to get polyphony must have each Player write into separate Track on separate Channel \n @channel_tracks[channel].events << NoteOnEvent.new(channel, note, velocity, START_TIME_APPEND_NOTE)\n @channel_tracks[channel].events << NoteOffEvent.new(channel, note, velocity, note_length)\n \n end\n end",
"title": ""
},
{
"docid": "b4d42fd651ad1b621a2b25777018d4c5",
"score": "0.6951914",
"text": "def model_note(model, body)\n model.notes.create(:author => current_user, :body => body)\n end",
"title": ""
},
{
"docid": "393919aa246ca983523488bcbcfce372",
"score": "0.69431686",
"text": "def add_note\n @script = Script.find(params[:resource_id])\n note = Note.new(:words=>params[:words], :user_id=>current_user.id, :notable_id=>@script.id, :notable_type=>\"Script\")\n note.save\n render :partial=>\"notes/note\", :locals=>{:note=>note}\n end",
"title": ""
},
{
"docid": "d18231e85fd7f37f99687a2d68f20157",
"score": "0.6936572",
"text": "def add_contact_note!(contact_id, params = {})\n cleaned = params.permit(:author_id, :body)\n create(\"contacts/#{contact_id}/notes\", cleaned)\n end",
"title": ""
},
{
"docid": "9a9060f74f284a662b6d5e7d051f921e",
"score": "0.6922787",
"text": "def note(*str)\n @note = str unless str.empty?\n @note\n end",
"title": ""
},
{
"docid": "9a9060f74f284a662b6d5e7d051f921e",
"score": "0.6922787",
"text": "def note(*str)\n @note = str unless str.empty?\n @note\n end",
"title": ""
},
{
"docid": "9a9060f74f284a662b6d5e7d051f921e",
"score": "0.6922787",
"text": "def note(*str)\n @note = str unless str.empty?\n @note\n end",
"title": ""
},
{
"docid": "29e28024fd6691fcb5adade36ec9b189",
"score": "0.69199044",
"text": "def add_note ticket_id, payload\n\t\t\t\t\tbegin\n\t\t\t\t\t\tFreshdesk::Api::Client.convert_to_hash( @connection.post \"tickets/#{ticket_id}/#{NOTES}\", payload )\n\t\t\t\t\trescue Freshdesk::Api::InvalidEndpointError\n\t\t\t\t\t\tfalse\n\t\t\t\t\tend\n\t\t\t\tend",
"title": ""
},
{
"docid": "253e8fd1324649ef157cc2efe25b1b11",
"score": "0.68988234",
"text": "def song_notes_1=(note)\n self.notes.first = Note.find_or_create_by(content: note)\n end",
"title": ""
},
{
"docid": "8fcada1b8745900ca642395ff3cf47ab",
"score": "0.68905735",
"text": "def note\n\t\t@user = load_user\n\t\t@notes = Note.all\n\t\t@note = Note.new\n\tend",
"title": ""
},
{
"docid": "3a3e6dc2f70e8e5a2c550983dece54c1",
"score": "0.68819165",
"text": "def create_note(project, body)\n post(\"/projects/#{url_encode project}/notes\", body: { body: body })\n end",
"title": ""
},
{
"docid": "3a3e6dc2f70e8e5a2c550983dece54c1",
"score": "0.68819165",
"text": "def create_note(project, body)\n post(\"/projects/#{url_encode project}/notes\", body: { body: body })\n end",
"title": ""
},
{
"docid": "783fea4b28212dde32e7113f6423db09",
"score": "0.6881174",
"text": "def note(value, pitch: nil, expression: nil)\n @_notes << Note.define(\n value: value,\n pitch: pitch,\n exp: expression,\n midi: midi,\n bpm: bpm,\n device: device\n )\n end",
"title": ""
},
{
"docid": "1293faa6f234c5e88a0c22032e34a290",
"score": "0.68627167",
"text": "def note(message)\n log(message, kind: :note)\n end",
"title": ""
},
{
"docid": "a3683e60ad3705828f481c668643ed01",
"score": "0.6858266",
"text": "def add_note\n @variable = Variable.find(params[:resource_id])\n note = Note.new(:words=>params[:words], :user_id=>current_user.id, :notable_id=>@variable.id, :notable_type=>\"Variable\")\n note.save\n render :partial=>\"notes/note\", :locals=>{:note=>note}\n end",
"title": ""
},
{
"docid": "df312d8da1c9a67be2b1c1df3401d998",
"score": "0.68512124",
"text": "def add_note(id, api_note, opts = {})\n data, status_code, headers = add_note_with_http_info(id, api_note, opts)\n return data\n end",
"title": ""
},
{
"docid": "df312d8da1c9a67be2b1c1df3401d998",
"score": "0.68512124",
"text": "def add_note(id, api_note, opts = {})\n data, status_code, headers = add_note_with_http_info(id, api_note, opts)\n return data\n end",
"title": ""
},
{
"docid": "df312d8da1c9a67be2b1c1df3401d998",
"score": "0.68512124",
"text": "def add_note(id, api_note, opts = {})\n data, status_code, headers = add_note_with_http_info(id, api_note, opts)\n return data\n end",
"title": ""
},
{
"docid": "09ccfe97d9f2376d656570b45aa00f23",
"score": "0.6839629",
"text": "def note(id, type, feature)\n _notes\n @_notes[id][type] = RSS_Note.new(id, type, feature)\n end",
"title": ""
},
{
"docid": "c6fcc031a59b164d3f7bf0362018ad28",
"score": "0.683289",
"text": "def create\n @note = current_user.notes.build(note_params)\n if @note.save\n flash[:success] = \"note has been created!\"\n redirect_to user_note_path(id: @note.id)\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "073df445cf9c165fd587b8d273a9c0d5",
"score": "0.6824957",
"text": "def <<(notes)\n notes.each do |note|\n new_note = note.dup\n # For debugging\n new_note.score_id = \"#{@name}_#{self.object_id}\" \n @notes << new_note\n end \n end",
"title": ""
},
{
"docid": "52d29424fcb26cc209af45e293c4286f",
"score": "0.6824749",
"text": "def create\n @note = Note.new(note_params)\n @note.user_id = @user.id\n respond_to do |format|\n if @note.save\n @user.notes << @note\n format.html { redirect_to user_notes_path(@user, @note), notice: 'Note was successfully created.' }\n format.json { render :show, status: :created, location: @note }\n else\n format.html { render :new }\n format.json { render json: @note.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1259bb9ada360e2ed4a649def2c1a8b9",
"score": "0.6820632",
"text": "def set_Note(value)\n set_input(\"Note\", value)\n end",
"title": ""
},
{
"docid": "b03ba669fd6e5396bb38c79d5a885e17",
"score": "0.6802582",
"text": "def new_note(note)\n @greeting = \"Hi there!\"\n @id = note.id\n @notemaker = note.user.name\n\n mail to: note.user.email\n end",
"title": ""
},
{
"docid": "ad3bce42f380382be1672c3a98d5646c",
"score": "0.68010443",
"text": "def note(id, type, feature)\n _notes\n @_notes[id][type] = RSS_Note.new(id, type, feature)\n end",
"title": ""
},
{
"docid": "a25db05d96943ca914ab2f7acbfe83cf",
"score": "0.6772539",
"text": "def add_note\n @survey = Survey.find(params[:resource_id])\n note = Note.new(:words=>params[:words], :user_id=>current_user.id, :notable_id=>@survey.id, :notable_type=>\"Survey\")\n note.save\n render :partial=>\"notes/note\", :locals=>{:note=>note}\n end",
"title": ""
},
{
"docid": "33b141892d2df8d9f2938e900c772730",
"score": "0.6760852",
"text": "def create\n note = current_user.notes.new(note_params)\n if note.save\n redirect_to notes_path, notice: 'Note was successfully created.'\n else\n redirect_to new_note_path, errors: note.errors \n end\n end",
"title": ""
},
{
"docid": "3e63e8af3206d2d190772b5db3659819",
"score": "0.6760818",
"text": "def create\n\t\t@note = Note.new do |u|\n\t\t\tu.heading = note_params[:heading]\n\t\t\tu.message = note_params[:message]\n\t\t\tu.due_at = note_params[:due_at]\n\t\t\tif user_signed_in?\n\t\t\t\tu.author_id = current_user.id\n\t\t\tend\n\t\t\tu.is_public = note_params[:is_public]\n\t\t\tu.signed_to_id = note_params[:signed_to]\n\t\t\tu.status_id = note_params[:status]\n\t\t\tu.category_id = note_params[:category]\n\t\tend\n\n\t\[email protected]\n\t\tredirect_to notes_path\n\tend",
"title": ""
},
{
"docid": "693c7358eb324e5214e7b4829f9b876d",
"score": "0.6751548",
"text": "def create\n @note = Note.new(note_params)\n if @note.save\n render json: @note, serializer: NoteSerializer\n else\n render json: { error: t('note_create_error') }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "73af689b4ed12a2cf6f9c91a4bec0675",
"score": "0.67506236",
"text": "def create\n\t\t@note = Note.new(params[:note])\n\t\[email protected]\n\t\trespond_with @note\n\t\t# respond_to do |format|\n\t\t# \tif @note.save\n\t\t# \t\t# format.html { redirect_to @note, notice: 'Note was successfully created.' }\n\t\t# \t\tformat.json { render json: @note, status: :created, location: @note }\n\t\t# \t\t# respond_with @note\n\t\t# \telse\n\t\t# \t\trespond_with({:msg => \"error\"}, :status => :unprocessable_entity, :location => nil)\n\t\t# \t\t# format.html { render action: \"new\" }\n\t\t# \t\t# format.json { render json: @note.errors, status: :unprocessable_entity }\n\t\t# \tend\n\t\t# end\n\tend",
"title": ""
},
{
"docid": "377f0b28ba09f1dafea2ca9fa5324bc6",
"score": "0.67418736",
"text": "def create_note(project_id, issue_id, content, access_token)\n rest_client.post(\"/projects/#{project_id}/issues/#{issue_id}/notes\", { verify: false, body: { body: content, access_token: access_token } })\n end",
"title": ""
},
{
"docid": "01d1ae810d09eca060908f896d245173",
"score": "0.6732418",
"text": "def add_note_for_reviews\n ResponseNote.create(note_text: params[:review_note], response_id: params[:id], user_id: current_user.id)\n redirect_to home_index_path\n flash[:success] = \"note added for review.\"\n end",
"title": ""
},
{
"docid": "70c6202dfa50a1a4cabea0b67bb7dc59",
"score": "0.67293024",
"text": "def note\n if params[:id]\n Note.find_by_id params[:id]\n else\n Note.new\n end\n end",
"title": ""
},
{
"docid": "e161ec513b67482f2d2c86b5ed4b3784",
"score": "0.67198515",
"text": "def add_comment(note, text, event, notify = true)\n attributes = { :visible => true, :event => event, :body => text }\n\n if current_user\n attributes[:author_id] = current_user.id\n else\n attributes[:author_ip] = request.remote_ip\n end\n\n comment = note.comments.create!(attributes)\n\n note.comments.map(&:author).uniq.each do |user|\n Notifier.note_comment_notification(comment, user).deliver_now if notify && user && user != current_user && user.visible?\n end\n end",
"title": ""
},
{
"docid": "0b987659d30c32031cfc6e889157d870",
"score": "0.6718138",
"text": "def note\n map_to_bibtex_value('annote', 'note')\n end",
"title": ""
},
{
"docid": "98e28f7b5cf35aedbc1a7bb6e4666431",
"score": "0.671166",
"text": "def note= note \n # @note = note\n end",
"title": ""
},
{
"docid": "350aeea7245deee114b8f70b4b08427d",
"score": "0.6701597",
"text": "def create\n @note = Note.new(note_params)\n @note.active = true\n\n\n respond_to do |format|\n if current_user.notes << @note\n flash[:notice] = 'Note was successfully created.'\n format.html { render :edit }\n format.json { render :show, status: :created, location: @note }\n else\n format.html { render :new }\n format.json { render json: @note.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1e983221dc620c8a8113c5a58436b819",
"score": "0.6700086",
"text": "def <<(notes) \n notes.each do |note|\n new_note = note.dup\n new_note = new_note.start(new_note.start + self.start)\n # For debugging\n new_note.score_id = \"#{@name}_#{self.object_id}\" \n @notes << new_note\n end \n end",
"title": ""
},
{
"docid": "21c3abd1df9a135b69f99ebdbcce08f2",
"score": "0.6699003",
"text": "def create_issue_note(project, issue, body)\n post(\"/projects/#{url_encode project}/issues/#{issue}/notes\", body: { body: body })\n end",
"title": ""
},
{
"docid": "21c3abd1df9a135b69f99ebdbcce08f2",
"score": "0.6699003",
"text": "def create_issue_note(project, issue, body)\n post(\"/projects/#{url_encode project}/issues/#{issue}/notes\", body: { body: body })\n end",
"title": ""
},
{
"docid": "8f31e66415f902299304f14d1eda6c9c",
"score": "0.6690882",
"text": "def addNewNote\n noteText = params[:note]\n timeSpent = params[:time_spent]\n @report = ProblemReportRecord.find(params[:id])\n\n if [email protected]?\n if auth_user?\n note = ProblemReportNote.new(:user_id => current_user.id, :problem_report_record_id => @report.id, :comment => noteText, :time_spent => timeSpent)\n note.save\n @report.initializeStatus current_user, true\n end\n end\n \n respond_to do |format|\n format.html { render action: \"index\" }\n format.js {}\n end\n end",
"title": ""
},
{
"docid": "e9e462345d5b0ac2ab1db52a9f6d17c8",
"score": "0.66856396",
"text": "def create_snippet_note(project, snippet, body)\n post(\"/projects/#{url_encode project}/snippets/#{snippet}/notes\", body: { body: body })\n end",
"title": ""
},
{
"docid": "e9e462345d5b0ac2ab1db52a9f6d17c8",
"score": "0.66856396",
"text": "def create_snippet_note(project, snippet, body)\n post(\"/projects/#{url_encode project}/snippets/#{snippet}/notes\", body: { body: body })\n end",
"title": ""
},
{
"docid": "bc9383b800595db1679a562683fdd65b",
"score": "0.66827536",
"text": "def create\n @note = current_user.notes.build(note_params)\n\n respond_to do |format|\n if @note.save\n format.html { redirect_to edit_note_path(@note), notice: 'Note was successfully created.' }\n format.json { render :show, status: :created, location: @note }\n else\n format.html { render :new }\n format.json { render json: @note.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc9383b800595db1679a562683fdd65b",
"score": "0.66827536",
"text": "def create\n @note = current_user.notes.build(note_params)\n\n respond_to do |format|\n if @note.save\n format.html { redirect_to edit_note_path(@note), notice: 'Note was successfully created.' }\n format.json { render :show, status: :created, location: @note }\n else\n format.html { render :new }\n format.json { render json: @note.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c47b94d0be9c33948a45a670991ec545",
"score": "0.6682528",
"text": "def modify_note(project_id, issue_id, note_id, content, access_token)\n rest_client.put(\"/projects/#{project_id}/issues/#{issue_id}/notes/#{note_id}\", { verify: false, body: { body: content, access_token: access_token } })\n end",
"title": ""
},
{
"docid": "a9309f10a824088d5612f38355a9ed28",
"score": "0.66659576",
"text": "def note_create\n\t\t@note = Note.new(note_params)\n\n\t\tif @note.save\n\t\t\tredirect_to '/main/personal_note'\n\t\telse\n\t\t\t#handle error message here\n\t\t\tredirect_to '/main/personal_note'\n\t\tend\n\tend",
"title": ""
},
{
"docid": "16def33f1674b1a4aeb6c75f513d7bf7",
"score": "0.6663344",
"text": "def create\n puts \"What do you want to name your Note?\"\n note_index = gets.chomp\n puts \"Type in the note contents\"\n note_content = gets.chomp\n note_list[note_index] = {\"note\"=> note_content, \"author\"=> author}\n options\n end",
"title": ""
},
{
"docid": "31769e54e9ea1af2a413b409673359c4",
"score": "0.66385263",
"text": "def add(*a)\n options = a.last.kind_of?(Hash) ? a.pop : {}\n notes = [a].flatten\n note_offs = notes.find_all { |n| n.kind_of?(MIDIMessage::NoteOff) }\n notes = sanitize_input_notes(notes, MIDIMessage::NoteOn, options)\n @sequence.add(notes)\n remove(*note_offs)\n end",
"title": ""
},
{
"docid": "7b15313cee5f2dc4341a0ca0398ba979",
"score": "0.663634",
"text": "def create\n @note = @book.notes.new(note_params)\n\n respond_to do |format|\n if @note.save\n format.html { redirect_to @book, notice: 'Note was added successfully.' }\n format.json { render :show, status: :created, location: @book }\n else\n format.html { flash[:alert] = 'Unable to add the note!'; render 'books/show' }\n format.json { render json: @note.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
201e9cdb7ac095d18a85fec4658bb252
|
Overriding so that we have pagination by default
|
[
{
"docid": "d478807b75265f0bd5eec3d305f32503",
"score": "0.0",
"text": "def collection\n get_collection_ivar || set_collection_ivar(end_of_association_chain.paginate(:page => params[:page]))\n end",
"title": ""
}
] |
[
{
"docid": "9e416762c92907672b35ecb5ab650dc9",
"score": "0.83754426",
"text": "def auto_paginate; end",
"title": ""
},
{
"docid": "1c1d8a2397d80198dde923f9cfb160bb",
"score": "0.8072182",
"text": "def paginate; false; end",
"title": ""
},
{
"docid": "a34d32d5402182ca4f53d799ba44b49d",
"score": "0.77784866",
"text": "def use_pagination\n false\n end",
"title": ""
},
{
"docid": "e0eaa9a8b19fc19e8e7189e03c29ba01",
"score": "0.76425266",
"text": "def use_pagination\n limit = params[:limit].blank? ? false : params[:limit].to_i\n if limit && limit < Rails.configuration.max_limit && limit > 0\n @res = @res.limit(limit.to_i)\n else\n @res = @res.limit(Rails.configuration.default_limit)\n end\n offset = params[:offset].blank? ? false : params[:offset].to_i\n if offset\n @res = @res.offset(offset)\n end\n end",
"title": ""
},
{
"docid": "55bbdc307ab83343529948c52de49d8b",
"score": "0.7556956",
"text": "def paginate(arg, options = {})\n if arg.instance_of?(Symbol) or arg.instance_of?(String)\n# Use default paginate function.\n collection_id = arg # arg is, e.g., :specs or \"specs\"\n super(collection_id, options)\n else\n# Paginate by hand.\n items = arg # arg is a list of items, e.g., users\n items_per_page = options[:per_page] || 10\n page = (params[:page] || 1).to_i\n result_pages = Paginator.new(self, items.length, items_per_page, page)\n offset = (page - 1) * items_per_page\n [result_pages, items[offset..(offset + items_per_page - 1)]]\n end\n end",
"title": ""
},
{
"docid": "a41870b710277e1f2e475b5e94b54df2",
"score": "0.7555348",
"text": "def paginate(options = {})\n super(prepare_options(options))\n end",
"title": ""
},
{
"docid": "594b373ae798ec198d70346f59386f39",
"score": "0.75467116",
"text": "def paginated\n @paginated ||= pered\n end",
"title": ""
},
{
"docid": "c8fc1969c74bfcee7bbbed16a36dddf2",
"score": "0.7531908",
"text": "def paginatable?; paginatable; end",
"title": ""
},
{
"docid": "816beaf1bd8825ce0f89a90de2918b65",
"score": "0.7529729",
"text": "def paginate!\n return if defined?(@pagination) && defined?(@list)\n @pagination, @list = pagy(relation)\n end",
"title": ""
},
{
"docid": "9deba4d66e95791e39bad3b95bf62b13",
"score": "0.75129014",
"text": "def pagination\n self.results\n end",
"title": ""
},
{
"docid": "5222c99dfc786358779dc549d1e24dce",
"score": "0.7411055",
"text": "def pagination\n return :auto if client.auto_pagination\n\n run.response.pagination\n end",
"title": ""
},
{
"docid": "77a83a78c3bc08186f051a3f70556fa8",
"score": "0.7403755",
"text": "def pagination_setup(paginator: Upload::Paginator, **opt)\n # noinspection RubyMismatchedReturnType\n super\n end",
"title": ""
},
{
"docid": "1fed3f8a03b7c468f1fd7ca90a7babee",
"score": "0.7400496",
"text": "def pagination\n return @pagination if @pagination\n first_page\n @pagination\n end",
"title": ""
},
{
"docid": "e185cc76db73bbd43403e7e002e7c884",
"score": "0.7394274",
"text": "def per_page; end",
"title": ""
},
{
"docid": "e185cc76db73bbd43403e7e002e7c884",
"score": "0.7394274",
"text": "def per_page; end",
"title": ""
},
{
"docid": "92d1c59f952719536b9bfa22e625f477",
"score": "0.73911923",
"text": "def paginate_with page:nil, per_page:nil\n @page = page if page\n @per_page = per_page if per_page\n self\n end",
"title": ""
},
{
"docid": "7363f7b2ea768cd55d141478f2bced99",
"score": "0.7362591",
"text": "def paginate\n false\n end",
"title": ""
},
{
"docid": "d83d3d4d1caffb75a849b6cdadc04e3a",
"score": "0.7349569",
"text": "def per_page\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "97338017056533fee360138cd60c54e3",
"score": "0.73429924",
"text": "def auto_paginate\n AUTO_PAGINATE\n end",
"title": ""
},
{
"docid": "61776429ec8360bb293fc70951c6d5f9",
"score": "0.734188",
"text": "def set_pagination_details\n\t\t\tself.from ||= 0\n\t\t\tself.size ||= 10\n\t\t\tself.total_pagination_blocks = 11\n\t\tend",
"title": ""
},
{
"docid": "52d5a3dfe1b6fb715e865a1acfa8da34",
"score": "0.7336729",
"text": "def pager; end",
"title": ""
},
{
"docid": "52d5a3dfe1b6fb715e865a1acfa8da34",
"score": "0.7336729",
"text": "def pager; end",
"title": ""
},
{
"docid": "52d5a3dfe1b6fb715e865a1acfa8da34",
"score": "0.7336729",
"text": "def pager; end",
"title": ""
},
{
"docid": "a8226301df2f2623a699a01b2f8f4f33",
"score": "0.7321974",
"text": "def default_per_page\r\n 400\r\n end",
"title": ""
},
{
"docid": "da20e19431f6503aee44bcc03e464162",
"score": "0.73076195",
"text": "def pagination\n if params[:offset].present?\n @offset = params[:offset].to_i\n end\n if params[:limit].present?\n @limit = params[:limit].to_i\n end\n @offset ||= 0\n @limit ||= 20\n end",
"title": ""
},
{
"docid": "561295265ea7528d9e6eb04ef5faff73",
"score": "0.7298334",
"text": "def pagination\n [ :previous_page ]\n end",
"title": ""
},
{
"docid": "2c42bb8f3f2737e555c7775eb82f3115",
"score": "0.7295852",
"text": "def method_missing name, *args\n if name.to_s =~ /^paginated?_(.+)$/\n paginate args[0], args[1], $1, *args[2..-1]\n else\n super name, *args\n end\n end",
"title": ""
},
{
"docid": "d77d3b78e366e547b600467d37be1329",
"score": "0.72898084",
"text": "def pagination\n settings.pagination || 50\n end",
"title": ""
},
{
"docid": "d77d3b78e366e547b600467d37be1329",
"score": "0.72898084",
"text": "def pagination\n settings.pagination || 50\n end",
"title": ""
},
{
"docid": "d77d3b78e366e547b600467d37be1329",
"score": "0.72898084",
"text": "def pagination\n settings.pagination || 50\n end",
"title": ""
},
{
"docid": "0ad1c0518a6a43b79d90e88e83cc00d0",
"score": "0.72786605",
"text": "def paginator(*)\n @paginator ||= pagination_setup\n end",
"title": ""
},
{
"docid": "62b575b5d659210514d5bbe0d40a0230",
"score": "0.72462535",
"text": "def paginate_with_method\n @paginate_with_method\n end",
"title": ""
},
{
"docid": "b082cfb6d2e375aeb1d91b8f5be7da24",
"score": "0.7234081",
"text": "def setPaginateDefault\n if defined?(params[:page])\n if params[:page].blank?\n params[:page] = 1\n end\n else\n params[:page] = 1\n end\n if defined?(params[:rows])\n if params[:rows].blank?\n params[:rows] = 30\n end\n else\n params[:rows] = 30\n end\n end",
"title": ""
},
{
"docid": "4fc8418ba34355cf0651a23c40a66175",
"score": "0.7228171",
"text": "def paginate(*args)\n prepare_options!(args.last) if(args.last.is_a?(Hash))\n super\n end",
"title": ""
},
{
"docid": "e187ed5d3033e1bf39183a64d1f0e8d8",
"score": "0.7219707",
"text": "def set_pagination\n @page = params[:page].blank? ? 1 : params[:page].to_i\n\n @per_page = params[:per_page].blank? ? 25 : params[:per_page].to_i\n @per_page = 100 if @per_page > 100\n end",
"title": ""
},
{
"docid": "ddae5211f17c02387b0182a6c117ebd0",
"score": "0.7217192",
"text": "def records\n case paginator_mode\n when :sequential_before\n super.first(records_per_page)\n when :sequential_after\n super.first(records_per_page).reverse\n when :numbered\n super\n end\n end",
"title": ""
},
{
"docid": "003040ae191245de064eea4db26bb349",
"score": "0.721674",
"text": "def records\n if paginator_mode == :sequential_before\n super.first(records_per_page)\n elsif paginator_mode == :sequential_after\n super.first(records_per_page).reverse\n elsif paginator_mode == :numbered\n super\n end\n end",
"title": ""
},
{
"docid": "9094f4d4d1c2693c6010761ad38addbe",
"score": "0.7208876",
"text": "def pagination_hook scope\n scope.limit params[:limit] if params[:limit].kind_of? Integer\n scope.skip params[:offset] if params[:offset].kind_of? Integer\n end",
"title": ""
},
{
"docid": "db3348c8b7e241882f2f14cb13867f42",
"score": "0.71542937",
"text": "def paginate(params)\n limit params[:per]\n offset((params.fetch(:page, 1).to_i - 1) * @structure[:limit])\n self\n end",
"title": ""
},
{
"docid": "a43adfc8c0e09ab1f7ab8626b712ef8a",
"score": "0.71304756",
"text": "def pagination\n @settings.pagination || 50\n end",
"title": ""
},
{
"docid": "9567883c07174ee1bd0c191f31bf1ba8",
"score": "0.7095436",
"text": "def paginate(options={})\n page = options[:page].to_i if options[:page]\n page ||= 0\n per_page = options[:per_page].to_i if options[:per_page]\n per_page ||= 10\n self.current_page = page\n self.total_pages = self.count / per_page\n self.offset(per_page * page).limit(per_page).decorate\n end",
"title": ""
},
{
"docid": "085d823c7c625f4e8e85395edbe20e52",
"score": "0.70935625",
"text": "def pagination\r\n @collection[:pagination]\r\n end",
"title": ""
},
{
"docid": "24229f02b481c89839c72fce2e93f818",
"score": "0.70928776",
"text": "def pagination_page\n params[:page] ||= 1\n params[:page]\n end",
"title": ""
},
{
"docid": "81d5ce3beb0a9fe48cad7da4015d6e5f",
"score": "0.70922935",
"text": "def enabled_and_apply_pagination\n Event.enabled.paginate(:page => params[:page], :per_page => 5)\n end",
"title": ""
},
{
"docid": "60f769f042244206aee19c76f3cb2e22",
"score": "0.7087811",
"text": "def paginate(target = collection, *args, &block)\n pagination = super\n return pagination unless block_given?\n pagination + capture(&block) + pagination\n end",
"title": ""
},
{
"docid": "7f7ac82d9f447db1c250b1cdaf8280bb",
"score": "0.7082372",
"text": "def paginate\n target_class.paginate(pagination_options)\n end",
"title": ""
},
{
"docid": "d0738a5dbeaf7bfafe9c9fa10698b56f",
"score": "0.70768315",
"text": "def check_for_pagination\n @page = params[:page] || self.class::PAGE\n @per_page = params[:per_page] || self.class::PER_PAGE\n end",
"title": ""
},
{
"docid": "47597227a3fbf39d0441ae8d517999d0",
"score": "0.7074155",
"text": "def paginator\n @my_paginator\n end",
"title": ""
},
{
"docid": "a936ce21d2eda04dbb23d2f2fa88e3fe",
"score": "0.7073658",
"text": "def set_pagination_defaults\n @@page = (params[:page] || 1).to_i\n @@page = 1 if @@page < 1\n @@per_page = (params[:per_page] || Settings.views.pagination.per_page).to_i\n end",
"title": ""
},
{
"docid": "5392c8ec1a1dc8ac0599c65908d4f7ef",
"score": "0.70681953",
"text": "def paginated(options = {})\n @action.traits << :paginated\n param :page, \"The page number\", :type => Integer, :required => true, :default => options[:page] || 1\n param :per_page, \"The number of items to return per page\", :type => Integer, :required => true, :default => options[:per_page] || 30\n end",
"title": ""
},
{
"docid": "a970e3bd9dddf67d85efa8a15ffe90f4",
"score": "0.70676285",
"text": "def per_page\n 50\n end",
"title": ""
},
{
"docid": "c39c7215f91e262f7dca106764696e4e",
"score": "0.7057973",
"text": "def initialize *a\n self.default_page_limit = 25\n super *a\n end",
"title": ""
},
{
"docid": "85aa19ee0c29094b713b2491bf5bb846",
"score": "0.70576674",
"text": "def default_per_page\n 30\n end",
"title": ""
},
{
"docid": "4852aaaefffffed38ae1998f19d1e785",
"score": "0.70499057",
"text": "def options\n { :page => @page, :per_page => @per_page }\n end",
"title": ""
},
{
"docid": "a436b08e7afd36948bc07b8e1e2f3523",
"score": "0.7040636",
"text": "def paginate(arg, options = {})\n if arg.instance_of?(Symbol) or arg.instance_of?(String)\n # Use default paginate function.\n collection_id = arg # arg is, e.g., :specs or \"specs\"\n super(collection_id, options)\n else\n # Paginate by hand.\n items = arg # arg is a list of items, e.g., users\n items_per_page = options[:per_page] || 10\n page = (params[:page] || 1).to_i\n result_pages = Paginator.new(self, items.length, items_per_page, page)\n offset = (page - 1) * items_per_page\n [result_pages, items[offset..(offset + items_per_page - 1)]]\n end\n end",
"title": ""
},
{
"docid": "05cfd77c45b49136645199384ff7eb49",
"score": "0.70401895",
"text": "def pagination(criteria, inputs)\n criteria.disable_pagination if inputs[:single_page]==true || inputs[:disable_pagination] == true\n criteria.page(inputs[:page]) if inputs[:page]\n criteria.per_page(inputs[:per_page]) if inputs[:per_page]\n self\n end",
"title": ""
},
{
"docid": "83fc5e2589fbf2b107e91512e796bd6a",
"score": "0.7037666",
"text": "def will_paginate(collection, options = {})\n options.merge!({\n :previous_label => t('generic.previous'),\n :next_label => t('generic.next')\n })\n\n super(collection, options)\n end",
"title": ""
},
{
"docid": "0cbbe7e2ff356b847da4a7a348faced4",
"score": "0.7017021",
"text": "def paginate_every(n=nil); @paginate = n if n; @paginate || 20; end",
"title": ""
},
{
"docid": "7d5149b97bd9e35067473cc0b697ebbf",
"score": "0.70134836",
"text": "def paginate(opts = {})\n paginated_by(:all, opts)\n end",
"title": ""
},
{
"docid": "39beb6df2e8dc88ca5cc703f17097fab",
"score": "0.70078456",
"text": "def without_count\n extend ::Kaminari::PaginatableWithoutCount\n end",
"title": ""
},
{
"docid": "0c85ede6293503cbc65b33bf4834d904",
"score": "0.6993865",
"text": "def set_pagination\n @page = params[:page] || 1\n @perPage = params[:per_page] || 25\n end",
"title": ""
},
{
"docid": "dec9ac0a1905886b6b048328deb11720",
"score": "0.6990423",
"text": "def add_paging_to_class(kls)\n kls.send(:include, Kaminari::ConfigurationMethods)\n kls.class.send(:define_method, Kaminari.config.page_method_name) do |num=0|\n result = limit(default_per_page).offset(default_per_page * ([num.to_i, 1].max - 1))\n result.extend Kaminari::ActiveRecordRelationMethods\n result.extend Kaminari::PageScopeMethods\n result\n end\n end",
"title": ""
},
{
"docid": "60d8c96070fbce4437e5ef4093fdff1f",
"score": "0.6983172",
"text": "def default_pagination_limit\n 1000\n end",
"title": ""
},
{
"docid": "3df2731a0dae8ef56cee27924076e8e8",
"score": "0.69696534",
"text": "def page(num)\n super.extending(RelationMethods)\n end",
"title": ""
},
{
"docid": "6092d25b6435a6e9c566c43dfcd464f6",
"score": "0.69664085",
"text": "def paginated_collection\n collection_paginator.new(collection, params).call\n end",
"title": ""
},
{
"docid": "85d0dc822f66b63514eaadb1c71ead08",
"score": "0.6955432",
"text": "def page_params\n [ :per_page, :page ]\n end",
"title": ""
},
{
"docid": "3ef5603cd517633297f3542e4b212a19",
"score": "0.6952112",
"text": "def next_paginate(options)\n if options.delete(:cannot_paginate).blank? || options.delete(:format).eqls?('pdf', 'xls', 'xlsx', 'xml')\n paginate(options)\n else\n all\n end\n end",
"title": ""
},
{
"docid": "d026108fad320fd54c17bd368a349ac1",
"score": "0.6945599",
"text": "def pages_for(size, options = {})\n default_options = {:per_page => 10}\n options = default_options.merge options\n pages = Paginator.new self, size, options[:per_page], (params[:page]||1)\n return pages\n end",
"title": ""
},
{
"docid": "982f4b283d76d518ac842de435cad761",
"score": "0.6940999",
"text": "def paginated(current_page: 1)\n prepend paginator: Margrid::Paginator.new(current_page)\n end",
"title": ""
},
{
"docid": "2fd8084e3b04b06b4a6dd343f439a2f9",
"score": "0.6940924",
"text": "def index\n\n # Pagination Query & Decoration\n # TODO - split this up onto multiple lines, getting a little messy\n items = pagination_config[:decorator].decorate_collection(model.where(params[:query]).order_by(params[:order]).page( @page ).per( @perPage ))\n\n # Template struct\n @paginated = OpenStruct.new({\n page: items.current_page,\n per_page: items.limit_value,\n total_pages: items.total_pages,\n total_entries: items.total_count,\n item_template: pagination_config[:item_template],\n items: items\n })\n\n # Renders the template\n render 'base/paginated'\n end",
"title": ""
},
{
"docid": "059e89ed2e1ab1d62a5e9da1637a6126",
"score": "0.69370484",
"text": "def will_paginate_options\n self.class.will_paginate_options || {}\n end",
"title": ""
},
{
"docid": "9eef5101d4bd190a10ea6c6f65403fa4",
"score": "0.69305867",
"text": "def paginated?\n false\n end",
"title": ""
},
{
"docid": "a9d42d5645913987fb4cb66843c25c76",
"score": "0.6929787",
"text": "def max_per_page\n 10\n end",
"title": ""
},
{
"docid": "ca49951f1202088a24710749f5225862",
"score": "0.69227254",
"text": "def pagination\n {}.tap do |h|\n h[:next_page_params] = next_page_params if next_page?\n h[:prev_page_params] = prev_page_params if prev_page?\n end\n end",
"title": ""
},
{
"docid": "848442ea7fc2f9a72fa2c50cc0d88d4c",
"score": "0.6918973",
"text": "def index\r\n # Update number of items to show on page (if supplied)\r\n Page.per_page = params[:per_page].to_i if params[:per_page]\r\n\r\n @pages = Page.get_my_pages :user => current_user, :page_no => params[:page]\r\n end",
"title": ""
},
{
"docid": "e9d4b95d4bd3dcc8068374f9fa21c0de",
"score": "0.6907592",
"text": "def source_for_collection\n super.page(params[:page]).per(params[:per])\n end",
"title": ""
},
{
"docid": "dee7403f9037ac1c6273352d6eabbcc0",
"score": "0.6902948",
"text": "def paginate\n @extends = Extend.order( 'created_at DESC' ).where( story_id: params[ :id ] ).paginate( :page => params[ :page ], :per_page => 5 )\n puts @extends.current_page\n puts @extends.total_pages\n respond_to do |format|\n format.json { render action: 'paginate', status: :ok }\n end\n @extends = Extend.all\n end",
"title": ""
},
{
"docid": "c87daeff381f62fa9085e4f31da35a38",
"score": "0.69017375",
"text": "def pagination_options\n {\n per_page: params[:per_page] || 10,\n page: params[:page] || 1\n }\n end",
"title": ""
},
{
"docid": "860257ecfd1da148de7b9473c787a502",
"score": "0.68991244",
"text": "def apply_paging_options #:nodoc:\n\n if page = @params['page']\n page = page.to_i\n unless page > 0\n page = 1 \n # page was invalid\n end\n else\n page = 1\n end\n\n if per_page = @params['per_page']\n per_page = per_page.to_i\n unless @per_pages.include?(per_page)\n per_page = @per_pages.first \n # per_page was invalid\n end\n else\n per_page = @per_pages.first\n end\n\n @select['start'] = (page - 1) * per_page\n @select['rows'] = per_page\n\n end",
"title": ""
},
{
"docid": "c06ac524caf357900524dabaab1503ca",
"score": "0.6898376",
"text": "def paginate_all(options = {})\n paginated_view(:all, options)\n end",
"title": ""
},
{
"docid": "92e5f9ead660573588b3bf2a0265523d",
"score": "0.68880355",
"text": "def paginate(collection , options = {})\n #options = options.merge defaults\n options[:renderer] = BootstrapPagination::Rails\n will_paginate collection, options\n end",
"title": ""
},
{
"docid": "fce72b6c0bf16a3845e5c1a848c7e982",
"score": "0.6882071",
"text": "def paginate_with(mtd)\n @paginate_with_method = mtd\n end",
"title": ""
},
{
"docid": "59eca3c0703ac1258756029758e493c4",
"score": "0.6875353",
"text": "def pagination_defaults\n {:page => @@page, :per_page => @@per_page}\n end",
"title": ""
},
{
"docid": "c10df1756a550699c66526addcaa37af",
"score": "0.68697935",
"text": "def pagination(collection = nil)\n collection.nil? ? will_paginate : will_paginate(collection)\n end",
"title": ""
},
{
"docid": "3a2f854ab15f004c1946c6d5218ffe50",
"score": "0.6868307",
"text": "def jsonapi_pagination(resources)\n instance_exec(resources, &JSONAPI::Rails.config[:jsonapi_pagination])\n end",
"title": ""
},
{
"docid": "6921efd5810f89affe64149a0c048b37",
"score": "0.6866907",
"text": "def get_facet_pagination(*args)\n end",
"title": ""
},
{
"docid": "ab9bc62e32501f3577bc422767cc0e3d",
"score": "0.68625563",
"text": "def apply_pagination(list)\n list = Kaminari.paginate_array list if list.is_a? Array\n list.page(params[:page] || 1).per(params[:per])\n end",
"title": ""
},
{
"docid": "ead5293a646b7e761705e87321dc9bef",
"score": "0.68505335",
"text": "def paginate(args=nil)\n # Default to 10 items per page\n args[:page] ||= 0\n args[:per_page] ||= 10\n args[:offset] = args[:page] * args[:per_page]\n find(:all, args)\n end",
"title": ""
},
{
"docid": "310c80e3e16a06cd81bc101c79619656",
"score": "0.6846169",
"text": "def add_paging_to_solr(solr_params, user_params)\n user_params[:rows] ||= 10\n super\n end",
"title": ""
},
{
"docid": "6b020e4ab1b395ecf92f6a32fb3dbf6a",
"score": "0.6842728",
"text": "def paginated_records\n @records\n .paginate(page: params[:page], per_page: params[:per_page])\n end",
"title": ""
},
{
"docid": "67978389c2584c536c13dd5f7cf257a3",
"score": "0.6838756",
"text": "def pagination_method\n case\n when self.respond_to?(:will_paginate)\n :will_paginate\n when self.respond_to?(:paginate)\n :paginate\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "993b12c22264f60197074a30fbdffb57",
"score": "0.68369484",
"text": "def allowed_to_disable_pagination?\n false\n end",
"title": ""
},
{
"docid": "448a0af8e8e74b1d625410df4168b9bb",
"score": "0.68358433",
"text": "def page_size\n 10\n end",
"title": ""
},
{
"docid": "8d670e67ddec0fd8fcb45053924f6d2e",
"score": "0.683459",
"text": "def pagination\n return unless total_pages && total_pages > 1\n from = [1, total_pages - 5].max\n to = [from + 9, total_pages].min\n haml_tag 'div.pagination' do\n haml_tag 'ul' do\n haml_tag :li, link_to(\"«\", params.merge(page: previous_page), class: previous_page ? nil : 'disabled')\n (from..to).each do |page|\n haml_tag :li, link_to(page, params.merge(page: page)), class: page == current_page ? 'active' : nil\n end\n haml_tag :li, link_to(\"»\", params.merge(page: next_page), class: next_page ? nil : 'disabled')\n end\n end\n end",
"title": ""
},
{
"docid": "03a18fca52eb3967134bb111dd80bcdb",
"score": "0.68330497",
"text": "def pagination\n # Extract page and per_page from the Solr query that we called\n per_page = (object.params['rows'] || 10).to_i\n start = (object.params['start'] || 0).to_i\n page = start / per_page\n\n num_pages = object.num_hits.to_f / per_page.to_f\n num_pages = Integer(num_pages.ceil)\n return ''.html_safe if num_pages <= 1\n\n h.content_tag :ul, class: 'pagination' do\n content = page_link('«'.html_safe,\n page == 0 ? nil : page - 1,\n page == 0 ? 'unavailable' : nil)\n\n # Render at most seven pagination links\n if num_pages < 7\n range_to_render = (0..num_pages).to_a\n elsif page < 3\n range_to_render = [0, 1, 2, 3, nil, num_pages - 2, num_pages - 1]\n elsif page >= num_pages - 3\n range_to_render = [0, 1, nil, num_pages - 4, num_pages - 3,\n num_pages - 2, num_pages - 1]\n else\n range_to_render = [0, nil, page - 1, page, page + 1, nil,\n num_pages - 1]\n end\n\n range_to_render.each do |p|\n if p.nil?\n content << page_link('…'.html_safe, nil, 'unavailable')\n else\n content << page_link((p + 1).to_s, p, page == p ? 'current' : nil)\n end\n end\n\n content << page_link('»'.html_safe,\n page == num_pages - 1 ? nil : page + 1,\n page == num_pages - 1 ? 'unavailable' : nil)\n\n content\n end\n end",
"title": ""
},
{
"docid": "e8861a53dbd8e58b1eb751b8ca7d8131",
"score": "0.6827239",
"text": "def enable_pagination_on(collection, args={})\n unless(collection.nil? || collection.empty?)\n content_for(args.fetch(:id, :pagination),\n view_context.will_paginate(collection,\n :renderer => BootstrapPagination::Rails,\n :class => 'pagination-sm',\n :param_name => args.fetch(:param_name, :page)\n )\n )\n end\n end",
"title": ""
},
{
"docid": "3591d55c1c6ad3d9b661dd02d6439534",
"score": "0.6824203",
"text": "def paginate(collection)\n will_paginate collection, renderer: BootstrapPagination::Rails\n end",
"title": ""
},
{
"docid": "59a149ed160a820d5a1a1fc0dd9a0a2a",
"score": "0.6821039",
"text": "def auto_paging_each(&blk); end",
"title": ""
},
{
"docid": "59a149ed160a820d5a1a1fc0dd9a0a2a",
"score": "0.6821039",
"text": "def auto_paging_each(&blk); end",
"title": ""
},
{
"docid": "e8207cfe7d94dea7aea37c0bdad7a93a",
"score": "0.6819587",
"text": "def render_paginated(resources)\n if pagination_params[:page] && pagination_params[:per_page]\n @resources = resources.order(created_at: :asc).paginate(pagination_params)\n elsif params[:page] || params[:per_page]\n render_pagination_400\n else\n @resources = resources\n end\n end",
"title": ""
},
{
"docid": "5ed45276e8b1cbbcfc4a0425c3b8ad1e",
"score": "0.681381",
"text": "def pagination options = {}\n default_options = { :collection => @collection, :separator => '|' }\n \n render_partial :pagination, default_options.merge(options)\n end",
"title": ""
}
] |
0e0a862b9b210a3b7adea8173639a3dc
|
PATCH/PUT /detail_invoices/1 PATCH/PUT /detail_invoices/1.json
|
[
{
"docid": "45d29b9814ea4e3b26d3bc5d479ab797",
"score": "0.72761405",
"text": "def update\n respond_to do |format|\n if @detail_invoice.update(detail_invoice_params)\n format.html { redirect_to @detail_invoice, notice: 'Detail invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @detail_invoice }\n else\n format.html { render :edit }\n format.json { render json: @detail_invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "ef9c9b31edbf325f824f5ac91b9f3318",
"score": "0.731254",
"text": "def update\n @invoice_detail = InvoiceDetail.find(params[:id])\n\n respond_to do |format|\n if @invoice_detail.update_attributes(params[:invoice_detail])\n format.html { redirect_to @invoice_detail.invoice, notice: 'Invoice detail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "893083a2ba78576ff36cb68b0dd16fb2",
"score": "0.7295938",
"text": "def update\n @invoice = Invoice.find(params[:id])\n @invoice.updated_user = current_user.login_name\n @invoice.invoice_details.each do |i|\n i.updated_user = current_user.login_name\n end\n @object = @invoice.invoiceable_type.classify.constantize.find(@invoice.invoiceable_id)\n @object.selector = @invoice.invoiceable_type == \"Provider\" ? Selector::PROVIDER : Selector::GROUP\n @invoice_method = InvoiceCalculation::METHODS\n @payment_terms = Invoice::PAYMENT_TERMS\n @display_sidebar = true\n @back_index = true\n @title = \"Client Invoices\"\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n @invoice.validate\n if params[:commit] == \"Update\"\n format.html { render action: \"new\", notice: 'Invoice was successfully created.' }\n else\n format.html { redirect_to invoice_path(@invoice), notice: 'Invoice was successfully updated.' }\n end\n format.json { render json: @invoice }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f1c509d05c67137b6985e4e9700ec6f4",
"score": "0.7284675",
"text": "def update\n respond_to do |format|\n if @detail_invoice.update(detail_invoice_params)\n format.html { redirect_to @detail_invoice.bill, notice: 'Detail invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @detail_invoice .bill}\n else\n format.html { render :edit }\n format.json { render json: @detail_invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6961df2adb3101e480f091d6c271889a",
"score": "0.7278047",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n @folioDetail = FolioDetail.find(@invoice.folio_detail_id)\n @folioDetail.status = 0\n @folioDetail.save\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c17d147ed9e5f14ef9c63e4e6aafaa07",
"score": "0.7116044",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n if @invoice.update(invoice_params)\n head :no_content\n else\n render json: @invoice.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "abf6ff198d0be9b0c4f3cfdbbac668df",
"score": "0.70446676",
"text": "def update\n @record = Invoice.find(params[:id]) \n @record.update_attributes(params[:invoice]) \n\n respond_to do |format| \n format.json {\n render json: {}\n }\n end\n end",
"title": ""
},
{
"docid": "a4ccff09f9ba79c289ae54ff61992568",
"score": "0.6989476",
"text": "def update\n respond_to do |format|\n if @invoicedetail.update(invoicedetail_params)\n format.html { redirect_to @invoicedetail, notice: 'Invoicedetail was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoicedetail }\n else\n format.html { render :edit }\n format.json { render json: @invoicedetail.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d413fef50d18065886d9e3b8ae796f8",
"score": "0.6960635",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d413fef50d18065886d9e3b8ae796f8",
"score": "0.69599694",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d413fef50d18065886d9e3b8ae796f8",
"score": "0.69599694",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d413fef50d18065886d9e3b8ae796f8",
"score": "0.69599694",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d413fef50d18065886d9e3b8ae796f8",
"score": "0.69599694",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d413fef50d18065886d9e3b8ae796f8",
"score": "0.69599694",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d413fef50d18065886d9e3b8ae796f8",
"score": "0.69599694",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d413fef50d18065886d9e3b8ae796f8",
"score": "0.69599694",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5d413fef50d18065886d9e3b8ae796f8",
"score": "0.69599694",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0d6540ba0778b1e6ad8fab0f11c279f",
"score": "0.6957333",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c0d6540ba0778b1e6ad8fab0f11c279f",
"score": "0.6957333",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "273634315f20717f09fb319e75b9e206",
"score": "0.6956253",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n set_formatted_dates()\n format.json { render json: @invoice.to_json(include: :client), status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "56bbd4ee4679385224b5fd008abb75ec",
"score": "0.6947424",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to invoices_path(), notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "934f2154753d0909ded48e119a68a2cc",
"score": "0.6945566",
"text": "def update\n if @invoice.update(invoice_params)\n render :show, status: :ok, location: @invoice\n else\n render json: @invoice.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "fa72790c63fc3d9756d2feedc4b10beb",
"score": "0.682942",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa72790c63fc3d9756d2feedc4b10beb",
"score": "0.682942",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa72790c63fc3d9756d2feedc4b10beb",
"score": "0.682942",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa72790c63fc3d9756d2feedc4b10beb",
"score": "0.682942",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa72790c63fc3d9756d2feedc4b10beb",
"score": "0.682942",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fa72790c63fc3d9756d2feedc4b10beb",
"score": "0.682942",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "55aea8847c2cf0cb2ddc12fca2f3ce4b",
"score": "0.6821031",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to [@customer, @invoice], notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85d5881b1d000e5846b0e2e309ae1a78",
"score": "0.68155664",
"text": "def update\n invoice = Invoice.find(params[:id])\n if invoice.update(invoice_params)\n render json: { status: '200', message: \"Updated Invoice with id #{params[:id]}\", data: invoice }, status: :ok\n else\n render json: { status: '422', error: 'Invoice not updated', data: invoice.errors }, status: :unprocessable_entity\n end\n rescue ActiveRecord::RecordNotFound\n render json: { status: '404', error: \"No Invoice with id #{params[:id]}\", data: invoice }, status: :not_found\n end",
"title": ""
},
{
"docid": "7f16519748d89e7863d3ff67e88478eb",
"score": "0.6802562",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to ([:admin, @invoice]), notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "91e194767ed66a6dd8ccfd215165da1f",
"score": "0.6801382",
"text": "def update\n @invoice.attributes_with_line_items = invoice_params\n\n if @invoice.save\n respond_with @invoice\n else\n render json: { errors: { :base => @invoice.errors.full_messages } }, status: 422\n end\n end",
"title": ""
},
{
"docid": "5f3df912d767aefdca12e5a1255be939",
"score": "0.6790073",
"text": "def update\n @user = current_user\n @patient = @user.patients.find(params[:patient_id])\n @invoice = @patient.invoices.find(params[:id])\n @invoice.insurance_id = @patient.insurance.id\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to user_patient_invoice_path(@user, @patient, @invoice), notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: user_patient_invoice_path(@user, @patient, @invoice).errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c6432020b64c477feda27edaa2f55a4b",
"score": "0.6786947",
"text": "def update\n\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to edit_invoice_path(@invoice), notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9e3122ab062ff59f9123731a8e8bf7c",
"score": "0.67726505",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96b63b6e68d29aad6acd7c0b37664778",
"score": "0.6769298",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to [:account,@invoice], notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "57264cb82cad0237e5c241a34504e7e9",
"score": "0.6768423",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to edit_invoice_path(@invoice), notice: \"Invoice was successfully updated.\" }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2568c61eb48b8c973ab1a8c089620436",
"score": "0.6751627",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: \"Invoice was successfully updated.\" }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24465636e32103092ff6bdf1875b5585",
"score": "0.6744698",
"text": "def update\n\n respond_to do |format|\n if @invoiceline.update(invoiceline_params)\n format.html { redirect_to invoice_path(@invoiceline.invoice), notice: 'Ligne modifiée.' }\n format.json { render :show, status: :ok, location: @invoiceline }\n else\n format.html { render :edit }\n format.json { render json: @invoiceline.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3dfb09db877af60cc95e9b4e4bf8340a",
"score": "0.6735215",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Din tur blevet opdateret og gemt' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0daf6b0a1d9a1d296cd532eaadab3c97",
"score": "0.6722952",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to admin_invoice_path(@invoice), notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d176af1b19b6148ddf5b457893fcf397",
"score": "0.67028135",
"text": "def update\n set_property_id(@invoice)\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "16a7a26ee5a1d1134bf09de143750603",
"score": "0.669317",
"text": "def update\n @invoice = Invoice.find_by_rand(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated. Whew.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3838bde888ebd1ce6145ba457dc1b1f",
"score": "0.66918606",
"text": "def update_invoice(invoice_id:,\n body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::PUT,\n '/v2/invoices/{invoice_id}',\n 'default')\n .template_param(new_parameter(invoice_id, key: 'invoice_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": "d9d1cbdebe7b17d8b2a3aecaad42df21",
"score": "0.6691394",
"text": "def update\n\n @service = Service.find(params[:service_id])\n @invoice = @service.invoices.find(params[:id])\n\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to service_invoices_url, location: [@invoice.service, @invoice], notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: [@invoice.service, @invoice] }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba5efe4396b49ee494642afaeb0a9cb2",
"score": "0.66870546",
"text": "def update\n respond_to do |format|\n if @invoice.update_attributes(invoice_params)\n format.html { redirect_to admin_conference_invoice_path(@conference.short_title, @invoice), notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n ticket_purchases = @invoice.recipient&.ticket_purchases&.where(conference: @conference)&.where&.not(ticket: nil) || []\n @tickets_grouped = tickets_grouped(ticket_purchases, user: @invoice.recipient)\n @tickets_collection = tickets_collection(@tickets_grouped)\n @tickets_selected = tickets_selected(@tickets_grouped)\n\n format.html {\n flash[:error] = 'Could not update invoice. ' + @invoice.errors.full_messages.to_sentence\n @url = admin_conference_invoice_path(@conference.short_title, @invoice)\n render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93ddc27f1395b712200510e9ab026000",
"score": "0.66857195",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: t('activerecord.attributes.invoice.successfully') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ef0901df1feb6c530b61c8cd81ae807",
"score": "0.66782576",
"text": "def update\n respond_to do |format|\n if @invoce.update(invoce_params)\n format.html { redirect_to @invoce, notice: t(:successfully_updated_invoice) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoce.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c50b7b4f1e28046a2f9008cbfa8b726c",
"score": "0.66468894",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params.require(:invoice).permit(:customer_id, :date_time, :invoice_number, :status))\n format.html { redirect_to invoices_url,\n notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n prepFormVariables(@invoice)\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2dbade263de6866ac11a0cd591ae32ad",
"score": "0.66348475",
"text": "def update\n @invoice = Invoice.where('id = ? and client_id in (?)', params[:id], current_user.company.clients.all.collect(&:id)).first\n \n not_found and return unless @invoice\n\n respond_to do |format|\n if @invoice.validate_client_belongs_to(current_user) and @invoice.update_attributes(params[:invoice])\n format.html { redirect_to(@invoice, :notice => t('.invoice_updated')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8fbb02e36aab1825fd13d951f6660a6f",
"score": "0.6627996",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.js { render 'show', :locals => { :invoice => @invoice }, :layout => false, notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8452689ee430cf4039fcbaf22e1a4995",
"score": "0.66222245",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to :back, notice: \"Invoice #{@invoice.id} has been paid!\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "adecb17b61cf5be8da133de21fa6e0b3",
"score": "0.6618584",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to invoices_url, flash: { 'alert alert-success' => 'Invoice was successfully updated.' }}\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d423f76eaa49aaaa126ff754592d18a",
"score": "0.66174835",
"text": "def update\n # find the invoice\n rowsParam = params[:invoice][:invoice_rows]\n rows = rowsParam.map do |row|\n data = row[1]\n { desc: data[:desc], units: data[:units], price: data[:price] }\n end\n\n @invoice.invoice_row.each do |row|\n row.destroy\n end\n\n rows.each do |row|\n @invoice.invoice_row.create(row)\n end\n\n # update info\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd7b6111ef18e1718282659f0210b5e5",
"score": "0.65577114",
"text": "def set_detail_invoice\n @detail_invoice = DetailInvoice.find(params[:id])\n end",
"title": ""
},
{
"docid": "bd7b6111ef18e1718282659f0210b5e5",
"score": "0.65577114",
"text": "def set_detail_invoice\n @detail_invoice = DetailInvoice.find(params[:id])\n end",
"title": ""
},
{
"docid": "fdfe87d32e72505b174b2473dbc7f9df",
"score": "0.65567243",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n flash[:notice] = 'Invoice was successfully updated.'\n format.html { redirect_to(invoices_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad26a3e5343c1a1ab8e063452cd6a4f7",
"score": "0.65334636",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to project_invoice_path(project_id: @project.id, id: @invoice.id), notice: \"Invoice was successfully updated.\" }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :show, status: :unprocessable_entity }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ced82782bd665b02eeacf994daed1f6",
"score": "0.65323985",
"text": "def update\n respond_to do |format|\n if @iinvoice.update(iinvoice_params)\n format.html { redirect_to @iinvoice, notice: 'Iinvoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @iinvoice }\n else\n format.html { render :edit }\n format.json { render json: @iinvoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92ebcf0ec5dec02ec8bda18f7efd27b8",
"score": "0.6526911",
"text": "def update\n \n respond_to do |format|\n if @invoice.update(invoice_params)\n @company = @invoice.company\n format.html { redirect_to admin_company_invoice_path(@company, @invoice), notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "52aa71fbef5055cc26abf7cd95d8b27a",
"score": "0.65258497",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Uw factuur is aangepast.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0925622e6ffc1ae33f74821fa042ced9",
"score": "0.65168375",
"text": "def set_invoicedetail\n @invoicedetail = Invoicedetail.find(params[:id])\n end",
"title": ""
},
{
"docid": "0438112252bfa47ece9d22883a8c1bf5",
"score": "0.6507604",
"text": "def update\n @account = SubledgerAccount.find_by_uuid(params[:account_id])\n head(:status=>:not_found) and return if @account.nil?\n \n @invoice = @account.invoices.find_by_id(params[:id]) \n head(:status=>:not_found) and return if @invoice.nil?\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n flash[:notice] = 'Invoice was successfully updated.'\n format.html { redirect_to account_invoice_url(:account_id=>@account.uuid, :id=>@invoice.id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b76f6ac21a739150557087cb2a4045f0",
"score": "0.6505962",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to invoices_url, notice: \"Invoice was successfully updated.\" }\n format.json { render :show, status: :ok, location: @invoice }\n else\n @project = @invoice.project\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b7c62c74a3a7e063acdf7e82dfd10b7e",
"score": "0.649988",
"text": "def update\n\t\t@invoice = Invoice.find(params[:id])\n\t\t@relation = @invoice.project_user_relation\n\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tif @invoice.update_attributes(params[:invoice])\n\t\t\t\tformat.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @invoice.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "ef4ba55a4cc540862d310a85ae2f89da",
"score": "0.6498855",
"text": "def update\n @pagetitle = \"Edit invoice\"\n @action_txt = \"Update\"\n \n items = params[:items].split(\",\")\n \n @invoice = Invoice.find(params[:id])\n @company = @invoice.company\n \n if(params[:ac_customer] and params[:ac_customer] != \"\")\n @ac_customer = params[:ac_customer]\n else\n @ac_customer = @invoice.customer.name\n end\n \n @products_lines = @invoice.products_lines\n \n @locations = @company.get_locations()\n @divisions = @company.get_divisions()\n \n @invoice[:subtotal] = @invoice.get_subtotal(items)\n @invoice[:tax] = @invoice.get_tax(items, @invoice[:customer_id])\n @invoice[:total] = @invoice[:subtotal] + @invoice[:tax]\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n # Create products for kit\n @invoice.delete_products()\n @invoice.add_products(items)\n \n # Check if we gotta process the invoice\n @invoice.process()\n \n format.html { redirect_to(@invoice, :notice => 'Invoice was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27513e824a6c754c220a593306edf764",
"score": "0.6491067",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n format.html { redirect_to(@invoice, :notice => 'Invoice was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8df2035912879a91c44bc22930be3319",
"score": "0.647919",
"text": "def update\n @invoice_line = InvoiceLine.find(params[:id])\n\n if @invoice_line.update(invoice_line_params)\n head :no_content\n else\n render json: @invoice_line.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bcf738a6551094af9d33f949052b4089",
"score": "0.6475521",
"text": "def update\n \n respond_to do |format|\n if @invoice.update(invoice_params)\n @company = @invoice.company\n format.html { redirect_to company_company_invoice_path(@company, @invoice), notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5dfb6d4e9883359a27242f9270834c94",
"score": "0.64676553",
"text": "def update\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Orden actualizada correctamente.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5f7b99b9282a4469e9d3840fee922c1c",
"score": "0.64380866",
"text": "def update\n authorize @invoice\n\n respond_to do |format|\n if @invoice.update(invoice_params)\n format.html { redirect_to @invoice, notice: 'Invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @invoice }\n else\n format.html { render :edit }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d042dabd9f08a683a9df6d45828ec815",
"score": "0.6435778",
"text": "def update\n @invoiceitem = Invoiceitem.find(params[:id])\n\n respond_to do |format|\n if @invoiceitem.update_attributes(params[:invoiceitem])\n format.html { redirect_to @invoiceitem, notice: 'Invoiceitem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invoiceitem.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9221a38bbf568f0cfe1300d02510339d",
"score": "0.643056",
"text": "def update\n respond_to do |format|\n if @total_invoice.update(total_invoice_params)\n format.html { redirect_to @total_invoice, notice: 'Total invoice was successfully updated.' }\n format.json { render :show, status: :ok, location: @total_invoice }\n else\n format.html { render :edit }\n format.json { render json: @total_invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36cd82e3d99e94d6ac4b0ec66e274209",
"score": "0.6424993",
"text": "def update\n @billing_entity = BillingEntity.find(params[:id])\n @invoices = Invoice.all\n respond_to do |format|\n if @billing_entity.update_attributes(params[:billing_entity])\n format.html { redirect_to(@billing_entity, :notice => 'Billing entity was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @billing_entity.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "077104cfcb01616c508a467fa6f60276",
"score": "0.6418164",
"text": "def update\n respond_to do |format|\n if @invoice.update_attributes(invoice_params)\n format.html { redirect_to member_additional_services_path(params[:member_id]), notice: 'Invoice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invoice.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "76132c7ee4258f559560cc61c2ca3696",
"score": "0.64115655",
"text": "def update()\n h = Simplify::PaymentsApi.execute(\"invoice\", 'update', self, self.authentication)\n self.merge!(h)\n self\n end",
"title": ""
},
{
"docid": "8876343200aeba635c8be541df554ba5",
"score": "0.6395692",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n flash[:notice] = 'Invoice was successfully updated.'\n format.html { redirect_to(@invoice) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8876343200aeba635c8be541df554ba5",
"score": "0.6395692",
"text": "def update\n @invoice = Invoice.find(params[:id])\n\n respond_to do |format|\n if @invoice.update_attributes(params[:invoice])\n flash[:notice] = 'Invoice was successfully updated.'\n format.html { redirect_to(@invoice) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1e8d96dea741f8c70ca77df3fc381693",
"score": "0.63913083",
"text": "def update_detail\n end",
"title": ""
}
] |
1344cc2921c6275c469a17abead044ad
|
Return instance role (i.e., app, utility, db, db_master, app_master
|
[
{
"docid": "ca2a78b12d3bbc4cf10902798f18c009",
"score": "0.74625564",
"text": "def role\n @instance['role']\n end",
"title": ""
}
] |
[
{
"docid": "0e7d1d825ff55742102c4c6599f561c0",
"score": "0.7990451",
"text": "def role\n @role ||= begin\n _, role, _ = *I.parse_instance\n role || raise(Missing, \"Cannot determine role, INSTANCE env value is #{I.from_environment(\"INSTANCE\").inspect}\")\n end\n end",
"title": ""
},
{
"docid": "a430250a1f019ca9be31b5796705248c",
"score": "0.739451",
"text": "def present_instance_role\n dna['instance_role']\n end",
"title": ""
},
{
"docid": "192e7e18c65404aecb960926e21ef89a",
"score": "0.7097123",
"text": "def role\n return \"webmaster\" if webmaster?\n return \"employer\" if employer?\n return \"job_seeker\" if job_seeker?\n return \"group_manager\" if group_manager?\n end",
"title": ""
},
{
"docid": "2fc67f63a0cb9026b3d9ba9a7a107a95",
"score": "0.7030412",
"text": "def role\n ROLES.detect { |role| self.has_role?(role) }\n end",
"title": ""
},
{
"docid": "35bf5ad3b519f2e6ed10a95dc1f41d81",
"score": "0.7002737",
"text": "def current_role\n self.class.roles[role]\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.6992782",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.6992581",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "565147b04ffe7ab0c4a2645c0ddd34f4",
"score": "0.6992581",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "4b8d99b222043be76dc8e52a0da4f619",
"score": "0.68932885",
"text": "def role\n self.roles_mask = 0 if self.roles_mask < 0 || self.roles_mask >= ROLES.count\n self.roles_mask ? ROLES[self.roles_mask].to_sym : guest\n end",
"title": ""
},
{
"docid": "4b8d99b222043be76dc8e52a0da4f619",
"score": "0.68932885",
"text": "def role\n self.roles_mask = 0 if self.roles_mask < 0 || self.roles_mask >= ROLES.count\n self.roles_mask ? ROLES[self.roles_mask].to_sym : guest\n end",
"title": ""
},
{
"docid": "4b8d99b222043be76dc8e52a0da4f619",
"score": "0.68932885",
"text": "def role\n self.roles_mask = 0 if self.roles_mask < 0 || self.roles_mask >= ROLES.count\n self.roles_mask ? ROLES[self.roles_mask].to_sym : guest\n end",
"title": ""
},
{
"docid": "440be4a1a1767b4f5252e6377fee690e",
"score": "0.6836304",
"text": "def role\n p = pool\n case\n when !@master then :master # nodes that aren't slaves (including orphans) \n when p.master == self then :master # nodes that the topology thinks are masters\n when for_backups? then :backup_slave\n when p && p.active_slave_weights[self] then :active_slave # if pool in topology, determine based on expected/ideal state\n when !p && !is_standby? then :active_slave # if pool missing from topology, determine based on actual state\n else :standby_slave\n end\n end",
"title": ""
},
{
"docid": "b1cbbd7ca21787be2255fe507ee92acb",
"score": "0.6819881",
"text": "def role\n @role\n end",
"title": ""
},
{
"docid": "83855f1b718e472ad772be58fde33faa",
"score": "0.6772327",
"text": "def role\n admin? ? :admin : :default\n end",
"title": ""
},
{
"docid": "c04826f3f7591c1a6afca389272a1861",
"score": "0.67661864",
"text": "def role\n roles.first\n end",
"title": ""
},
{
"docid": "c04826f3f7591c1a6afca389272a1861",
"score": "0.67661864",
"text": "def role\n roles.first\n end",
"title": ""
},
{
"docid": "c04826f3f7591c1a6afca389272a1861",
"score": "0.67661864",
"text": "def role\n roles.first\n end",
"title": ""
},
{
"docid": "59d2017f0eb665515a3ac77b0487391e",
"score": "0.67650735",
"text": "def current_role\n admin_user.role.to_sym\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.6751776",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.6751776",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.6751776",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "b476296169399b86d0140c213f22f2c3",
"score": "0.6751776",
"text": "def role\n return @role\n end",
"title": ""
},
{
"docid": "d100312c8e14aa3db7eba61bc6e1ae21",
"score": "0.6746378",
"text": "def role\n\t\t\t\t\t\tself.current_role\n\t\t\t\t\tend",
"title": ""
},
{
"docid": "d100312c8e14aa3db7eba61bc6e1ae21",
"score": "0.6746378",
"text": "def role\n\t\t\t\t\t\tself.current_role\n\t\t\t\t\tend",
"title": ""
},
{
"docid": "7348ef978d9bd92f3c2dd3e0ad016fa1",
"score": "0.6732377",
"text": "def current_role\n self.roles[0].to_string\n end",
"title": ""
},
{
"docid": "257efd053fa2483723ef44d8d29d6736",
"score": "0.6730601",
"text": "def current_role\n self.roles[0].toString\n end",
"title": ""
},
{
"docid": "19c252946f789471c56157ed93e010f2",
"score": "0.67127156",
"text": "def role\n @roles.find { |r| r!='DEFAULT' }\n end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6712634",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6712634",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6712634",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6712634",
"text": "def role; end",
"title": ""
},
{
"docid": "720fa5370d0bbe5d4f9363f8396f1a78",
"score": "0.6712634",
"text": "def role; end",
"title": ""
},
{
"docid": "3ca9b9dfb2650e3af66fec1fc8d677f0",
"score": "0.6707144",
"text": "def role_kind\n self.class.name.split('::')[-1].underscore\n end",
"title": ""
},
{
"docid": "4f408feea99641bdab45ecf92ce1c9aa",
"score": "0.67033386",
"text": "def role\n roles.first.name.to_sym if roles.present?\n end",
"title": ""
},
{
"docid": "5e5d348b6ffb8299deb86235dbfeb28b",
"score": "0.670192",
"text": "def role\n self[:role].to_sym\n end",
"title": ""
},
{
"docid": "0f2a04aa7bab1d13f4186b96b123e880",
"score": "0.66861224",
"text": "def role\n if !instance_variable_defined?(:@role)\n @role = user.role\n end\n return @role\n end",
"title": ""
},
{
"docid": "56e8743b0fedc6813996dea7e3226d18",
"score": "0.6662078",
"text": "def role\n user.role\n end",
"title": ""
},
{
"docid": "9ae4d5a173d0960f2cf98c18268a8116",
"score": "0.6633152",
"text": "def role\n\t\tif(self.admin?) \n\t\t\treturn \"Administrador\"\n\t\telse\n\t\t\treturn \"Digitador\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c22d57be8a5541624f7f79b3f37e5d3d",
"score": "0.66192",
"text": "def getRole\r\n\t\t\t\t\treturn @role\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "c22d57be8a5541624f7f79b3f37e5d3d",
"score": "0.66192",
"text": "def getRole\r\n\t\t\t\t\treturn @role\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "c22d57be8a5541624f7f79b3f37e5d3d",
"score": "0.66192",
"text": "def getRole\r\n\t\t\t\t\treturn @role\r\n\t\t\t\tend",
"title": ""
},
{
"docid": "01e4f874539704ed5291ca0467786141",
"score": "0.66162866",
"text": "def role\n ::Installation::SystemRole.find(\"cc_role\")\n end",
"title": ""
},
{
"docid": "e1a893aef5d6113c15f352022660c148",
"score": "0.66056633",
"text": "def current_role\n case current_user.role\n when 'advertiser'\n current_user.advertiser\n when 'influencer'\n current_user.influencer\n when 'affiliate'\n current_user.affiliate\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f1eff991dc0328815421d7fdebfdb968",
"score": "0.65867937",
"text": "def virtual_role\n \treturn \"Admin\" if name == 'Admin'\n \treturn \"Manager\" if name == 'Manager'\n \treturn \"SuperVisor\" if name == 'Employee'\n end",
"title": ""
},
{
"docid": "b458fb1fd678c1e4d2ca85775c899915",
"score": "0.65704286",
"text": "def role\n\t\tunless self.employee.nil?\n\t\t\treturn self.employee.role\n\t\telse\n\t\t\treturn \"guest\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7e90656e380e008c8dede794144ccea0",
"score": "0.6551342",
"text": "def role\n read_attribute(:role).to_sym\n end",
"title": ""
},
{
"docid": "991e088d9255f4eaf9a297c6c2407d03",
"score": "0.65484244",
"text": "def role\n :member\n end",
"title": ""
},
{
"docid": "5d8fe8095f060726c2757ec14d1addf3",
"score": "0.6531073",
"text": "def role\n if self.approved? then\n r = super\n else\n r = Role.find_by_name('client')\n end\n return r\n end",
"title": ""
},
{
"docid": "913eb98fd7fee0520eec47e59a6c2c95",
"score": "0.6520563",
"text": "def main_role\n if self.is_super_admin?\n return 'super_admin'\n elsif self.is_admin?\n return 'admin'\n elsif self.is_operator?\n return 'operator'\n elsif self.is_halouser?\n return 'halouser'\n elsif self.is_caregiver?\n return 'caregiver'\n end\n return ''\n end",
"title": ""
},
{
"docid": "5f5330f47e3d24ce5914de263ba9a4f3",
"score": "0.6515352",
"text": "def role\n the_role = self.read_attribute(:role)\n if the_role \n the_role.to_sym\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "4f9b38b5c8de232d683b201cb8f2c36a",
"score": "0.6515019",
"text": "def type\n self[:role]\n end",
"title": ""
},
{
"docid": "72b96d9cd3c7126486926b774b8a5189",
"score": "0.65043014",
"text": "def role\n ''\n end",
"title": ""
},
{
"docid": "3bca52d3c6e312ce1701c8e7b3cd849c",
"score": "0.6481505",
"text": "def role\n return if user?.blank? || provider?\n\n @current_user.role.to_s\n end",
"title": ""
},
{
"docid": "4bc759fbec0b65f1c75c207dc531f6ef",
"score": "0.6480574",
"text": "def role\n\t\tr = Role.find(@user.role_id)\n\t\treturn r\n\tend",
"title": ""
},
{
"docid": "276cb0f813f7f5eff75396cc09c2d5b4",
"score": "0.647334",
"text": "def role(state=:proposed)\n unless self.actual.nil?\n snap = case state\n when :active\n self.deployment.active || self.deploymnent.proposed\n when :committed\n self.deployment.committed || self.deploymnent.active\n else\n self.deployment.proposed || self.deploymnent.active\n end\n role_type = self.role_type\n Role.find_by_role_type_id_and_snapshot_id role_type.id, snap.id if role_type\n end\n end",
"title": ""
},
{
"docid": "d968ef081cbf94cdec1aff324dc23bf1",
"score": "0.64677155",
"text": "def current_domain_role\n domain = current_domain\n return 'admin' if object.has_role?(:admin, domain)\n return 'guest' if object.guest_of?(domain)\n return 'power' if object.power_of?(domain)\n\n 'member'\n end",
"title": ""
},
{
"docid": "daa3ddd4484a04f30b7d98015041fe4e",
"score": "0.6462027",
"text": "def role role_name\n run_list << \"role[#{role_name}]\"\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end",
"title": ""
},
{
"docid": "daa3ddd4484a04f30b7d98015041fe4e",
"score": "0.6462027",
"text": "def role role_name\n run_list << \"role[#{role_name}]\"\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end",
"title": ""
},
{
"docid": "8f1198a46c31bd45810d93eeb63daeb9",
"score": "0.64544785",
"text": "def role(type)\n role = 'Employer' if type == 'Employer'\n role = 'Job Seeker' if type == 'Member'\n role = 'Administrator' if type == 'Admin'\n return role\n end",
"title": ""
},
{
"docid": "a8950174ccaab5a812012b8d2b24ab90",
"score": "0.6447006",
"text": "def current_user_role\n\t\treturn self.role \n\tend",
"title": ""
},
{
"docid": "c0dae085dbcf27ccfb7373fb6a335442",
"score": "0.6425657",
"text": "def role\n first_role = self.roles.first unless self.roles.nil?\n if (first_role.nil?)\n return \"(none)\"\n else\n return first_role.name\n end\n end",
"title": ""
},
{
"docid": "d19b1275934c888d24c328f85c0d92d0",
"score": "0.64174116",
"text": "def role(prefs)\n\tcurrent_role = prefs[@name]\n\treturn STANDALONE unless current_role\n\n\tcase\n\twhen current_role.casecmp(DOMAIN) == 0\n\t return DOMAIN\n\twhen current_role.casecmp(ADS) == 0\n\t return ADS\n\twhen current_role.casecmp(PDC) == 0\n\t return PDC\n\twhen current_role.casecmp(BDC) == 0\n\t return BDC\n\telse\n\t return STANDALONE\n\tend\n end",
"title": ""
},
{
"docid": "a512f3f47b698950c229d24a7814801e",
"score": "0.6417134",
"text": "def role\n self[:celluloid_role]\n end",
"title": ""
},
{
"docid": "b5e5798fb0bd180a4c0cd91fb13159df",
"score": "0.6413348",
"text": "def role\n if task.subclass_name == \"event\"\n return :guest\n else\n return :manager\n end\n end",
"title": ""
},
{
"docid": "be8b49965ac5d20180416e5729581a37",
"score": "0.6390595",
"text": "def role\n ActiveSupport::StringInquirer.new(self[:role]) if self[:role]\n end",
"title": ""
},
{
"docid": "a43490ca34811e0118226bd5066c8e1b",
"score": "0.6378767",
"text": "def role role_name\n run_list << \"role[#{role_name}]\"\n run_list.uniq!\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end",
"title": ""
},
{
"docid": "6ad41b1de92f653cf75291fe77b9bd6c",
"score": "0.63687056",
"text": "def role\n r=roles.first\n return r.nil? ? nil : r.name\n end",
"title": ""
},
{
"docid": "cd2059741ea9be7bdff07d1a6c0dcca1",
"score": "0.63556206",
"text": "def role\n case level\n when LEVEL_SUPER_ADMIN then 'Super Admin'\n when LEVEL_ADMIN then 'Admin'\n when LEVEL_MODERATOR then 'Moderator'\n when LEVEL_CRM then 'CRM'\n else 'User'\n end\n end",
"title": ""
},
{
"docid": "4e101a1f09337f279f710556fa355e2f",
"score": "0.6347314",
"text": "def role(type)\n ENUM[:roles].each {|role| return role if role[:name].downcase.to_sym == type }\n end",
"title": ""
},
{
"docid": "6975f4882dae637280b0d2d228f8cbcb",
"score": "0.63290006",
"text": "def symbolic_role\n ROLES.invert[self[:role]]\n end",
"title": ""
},
{
"docid": "c6968c220bc21357cbf8178bff626f88",
"score": "0.6327422",
"text": "def builtin_role\n @builtin_role ||= Role.anonymous\n end",
"title": ""
},
{
"docid": "b83655374608949ed2a2e90ed30e0910",
"score": "0.6322293",
"text": "def get_role_name\n length = self.roles.to_s.length\n if length == 7\n role = \"user\"\n else if length == 19\n role = \"moderator\"\n else\n role = \"admin\"\n end\n end\n end",
"title": ""
},
{
"docid": "baa1eb4bdf66e0e2e19ed862c1f8339a",
"score": "0.6305122",
"text": "def _auth_role_class\n self.class._auth_role_class_name.constantize\n end",
"title": ""
},
{
"docid": "848fc2a589a96f204fe63cee51cabe49",
"score": "0.6301197",
"text": "def admin_role\n @admin ||= Role.where(name: 'Admin').first\n end",
"title": ""
},
{
"docid": "a06722710bef964f8eeadec5b7f6b3e2",
"score": "0.6287321",
"text": "def roles \n \n # Stash away the db the user is currently connected to ( aka which company )\n connection_spec = self.connection.instance_variable_get \"@config\"\n # Connect to the master db so you can get the user's roles.\n ActiveRecord::Base.establish_connection(ENV[\"RAILS_ENV\"])\n @myroles = User.find(self.id).roles \n # Switch back to original company db\n ActiveRecord::Base.establish_connection( connection_spec )\n\n return @myroles\n end",
"title": ""
},
{
"docid": "947794fbe1c4e10159c7026f197b3509",
"score": "0.62751144",
"text": "def normal_admin_role\n 'normal_admin'\n end",
"title": ""
},
{
"docid": "18e9f62d0aa3b3927754468135282c54",
"score": "0.6272311",
"text": "def role?\n true\n end",
"title": ""
},
{
"docid": "141e870e74a43562a9102d8fe2981464",
"score": "0.62692577",
"text": "def roleName\n case role\n when 1\n return \"Admin\"\n when 2\n return \"Editor\"\n when 3 \n return \"Viewer\"\n end\n end",
"title": ""
},
{
"docid": "7bd020af2b6ab13433ab1ee033cb9317",
"score": "0.62688714",
"text": "def get_instance_role\n url = URI.parse('http://169.254.169.254/latest/meta-data/iam/security-credentials/')\n response = Net::HTTP.get_response(url)\n\n return {} if response.code != \"200\"\n\n body = response.body\n\n role = body.lines.first\n response = Net::HTTP::get_response(url+role)\n\n return {} if response.code != \"200\"\n\n role = parse_json_object(response.body)\nend",
"title": ""
},
{
"docid": "c5f0a241cd4cbf1cf2092ff0f6e1d29f",
"score": "0.62677497",
"text": "def master?; role_is?(:master); end",
"title": ""
},
{
"docid": "ce50b9181810458c7721e46aba8ec61d",
"score": "0.6257018",
"text": "def get_role(site)\n @_user_role ||= site.user_roles.where(slug: self.role).first\n end",
"title": ""
},
{
"docid": "4c05874ac6b91e43fc38fba685169502",
"score": "0.6255041",
"text": "def user_role\n return @user_role\n end",
"title": ""
},
{
"docid": "4c05874ac6b91e43fc38fba685169502",
"score": "0.6255041",
"text": "def user_role\n return @user_role\n end",
"title": ""
},
{
"docid": "148b73782fbc182462a57c6e2d41e548",
"score": "0.6247661",
"text": "def role_type\n return User.role_type_from_string(self.role)\n end",
"title": ""
},
{
"docid": "a567c7cc2df6480fb4a978a011e47206",
"score": "0.6242311",
"text": "def active_role\n Role.find(self.active_role_id)\n end",
"title": ""
},
{
"docid": "f4d2501fec6db33d772bdfbf927b5f56",
"score": "0.62277853",
"text": "def role\n template.dig('Metadata', 'Role')\n end",
"title": ""
},
{
"docid": "9706ec097217669065c373fe1b7ab5df",
"score": "0.6218516",
"text": "def app_roles\n return @app_roles\n end",
"title": ""
},
{
"docid": "1f0f4b40d457d68b72595a2b547b4a72",
"score": "0.62143475",
"text": "def admin_role\n return 'Admin' if admin?\n return 'Gig Admin' if gig_admin?\n end",
"title": ""
},
{
"docid": "dd47fd34ddf2c520ee5fc44d3747f006",
"score": "0.6180925",
"text": "def team_role\n TEAM_ROLE[role]\n end",
"title": ""
},
{
"docid": "07ede7e58765a74c5da52957a2c9c7c2",
"score": "0.61800647",
"text": "def ui_role\n user.uiRole\n end",
"title": ""
},
{
"docid": "110a45090a0d50fe098db8b9eca5851b",
"score": "0.6180034",
"text": "def role\n Employee.find(self.employee_id).role\n end",
"title": ""
},
{
"docid": "0973e43094644ccdc1125679ed5f11e2",
"score": "0.617693",
"text": "def role\n return Role.find(:first, :conditions => {:id => (RolesPerson.find(:first, :conditions => {:person_id => self.id})).role_id}).name\n end",
"title": ""
},
{
"docid": "0cabbfd59fb9d8886e9957e2c383ac42",
"score": "0.6175463",
"text": "def entity_class\n \"#{role.name.capitalize}\".constantize\n end",
"title": ""
},
{
"docid": "16672bb0b8eb9033575730c1fc951f49",
"score": "0.61703897",
"text": "def valid_roles\n [:master, :active_slave, :standby_slave, :backup_slave]\n end",
"title": ""
},
{
"docid": "d9e42f3ec31c361d331521f21f9ce3d5",
"score": "0.6169621",
"text": "def app_role_id\n return @app_role_id\n end",
"title": ""
},
{
"docid": "21bb7d5289ea6fc3a1ec2aeddfc873fa",
"score": "0.61678183",
"text": "def role\n # make an ssh call? decide if the role is already installed?\n false\n end",
"title": ""
},
{
"docid": "a663167980ea8dc3164c5a75e21daf11",
"score": "0.6164394",
"text": "def my_role member\n uri = self.uri\n query = Ruta::Sparql.select.where(\n [uri, RRDF::FOAF.member, :mir],\n [:mir, Ruta::Property.has_member, member.uri],\n [:mir, Ruta::Property.has_role, :role]\n )\n role = nil\n query.each_solution { |sol| role = sol.role.as(Role) }\n role\n end",
"title": ""
},
{
"docid": "c31434f12fe700ba75e206c8e2cb91fe",
"score": "0.61508995",
"text": "def server_role(event, role_name)\n\t\tevent.server.roles.select { |role| role.name.downcase == role_name.downcase }.first\n\tend",
"title": ""
},
{
"docid": "dc6939d16eebca2dcb5872e6765cb37a",
"score": "0.6146353",
"text": "def role\n # ssh into the instance to see if puppet is already installed\n # TODO eventually, this should also check the version\n begin\n results = run_remote_puppet_script('check_puppet_version')\n rescue Puppet::Error => e\n return nil\n end\n version = results['stdout'].split(\"\\n\").last.strip\n Puppet.info(\"Puppet version #{version} is currently installed\")\n version\n end",
"title": ""
},
{
"docid": "6794b6cc07a9c5c93d87b84b2f45a230",
"score": "0.61407053",
"text": "def my_role member\n uri = self.uri\n query = Ruta::Sparql.select.where(\n [uri, RDF::FOAF.member, :mir],\n [:mir, Ruta::Property.has_member, member.uri],\n [:mir, Ruta::Property.has_role, :role]\n )\n role = nil\n query.each_solution { |sol| role = sol.role.as(Role) }\n role\n end",
"title": ""
}
] |
a503bb01d49a3218316b2f212cb71991
|
Load our values from the file(s) specified during creation, in order, respecting the :secure option to only load safe settings files if so specified.
|
[
{
"docid": "94e6bb58fc1bbf2fb0d7589972a8a45f",
"score": "0.0",
"text": "def load\n super\n @paths.each {|p| load_file(p) }\n end",
"title": ""
}
] |
[
{
"docid": "51191d3ddd7a503b8b2eca6b9c27e306",
"score": "0.6583093",
"text": "def load_settings(settings)\n\t\t@credentials = JSON.load(File.read(settings[:credentials_filename])) \n\t\t@config = JSON.load(File.read(settings[:config_filename]), nil, symbolize_names: true)\n\tend",
"title": ""
},
{
"docid": "9065a5e1b470868cef47249741157b5a",
"score": "0.6505202",
"text": "def load_file(file, required_keys)\n file_path = settings_files[file]\n res = YAML.load_file(file_path) || {}\n unless required_keys.all? { |k| res.keys.include?(k) }\n security_fail \"File #{settings_files[file]} does not contain all the required settings: #{required_keys.join(', ')}. Please fix!\"\n end\n # stringify keys and values for security reasons\n stringify(res)\nend",
"title": ""
},
{
"docid": "e1b8adc1aa1fbd0e8a52fbfcec001753",
"score": "0.62063897",
"text": "def load_settings(fname, use_envs=true)\n conf = YAML.load_file(fname)\n if use_envs\n conf[env.to_s].each {|k,v| set k.to_sym, v }\n else\n conf.each {|k,v| set k.to_sym, v }\n end\n end",
"title": ""
},
{
"docid": "c90a0c3469e83564288d9968a93e6efc",
"score": "0.6162974",
"text": "def load_settings(fname)\n conf = YAML.load_file(fname)\n conf[env.to_s].each {|k,v| send(k.to_sym, v) }\n end",
"title": ""
},
{
"docid": "df395381b8023fdaa4e3a85f31f64cd9",
"score": "0.613828",
"text": "def load_settings ( file )\n return YAML.load_file( @lewt_stash + file )\n end",
"title": ""
},
{
"docid": "6d69992d731039cdd868a87b896d4b16",
"score": "0.61331624",
"text": "def initialize(options = {})\n @raise_noprofile = options[:raise_on_no_profile] || false\n raw = load_from_file(real_files(cred_files(options)),\n options[:profile] || 'default')\n\n populate(env_override(raw))\n end",
"title": ""
},
{
"docid": "3bfbb7705df28be320a38e6a2314688f",
"score": "0.61026525",
"text": "def load_settings(file)\n dir = File.dirname(File.expand_path(__FILE__))\n if !File.exist?(\"#{dir}/provider/#{file}.yml\")\n FileUtils.cp(\"#{dir}/provider/example.#{file}.yml\", \"#{dir}/provider/#{file}.yml\") \n if !File.exist?(\"#{dir}/provider/#{file}.yml\")\n raise \"Settings file not found! Please copy provider/example.#{file}.yml to vagrant/#{file}.yml and try again.\"\n end\n end\n YAML.load_file \"#{dir}/provider/#{file}.yml\"\nend",
"title": ""
},
{
"docid": "5f93f87d748242494bf7a1e365bb0f94",
"score": "0.60890245",
"text": "def settings\n return @settings if @loaded_from_file\n\n @loaded_from_file = true\n return @settings if file.nil?\n\n parse_file(file) do |key, parsed_setting|\n # Create a settings chain if a setting already exists\n parsed_setting.previous_setting = @settings[key] unless @settings[key].nil?\n @settings[key] = parsed_setting\n end\n @settings\n end",
"title": ""
},
{
"docid": "1659ce054221d0a5d9c47e29dd8864c4",
"score": "0.6065967",
"text": "def verify_file_security(path)\n # Not requiring security? File doesn't exist? Then everything is fine...\n return unless (File.exists?(path) && @secure)\n \n # Root can read all files, useful for backups and of course no security lost\n return if Process.uid == 0\n \n # Check file ownership\n stat = File::Stat.new(path)\n raise RuntimeError.new(\"Cannot load settings file #{path} - file must be owned by the user this program is running as (UID #{Process.uid})\") unless stat.owned?\n raise RuntimeError.new(\"Cannot load settings file #{path} - file cannot be world-writable\") if stat.world_writable?\n end",
"title": ""
},
{
"docid": "7921d732324791dc8ad6de4665beb8a4",
"score": "0.6057861",
"text": "def load_settings\n end",
"title": ""
},
{
"docid": "cca788131ae90b31613a2542d56162f6",
"score": "0.60520375",
"text": "def load_creds!\n @creds ||= load_file[cred_key].tap do |creds|\n raise NoCredsFound, \"#{cred_key} not found in #{config_file}\" if !creds\n end\n end",
"title": ""
},
{
"docid": "5b8b3fbbb315189c4c0d78a1f55fa8d1",
"score": "0.6038599",
"text": "def load\n @settings = {}\n @settings[:env] = LocationSettings.from_environment\n @settings[:user] = Files.load(@user_path, location: :user)\n @settings[:project] = Files.load(@project_path, location: :project)\n @settings[:runtime] = LocationSettings.runtime(@runtime)\n end",
"title": ""
},
{
"docid": "ea2fee5dea0379f8a4b37397ac3e3779",
"score": "0.60264236",
"text": "def load_config!\n options = load_file\n options.each do |k, v|\n config_key_setter = \"#{k}=\".to_sym\n self.public_send(config_key_setter, v) if respond_to?(config_key_setter)\n end\n end",
"title": ""
},
{
"docid": "fb73f73675f9b323bec834a041e2590e",
"score": "0.60153854",
"text": "def credentials\n YAML.load_file(CONFIG_FILE)\n end",
"title": ""
},
{
"docid": "8513f44374bc1c357337efb99aff5132",
"score": "0.60135645",
"text": "def settings\n @settings ||= file ? YAML.load_file(file) : {}\n end",
"title": ""
},
{
"docid": "2fb7973d5caa6edaae9a7d8a33fc89d5",
"score": "0.6013408",
"text": "def load(filename, options = {})\n newsets = SafeYAML.load_file(filename).deep_symbolize\n newsets = newsets[options[:env].to_sym] if \\\n options[:env] && \\\n newsets[options[:env].to_sym]\n deep_merge(@_settings, newsets)\n end",
"title": ""
},
{
"docid": "5411280effe642f5ba2dd4ed9dfd762f",
"score": "0.6010443",
"text": "def load_settings(file)\n dir = File.dirname(File.expand_path(__FILE__))\n if !File.exist?(\"#{dir}/vagrant/#{file}.yml\")\n FileUtils.cp(\"#{dir}/vagrant/example.#{file}.yml\", \"#{dir}/vagrant/#{file}.yml\")\n if !File.exist?(\"#{dir}/vagrant/#{file}.yml\")\n raise \"Settings file not found! Please copy vagrant/example.#{file}.yml to vagrant/#{file}.yml and try again.\"\n end\n end\n YAML.load_file \"#{dir}/vagrant/#{file}.yml\"\nend",
"title": ""
},
{
"docid": "b2e21362c98f9de9ded2c5b5ead8e72e",
"score": "0.59982485",
"text": "def load_settings\n # if there is a logged in user, we load settings saved in DB\n if current_user\n @setting = Setting.load_for_mission(current_mission)\n\n # otherwise we just spin up a dummy default setting obj and don't save it\n else\n @setting = Setting.load_default\n end\n end",
"title": ""
},
{
"docid": "471731afedaf0df37c01b9cf1e1c80e0",
"score": "0.59847766",
"text": "def initialize(options = {})\n raw = load_from_file(cred_files(options), options[:profile] ||\n 'default')\n populate(env_override(raw))\n end",
"title": ""
},
{
"docid": "2304298daf7a24bff93ec9627388e17b",
"score": "0.59675056",
"text": "def read_settings_from_file\n JSON.parse(File.open('./settings.json').read)\n end",
"title": ""
},
{
"docid": "c1f92910d86e4d46b7ce8e2488229e32",
"score": "0.5964988",
"text": "def load!(filename, options = {})\n newsets = Psych.load_file(filename).deep_symbolize\n\n newsets = newsets[options[:env].to_sym] if options[:env] && newsets[options[:env].to_sym]\n\n deep_merge!(@_settings, newsets)\n\n # define an accessor method for each top-level key\n @_settings.each do |k, v|\n define_method(k) do\n v\n end\n end\n end",
"title": ""
},
{
"docid": "37bcd52c301bd67727541840a750c3f7",
"score": "0.5936498",
"text": "def load_file\n if File.exists?(config_file)\n parse_file\n else\n raise NoCredsFound, bad_config_file(\"#{config_file} does not exist.\")\n end\n end",
"title": ""
},
{
"docid": "d66b26b0c60dc1523c7f7326a535b7dc",
"score": "0.59164584",
"text": "def load_credentials\n return YAML.load(File.read(credentials_file))\n end",
"title": ""
},
{
"docid": "f0c156484316749daa34740dfd647a11",
"score": "0.58973193",
"text": "def load\r\n settings = YAML.load_file(SETTINGS_PATH)\r\n debug \"loaded settings\"\r\n settings\r\n end",
"title": ""
},
{
"docid": "c3634fc2a4782da66b9831399e4cf584",
"score": "0.588059",
"text": "def credentials\n return @credentials if @credentials\n\n Rails.env.development? ? load_from_secrets : load_from_settings\n end",
"title": ""
},
{
"docid": "d24ea68d9df08a631ec4e3a38de7222e",
"score": "0.5880216",
"text": "def load\n @settings = Serializer.deserialize(Constants::CONFIG_PATH)\n end",
"title": ""
},
{
"docid": "32b2dd3557b2bed501aa30005421263b",
"score": "0.5839134",
"text": "def credentials\n Psych.load_file(File.expand_path('../users.yml', data_path))\nend",
"title": ""
},
{
"docid": "c3a4cd52183b562f1f9745398de74a59",
"score": "0.58302414",
"text": "def read_settings\n @settings = YAML::load_file \"#{@gem_root}/settings.yml\"\n end",
"title": ""
},
{
"docid": "79db629dad1ffc3e429135961cbc8d18",
"score": "0.5829673",
"text": "def initialize\n file = \"#{Rails.root}/config/settings.yml\"\n env_file = \"#{Rails.root}/config/settings_#{Rails.env}.yml\"\n @config = {}\n if File.exist? file\n base_cfg = YAML.load File.read(file)\n @config.deep_merge! base_cfg if base_cfg.kind_of? Hash\n end\n if File.exist? env_file\n env_cfg = YAML.load File.read(env_file)\n @config.deep_merge! env_cfg if env_cfg.kind_of? Hash\n end\n end",
"title": ""
},
{
"docid": "48d4b626e6bb219fe2191cbd480ddc57",
"score": "0.58179903",
"text": "def load_settings\n @expected_conf = YAML.load_file(@expected_conf_file)\n @actual_conf = YAML.load_file(@actual_conf_file)\n end",
"title": ""
},
{
"docid": "012b3938370856da49ad291265c93b9f",
"score": "0.5785806",
"text": "def load\n reset\n\n if ::File.exist?(@name)\n @content = YAML.load_file(@name)\n end\n rescue StandardError => e\n OneCfg::LOG.error(\"Can't load settings from '#{@name}' \" \\\n \"due to '#{e.message}'\")\n raise\n end",
"title": ""
},
{
"docid": "a881e66d578dc9f2351ff85fe2550e8d",
"score": "0.5784745",
"text": "def load_settings_from_all_domains(file_name)\n settings = {}\n if File.exists?(\"#{I3::SITE_PATH}/config/#{file_name}\")\n settings.merge!(YAML.load(File.new(\"#{I3::SITE_PATH}/config/#{file_name}\")))\n end #if\n if File.exists?(\"#{I3::LOCAL_PATH}/config/#{file_name}\")\n settings.merge!(YAML.load(File.new(\"#{I3::LOCAL_PATH}/config/#{file_name}\")))\n end #if\n settings\n end",
"title": ""
},
{
"docid": "6c8485da71c228d1478ddb6e487e5bbe",
"score": "0.5781935",
"text": "def load_settings()\n saved_settings_data = nil\n if File.exists?(\"#{SAVED_SETTINGS_FILENAME}\")\n File.open(\"#{SAVED_SETTINGS_FILENAME}\") do |file|\n saved_settings_data = Marshal.load(file)\n end \n else\n puts \"Didn't find settings savedata\"\n end\n \n if saved_settings_data\n $settings = saved_settings_data\n else\n puts 'Unable to load settings save file'\n return\n end\n \n puts 'Loaded saved settings data'\nend",
"title": ""
},
{
"docid": "e15960fe8d048ab88caddc9b52bce9da",
"score": "0.5777159",
"text": "def load!(filename, options = {})\n if !@loaded\n newsets = YAML::load_file(filename)\n newsets.deep_symbolize_keys!\n newsets = newsets[options[:env].to_sym] if \\\n options[:env] && \\\n newsets[options[:env].to_sym]\n deep_merge!(@_settings, newsets)\n loaded = true\n end\n end",
"title": ""
},
{
"docid": "b835773b0bf47c54e4b813f7ef61ae18",
"score": "0.57605857",
"text": "def read_settings\n\t\t\t\tread = nil\n\t\t\t\tif File.exist?(Growl_yaml)\n\t\t\t\t\tldconfig = YAML.load_file(\"#{Growl_yaml}\")\n\t\t\t\t\t@host\t = ldconfig['host']\n\t\t\t\t\t@password = ldconfig['password']\n\t\t\t\t\t@source = ldconfig['source']\n\t\t\t\t\t@sticky = ldconfig['sticky']\n\n\t\t\t\t\tread = true\n\t\t\t\telse\n\t\t\t\t\tprint_error(\"You must create a YAML File with the options\")\n\t\t\t\t\tprint_error(\"as: #{Growl_yaml}\")\n\t\t\t\t\treturn read\n\t\t\t\tend\n\t\t\t\treturn read\n\t\t\tend",
"title": ""
},
{
"docid": "8c96fc38bdc8b3ae2d8f887b3beb391b",
"score": "0.575535",
"text": "def load_beagle_settings(settings_file, verbose=false, debug=false)\n #\n # has a nil value been passed?\n # i.e., the LORIS_SETTINGS_FILE env var has not been set\n if ( settings_file.nil? ) then\n puts sprintf(\"\\n*** Error: Loris environmental variable [LORIS_SETTINGS_FILE] has not been set\")\n exit\n end\n\n # file exists?\n if ( !File.exists?(settings_file) or !File.file?(settings_file) ) then\n puts sprintf(\"\\n*** Error: Loris settings file [%s] is not readable.\", settings_file)\n exit\n end\n\n # OK, so file is readable.\n settings = Hash.new\n File.readlines(settings_file).each { |line|\n line = line.strip\n #\n # skip this line if a comment or if it's empty\n if ( line[0,1] == \"#\" or line.empty? ) then next end\n #\n var,val = line.chomp.split(\"=\")\n\n # strip the double-quotes from all input strings\n # ... these are needed for R to know that they're to be read\n # ... as strings, but it messes up Ruby, who includes the\n # ... double-quotes within the strings themselves\n val = val.delete '\"'\n #\n settings[var] = val\n puts(sprintf(\"Debug: setting %s ---> %s\", var, val)) if debug\n }\n nSettings = settings.length\n\n # have we read the correct number of settings?\n if ( settings['NBR_SETTINGS'].nil? or settings['NBR_SETTINGS'].to_i != nSettings ) then\n puts sprintf(\"*** Error: Loris settings file [%s] does not have the correct number of settings.\", settings_file)\n puts sprintf(\"*** Expected: %d\", settings['NBR_SETTINGS'].to_i)\n puts sprintf(\"*** Read: %d\", nSettings)\n exit\n end\n\n # settings file is structurally valid. Let's look at it (if desired) ...\n if ( verbose ) then\n puts sprintf(\"\\n*** Loris settings in file: %s \", settings_file)\n #\n # loop over all settings\n settings.each { |key, value|\n puts sprintf(\"*** SETTING: %s VALUE: %s\", key, value)\n }\n end\n\n return settings\nend",
"title": ""
},
{
"docid": "80c8cc54e0f48f7a93584bc93fa0438f",
"score": "0.5748069",
"text": "def load\n return unless configFile.file.exists?\n load_values_from_xml(File.read(configFile.file.canonicalPath))\n end",
"title": ""
},
{
"docid": "ca2bc6ac4f7339a0e918a5d20f2f36c1",
"score": "0.57370746",
"text": "def load_user_credentials\n credentials_path = user_path\n YAML.load_file(credentials_path)\nend",
"title": ""
},
{
"docid": "24c12fc3f7a1b4dae0a238b54ba66d48",
"score": "0.5726001",
"text": "def load_settings\n @allocation_precision = AppSetting.allocation_precision\n @current_fiscal_year = AppSetting.current_fiscal_year\n @fiscal_years = FiscalYear.active_fiscal_years\n @fte_hours_per_week = AppSetting.fte_hours_per_week\n @logo = AppSetting.logo\n @open_login = AppSetting.open_login\n @rest_api_key = AppSetting.rest_api_key\n end",
"title": ""
},
{
"docid": "a743890da437df3ed9ba6746f44ba934",
"score": "0.56986386",
"text": "def initialize(settings_file)\n yaml = File.read settings_file\n \n # Replace environment variables in the settings.\n yaml.gsub!(/([A-Z][A-Z0-9_]+)/) do |env|\n ENV[env] || env\n end\n \n @settings = YAML::load yaml\n end",
"title": ""
},
{
"docid": "18e4c74b933e6fe0f97cb8658fe9eee3",
"score": "0.56888163",
"text": "def initialize(opts = {})\n @path = (opts[:path] && File.expand_path(opts[:path])) || \"/etc/opscode/private-chef-secrets.json\"\n\n import_existing = File.exists?(path) && (File.size(path) != 0)\n legacy = true\n\n if import_existing\n begin\n hash = JSON.parse(IO.read(path), symbolize_names: true)\n rescue JSON::ParserError, Errno::ENOENT => e\n raise InvalidCredentialCollectionFile.new(\"#{path} is not a valid credentials file:\\n #{e.message}\")\n end\n\n if hash.key?(:veil) && hash[:veil][:type] == \"Veil::CredentialCollection::ChefSecretsFile\"\n opts = Veil::Utils.symbolize_keys(hash[:veil]).merge(opts)\n legacy = false\n end\n end\n\n @user = opts[:user]\n @group = opts[:group] || @user\n opts[:version] = CURRENT_VERSION\n super(opts)\n\n import_credentials_hash(hash) if import_existing && legacy\n end",
"title": ""
},
{
"docid": "5fbf21218666b06b1736606176dd7a9b",
"score": "0.5680719",
"text": "def load_settings\n settings.load(project_root + \"/settings.rb\")\n settings[:additional_load_paths].reverse.each { add_load_path(path) }\n end",
"title": ""
},
{
"docid": "0e71a1189934ef2263cd6a571f411fd3",
"score": "0.5674271",
"text": "def autosign_store(file)\n auth = Puppet::Network::AuthStore.new\n File.readlines(file).each do |line|\n next if line =~ /^\\s*#/\n next if line =~ /^\\s*$/\n auth.allow(line.chomp)\n end\n\n auth\n end",
"title": ""
},
{
"docid": "8c1af2da4029a74d2e1f46f45ae6c75c",
"score": "0.5673595",
"text": "def parse_config_file(path)\n return unless File.exists?(path)\n \n conf = YAML::load(ERB.new(IO.read(path)).result)[Rails.env]\n \n conf.each do |key,value|\n self.send(\"#{key}=\", value) if self.respond_to?(\"#{key}=\")\n end unless conf.nil?\n end",
"title": ""
},
{
"docid": "d1f0fa339e0c96973ecb1bce9926574f",
"score": "0.5672657",
"text": "def load\n # TODO: turn into some sort of lazy lookup\n config = {\n 'db' => {\n 'password' => @settings.try(:db).try(:password) || self.db_password,\n 'host' => @settings.try(:db).try(:host) || self.service(:db).target,\n }\n }\n if config[:redis]\n config['redis'] = {\n 'url' => @settings.try(:redis).try(:url) || \"redis://#{self.service(:redis).target}:#{self.service(:redis).port}\"\n }\n end\n config\n end",
"title": ""
},
{
"docid": "ede47dd447ba18481bb083ee73707bdd",
"score": "0.5670149",
"text": "def load_cfg\n map = YAML.safe_load(File.open(yaml_path, 'w+'))\n @gitlab_host = map['gitlab_host']\n @gitlab_private_token = map['gitlab_private_token']\n end",
"title": ""
},
{
"docid": "57eed5d9c00e6108e9cedbba0e06c4d3",
"score": "0.56528735",
"text": "def load_from_file\n if File.file?(CONF_FILE)\n @attributes.merge!(YAML.load_file(CONF_FILE))\n end\n end",
"title": ""
},
{
"docid": "186ada2f0eb994da5b50f50d0a1c9378",
"score": "0.56494033",
"text": "def secrets\n @secrets ||= if File.exist?(secrets_path)\n info \"Loading existing secrets from #{secrets_path}\"\n YAML.load_file(secrets_path)\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "33c03f6a3076930e71feff7f37367d73",
"score": "0.56416667",
"text": "def load!(filename, options = {})\n newsets = YAML::load_file(filename)\n newsets.extend Marsys::Settings::DeepSymbolizable\n newsets = newsets.deep_symbolize\n newsets = newsets[options[:env].to_sym] if \\\n options[:env] && \\\n newsets[options[:env].to_sym]\n deep_merge!(@_settings, newsets)\n end",
"title": ""
},
{
"docid": "3aac092aee06fe3e4a80b736246445a1",
"score": "0.5641054",
"text": "def load_or_initialize_site_keys\n case\n when defined? REST_AUTH_SITE_KEY\n if (options[:old_passwords]) && ((! REST_AUTH_SITE_KEY.blank?) || (REST_AUTH_DIGEST_STRETCHES != 1))\n raise \"You have a site key, but --old-passwords will overwrite it. If this is really what you want, move the file #{site_keys_file} and re-run.\"\n end\n $rest_auth_site_key_from_generator = REST_AUTH_SITE_KEY\n $rest_auth_digest_stretches_from_generator = REST_AUTH_DIGEST_STRETCHES\n when options[:old_passwords]\n $rest_auth_site_key_from_generator = nil\n $rest_auth_digest_stretches_from_generator = 1\n $rest_auth_keys_are_new = true\n else\n $rest_auth_site_key_from_generator = make_token\n $rest_auth_digest_stretches_from_generator = 10\n $rest_auth_keys_are_new = true\n end\n # template 'config/initializers/site_keys.rb', \"config/initializers/#{controller_file_name}_site_keys.rb\"\n template 'config/initializers/site_keys.rb'\n end",
"title": ""
},
{
"docid": "5ed957230539a553f548f2f08e268b80",
"score": "0.5636936",
"text": "def load_account_details(file_name)\n @options = YAML.load_file(file_name)\n end",
"title": ""
},
{
"docid": "ac500c81c9932e76d3d2abc85fe8fa0d",
"score": "0.5630553",
"text": "def load_config\n config = YAML::load_file(@config_file)\n @host = config[\"host\"] || @host\n @user_name = config[\"user_name\"] || @user_name\n @password = config[\"password\"] || @password\n @path = config[\"path\"] || @path\n end",
"title": ""
},
{
"docid": "1822b50d296f2c7d1786c24ad3b53cab",
"score": "0.56298876",
"text": "def load_database_settings\n database_settings_file = \"config/database.yml\"\n valid_file?(database_settings_file) ? YAML::load_file(database_settings_file) : {}\n end",
"title": ""
},
{
"docid": "a2a43d678cacac2e5f03fd0cbf844a8d",
"score": "0.56282234",
"text": "def load_creds\n load_creds! rescue nil\n end",
"title": ""
},
{
"docid": "41b742af2a1a3ddbeff76d18c301d4fe",
"score": "0.5615871",
"text": "def load_settings\n home_dir = File.expand_path '~/.config'\n install_dir = File.expand_path File.dirname(__FILE__)\n cfg_file = 'acrodict.conf'\n return YAML::load_file(\"#{home_dir}/#{cfg_file}\") if File.exists? \"#{home_dir}/#{cfg_file}\"\n return YAML::load_file(\"#{install_dir}/#{cfg_file}\")\nend",
"title": ""
},
{
"docid": "ef4d2f930c31a4bea6cd0f87fcc00844",
"score": "0.561371",
"text": "def settings_files\n @settings_files || settings_files_map_and_check!\nend",
"title": ""
},
{
"docid": "ada75d042756675d200a07c087abce23",
"score": "0.55884284",
"text": "def load_config\n config = {}\n File.open('/data/seafile-app/conf/seafile.conf', 'r') do |fd|\n fd.each_line do |l|\n case l.strip!\n when /^password/; config['key'] = l.split('=')[1].strip\n when /^user/; config['dbuser'] = l.split('=')[1].strip\n when /^host/; config['host'] = l.split('=')[1].strip\n when /^port/; config['port'] = l.split('=')[1].strip\n when /^db_name/; config['db'] = l.split('=')[1].strip\n end\n end\n end\n @config = WIKK::Configuration.new(config)\nend",
"title": ""
},
{
"docid": "d38ca0ba05a1a72c9b137294d62d5695",
"score": "0.55780977",
"text": "def populate\n data = ERB.new(File.read(AUTH_FILE), nil, '<>').result(binding)\n\n @static_auth.load!(StringIO.new(data))\n end",
"title": ""
},
{
"docid": "ce6e93a19d95606d2ef08c9a71b12666",
"score": "0.55707335",
"text": "def load_lewt_settings \n @lewt_settings = load_settings( \"settings.yml\")\n # Start by loading the local config files\n @customers = load_settings(\"customers.yml\")\n @enterprise = load_settings(\"enterprise.yml\")\n end",
"title": ""
},
{
"docid": "6ba7d15861912779df4ae45365490e96",
"score": "0.5567986",
"text": "def load_user_settings\n if (exists = File.exist? USER_SETTINGS_PATH)\n require \"dotenv\"\n Dotenv.overload USER_SETTINGS_PATH\n end\n exists\n end",
"title": ""
},
{
"docid": "690ab2536e0ccd2a4e6860c705c54cb7",
"score": "0.55665994",
"text": "def load_settings(filepath)\n if File.file?(filepath)\n settings = YAML.load(ERB.new(File.read(filepath)).result)\n\n if settings['GLOBAL'].nil?\n $stderr.puts 'Settings file found but missing GLOBAL section.'\n $logger.error \"Aggie Bot could not start because #{filepath} does not have a GLOBAL section. See example.\"\n return nil\n end\n\n $logger.info \"Settings loaded from #{filepath}.\"\n else\n $logger.error \"Aggie Bot could not start because #{filepath} does not exist. See example.\"\n return nil\n end\n\n return settings\nend",
"title": ""
},
{
"docid": "499e2e0099a5fa93774de2e13cdf8413",
"score": "0.555778",
"text": "def settings\n begin\n settings ||= YAML.load_file File.absolute_path Nark.settings_path\n rescue\n {}\n end\n end",
"title": ""
},
{
"docid": "4a049c7d6be3bdae01e69d045ed8b642",
"score": "0.55552346",
"text": "def load_overrides\n if ENV['PARAMS_FILE'] && ENV['PARAMS_FILE'] != ''\n if File.readable?(ENV['PARAMS_FILE'])\n project_root = self.instance_variable_get(\"@project_root\")\n packaging_root = self.instance_variable_get(\"@packaging_root\")\n self.config_from_yaml(ENV['PARAMS_FILE'])\n self.instance_variable_set(\"@project_root\", project_root) if project_root\n self.instance_variable_set(\"@packaging_root\", packaging_root) if packaging_root\n else\n fail \"PARAMS_FILE was set, but not to the path to a readable file.\"\n end\n end\n end",
"title": ""
},
{
"docid": "8749b4f9a9790e9ecae86cc47bb498ad",
"score": "0.55401117",
"text": "def load_config_file(file_name)\n if (File.file?(file_name))\n prop_file = File.open(file_name)\n #go through each line and add it to the Settings array\n prop_file.readlines.each do |line|\n line.strip!\n \n #if it's not a comment \n if (line[0] != ?# and line[0] != ?=)\n i = line.index('=')\n if (i)\n Settings[line[0..i - 1].strip] = line[i + 1..-1].strip\n else\n Settings[line] = ''\n end\n end\n end\n prop_file.close\n end\nend",
"title": ""
},
{
"docid": "c96db93775ddb3fa758d72d6437b5fd5",
"score": "0.55373454",
"text": "def load\n @preferences = load_from_file || {}\n end",
"title": ""
},
{
"docid": "b445ffb6b75d218e5c2f564cc7bdebba",
"score": "0.5536228",
"text": "def load\n path = \"/vault/secrets\"\n Find.find(path) { |f| f.include?(\"yml\") && Envyable.load(f, Rails.env) } if File.exists?(path)\n end",
"title": ""
},
{
"docid": "4fb83c58c29f41756160cca59417c03d",
"score": "0.5531752",
"text": "def load_settings(options={})\n @settings = Settings.get(options)\n log_concerns(@settings.warnings)\n failures = @settings.validate\n unless failures.empty?\n @logger.fatal(\"invalid settings\")\n log_concerns(failures, :fatal)\n @logger.fatal(\"SENSU NOT RUNNING!\")\n exit 2\n end\n end",
"title": ""
},
{
"docid": "fab73b3ca8c76ad26c9f4a67cf98f8ff",
"score": "0.55301625",
"text": "def load\n if config_file\n full_path = full_path(config_dir, config_file)\n load_file(full_path)\n else\n load_dir(config_dir)\n end\n settings\n end",
"title": ""
},
{
"docid": "608d1988c384e169bc67e4745e25709e",
"score": "0.5527903",
"text": "def load_config\n if File.exist?(@options.config_file)\n store = YAML::Store.new(@options.config_file)\n store.transaction do\n @trello_token = store['trello_token']\n @trello_app_key = store['trello_app_key']\n @trello_app_secret = store['trello_app_secret']\n @pivotal_tracker_api_key = store['privotal_tracker_api_key']\n end\n end\n\n # Pull in defaults from the environment\n @trello_token = ENV['TRELLO_TOKEN'] if @trello_token.blank?\n @trello_app_key = ENV['TRELLO_APP_KEY'] if @trello_api_key.blank?\n @trello_app_secret = ENV['TRELLO_APP_SECRET'] if @trello_app_secret.blank?\n @pivotal_tracker_api_key = ENV['PIVOTAL_TRACKER_API_KEY'] if @pivotal_tracker_api_key.blank?\n end",
"title": ""
},
{
"docid": "abae1cef7e31d7727bb39c0d9b61deb7",
"score": "0.5525571",
"text": "def set_key_file(opts)\n opts = check_params(opts,[:keys])\n super(opts)\n end",
"title": ""
},
{
"docid": "491418c3cf0ea6967a889ce5e989014d",
"score": "0.55160475",
"text": "def load_config\n settings_file = File.open(\"./config/u_settings.txt\",\"r\")\n config = settings_file.readlines()\n\n @u_db_address = config[0].split(\":\")[1].chomp\n @u_db_config_address = config[1].split(\":\")[1].chomp\n settings_file.close\n end",
"title": ""
},
{
"docid": "90983edab02f879b4e7b70cabbaa32ec",
"score": "0.55070764",
"text": "def settings\n @settings ||= begin\n FileUtils.mkdir_p(File.dirname(settings_path))\n unless File.exists?(settings_path)\n File.open(settings_path, \"w\") do |file|\n file << {}.to_yaml\n end\n end\n FileUtils.chmod 0600, settings_path\n Settingslogic.new(settings_path)\n end\n end",
"title": ""
},
{
"docid": "3bee6d9054e0e817f9a027e9296f96d2",
"score": "0.5502798",
"text": "def load_or_initialize_site_keys\n case\n when defined? REST_AUTH_SITE_KEY\n if (options[:old_passwords]) && ((! REST_AUTH_SITE_KEY.blank?) || (REST_AUTH_DIGEST_STRETCHES != 1))\n raise \"You have a site key, but --old-passwords will overwrite it. If this is really what you want, move the file #{site_keys_file} and re-run.\"\n end\n $rest_auth_site_key_from_generator = REST_AUTH_SITE_KEY\n $rest_auth_digest_stretches_from_generator = REST_AUTH_DIGEST_STRETCHES\n when options[:old_passwords]\n $rest_auth_site_key_from_generator = nil\n $rest_auth_digest_stretches_from_generator = 1\n $rest_auth_keys_are_new = true\n else\n $rest_auth_site_key_from_generator = make_token\n $rest_auth_digest_stretches_from_generator = 10\n $rest_auth_keys_are_new = true\n end\n end",
"title": ""
},
{
"docid": "3bee6d9054e0e817f9a027e9296f96d2",
"score": "0.5502798",
"text": "def load_or_initialize_site_keys\n case\n when defined? REST_AUTH_SITE_KEY\n if (options[:old_passwords]) && ((! REST_AUTH_SITE_KEY.blank?) || (REST_AUTH_DIGEST_STRETCHES != 1))\n raise \"You have a site key, but --old-passwords will overwrite it. If this is really what you want, move the file #{site_keys_file} and re-run.\"\n end\n $rest_auth_site_key_from_generator = REST_AUTH_SITE_KEY\n $rest_auth_digest_stretches_from_generator = REST_AUTH_DIGEST_STRETCHES\n when options[:old_passwords]\n $rest_auth_site_key_from_generator = nil\n $rest_auth_digest_stretches_from_generator = 1\n $rest_auth_keys_are_new = true\n else\n $rest_auth_site_key_from_generator = make_token\n $rest_auth_digest_stretches_from_generator = 10\n $rest_auth_keys_are_new = true\n end\n end",
"title": ""
},
{
"docid": "aea3708b0cd3fd3cb20b2bd40bc0be46",
"score": "0.5498808",
"text": "def load_or_initialize_site_keys\r\n case\r\n when defined? REST_AUTH_SITE_KEY\r\n if (options.old_passwords?) && ((! REST_AUTH_SITE_KEY.blank?) || (REST_AUTH_DIGEST_STRETCHES != 1))\r\n raise \"You have a site key, but --old-passwords will overwrite it. If this is really what you want, move the file #{site_keys_file} and re-run.\"\r\n end\r\n $rest_auth_site_key_from_generator = REST_AUTH_SITE_KEY\r\n $rest_auth_digest_stretches_from_generator = REST_AUTH_DIGEST_STRETCHES\r\n when options.old_passwords?\r\n $rest_auth_site_key_from_generator = nil\r\n $rest_auth_digest_stretches_from_generator = 1\r\n $rest_auth_keys_are_new = true\r\n else\r\n $rest_auth_site_key_from_generator = make_token\r\n $rest_auth_digest_stretches_from_generator = 10\r\n $rest_auth_keys_are_new = true\r\n end\r\n end",
"title": ""
},
{
"docid": "04fa58f1f309de75a191e32f1675971c",
"score": "0.54918087",
"text": "def load()\n\n if File.file?(SETTINGS_FILE) == false\n puts \"No settings file found, creating one now\"\n # Settings file doesn't exist\n # Create it\n @targets = {}\n @active_target = nil\n @src = './src'\n\n dump_settings\n else\n settings = YAML.load_file(SETTINGS_FILE)\n @targets = settings[:targets]\n @src = settings[:src]\n end\n\n # Set the default target\n @targets.values.each do |target|\n # Check if this one is active\n if target.active == true\n # Set it if there is no default target set yet\n if @active_target == nil\n @active_target = target\n else\n puts \"Two active targets set. Using #{@active_target.print}\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9d468b411ec62b2628e1a728322cdf27",
"score": "0.54843193",
"text": "def _load_secrets\n AutomateCluster::Secrets.from_file(config.secrets_key_file, config.secrets_store_file)\n # Make sure to filter out any secrets from the logs\n logger.filter(secrets.map { |k,v| v })\n end",
"title": ""
},
{
"docid": "64792f86c186b419a2b0b46167b0f7c4",
"score": "0.547934",
"text": "def load_from_file!\n config_file = Utils.find_file_upward(*CONFIG_FILES)\n\n unless config_file\n raise NoConfigurationFileFoundError\n end\n\n yaml = YAML.load_file(config_file)\n yaml_dir = File.dirname(config_file)\n\n _base_path = yaml.delete('base_path')\n self.base_path = _base_path ? File.absolute_path(_base_path, yaml_dir) : yaml_dir\n\n _stats_path = yaml.delete('stats_path')\n self.stats_path = File.absolute_path(_stats_path, yaml_dir) if _stats_path\n\n yaml.each do |k, v|\n if self.respond_to?(\"#{k}=\")\n self.send(\"#{k}=\", v)\n else\n raise InvalidOptionError.new(k)\n end\n end\n end",
"title": ""
},
{
"docid": "c32556f2e0fd44e2ae099773ebff7952",
"score": "0.5477007",
"text": "def load_config!\n @user = YAML.load(File.read('spec/config/user.yml'))\n @user.each do |key, val|\n ZerigoDNS.config.send(\"#{key}=\", val)\n end\n end",
"title": ""
},
{
"docid": "e89b923ddafccbddff809980c7146bcf",
"score": "0.54769534",
"text": "def secure(value = nil)\n rw_config(:secure, value, true)\n end",
"title": ""
},
{
"docid": "148118c54d5d81beb04ad3d11d6f74eb",
"score": "0.54750234",
"text": "def initialize(file_path)\n site_config = symbolize_keys(YAML.load_file(file_path))\n assign_attributes(site_config)\n end",
"title": ""
},
{
"docid": "956d039bd2b80742377c955ad416da03",
"score": "0.54592687",
"text": "def secure=(secure); end",
"title": ""
},
{
"docid": "3c0b1252a773db86904a5a3f0b09284e",
"score": "0.54557556",
"text": "def load_settings(path)\n if File.file?(path)\n settings = YAML.load_file(path)\n\n if settings[\"GLOBAL\"] == nil\n $stderr.puts \"Settings file found but missing GLOBAL section. Cannot proceed.\"\n $logger.error \"DSS ChatBot could not start because #{path} does not have a GLOBAL section. See config/settings.example.yml.\"\n return nil\n end\n\n $logger.info \"Settings loaded.\"\n else\n $stderr.puts \"You need to set up #{path} before running this script.\"\n $logger.error \"DSS ChatBot could not start because #{path} does not exist. See config/settings.example.yml.\"\n return nil\n end\n\n return settings\nend",
"title": ""
},
{
"docid": "f68564f2a44d30667cb4c195dc037d88",
"score": "0.54545045",
"text": "def load_settings\n %w(user password database skip_tables additional_options).each do |attribute|\n send(:\"#{attribute}=\", procedure.get_adapter_configuration.attributes[attribute])\n end\n \n %w(host port socket).each do |attribute|\n send(:\"#{attribute}=\", procedure.get_adapter_configuration.get_options.attributes[attribute])\n end\n end",
"title": ""
},
{
"docid": "7cd6131f19fadae13b5e0e0f227befb5",
"score": "0.5453926",
"text": "def load\n read_file.each_pair do |key,value|\n send(\"#{key.to_s}=\",value) if self.methods.include?(\"#{key.to_s}=\")\n end\n return self\n end",
"title": ""
},
{
"docid": "171c154347b74545fd3859e608f85f92",
"score": "0.54519516",
"text": "def load_or_create\r\n if File.exist?(@file)\r\n @config= {}\r\n File.open @file, \"r\" do |input|\r\n YAML.load_documents(erb_render(input.read)) do |doc|\r\n @config.merge! doc\r\n end\r\n end\r\n @logger.info format(INFO_LOADED_CONFIG, @file)\r\n else\r\n @config = {\r\n \"store\" => DEFAULT_STORE,\r\n \"drb\" => DEFAULT_DRB\r\n }\r\n save\r\n @logger.info format(INFO_CREATED_CONFIG, @file)\r\n end\r\n end",
"title": ""
},
{
"docid": "a6a91392034e236c882836544406e111",
"score": "0.545028",
"text": "def initialize\n ensure_cache_exists\n load_settings\n end",
"title": ""
},
{
"docid": "85dee0b55e0e3effbd2cca818d79f9ce",
"score": "0.5444008",
"text": "def unsafe_parse(file)\n return unless FileTest.exist?(file)\n begin\n data = parse_file(file)\n rescue => details\n puts details.backtrace if Puppet[:trace]\n Puppet.err \"Could not parse #{file}: #{details}\"\n return\n end\n\n unsafe_clear(true)\n\n metas = {}\n data.each do |area, values|\n metas[area] = values.delete(:_meta)\n values.each do |key,value|\n set_value(key, value, area, :dont_trigger_handles => true, :ignore_bad_settings => true )\n end\n end\n\n # Determine our environment, if we have one.\n if @config[:environment]\n env = self.value(:environment).to_sym\n else\n env = \"none\"\n end\n\n # Call any hooks we should be calling.\n settings_with_hooks.each do |setting|\n each_source(env) do |source|\n if value = @values[source][setting.name]\n # We still have to use value to retrieve the value, since\n # we want the fully interpolated value, not $vardir/lib or whatever.\n # This results in extra work, but so few of the settings\n # will have associated hooks that it ends up being less work this\n # way overall.\n setting.handle(self.value(setting.name, env))\n break\n end\n end\n end\n\n # We have to do it in the reverse of the search path,\n # because multiple sections could set the same value\n # and I'm too lazy to only set the metadata once.\n searchpath.reverse.each do |source|\n source = run_mode if source == :run_mode\n source = @name if (@name && source == :name)\n if meta = metas[source]\n set_metadata(meta)\n end\n end\n end",
"title": ""
},
{
"docid": "049af8ea27bf51680fec866bf7bc7d9e",
"score": "0.54439193",
"text": "def load_settings\n self.trigger = procedure.trigger\n \n %w(user password database skip_tables additional_options).each do |attribute|\n send(:\"#{attribute}=\", procedure.get_adapter_configuration.attributes[attribute])\n end\n \n %w(host port socket).each do |attribute|\n send(:\"#{attribute}=\", procedure.get_adapter_configuration.get_options.attributes[attribute])\n end\n\n self.dumped_file = \"#{timestamp}.#{trigger.gsub(' ', '-')}.sql\" \n self.compressed_file = \"#{dumped_file}.gz\"\n self.encrypted_file = \"#{compressed_file}.enc\"\n self.final_file = compressed_file\n end",
"title": ""
},
{
"docid": "a009ea7f8726921f52feeac70e143125",
"score": "0.5441495",
"text": "def load\n def read_erb(erb)\n ERB.new(File.read(erb), 0, '%<>')\n end\n\n # YAML.safe_load is prefered\n # rubocop:disable Security/YAMLLoad\n if centralized?\n if !cached?\n if fetch\n erb = read_erb(cached_file)\n else\n # There was a problem fetching the config. Just use an empty string.\n # Warning message will come from #fetch\n erb = ERB.new('')\n end\n else\n erb = read_erb(cached_file)\n end\n\n @values = (YAML.load(erb.result) || {})\n else\n if File.extname(path) == '.erb'\n erb = read_erb(path)\n @values = (YAML.load(erb.result) || {})\n else\n @values = (YAML.load_file(path) || {})\n end\n end\n # rubocop:enable Security/YAMLLoad\n\n unless @values.is_a?(Hash)\n puts red(\"Origen: Site Config: The config at #{path} was not parsed as a Hash, but as a #{@values.class}\")\n puts red(' Please review the format of the this file.')\n puts red(' Alternatively, an error condition may have been received from the server.')\n puts red(\" This site config is available at: #{cached_file}\")\n puts red(' This config will not be loaded and will be replaced with an empty config.')\n puts\n @values = {}\n end\n\n if centralized?\n # check for restricted centralized config values\n RESTRICTED_FROM_CENTRALIZED_VARIABLES.each do |var|\n if @values.key?(var)\n val = @values.delete(var)\n puts red(\"Origen: Site Config: config variable #{var} is not allowed in the centralized site config and will be removed.\")\n puts red(\" Value #{val} will not be applied!\")\n end\n end\n end\n\n @loaded = true\n @values\n end",
"title": ""
},
{
"docid": "d3608dcbecf67f301edbcf82ecbba536",
"score": "0.54406005",
"text": "def load(file)\n raise Thoth::Error, \"Config file not found: #{file}\" unless File.file?(file)\n\n @live = {\n 'db' => \"sqlite:///#{HOME_DIR}/db/live.db\",\n\n 'site' => {\n 'name' => \"New Thoth Blog\",\n 'desc' => \"Thoth is awesome.\",\n 'url' => \"http://localhost:7000/\",\n\n 'core_js' => [\n 'http://yui.yahooapis.com/2.8.0/build/yahoo-dom-event/yahoo-dom-event.js',\n '/js/thoth.js'\n ],\n\n 'css' => [],\n 'js' => [],\n\n 'enable_comments' => true,\n 'enable_sitemap' => true,\n\n 'gravatar' => {\n 'enabled' => true,\n 'default' => \"identicon\",\n 'rating' => \"g\",\n 'size' => 32\n }\n },\n\n 'admin' => {\n 'name' => \"John Doe\",\n 'email' => \"\",\n 'user' => \"thoth\",\n 'pass' => \"thoth\",\n 'seed' => \"6d552ac197a862b82b85868d6c245feb\"\n },\n\n 'plugins' => [],\n\n 'media' => File.join(HOME_DIR, 'media'),\n\n 'server' => {\n 'adapter' => 'webrick',\n 'address' => '0.0.0.0',\n 'port' => 7000,\n 'enable_cache' => true,\n 'enable_minify' => true,\n 'error_log' => File.join(HOME_DIR, 'log', 'error.log'),\n\n 'memcache' => {\n 'enabled' => false,\n 'servers' => ['localhost:11211:1']\n }\n },\n\n 'timestamp' => {\n 'long' => \"%A %B %d, %Y @ %I:%M %p (%Z)\",\n 'short' => \"%Y-%m-%d %I:%M\"\n }\n }\n\n @dev = {\n 'db' => \"sqlite:///#{HOME_DIR}/db/dev.db\",\n\n 'server' => {\n 'enable_cache' => false,\n 'enable_minify' => false\n }\n }\n\n begin\n config = YAML.load(Erubis::Eruby.new(File.read(file)).result(binding)) || {}\n rescue => e\n raise Thoth::ConfigError, \"Config error in #{file}: #{e}\"\n end\n\n @lookup ||= if Thoth.trait[:mode] == :production\n [config['live'] || {}, @live]\n else\n [config['dev'] || {}, config['live'] || {}, @dev, @live]\n end\n\n cache_config\n end",
"title": ""
},
{
"docid": "72b17291e0702292a536bb4a61a614e8",
"score": "0.5437424",
"text": "def load_credentials\n oauth2_data = User::Oauth2Data.get(@uid, @app_id)\n return nil if oauth2_data.empty?\n credentials = CredentialStore.settings_of @app_id\n credentials.merge! oauth2_data\n # Infer times\n unless credentials[:expires_in] && credentials[:issued_at]\n credentials[:expires_in] = 3600\n expiration_time = credentials[:expiration_time].to_i\n credentials[:issued_at] = Time.at(expiration_time - 3600)\n end\n credentials\n end",
"title": ""
},
{
"docid": "89b3ffac6f8b9567a5da6b7b31736778",
"score": "0.5435649",
"text": "def load_opts\n o = @redis.hgetall(\"DismalTony:RedisStore:opts\").clone\n o.transform_keys!(&:to_sym)\n o.transform_values! { |v| Psych.load(v) }\n o[:env_vars]&.each_pair { |key, val| ENV[key.to_s] = val }\n @opts = o\n end",
"title": ""
},
{
"docid": "da60268f2f5cd4c07eef023ed1d7831d",
"score": "0.5431262",
"text": "def reload_settings\n @settings_values.load\n true\n end",
"title": ""
},
{
"docid": "3c2f44e299803b2189ffd03cccabe7a5",
"score": "0.5429381",
"text": "def load_settings\n # Default\n $settings = {}\n $settings['sound'] = 0.3\n $settings['music'] = 0.1\n $settings['robot'] = 0.7\n end",
"title": ""
},
{
"docid": "1ab728b7d0e3f6db7f899fa9de4ceec7",
"score": "0.5423564",
"text": "def initialize\n @config_file_path = File.join(DEFAULT_SETTINGS[:data_directory], CONFIG_FILENAME)\n\n begin\n read_settings\n raise InvalidConfigurationError unless DEFAULT_SETTING_KEYS <= @settings.keys.to_set\n rescue Errno::ENOENT, InvalidConfigurationError => ex\n FileUtils.mv @config_file_path, \"#{@config_file_path}.old\" if File.exist? @config_file_path\n write_settings true\n end\n end",
"title": ""
},
{
"docid": "584726e976ad469699d2fbec1065ae98",
"score": "0.54190236",
"text": "def load(key, *dig_keys, **options)\n super\n secret_file = Dir.glob(File.join(secret_mount_directory(**options), \"**\", key)).first\n return if secret_file.nil? || !File.exist?(secret_file)\n\n File.read(secret_file)\n end",
"title": ""
},
{
"docid": "5ce08fb048cbb1ec66a23c0945e37f9a",
"score": "0.54064566",
"text": "def credential_file(file=nil)\n unless file.nil?\n dsl_options[:credential_file]=file\n dsl_options.merge!(Ec2.load_keys_from_credential_file(file))\n else\n fetch(:credential_file)\n end\n end",
"title": ""
},
{
"docid": "c7f8f3ffce965bbd6e631caa63fed7a0",
"score": "0.54059887",
"text": "def load(file)\n @options[:config_files] ||= []\n @options[:config_files] << file\n end",
"title": ""
},
{
"docid": "5360c1c6fc8987068d3ca99e82129e6d",
"score": "0.54049784",
"text": "def loadConfig\n config = YAML.load_file('config.yml')\n \n # server related options\n @host = config['default']['host']\n @port = config['default']['port']\n \n # user related options\n @login = config['default']['login']\n @password = config['default']['password']\n @location = config['default']['location']\n end",
"title": ""
},
{
"docid": "7608e2e1ca95f27b846548b0ebdd3338",
"score": "0.54048854",
"text": "def read_config( file_path = nil )\n config_file = file_path || default_config_file\n @config = YAML.load( File.read( config_file ) )\n rescue Errno::ENOENT\n @needs_setup = true\n db_path = File.expand_path('../../tmp/tmp_db.sqlite3', __FILE__)\n\n @config = {\n 'database' => {\n 'production' => db_path,\n 'test' => db_path,\n 'development' => db_path\n }\n }\n end",
"title": ""
}
] |
35462e1ebc99ffd5f9a1aa0f568edc8f
|
GET /folder2s/1 GET /folder2s/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "615e7ee407b642a2a6d85bc787c5c696",
"score": "0.6977759",
"text": "def index\n @folder2s = Folder2.all\n end",
"title": ""
},
{
"docid": "c2d79da5ac66ffaaa1b7526d4a5b1dea",
"score": "0.66519",
"text": "def set_folder2\n @folder2 = Folder2.find(params[:id])\n end",
"title": ""
},
{
"docid": "b5fd2727df6f95619c4e1de872263e3b",
"score": "0.62574786",
"text": "def show\n @folder = Folder.includes(:subfolders).find(params[:id])\n\n # See if there is a better way to add filenames at a later date\n render json: @folder.as_json(include: :subfolders).merge(\n { filenames: @folder.extract_filenames }\n )\n end",
"title": ""
},
{
"docid": "3b0404e1ea776824d510a6a1bbbd04f0",
"score": "0.6154404",
"text": "def get_folder(folder_id)\n\tputs \"Getting folder: \" + folder_id\n\tresponse = request_get('/api/partner/folder/' + folder_id)\n\tputs response.body\nend",
"title": ""
},
{
"docid": "a2e4b3047a5bd020c80fd15663de593a",
"score": "0.6038664",
"text": "def create\n @folder2 = Folder2.new(folder2_params)\n\n respond_to do |format|\n if @folder2.save\n format.html { redirect_to @folder2, notice: 'Folder2 was successfully created.' }\n format.json { render :show, status: :created, location: @folder2 }\n else\n format.html { render :new }\n format.json { render json: @folder2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f76557c53f8adfe1913b78752ef546d3",
"score": "0.5922764",
"text": "def update\n respond_to do |format|\n if @folder2.update(folder2_params)\n format.html { redirect_to @folder2, notice: 'Folder2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @folder2 }\n else\n format.html { render :edit }\n format.json { render json: @folder2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2e370fc8f08d7b0f2df2aab4b75a9f94",
"score": "0.58706266",
"text": "def show\n @folder = Folder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @folder }\n end\n end",
"title": ""
},
{
"docid": "ebb17e97be0f460358521a586fc4d50a",
"score": "0.5870076",
"text": "def show\n @folder = current_user.folders.find_by_name(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @folder }\n end\n end",
"title": ""
},
{
"docid": "fc4ce145b324740bdadac458aeec9f61",
"score": "0.5754174",
"text": "def get_folder folder_id\n get(\"/projects/#{folder_id}\")\n end",
"title": ""
},
{
"docid": "636b907376cb12e20003c3708a1f5986",
"score": "0.5681725",
"text": "def index\n @folders = Folder.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @folder }\n end\n\n end",
"title": ""
},
{
"docid": "20546ad01609c86cc8bd75d24047a813",
"score": "0.5642714",
"text": "def show\n temp = @folder_client.index(id_parent_folder: get_id)\n @contents = temp[:data]\n temp2 = @folder_client.find(get_id)\n @folder = temp2[:data]\n temp3 = @document_client.index(id_parent_folder: get_id)\n @contents = @contents + temp3[:data]\n @success = temp[:status] and temp2[:status] and temp3[:status]\n end",
"title": ""
},
{
"docid": "0e11bed618faccfced988b47407f3ed1",
"score": "0.56247616",
"text": "def index\n # base_url, token, app_id, app_secret\n temp = @folder_client.index({id_parent_folder: -1})\n @contents = temp[:data]\n temp2 = @document_client.index(id_parent_folder: -1)\n @contents = @contents + temp2[:data]\n @current_folder = Folder.new({name: 'Root'})\n @success = temp[:status] and temp2[:status]\n\n end",
"title": ""
},
{
"docid": "3cb3742a0052155654cb506eb7bfc778",
"score": "0.56071424",
"text": "def folder2_params\n params.require(:folder2).permit(:title, :content)\n end",
"title": ""
},
{
"docid": "43a4eb65fe0b533ba4836a948e7ca3ed",
"score": "0.5568511",
"text": "def get_sub_folder_contents\n # Convert the object received in parameters to a FolderNode object.\n folder_node = (params[:reactParams2][:nodeType]).constantize.new\n params[:reactParams2][:child_nodes].each do |key, value|\n folder_node[key] = value\n end\n\n # Get all of the children in the sub-folder.\n child_nodes = folder_node.get_children(nil, nil, session[:user].id, nil, nil)\n\n # Serialize the contents of each node so it can be displayed on the UI\n contents = []\n child_nodes.each do |node|\n contents.push(serialize_sub_folder_to_json(node))\n end\n respond_to do |format|\n format.html { render json: contents }\n end\n end",
"title": ""
},
{
"docid": "7966511adee1a8d90ffec3b1269c0032",
"score": "0.5557855",
"text": "def destroy\n @folder2.destroy\n respond_to do |format|\n format.html { redirect_to folder2s_url, notice: 'Folder2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f88e6fbb8e0b2d27b0a81de59b937d9e",
"score": "0.5528565",
"text": "def getFolder(response)\r\n\t\t\t\tfolder_json = JSON.parse response\r\n\t\t\t\tfolder_array = folder_json[\"folders\"]\r\n\t\t\t\treturn jsonToFolder(folder_array[0])\r\n\t\t\tend",
"title": ""
},
{
"docid": "3d2ef6f26f281b2a8242c566f148f5d2",
"score": "0.5490877",
"text": "def folder\n connection.directories.get(folder_name)\n end",
"title": ""
},
{
"docid": "470175114d6fa9151b2e9497f8dba3b4",
"score": "0.5471136",
"text": "def show\n @task_folder = TaskFolder.find(params[:id])\n @project = @task_folder.project\n @sub_folders = TaskFolder.find(:all, :conditions => { :parent_id => @task_folder.id })\n\t@tasks = @task_folder.tasks\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @task_folder }\n end\n end",
"title": ""
},
{
"docid": "8d0f0ff51f35f711f2c81cbb1ce87d65",
"score": "0.54708976",
"text": "def index\n @folders = current_user.folders.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @folders }\n end\n end",
"title": ""
},
{
"docid": "270859dfd2a108f5276fa0dd5686c046",
"score": "0.5466828",
"text": "def list(directory: '\\\\', pattern: '*', type: RubySMB::Fscc::FileInformation::FileFullDirectoryInformation)\n find_first_request = RubySMB::SMB1::Packet::Trans2::FindFirst2Request.new\n find_first_request.smb_header.tid = id\n find_first_request.smb_header.flags2.eas = 1\n find_first_request.smb_header.flags2.unicode = 1\n\n search_path = directory.dup\n search_path << '\\\\' unless search_path.end_with?('\\\\')\n search_path << pattern\n search_path = '\\\\' + search_path unless search_path.start_with?('\\\\')\n\n # Set the search parameters\n t2_params = find_first_request.data_block.trans2_parameters\n t2_params.search_attributes.hidden = 1\n t2_params.search_attributes.system = 1\n t2_params.search_attributes.directory = 1\n t2_params.flags.close_eos = 1\n t2_params.flags.resume_keys = 0\n t2_params.information_level = type::SMB1_FLAG\n t2_params.filename = search_path\n t2_params.search_count = 10\n\n find_first_request = set_find_params(find_first_request)\n\n raw_response = client.send_recv(find_first_request)\n response = RubySMB::SMB1::Packet::Trans2::FindFirst2Response.read(raw_response)\n\n results = response.results(type)\n\n eos = response.data_block.trans2_parameters.eos\n sid = response.data_block.trans2_parameters.sid\n last = results.last.file_name\n\n while eos.zero?\n find_next_request = RubySMB::SMB1::Packet::Trans2::FindNext2Request.new\n find_next_request.smb_header.tid = id\n find_next_request.smb_header.flags2.eas = 1\n find_next_request.smb_header.flags2.unicode = 1\n\n t2_params = find_next_request.data_block.trans2_parameters\n t2_params.sid = sid\n t2_params.flags.close_eos = 1\n t2_params.flags.resume_keys = 0\n t2_params.information_level = type::SMB1_FLAG\n t2_params.filename = last\n t2_params.search_count = 10\n\n find_next_request = set_find_params(find_next_request)\n\n raw_response = client.send_recv(find_next_request)\n response = RubySMB::SMB1::Packet::Trans2::FindNext2Response.read(raw_response)\n\n results += response.results(type)\n\n eos = response.data_block.trans2_parameters.eos\n last = results.last.file_name\n end\n\n results\n end",
"title": ""
},
{
"docid": "e1b360d254a6bc899d93c172dc15b60a",
"score": "0.54409426",
"text": "def show\n\t\trespond_to do |format|\n\t\t\tformat.html { }\n\t\t\tformat.json { render :json => {:fallacyfolder => @fallacyfolder}.to_json }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "dbbf360565e12aefafd0a2ff0a08b38f",
"score": "0.54390216",
"text": "def index\n @folders = Folder.accessible_by(current_ability)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @folders }\n end\n end",
"title": ""
},
{
"docid": "f3ab0dcf2fa13f2e9fb719a620a41ad0",
"score": "0.5424138",
"text": "def get_children_folders(folder_id)\n url = URI(\"#{$base_url}/api/projects/#{$project_id}/folders/#{folder_id}/children\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n request = Net::HTTP::Get.new(url)\n request[\"accept\"] = 'application/vnd.api+json; version=1'\n request[\"access-token\"] = $access_token\n request[\"uid\"] = $uid\n request[\"client\"] = $client\n response = http.request(request)\n\n folders_json = ''\n\n if response.code == 200.to_s\n folders_json = JSON.parse(response.read_body)['data']\n else\n puts \"Problem with getting folders. Status: #{response.code}\"\n puts response.body\n end\n folders_json\nend",
"title": ""
},
{
"docid": "6477edf6167e56209bf23438bdc186f0",
"score": "0.54165196",
"text": "def show\n @server1 = Server1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server1 }\n end\n end",
"title": ""
},
{
"docid": "73369a35b46c1fb0d63a9cb891c56396",
"score": "0.5389481",
"text": "def get_specific_folder_contents\n # Get all child nodes associated with a top level folder that the logged in user is authorized\n # to view. Top level folders include Questionaires, Courses, and Assignments.\n folders = {}\n FolderNode.includes(:folder).get.each do |folder_node|\n child_nodes = folder_node.get_children(nil, nil, session[:user].id, nil, nil)\n # Serialize the contents of each node so it can be displayed on the UI\n contents = []\n child_nodes.each do |node|\n contents.push(serialize_folder_to_json(folder_node.get_name, node))\n end\n\n # Store contents according to the root level folder.\n folders[folder_node.get_name] = contents\n end\n\n respond_to do |format|\n format.html { render json: folders }\n end\n end",
"title": ""
},
{
"docid": "f72c2743a42762b2e5bb76e334229226",
"score": "0.53812104",
"text": "def show\n @folder = Folder.find(params[:id])\n end",
"title": ""
},
{
"docid": "1c223e205f087e93e16a00adae73dc70",
"score": "0.537204",
"text": "def multi_from_path(path)\n without_slash = path.gsub(/^\\//, \"\")\n request_object(:get, \"/api/multi/\" + without_slash)\n end",
"title": ""
},
{
"docid": "b4591d2a4d4eea672f523bcc4d86b0e6",
"score": "0.53568256",
"text": "def index\n @trip = Trip.find_by_name(params[:trip_id])\n @folder = @trip.folders.find_by_name(params[:folder_id])\n @descriptions = @folder.descriptions\n if request.headers['X-PJAX']\n render :layout => false\n else\n render :layout => \"folder\"\n end\n end",
"title": ""
},
{
"docid": "172ba45a5ed8d5e5e8b2b09694952c3d",
"score": "0.5282198",
"text": "def index_folder\n @folder = current_user.folders.find params[:folder_id]\n if @folder.present?\n # If feed subscriptions in the folder have not changed, return a 304\n if stale? EtagCalculator.etag(@folder.subscriptions_updated_at),\n last_modified: @folder.subscriptions_updated_at\n @feeds = current_user.folder_feeds @folder, include_read: @include_read\n index_feeds\n end\n else\n Rails.logger.info \"User #{current_user.id} - #{current_user.email} tried to index feeds in folder #{params[:folder_id]} which does not exist or he does not own\"\n head 404\n end\n\n end",
"title": ""
},
{
"docid": "6b5668ab9d01d8a2f7172fac552dcf68",
"score": "0.5223088",
"text": "def show\n @folder = current_user.folders.find(params[:id])\n end",
"title": ""
},
{
"docid": "eecb5b3c3529318904e4ece48101d072",
"score": "0.52182585",
"text": "def get_folder(folder, grafana_options)\n grafana_options[:method] = 'Get'\n grafana_options[:success_msg] = 'Folder deletion was successful.'\n grafana_options[:unknown_code_msg] = 'FolderApi::get_folder_by_uid unchecked response code: %{code}'\n grafana_options[:endpoint] = '/api/folders/' + get_folder_uid(folder)\n\n folder_obj = do_request(grafana_options)\n\n return if folder_obj[:message] == 'Folder not found'\n folder_obj\n end",
"title": ""
},
{
"docid": "401451bfd278d78799ce95ddeeca7958",
"score": "0.52163386",
"text": "def toodle_folder_to_tw(folderid)\n @remote_folders.find{|f| f[:id] == folderid}[:name]\n end",
"title": ""
},
{
"docid": "77cada0eda79a1ef075b07df16fe440f",
"score": "0.52153385",
"text": "def get_folder_contents\n # Get all child nodes associated with a top level folder that the logged in user is authorized\n # to view. Top level folders include Questionaires, Courses, and Assignments.\n folders = {}\n FolderNode.includes(:folder).get.each do |folder_node|\n child_nodes = folder_node.get_children(nil, nil, session[:user].id, nil, nil)\n # Serialize the contents of each node so it can be displayed on the UI\n contents = []\n child_nodes.each do |node|\n contents.push(serialize_folder_to_json(folder_node.get_name, node))\n end\n\n # Store contents according to the root level folder.\n folders[folder_node.get_name] = contents\n end\n\n respond_to do |format|\n format.html { render json: folders }\n end\n end",
"title": ""
},
{
"docid": "2fb7b806e0c3ba0cd70843dacc8a4801",
"score": "0.52095616",
"text": "def new_folder_request(dir_name)\n url = URI(\"#{$base_url}/api/projects/#{$project_id}/folders\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n request = Net::HTTP::Post.new(url)\n request[\"accept\"] = 'application/vnd.api+json; version=1'\n request[\"access-token\"] = $access_token\n request[\"uid\"] = $uid\n request[\"client\"] = $client\n request[\"Content-Type\"] = 'application/json'\n\n data = {\n data: {\n attributes: {\n \"name\": dir_name,\n \"parent-id\": $root_folder_id\n }\n }\n }\n\n request.body = JSON.generate(data)\n response = http.request(request)\n\n id = ''\n\n if response.code == 422.to_s\n id = JSON.parse(response.read_body)['existing_folder_id']\n puts \"Folder already exist. id: #{id}\"\n elsif response.code == 201.to_s\n id = JSON.parse(response.read_body)['data']['id']\n puts \"Folder created. id: #{id}\"\n end\n\n id\nend",
"title": ""
},
{
"docid": "62f91ffda1b59780c89bb1df6e400977",
"score": "0.5173072",
"text": "def get_path2\n\t\tlist_required = params[:list_id]\n\t\tproducts_required = Shoppinglist.get_products_of_shopping_list(list_required)\n\n\t\tnodes_required = []\n\t\tproducts_not_found = []\n\t\tlocations = []\n\n\t\t\n\t\tnodes_required.push( Mapnode.get_id_entrance_point() )\n\t\tproducts_required.each do |product_id|\n\t\t\tresult = Productnode.get_node_of_product(product_id)\n\t\t\tif result != -1\n\t\t\t\tnodes_required.push( result )\n\n\t\t\t\tlocation=Productlocation.get_product_location(product_id)\n\t\t\t\tproduct_name = Product.get_name(product_id)\n\t\t\t\tlocations.push(\"point\" => Point.new(location[0]['X'],location[0]['Y']) , \"name\" => product_name )\n\t\t\telse\n\t\t\t\tproducts_not_found.push(product_id)\n\t\t\tend\n\t\t\t\n\t\tend\n\n\t\tpoints=Tsp.get_path3(nodes_required)\n\t\tresult = { 'path' => points , 'products_not_found' =>products_not_found , 'locations'=>locations }\n\n\t\trender :json => result \n\tend",
"title": ""
},
{
"docid": "3644278b08d2136c80547cf455b10736",
"score": "0.5157382",
"text": "def show\n @album2photo = Album2photo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @album2photo }\n end\n end",
"title": ""
},
{
"docid": "d57524dfe3b56902dc59989380fd452f",
"score": "0.5141385",
"text": "def show\n @step2 = Step2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @step2 }\n end\n end",
"title": ""
},
{
"docid": "22655aea01279bd5c3689121a15b4862",
"score": "0.5140917",
"text": "def index\n @trip = Trip.find_by_name(params[:trip_id])\n @folder = @trip.folders.find_by_name(params[:folder_id])\n @photos = @folder.photos.group_by{ |photo| photo.album }\n if request.headers['X-PJAX']\n render :layout => false\n else\n render :layout => \"folder\"\n end\n end",
"title": ""
},
{
"docid": "1a98f1811790b9b208e8ed7563dee0ff",
"score": "0.5134636",
"text": "def folder_list(command)\n path = '/' + clean_up(command[1] || '')\n resp = @client.files.folder_list(path)\n\n resp.contents.each do |item|\n puts item.path\n end\n end",
"title": ""
},
{
"docid": "c32c269d2535705292a0ca9c9a12185c",
"score": "0.5128786",
"text": "def new\n @folder = Folder.new\n\n @folder.user = @current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @folder }\n end\n end",
"title": ""
},
{
"docid": "dcf00a559492c206db6b0d7e3695ea74",
"score": "0.51184285",
"text": "def browse\n # Get the folders owned/created by the current_user\n @current_folder = current_user.folders.find(params[:folder_id])\n \n if @current_folder\n # Getting the folders which are inside this @current_folder\n @folders = @current_folder.children\n \n # We need to fix this to show files under a specific folder if we are viewing that folder\n @assets = @current_folder.assets.order(\"uploaded_file_file_name desc\")\n \n render :action => \"index\"\n else\n flash[:error] = \"Don't be cheeky! Mind your own folders!\"\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "3b03fe7f324997316ded8751107fdac5",
"score": "0.5116277",
"text": "def team_folder_list(trace: false, &block)\n r = dropbox_query(query: '2/team/team_folder/list', trace: trace)\n r['team_folders'].each(&block)\n while r['has_more']\n r = dropbox_query(query: '2/team/team_folder/list/continue', query_data: \"{\\\"cursor\\\":\\\"#{r['cursor']}\\\"}\", trace: trace)\n r['team_folders'].each(&block)\n end\n end",
"title": ""
},
{
"docid": "3ebf8d627dfc17bf4d98478b576e8a31",
"score": "0.51082",
"text": "def get_team_folder\n\n Team.get_team_folder(self.id)\n end",
"title": ""
},
{
"docid": "e712b199388e4aa0d037d8f5f550fedc",
"score": "0.51073325",
"text": "def show\n if @folder\n @user_files = @folder.user_files\n @folders = @folder.children\n @folder.parent ? @parent = @folder.parent.id : @parent = \"\"\n if (@folder.root.name == \"Dropbox_Root\")\n @service = current_user.services.find_by(name: \"Dropbox\")\n elsif (@folder.root.name == \"Onedrive_Root\")\n @service = current_user.services.find_by(name: \"Onedrive\")\n else\n @service = current_user.services.find_by(name: \"Googledrive\")\n end\n else\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "4064f93d6deb39691788d3d05a1cf774",
"score": "0.5105331",
"text": "def get_folder(folder_id)\n @folders[folder_id]\n end",
"title": ""
},
{
"docid": "4064f93d6deb39691788d3d05a1cf774",
"score": "0.5105331",
"text": "def get_folder(folder_id)\n @folders[folder_id]\n end",
"title": ""
},
{
"docid": "4321811294946e17cf1b97cc8d08ec02",
"score": "0.5102037",
"text": "def ingest_path_info\n respond_to do |format|\n format.json {render json: ingest_directory_info(params[:path])}\n end\n end",
"title": ""
},
{
"docid": "bd06adbf26e15bb9f30b102644e6784f",
"score": "0.50890446",
"text": "def list(folder)\n\t\tc = 0\n\t\tfolder = '/' + folder\t\t\t\n\t\tresp = @client.metadata(folder)\n\t\tputs \"\\n List of contents in \" + folder + \"\\n\"\n\t\tfor item in resp['contents']\t\t\n\t\t\tputs item['path']\n\n\t\t\tc=c+1\n\t\tend\t\n\t\t\n\tend",
"title": ""
},
{
"docid": "927ef82673b2804243e2caf1b06795ca",
"score": "0.5084919",
"text": "def retrieve_docs_from_host2\n apis = {}\n\n host2 = doc_urls[:doc_base2][%r{^https?:\\/\\/[^\\/]+/}]\n open(doc_urls[:doc_base2], Options, &:read).scan(/<li>\\s*<img.+data-src=.+?>\\s*<h2><a href=\"(.+?)\".*?>\\s*(.+?)\\s*<\\/a><\\/h2>\\s*<p>(.+?)<\\/p>\\s*<\\/li>/) do\n api = {'path'=>$1, 'title'=>$2, 'description'=>$3}\n apis[api['title']]['description'] = api['description'] if api['path'] !~ /\\.\\./ && apis.key?(api['title'])\n end\n\n apis\n end",
"title": ""
},
{
"docid": "178dbccfbd37a43dd4384c9bc23468d3",
"score": "0.5071797",
"text": "def show\n @folder = Folder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @folder }\n end\n end",
"title": ""
},
{
"docid": "178dbccfbd37a43dd4384c9bc23468d3",
"score": "0.5071797",
"text": "def show\n @folder = Folder.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @folder }\n end\n end",
"title": ""
},
{
"docid": "a3fa01882e6f7fe052b9c0f883d7f369",
"score": "0.5067159",
"text": "def list\n require_public = ( params[:user].nil? ? false : true )\n user = ( params[:user].nil? ? session[:user] : User.first(id: params[:user]) )\n raise RequestError.new(:bad_params, \"User does not exist\") unless user\n raise RequestError.new(:bad_params, \"Depth not valid\") if params[:depth].to_i < 0\n depth = (params[:depth] ? params[:depth].to_i : -1)\n xfile = ( params[:id].nil? ? user.root_folder : WFolder.get(params[:id]) )\n raise RequestError.new(:internal_error, \"No root directory. Please contact your administrator\") if xfile.nil? && params[:id].nil?\n raise RequestError.new(:folder_not_found, \"File or folder not found\") if xfile.nil?\n if (require_public && params[:id] && session[:user].admin == false) then\n raise RequestError.new(:folder_not_public, \"Folder is not public\") if xfile.folder == true && xfile.public == false\n raise RequestError.new(:folder_not_public, \"File is not public\") if xfile.folder == false && xfile.public == false\n end\n if xfile.folder then\n @result = { folder: crawl_folder(xfile, require_public, depth), success: true }\n else \n @result = { file: xfile.description(session[:user]) , success: true }\n end\n end",
"title": ""
},
{
"docid": "e244d40729eb855cec87206c8e2beedd",
"score": "0.50659585",
"text": "def update\n respond_to do |format|\n if @folder.update(folder_params)\n format.json { render :show, status: :ok, location: @folder }\n else\n format.json { render json: @folder.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "93a1b42fee2fab2f9ee54e4911a613ff",
"score": "0.5063924",
"text": "def index\n @sharedfolders = Sharedfolder.all\n end",
"title": ""
},
{
"docid": "0bd9f14319d49289a51d5841ccbcbc94",
"score": "0.5057802",
"text": "def get_entries(dir, subfolder); end",
"title": ""
},
{
"docid": "49b8286beddf66c2922c274cb6824dda",
"score": "0.50559145",
"text": "def list(path=nil)\n remote_path = list_path(path)\n begin\n folder = @client.folder(remote_path)\n raise Error if folder.nil?\n folder.items.map do |elem|\n {\n name: elem.name,\n path: \"#{remote_path}/#{elem.name}\",\n type: elem.type\n }\n end\n rescue RubyBox::AuthError\n box_error\n end\n end",
"title": ""
},
{
"docid": "43f491b9e6f35afa7f7db617352e69d0",
"score": "0.5054241",
"text": "def pull_folder(path)\n @bridge.pull_folder(path)\n end",
"title": ""
},
{
"docid": "b8edb8c765c15d02b3c27597d56191be",
"score": "0.5048632",
"text": "def index\n @folders = @user.folders.all\n end",
"title": ""
},
{
"docid": "0b633ef1ed60e90b7646031abe7b7d3d",
"score": "0.50482506",
"text": "def stod2sport2\n Apis.client.get('/tv/stod2sport2')\n end",
"title": ""
},
{
"docid": "f9eb49f0244356a48db7c284c0487f9d",
"score": "0.50429803",
"text": "def index\n authorize! :read, Item\n @global_folder = Folder.global_root\n @user_folder = Folder.user_root(current_user)\n @shared_folders = Folder.shared_for(current_user)\n @current_folder_id = params[:folder]\n @current_folder = Folder.where(id: @current_folder_id).first\n\n @current_folder ||= if @current_folder_id.nil?\n @user_folder\n elsif @current_folder_id == 'global'\n @global_folder\n end\n\n authorize!(:download, @global_folder) if @current_folder == @global_folder\n\n @current_folder_id = @current_folder_id.to_sym if @current_folder.nil? and @current_folder_id.present?\n\n @item = Item.new(folder: @current_folder, user: current_user)\n\n if @current_folder\n @subfolders = @current_folder.subfolders.scoped\n @items = Item.where(folder_id: @current_folder.try(:id))\n elsif @current_folder_id == :shared\n @subfolders = @shared_folders\n @items = Item.shared_for(current_user)\n elsif @current_folder_id == :transfers\n @subfolders = []\n if params.has_key?(:history) and params[:history] == 'true'\n @items = current_user.transfers\n else\n @items = current_user.transfers.active\n end\n end\n\n @empty_list = (@subfolders + @items).size == 0\n\n if params.has_key?(:sort)\n column = (params[:sort][:column] || :name).to_sym\n order = (params[:sort][:dir] || :asc).to_sym\n if [:name, :size, :date].include?(column)\n @items = @items.sort_by { |i| i.send(column) }\n @items.reverse! if order == :desc\n end\n if [:name, :date].include?(column)\n @subfolders = @subfolders.sort_by { |i| i.send(column) }\n @subfolders.reverse! if order == :desc\n end\n end\n\n unless [:shared, :transfers].include?(@current_folder_id)\n @folder = Folder.new parent: @current_folder, user: current_user, global: @current_folder.try(:global)\n end\n\n respond_to do |format|\n format.html { render layout: !request.xhr? }\n end\n end",
"title": ""
},
{
"docid": "736e32bcd6549aec8d46a6a8f12c2610",
"score": "0.50403935",
"text": "def image_list\n @folder = PulStore::Lae::Folder.find(params[:id])\n @page_title = \"Folder #{@folder.physical_number}\"\n @pages_list = get_pages_by_folder @folder.id\n respond_to do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "f1cdb9b1ff0696f732acf32a3a91d58d",
"score": "0.502518",
"text": "def show\n @gid2name = Gid2name.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gid2name }\n end\n end",
"title": ""
},
{
"docid": "6a747da08eb321814f91c3461fe72a78",
"score": "0.50241977",
"text": "def index\n @level2s = Level2.all\n end",
"title": ""
},
{
"docid": "2df3f19913d02c159ba91d5cb2ac98e8",
"score": "0.5017717",
"text": "def show\n @show = Show.find(params[:id])\n\n @seasons = {}\n @files = `ls \"public/tv/#{ @show.folder }\"`.split(\"\\n\")\n @files.each do |f|\n @seasons[f] = `find \"public/tv/#{ @show.folder }/#{ f }\" -type f`.split(\"\\n\").map { |ep| ep.gsub('public', '') }\n end\n\n respond_to do |format|\n format.html\n format.json { render json: @show }\n end\n end",
"title": ""
},
{
"docid": "0ccaf1a93c5c080e964edf3bf662d91b",
"score": "0.5012142",
"text": "def index\n @folders = Folder.all\n end",
"title": ""
},
{
"docid": "f67140f708c9ac512adc1232f6294a20",
"score": "0.5004771",
"text": "def set_folder\n begin\n @folder = Folder.find(params[:id])\n rescue ActiveRecord::RecordNotFound => e\n render json: {\n error: e.to_s\n }, status: :not_found\n end\n end",
"title": ""
},
{
"docid": "7febd2630f75668f3024801fd4d81d4c",
"score": "0.5000938",
"text": "def fetch_common_json(common_conf_name, folders)\n common_json = {}\n folders.each_with_index do |client_conf_folder, index|\n next_conf_folder = folders.to_a[index + 1].nil? ? 0 : folders.to_a[index + 1]\n puts \"for file : #{common_conf_name} : client : #{client_conf_folder}\"\n common_json = compare_and_intersect(client_conf_folder, next_conf_folder, common_conf_name, common_json)\n end\n\n return common_json\n end",
"title": ""
},
{
"docid": "39fe1e05f44393930fa97b4d90f3834d",
"score": "0.49960685",
"text": "def show\n @topic2 = Topic2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @topic2 }\n end\n end",
"title": ""
},
{
"docid": "e4d46f1155598deb527c6c7be49e8ecb",
"score": "0.4984936",
"text": "def list_folders\n http_get(:uri=>\"/folders\", :fields=>x_cookie)\n end",
"title": ""
},
{
"docid": "6902447ceccc6331d12c5a9a4061a115",
"score": "0.49794978",
"text": "def index(path = \"/\")\n \t\tlogin_filter\n\t\tpath = namespace_path(path)\n\t\t\n\t\tlist = @agent.post(\"/browse2#{path}?ajax=yes\", {\"d\"=> 1, \"t\" => @token })\n\t\t\n\t\tlisting = list.search('div.browse-file-box-details').collect do |file|\n\t\t\tdetails = {}\n\t\t\tdetails['name'] = file.at('div.details-filename a').content.strip\n\t\t\tdetails['url'] = file.at('div.details-filename a')[\"href\"]\n\t\t\t#details['size'] = file.at('div.details-size a').try(:content).try(:strip)\n\t\t\t#details['modified'] = file.at('div.details-modified a').try(:content).try(:strip)\n\t\t\t\n\t\t\tif match_data = details['url'].match(/^\\/browse_plain(.*)$/)\n\t\t\t\tdetails['directory'] = true\n\t\t\t\tdetails['path'] = normalize_namespace(match_data[1])\n\t\t\telsif match_data = details['url'].match(%r{^https?://[^/]*/get(.*)$})\n\t\t\t\tdetails['directory'] = false\n\t\t\t\tdetails['path'] = normalize_namespace(match_data[1])\n elsif match_data = details['url'].match(%r{^https?://[^/]*/u/\\d*/(.*)$})\n details['directory'] = false\n details['path'] = \"Public/#{match_data[1]}\"\n\t\t\telse\n\t\t\t\traise \"could not parse path from Dropbox URL: #{details['url'] }\"\n\t\t\tend\n\t\t\t\n\t\t\tdetails\n\t\tend\n\t\t#\n\n\t\treturn listing\n\tend",
"title": ""
},
{
"docid": "cc762e801e3552e046799128553afee1",
"score": "0.4977954",
"text": "def lws_api_get(path)\n # See also catalog_controller for use of ENV['LWS_...']\n url ||= ENV['LWS_API_URL']\n url ||= \"#{ENV['LWS_CORE_URL']}/api\" if ENV['LWS_CORE_URL']\n \n # http://localhost:8888/api/collections\n resp = Net::HTTP.get_response(URI.parse(\"#{url || 'http://127.0.0.1:8888/api'}#{path}\"))\n result = JSON.parse(resp.body)\n end",
"title": ""
},
{
"docid": "66cf6acfa448b110151a020bc0341d06",
"score": "0.49765903",
"text": "def folder\n query = Builder::XmlMarkup.new.Query do |xml|\n xml.Where do |xml|\n xml.Eq do |xml|\n xml.FieldRef(:Name => \"FileRef\")\n xml.Value(::File.dirname(url).sub(/\\A\\//, \"\"), :Type => \"Text\")\n end\n xml.Eq do |xml|\n xml.FieldRef(:Name => \"FSObjType\")\n xml.Value(1, :Type => \"Text\")\n end\n end\n end\n @list.items(:folder => :all, :query => query).first\n end",
"title": ""
},
{
"docid": "7cd06191a94c26a2432e31222779a6b0",
"score": "0.4973367",
"text": "def show\n @directory = Directory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @directory }\n end\n end",
"title": ""
},
{
"docid": "628caa2abf0d7cb93418c759fd1df560",
"score": "0.49704385",
"text": "def realm_clients_id1_protocol_mappers_models_id2_get_with_http_info(realm, id1, id2, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProtocolMappersApi.realm_clients_id1_protocol_mappers_models_id2_get ...'\n end\n # verify the required parameter 'realm' is set\n if @api_client.config.client_side_validation && realm.nil?\n fail ArgumentError, \"Missing the required parameter 'realm' when calling ProtocolMappersApi.realm_clients_id1_protocol_mappers_models_id2_get\"\n end\n # verify the required parameter 'id1' is set\n if @api_client.config.client_side_validation && id1.nil?\n fail ArgumentError, \"Missing the required parameter 'id1' when calling ProtocolMappersApi.realm_clients_id1_protocol_mappers_models_id2_get\"\n end\n # verify the required parameter 'id2' is set\n if @api_client.config.client_side_validation && id2.nil?\n fail ArgumentError, \"Missing the required parameter 'id2' when calling ProtocolMappersApi.realm_clients_id1_protocol_mappers_models_id2_get\"\n end\n # resource path\n local_var_path = '/{realm}/clients/{id1}/protocol-mappers/models/{id2}'.sub('{' + 'realm' + '}', CGI.escape(realm.to_s)).sub('{' + 'id1' + '}', CGI.escape(id1.to_s)).sub('{' + 'id2' + '}', CGI.escape(id2.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] || 'ProtocolMapperRepresentation' \n\n # auth_names\n auth_names = opts[:auth_names] || ['access_token']\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: ProtocolMappersApi#realm_clients_id1_protocol_mappers_models_id2_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a149936c6bbec7ea1f4005c7fabec395",
"score": "0.4969896",
"text": "def repo1\n addons = Addon.where(\"lower(repos.name) = ?\", params[:repo_name].downcase)\n render json: to_v1_repo_hashes(addons)\n end",
"title": ""
},
{
"docid": "8878506e96f901f84675d3e44ea9ee10",
"score": "0.49679643",
"text": "def image_list\n @images = Picture.where(album_id: params[:album_id])\n respond_to do |format|\n format.json { render json: @images.to_json(methods: [:path])}\n end\n end",
"title": ""
},
{
"docid": "fa12b67c5ad1a5862c17151ed94bdf62",
"score": "0.49554676",
"text": "def readJsonIntoString(hashed_data2, path, dataFolder)\r\n user2 = File.read(path+\"\\\\#{dataFolder}\\\\users.json\")\r\n hashed_data2 = JSON.parse(user2)\r\n return hashed_data2\r\n end",
"title": ""
},
{
"docid": "c3558663e9c41d6a01e2a6c3e3c9ac21",
"score": "0.49512854",
"text": "def index\n @folders = Folder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @folders }\n end\n end",
"title": ""
},
{
"docid": "c3558663e9c41d6a01e2a6c3e3c9ac21",
"score": "0.49512854",
"text": "def index\n @folders = Folder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @folders }\n end\n end",
"title": ""
},
{
"docid": "f4cf830df6f120e9dff21122fccd5fc4",
"score": "0.49501175",
"text": "def get_folder_by_id(folder, grafana_options)\n grafana_options[:method] = 'Get'\n grafana_options[:success_msg] = 'Folder deletion was successful.'\n grafana_options[:unknown_code_msg] = 'FolderApi::get_folder_by_id unchecked response code: %{code}'\n grafana_options[:endpoint] = '/api/folders/id/' + get_folder_id(folder)\n\n folder_obj = do_request(grafana_options)\n\n return if folder_obj[:message] == 'Folder not found'\n folder_obj\n end",
"title": ""
},
{
"docid": "232cf0f688455741ca896f3cfd190242",
"score": "0.49447054",
"text": "def index\n @trip = Trip.find_by_name(params[:trip_id])\n @folder = @trip.folders.find_by_name(params[:folder_id])\n @reminders = @folder.reminders\n if request.headers['X-PJAX']\n render :layout => false\n else\n render :layout => \"folder\"\n end\n end",
"title": ""
},
{
"docid": "34b76befd9e93935bf80d668300bdc3f",
"score": "0.49362093",
"text": "def index\n @trip = Trip.find_by_name(params[:trip_id])\n @folder = @trip.folders.find_by_name(params[:folder_id])\n @itenaries = @folder.itenaries\n if request.headers['X-PJAX']\n render :layout => false\n else\n render :layout => \"folder\"\n end\n end",
"title": ""
},
{
"docid": "1a158f07d0fd73898bf63453053dab37",
"score": "0.49264178",
"text": "def show\n @club_path = ClubPath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @club_path }\n end\n end",
"title": ""
},
{
"docid": "bac15ca0778a01188f9f4043f79ecabe",
"score": "0.4922543",
"text": "def b2_download_file_by_name(file, *folder)\n\n if folder[0] != nil\n file_url = b2_generate_file_url(file, folder[0])\n else\n file_url = b2_generate_file_url(file)\n end\n\n uri = URI(file_url)\n req = Net::HTTP::Get.new(uri)\n http = Net::HTTP.new(req.uri.host, req.uri.port)\n http.use_ssl = true\n res = http.start {|http| http.request(req)}\n\n case res\n when Net::HTTPSuccess then\n res.body\n swapfile = File.new(\"./public/swap/#{file}\", 'wb')\n swapfile.puts(res.body)\n swapfile.close\n when Net::HTTPRedirection then\n fetch(res['location'], limit - 1)\n else\n res.error!\n end\n\nend",
"title": ""
},
{
"docid": "b9ce9c84b868a692b35e745a55cae2c6",
"score": "0.49170732",
"text": "def show\n @photo1 = Photo1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photo1 }\n end\n end",
"title": ""
},
{
"docid": "50fd1f8b53f90de3253e5639ad46c0ac",
"score": "0.49123853",
"text": "def index\n client = DropboxApi::Client.new(\"C8Eg7_xlTzAAAAAAAAAAMduh226EdjZy_X_pVqXkbOUenDBMOVpQwo0zhF9sr8bC\")\n @result = client.list_folder \"/Yann Doré\"\n pp @result.entries\n @result.has_more? \n end",
"title": ""
},
{
"docid": "c1be47422231317d3595bd9aacd8c765",
"score": "0.49120787",
"text": "def browse\n \t# first find the current folder within own folders\n \t@current_folder = current_user.folders.find_by_id(params[:folder_id])\n \t@is_this_folder_being_shared = false if @current_folder # just an instance variable to help hiding buttons on view\n\n # if not found in own folders, find it in being_shared_folders\n if @current_folder.nil?\n folder = Folder.find_by_id(params[:folder_id])\n \n @current_folder ||= folder if current_user.has_share_access?(folder)\n @is_this_folder_being_shared = true if @current_folder # just an instance variable to help hiding buttons on view\n end\n\n \tif @current_folder\n # if under a sub-folder, we shouldn't see shared folders\n @being_shared_folders = []\n\n \t #getting the folders which are inside this @current_folder\n \t @folders = @current_folder.children\n\n \t #We need to fix this to show files under a specific folder if we are viewing that folder\n \t @assets = @current_folder.assets.order(\"uploaded_file_file_name desc\")\n\n \t render :action => \"index\"\n \telse\n \t flash[:error] = \"Don't be cheeky! Mind your own folders!\"\n \t redirect_to root_url\n \tend\n end",
"title": ""
},
{
"docid": "85dba46f286a06cea388563fd9d0a29c",
"score": "0.49093974",
"text": "def index\n @resources = []\n\t\tDir.glob(\"#{params[:path]}/*\").each do |f|\n\t\tunless File.directory?(f)\n\t\t\[email protected](File.basename(f))\n\t\tend\n\tend\n\n\trender json: @resources\n end",
"title": ""
},
{
"docid": "2360140f8d8a3b3205ab997013c3eaad",
"score": "0.4906133",
"text": "def list\r\n # Get the folder\r\n @folder = Folder.find_by_id(folder_id)\r\n\r\n # Set if the user is allowed to update or delete in this folder;\r\n # these instance variables are used in the view.\r\n @can_update = @logged_in_user.can_update(@folder.id)\r\n @can_delete = @logged_in_user.can_delete(@folder.id)\r\n\r\n # determine the order in which files are shown\r\n file_order = 'filename '\r\n file_order = params[:order_by].sub('name', 'filename') + ' ' if params[:order_by]\r\n file_order += params[:order] if params[:order]\r\n\r\n # determine the order in which folders are shown\r\n folder_order = 'name '\r\n if params[:order_by] and params[:order_by] != 'filesize' \r\n folder_order = params[:order_by] + ' '\r\n folder_order += params[:order] if params[:order]\r\n end\r\n\r\n # List of subfolders\r\n @folders = @folder.list_subfolders(@logged_in_user, folder_order.rstrip)\r\n\r\n # List of files in the folder\r\n @myfiles = @folder.list_files(@logged_in_user, file_order.rstrip)\r\n\r\n #get the correct URL\r\n url = url_for(:controller => 'folder', :action => 'list', :id => nil)\r\n\r\n # it's nice to have the possibility to go up one level\r\n @folder_up = '<a href=\"' + url + '/' + @folder.parent.id.to_s + '\">..</a>' if @folder.parent\r\n end",
"title": ""
},
{
"docid": "e537bf99402c44f37d02a29a345dc158",
"score": "0.4905381",
"text": "def child\n @folder = Folder.new\n @folder.parent = Folder.find(params[:id])\n @folder.user = @current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @folder }\n end\n end",
"title": ""
},
{
"docid": "79ffd425feeeb6b087d60393ac8dd9f0",
"score": "0.48995712",
"text": "def folder\n @folders[@folder_name]\n end",
"title": ""
},
{
"docid": "b0e2901549b433e2a00f11513e455ff5",
"score": "0.48947385",
"text": "def show\n authorize! :show, params[:id]\n @folder = PulStore::Lae::Folder.find(params[:id])\n @page_title = \"Folder #{@folder.physical_number}\"\n @pages_list = get_pages_by_folder @folder.id\n @box_list = get_box_by_id @folder.box_id\n \n respond_to do |format|\n format.html { setup_next_and_previous_documents } # show.html.erb\n format.json { render json: @folder }\n format.yml { render text: @folder.to_yaml(prod_only: !params.include?(:all)) }\n format.ttl { render text: @folder.to_ttl(prod_only: !params.include?(:all)) }\n format.xml { render xml: @folder.to_solr_xml(prod_only: !params.include?(:all)) }\n end\n rescue NoMethodError\n not_allowed\n end",
"title": ""
},
{
"docid": "e8624195c7c86df906546ddfc0ab3b7f",
"score": "0.4887586",
"text": "def download_b2_file(image_info, *sightings_count)\n\n folder = image_info[0]\n filename = image_info[1]\n b2_file_path = \"#{folder}/#{filename}\"\n\n if sightings_count\n sightings_count = sightings_count[0]\n subdirectory = folder.split(\"/\")[1]\n sightings_dir = create_directory(subdirectory, sightings_count)\n swap_file = \"#{sightings_dir}/#{filename}\"\n else\n create_folder()\n swap_file = \"./public/swap/#{filename}\" # use when running via app.rb\n # swap_file = \"../public/swap/#{file}\" # use when running locally from /lib/b2_bucket.rb\n end\n\n file_url = b2_generate_file_url(filename, folder)\n\n uri = URI(file_url)\n req = Net::HTTP::Get.new(uri)\n http = Net::HTTP.new(req.uri.host, req.uri.port)\n http.use_ssl = true\n res = http.start {|http| http.request(req)}\n\n case res\n when Net::HTTPSuccess then\n res.body\n swapfile = File.new(swap_file, 'wb')\n swapfile.puts(res.body)\n swapfile.close\n when Net::HTTPRedirection then\n fetch(res['location'], limit - 1)\n else\n res.error!\n end\n\nend",
"title": ""
},
{
"docid": "9c2a6d88fab662443ac5c252ebe905da",
"score": "0.48875797",
"text": "def realm_client_scopes_id1_protocol_mappers_models_id2_get_with_http_info(realm, id1, id2, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProtocolMappersApi.realm_client_scopes_id1_protocol_mappers_models_id2_get ...'\n end\n # verify the required parameter 'realm' is set\n if @api_client.config.client_side_validation && realm.nil?\n fail ArgumentError, \"Missing the required parameter 'realm' when calling ProtocolMappersApi.realm_client_scopes_id1_protocol_mappers_models_id2_get\"\n end\n # verify the required parameter 'id1' is set\n if @api_client.config.client_side_validation && id1.nil?\n fail ArgumentError, \"Missing the required parameter 'id1' when calling ProtocolMappersApi.realm_client_scopes_id1_protocol_mappers_models_id2_get\"\n end\n # verify the required parameter 'id2' is set\n if @api_client.config.client_side_validation && id2.nil?\n fail ArgumentError, \"Missing the required parameter 'id2' when calling ProtocolMappersApi.realm_client_scopes_id1_protocol_mappers_models_id2_get\"\n end\n # resource path\n local_var_path = '/{realm}/client-scopes/{id1}/protocol-mappers/models/{id2}'.sub('{' + 'realm' + '}', CGI.escape(realm.to_s)).sub('{' + 'id1' + '}', CGI.escape(id1.to_s)).sub('{' + 'id2' + '}', CGI.escape(id2.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] || 'ProtocolMapperRepresentation' \n\n # auth_names\n auth_names = opts[:auth_names] || ['access_token']\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: ProtocolMappersApi#realm_client_scopes_id1_protocol_mappers_models_id2_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "acafb4bab995e4c5c4ba97d80a045056",
"score": "0.48843277",
"text": "def get_list_folders()\n\t\trefresh_access_token()\n\t\trequest_url = \"https://www.googleapis.com/drive/v2/files?q=mimeType='application/vnd.google-apps.folder'&access_token=#{@access_token}\"\n\n\t\tresponse = RestClient.get request_url\n\t\tresponse_body = JSON.parse(response.body)\n\t\tfolders = Hash.new\n\n\t\tresponse_body['items'].each do |item|\n\t\t\tfolders[item['title']] = item['id']\n\t\tend\n\n\t\treturn folders\n\tend",
"title": ""
},
{
"docid": "8b967068a1ef07734415ac63e75409ff",
"score": "0.48825374",
"text": "def index\n if params[:single]\n\t url = \"#{API_BASE_URL}/photos/#{params[:id]}.json?token=#{ENV['API_KEY']}\"\n\t response = RestClient.get(url)\n\t @photo = JSON.parse(response.body)\n\telse\n\t url = \"#{API_BASE_URL}/photos.json?token=#{ENV['API_KEY']}\"\n response = RestClient.get(url)\n @photos = JSON.parse(response.body)\t\t \n\tend\n end",
"title": ""
},
{
"docid": "a04bc7ffdb1f02f313a4dfcd032cd450",
"score": "0.48721695",
"text": "def show\n @combined_image = CombinedImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @combined_image }\n end\n end",
"title": ""
},
{
"docid": "2302d68e6f25ae91494965da53822022",
"score": "0.48700544",
"text": "def update\n if @folder.update(folder_params)\n render :show, status: :ok\n else\n render json: @folder.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "50d005a3d32a6805a6df6354e914fea2",
"score": "0.48651096",
"text": "def new\n @folder = current_user.folders.build\n\n respond_to do |format|\n format.html { render :layout => false }\n format.json { render :json => @folder }\n end\n end",
"title": ""
},
{
"docid": "8df8d37f332b1cb622150fd897656979",
"score": "0.48596418",
"text": "def getFolders(response)\r\n\t\t\t\tfolders_all_json = JSON.parse response\r\n\t\t\t\tfolders_all_array = folders_all_json[\"folders\"]\r\n\t\t\t\tfolders_class_array = Array.new\r\n\t\t\t\tfor i in 0...folders_all_array.length\r\n\t\t\t\t\tfolders_class_array.push(jsonToFolder(folders_all_array[i]))\r\n\t\t\t\tend\r\n\t\t\t\treturn folders_class_array\r\n\t\t\tend",
"title": ""
},
{
"docid": "7370a37a4d8e43dfde37919389f9514e",
"score": "0.4852679",
"text": "def index\n #if params[:id] == nil\n @folders = Folder.where([\"id_padre = 1\"])\n \n @p = \"?p=1\"\n @idpadre = 1\n @folder = Folder.find(1)\n @nombre = \"home\"\n @archivofolders = Archivofolder.where([\"folder_id = 1\"])\n\n #else\n #@folder = Folder.find(params[1])\n #end\n end",
"title": ""
}
] |
8d7d07c6e4f620a7eb435f37364f8efc
|
Return the IDs of all children recursively.
|
[
{
"docid": "0ccd78813be5b08b75266d7f11bdee0f",
"score": "0.83859193",
"text": "def child_ids\n ids = [self.id]\n self.children.each do |child|\n ids += child.child_ids\n end\n ids\n end",
"title": ""
}
] |
[
{
"docid": "ff421380f3353923d21c09366a024760",
"score": "0.8937491",
"text": "def get_children_ids_recursive\n ids = []\n children.each do |c|\n\t\t\t\tif !c.children.empty?\n\t\t\t\t\tids += c.get_children_ids_recursive\n\t\t\t\tend\n\t\t\t\tids << c.id\n\t\t\tend\n return ids\n\t\tend",
"title": ""
},
{
"docid": "38b5f235e5b586b6ad64e4e55ec396b2",
"score": "0.838502",
"text": "def ids\n self.is_leaf? ? [@ids].flatten : self.children.inject([]) {|result, item| result += item.ids}\n end",
"title": ""
},
{
"docid": "68e7841a54e54320d3497d2e3807fa18",
"score": "0.8315821",
"text": "def get_self_and_children_ids\n ids = [self.id]\n ids += get_children_ids_recursive\n return ids\n\t\tend",
"title": ""
},
{
"docid": "95f22c79f98efc9a75efeb766de760ac",
"score": "0.8084634",
"text": "def child_ids\n\n children.collect { |cfei| Ruote.extract_child_id(cfei) }\n end",
"title": ""
},
{
"docid": "0dea5a1c5792350759649102880009a5",
"score": "0.7668755",
"text": "def children_ids\n \t children_ids = []\n self.children.each { |child| children_ids << child.id if child.permitted? } unless self.children.empty?\n children_ids\n end",
"title": ""
},
{
"docid": "a709ad33253f109556f6aea5844921ef",
"score": "0.76285815",
"text": "def children\n kids = []\n each_child { |kid| kids << kid }\n kids\n end",
"title": ""
},
{
"docid": "27782b4d69c80caa65a430b70485d471",
"score": "0.7513609",
"text": "def descendants_ids(ignore_permissions = false)\n \t descendants_ids = [] \n \t self.children.each { |child|\n \t descendants_ids += [child.id] if ignore_permissions or child.permitted?\n \t descendants_ids += child.descendants_ids\n \t } unless self.children.empty?\n \t descendants_ids\n \tend",
"title": ""
},
{
"docid": "7ca9acebf9668af0352ad0f4bdaa1590",
"score": "0.746404",
"text": "def self_and_siblings_ids\n parent ? parent.children_ids : self.class.roots.map {|x| x.id}\n end",
"title": ""
},
{
"docid": "0aa23815ae96d861d7edd2a2e8076aa4",
"score": "0.74136513",
"text": "def descendant_ids\n descendants.map(&:id)\n end",
"title": ""
},
{
"docid": "8792b3ddb26734a45cff58689e08ab85",
"score": "0.7383038",
"text": "def recursive_subdirectory_ids\n if self.root?\n CfsDirectory.where(root_cfs_directory_id: self.id).ids\n else\n ids = [self.id]\n while true\n new_ids = (CfsDirectory.non_roots.where(parent_id: ids).ids << self.id).sort\n return new_ids if ids == new_ids\n ids = new_ids\n end\n end\n end",
"title": ""
},
{
"docid": "70242594f1e3b255f5475f7f62135b40",
"score": "0.73571527",
"text": "def children\n self.class.where('? = ANY(parent_ids)', id.to_s)\n end",
"title": ""
},
{
"docid": "3a50bd1349a260dd6ff418ed86dc1325",
"score": "0.7336954",
"text": "def ids\n root.ids\n end",
"title": ""
},
{
"docid": "78c029890c0af40587b938281aab372f",
"score": "0.7243127",
"text": "def all_children\n find_all_children_with_dotted_ids\n end",
"title": ""
},
{
"docid": "8087f5b973ba47478687a303af30db3f",
"score": "0.71814364",
"text": "def ancestors_ids\n node, nodes = self, []\n while node.parent\n node = node.parent\n nodes << node.id\n end\n nodes\n end",
"title": ""
},
{
"docid": "d4465382b3d5eaedbb5bbb0515f50552",
"score": "0.71777236",
"text": "def child_ids(*args)\n return call_ancestry_method(:child_ids) if use_ancestry?\n\n Relationship.resource_pairs(child_rels(*args))\n end",
"title": ""
},
{
"docid": "30835d402b39a25b99879a853f7a3c28",
"score": "0.7161117",
"text": "def all_ancestor_ids\n ancestors.pluck(:id)\n end",
"title": ""
},
{
"docid": "fad5cfd28afadf6a20bb1b8bf15cb798",
"score": "0.7019089",
"text": "def direct_children_by_id(*args)\n scope = args.last.is_a?(Hash) ? args.pop : {}\n ids = args.flatten.compact.uniq\n self.class.find_in_nested_set(:all, { \n :conditions => [\"#{scope_condition} AND #{prefixed_parent_col_name} = #{self.id} AND #{self.class.table_name}.#{self.class.primary_key} IN (?)\", ids]\n }, scope) \n end",
"title": ""
},
{
"docid": "847257ec6531b7c9b8db4c93eacc0550",
"score": "0.7014539",
"text": "def get_all_child_collections_ids()\r\n ids = @db_interface.get_all_hash_values(@certain_coll_key)\r\n ids ||= []\r\n return ids\r\n end",
"title": ""
},
{
"docid": "20ca4f01ea28302b781b9076b12d51a5",
"score": "0.69676673",
"text": "def get_ids_of_all_child_jobs_old\r\n ids_of_child_jobs = []\r\n if parent_job_id.blank?\r\n child_jobs = Job.where(\"jobs.parent_job_id = #{id}\").all\r\n child_jobs.each do |child_job|\r\n ids_of_child_jobs << child_job.id\r\n end\r\n end\r\n \r\n ids_of_child_jobs\r\n end",
"title": ""
},
{
"docid": "bb2d4cf6f179b84bccea0c2f67a6802d",
"score": "0.69257474",
"text": "def parent_ids\n []\n end",
"title": ""
},
{
"docid": "5202a94caf8e7e7cab6a3bf67ca7f95a",
"score": "0.6907634",
"text": "def leaf_ids\n lids = []\n self.categories.leaves.each do |cat|\n lids << cat.id\n end\n lids\n end",
"title": ""
},
{
"docid": "29a322a663d5b9a99b362d4ce23f74c4",
"score": "0.6901945",
"text": "def children\n \n TapirLogger.instance.log \"Finding children for #{self}\"\n children = []\n EntityMapping.all.each do |mapping| \n\n # Go through each associated entity mapping, and find mappings where the parent_id is us\n # which means that the child_id is some other entity, and it's a child\n \n # the to_s is important, otherwise self.id returns a :Moped::BSON::ObjectID\n children << mapping.get_child if mapping.parent_id == self.id.to_s\n\n # TODO - what happens if parent_id and child_id are the same. We'll\n # end up grabbing it. Could that break any assumptions?\n end\n \n children\n end",
"title": ""
},
{
"docid": "ffe35265903de02ce18509f629e3acbc",
"score": "0.6869336",
"text": "def child_object_ids(valkyrie: false)\n child_objects(valkyrie: valkyrie).map(&:id)\n end",
"title": ""
},
{
"docid": "ea83a946e6970fb464f428c1a956fa9a",
"score": "0.6854254",
"text": "def taxons_including_children_ids\n taxons.inject([]) { |ids, taxon| ids += taxon.self_and_descendants.ids }\n end",
"title": ""
},
{
"docid": "3647015de2cbc3b0e107ab1f8d0c9035",
"score": "0.6831649",
"text": "def subtree_ids(*args)\n return call_ancestry_method(:subtree_ids) if use_ancestry?\n\n Relationship.resource_pairs(subtree_rels(*args))\n end",
"title": ""
},
{
"docid": "53599881618e23cb9b5ac28cbb241971",
"score": "0.68236834",
"text": "def ids\n @store.transaction do\n @store.roots\n end\n end",
"title": ""
},
{
"docid": "eb32d3e40bbc99be2708f8308472b4db",
"score": "0.68157005",
"text": "def descendants\n tree.children_of(id)\n end",
"title": ""
},
{
"docid": "5537f5b7032aa6a57bb1eee8126c8176",
"score": "0.6746555",
"text": "def child_group_ids\n child_groups.map(&:id)\n end",
"title": ""
},
{
"docid": "2e4ed57dcc5d9838633f2238eeadae26",
"score": "0.6702201",
"text": "def children\n children_tree.values\n end",
"title": ""
},
{
"docid": "2e4ed57dcc5d9838633f2238eeadae26",
"score": "0.6702201",
"text": "def children\n children_tree.values\n end",
"title": ""
},
{
"docid": "ea3743243674580a2cf3b1deed4b5e7a",
"score": "0.6699452",
"text": "def parent_rel_ids\n rel = relationships\n if rel.kind_of?(Array) || rel.try(:loaded?)\n rel.reject { |x| x.ancestry.blank? }.collect(&:parent_id)\n else\n rel.where.not(:ancestry => [nil, \"\"]).select(:ancestry).collect(&:parent_id)\n end\n end",
"title": ""
},
{
"docid": "369ad6cc6fc067d47d22ef8ffa773245",
"score": "0.66896605",
"text": "def tree_numbers(id)\n parents = self.nodes[id]\n if parents.nil?\n return [\"#{id}\"]\n else\n parent_trees = parents.map { |p| tree_numbers(p) }.flatten\n parent_trees.map { |tn| \"#{tn}.#{id}\" }\n end\n end",
"title": ""
},
{
"docid": "51e196a53929981e43d8f1afb5d8436c",
"score": "0.6655316",
"text": "def ancestor_ids\n read_attribute(self.base_class.ancestry_column).to_s.split(%r|[,/]|).uniq.map { |id| cast_primary_key(id) }\n end",
"title": ""
},
{
"docid": "3752c0cdf876a1e591a90158d8a642c8",
"score": "0.6626669",
"text": "def parent_ids\n if ancestor_ids.empty? then\n []\n else\n branches.map { |branch| cast_primary_key(branch.split('/').last) }.uniq\n end\n end",
"title": ""
},
{
"docid": "3318d6e72fc88d440aff4c29ee960ed8",
"score": "0.66139793",
"text": "def ids\n @nodes.map(&:id)\n end",
"title": ""
},
{
"docid": "152e76131fba5b915981ca1a6de03d80",
"score": "0.6611968",
"text": "def children\n _children\n end",
"title": ""
},
{
"docid": "31703536d5cf4d517f40ef6fb0e15c9b",
"score": "0.6607137",
"text": "def children\n self.class.find(:all, :conditions => \"#{acts_as_nested_set_options[:scope]} AND #{acts_as_nested_set_options[:parent_column]} = #{self.id}\", :order => acts_as_nested_set_options[:left_column])\n end",
"title": ""
},
{
"docid": "f704e5721dba572a1aecfc2e2e5149e0",
"score": "0.65980315",
"text": "def children\n nested_set_class.find_with_nested_set_scope(:all, :conditions => \"#{nested_set_parent} = #{self.id}\", :order => nested_set_left)\n end",
"title": ""
},
{
"docid": "f2b28e0853908e7f483a23559f0dc935",
"score": "0.65772504",
"text": "def get_children\n return children\n end",
"title": ""
},
{
"docid": "fc6a56d1ffa24f11f0d6ba3d5154d85f",
"score": "0.65716153",
"text": "def children\n tree_search_class.where(tree_parent_id_field => self._id).sort(self.class.tree_sort_order()).all\n end",
"title": ""
},
{
"docid": "e6c518ea246120607d13495124da2742",
"score": "0.6562712",
"text": "def descendant_ids(*args)\n return call_ancestry_method(:descendant_ids) if use_ancestry?\n\n Relationship.resource_pairs(descendant_rels(*args))\n end",
"title": ""
},
{
"docid": "56b173a3b85a4ecac4ac7510047f42d3",
"score": "0.655183",
"text": "def find_all_parents\n end",
"title": ""
},
{
"docid": "8d40dc1d31d2e3ddedc885ad05ed37d0",
"score": "0.6542364",
"text": "def all_children\n @all_children ||= children + children.inject([]) {|records, child| records + child.all_children}\n end",
"title": ""
},
{
"docid": "9f86f67ef5cc6e85d8b874f12501aeec",
"score": "0.6486453",
"text": "def find_parent_ids(array=nil)\n parent_id = []\n\n puts array.class\n parent = Parent.find_by(array)\n puts parent\n\n parent_id << parent.children.pluck(:child_id)\n\n parent.children.each do |child| \n unless child.children.blank?\n parent_id << child.child_id\n end\n end\n\n # parent.each do |p|\n # unless p.child.blank?\n # parent_id << child.child_id\n # child_id = p.child.pluck(:child_id)\n\n # unless child_id.blank?\n # find_parent_ids(child_id)\n # end\n # end\n # end\n\n parent_id\n end",
"title": ""
},
{
"docid": "cc71fe14c85f2854c3fde07bcc2a59ac",
"score": "0.64698964",
"text": "def all_children\n children(all: true)\n end",
"title": ""
},
{
"docid": "e82c2ababa69a134d06113d7e25e47ee",
"score": "0.6465308",
"text": "def children\n []\n end",
"title": ""
},
{
"docid": "e82c2ababa69a134d06113d7e25e47ee",
"score": "0.6465308",
"text": "def children\n []\n end",
"title": ""
},
{
"docid": "e82c2ababa69a134d06113d7e25e47ee",
"score": "0.6465308",
"text": "def children\n []\n end",
"title": ""
},
{
"docid": "89f5ad5f7b9f9206b0aea281a7c61098",
"score": "0.6461718",
"text": "def children\n @ref.children.to_ruby\n end",
"title": ""
},
{
"docid": "4204a3fa74672425964105434cd1675b",
"score": "0.64601284",
"text": "def parent_ids(*args)\n return Array.wrap(parent_id(*args)) if use_ancestry?\n\n Relationship.resource_pairs(parent_rels(*args))\n end",
"title": ""
},
{
"docid": "98fffb143ddfb0d4edbe8cfe219a3642",
"score": "0.6458096",
"text": "def all_children(accummulator=[])\n return accummulator if children.size == 0\n children.each do |child_id|\n child = Folder.get(child_id)\n accummulator << child\n child.all_children(accummulator)\n end\n accummulator\n end",
"title": ""
},
{
"docid": "d0507ffdcc013906a30293f3895fd4e9",
"score": "0.64491093",
"text": "def all_children(children_array = [self.id])\n children_array << self.child_ids\n self.children.each do |child|\n child.all_children(children_array)\n end\n children_array.flatten.uniq\n end",
"title": ""
},
{
"docid": "765fe5c24c6169915f43bdbfe675dcd7",
"score": "0.6448202",
"text": "def get_ids_of_all_jobs\r\n result = [id, parent_job_id].compact\r\n result << Job.where([\"parent_job_id in (?)\",result]).select(:id).collect(&:id)\r\n result.flatten.uniq\r\n end",
"title": ""
},
{
"docid": "6cab3128f5d7ddb794df2d3435c0389f",
"score": "0.64287823",
"text": "def children\n children = []\n\n unless leaf?\n zipper = down\n children << zipper\n\n until zipper.last?\n zipper = zipper.next\n children << zipper\n end\n end\n\n children\n end",
"title": ""
},
{
"docid": "55a57aeef446cbb9327288ed1cd3c27f",
"score": "0.64230067",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "eb15e3e1f94f2d72e3c7aa2b2e4c4b56",
"score": "0.64203495",
"text": "def path_ids\n ancestor_ids + [id]\n end",
"title": ""
},
{
"docid": "eb15e3e1f94f2d72e3c7aa2b2e4c4b56",
"score": "0.64203495",
"text": "def path_ids\n ancestor_ids + [id]\n end",
"title": ""
},
{
"docid": "dd1117d26d5e933c5f1f3a47f3c611a8",
"score": "0.64201015",
"text": "def lineage_ids\n ancestor_ids + subtree_ids\n end",
"title": ""
},
{
"docid": "dd1117d26d5e933c5f1f3a47f3c611a8",
"score": "0.64201015",
"text": "def lineage_ids\n ancestor_ids + subtree_ids\n end",
"title": ""
},
{
"docid": "49426e218f3e44af863007f3c04ec0b4",
"score": "0.64199805",
"text": "def children\n []\n end",
"title": ""
},
{
"docid": "49426e218f3e44af863007f3c04ec0b4",
"score": "0.64199805",
"text": "def children\n []\n end",
"title": ""
},
{
"docid": "64242a8d8da8d82e800e164de8e0746a",
"score": "0.6416486",
"text": "def children\n unless defined? @children\n @children = Array.new\n end\n return @children\n end",
"title": ""
},
{
"docid": "199de37aa45535ca819ace508a309b18",
"score": "0.6415872",
"text": "def children\n EarLogger.instance.log \"Finding children for #{self}\"\n ObjectManager.instance.find_children(self.id, self.class.to_s)\n end",
"title": ""
},
{
"docid": "0249644a55d1149ef9d9949e78261d72",
"score": "0.64076376",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "0249644a55d1149ef9d9949e78261d72",
"score": "0.64076376",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "0249644a55d1149ef9d9949e78261d72",
"score": "0.64076376",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "0249644a55d1149ef9d9949e78261d72",
"score": "0.64076376",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "f71d7ea9e3d254f2c6f91ff62bec4cc3",
"score": "0.6399069",
"text": "def get_children_pids(pid)\n pid = pid.to_i\n unless process_tree.key? pid\n log \"No such pid: #{pid}\"\n return []\n end\n process_tree[pid][:children].inject([pid]) do |all_children_pids, child_pid|\n all_children_pids + get_children_pids(child_pid)\n end\n end",
"title": ""
},
{
"docid": "7b0d7df35e8294faed45284f56d865b9",
"score": "0.6398683",
"text": "def _children\n @children\n end",
"title": ""
},
{
"docid": "321bb7892221e3fd538d4a817efad531",
"score": "0.6385605",
"text": "def descendants\n children + children.map(&:children).flatten\n end",
"title": ""
},
{
"docid": "c33590bfae321dafd0dd5b57b31e44e5",
"score": "0.63782746",
"text": "def get_ids_of_all_jobs_old\r\n ids_of_jobs = []\r\n \r\n if parent_job_id.blank?\r\n child_jobs = Job.where(\"jobs.parent_job_id = #{id}\").all \r\n ids_of_jobs << id\r\n else\r\n child_jobs = Job.where(\"jobs.parent_job_id = #{parent_job_id}\").all\r\n ids_of_jobs << parent_job_id\r\n end\r\n\r\n child_jobs.each do |child_job|\r\n ids_of_jobs << child_job.id\r\n end\r\n\r\n ids_of_jobs\r\n end",
"title": ""
},
{
"docid": "d3ae58be2b19d1bfc4f087fbcb497acc",
"score": "0.63727874",
"text": "def children\n result = []\n @children.each do |_, child_group|\n result.concat(child_group)\n end\n\n result\n end",
"title": ""
},
{
"docid": "6d22022e115706566509070531fb2ef2",
"score": "0.6367033",
"text": "def parent_ids\n if ancestor_ids.empty? then\n nil\n else\n branches.map { |branch| cast_primary_key(branch.split('/').last) }\n end\n end",
"title": ""
},
{
"docid": "6b65745f40752ebef04d57b9545349bd",
"score": "0.63632464",
"text": "def children\n entries\n end",
"title": ""
},
{
"docid": "8ad3cd996de023a4aca8cb32b118b1d0",
"score": "0.6349417",
"text": "def get_children\n return @children\n end",
"title": ""
},
{
"docid": "738a607c54a4e889f11bbfec9d9f0232",
"score": "0.63390493",
"text": "def children\n @children ||= []\n end",
"title": ""
},
{
"docid": "13c6c84d4c80c0fadf1c86766d86d0d8",
"score": "0.6338194",
"text": "def children\n []\n end",
"title": ""
},
{
"docid": "cb8b624b469d15597457ef49d4ca8efd",
"score": "0.6333875",
"text": "def children_names; @children.keys; end",
"title": ""
},
{
"docid": "ed5a1dd7c6561595a17f66a1e15a54b9",
"score": "0.63247156",
"text": "def parents\n self.class.where(id: parent_ids)\n end",
"title": ""
},
{
"docid": "5ed26cb6bbf9b115df8bd8feaa6d3eb5",
"score": "0.6319587",
"text": "def children\n @children ||= {}.with_indifferent_access\n end",
"title": ""
},
{
"docid": "6c2e2c45512da4691cea9b62d52feb5c",
"score": "0.6318317",
"text": "def children\n []\n end",
"title": ""
},
{
"docid": "8a9f6de6abe1664fc786ba00976bace6",
"score": "0.6317654",
"text": "def children\n @children\n end",
"title": ""
},
{
"docid": "8a9f6de6abe1664fc786ba00976bace6",
"score": "0.6317654",
"text": "def children\n @children\n end",
"title": ""
},
{
"docid": "80d6cb7bfd47076033a13cdba6eb1585",
"score": "0.6311606",
"text": "def currently_persisted_parent_uids\n DigitalObject.where(id: currently_persisted_parent_ids).pluck(:uid)\n end",
"title": ""
},
{
"docid": "35c9ce7f636e29f6cb4376c2bed1cd50",
"score": "0.6302384",
"text": "def ancestor_ids\n read_attribute(self.base_class.structure_column).to_s.split(%r|[,/]|).uniq.map { |id| cast_primary_key(id) }\n end",
"title": ""
},
{
"docid": "4703d5de5bdc655f4bc4444b09949076",
"score": "0.6301089",
"text": "def children\n dataset.nested.filter(self.class.qualified_parent_column => self.id)\n end",
"title": ""
},
{
"docid": "901329bc8db36a1b7dedbc6e3bc4a705",
"score": "0.6288834",
"text": "def children()\n #Ressource.filter(:parent_id => self.id, :parent_service_id => self.service_id).all\n end",
"title": ""
},
{
"docid": "9718de7f1245bff0804708d2f3cf94b1",
"score": "0.62872523",
"text": "def get_children\n @children\n end",
"title": ""
},
{
"docid": "cc69cef04955d71b4c4c072ec9fb298b",
"score": "0.6281089",
"text": "def children\n self.class.find(:all, \n :select => \"a.*\",\n :joins => \"a join #{self.class.bridge_class.table_name} b on a.id = b.#{self.class.parent_foreign_key}\", \n :conditions => [\"b.#{self.class.child_foreign_key} = ? and b.#{self.class.levels_from_parent} = 1\", self.id])\n end",
"title": ""
},
{
"docid": "fbd058a42e290bbcaab80f5e1baa59a3",
"score": "0.6247763",
"text": "def grand_children\n []\n end",
"title": ""
},
{
"docid": "cb3a2810715da17c5dc95f7a656421ba",
"score": "0.6230963",
"text": "def children\n Array.new\n end",
"title": ""
},
{
"docid": "0e12864570a034f5816c3997770186f6",
"score": "0.62306595",
"text": "def with_descendants(id)\n next_ids = [id]\n descendants = [id]\n\n while next_ids.any?\n parents = next_ids\n next_ids = []\n\n parents.each do |pid|\n if children = node_ids_by_parent_id[pid]\n descendants.concat(children)\n next_ids.concat(children)\n end\n end\n end\n\n descendants\n end",
"title": ""
},
{
"docid": "7a33d508286cba8ee66543677d4b52e0",
"score": "0.62276834",
"text": "def children(*args)\n self.class.send(:with_scope, :find=>{:conditions=>['parent_node_id=?', self.child_node_id]}) do\n self.class.find(:all, *args)\n end\n end",
"title": ""
},
{
"docid": "4c0f7e88cb89190f5f3217233f24926b",
"score": "0.62274337",
"text": "def children_get()\n @children\n end",
"title": ""
},
{
"docid": "aa3a6743936f7abd31e88539cbcc12de",
"score": "0.62111604",
"text": "def depth_first\n result = [self]\n if child_ids.empty?\n return result\n else\n children.sort.each do |child|\n result += child.depth_first\n end \n end\n return result \n end",
"title": ""
},
{
"docid": "959e0c6d91b4c1287eb5bfc52c4ea910",
"score": "0.62022406",
"text": "def descendants\n children + children.map(&:descendants).flatten\n end",
"title": ""
},
{
"docid": "a8cc4d3b5729a99ebe363f78fd9f4523",
"score": "0.62001395",
"text": "def children\n return @children if [email protected]?\n @children = all_children.find_all{|collection| collection.url.count('/') == self.url.count('/') + 1}\n end",
"title": ""
},
{
"docid": "60a2a2439ff11b54f87f9976285b46c5",
"score": "0.61972123",
"text": "def children\n self.class.children(self) \n end",
"title": ""
},
{
"docid": "d8de629574e9c2cab3440dfe54350f56",
"score": "0.61894786",
"text": "def children\n\t\treturn children_of @current_node\n\tend",
"title": ""
},
{
"docid": "5d131e271708e71e3a2a2af19ba7980c",
"score": "0.6176637",
"text": "def each_element_with_id(recursive=false, &block)\n children.each do |node|\n node.each_element_with_id(recursive, &block)\n end\n end",
"title": ""
}
] |
4f21aae2bb1730fc7e48e15883d7d6a9
|
Overwriting the sign_out redirect path method
|
[
{
"docid": "747a6923b041c93ccae5d7fc5fd9f36a",
"score": "0.0",
"text": "def after_sign_out_path_for(resource_or_scope)\n # root_path\n demo_path\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": ""
}
] |
25b4b4d18a8fe51c5afaca9d5196d986
|
This class method is used to access entries used by the localized application feature. Since the +app+ section of the language file is reserved for this feature this method restricts the scope of the entries available to the +app+ section. The method should only be used for application localization and therefor there is no need to access other sections of the language file with this method. app_default_value: No translation available app: index: title: Welcome to XYZ subtitle: Have a nice day... Language.app_not_scoped(:index, :subtitle) => "Have a nice day..." If the specified entry does not exists a default value is returned. If the last argument specified is a string this string is returned as default value. Assume the same language file data as above: Language.app_not_scoped(:index, "Welcome to my app") => "Welcome to my app" The "Welcome to my app" entry doesn't exists in the language file. Because the last argument is a string it will returned as a default value. If the last argument isn't a string the method will return the +app_default_value+ entry of the language file. Again, same language file data as above: Language.app_not_scoped(:index, :welcome) => "No translation available" The :welcome entry does not exists. The last argument isn't a string and therefore the value of the +app_default_value+ entry is returned. If this fall back entry does not exists +nil+ is returned. This method does not respect the scope set by the +with_app_scope+ method. This is done by the +app_scoped+ method.
|
[
{
"docid": "750f4cc92a6d1b49b3202d89fa0d8097",
"score": "0.692771",
"text": "def app_not_scoped(*keys)\n self.entry(:app, *keys) || begin\n substitution_args = if keys.last.kind_of?(Array)\n keys.pop\n elsif keys.last.kind_of?(Hash)\n [keys.pop]\n else\n []\n end\n if keys.last.kind_of?(String)\n self.substitute_entry keys.last, *substitution_args\n else\n self.entry(:app_default_value)\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "b0da8508ccc93297729283bd6a7983bb",
"score": "0.55182457",
"text": "def app_scoped(*keys)\n self.app_not_scoped(*(@@app_scope_stack.flatten + keys))\n end",
"title": ""
},
{
"docid": "f0e6e508a476a5ddccab861b23d21f36",
"score": "0.5399737",
"text": "def app_scope\n return @app_scope\n end",
"title": ""
},
{
"docid": "1ff18bf4caaa013df3631adacfd06b33",
"score": "0.53155047",
"text": "def l_scope(*sections, &block)\r\n ArkanisDevelopment::SimpleLocalization::Language.with_app_scope(*sections, &block)\r\n end",
"title": ""
},
{
"docid": "6a96de4f81357b737fb4d68a2b0101f3",
"score": "0.52502596",
"text": "def app_strings(language = nil)\n @bridge.app_strings(language)\n end",
"title": ""
},
{
"docid": "6a96de4f81357b737fb4d68a2b0101f3",
"score": "0.52502596",
"text": "def app_strings(language = nil)\n @bridge.app_strings(language)\n end",
"title": ""
},
{
"docid": "c4813ee72db6a588c4e9bab45185c250",
"score": "0.52368766",
"text": "def set_application(app)\n self.application = app\n translations.values.each do |locale_translations|\n locale_translations.each do |translation|\n translation.translation_key = self\n translation.language = self.application.language(translation.locale)\n end\n end\n self\n end",
"title": ""
},
{
"docid": "b418311d16cffa48208ffa08d3c2146b",
"score": "0.520474",
"text": "def i18n_set_locale_from_app(loc, type)\n confs = { locale: loc, translations: File.expand_path('../fixtures/**/i18n', __FILE__) }\n app(:bare) do\n plugin :i18n, confs\n route do |r|\n r.root { erb('<%= t.hello %>') }\n r.is('env') { erb(\"<%= env.inspect %>\") }\n r.is('one') { erb('<%= t.one %>') }\n r.i18n_set_locale_from(type)\n r.get('locale') { erb('<%= t.hello %>') }\n r.get('locale/one') { erb('<%= t.one %>') }\n r.get('locale', :lang) do |lng|\n @lng = lng\n # erb(%Q{<%= @lng %>})\n erb(%Q{<%= t.do.you.speak[:#{@lng}] %>}, {locals: { lng: @lng.to_sym }})\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d67c231eb66184b0d79959d5a5838885",
"score": "0.51424783",
"text": "def application\n [email protected]? && @modes.has_key?(@settings[:mode]) ? @modes[@settings[:mode]][:app] : \"unknown\"\n end",
"title": ""
},
{
"docid": "c5b6c2fce5f7756aaf97698cac1c912f",
"score": "0.5128146",
"text": "def app_scope=(value)\n @app_scope = value\n end",
"title": ""
},
{
"docid": "924867e68c4b7149608a700456f4fb9d",
"score": "0.50587803",
"text": "def index\n @app_dictionary_entries = AppDictionaryEntry.all\n end",
"title": ""
},
{
"docid": "2b098871b48b4e7aacefa7c4bad5db0b",
"score": "0.5046703",
"text": "def get_translation_info(app = nil)\r\n @@translation_info ||= {}\r\n\r\n unless @@translation_info[app].present?\r\n if app.present?\r\n location = File.join(app, info_file)\r\n else\r\n location = info_file\r\n end\r\n\r\n if File.exists?(location)\r\n @@translation_info[app] = YAML.load_file(location) || {}\r\n end\r\n end\r\n\r\n return @@translation_info[app] || {}\r\n end",
"title": ""
},
{
"docid": "b9c35f59cd7f26cc9fe88590ecbcd03c",
"score": "0.50316316",
"text": "def get_app(what, app, id)\n apps = all(case what.keys[0]\n when :study\n %Q{div.app a[href*=\"/?study_id=#{id}\"]}\n when :study_group\n %Q{div.app a[href*=\"/?studygroup_id=#{id}\"]}\n when :site\n raise \"don't know how to search for site apps\"\n when :team\n raise \"don't know how to search for team apps\"\n else\n nil\n end)\n apps.detect { |a| a['text'] == app }\n end",
"title": ""
},
{
"docid": "5fc96bc49c006bac96bb8cb71bc6b1f9",
"score": "0.5016567",
"text": "def i18n_empty_locale_app(loc)\n confs = { locale: loc, translations: File.expand_path('../fixtures/**/i18n', __FILE__) }\n app(:bare) do\n plugin :i18n, confs\n route do |r|\n r.is('one') { erb('<%= t.one %>') }\n r.locale do\n end\n r.get('two') { erb('<%= t.two %>') }\n r.root { erb('<%= t.one %>') }\n end\n end\n end",
"title": ""
},
{
"docid": "d5c391899b8aee14c9a6c1c5e99434e4",
"score": "0.4903618",
"text": "def apps_single_app_mode_list\n return @apps_single_app_mode_list\n end",
"title": ""
},
{
"docid": "57382b54ae3dee1da1ae22b2717cb4be",
"score": "0.48588604",
"text": "def config_or_app_settings(config,key,app)\n app_value = (app && app[key.to_sym] ? app[key.to_sym] : nil)\n config_or_default(config,key,app_value)\n end",
"title": ""
},
{
"docid": "b3915debd6fde7718b3e8724f1b62b6d",
"score": "0.4849408",
"text": "def i18n_locale_app(loc)\n confs = { locale: loc, translations: File.expand_path('../fixtures/**/i18n', __FILE__) }\n app(:bare) do\n plugin :i18n, confs\n route do |r|\n r.is('one') { erb('<%= t.one %>') }\n r.locale do\n r.is('t') { erb('<%= t.one %>') }\n r.is('l') { erb '<%= l Date.parse(\"October 5, 2011\") %>' }\n end\n # routes behind the block SHOULD work\n r.get('two') { erb('<%= t.two %>') }\n r.root { erb('<%= t.one %>') }\n end\n end\n end",
"title": ""
},
{
"docid": "3e91969eec2fa78b92d03b813a46cc39",
"score": "0.48396534",
"text": "def default_app()\n @apps[0]\n end",
"title": ""
},
{
"docid": "88484e6875bc69b4fdcb460f16c27352",
"score": "0.48302817",
"text": "def app_proxy(*keys)\n options = {:orginal_receiver => ''}\n options.update(keys.pop) if keys.last.kind_of?(Hash)\n options[:sections] = [:app] + keys\n CachedLangSectionProxy.new options\n end",
"title": ""
},
{
"docid": "4ca6606d881ca309cd438e0d2055677f",
"score": "0.4791153",
"text": "def application(name)\n Typus::Configuration.config.collect { |i| i.first if i.last[\"application\"] == name }.compact.uniq.sort\n end",
"title": ""
},
{
"docid": "bb0775afc44cff75fa9da7b8c784abbb",
"score": "0.47866765",
"text": "def get_global_appdata(*keys)\r\n context.appdata_to_hash do\r\n if keys.length > 0\r\n @context.call_myspace_api(:appdata_global_keys_get, :keys => keys.join(';'), :v1_json => true)\r\n else\r\n @context.call_myspace_api(:appdata_global_get, :v1_json => true)\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "cf94f86feb168200151bf03f32266a75",
"score": "0.4754852",
"text": "def show_comparison_app_label?(context, app)\n context.can_administer_site? && app.dxid == Setting.comparison_app\n end",
"title": ""
},
{
"docid": "6c635da66720af6dc9d4248731ac77d3",
"score": "0.4753614",
"text": "def metadata_any_app_get(name)\n app = node.apps.detect {|a| a.metadata?(name) } and app.metadata?(name)\n end",
"title": ""
},
{
"docid": "77069fda48a8fb76799a7988e3f9d20c",
"score": "0.47507253",
"text": "def general_application_questions\n GENERAL_APPLICATION_QUESTIONS.reduce([]) do |arr, app_question|\n db_attr, prompt = app_question\n if self.send(\"app_ques_#{db_attr}\".to_sym)\n arr << { prompt: prompt + ':' }\n end\n arr\n end\n end",
"title": ""
},
{
"docid": "908a7e5550c9337cf917216f6cab0d5e",
"score": "0.47177148",
"text": "def list_apps\n render :text => app_configs.keys\n end",
"title": ""
},
{
"docid": "05621e38c45a26ad8a367d08d2018901",
"score": "0.47124183",
"text": "def get_apps(scope)\n\t\tcase scope\n\t\twhen :added\n\t\t\treturn ClientApplication.select(\"client_applications.*\").\n\t\t\tjoins(:oauth_tokens).\n\t\t\twhere(\"oauth_tokens.invalidated_at is null and oauth_tokens.authorized_at is not null and oauth_tokens.type = 'AccessToken'\").\n\t\t\twhere(\"client_applications.id = oauth_tokens.client_application_id and oauth_tokens.user_id = #{id}\").\n\t\t\tgroup(\"client_applications.id\").\n\t\t\torder(\"oauth_tokens.authorized_at DESC\")\n\t\t\n\t\twhen :created\n\t\t\treturn apps\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5582a2ad75527b17f75fe7bb34b19d2c",
"score": "0.47096133",
"text": "def print_layout_application\n { code: :application_type, # section code\n key: :pdf_title, # key for the title translation\n key_scope: %i[applications slft application_type], # scope for the title translation\n divider: true, # should we have a section divider\n display_title: true, # Is the title to be displayed\n type: :list, # type list = the list of attributes to follow\n list_items: print_layout_application_type_list_items }\n end",
"title": ""
},
{
"docid": "bcec3664c6c2a5c5e441df86134e886f",
"score": "0.4671525",
"text": "def app_display_name\n return @app_display_name\n end",
"title": ""
},
{
"docid": "bcec3664c6c2a5c5e441df86134e886f",
"score": "0.4671525",
"text": "def app_display_name\n return @app_display_name\n end",
"title": ""
},
{
"docid": "bcec3664c6c2a5c5e441df86134e886f",
"score": "0.4671525",
"text": "def app_display_name\n return @app_display_name\n end",
"title": ""
},
{
"docid": "06741f3f993b7f60354e66c08ecab2ca",
"score": "0.46574098",
"text": "def app_list\n @app_list ||= self.send(\"#{my_os_family}_app_list\")\n end",
"title": ""
},
{
"docid": "3b2702be7bbf97126a679a8300943535",
"score": "0.46498394",
"text": "def find_app(what, item, app)\n id = get_id(what, item)\n the_app = get_app(what, app, id)\n raise \"#{what} #{item['text']} app #{app} not found\" unless the_app\n the_app\n end",
"title": ""
},
{
"docid": "5d868f2623cbe321fa84b8b1b961bd24",
"score": "0.46485406",
"text": "def applications\n get(PLURAL_PATH, RESOURCE)\n end",
"title": ""
},
{
"docid": "f0275fe28dc796c54d7a4309a78cefe6",
"score": "0.46387485",
"text": "def enabled_locales(app_path = nil)\r\n ::LinguaFranca.enabled_locales(app_path)\r\n end",
"title": ""
},
{
"docid": "9708bf05e93fb795ddd0cc9962038613",
"score": "0.4629337",
"text": "def lookup(locale, key, scope = [], options = {})\n\n init_translations unless initialized?\n result = nil\n _locale = ::Locale.first(:code => locale)\n key = pluralizer(_locale, key, options[:count])\n value = _locale.translations.first(:code => key)\n result = value.value unless value.nil?\n result = options[:default] if !value.nil? && value.value == key && options[:default]\n return result unless value.nil? || value.value == key\n \n # check devise messages for remaining keys\n result = _locale.translations.first(:code => \"devise.sessions.#{key}\")\n return result.value unless result.nil?\n\n # fall back on yaml file if no object is found in db\n keys = I18n.normalize_keys(locale, key, scope, options[:separator])\n keys.inject(translations) do |result, _key|\n return nil unless result.is_a?(Hash) && result.has_key?(_key)\n result = result[_key]\n result = resolve(locale, _key, result, options.merge(:scope => nil)) if result.is_a?(Symbol)\n result = options[:default] if options[:default] && result.nil?\n result\n end\n \n end",
"title": ""
},
{
"docid": "47bc5cb12f518967b7975de785d4eede",
"score": "0.46272594",
"text": "def configLocals(spaces, apps)\n puts(self.class.name + '.' + __method__.to_s + ' - ' + Time.now.utc.to_s)\n @local_spaces_ids = {}\n @local_apps_ids1 = {}\n\n for i in 0...spaces.total_count\n if spaces.type(i) == $enum_type[:local] && spaces.area(i) == $enum_area[:igip]\n @local_spaces_ids[spaces.id(i)] = nil\n end\n end\n\n @entities1 = []\n for j in 0...apps.total_count\n work_id = apps.workspace_id_calculated(j)\n for i in 0...spaces.total_count\n if spaces.id(i) == work_id && !spaces.entity(i).nil? && spaces.area(i) == $enum_area[:igip]\n @entities1 << spaces.entity(i)\n end\n end\n end\n\n @entities1.uniq!\n for entity in @entities1 do\n app1 = nil\n app2 = nil\n app3 = nil\n app4 = nil\n app5 = nil\n for j in 0...apps.total_count\n work_id = apps.workspace_id_calculated(j)\n for i in 0...spaces.total_count\n if spaces.id(i) == work_id && !spaces.entity(i).nil? && spaces.entity(i).eql?(entity) && spaces.area(i) == $enum_area[:igip]\n case apps.name(j)\n when $enum_iGIP_apps_name[:open] then app1 = GIPOpportunityDAO.new(apps.id(j))\n when $enum_iGIP_apps_name[:in_progress] then app2 = GIPOpportunityDAO.new(apps.id(j))\n when $enum_iGIP_apps_name[:match] then app3 = GIPOpportunityDAO.new(apps.id(j))\n when $enum_iGIP_apps_name[:realize] then app4 = GIPOpportunityDAO.new(apps.id(j))\n when $enum_iGIP_apps_name[:history] then app5 = GIPOpportunityDAO.new(apps.id(j))\n end\n end\n @local_apps_ids1[entity] = {:app1 => app1,\n :app2 => app2,\n :app3 => app3,\n :app4 => app4,\n :app5 => app5}\n\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "759d62d9cf0cbef694e0dcc907695ddc",
"score": "0.4622862",
"text": "def app_scope_id\n return @app_scope_id\n end",
"title": ""
},
{
"docid": "781368e67c9d5aedd22e53b884ddaa88",
"score": "0.4608068",
"text": "def locale_scope\n I18n::Scope.new(locale_translations)\n end",
"title": ""
},
{
"docid": "18e5411c55442f2f636f9f652067a7c2",
"score": "0.46072936",
"text": "def scope\n @scope ||= \"study.#{app_name}\"\n end",
"title": ""
},
{
"docid": "04ccfcaaee76ca2ec7a3862960b52423",
"score": "0.460511",
"text": "def list_apps\n check_scope!\n\n apps = App.accessible_by(@context).unremoved.includes(:app_series).order(:title)\n apps = apps.where(scope: params[:scopes]) if params[:scopes].present?\n\n # Filter by latest revisions or versions.\n # This is kinda tricky, but we need to handle the apps which revisions were moved to a space\n # before we migrated to the new way how app is published to a space.\n apps = apps.select(&:latest_accessible_in_scope?)\n\n result = apps.map do |app|\n describe_for_api(app, unsafe_params[:describe])\n end\n\n render json: result\n end",
"title": ""
},
{
"docid": "ec34c690d16a03ca255355d1d1d1da96",
"score": "0.4593309",
"text": "def [](ns)\n namespaces = ns.to_s.split(\":\").compact\n rtn = @applications.find {|a| a.name == namespaces.shift }\n begin\n while (!namespaces.empty?)\n rtn = rtn[namespaces.shift]\n end\n rescue\n return nil\n end\n return rtn\n end",
"title": ""
},
{
"docid": "702caa0a05bcd764ea1b3bb19558d9f9",
"score": "0.4585041",
"text": "def app_dictionary_entry_params\n params.require(:app_dictionary_entry).permit(:name)\n end",
"title": ""
},
{
"docid": "ac8d14c9a1661de53688525f5fa29efe",
"score": "0.45812312",
"text": "def set_app_dictionary_entry\n @app_dictionary_entry = AppDictionaryEntry.find(params[:id])\n end",
"title": ""
},
{
"docid": "a56c1b670469a27b0e1c7550e5f61f42",
"score": "0.45805153",
"text": "def kiosk_mode_apps\n return @kiosk_mode_apps\n end",
"title": ""
},
{
"docid": "c545d08501e7d0a6c5e483f57a948287",
"score": "0.45745835",
"text": "def compliant_apps_list\n return @compliant_apps_list\n end",
"title": ""
},
{
"docid": "c545d08501e7d0a6c5e483f57a948287",
"score": "0.45745835",
"text": "def compliant_apps_list\n return @compliant_apps_list\n end",
"title": ""
},
{
"docid": "c489a09d6bf71e1ce9c6383c5bb7774d",
"score": "0.45713645",
"text": "def apps\n @apps.keys\n end",
"title": ""
},
{
"docid": "36bdc9d0617e2858c4bd1c263af60b7f",
"score": "0.45707598",
"text": "def app(*args)\n\t\tif args == []\n\t\t\treturn MRA_App\n\t\telse\n\t\t\treturn MRA_App.by_name(*args)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "978bed28d9fb7e8b19d5ba5dab9ee63c",
"score": "0.45702112",
"text": "def get_appdata_global (*keys)\n @restv1.get_global_appdata(*keys)\n end",
"title": ""
},
{
"docid": "eb46f6d6f7e231df2ef35f172f36f3be",
"score": "0.4568769",
"text": "def get_global_appdata(*keys)\n MySpace.appdata_to_hash do\n if keys.length > 0\n call_myspace_api(:appdata_global_keys_get, :keys => keys.join(';'), :v1_json => true)\n else\n call_myspace_api(:appdata_global_get, :v1_json => true)\n end\n end\n end",
"title": ""
},
{
"docid": "62edb6363e774eaf1f956fb62e116cab",
"score": "0.45682856",
"text": "def explain_application_info(org_text)\n retval = {} # Default\n return retval unless org_text\n\n if org_text.match('Application = ')\n appl = SyspApplication.get_cached_instance(org_text.split(' ')[2].to_i)\n if appl\n retval[:short_info] = appl.name\n retval[:long_info] = \"#{appl.description} >> Team: #{appl.developmentteam.name}\"\n else\n retval[:short_info] = \"Application not found for #{org_text}\"\n end\n end\n\n if org_text.match('ID_WSMethod = ')\n ws = Wsmethod.get_cached_instance(org_text.split(' ')[2].to_i)\n if ws\n retval[:short_info] = ws.name\n retval[:long_info] = \"#{ws.name}\"\n else\n retval[:short_info] = \"WSMethod not found for #{org_text}\"\n end\n end\n\n if org_text.match('ID_OFMsgType = ')\n mt = Ofmessagetype.get_cached_instance(org_text.split(' ')[2].to_i, session[:database].hash)\n if mt\n retval[:short_info] = mt.name\n retval[:long_info] = \"#{mt.description} >> Domain: #{mt.domain.name}\"\n else\n retval[:short_info] = \"OFMessagetype not found for #{org_text}\"\n end\n end\n\n\n\n retval\n end",
"title": ""
},
{
"docid": "b9b618d7f1661233ecf369906fde6a76",
"score": "0.45609197",
"text": "def customize_en_us_dictionary(dict)\n dict.add('admin')\n dict.add('admin_authenticator')\n dict.add('apps')\n dict.add('Authy')\n dict.add('cancelled')\n dict.add('captcha')\n dict.add('code_verifier')\n dict.add('COVID-19')\n dict.add('HTTPS')\n dict.add('ltr')\n dict.add('OAuth')\n dict.add('OAuth2')\n dict.add('org')\n dict.add('pkce')\n dict.add('pre-authorization')\n dict.add('resource_owner_authenticator')\n dict.add('resource_owner_from_credentials')\n dict.add('S256')\n dict.add('saraalert')\n dict.add('SMS')\n dict.add('SSL')\n dict.add('UID')\n dict.add('unconfigured')\n dict.add('uri')\n dict.add('urls')\n dict.add('webpage')\n end",
"title": ""
},
{
"docid": "67e20479a95abc91804490b2b4864bb9",
"score": "0.4557547",
"text": "def find_application\n unless self.app_name.blank?\n my_apps = []\n # in the case of an array, the new finder will not work\n Array(self.app_name).each do |individual_name|\n new_apps = App.active.by_short_or_long_name(individual_name)\n logger.info \"new_apps\" + new_apps.inspect\n my_apps += new_apps unless new_apps.blank?\n logger.info \"my_apps\" + my_apps.inspect\n end\n unless my_apps.blank? || my_apps.length != Array(self.app_name).length\n self.apps << my_apps - self.apps\n else\n self.application_lookup_failed = true\n end\n end\n # be sure the call back returns true or else the call will fail with no error message\n # from the validation loop\n return true\n end",
"title": ""
},
{
"docid": "a74c09a6f334e88978002ef9ada1f20c",
"score": "0.45560208",
"text": "def localized(value=nil, table=nil)\n @localized = NSBundle.mainBundle.localizedStringForKey(self, value:value, table:table)\n end",
"title": ""
},
{
"docid": "19ce82c44f3f8baaecb4e32d04daad03",
"score": "0.45476925",
"text": "def lookup(locale, key, scope = T.unsafe(nil), options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "821c4c6f23705569e9cf4d8eebd720cd",
"score": "0.45283216",
"text": "def application_name\n @application_name ||= t('application.name')\n end",
"title": ""
},
{
"docid": "76efac3761a5d6f85b92f9b851b8e7d2",
"score": "0.45140257",
"text": "def my_application_log_entries\n @logging.entries(\n filter: %(logName=\"#{my_application_log_name}\")\n )\n end",
"title": ""
},
{
"docid": "fc925a4a8bb477f6803b9a62db1970dc",
"score": "0.45139116",
"text": "def load_all_entries\n results = self.all :order=>\"locale, key\"\n data = {}\n\n results.each do |result|\n #create an empty hash for each locale initially\n data[result.locale] ||= {}\n\n # create the deep nested scopes from the dotted key\n scopes = result.key.split(\".\").map{|k| k.to_sym}\n key = scopes.pop\n scope = scopes.inject(data[result.locale]) do |scope, s|\n # a new scope is empty initially\n # if its a simple string override it with a empty hash\n scope[s] = {} unless scope[s] and scope[s].is_a?(Hash)\n scope[s]\n end\n\n # if we have a pluralization form and the translation key already exists add the specific pluralization form\n if scope[key] && scope[key].is_a?(Hash) && !result.pluralization_index.blank?\n scope[key][result.pluralization_index] = result.text\n\n # if we have a pluralization index add the initial hash\n elsif !result.pluralization_index.blank?\n scope[key] = { result.pluralization_index.to_sym => result.text.to_s }\n\n # else we just add the simple text\n else\n scope[key] = result.text\n end\n\n end\n return data\n end",
"title": ""
},
{
"docid": "4ffd45abdd269a62e1510d430142c5f3",
"score": "0.45125926",
"text": "def require_entries; end",
"title": ""
},
{
"docid": "4b52069783d6fe7a8e258e4e17c1c046",
"score": "0.45028028",
"text": "def lookup(app_name)\n unless @metadata.key?(app_name)\n data = YAML.load_file(\"./data/applications/#{app_name}.yaml\")\n @metadata[app_name] = data['cots::app_metadata']\n end\n @metadata[app_name]\n end",
"title": ""
},
{
"docid": "6f0439696a516a40658472fef1b1fe97",
"score": "0.44947675",
"text": "def application\n @env.fetch( :application, \"N/A\" )\n end",
"title": ""
},
{
"docid": "d0c35f723c03f659871b32dbeb6d41a4",
"score": "0.4490819",
"text": "def lookup_global_silent(param)\n @context.find_global_scope.to_hash[param]\nend",
"title": ""
},
{
"docid": "1c29dad29ad78e5db8effaeee03efe34",
"score": "0.44863907",
"text": "def _(key,value=\"\")\n NSBundle.mainBundle.localizedStringForKey(key, value:value, table:nil)\n end",
"title": ""
},
{
"docid": "a2d0140c83fe1eb271cc44f697776418",
"score": "0.44841152",
"text": "def get_fav_prog_lang()\n return @fav_prog_lang\n end",
"title": ""
},
{
"docid": "b3b3382cb85c9d800c9b9dfa2e6752ac",
"score": "0.44704565",
"text": "def verify_available_info_languages!(options, app, languages)\n app_info = fetch_edit_app_info(app)\n\n unless app_info\n UI.user_error!(\"Cannot update languages - could not find an editable info\")\n return\n end\n\n localizations = app_info.get_app_info_localizations\n\n languages = (languages || []).reject { |lang| lang == \"default\" }\n locales_to_enable = languages - localizations.map(&:locale)\n\n if locales_to_enable.count > 0\n lng_text = \"language\"\n lng_text += \"s\" if locales_to_enable.count != 1\n Helper.show_loading_indicator(\"Activating info #{lng_text} #{locales_to_enable.join(', ')}...\")\n\n locales_to_enable.each do |locale|\n app_info.create_app_info_localization(attributes: {\n locale: locale\n })\n end\n\n Helper.hide_loading_indicator\n\n # Refresh version localizations\n localizations = app_info.get_app_info_localizations\n end\n\n return localizations\n end",
"title": ""
},
{
"docid": "fcbc44e7e042404337ce58b8244ffda0",
"score": "0.44695953",
"text": "def get_appdata(node, appname, attribute = nil)\n data = {}\n if node.fetch('deploy', {}).fetch(appname, {})['application'].nil?\n data['appname'] = appname\n else\n data['appname'] = node['deploy'][appname]['application']\n end\n\n data['domains'] = get_domains(node, appname)\n\n if ::EasyBib.is_aws(node)\n data['deploy_dir'] = node['deploy'][appname]['deploy_to']\n\n data['app_dir'] = get_app_dir(data['deploy_dir'])\n\n data['doc_root_dir'] = \"#{data['app_dir']}#{node['deploy'][appname]['document_root']}\"\n else\n data['deploy_dir'] = data['app_dir'] = get_vagrant_appdir(node, appname)\n\n if node.fetch('vagrant', {}).fetch('applications', {}).fetch(appname, {})['doc_root_location'].nil?\n fail \"node[vagrant][applications][#{appname}][doc_root_location] is not set - fix web_dna.json!\"\n end\n\n data['doc_root_dir'] = node['vagrant']['applications'][appname]['doc_root_location']\n end\n\n # ensure all dirs end with a slash:\n %w(deploy_dir app_dir doc_root_dir).each do |name|\n data[name] << '/' unless data[name].end_with?('/')\n end\n\n if attribute.nil?\n return data\n end\n\n value = data[attribute]\n fail \"Could not get #{attribute} for #{appname}!\" if value.nil? || value.empty?\n\n value\n end",
"title": ""
},
{
"docid": "d7649d4f112c18a119f41dd273bc3515",
"score": "0.44693074",
"text": "def current_application\n # Get from last year for Postgresql\n @current_application ||= self.applications.current.first\n end",
"title": ""
},
{
"docid": "33bc9a4937e150d6e79a559de3cf60c0",
"score": "0.44651383",
"text": "def available_languages\n AppConfig.available_languages\n end",
"title": ""
},
{
"docid": "8b9d1137870c2ebd4c275c5c77615063",
"score": "0.44647208",
"text": "def org_language(item:)\n dflt = I18n.default_locale || 'en'\n return dflt unless item.present?\n\n labels = item.fetch('labels', [{ iso639: dflt }])\n labels.first&.fetch('iso639', I18n.default_locale) || dflt\n end",
"title": ""
},
{
"docid": "15aba78f2515125bf970bc4937e8dbd4",
"score": "0.44629675",
"text": "def entry(*args)\n if args.last.kind_of?(Hash)\n options = {:values => nil}.merge args.delete_at(-1)\n options.assert_valid_keys :values\n format_values = Array(options[:values])\n end\n \n if args.last.kind_of?(Array)\n format_values = args.delete_at(-1)\n end\n \n lang_entry = self.find(self.current_language, *args)\n \n if format_values\n begin\n format(lang_entry, *format_values)\n rescue StandardError => e\n self.debug ? raise(EntryFormatError.new(self.current_language, args, lang_entry, format_values, e)) : lang_entry\n end\n else\n lang_entry\n end\n end",
"title": ""
},
{
"docid": "231cf713f3f733398558e8d78fbac988",
"score": "0.44574222",
"text": "def i18n_scope\n self.class.i18n_scope\n end",
"title": ""
},
{
"docid": "231cf713f3f733398558e8d78fbac988",
"score": "0.44574222",
"text": "def i18n_scope\n self.class.i18n_scope\n end",
"title": ""
},
{
"docid": "1d7b9002cea8b4927dbcf8fdb251373c",
"score": "0.44521287",
"text": "def app_list\n host_os_family.app_list( self )\n end",
"title": ""
},
{
"docid": "c5c1171f900e8954a0d9f167b1718f38",
"score": "0.44497073",
"text": "def app(id_or_name_or_package_id)\n all_available_apps.find do |app|\n [app.name, app.id, app.package_id].include?(id_or_name_or_package_id)\n end\n end",
"title": ""
},
{
"docid": "3d6b742f9abd1062dfacd71bd4cc1c4a",
"score": "0.44494137",
"text": "def category\n conf['category'] || 'apps'\n end",
"title": ""
},
{
"docid": "b7c9fceea99ad8bcd566613b7bbf3475",
"score": "0.44454205",
"text": "def appl_settings\n @appl_settings\n end",
"title": ""
},
{
"docid": "c545b8c9358b9b615eea700d1d671b6b",
"score": "0.44435352",
"text": "def language_options(current_value = nil)\n standard_options = [ [t('patient.helper.language.English'),nil] ]\n full_set = standard_options + Config.find_or_create_by(config_key: 'language').options\n\n options_plus_current(full_set, current_value)\n end",
"title": ""
},
{
"docid": "c642c1985d55fb54bc71b1050f34bb09",
"score": "0.44411922",
"text": "def localizations\n @@locales[Locale.code] || {}\n end",
"title": ""
},
{
"docid": "1ac1f1f6c70dc22f8aab07c6ab0b1b0d",
"score": "0.44331345",
"text": "def default(app)\n @default_app = app\n end",
"title": ""
},
{
"docid": "a5e6d44859168ff326a75e8fd4f2bc97",
"score": "0.44300967",
"text": "def get_scope_of_context\n stack_to_analyse = $lc_test_get_scope_of_context_stack || caller\n latest_app_file = stack_to_analyse.detect { |level| level =~ /#{Regexp.escape(RAILS_ROOT)}\\/app\\/(controllers|views|models)\\// }\n return [] unless latest_app_file\n \n path = latest_app_file.match(/([^:]+):\\d+.*/)[1]\n dir, file = path.match(/^#{Regexp.escape(RAILS_ROOT)}\\/app\\/(controllers|views|models)\\/(.+)#{Regexp.escape(File.extname(path))}$/)[1, 2]\n \n scope = file.split('/')\n case dir\n when 'controllers'\n scope.last.gsub! /_controller$/, ''\n when 'views'\n scope.last.gsub! /^_/, ''\n when 'models'\n scope.last.gsub! /_observer$/, ''\n end\n \n scope\n end",
"title": ""
},
{
"docid": "60b51eea1c5bec95aa3ebf6fba4c14dc",
"score": "0.44286478",
"text": "def app_environments(env_filter=\"\")\n apps.each_with_object([]) do |(app, hsh), arr|\n hsh.each { |env, app_name| arr << self.class.app_name(app, env) if (env_filter.nil? || env_filter.empty?) || env == env_filter }\n end\n end",
"title": ""
},
{
"docid": "44dd925ddeb55d8856b0c68d982401df",
"score": "0.44239643",
"text": "def apps_visibility_list\n return @apps_visibility_list\n end",
"title": ""
},
{
"docid": "0854c7bd282766db2c56ea5e8579860f",
"score": "0.44135594",
"text": "def language_strings(data_version = nil)\n language_string = get(resource_path('language-strings'), @version, version: data_version)\n RiotGamesApi::LOL::Model::StaticData::LanguageString.new language_string\n end",
"title": ""
},
{
"docid": "57be75f815b73b2c4538b8a013202ce5",
"score": "0.44131282",
"text": "def data_dictionary_page\n page(page_sys_data_dictionary) if system_space?\n end",
"title": ""
},
{
"docid": "9a1a9160a82f30cc65e48694b076cff4",
"score": "0.44129276",
"text": "def load_appl_settings\n Configuration::Application::SETTINGS\n end",
"title": ""
},
{
"docid": "6e6fee385b387a1df1f666351a155dc9",
"score": "0.4411085",
"text": "def main_app\n @main_app\n end",
"title": ""
},
{
"docid": "15581e0a72df10ec892a97ca18ac9bcc",
"score": "0.44071308",
"text": "def app_definitions\n return @app_definitions\n end",
"title": ""
},
{
"docid": "71f95c795867faa33107c798ec56123c",
"score": "0.44042918",
"text": "def getMyEnterpriseAPP\n \treturn view_context.getMyEnterprise\n end",
"title": ""
},
{
"docid": "66202617cca4c7a7620626aeccbec29e",
"score": "0.43909436",
"text": "def typus_application\n Typus::Configuration.config[name][\"application\"] || \"Unknown\"\n end",
"title": ""
},
{
"docid": "544628523b9826644254f3fc936f20f3",
"score": "0.4390486",
"text": "def application_name\n # It's important that we don't use ActionView::Helpers::CacheHelper#cache here\n # because it returns nil.\n Rails.cache.fetch 'blacklight/application_name' do\n t('blacklight.application_name',\n default: t('blacklight.application_name', locale: I18n.default_locale))\n end\n end",
"title": ""
},
{
"docid": "aeef78a8cfe56621a432dca51fbd0a1a",
"score": "0.4390348",
"text": "def app_ver\n @values.fetch('appVer') { \n @values['appVer'] = nil\n }\n end",
"title": ""
},
{
"docid": "dd3ac4bbc73407648fcaf1682292c81c",
"score": "0.4388077",
"text": "def decide\n @meta = { title: 'Select Application', description: 'Select the application you want to login to' }\n @user_app_access_list = retrieve_user_access_list_for_app(current_user,current_app)\n end",
"title": ""
},
{
"docid": "6a3532c475a9b8dce8166b0e24b9a3bc",
"score": "0.43848732",
"text": "def app_name\n @app_name || Sapience.app_name\n end",
"title": ""
},
{
"docid": "a0c8b2e0e0d5c72d1c39307499b222c3",
"score": "0.4384518",
"text": "def apps_hide_list\n return @apps_hide_list\n end",
"title": ""
},
{
"docid": "a797e17a5f0aedce5b999db480b6cc5b",
"score": "0.43820417",
"text": "def scan_app(app)\n format_regular = true\n if (!app) # end recursion\n return @app_data\n end\n\n # remove leading ;\n if app.is_a? Integer # for applications that are just one year\n app = app.to_s\n else\n app.sub!(/^\\;/, \"\")\n end\n\n # check for string starting with dates\n date_range = app.scan(/\\A\\W*(\\d{2})-{0,1}(\\d{0,2})\\s(.*)/)\n\n # if reverse format (text first, then date)\n if(date_range.length == 0)\n # check if make/model are before date\n if((date_range2 = app.scan(/(\\D*)(\\d{2})-{0,1}(\\d{0,2})\\s*(.*)/)).length == 0)\n return @app_data\n else # Set correct values\n format_regular = false\n date_range[0] = []\n date_range[0][0] = date_range2[0][1] # set correct start year\n date_range[0][1] = date_range2[0][2] # set correct end year\n date_range[0][2] = date_range2[0][0] + \" \" + date_range2[0][3] # set correct text\n end\n end\n\n #if(date_range[0][2].slice(/\\;.*/)) # scan items separated by semi-colon\n scan_app(date_range[0][2].slice!(/\\;.*/))\n #else\n #scan_app(date_range[0][2].slice!(/\\d{2}-{0,1}\\d{0,2}\\s.*/)) # scan dates remaining\n #end\n\n @app_data << { :start_year => date_range[0][0], :end_year => date_range[0][1], :text => date_range[0][2].strip}\n # end\n end",
"title": ""
},
{
"docid": "8c18d38b08f4f65d80b4e0785da1713e",
"score": "0.43770933",
"text": "def fallback_localization(locale, key_without_locale)\n value = nil\n return nil unless fallbacks = ::Rails.application.config.i18n.fallbacks\n keys = fallbacks == true ? @locale_cache.keys : fallbacks\n keys.map(&:to_s).each do |lc|\n if lc != locale.locale && value.nil?\n nk = \"#{lc}.#{key_without_locale}\"\n v = localizations[nk]\n value = v if v.present? && value.nil?\n end\n end\n value\n end",
"title": ""
},
{
"docid": "141d1c8a7109562199b0a14e763d3888",
"score": "0.4374853",
"text": "def localize(key, error_msg='__localization_missing__', args={}, locale=nil)\n return if reserved_keys.include? key\n\n # Set a temporary Locale to support the localized_in method\n #\n unless locale.nil?\n @original_locale = Locale.code\n Locale.set_code(locale)\n end\n localized = localizations[key] || error_msg\n # Get translations from another country but in the same language if Globalite can't find a translation for my locale\n #\n if localized == error_msg\n locales.each do |t_locale|\n if t_locale.to_s.include?(\"#{current_language.to_s}-\") && t_locale != Locale.code\n localized = @@locales[t_locale][key] || error_msg\n end\n end\n end\n localized = interpolate_string(localized.dup, args.dup) if localized.class == String && localized != error_msg\n\n # let's handle pluralization if needed\n # the translation must include pluralize{count, singular string} to be translated\n # the translator can also pass the plural form if needed:\n # pluralize{3, goose, geese}\n localized = localized.gsub( /pluralize\\{(.*)\\}/){ |erb| pluralize(Regexp.last_match(1)) } if localized.is_a?(String) && (localized=~ /pluralize\\{(.*)\\}/)\n\n # Set the locale back to normal\n #\n unless locale.nil?\n Locale.code = @original_locale\n end\n\n return localized\n end",
"title": ""
},
{
"docid": "33b50d721cf53b01c7c006fd7a812072",
"score": "0.43739364",
"text": "def process_application_default_auth(options)\n ::Google::Auth.get_application_default(options[:google_api_scope_url])\n end",
"title": ""
},
{
"docid": "76ccaa3f98f2c9ef070763b386e0a0d7",
"score": "0.43702284",
"text": "def app_for(name)\n app_name = app?(name) ? name : \"all\"\n\n @apps[name] ||= App.new(app_name, @roots)\n end",
"title": ""
},
{
"docid": "e22e016c942ec16bf0dade7a7ac0470a",
"score": "0.4365753",
"text": "def app\n defined?(@app) ? @app : build_app\n end",
"title": ""
},
{
"docid": "e841eb9d31ce50db8c614f1c9f0da5be",
"score": "0.43579298",
"text": "def language; languages.first; end",
"title": ""
}
] |
43a1f2e52a298213793a3c75960bf424
|
Test if a Pokemon can Mega Evolve
|
[
{
"docid": "f9da72d2e162ee3df9ca311a874f64d8",
"score": "0.78617215",
"text": "def can_pokemon_mega_evolve?(pokemon, bag)\n return false unless MEGA_EVOLVE_TOOLS.any? { |item_db_symbol| bag.contain_item?(item_db_symbol) }\n\n return !@mega_evolved_trainer_ids.include?(pokemon.trainer_id) && pokemon.can_mega_evolve?\n end",
"title": ""
}
] |
[
{
"docid": "e1437f27768d11103643b9491a566f84",
"score": "0.6620153",
"text": "def superShiny?\n return self.pokemon && self.pokemon.superShiny?\n end",
"title": ""
},
{
"docid": "d99fe1568a87d91562815cfbad186a49",
"score": "0.6596971",
"text": "def can_loot?\n false\n end",
"title": ""
},
{
"docid": "de23b748791c75c40417b9c4a930aaf0",
"score": "0.6555598",
"text": "def check_evolution_internal\r\n return nil if egg? || shadowPokemon?\r\n return nil if hasItem?(:EVERSTONE)\r\n return nil if hasAbility?(:BATTLEBOND)\r\n species_data.get_evolutions(true).each do |evo| # [new_species, method, parameter, boolean]\r\n next if evo[3] # Prevolution\r\n ret = yield self, evo[0], evo[1], evo[2] # pkmn, new_species, method, parameter\r\n return ret if ret\r\n end\r\n return nil\r\n end",
"title": ""
},
{
"docid": "53aae26947c9384c361b8863569b6c38",
"score": "0.65554166",
"text": "def check_priority_trigger_quick_claw(pokemon)\n return rand(100) < 20\n end",
"title": ""
},
{
"docid": "7b2a32ad64844e81bee9330b601f1af3",
"score": "0.6542072",
"text": "def can_player_make_another_action_choice?\n @player_actions.size.upto(@logic.battle_info.vs_type - 1) do |position|\n next_pokemon = @logic.battler(0, position)\n # If there's no Pokemon at this position, then it's probably the end of the team\n break unless next_pokemon\n # If it's not our Pokemon we don't control it\n next(@player_actions << {}) if next_pokemon.party_id != 0\n # If the Pokemon is dead, we also don't control it\n next(@player_actions << {}) if next_pokemon.dead?\n # This Pokemon can be controlled\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "c24eddbdde5abf4cfcab146e81c4c9ea",
"score": "0.6514234",
"text": "def check_evolution_on_level_up\r\n return check_evolution_internal { |pkmn, new_species, method, parameter|\r\n success = GameData::Evolution.get(method).call_level_up(pkmn, parameter)\r\n next (success) ? new_species : nil\r\n }\r\n end",
"title": ""
},
{
"docid": "cb5088c4bd96c5fc0d50eeb92a835024",
"score": "0.64842165",
"text": "def pbCheckAble(pokemonIndex)\n for i in 0...$Trainer.party.length\n next if i==pokemonIndex\n p = $Trainer.party[i]\n return true if p && !p.egg? && p.hp>0\n end\n return false\nend",
"title": ""
},
{
"docid": "851ac102d4c71262ece4e87adfbf83b6",
"score": "0.6444415",
"text": "def pbAllFainted\n return $Trainer.ablePokemonCount==0\nend",
"title": ""
},
{
"docid": "0be5e3a948e8b5989f1524881c0c4759",
"score": "0.64440733",
"text": "def should_eat?\n !stat_boosted?\n end",
"title": ""
},
{
"docid": "59a99f1f11550a94e59c4ced0cb28cc0",
"score": "0.6430313",
"text": "def have_double_wild_battle?\r\n return false if $PokemonTemp.forceSingleBattle\r\n return false if pbInSafari?\r\n return true if $PokemonGlobal.partner\r\n return false if $Trainer.able_pokemon_count <= 1\r\n return true if $game_player.pbTerrainTag.double_wild_encounters && rand(100) < 30\r\n return false\r\n end",
"title": ""
},
{
"docid": "96f25465b1aa8d010fca8eaed527a973",
"score": "0.63357836",
"text": "def have_lives?\r\n @chances >= 1\r\n end",
"title": ""
},
{
"docid": "eb02cc6ef5fa3525ebe5aaca4a51ec0a",
"score": "0.63042945",
"text": "def check_for_a_bomb\n warrior.listen.each do |unit|\n if Captives.include? unit.to_s.to_sym and unit.ticking?\n return true\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "7fede337d019838a562abae14e51bd8b",
"score": "0.6282196",
"text": "def occasion_ok?(item)\r\n $game_party.in_battle ? item.battle_ok? : item.menu_ok?\r\n end",
"title": ""
},
{
"docid": "b5ae36a6f41597c1473a27592d079097",
"score": "0.6246394",
"text": "def hungry?\n\n\t\t @stuff_in_belly <= 2\n\t\tend",
"title": ""
},
{
"docid": "1cf5dd8b7cc29ff5981d934cfe5aaa4b",
"score": "0.6241714",
"text": "def elv_kicklee\n atk > dfe\n end",
"title": ""
},
{
"docid": "e765e0185f1237f61f3238bd8c626508",
"score": "0.62267524",
"text": "def activate_guts?\n rand < guts_chance\n end",
"title": ""
},
{
"docid": "6aef210bbe591da63b672ab274b55434",
"score": "0.6214055",
"text": "def unstable?\n harm > 3\n end",
"title": ""
},
{
"docid": "72ede5a6a508382dfb7db2476470b9f6",
"score": "0.6204159",
"text": "def poisonAllPokemon(event=nil)\n for pkmn in $Trainer.ablePokemonParty\n next if pkmn.hasType?(:POISON) || pkmn.hasType?(:STEEL) ||\n pkmn.hasAbility?(:COMATOSE) || pkmn.hasAbility?(:SHIELDSDOWN) || pkmn.hasAbility?(:IMMUNITY)\n pkmn.status!=0\n pkmn.status = 2\n pkmn.statusCount = 1\n end\nend",
"title": ""
},
{
"docid": "4fbca08585539abe643c23074072052e",
"score": "0.6189906",
"text": "def hungry?\r\n # methods that return true or false\r\n @stuff_in_belly <= 2\r\n end",
"title": ""
},
{
"docid": "a460fe1453bfbd80907e4b2e3245533e",
"score": "0.6177298",
"text": "def elv_demanta\n $pokemon_party.has_pokemon?(223)\n end",
"title": ""
},
{
"docid": "a58682cf67304d93e0610521300c3097",
"score": "0.6173343",
"text": "def is_pokemon_strong_against(launcher, target)\n useless = true\n max_mod = 0\n # Useless check\n launcher.skills_set.each do |skill|\n if !skill.status?\n if (mod = BattleEngine::_type_modifier_calculation(target, skill)) > 0\n useless = false\n max_mod = mod if mod > max_mod\n end\n end\n end\n return nil if useless\n return true if max_mod >= 2\n return false\n end",
"title": ""
},
{
"docid": "d8967031bcf9718b1016ba799c6b41cb",
"score": "0.6167218",
"text": "def moleable?\n @moleable\n end",
"title": ""
},
{
"docid": "3e5d7c282f65e6b77f1a7054a2abcb86",
"score": "0.6163305",
"text": "def can_battle?(id)\n has_pokemon?(id) && (Graphics.current_time - get(id)[:slather_time]) > WAIT_TO_BATTLE\n end",
"title": ""
},
{
"docid": "51ccfabc67be72c03daf7fc58bfc0ef1",
"score": "0.6161616",
"text": "def pbBikeCheck\n if $PokemonGlobal.surfing ||\n (!$PokemonGlobal.bicycle && pbGetTerrainTag==PBTerrain::TallGrass)\n Kernel.pbMessage(_INTL(\"Can't use that here.\"))\n return false\n end\n# if $game_player.pbHasDependentEvents?\n# Kernel.pbMessage(_INTL(\"It can't be used when you have someone with you.\"))\n# return false\n# end\n if $PokemonGlobal.bicycle\n if pbGetMetadata($game_map.map_id,MetadataBicycleAlways)\n Kernel.pbMessage(_INTL(\"You can't dismount your Bike here.\"))\n return false\n end\n return true\n else\n val=pbGetMetadata($game_map.map_id,MetadataBicycle)\n val=pbGetMetadata($game_map.map_id,MetadataOutdoor) if val==nil\n if !val\n Kernel.pbMessage(_INTL(\"Can't use that here.\"))\n return false\n end\n return true\n end\nend",
"title": ""
},
{
"docid": "cdd84ff43b5caa42db4b67e5e7b2dc68",
"score": "0.61594653",
"text": "def can_battle_continue?\n return false if @battle_result >= 0\n banks_that_can_fight = []\n @battlers.each_with_index do |battler_bank, bank|\n battler_bank.each do |battler|\n break(banks_that_can_fight << bank) if battler&.can_fight?\n end\n end\n # It's a victory if the player still have a Pokemon on its bank\n if banks_that_can_fight.size <= 1\n @battle_result = banks_that_can_fight.include?(0) ? 0 : 1\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "14bdde8019b13b543a7c3a88483ee5fc",
"score": "0.6149415",
"text": "def maybe_pause_evolution\n\n end",
"title": ""
},
{
"docid": "4e5299bfb27d45ee5fba2a9f783f25cf",
"score": "0.61430347",
"text": "def hungry?\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "4e5299bfb27d45ee5fba2a9f783f25cf",
"score": "0.61430347",
"text": "def hungry?\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "4e5299bfb27d45ee5fba2a9f783f25cf",
"score": "0.61430347",
"text": "def hungry?\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "ecaa4df76b69735b0ddf5c7aa8d785a4",
"score": "0.611865",
"text": "def hungry?\n\t @stuff_in_belly <= 2\n\tend",
"title": ""
},
{
"docid": "c8a872c8f88031dfcdd1cb32fa6a29ee",
"score": "0.6111833",
"text": "def hungry?\n\t\t@stuff_in_belly <= 2\n\tend",
"title": ""
},
{
"docid": "c8a872c8f88031dfcdd1cb32fa6a29ee",
"score": "0.6111833",
"text": "def hungry?\n\t\t@stuff_in_belly <= 2\n\tend",
"title": ""
},
{
"docid": "0329e6e62ec1640d228bd269dd0b7fb8",
"score": "0.61016244",
"text": "def update_forcing?\r\n # If battler forcing an action doesn't exist,\r\n # and battle event is running\r\n if $game_temp.forcing_battler == nil and\r\n $game_system.battle_interpreter.running?\r\n return true\r\n end\r\n return false\r\n end",
"title": ""
},
{
"docid": "43ab0b83b927490501e121166bd1ba88",
"score": "0.6094704",
"text": "def disadvantage?\n @points + 1 == @opponent.points\n end",
"title": ""
},
{
"docid": "0fcedd33ad55c490e2503b8062ff2f18",
"score": "0.6086783",
"text": "def win_by_default(pokemon_atk, pokemon_def)\n if type_advantage_calculator(pokemon_atk.types[:type1], pokemon_def.types[:type1]).zero?\n pokemon_def\n else\n false\n end\n end",
"title": ""
},
{
"docid": "1145bb8424a407770ab3fd77ee5c674b",
"score": "0.6085049",
"text": "def hungry?\r\n @food <= 2\r\n end",
"title": ""
},
{
"docid": "63ea76325d2491ba01f41d4f92a15082",
"score": "0.6044357",
"text": "def hungry?\n @stuffInBelly <= 2\n end",
"title": ""
},
{
"docid": "8d3c002736b2f0096f90bac8956e8348",
"score": "0.6044241",
"text": "def in_battle?\n Game_Temp.in_battle\n end",
"title": ""
},
{
"docid": "39b80309f35b440c325092a00ea2e8f0",
"score": "0.60428196",
"text": "def talk_to_pokemon\n e=$Trainer.party[0]\n events=$PokemonGlobal.dependentEvents\n for i in 0...events.length\n if events[i] && events[i][8]==\"Dependent\"\n pos_x=@realEvents[i].x\n pos_y=@realEvents[i].y\n end\n end\n if e==0\n else\n if e.hp>0 && !$Trainer.party[0].egg?\n if $PokemonGlobal.surfing==true || $PokemonGlobal.bicycle==true\n else\n#===============================================================================\n# * Checks to make sure the Pokemon isn't blocking a surfable water surface\n# * If the water is blocked by the sprite (even though it is invisible) and\n# the player should be able to surf, calls surf\n#===============================================================================\n terrain=Kernel.pbFacingTerrainTag\n notCliff=$game_map.passable?($game_player.x,$game_player.y,$game_player.direction)\n if pbIsWaterTag?(terrain) || !notCliff\n if !pbGetMetadata($game_map.map_id,MetadataBicycleAlways) && !$PokemonGlobal.surfing\n if $DEBUG\n $FollowingFinishedSurfing = false\n Kernel.pbSurf\n elsif (HIDDENMOVESCOUNTBADGES ? $Trainer.numbadges>=BADGEFORSURF : $Trainer.badges[BADGEFORSURF])\n $FollowingFinishedSurfing = false\n Kernel.pbSurf\n end\n end\n#===============================================================================\n# * talk_to_pokemon when possible begins here\n#===============================================================================\n elsif e!=6 && $game_switches[Toggle_Following_Switch]==true\n pbPlayCry(e.species)\n random1=rand(7) # random message if no special conditions apply\n mapname=$game_map.name # Get's current map name\n#===============================================================================\n# * Pokemon Messages when Status Condition\n#=============================================================================== \n if e.status==PBStatuses::POISON && e.hp>0 && !e.egg? # Pokemon Poisoned\n $scene.spriteset.addUserAnimation(Emo_Poison, pos_x, pos_y-2)\n pbWait(120)\n Kernel.pbMessage(_INTL(\"{1} is shivering with the effects of being poisoned.\",e.name))\n \n elsif e.status==PBStatuses::BURN && e.hp>0 && !e.egg? # Pokemon Burned\n $scene.spriteset.addUserAnimation(Emo_Hate, pos_x, pos_y-2)\n pbWait(70)\n Kernel.pbMessage(_INTL(\"{1}'s burn looks painful.\",e.name))\n \n elsif e.status==PBStatuses::FROZEN && e.hp>0 && !e.egg? # Pokemon Frozen\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n Kernel.pbMessage(_INTL(\"{1} seems very cold. It's frozen solid!\",e.name))\n \n elsif e.status==PBStatuses::SLEEP && e.hp>0 && !e.egg? # Pokemon Asleep\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n Kernel.pbMessage(_INTL(\"{1} seems really tired.\",e.name))\n \n elsif e.status==PBStatuses::PARALYSIS && e.hp>0 && !e.egg? # Pokemon Paralyzed\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n Kernel.pbMessage(_INTL(\"{1} is standing still and twitching.\",e.name))\n#===============================================================================\n# * Pokemon is holding an item on a Specific Map\n#=============================================================================== \n elsif $game_variables[ItemWalk]==15 and mapname==\"Item Map\" # Pokemon has item and is on map \"Item Map\"\n items=[:MASTERBALL,:MASTERBALL] # This array can be edited and extended. Look at the one below for a guide\n random2=0\n loop do\n random2=rand(items.length)\n break if hasConst?(PBItems,items[random2])\n end\n Kernel.pbMessage(_INTL(\"{1} seems to be holding something.\",e.name))\n Kernel.pbPokemonFound(getConst(PBItems,items[random2]))\n $game_variables[ItemWalk]=0\n#===============================================================================\n# * Pokemon is holding an item on any other map\n#=============================================================================== \n elsif $game_variables[ItemWalk]==15 # Pokemon has Item\n items=[:POTION,:SUPERPOTION,:FULLRESTORE,:REVIVE,:PPUP,\n :PPMAX,:RARECANDY,:REPEL,:MAXREPEL,:ESCAPEROPE,\n :HONEY,:TINYMUSHROOM,:PEARL,:NUGGET,:GREATBALL,\n :ULTRABALL,:THUNDERSTONE,:MOONSTONE,:SUNSTONE,:DUSKSTONE,\n :REDAPRICORN,:BLUAPRICORN,:YLWAPRICORN,:GRNAPRICORN,:PNKAPRICORN,\n :BLKAPRICORN,:WHTAPRICORN\n ]\n random2=0\n loop do\n random2=rand(items.length)\n break if hasConst?(PBItems,items[random2])\n end\n\n Kernel.pbMessage(_INTL(\"{1} seems to be holding something.\",e.name))\n Kernel.pbPokemonFound(getConst(PBItems,items[random2]))\n $game_variables[ItemWalk]=0\n#===============================================================================\n# * Examples of Map Specific Messages\n#===============================================================================\n elsif mapname==\"Dusk Forest\" && e.hasType?(:BUG) # Bug Type in Dusk Forest\n $scene.spriteset.addUserAnimation(Emo_sing, pos_x, pos_y-2)\n pbWait(50)\n random3=rand(3)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} seems highly interested in the trees.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} seems to enjoy the buzzing of the bug Pokémon.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is jumping around restlessly in the forest.\",e.name,$Trainer.name))\n end\n \n elsif mapname==\"Old Lab\" # In the Old Lab\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n random3=rand(3)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} is touching some kind of switch.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} has a cord in its mouth!\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} seems to want to touch the machinery.\",e.name,$Trainer.name))\n end \n \n elsif mapname==\"Home\" # In the Player's Home\n $scene.spriteset.addUserAnimation(Emo_Happy, pos_x, pos_y-2)\n pbWait(70)\n random3=rand(3)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} is sniffing around the room.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} noticed {2}'s mom is nearby.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} seems to want to settle down at home.\",e.name,$Trainer.name))\n end\n elsif mapname.include?(\"Route\") # On any map that includes \"Route\" in the name\n # Animation goes here\n # Appropriate wait time for animation goes here\n # random3=rand(x)\n # different random messages\n#===============================================================================\n# * Random Messages if none of the above apply\n#=============================================================================== \n elsif random1==0 # Music Note\n $scene.spriteset.addUserAnimation(Emo_sing, pos_x, pos_y-2)\n pbWait(50)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} seems to want to play with {2}.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} is singing and humming.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is looking up at the sky.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} swayed and danced around as it pleased.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} is pulling out the grass.\",e.name,$Trainer.name))\n end\n \n elsif random1==1 # Hate/Angry Face\n $scene.spriteset.addUserAnimation(Emo_Hate, pos_x, pos_y-2)\n pbWait(70)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} let out a roar!\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} is making a face like it's angry!\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} seems to be angry for some reason.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} chewed on your feet.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} is trying to be intimidating.\",e.name,$Trainer.name))\n end\n \n elsif random1==2 # ... Emoji\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} is looking down steadily.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} is sniffing at the floor.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is concentrating deeply.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} faced this way and nodded.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} is glaring straight into {2}'s eyes.\",e.name,$Trainer.name))\n end\n \n elsif random1==3 # Happy Face\n $scene.spriteset.addUserAnimation(Emo_Happy, pos_x, pos_y-2)\n pbWait(70)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} began poking you in the stomach.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} looks very happy.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} happily cuddled up to you.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} is so happy that it can't stand still.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} looks like it wants to lead!\",e.name,$Trainer.name))\n end\n \n elsif random1==4 # Heart Emoji\n $scene.spriteset.addUserAnimation(Emo_love, pos_x, pos_y-2)\n pbWait(70)\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} suddenly started walking closer.\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"Woah! {1} suddenly hugged {2}.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is rubbing up against you.\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} is keeping close to {2}.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} blushed.\",e.name,$Trainer.name))\n end\n \n elsif random1==5 # No Emoji\n random3=rand(5)\n if random3==0\n Kernel.pbMessage(_INTL(\"{1} spun around in a circle!\",e.name,$Trainer.name))\n elsif random3==1\n Kernel.pbMessage(_INTL(\"{1} let our a battle cry.\",e.name,$Trainer.name))\n elsif random3==2\n Kernel.pbMessage(_INTL(\"{1} is on the lookout!\",e.name,$Trainer.name))\n elsif random3==3\n Kernel.pbMessage(_INTL(\"{1} is standing patiently.\",e.name,$Trainer.name))\n elsif random3==4\n Kernel.pbMessage(_INTL(\"{1} is looking around restlessly.\",e.name,$Trainer.name))\n end\n#===============================================================================\n# * This random message shows the Pokemon's Happiness Level\n#=============================================================================== \n elsif random1==6 # Check Happiness Level\n if e.happiness>0 && e.happiness<=50\n $scene.spriteset.addUserAnimation(Emo_Hate, pos_x, pos_y-2)\n pbWait(70)\n Kernel.pbMessage(_INTL(\"{1} hates to travel with {2}.\",e.name,$Trainer.name))\n elsif e.happiness>50 && e.happiness<=100\n $scene.spriteset.addUserAnimation(Emo_Normal, pos_x, pos_y-2)\n pbWait(100)\n Kernel.pbMessage(_INTL(\"{1} is still unsure about traveling with {2} is a good thing or not.\",e.name,$Trainer.name))\n elsif e.happiness>100 && e.happiness<150\n $scene.spriteset.addUserAnimation(Emo_Happy, pos_x, pos_y-2)\n Kernel.pbMessage(_INTL(\"{1} is happy traveling with {2}.\",e.name,$Trainer.name))\n elsif e.happiness>=150\n $scene.spriteset.addUserAnimation(Emo_love, pos_x, pos_y-2)\n pbWait(70)\n Kernel.pbMessage(_INTL(\"{1} loves traveling with {2}.\",e.name,$Trainer.name))\n end\n end\n else\n end\n end\n end\n end\nend",
"title": ""
},
{
"docid": "bd3ea97c5c5d88e9b4368d402bbab2cc",
"score": "0.6026523",
"text": "def hungry?\n\t@stuff_in_belly <= 2\nend",
"title": ""
},
{
"docid": "979bcbb9a125a8591b32cac95b3083a6",
"score": "0.60254323",
"text": "def hungry?\n # end a method with ? if it returnes true or false\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "852ed89ca83813702d8fd9a94dcf337c",
"score": "0.601988",
"text": "def can_call?(player)\n return (self.high_bet > player.in_pot_current)\n end",
"title": ""
},
{
"docid": "9db6b27752528c87645ee27e9428b6ae",
"score": "0.60186696",
"text": "def sorrounded?\n enemies_around > 2\n end",
"title": ""
},
{
"docid": "e4799b70ae9b892c5848b374b24a32e6",
"score": "0.60167015",
"text": "def occasion_ok?(item)\n SceneManager.scene_is?(Scene_Map) ? item.battle_ok? : item.menu_ok?\n end",
"title": ""
},
{
"docid": "64377a8b69ba744e35251f6a1fe72f57",
"score": "0.6011304",
"text": "def is_used?\n !self.involvement_events.empty?\n end",
"title": ""
},
{
"docid": "5331b854f4c3699c5b2d02deae4c41db",
"score": "0.59962785",
"text": "def game_over?\n true\n end",
"title": ""
},
{
"docid": "cc33182846078c66073b0986e961d4a8",
"score": "0.59940714",
"text": "def weapon?\n melee_weapon? or ranged_weapon?\n end",
"title": ""
},
{
"docid": "d6772af6bf43614a0071d606e01f915b",
"score": "0.5970575",
"text": "def enable?(item)\n return false if item.nil?\n return false if $game_party.gold < item.dismantle_gold_fee \n return item.dismantlable?\n end",
"title": ""
},
{
"docid": "3b697e8b9c776451eaa2cb5216357087",
"score": "0.5969632",
"text": "def enable?(item)\n true#$game_party.usable?(item)\n end",
"title": ""
},
{
"docid": "fec0305cde1b482f22d9fe9c45a581e3",
"score": "0.596905",
"text": "def hungry?\n # method naam kan eindigen met \"?\"\n # dit is gebruikelijk om te doen als de methode\n # true of false terug geeft\n @stuff_in_belly <= 2\n end",
"title": ""
},
{
"docid": "8f628912b66e6e8b999563d1440645b5",
"score": "0.5968441",
"text": "def combat?; false; end",
"title": ""
},
{
"docid": "b2bca8bedeee54b359561036ee56d0c3",
"score": "0.5967736",
"text": "def item_can_use?(item)\n return false unless item.is_a?(RPG::Item)\n return false if item_number(item) == 0\n if $game_temp.in_battle\n return item.battle_ok?\n else\n return item.menu_ok?\n end\n end",
"title": ""
},
{
"docid": "36e2614da2db99a654924b9f23c32db1",
"score": "0.5964452",
"text": "def any_oranges?\n if @oranges_for_pick <= 0\n @is_die = true\n return false\n else \n return true\n end\n end",
"title": ""
},
{
"docid": "b6b1a97a58287c358a11ea78ae7f84e6",
"score": "0.59643257",
"text": "def game_over?\n # Write a if condition - true\n if @lives == 0\n true\n end\n end",
"title": ""
},
{
"docid": "ac7af68538644246c24df83eedc3f353",
"score": "0.59617364",
"text": "def game_over?\n alive_robots.count == 1\n end",
"title": ""
},
{
"docid": "b3d1f1a2fd7c3448620b227360f3376d",
"score": "0.5957627",
"text": "def judge\r\n # If all dead determinant is true, or number of members in party is 0\r\n if $game_party.all_dead? or $game_party.actors.size == 0\r\n # If possible to lose\r\n if $game_temp.battle_can_lose\r\n # Return to BGM before battle starts\r\n $game_system.bgm_play($game_temp.map_bgm)\r\n # Battle ends\r\n battle_end(2)\r\n # Return true\r\n return true\r\n end\r\n # Set game over flag\r\n $game_temp.gameover = true\r\n # Return true\r\n return true\r\n end\r\n # Return false if even 1 enemy exists\r\n for enemy in $game_troop.enemies\r\n if enemy.exist?\r\n return false\r\n end\r\n end\r\n # Start after battle phase (win)\r\n start_phase5\r\n # Return true\r\n return true\r\n end",
"title": ""
},
{
"docid": "67b0d366a9100789a4d5beb8c347f3f3",
"score": "0.59552944",
"text": "def hungry?\n return (@hunger > @max_health/2)\n end",
"title": ""
},
{
"docid": "56ef721fdc12554f427b06eed12c5911",
"score": "0.5953944",
"text": "def check_priority_trigger_custap_berry(pokemon)\n return pokemon.hp_rate < VAL_0_25\n end",
"title": ""
},
{
"docid": "0f9c3a54efcc923bff779817d9c1dd49",
"score": "0.5946435",
"text": "def start_battle\n self.go_to_pokemon_center? if user.pokemon.hp == 0\n choice = prompt.select(Interactivity.fightPokemon?(@@wild_pokemon.name), [\"Let's BATTLE!\", \"No, I don't wanna battle.\"]) \n if choice == \"Let's BATTLE!\"\n self.accepts_battle\n elsif choice == \"No, I don't wanna battle.\"\n self.keep_exploring? \n end \n end",
"title": ""
},
{
"docid": "bed783c40ea514cb5fb2da14908d245c",
"score": "0.59440684",
"text": "def starvation?()\n\n @hunger_counter >= @starvation_level\n end",
"title": ""
},
{
"docid": "bad0e019998ac87618b566fcb8f597a6",
"score": "0.59429646",
"text": "def pbTypeImmunityByAbility(type,attacker,opponent)\n return false if attacker.index==opponent.index\n return false if attacker.hasMoldBreaker\n if opponent.hasWorkingAbility(:SAPSIPPER) && isConst?(type,PBTypes,:GRASS)\n PBDebug.log(\"[Ability triggered] #{opponent.pbThis}'s Sap Sipper (made #{@name} ineffective)\")\n if opponent.pbCanIncreaseStatStage?(PBStats::ATTACK,opponent)\n opponent.pbIncreaseStatWithCause(PBStats::ATTACK,1,opponent,PBAbilities.getName(opponent.ability))\n else\n @battle.pbDisplay(_INTL(\"{1}'s {2} made {3} ineffective!\",\n opponent.pbThis,PBAbilities.getName(opponent.ability),self.name))\n end\n return true\n end\n if (opponent.hasWorkingAbility(:STORMDRAIN) && isConst?(type,PBTypes,:WATER)) ||\n (opponent.hasWorkingAbility(:LIGHTNINGROD) && isConst?(type,PBTypes,:ELECTRIC))\n PBDebug.log(\"[Ability triggered] #{opponent.pbThis}'s #{PBAbilities.getName(opponent.ability)} (made #{@name} ineffective)\")\n if opponent.pbCanIncreaseStatStage?(PBStats::SPATK,opponent)\n opponent.pbIncreaseStatWithCause(PBStats::SPATK,1,opponent,PBAbilities.getName(opponent.ability))\n else\n @battle.pbDisplay(_INTL(\"{1}'s {2} made {3} ineffective!\",\n opponent.pbThis,PBAbilities.getName(opponent.ability),self.name))\n end\n return true\n end\n if opponent.hasWorkingAbility(:MOTORDRIVE) && isConst?(type,PBTypes,:ELECTRIC)\n PBDebug.log(\"[Ability triggered] #{opponent.pbThis}'s Motor Drive (made #{@name} ineffective)\")\n if opponent.pbCanIncreaseStatStage?(PBStats::SPEED,opponent)\n opponent.pbIncreaseStatWithCause(PBStats::SPEED,1,opponent,PBAbilities.getName(opponent.ability))\n else\n @battle.pbDisplay(_INTL(\"{1}'s {2} made {3} ineffective!\",\n opponent.pbThis,PBAbilities.getName(opponent.ability),self.name))\n end\n return true\n end\n if (opponent.hasWorkingAbility(:DRYSKIN) && isConst?(type,PBTypes,:WATER)) ||\n (opponent.hasWorkingAbility(:VOLTABSORB) && isConst?(type,PBTypes,:ELECTRIC)) ||\n (opponent.hasWorkingAbility(:WATERABSORB) && isConst?(type,PBTypes,:WATER))\n PBDebug.log(\"[Ability triggered] #{opponent.pbThis}'s #{PBAbilities.getName(opponent.ability)} (made #{@name} ineffective)\")\n healed=false\n if opponent.effects[PBEffects::HealBlock]==0\n if opponent.pbRecoverHP((opponent.totalhp/4).floor,true)>0\n @battle.pbDisplay(_INTL(\"{1}'s {2} restored its HP!\",\n opponent.pbThis,PBAbilities.getName(opponent.ability)))\n end\n end\n if !healed\n @battle.pbDisplay(_INTL(\"{1}'s {2} made {3} useless!\",\n opponent.pbThis,PBAbilities.getName(opponent.ability),@name))\n end\n return true\n end\n if opponent.hasWorkingAbility(:FLASHFIRE) && isConst?(type,PBTypes,:FIRE)\n PBDebug.log(\"[Ability triggered] #{opponent.pbThis}'s Flash Fire (made #{@name} ineffective)\")\n if !opponent.effects[PBEffects::FlashFire]\n opponent.effects[PBEffects::FlashFire]=true\n @battle.pbDisplay(_INTL(\"{1}'s {2} raised its Fire power!\",\n opponent.pbThis,PBAbilities.getName(opponent.ability)))\n else\n @battle.pbDisplay(_INTL(\"{1}'s {2} made {3} ineffective!\",\n opponent.pbThis,PBAbilities.getName(opponent.ability),self.name))\n end\n return true\n end\n if opponent.hasWorkingAbility(:TELEPATHY) && pbIsDamaging? &&\n !opponent.pbIsOpposing?(attacker.index)\n PBDebug.log(\"[Ability triggered] #{opponent.pbThis}'s Telepathy (made #{@name} ineffective)\")\n @battle.pbDisplay(_INTL(\"{1} avoids attacks by its ally Jermon!\",opponent.pbThis))\n return true\n end\n if opponent.hasWorkingAbility(:BULLETPROOF) && isBombMove?\n PBDebug.log(\"[Ability triggered] #{opponent.pbThis}'s Bulletproof (made #{@name} ineffective)\")\n @battle.pbDisplay(_INTL(\"{1}'s {2} made {3} ineffective!\",\n opponent.pbThis,PBAbilities.getName(opponent.ability),self.name))\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "17237e68615d79043e3eb4188b5c3ce7",
"score": "0.5941207",
"text": "def pbHasFatefulSpecies?(species)\n if species.is_a?(String) || species.is_a?(Symbol)\n species = getID(PBSpecies,species)\n end\n for pokemon in $Trainer.pokemonParty\n return true if pokemon.species==species && pokemon.obtainMode==4\n end\n return false\nend",
"title": ""
},
{
"docid": "8279a5599590f8887c9a290792f2e4f8",
"score": "0.5939308",
"text": "def alive?()\n\n @hunger_counter < @hunger_limit\n end",
"title": ""
},
{
"docid": "b335594f6d32421ce344bdc734013340",
"score": "0.5936315",
"text": "def game_over?\n @lives == 0\n end",
"title": ""
},
{
"docid": "18a45fd6865ce3a8f06c49bcb3929528",
"score": "0.5935492",
"text": "def check_special_states\n # if Tons of Add-ons is there\n if $tons_version != nil\n # if version is sufficient and using Auto-Revive\n if $tons_version >= 1.6 && $game_system.AUTO_REVIVE\n # for each actor\n $BlizzABS.battlers.each {|actor|\n # if battler exists and dead and having Auto-Revive\n if actor.battler != nil && actor.battler.hp == 0 &&\n AUTO_REVIVE_IDS.any? {|i| actor.battler.states.include?(i)}\n # execute\n actor.battler.hp += actor.battler.maxhp / 5\n # remove Auto-Revive and Dead\n (AUTO_REVIVE_IDS + [DEAD_ID]).each {|i|\n actor.battler.remove_state(i)}\n # set animation\n actor.animation_id = REVIVE_ANIMATION_ID\n # set revival text\n actor.battler.damage = REVIVE_TEXT\n # display text\n actor.battler.damage_pop = true\n end}\n end\n # if version is sufficient and using Fury Status\n if $tons_version >= 6.41 && $game_system.FURY_STATUS\n # execute Fury Status change\n BlizzCFG.fury_execution\n end\n end\n end",
"title": ""
},
{
"docid": "6223795090e9675ed0a5c3226336cb8e",
"score": "0.5919254",
"text": "def won?\n @game.started? && !detectives_won? && detectives_cannot_move?\n end",
"title": ""
},
{
"docid": "66167cd4585091b0c261f85fa6e4ba31",
"score": "0.59086156",
"text": "def advantage?\n @points > @opponent.points && @points > 3\n end",
"title": ""
},
{
"docid": "c9e15e02b7bb6a52b421c02bc2eec260",
"score": "0.59073335",
"text": "def evolve_check(reason = :level_up, extend_data = nil)\n return false if item_db_symbol == :everstone\n\n data = EVOLVE_ON_FORM0 ? primary_data : self.data\n if reason == :level_up\n return data.evolution_id if data.evolution_id != 0 && data.evolution_level.to_i.between?(1, @level)\n\n if PSDK_CONFIG.use_form0_when_no_evolution_data\n if data.evolution_id == 0 && primary_data.evolution_id != 0 && primary_data.evolution_level.to_i.between?(1, @level)\n return data.evolution_id\n end\n end\n end\n\n unless data.special_evolution\n data = primary_data if PSDK_CONFIG.use_form0_when_no_evolution_data\n return false unless data.special_evolution\n end\n\n criteria = Pokemon.evolution_criteria\n expected_evolution = data.special_evolution.find do |evolution|\n next unless evolution.is_a?(Hash)\n\n next evolution.all? { |key, value| criteria[key] && instance_exec(value, extend_data, reason, &criteria[key]) }\n end\n\n return false unless expected_evolution\n\n id = expected_evolution[SPECIAL_EVOLUTION_ID.find { |key| expected_evolution[key] }]\n return id, expected_evolution[:form]\n end",
"title": ""
},
{
"docid": "519233c67558b00c5886e14385636649",
"score": "0.5903027",
"text": "def won?\n won_checker\n end",
"title": ""
},
{
"docid": "3b354baff7af7f6a49c4acc43326bcfd",
"score": "0.5902819",
"text": "def has_honors\n if @gpa >= 3.5\n return true\n end\n return false\n end",
"title": ""
},
{
"docid": "cfc2acaf9d3d0fa6825340d8469ec69f",
"score": "0.589973",
"text": "def no_advantage_check\n $game_temp.advantage = false if $game_temp.no_advantage or not Allow_Advantage\n $game_temp.disvantage = false if $game_temp.no_disvantage or not Allow_Disvantage\n $game_temp.pre_emptive = false if $game_temp.no_pre_emptive or not Allow_Pre_Emptive\n $game_temp.surprised = false if $game_temp.no_surprised or not Allow_Surprised\n $game_temp.raid_attack = false if $game_temp.no_raid_attack or not Allow_Raid_Attack\n $game_temp.back_attack = false if $game_temp.no_back_attack or not Allow_Back_Attack\n $game_temp.invert_postion = ($game_temp.back_attack and Invert_Back_Attack)\n end",
"title": ""
},
{
"docid": "5fdb986ebaf7eeef5e743c8645608861",
"score": "0.58949834",
"text": "def can_train_peasant?\n gold >= 90 && food >= 5\n end",
"title": ""
},
{
"docid": "5fdb986ebaf7eeef5e743c8645608861",
"score": "0.58949834",
"text": "def can_train_peasant?\n gold >= 90 && food >= 5\n end",
"title": ""
},
{
"docid": "36a2708ee8764a1119f60381cb906976",
"score": "0.58924073",
"text": "def hungry?\n@stuff_in_belly <= 2\nend",
"title": ""
},
{
"docid": "3acb71f63c5df5a3d2e01c6a11b9e4e3",
"score": "0.5889467",
"text": "def game_over?\n remaining_players == 1\n end",
"title": ""
},
{
"docid": "697e94b2307d7ecd0ee4896a97fbe646",
"score": "0.5885592",
"text": "def can_attack?(target)\n if target.is_a?(Sub)\n return true if (DamageChart::PriDamage[@unit_type][target.unit_type] != -1 and @ammo > 0)\n else\n return super\n end\n end",
"title": ""
},
{
"docid": "697e94b2307d7ecd0ee4896a97fbe646",
"score": "0.5885592",
"text": "def can_attack?(target)\n if target.is_a?(Sub)\n return true if (DamageChart::PriDamage[@unit_type][target.unit_type] != -1 and @ammo > 0)\n else\n return super\n end\n end",
"title": ""
},
{
"docid": "b90570c567dabaec7e588bd65937d425",
"score": "0.5884658",
"text": "def has2w\n #equips.count { |equip| equip.is_a?(RPG::Weapon) } >= 2\n armi = 0\n equips.each { |equipment|\n armi += 1 if equipment.is_a?(RPG::Weapon)\n }\n armi >= 2\n end",
"title": ""
},
{
"docid": "b660b0c749f3371b196b518d0d0d1216",
"score": "0.58844304",
"text": "def game_over?\n return true if victory? || (@turns == 12)\n false\n end",
"title": ""
},
{
"docid": "e311609293630d0496ea36fb56a5905d",
"score": "0.5883464",
"text": "def is_game_over?; won_by?(:hunter) || won_by?(:prey) end",
"title": ""
},
{
"docid": "6a72502d66b197116c0074727ee42e4d",
"score": "0.5877238",
"text": "def enemy_pokemon?(pokemon)\n return (pokemon.is_a?(PFM::PokemonBattler) && pokemon.bank != 0) ||\n (pokemon.is_a?(PFM::Pokemon) && (pokemon.position == nil or pokemon.position < 0))\n end",
"title": ""
},
{
"docid": "ce290c01e8cf9c608ad56b46a9b8fe3a",
"score": "0.58735573",
"text": "def check?\n king_attacked?\n end",
"title": ""
},
{
"docid": "8ccfd9f2afc0b45b8ec3a551b2ccd2db",
"score": "0.5869206",
"text": "def damaged?\n health < MAX_HEALTH\n end",
"title": ""
},
{
"docid": "b0c247ef9fea64af501433214a71455a",
"score": "0.5862659",
"text": "def appealed?\n appealed == 1\n end",
"title": ""
},
{
"docid": "1493a4fbd1a588126e328fd8494bb002",
"score": "0.58568555",
"text": "def has_pokemon?(id)\n get(id)[:column] != 0 && (Graphics.current_time - get(id)[:slather_time]) < LEAVE_TREE_TIME\n end",
"title": ""
},
{
"docid": "0685015407c4089d78f48a507154d842",
"score": "0.58434623",
"text": "def is_still_ongoing?\n if player1.life_point>0 #&& enemies_in_sight.size>0\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "8b3f70410ffbbb1568ee9266cb0bbfd0",
"score": "0.5842576",
"text": "def rech_bonus?\n has_feature?(:esper_recharger)\n end",
"title": ""
},
{
"docid": "88fabf65ec86fbf8986d09fff88c3f20",
"score": "0.58408576",
"text": "def attack?\n if rand(@danger_level) > 3\n report_action 'attacking!'\n sleep 7\n return true\n else \n report_action 'not attacking....'\n sleep 1\n return false\n end\n end",
"title": ""
},
{
"docid": "740ca081b5647d17ee5b971c8f977c56",
"score": "0.58381814",
"text": "def slot_contain_pokemon?(index)\n return @boxes[@current_box][index].class == ::PFM::Pokemon\n end",
"title": ""
},
{
"docid": "a1bd98c7c6694bc1cec13138d76f2aba",
"score": "0.58359224",
"text": "def pbIsMedicine?(item)\n return [1, 2, 6, 7].include?(GameData::Item.get(item).battle_use) && !GameData::Item.get(item).is_berry?\nend",
"title": ""
},
{
"docid": "56bb3546571de9b5917111d657c628b6",
"score": "0.5834199",
"text": "def check_item_heal(pokemon)\n return false unless $game_temp.trainer_battle\n is_last = (@enemies.count { |pkmn| !pkmn.dead? }) == 1\n max_hp = pokemon.max_hp\n dhp = max_hp - pokemon.hp\n bag = get_bag(pokemon)\n has_full_restore = bag.contain_item?(:full_restore)\n has_full_restore = false unless is_last or bag.item_quantity(:full_restore) > 1\n has_full_restore = false if dhp < 60 # Don't use the fullrestore at this point\n #> Soin status\n if pokemon.status != 0 and pokemon.hp_rate > 0.5\n if pokemon.poisoned?\n return true if perform_status_heal(bag, has_full_restore, *PoisonHealItems)\n elsif pokemon.burnt?\n return true if perform_status_heal(bag, has_full_restore, *BurnHealItems)\n elsif pokemon.paralyzed?\n return true if perform_status_heal(bag, has_full_restore, *ParalyzeHealItems)\n elsif pokemon.frozen?\n return true if perform_status_heal(bag, has_full_restore, *FreezeHealItems)\n elsif pokemon.asleep?\n return true if perform_status_heal(bag, has_full_restore, *WakeUpItems)\n end\n end\n #> Soin HP\n if pokemon.hp_rate < 0.25\n if dhp > 120 and has_full_restore\n return _stack_add_item(pokemon: pokemon, item_id: :full_restore, bag: bag)\n elsif dhp > 120 and bag.contain_item?(:max_potion)\n return _stack_add_item(pokemon: pokemon, item_id: :max_potion, bag: bag)\n end\n # Test items healing more than 60 HP\n if dhp > 60\n ItemHealingMoreThan60.each do |sym|\n return _stack_add_item(pokemon: pokemon, item_id: sym, bag: bag) if bag.contain_item?(sym)\n end\n end\n # Itest items healing more than 20 HP\n if dhp > 20\n ItemHealingMoreThan20.each do |sym|\n return _stack_add_item(pokemon: pokemon, item_id: sym, bag: bag) if bag.contain_item?(sym)\n end\n end\n ItemHealingHP.each do |sym|\n return _stack_add_item(pokemon: pokemon, item_id: sym, bag: bag) if bag.contain_item?(sym)\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "67db5e908089c121f7c74855e608f354",
"score": "0.5832766",
"text": "def elide?\n false\n end",
"title": ""
},
{
"docid": "68b0704c713a6013eb39ac150fec6c3b",
"score": "0.58289015",
"text": "def summon?\n return false\n end",
"title": ""
},
{
"docid": "21915e7f4a30933e10b23f1b867bdf86",
"score": "0.5828465",
"text": "def pbHasEgg?(species)\n if species.is_a?(String) || species.is_a?(Symbol)\n species = getID(PBSpecies,species)\n end\n # species may be unbreedable, so check its evolution's compatibilities\n evospecies = pbGetEvolvedFormData(species)\n compatspecies = (evospecies && evospecies[0]) ? evospecies[0][2] : species\n dexdata = pbOpenDexData\n pbDexDataOffset(dexdata,compatspecies,31)\n compat1 = dexdata.fgetb # Get egg group 1 of this species\n compat2 = dexdata.fgetb # Get egg group 2 of this species\n dexdata.close\n return false if isConst?(compat1,PBEggGroups,:Ditto) ||\n isConst?(compat1,PBEggGroups,:Undiscovered) ||\n isConst?(compat2,PBEggGroups,:Ditto) ||\n isConst?(compat2,PBEggGroups,:Undiscovered)\n baby = pbGetBabySpecies(species)\n return true if species==baby # Is a basic species\n baby = pbGetBabySpecies(species,0,0)\n return true if species==baby # Is an egg species without incense\n return false\nend",
"title": ""
},
{
"docid": "6356ee0c197ac11f819f7edbe2087be4",
"score": "0.5827045",
"text": "def game_over\n @lives == 0\n end",
"title": ""
},
{
"docid": "160087d37101ad7f1f82b6651aa0991c",
"score": "0.58245033",
"text": "def victory?\n !!get_winner\n end",
"title": ""
},
{
"docid": "af509ac6bd71e260cf863f672f8cde79",
"score": "0.5822025",
"text": "def can_train_siege_engine?\n gold >= 200 && food >= 3 && lumber >= 60\n end",
"title": ""
},
{
"docid": "72fb654513499015a01914fc818a2d6b",
"score": "0.5819065",
"text": "def game_over?\n @life <= 0\nend",
"title": ""
},
{
"docid": "8ba337163efa8184df66400563b57507",
"score": "0.581748",
"text": "def is_one_attack?\n get_model.is_one_use_weapon?\n end",
"title": ""
},
{
"docid": "8e7bf5e101eed4d18bad3bae60e51e91",
"score": "0.5811494",
"text": "def loser?\n @lives == 0\n end",
"title": ""
}
] |
71815dcae6418d8c78e8ba3358f1d2dd
|
Provides cleanup_and_setup_workflow_dirs Called before every test method runs. Can be used to set up fixture information.
|
[
{
"docid": "6881252ec44527f51f2c96c2975505eb",
"score": "0.0",
"text": "def setup\n @rblog = Log.new(__FILE__)\n CLASSLOG.debug \"Running #{self.to_s}.\"\n end",
"title": ""
}
] |
[
{
"docid": "51f1036d4e9cf9a7356011398bce0aad",
"score": "0.66712755",
"text": "def prepare\n [@build_dir, @log_dir, @local_tmp_dir].each do |dir|\n if not File.directory?(dir)\n FileUtils.mkdir_p dir\n end\n end\n cleanup\n end",
"title": ""
},
{
"docid": "87ccf5499a8b0867930a5f7f2958bb63",
"score": "0.6650293",
"text": "def setup_seed_data\n clear_old_files\n move_test_script_files\n\n # setup other elements required for autotesting\n create_marking_scheme\n create_criteria\n create_submission\n process_schema_data\n end",
"title": ""
},
{
"docid": "973eab7849462224c778e2b26740d61f",
"score": "0.6629447",
"text": "def teardown\n Dir.rmdir(TEST_DIRECTORY)\n end",
"title": ""
},
{
"docid": "7ce86423de7df80da786b59f10e4e7d7",
"score": "0.6596184",
"text": "def teardown\n FileUtils::rm_r(\"./testData\")\n Dir::mkdir(\"./testData\")\n end",
"title": ""
},
{
"docid": "95778b1f91c7120eef5af3aa8cf704d1",
"score": "0.6561351",
"text": "def teardown\n super\n clear_tasks\n\n remove_file @temp_path\n remove_file @temp_cache\n\n @temp_path = nil\n @temp_cache = nil\n\n if(@start_path && Dir.pwd != @start_path)\n puts \"[WARNING] >> SproutTestCase changing dir from #{Dir.pwd} back to: #{@start_path} - Did you mean to leave your working directory in a new place?\"\n Dir.chdir @start_path\n end\n end",
"title": ""
},
{
"docid": "013ae4bfdb199f4116bb2dcbe26870cb",
"score": "0.64887565",
"text": "def setup\n teardown\n\n # create a master repo for testing\n if !File.exists?(conf.master_repository_uri)\n create_script = File.join(conf.app_dir, 'bin/create_master_repo')\n `#{create_script} #{conf.master_repository_uri}`\n end\n\n db.sync\n\n # preload repo?\n if @state == :populated\n Satellite::Models::Page.new('Home', 'I am the Home page.').save\n Satellite::Models::Page.new('Fizz', 'I am the Fizz page.').save\n Satellite::Models::Page.new('Bozz', 'I am the Bozz page.').save\n Satellite::Models::Page.new('bazz', 'I am the bazz page.').save\n Satellite::Models::Upload.new('Hello World.txt').save('Hello World!')\n Satellite::Models::Upload.new('Baaa.txt').save('Meow...')\n Satellite::Models::Upload.new('blam.txt').save('Boom, headshot!')\n end\n\n db.sync\n end",
"title": ""
},
{
"docid": "2c1a555d3bc953772115c0ccb19761d4",
"score": "0.6436795",
"text": "def after_teardown\n Rugged::TestCase::FixtureRepo.teardown\n FileUtils.remove_entry_secure(@configdir)\n super\n end",
"title": ""
},
{
"docid": "5180cda0f6e71ccffa68a2f84f5974cc",
"score": "0.6396731",
"text": "def setup\n FileUtils.makedirs(@tmp_dir)\n end",
"title": ""
},
{
"docid": "7fbf9515d82c8ab755da0c5b8507bd7e",
"score": "0.6395",
"text": "def teardown\n Dir.chdir(@prev_dir)\n end",
"title": ""
},
{
"docid": "7fbf9515d82c8ab755da0c5b8507bd7e",
"score": "0.6395",
"text": "def teardown\n Dir.chdir(@prev_dir)\n end",
"title": ""
},
{
"docid": "226ed25f17d96df52e25a63d1932ff13",
"score": "0.63948065",
"text": "def setup\n\n #logger.level=TestHelper.getCommonLogLevel\n # use error since we expect some warning messages\n logger.level=TestHelper.getCommonLogLevel\n #logger.level = Logger::ERROR\n #logger.level = Logger::DEBUG\n\n ## Resolve test directory regardless of where the tests\n ## are started.\n test_file_dir = TestHelper.findTestFileDirectory()\n @resources_dir = test_file_dir+\"/resources\"\n @terms_dir = test_file_dir+ \"/terms\"\n @courses_dir = test_file_dir+\"/courses\"\n\n end",
"title": ""
},
{
"docid": "f3059844dd160c509c86bc70cb1d4869",
"score": "0.6363917",
"text": "def teardown\n %w{ a b }.each { |f| FileUtils.remove_dir(f) }\n end",
"title": ""
},
{
"docid": "6aed2000276926996c9c92a78cc99cb6",
"score": "0.63553524",
"text": "def setup_and_teardown(state)\n before(:each) do\n set_up_test_env(:test, state)\n end\n after(:each) do\n tear_down_test_env\n end\nend",
"title": ""
},
{
"docid": "878d413ae7dbb34d5c7dc4f52f45fc70",
"score": "0.634448",
"text": "def teardown!\n env = ::Librarian::Chef::Environment.new(project_path: Dir.pwd)\n env.config_db.local[\"path\"] = @originalpath\n\n FileUtils.rm_rf(@tmpdir) if File.exist?(@tmpdir)\n end",
"title": ""
},
{
"docid": "1f1e8c0b8c124f9a568897dbfdf732bc",
"score": "0.63290876",
"text": "def teardown\n Dir.chdir(@start_dir)\n end",
"title": ""
},
{
"docid": "0267bc0770ef3c038907e977c0d09b4f",
"score": "0.6314553",
"text": "def setup\n FileUtils.mkdir_p(data_path)\n end",
"title": ""
},
{
"docid": "199f50cf2031e75477423f09e6424912",
"score": "0.63007116",
"text": "def teardown\n $LOAD_PATH.delete_if do |iDirName|\n iDirName == @RootDir\n end\n end",
"title": ""
},
{
"docid": "1a3ff98a8be654e8eb0fe733694072f9",
"score": "0.628378",
"text": "def teardown\n delete_all\n restore_path\n end",
"title": ""
},
{
"docid": "981de456e17626afa76f3acdf8b89062",
"score": "0.6244501",
"text": "def initialize_directories\n mkpath @@conf.root\n mkdir @@conf.test_root\n mkdir @@conf.expected_root\n mkdir @@conf.result_root\n end",
"title": ""
},
{
"docid": "c48a40fc733d3b9444b7cb028c42a1a8",
"score": "0.62407744",
"text": "def teardown\n FileUtils.rm_rf(\"test/resources/IncludesSinceTestRepository\")\n end",
"title": ""
},
{
"docid": "241ba85f0db082e4cb712ab803c9187e",
"score": "0.62217474",
"text": "def ensure_workaround_directory_is_set_up_during_init!\n for_each_parcel do |parcel|\n ensure_workaround_directory_is_set_up!\n return\n end\n end",
"title": ""
},
{
"docid": "e7d98f4e8d13f3c4f226b9ae015fb1e4",
"score": "0.6208069",
"text": "def setup\n super\n @user_dir = Dir.pwd\n cleanup\n end",
"title": ""
},
{
"docid": "0fe6f23b07626668c5d3a91040b66e50",
"score": "0.61824244",
"text": "def prepare_dirs\n require 'fileutils'\n [USERS_DIR, USERS_SUSPENDED_DIR, USERS_SN_DIR, FOLLOWERS_DIR, STATUSES_DIR, LANGUAGES_DIR, LANGUAGES_LDIG_DIR].each do |dir|\n FileUtils.mkdir_p dir unless File.exist? dir\n end\nend",
"title": ""
},
{
"docid": "178338b61053d07a91e4f47a62155bc7",
"score": "0.6181738",
"text": "def teardown\n Dir.glob(\"#{File.expand_path(File.dirname(__FILE__))}/test_data/**\").each do |file_path|\n FileUtils.rm_rf(file_path)\n end\n end",
"title": ""
},
{
"docid": "f693a4032456fe90b116f7148836ebb6",
"score": "0.6100192",
"text": "def setup\n setup_files = %w(transactions.dat accounts.dat budgets.dat aliases.dat commodities.dat setup.dat ledger.dat)\n FileUtils.mkdir_p(FILEBASE)\n setup_files.each do |file|\n FileUtils.touch(\"#{FILEBASE}#{file}\")\n end\n end",
"title": ""
},
{
"docid": "a00eedb654f8c85d95e9755ffb928c65",
"score": "0.6092843",
"text": "def prepare_dirs\n FileUtils.mkdir_p self.basedir unless Dir.exist? self.basedir\n end",
"title": ""
},
{
"docid": "261c93165f0b628d6391339669fec792",
"score": "0.6089412",
"text": "def setup\n Dir.mkdir data_dir unless File.exist? data_dir\n end",
"title": ""
},
{
"docid": "14b0a993a3824b99b3fe52ceca488a17",
"score": "0.6085429",
"text": "def setup\n setup_group_fixture_repos\n end",
"title": ""
},
{
"docid": "28bec6fb20ed6937bf2160df5097a456",
"score": "0.60836065",
"text": "def setup_initial_tests\n remove_file \"test/unit/#{@resource.singularize}_test.rb\"\n template \"devise/test/unit/unit_test.rb\", \"test/unit/#{@resource.singularize}_test.rb\"\n remove_file \"test/factories/#{@resource}.rb\"\n template \"devise/test/factories/factory.rb\", \"test/factories/#{@resource}.rb\"\n \n Dir[\"#{self.class.source_root}/devise/test/functional/devise/*\"].each do |filepath|\n filename = filepath.split(\"/\").last\n template \"devise/test/functional/devise/#{filename}\", \"test/functional/devise/#{filename}\"\n end\n \n template \"devise/test/integration/resource_stories_test.rb\", \"test/integration/#{@resource.singularize}_stories_test.rb\"\n \n remove_file \"test/test_helper.rb\"\n template \"devise/test/test_helper.rb\", \"test/test_helper.rb\"\n end",
"title": ""
},
{
"docid": "2080f3ae82c6ea48a14217fc6d4050e0",
"score": "0.6080577",
"text": "def teardown\n db.obliterate!\n FileUtils.cd(conf.app_dir)\n FileUtils.rm_rf(conf.master_repository_uri)\n end",
"title": ""
},
{
"docid": "80a0e52a2b09abcbd75981d4943dfd71",
"score": "0.6080143",
"text": "def teardown\n reset_test_env\n end",
"title": ""
},
{
"docid": "28c0bd73d229e598a5d329b3807c6780",
"score": "0.6068012",
"text": "def on_test_run_started(_event)\n lifecycle.clean_results_dir\n end",
"title": ""
},
{
"docid": "28c0bd73d229e598a5d329b3807c6780",
"score": "0.6068012",
"text": "def on_test_run_started(_event)\n lifecycle.clean_results_dir\n end",
"title": ""
},
{
"docid": "c7d7081d44951e29ba9332608ddf6f3e",
"score": "0.6062117",
"text": "def testFixtureTearDown()\n end",
"title": ""
},
{
"docid": "c7d7081d44951e29ba9332608ddf6f3e",
"score": "0.6062117",
"text": "def testFixtureTearDown()\n end",
"title": ""
},
{
"docid": "be8caf40a922e7b6bf61141e01f9fbe3",
"score": "0.6047548",
"text": "def setup\n FileUtils.rm_rf(@@temp_dir) if Dir.exists?(@@temp_dir)\n Dir.mkdir(@@temp_dir) # unless Dir.exists?(@@temp_dir)\n\n #Creating directory structure for tests\n 5.times do |i|\n dir = @@temp_dir + \"/#{i}\"\n Dir.mkdir(dir)\n\n size = 2 ** i\n File.open(\"#{dir}/file\", 'w') { |f| f.seek(size-1);f.write(\"\\0\")} unless size <= 0\n end\n\n Dir.mkdir(@@dir_prerenamed1)\n File.open(\"#{@@dir_prerenamed1}/file\", 'w') { |f| f.write(\"\\0\")}\n\n Dir.mkdir(@@dir_prerenamed2)\n Dir.mkdir(@@dir_name_actual)\n Dir.mkdir(@@dir_name_wrong)\n Dir.mkdir(@@dir_empty)\n\n end",
"title": ""
},
{
"docid": "a261440d572c882d27e077792888e31a",
"score": "0.6045009",
"text": "def create_all_test_data\n create_system_parameters()\n create_members_and_security_servers()\n create_requests()\n create_approved_cas()\n create_tsps()\n create_global_groups()\n create_configuration_sources()\n create_configuration_anchors()\nend",
"title": ""
},
{
"docid": "88134e63c54bfd61ead65bdd1b64b082",
"score": "0.6040971",
"text": "def teardown\r\n unless method_root\r\n raise \"teardown failure: method_root is nil (does setup call super?)\"\r\n end\r\n \r\n # clear out the output folder if it exists, unless flagged otherwise\r\n unless ENV[\"KEEP_OUTPUTS\"] == \"true\" || (!passed? && ENV[\"KEEP_FAILURES\"] == \"true\")\r\n begin\r\n cleanup\r\n rescue\r\n raise(\"cleanup failure: #{$!.message}\")\r\n end\r\n end\r\n \r\n try_remove_dir(class_root.path)\r\n end",
"title": ""
},
{
"docid": "4e5df8736ed5c73f3fba16d52f1124a4",
"score": "0.60352784",
"text": "def cleanup_state\n # intentionally not deleting entire temp dir to preserve localized\n # executable directories between tests on Windows. see how we reference\n # RS_RIGHT_RUN_EXE below.\n delete_if_exists(state_file_path)\n delete_if_exists(chef_file_path)\n delete_if_exists(past_scripts_path)\n delete_if_exists(log_path)\n delete_if_exists(cook_state_file_path)\n end",
"title": ""
},
{
"docid": "b7bf13cbf913ff1647c04637cfe713c5",
"score": "0.6032324",
"text": "def teardown\n FileUtils.rm_rf(data_path)\n end",
"title": ""
},
{
"docid": "fee4420d163fa120700cd4cf987f2f92",
"score": "0.60261405",
"text": "def teardown\n Dir.chdir(@working_dir)\n FileUtils.rm_rf(@tmp_dir)\n end",
"title": ""
},
{
"docid": "761fcb6a03f3d1a7e38db82d89ffbcd1",
"score": "0.6024354",
"text": "def teardown\n Dir.chdir(user_dir)\n\n unless keep_outputs?\n cleanup\n\n dir = method_dir\n while dir != class_dir\n dir = File.dirname(dir)\n Dir.rmdir(dir)\n end rescue(SystemCallError)\n end\n\n super\n end",
"title": ""
},
{
"docid": "de7c6a6d9a8e962bce3f433ccf7a1840",
"score": "0.6020907",
"text": "def setupAppDir\n # Get an image of the context, as we will put it back after the testing\n lSystemPath = getSystemExePath.clone\n lLibsPath = getSystemLibsPath.clone\n lLoadPath = $LOAD_PATH.clone\n lGemsPath = nil\n if (defined?(Gem) != nil)\n lGemsPath = Gem.path.clone\n if (defined?(Gem.clearCache_RDI))\n Gem.clearCache_RDI\n end\n end\n # Create the application root directory for testing\n lAppRootDir = \"#{Dir.tmpdir}/RDITest/#{self.class.to_s.gsub(/:/,'_')}\"\n # If the application dir exists, clean it first\n if (File.exists?(lAppRootDir))\n FileUtils::rm_rf(lAppRootDir)\n end\n FileUtils::mkdir_p(lAppRootDir)\n # Create the installer\n @Installer = RDI::Installer.new(lAppRootDir)\n # Register the mute progress view\n @Installer.register_new_plugin(\n 'ProgressViews',\n 'MuteProgressView',\n nil,\n nil,\n RDI::Test::MuteProgressView,\n nil\n )\n # And set it as the default progress view\n @Installer.set_default_options( {\n :preferred_progress_views => [ 'MuteProgressView' ]\n } )\n\n # Call the test code\n yield\n @Installer = nil\n # Remove the temporary application root dir\n FileUtils::rm_rf(lAppRootDir)\n # Put back the context\n setSystemExePath(lSystemPath)\n setSystemLibsPath(lLibsPath)\n $LOAD_PATH.replace(lLoadPath)\n if (defined?(Gem) != nil)\n Gem.clear_paths\n lGemsPath.each do |iDir|\n if (!Gem.path.include?(iDir))\n Gem.path << iDir\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c34c7b46bf76b96f37233c8bc7fff1ce",
"score": "0.6016473",
"text": "def prepare_for_external_run\n raise \"You must call setUp before running this method.\" unless @setUp\n\n if ! @has_tests\n return\n end\n\n test_config_system_properties_file = @build_results.test_config_system_properties_file(@subtree.build_module.module_set)\n\n # Write out the system properties that we need to set.\n File.open(test_config_system_properties_file.to_s, \"w\") do |file|\n @sysproperties.each do |key, value|\n file << property_string(key, value) + \"\\n\"\n end\n end\n\n # Compute which system properties need to be set manually. This, as it turns out, is a bad idea: the\n # Eclipse plugin for TC development (actually JUnit which it extends) creates an Eclipse launch\n # configuration and it needs ALL the properties since this configuration is reused. Commented out in\n # case someone really wants to look at this, instead of just removing it.\n #required_system_properties = @sysproperties.keys & NON_CLASSPATH_LOADABLE_SYSTEM_PROPERTIES\n required_system_properties = @sysproperties.keys\n\n # Write out a file 'stamping' the module and subtree we've prepared this for, plus containing\n # extra information that the Eclipse tool we wrote that runs Terracotta tests needs in order\n # to correctly spawn the JVM that will run the test(s).\n File.open(@build_results.prepped_stamp_file(@subtree.build_module.module_set).to_s, \"w\") do |file|\n file << \"# This file is an indication that 'tcbuild check_prep' has been run.\\n\"\n file << \"tcbuild.prepared.module=#{@subtree.build_module.name.escape}\\n\"\n file << \"tcbuild.prepared.subtree=#{@subtree.name.escape}\\n\"\n file << \"tcbuild.prepared.cwd=#{@cwd.escape}\\n\"\n file << \"tcbuild.prepared.jvm.java=#{tests_jvm.java.escape}\\n\"\n file << \"tcbuild.prepared.jvm.version=#{tests_jvm.actual_version.escape}\\n\"\n file << \"tcbuild.prepared.jvm.type=#{tests_jvm.actual_type.escape}\\n\"\n\n jvm_args = all_jvmargs\n if container_home = @subtree.container_home || @config_source['tc.tests.configuration.appserver.home']\n jvm_args << \"-D#{@subtree.create_dynamic_property('appserver.home', container_home)}\"\n end\n file << \"tcbuild.prepared.jvmargs=#{jvm_args.length}\\n\"\n\n index = 0\n jvm_args.each do |jvmarg|\n file << \"tcbuild.prepared.jvmarg_%d=#{jvmarg.escape}\\n\" % [ index ]\n index += 1\n end\n\n\n required_system_properties.each do |syspropertykey|\n file << \"tcbuild.prepared.system-property.#{property_string(syspropertykey, @sysproperties[syspropertykey])}\\n\"\n end\n end\n\n puts \"========================================================================\"\n puts \"Wrote required system properties for module #{@subtree.module_subtree_name} to:\"\n puts \" '#{test_config_system_properties_file}'.\"\n puts \"The test configuration system will automatically load this file as needed.\"\n\n extra = \"\"\n extra += \" JVM arguments:\\n\\n\"\n\n unless all_jvmargs.empty?\n all_jvmargs.each { |key| extra += \"#{key}\\n\" }\n end\n\n unless required_system_properties.empty?\n required_system_properties.each { |key| extra += \"-D#{property_string(key, @sysproperties[key])}\\n\" }\n end\n\n unless extra.blank?\n puts \"\"\n puts :warn, \"This tree requires certain arguments and system properties that \"\n puts :warn, \"can't be set at runtime. You should set these directly via your \"\n puts :warn, \"IDE. If you don't, your tests may or may not work -- you have \"\n puts :warn, \"been warned.\"\n puts \"\"\n puts extra\n end\n\n puts \"\"\n puts \"And, just FYI (it isn't usually necessary to set these) the buildsystem \"\n puts \"normally runs tests in #{@subtree.module_subtree_name}...\"\n puts \" ...with the current working directory set to:\\n\\n#{@cwd}\\n\\n\"\n puts \" ...using the Java command at '#{tests_jvm.java}'.\"\n puts \"\"\n end",
"title": ""
},
{
"docid": "541e6abb90467dd08119becbb13d6b77",
"score": "0.60159457",
"text": "def teardown\n if File.exist?(modelPath())\n FileUtils.rm(modelPath())\n end\n if File.exist?(runDir())\n FileUtils.rm_rf(runDir())\n end\n end",
"title": ""
},
{
"docid": "6b4ccfd4a5f5eeee151a39469fb63dea",
"score": "0.60133624",
"text": "def testFixtureSetup()\n @windows = []\n # setup your objects for the tests (if needed)\n end",
"title": ""
},
{
"docid": "86d610b110739f1ae7580ab40813a56e",
"score": "0.60133594",
"text": "def teardown\n FileUtils.rm_rf(@@temp_dir) if Dir.exists?(@@temp_dir)\n end",
"title": ""
},
{
"docid": "1cd7cd698f4b73b650de6aa0539c4e74",
"score": "0.5986922",
"text": "def teardown_create_folder()\n @@PICS_PATH\n \nend",
"title": ""
},
{
"docid": "9b9c6175d3be3b714b23d5a63c111726",
"score": "0.5978642",
"text": "def teardown\n FileUtils.rm_rf(@@temp_dir) if Dir.exists?(@@temp_dir)\n end",
"title": ""
},
{
"docid": "07f06dd08df6ab05400a01766c8b346c",
"score": "0.59769845",
"text": "def test_setup\n \n end",
"title": ""
},
{
"docid": "160b8f089ad6d9d6cabf38c4f7efc3fe",
"score": "0.5972815",
"text": "def setup_all\n IdeaStore.environment = 'test_engine'\n IdeaStore.destroy_all\n assert_equal 0, IdeaStore.all.count\n end",
"title": ""
},
{
"docid": "cd2cb31b92c61394bbf53f9a9d7c9158",
"score": "0.5960263",
"text": "def teardown\n FileUtils.rm_rf(build_dir)\n end",
"title": ""
},
{
"docid": "8137fda94ed8c42ce36459509e2b4d4f",
"score": "0.59582055",
"text": "def cleanup_test_assets; end",
"title": ""
},
{
"docid": "3f57c9b42ca4b2b6f5ebf3bcee1aeda9",
"score": "0.59496015",
"text": "def after_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5948591",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "c7d372c3358b9bfee3e31bfca2e3e72a",
"score": "0.5946746",
"text": "def run!\n # Only run tests if the set-up passes\n if before.passed?\n # Run tests and report results\n new_context = if Context.async?\n run_tests_async!\n else\n run_tests!\n end\n # Run the clean-up file, if present\n after.run!\n else\n # The set-up file failed, All tests in this context and sub-contexts cannot be run.\n new_context = set_reason before.result, before.reason\n # Push the setup file to the 'stack trace'\n new_context = new_context.push before.file\n # Report the results of tests\n new_context.report\n end\n new_context\n end",
"title": ""
},
{
"docid": "08a529da0b0fb5782e113fa35a197374",
"score": "0.5937297",
"text": "def setup\n mutex.synchronize do\n break if @setup\n\n actual_root_dirs.each do |root_dir, namespace|\n set_autoloads_in_dir(root_dir, namespace)\n end\n do_preload\n\n @setup = true\n end\n end",
"title": ""
},
{
"docid": "f6592c738c27ed89bfaecebf7ae74efa",
"score": "0.593632",
"text": "def test_setup\n end",
"title": ""
},
{
"docid": "b2123383566924ed28daf0b4ae3a0715",
"score": "0.59356606",
"text": "def teardown!\n FileUtils.rm_rf(@tmpdir) if File.exists?(@tmpdir)\n end",
"title": ""
},
{
"docid": "b866304a4760350a52cf108f9ee079f5",
"score": "0.59335995",
"text": "def dummy_cleanup\n inside dummy_path do\n paths = %w[.gitignore db/seeds.rb Gemfile lib/tasks public/robots.txt\n spec test vendor]\n\n paths.each { |path| remove_file path }\n end\n end",
"title": ""
},
{
"docid": "1a7d0abd4d57242b02ea329638885ccc",
"score": "0.59285086",
"text": "def teardown!\n FileUtils.rm_rf(@tmpdir) if File.exist?(@tmpdir)\n end",
"title": ""
},
{
"docid": "c1a9589f693b180299b2b438e7ac1d37",
"score": "0.59239966",
"text": "def setup\n setup! unless setup?\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.5913284",
"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": "42d6ea597a28f1f6d9606347746a9469",
"score": "0.59114724",
"text": "def teardown\n working_dir = File.expand_path(WORKING_DIR)\n FileUtils.rm_rf(working_dir)\n\n true\nend",
"title": ""
},
{
"docid": "6902991bf96bea2a608560c5fef89946",
"score": "0.5910423",
"text": "def MainDirSetup\n\t\t\t\n\t\t\t# Create a Hash of directoryName to paths for easy user navigation?\n\t\t\n\t\t\tttDir = self.mkDir(\"ticketTemplateFiles\")\n\t\t\t\n\t\t\t# Move to the ticketTemplateFiles directory:\n\t\t\tself.add_usrPath(\"ticketTemplateFiles\")\n\t\t\t\n\t\t\t# Create the main tt Directories: outlines, templates, and codeLibrary\n\t\t\t\n\t\t\ttemplateDir = self.mkDir(\"templates\")\n\t\t\t\n\t\t\toutlineDir = self.mkDir(\"outlines\")\n\t\t\t\t\n\t\t\tcodeLibDir = self.mkDir(\"codeLibrary\")\n\t\t\t\n\t\t\t# Move to the templates directory:\n\t\t\tself.add_usrPath(\"templates\")\n\t\t\t\n\t\t\t# Create dirs for folders under templates: extracts, generated\n\t\t\t\n\t\t\textDir = self.mkDir(\"extracts\")\n\t\t\t\n\t\t\tgenDir = self.mkDir(\"generated\")\n\t\t\t\n\t\t\t# Go up 1 level\n\t\t\tself.rm_usrPath(1)\n\t\t\t\n\t\tend",
"title": ""
},
{
"docid": "c90a90f01a45978016c3fa6ef02daaad",
"score": "0.5902654",
"text": "def after_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "788994f458c565ba7efd8f41504906ba",
"score": "0.5897973",
"text": "def prepare!\n FileUtils.mkdir_p(File.join(Config.data_path, trigger))\n Cleaner.prepare(self)\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.5890334",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "a0d125200e8afc569defdb1c430e13d6",
"score": "0.58892196",
"text": "def before_setup\n # Reset the DB before each test to make a clean slate.\n # I swear this was easier back in like 2012!\n [ShortCode].each do |model|\n ApplicationRecord.connection.execute(\"Delete from #{model.table_name}\")\n ApplicationRecord.connection.execute(\"DELETE FROM SQLITE_SEQUENCE WHERE name='#{model.table_name}'\")\n end\n\n super\n end",
"title": ""
},
{
"docid": "487fce80f20e6667e1b1c1c7608f7931",
"score": "0.58862597",
"text": "def setup\n FileUtils.rm_rf(@@temp_dir) if Dir.exists?(@@temp_dir)\n Dir.mkdir(@@temp_dir) # unless Dir.exists?(@@temp_dir)\n\n #Creating directory structure for tests\n 5.times do |i|\n dir = @@temp_dir + \"/#{i}\"\n Dir.mkdir(dir)\n\n size = 2 ** i\n File.open(\"#{dir}/file\", 'w') { |f| f.seek(size-1);f.write(\"\\0\")} unless size <= 0\n end\n\n Dir.mkdir(@@dir_prerenamed1)\n File.open(\"#{@@dir_prerenamed1}/file\", 'w') { |f| f.write(\"\\0\")}\n\n Dir.mkdir(@@dir_prerenamed2)\n\n end",
"title": ""
},
{
"docid": "34e6924813cad45baa4c4e015b1bdadd",
"score": "0.5881104",
"text": "def before_teardown\n end",
"title": ""
},
{
"docid": "c1077a8f36d3f314e0559f1ec0fa523c",
"score": "0.5876094",
"text": "def teardown\n # remove files from working dir\n FileUtils.rm_rf Dir.glob(\"#{@dir}/*\")\n end",
"title": ""
},
{
"docid": "fd3002bddc15309761c18ce8e2b2b153",
"score": "0.58607835",
"text": "def testcase_setup\n end",
"title": ""
},
{
"docid": "07e8dcf31a42d25b8b498589ff92c087",
"score": "0.58550864",
"text": "def prepare\n if not File.exist?(build_dir)\n FileUtils.mkdir_p build_dir\n end\n cleanup\n end",
"title": ""
},
{
"docid": "390b9cf9864e847e712d265df3c59766",
"score": "0.5846191",
"text": "def before_teardown; end",
"title": ""
},
{
"docid": "390b9cf9864e847e712d265df3c59766",
"score": "0.5846191",
"text": "def before_teardown; end",
"title": ""
},
{
"docid": "390b9cf9864e847e712d265df3c59766",
"score": "0.5846191",
"text": "def before_teardown; end",
"title": ""
},
{
"docid": "40e319a46884718f438db7c17140f670",
"score": "0.58394825",
"text": "def setup\n @fixtures_dir = File.expand_path(File.dirname(__FILE__) + '/fixtures')\n end",
"title": ""
},
{
"docid": "40e319a46884718f438db7c17140f670",
"score": "0.58394825",
"text": "def setup\n @fixtures_dir = File.expand_path(File.dirname(__FILE__) + '/fixtures')\n end",
"title": ""
},
{
"docid": "a6ab1913687a79e184b39bdc256c5fd5",
"score": "0.583583",
"text": "def prepare!\n context.prepare!\n\n temp_path.rmtree if temp_path.exist?\n temp_path.mkdir\n end",
"title": ""
},
{
"docid": "d07d36891f30b59ef79f7bd0f574b3ed",
"score": "0.58347964",
"text": "def teardown\n FileUtils.rm_rf(\"test/resources/pac-test-repo\")\n end",
"title": ""
},
{
"docid": "da88436fe6470a2da723e0a1b09a0e80",
"score": "0.5828627",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "25a93eed474006f80a24eff115696a23",
"score": "0.58276653",
"text": "def finalize\n PathUtils.rm_rf @data_dir if File.exist?(@data_dir)\n end",
"title": ""
},
{
"docid": "5c05ee8144a980e20d6e9215aef247a3",
"score": "0.5820311",
"text": "def before\n _init_env\n end",
"title": ""
},
{
"docid": "a58f3b209d20c1ccaf3d7fc673b66646",
"score": "0.5814055",
"text": "def init_data_storage\n Dir::mkdir DATA_PATH unless FileTest::directory? DATA_PATH\n Dir::mkdir log_dir unless FileTest::directory? log_dir or not FileTest::directory? DATA_PATH\n end",
"title": ""
},
{
"docid": "cac8c364af03e2ea2162acc9d01e8a8b",
"score": "0.581153",
"text": "def cleanup\n action = false\n\n @repository.categories.each do |category|\n next if category.eql?(\"stage\")\n Architecture.dataset(category).each do |entry|\n directory = Architecture.new(entry[:architecture], entry[:component], entry[:suitename], category)\n if directory.is_unused?(entry[:fullpath])\n action = true\n directory.destroy\n end\n end\n Component.dataset(category).each do |entry|\n directory = Component.new(entry[:component], entry[:suitename], category)\n if directory.is_unused?(entry[:fullpath])\n action = true\n directory.destroy\n end\n end\n Suite.dataset(category).each do |entry|\n directory = Suite.new(entry[:suitename], category)\n if directory.is_unused?(entry[:fullpath])\n action = true\n directory.destroy\n end\n end\n end\n \n @metafile.create if action\n end",
"title": ""
},
{
"docid": "7cb71aedec67762f6d4ac0d68bcf7551",
"score": "0.5809606",
"text": "def setup\n setup! unless setup?\n end",
"title": ""
},
{
"docid": "dfff15c21b16a1352a23c0165babef55",
"score": "0.5807985",
"text": "def clean_up\n FileUtils.remove_entry @sandbox_dir\n end",
"title": ""
},
{
"docid": "9a65eeb9357328b4594715686d141379",
"score": "0.58064985",
"text": "def initialize_test_layout\n self.model_tests_dir = \"spec/models\"\n self.controller_tests_dir = \"spec/controllers\"\n self.view_tests_dir = \"spec/views\"\n self.fixtures_dir = \"spec/fixtures\"\n end",
"title": ""
},
{
"docid": "e4c4e94873c5a141fa3bfafab9bf968a",
"score": "0.5794325",
"text": "def setup\n Logging.ndc.push(@test_name)\n #\n super\n @result_data = Automation::TaskResultData.new(@config_manager['run.result.directory'], @test_name)\n runtime.save(:test_runner, self)\n # Task name.\n @task_result.properties['display_name'] = @test_name\n @task_result.save\n #\n @logger.debug('Loading test...')\n load_test\n create_working_directory\n notify_change('test_started')\n #\n @logger.debug('Loading database resources...')\n @run_result = @results_database.get_run_result\n @run_config = @run_result.run_config\n @resource = @test_database.get_test!(@run_config, @test_name, @test.test_type)\n @test_result = @test_database.create_test_result(@run_result, @resource)\n # Validate that the resources were created properly.\n raise DataError.new(\"Could not create the 'Test' resource\") if @resource.nil?\n raise DataError.new(\"Could not create the 'TestResult' resource\") if @test_result.nil?\n # Save extra test information to the database.\n @resource.test_category = @test.category\n @resource.test_description = @test.description\n @resource.save\n # Save the current process' PID.\n update_pid\n end",
"title": ""
},
{
"docid": "95c3bf4b0412a6af1e1d30ac1df05931",
"score": "0.57935226",
"text": "def setup\n create_path\n create_file\n create_config_file\n end",
"title": ""
},
{
"docid": "c78ff861e1a7ab63b018740b0c3f2c9c",
"score": "0.57827115",
"text": "def reset!\n self.class.cleanup(prepared_root)\n FileUtils.mkdir_p(root)\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5780586",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "d4af6529acdc1460860e4ed5838adbf9",
"score": "0.5779861",
"text": "def teardown\n cleanup_token # In case we created an authorization\n FileUtils.remove_entry_secure ENV['HOME'] if ENV['HOME'].start_with? '/tmp'\n FileUtils.remove_entry_secure @pwd if @pwd.start_with? '/tmp'\n ENV['HOME'] = @old_home\n Dir.chdir @old_pwd\n super\n end",
"title": ""
},
{
"docid": "56181ded3ade49495da4772ad028d02f",
"score": "0.5777193",
"text": "def setup\n\n if File.exist?(reportPath())\n FileUtils.rm(reportPath())\n end\n \n assert(File.exist?(modelPath()))\n end",
"title": ""
},
{
"docid": "69b36783014783c70f171276af01eb02",
"score": "0.5773164",
"text": "def prepare_container_component_dirs; end",
"title": ""
},
{
"docid": "241713329f38fd1f43a7799cf79d710a",
"score": "0.5767411",
"text": "def setup_dir(dir)\n rm_dir(dir)\n mkdir(dir)\n end",
"title": ""
},
{
"docid": "54bc5dcae180a37208662771ff8732ce",
"score": "0.5766836",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "02525fcabbf68d991e70d4ee38c263fc",
"score": "0.57622975",
"text": "def setup_environment\n dirs = [ $chrootdir, LOGDIR, STATEDIR, SNAPSHOTDIR, STAGEDIR, SNAPSHOTCACHE ]\n dirs.each { |dir| FileUtils.mkdir_p(\"#{dir}\") }\n end",
"title": ""
},
{
"docid": "c7e6625d62e56ef1edb7f943b7bf0ef5",
"score": "0.57572323",
"text": "def setup!\n ensure_config_directory_exists!\n load_config\n load_users\n end",
"title": ""
},
{
"docid": "b1006739444088976d877994de66d665",
"score": "0.5756931",
"text": "def cleanup\n FileUtils.remove_dir(work_dir, force: false)\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "be75e219caa852b50008152e67f0f9f3",
"score": "0.0",
"text": "def set_call\n @call = Call.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": ""
}
] |
a93649f9d1b9f092cb2e5ec6c19a51da
|
TODO: add unit to scope
|
[
{
"docid": "0c55f419d83bb618ef44845f0c76b2e6",
"score": "0.0",
"text": "def pds_meters_digitals\n @data_list = PdsMetersDigital.where(Project: project.ProjectID)\n .includes({ hw_ic: [:hw_ped, pds_project_unit: :unit] }, :system,\n :pds_section_assembler)\n .pluck(:MetDigID,\n 'hw_ic.icID', 'hw_ic.ref', 'hw_ic.tag_no', 'hw_ic.Description',\n 'hw_peds.ped_N', 'hw_peds.ped',\n 'pds_syslist.SystemID', 'pds_syslist.System',\n 'pds_section_assembler.section_N', 'pds_section_assembler.section_name',\n 'hw_ic.scaleMin', 'hw_ic.scaleMax',\n 'pds_project_unit.ProjUnitID', 'pds_unit.UnitID', 'pds_unit.Unit_RU').each.map do |e|\n e1 = {}\n e1['id'] = e[0]\n e1['hw_ic'] = { id: e[1], ref: e[2], tag_no: e[3], Description: e[4],\n hw_ped: { id: e[5], ped: e[6] }, scaleMin: e[11], scaleMax: e[12],\n pds_project_unit: { id: e[13], unit: { id: e[14], Unit_RU: e[15] } } }\n e1['system'] = { id: e[7], System: e[8] }\n e1['pds_section_assembler'] = { id: e[9], section_name: e[10] }\n e = e1\n end\n end",
"title": ""
}
] |
[
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "a9c3d6a9cee3eb85d330b5e72e96f90a",
"score": "0.69340616",
"text": "def scope; end",
"title": ""
},
{
"docid": "2b7331694c41d423bf0fac01c1ebbdc2",
"score": "0.68782866",
"text": "def scope_test\n end",
"title": ""
},
{
"docid": "a5432aadd8cc5947db0ccf866c05e0a0",
"score": "0.6416703",
"text": "def scope=(_); end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.6328664",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.6328664",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "117bc71cd8976d01e54c03e8a55ef09e",
"score": "0.6328664",
"text": "def scope=(_arg0); end",
"title": ""
},
{
"docid": "4946f387d24ffb47822364ad2bc6babb",
"score": "0.61578405",
"text": "def process_scope exp\n # NOPE?\n end",
"title": ""
},
{
"docid": "ede8516c91636f45c76174d0432c7319",
"score": "0.61563724",
"text": "def scope() binding end",
"title": ""
},
{
"docid": "6caab9d41806a3f814127643d8c622b3",
"score": "0.6114795",
"text": "def scope() yield end",
"title": ""
},
{
"docid": "cb1deda94ece90e9475c8cd2827744f8",
"score": "0.607381",
"text": "def evaluate(scope)\n end",
"title": ""
},
{
"docid": "7259dd410affd3468a46d3f51791be85",
"score": "0.60269684",
"text": "def scope(*args); end",
"title": ""
},
{
"docid": "30e913f766c746c07a11a0e27284fd0c",
"score": "0.6023754",
"text": "def scope_level; end",
"title": ""
},
{
"docid": "b0e19db890a48f47b0f91985e3399ae6",
"score": "0.5983665",
"text": "def run_scope(scope, machine, klass, states); end",
"title": ""
},
{
"docid": "74678fbe6c627b40ca379220be78fbe5",
"score": "0.5976722",
"text": "def unit\n self.dup.unit!\n end",
"title": ""
},
{
"docid": "f3c13a1a81915ee7e7acb15e84307ded",
"score": "0.5917227",
"text": "def scopes; end",
"title": ""
},
{
"docid": "a95ca71a73143bde330e84db80daf329",
"score": "0.59009194",
"text": "def scope_name; end",
"title": ""
},
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.58973897",
"text": "def private; end",
"title": ""
},
{
"docid": "5ca8ac53f0d0540823ff2227a89984b3",
"score": "0.5839423",
"text": "def scope_condition() \"1\" end",
"title": ""
},
{
"docid": "3e463304ef594c1ed0906d3424abd26d",
"score": "0.5836118",
"text": "def scope_condition() {} end",
"title": ""
},
{
"docid": "49bce52070c36a20ae5f26875079400d",
"score": "0.5830463",
"text": "def scope=(v); end",
"title": ""
},
{
"docid": "49bce52070c36a20ae5f26875079400d",
"score": "0.5830463",
"text": "def scope=(v); end",
"title": ""
},
{
"docid": "ce4cad4095be35dc2288c9352e24dc0b",
"score": "0.5784761",
"text": "def units _args\n \"units _args;\" \n end",
"title": ""
},
{
"docid": "38078b4e2c9e6d400c359a41aee5dfee",
"score": "0.57675034",
"text": "def unit\n return @unit\n end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.574124",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.574124",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.574124",
"text": "def specie; end",
"title": ""
},
{
"docid": "d8ae3e2b236950074c4632d180274b8a",
"score": "0.574124",
"text": "def specie; end",
"title": ""
},
{
"docid": "80d0775c89c45a1224b2a3d1c8eda62a",
"score": "0.57098347",
"text": "def scope\n if true\n bar = 1\n end\n p bar\nend",
"title": ""
},
{
"docid": "e8d3e1d1d5233e73884fc12ada3e2a73",
"score": "0.567139",
"text": "def units\n @units = SQF.units @this\n @units\n end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5666582",
"text": "def isolated; end",
"title": ""
},
{
"docid": "7ff2011fa3dc45585a9272310eafb765",
"score": "0.5666582",
"text": "def isolated; end",
"title": ""
},
{
"docid": "c3d2edfd89056beea08f50cd498ee4da",
"score": "0.56592137",
"text": "def scope_loop\nend",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.565482",
"text": "def spec; end",
"title": ""
},
{
"docid": "072514f3348fe62556dcdfd4b06e3d08",
"score": "0.565482",
"text": "def spec; end",
"title": ""
},
{
"docid": "ed84d06884df63265fa1af69ca7e8633",
"score": "0.56355995",
"text": "def scope_options; end",
"title": ""
},
{
"docid": "ed84d06884df63265fa1af69ca7e8633",
"score": "0.56355995",
"text": "def scope_options; end",
"title": ""
},
{
"docid": "2600ad0ca26c6995868e1c4be0ff6a75",
"score": "0.55936056",
"text": "def unit_t\n I18n.t \"#{self.unit_s}\", :count => 1\n end",
"title": ""
},
{
"docid": "2f2ed90552346416a246c197cd85cb1a",
"score": "0.5584109",
"text": "def switchableUnits \n \"switchableUnits\" \n end",
"title": ""
},
{
"docid": "ab3338ea4a4f4dfe7e181f07fae90083",
"score": "0.5581851",
"text": "def base_unit\n units[0]\n end",
"title": ""
},
{
"docid": "e0ffb8c6316a706a532b5c46c9d40aa0",
"score": "0.5532641",
"text": "def as(scope); end",
"title": ""
},
{
"docid": "2acfd4a0a6163bda3b3e976520785950",
"score": "0.5499069",
"text": "def playableUnits \n \"playableUnits\" \n end",
"title": ""
},
{
"docid": "758dfff0ca414d2c1e4af0fa8fa2718d",
"score": "0.54864025",
"text": "def scope\n @scope ||= TestScope.new(self)\n end",
"title": ""
},
{
"docid": "17fa5ad880748b32718dcd8176cffa5c",
"score": "0.5455851",
"text": "def systemOfUnits \n \"systemOfUnits\" \n end",
"title": ""
},
{
"docid": "b7ca91539ebed1456ca6bd8e8fe08dbf",
"score": "0.54476523",
"text": "def getAssignedCuratorUnit _args\n \"getAssignedCuratorUnit _args;\" \n end",
"title": ""
},
{
"docid": "d2b660426f507d0f03c848711b5beba5",
"score": "0.54453415",
"text": "def action(unit)\n\tend",
"title": ""
},
{
"docid": "311526caf75b30eb1800eac4ee5f4120",
"score": "0.5398769",
"text": "def valid_scope(valid_scopes, scope)\n\t\tend",
"title": ""
},
{
"docid": "733a66aa14b46407482fa08423b84dc8",
"score": "0.5390685",
"text": "def Unitize(*args)\n Unitize::Measurement.new(*args)\nend",
"title": ""
},
{
"docid": "c0426a17f21a790cecf51dd7841ec6ad",
"score": "0.5389625",
"text": "def ask_usable(unit)\n\tend",
"title": ""
},
{
"docid": "36be03e4382c7a116636031e4fe62641",
"score": "0.5382897",
"text": "def try_to_set_scope\n #this is a commodity method\n if self.featurable.is_a?(Account)\n self.scope = \"AccountPlan\"\n end\n end",
"title": ""
},
{
"docid": "fa79528ec2a37928b1e16213497e835b",
"score": "0.5380269",
"text": "def find_scope!(obj); end",
"title": ""
},
{
"docid": "0239d2bcf7e03e07b10d0dd352de4ceb",
"score": "0.5375159",
"text": "def scope1(var)\r\n\ta = \"monkey\"\r\nend",
"title": ""
},
{
"docid": "d5d5767a674be6a28fc297ccfd7489c3",
"score": "0.5357613",
"text": "def unit\n \"#{context}##{target}\"\n end",
"title": ""
},
{
"docid": "056fdc29100b43dab7cf6300b60ef4c9",
"score": "0.5325913",
"text": "def put_var_scope\nend",
"title": ""
},
{
"docid": "f13fb977fa8a7e748ace8196d829fe88",
"score": "0.5324073",
"text": "def refresh!\n\t\tunits.each do |unit| \n\t\t\tvar_name = :\"@#{unit}\"\n\t\t\tinstance_variable_set var_name, nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0030e8c2c08afd7374d4d0f594223cdf",
"score": "0.5323703",
"text": "def production_curtailment; end",
"title": ""
},
{
"docid": "b8ecb400cb030efcfbf142f3d520461a",
"score": "0.5314787",
"text": "def local_variables() end",
"title": ""
},
{
"docid": "c9f1af465866d59613fd9e2e2442c2f0",
"score": "0.5314108",
"text": "def param; end",
"title": ""
},
{
"docid": "c9f1af465866d59613fd9e2e2442c2f0",
"score": "0.5314108",
"text": "def param; end",
"title": ""
},
{
"docid": "cce3bbaaa3ee1ceb1e7a63e190c824c6",
"score": "0.5309046",
"text": "def scope\n @scope ||= {}\n end",
"title": ""
},
{
"docid": "cce3bbaaa3ee1ceb1e7a63e190c824c6",
"score": "0.5309046",
"text": "def scope\n @scope ||= {}\n end",
"title": ""
},
{
"docid": "f585a193db2cbfce5242457fc7785f81",
"score": "0.52933794",
"text": "def inner_scope(param)\n param = 12\nend",
"title": ""
},
{
"docid": "7374b959a4a2ed75455cee3c826e44e3",
"score": "0.5286742",
"text": "def fuzzily_scope\n self\n end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.5282331",
"text": "def context; end",
"title": ""
},
{
"docid": "b3fe915337424bf55bb3a4d10707077c",
"score": "0.5279948",
"text": "def set_unit\n #@unit = Unit.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a1189b8e91ec3e338236a5617e87c97",
"score": "0.5277252",
"text": "def guct\n end",
"title": ""
},
{
"docid": "3b20b1d90645498bb5e9a7e8b446b3c5",
"score": "0.52763176",
"text": "def evaluate(scope)\n self\n end",
"title": ""
},
{
"docid": "d8caf087c6ce7fb378d57dc1f46fa8e6",
"score": "0.52763134",
"text": "def it_scope\n @it_scope ||= Example::Scope.new(self)\n end",
"title": ""
},
{
"docid": "b13dc2eea9e9984c73f6470575daae34",
"score": "0.5275487",
"text": "def scopeName _args\n \"scopeName _args;\" \n end",
"title": ""
},
{
"docid": "db7aeb37824c3836be46680fa163f7a6",
"score": "0.5275485",
"text": "def strain; end",
"title": ""
},
{
"docid": "cdd16ea92eae0350ca313fc870e10526",
"score": "0.527527",
"text": "def who_we_are\r\n end",
"title": ""
},
{
"docid": "3271745a58fcbfa978b8f2d1da80cd78",
"score": "0.52712893",
"text": "def unit_s\n self.unit.to_s if self.unit\n end",
"title": ""
}
] |
86aee864caa0f60c3516918d2aa63d77
|
Get Marketing Companys Count
|
[
{
"docid": "b8bca7ea6ef2dfaeb81f5c649aa5dceb",
"score": "0.0",
"text": "def marketing_groups_id_companies_count_get(id, opts = {})\n data, _status_code, _headers = marketing_groups_id_companies_count_get_with_http_info(id, opts)\n return data\n end",
"title": ""
}
] |
[
{
"docid": "fe38254436f27ab98b04ae975f39c6da",
"score": "0.6702017",
"text": "def collaboration_count\n (attributes['collaboration_count'] || mixables.size).to_i\n end",
"title": ""
},
{
"docid": "d5e73b68d4f2de778b74162f7a0c0a15",
"score": "0.6609296",
"text": "def get_department_count(company)\n company.departments.count\n end",
"title": ""
},
{
"docid": "1d8ca9184577f3869b5bb7f9fbf24d8c",
"score": "0.64509165",
"text": "def summate_activity_counts\n activity_count = 0\n all_user_projects_subscriptions.find_each do |subscription|\n next if subscription.empty_summary?\n if count = subscription.summary.values.first[:count].to_i\n activity_count += count\n end\n end\n activity_count\n end",
"title": ""
},
{
"docid": "f2b9b09653ba1885eb55652ddb6ff0c4",
"score": "0.64302003",
"text": "def count\n merchants.count\n end",
"title": ""
},
{
"docid": "64601aac653ab2bb387b3662758e9f61",
"score": "0.6403526",
"text": "def cc_count\n stats = self.association_stats\n stats['cc_conditions'] + stats['cc_loops'] + stats['cc_questions'] +\n stats['cc_sequences'] + stats['cc_statements']\n end",
"title": ""
},
{
"docid": "4a38f3e11fcb89bd526ef81a18057e2c",
"score": "0.6374573",
"text": "def calculate_count _changed_card=nil\n ids = left.related_companies\n update_topic_company_cached_count ids.size\n result = {}\n ids.each do |company_id|\n result[company_id] = true unless result.key?(company_id)\n end\n result.to_json\nend",
"title": ""
},
{
"docid": "b7cead39525ede7c983142f3e3851489",
"score": "0.63186115",
"text": "def get_affiliations_count\r\n @summary.affiliations_count\r\n end",
"title": ""
},
{
"docid": "e657fadd6f7d77f065b0468e9c67a7f3",
"score": "0.62547773",
"text": "def enrollee_count\n count = 0\n courses.each do |c|\n count += c.course.all_enrollee_count\n end\n count += extra_enrollees.size\n count\n end",
"title": ""
},
{
"docid": "3fed6d1c178ac418cb6bc0b3ed026828",
"score": "0.62162167",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "079f4a41cd2f2c5d240c812cc54833e1",
"score": "0.62132734",
"text": "def subscriber_count\n return @count if @count\n\n conditions = [{:field => \"date\", :op => \"lt\", :value => id},\n {:field => \"interests-#{MAILCHIMP_SETTINGS[:grouping_id]}\", \n :op => \"none\", \n :value => \"Free Subscription\"}]\n\n @count = api.campaign_segment_test MAILCHIMP_SETTINGS[:list_id], \n :match => \"all\", \n :conditions => conditions \n end",
"title": ""
},
{
"docid": "dbf75e5663dec9572150a9b37249843f",
"score": "0.6182314",
"text": "def number_of_commissioned_works(login=nil)\n count_by_frbr(login, :has_commissioned, :how_many_works?) \n end",
"title": ""
},
{
"docid": "a6a3b4dee3b3208d7c689b963503454e",
"score": "0.6167165",
"text": "def company_count\n return 0 unless answer_id\n Card.search left_id: answer_id,\n right: { type_id: WikirateCompanyID },\n return: :count\nend",
"title": ""
},
{
"docid": "e89e21a5db9731ba5c40998d247cd5bd",
"score": "0.61568916",
"text": "def number_of_commissioners(login=nil)\n count_by_frbr(login, :is_commissioned_by, :how_many_roles?) \n end",
"title": ""
},
{
"docid": "fc54ad31e695001e8b1ab55bddcb9b86",
"score": "0.61247045",
"text": "def number_of_councils\n payer_breakdown && payer_breakdown.select{ |p| p[:organisation_type] == 'Council' }.size\n end",
"title": ""
},
{
"docid": "7fcb718c8a5bb8d4a0121174e568a3cc",
"score": "0.61183316",
"text": "def number_of_commissioned_expressions(login=nil)\n count_by_frbr(login, :has_commissioned, :how_many_expressions?) \n end",
"title": ""
},
{
"docid": "63f1bc2020187cb26dbca0c473e34c90",
"score": "0.611364",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "63f1bc2020187cb26dbca0c473e34c90",
"score": "0.611364",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "63f1bc2020187cb26dbca0c473e34c90",
"score": "0.611364",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "2838a76bc7015ff9ba7a20ed8ad72595",
"score": "0.6103162",
"text": "def mailCount count_type=nil\n # Init the email count to start fresh every time this is called\n total_count = 0\n\n # Get the total count of emails in the Exchange inboxes\n exch_count = exchangeMailCount\n total_count += exch_count\n \n # Get the total count of emails in the IMAP inboxes\n imap_count = imapMailCount\n total_count += imap_count\n\n @email_count = total_count\n puts total_count\n growlNotify\n return @email_count.to_s\n end",
"title": ""
},
{
"docid": "60bfe54b21db4c0556b31dcdda2728a4",
"score": "0.6095396",
"text": "def assignation_count(options = {})\n assignations = options[:assignations]\n \n if assignations.present?\n return assignations.count\n end\n \n #puts \"START COUNTING!\"\n assignation_count = inorder_assignation_count(self) \n end",
"title": ""
},
{
"docid": "b2c039ad790178638b0700e88126d82a",
"score": "0.60922337",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "b2c039ad790178638b0700e88126d82a",
"score": "0.60922337",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "b2c039ad790178638b0700e88126d82a",
"score": "0.60922337",
"text": "def count\n @count\n end",
"title": ""
},
{
"docid": "7dd39e5a9e339ea0d2d63e68098cbb8f",
"score": "0.60818416",
"text": "def agreed_with_community\n responses = self.responses\n count = 0\n responses.each do |response|\n #count += 1 if response.verdict == response.question.get_community_verdict\n count += 1 if response.question.get_community_verdict(response.verdict)\n end\n return count\n end",
"title": ""
},
{
"docid": "98329509c17babf954fee41d75e3b629",
"score": "0.60532326",
"text": "def total_registered_subject_count\n # CourseTeachingAssignment.find(:all, :conditions => {\n # :user_id => self.id,\n # :is_active => true \n # }).count\n \n \n all_subjects_registered_id_list = all_subjects_registered.map{|x| x.id }\n SubjectRegistration.where(:is_active => true, :user_id => self.id,\n :subject_id =>all_subjects_registered_id_list ).count\n \n \n # all_courses_taught_id_list = all_courses_taught.map{|x| x.id }\n # CourseTeachingAssignment.where(:is_active => true, :user_id => self.id,\n # :course_id =>all_courses_taught_id_list ).count\n end",
"title": ""
},
{
"docid": "79d6d3ede448a8b0f463b25a6d141134",
"score": "0.6051192",
"text": "def customers_count()\n return customers().length()\n end",
"title": ""
},
{
"docid": "0a83a5c9586a8b9653313a1a4fdf8279",
"score": "0.6047684",
"text": "def get_collections_count()\n uri = build_uri('info/collection_counts')\n @tools.process_get_request(uri, @user_obj.encrypted_login, @user_pwd).body\n end",
"title": ""
},
{
"docid": "6a875c3a29b139786bdea905bb48d5d1",
"score": "0.6041145",
"text": "def total_count\n fetch.json.[](:total_count)\n end",
"title": ""
},
{
"docid": "bb4013329c17b5229aa777fdc1d2ffd7",
"score": "0.6014437",
"text": "def counts\r\n @counts\r\n end",
"title": ""
},
{
"docid": "06d9df329f06acd4f21a53bdfccf0b9a",
"score": "0.6014243",
"text": "def meeting_count\n Meeting.visible.count(:include => [:project], :conditions => statement)\n rescue ::ActiveRecord::StatementInvalid => e\n raise StatementInvalid.new(e.message)\n end",
"title": ""
},
{
"docid": "ca0b9d3b4ef0bfbe89a0f21e422b752f",
"score": "0.59959733",
"text": "def number_of_events_commissioned_at(login=nil)\n count_by_frbr(login, :is_commissioned_for, :how_many_events?) \n end",
"title": ""
},
{
"docid": "f2058c9d694279af244293aa2f460cd1",
"score": "0.5995271",
"text": "def ActiveKiteCount\n return kites.where(:Completed => true).any? ? kites.where(:Completed => true).count : 0\n end",
"title": ""
},
{
"docid": "48acee784a9753ea8d56f00c1aeeca70",
"score": "0.5980661",
"text": "def count\n @collector.count\n end",
"title": ""
},
{
"docid": "3d76bad2ce907ae4af9d04eed0a59a13",
"score": "0.5964466",
"text": "def email_count\n return @email_count\n end",
"title": ""
},
{
"docid": "346002754459fe17e4e51dc5f6b8a89d",
"score": "0.5951452",
"text": "def total_cat_count\n @training_count\n end",
"title": ""
},
{
"docid": "346002754459fe17e4e51dc5f6b8a89d",
"score": "0.5951452",
"text": "def total_cat_count\n @training_count\n end",
"title": ""
},
{
"docid": "ba6ad2e280b5fcab8ab2afdaa1e8f931",
"score": "0.594292",
"text": "def count_of_teams\n @teams.count\n end",
"title": ""
},
{
"docid": "0058d3cdb7fdc4b073852328dd080584",
"score": "0.5937584",
"text": "def number_of_compilers(login=nil)\n count_by_frbr(login, :is_compiled_by, :how_many_roles?) \n end",
"title": ""
},
{
"docid": "867fc9a980c3812809c24cc343335a68",
"score": "0.5934643",
"text": "def project_counts\n @project_counts ||= Kithe::Model.joins(:contains_contained_by).\n where(published: true, contains_contained_by: {container_id: project_list.collect(&:id) }).\n group(:container_id).\n count\n end",
"title": ""
},
{
"docid": "a47a5f7cc1530b8afdb0d7e069ccf2f4",
"score": "0.59332794",
"text": "def count\n call_client(:count)\n end",
"title": ""
},
{
"docid": "07cc6a3cf486c16e7188c9d8950a2f28",
"score": "0.59251595",
"text": "def check_count\n\n count = { :designer => 0, :peer => 0 }\n checklist = self.checklist\n\n case self.design.design_type\n when 'New'\n count[:designer] = checklist.new_design_self_check_count\n count[:peer] = checklist.new_design_peer_check_count\n when 'Dot Rev'\n count[:designer] = checklist.bareboard_design_self_check_count\n count[:peer] = checklist.bareboard_design_peer_check_count\n end\n\n return count\n \n end",
"title": ""
},
{
"docid": "614b828d2b32b32d3321f031eb7ca099",
"score": "0.59216076",
"text": "def customer_count()\n customers().count()\nend",
"title": ""
},
{
"docid": "a61b12481a8475e940fe159a807f4501",
"score": "0.5909098",
"text": "def offense_counts; end",
"title": ""
},
{
"docid": "a61b12481a8475e940fe159a807f4501",
"score": "0.5909098",
"text": "def offense_counts; end",
"title": ""
},
{
"docid": "0e0c5010434a9732ebf44e4db8d3eac7",
"score": "0.5906535",
"text": "def number_of_tickets_bought() # working in terminal - console (eg.: customer1.number_of_tickets_bought)\n return films.count\n end",
"title": ""
},
{
"docid": "ee64c3b4965e454518cfe9f456e0c2ad",
"score": "0.5905265",
"text": "def exchangeMailCount\n # Init the email count to start fresh every time this is called\n total_count = 0\n\n # Get the total count of emails in the Exchange inboxes\n exchange_inbox = Array.new\n count = 0\n @exch_accounts.each do |acct|\n exchange_inbox[count] = @exch_accounts[count].inboxFolder.get\n total_count += exchange_inbox[count].unreadMessageCount\n end\n\n return total_count\n end",
"title": ""
},
{
"docid": "824cb5fd5324eba2355d60f78abd5913",
"score": "0.5903213",
"text": "def sellings_count\n sellings.count\n end",
"title": ""
},
{
"docid": "44622ec95477068de4a879b7c22a3db0",
"score": "0.5899807",
"text": "def commons_count\n respond_to?(:commonsCount) ? commonsCount.to_i : nil\n end",
"title": ""
},
{
"docid": "c8739faad0d17c293b5df24f70d1e50c",
"score": "0.58979434",
"text": "def count_meetings\n # TODO respond with xml, only if valid session, otherwise return nil\n team = Team.find_by_id( params[:id] )\n if team\n render json: team.meetings.collect{|row| row.id}.uniq.size\n else\n render json: 0\n end\n end",
"title": ""
},
{
"docid": "4ca5792b5c0602df61c22e753c9d37fe",
"score": "0.58717465",
"text": "def count\n @mailcount = `exiqgrep -c #{@direction} #{@email} 2>/dev/null`.chomp\n end",
"title": ""
},
{
"docid": "bdc3bf3f207149ebc7e46b82bec459ef",
"score": "0.58671844",
"text": "def count_meetings\n team = Team.find_by_id( params[:id] )\n if team\n render( json: team.meetings.collect{|row| row.id}.uniq.size )\n else\n render( json: 0 )\n end\n end",
"title": ""
},
{
"docid": "02a3dc96ea45246b5dbaf7c670472eb9",
"score": "0.5863489",
"text": "def total_num_assignment_teams\n assignment_team_counts.inject(:+)\n end",
"title": ""
},
{
"docid": "5d269f5e4a46984b60fdfe073921bf1d",
"score": "0.58612853",
"text": "def counters\n {\n files: files_count,\n apps: apps_count,\n workflows: workflows_count,\n jobs: jobs_count,\n members: members_count,\n }\n end",
"title": ""
},
{
"docid": "bce2b1ec17413112d58e91019091a6c2",
"score": "0.58522415",
"text": "def count\n @count ||= get_count\n end",
"title": ""
},
{
"docid": "31213bbc1a1c29131532d4f0fb22a994",
"score": "0.58394665",
"text": "def get_num_courses_for_department(valid_department)\r\n valid_department.courses.count\r\n end",
"title": ""
},
{
"docid": "461fb1ff68facd31eca39efa943a7714",
"score": "0.5834908",
"text": "def get_office365_activations_user_counts()\n return MicrosoftGraph::Reports::GetOffice365ActivationsUserCounts::GetOffice365ActivationsUserCountsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "a53b269b5dc577fbd5065de1a81780db",
"score": "0.58305514",
"text": "def call\n res = client.get('/api/rest/v1/users.json?action=count')\n res['data']['count']\n end",
"title": ""
},
{
"docid": "8b394293066ea3d052790f8eba78ebd4",
"score": "0.58300716",
"text": "def count\n @count ||= Date.current.year - @release_date.year\n end",
"title": ""
},
{
"docid": "b0a4bf20123bdf36859f5acfb60ff7c6",
"score": "0.5827624",
"text": "def fGetEventCount\n @sports.eventCount\n end",
"title": ""
},
{
"docid": "f507ef4cdc7c19338af9df75c2b0f3cf",
"score": "0.58229196",
"text": "def count_tickets\n tickets = self.tickets\n total_tickets = tickets.count\n return total_tickets\n end",
"title": ""
},
{
"docid": "909336378ff400952932e0cbeb256806",
"score": "0.58204854",
"text": "def submission_count\n if current_course_user&.manager_or_owner?\n my_students_pending_submissions_count > 0 ? my_students_pending_submissions_count : pending_submissions_count\n elsif current_course_user&.staff?\n my_students_pending_submissions_count\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "9aaef60fe36b82eef7e96cc8a6c1b234",
"score": "0.5818028",
"text": "def count\n Project.count\n end",
"title": ""
},
{
"docid": "5e62c0c75af07d24f44e7b374b60b284",
"score": "0.5814203",
"text": "def totalcount\n @totalcount\n end",
"title": ""
},
{
"docid": "4848f6617d2a9cdcca67c786bf3f643f",
"score": "0.58056754",
"text": "def get_office365_activation_counts()\n return MicrosoftGraph::Reports::GetOffice365ActivationCounts::GetOffice365ActivationCountsRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "100d0cc7a4f8462a63a00af6d2fc4f58",
"score": "0.57880104",
"text": "def number_of_event_commissions(login=nil)\n count_by_frbr(login, :is_commissioned_for, :how_many_events?) \n end",
"title": ""
},
{
"docid": "d260da49b65d97aab7b6b19b28f96a55",
"score": "0.5780274",
"text": "def present_count\n __present__(*planets_and_counts { |p| p.connection(format) })\n end",
"title": ""
},
{
"docid": "c7b0af731d4ecfb381f89e79da669ab0",
"score": "0.5779395",
"text": "def count_customers\n return customers().length\n end",
"title": ""
},
{
"docid": "0942ea74b97129b8a6a32d759e1ab1a4",
"score": "0.57781124",
"text": "def company_count\n return 0 unless answer_id\n Relationship.where(answer_id: answer_id).count\nend",
"title": ""
},
{
"docid": "80ff8e43f6b6932e7ad48a6f379d2814",
"score": "0.57778484",
"text": "def get_counter\n conversations = (Conversation.where(buyer_id: @current_user.id).all + Conversation.where(seller_id: @current_user.id).all)\n total = 0\n conversations.each do |conversation|\n count = conversation.messages.count - conversation.buyer_marker if conversation.buyer_id == @current_user.id\n count = conversation.messages.count - conversation.seller_marker if conversation.seller_id == @current_user.id\n total = total + count\n end\n render status: 200, json: {unread_count: total}\n end",
"title": ""
},
{
"docid": "b9e492879e24b2a405d1c590b658fa86",
"score": "0.57766795",
"text": "def meeting_count_by_group\n r = nil\n if grouped?\n begin\n # Rails3 will raise an (unexpected) RecordNotFound if there's only a nil group value\n r = Meeting.visible.count(:group => group_by_statement, :include => [:project], :conditions => statement)\n rescue ActiveRecord::RecordNotFound\n r = {nil => meeting_count}\n end\n c = group_by_column\n end\n r\n rescue ::ActiveRecord::StatementInvalid => e\n raise StatementInvalid.new(e.message)\n end",
"title": ""
},
{
"docid": "5837062f5659e58c5c4a67a87a7b894a",
"score": "0.5763674",
"text": "def get_category_count(city_portal)\n @city_portal = city_portal\n @data_portal = DataPortal.find(@city_portal.data_portal_id)\n\n categories = @city_portal.count_categories\n @data_portal.update(category_counts: categories)\n end",
"title": ""
},
{
"docid": "6339caa9216994b1d734e2bdeca1d258",
"score": "0.57612514",
"text": "def get_count\n @count <= 0 ? DEFAULT_COUNT : @count;\n end",
"title": ""
},
{
"docid": "d8efaa1fc291023832ed2d696dff6d2e",
"score": "0.57586735",
"text": "def developers_count\n person_ids = []\n person_ids += solutions.pluck(:person_id)\n person_ids += bounty_claims.pluck(:person_id)\n person_ids += developer_goals.pluck(:person_id)\n\n person_ids.uniq.length\n end",
"title": ""
},
{
"docid": "efab65b6bca50d46f31ae64e59887c4a",
"score": "0.57470983",
"text": "def borrowed_books_count\n @borrowed_books_count\n end",
"title": ""
},
{
"docid": "5e15f18a210260f61baaeccd46160d30",
"score": "0.57393134",
"text": "def convention_signed_applications_count\n internship_offer.internship_applications\n .select(&:convention_signed?)\n .count\n end",
"title": ""
},
{
"docid": "addd66f3b5c8e89624b1856d23cd4f0e",
"score": "0.5735828",
"text": "def total_count\n @all.size\n end",
"title": ""
},
{
"docid": "08c6df2fe282738196273c5606bb035e",
"score": "0.57327574",
"text": "def CompletedKitesCount\n kites.any? ? kites.where(:Completed => true).count : 0\n end",
"title": ""
},
{
"docid": "1789802abca9aefa6040adbeee60d5b1",
"score": "0.5730615",
"text": "def call_site_count\n @call_sites.size\n end",
"title": ""
},
{
"docid": "0ae9fbeb003197e710aea822518ff3eb",
"score": "0.57297844",
"text": "def Count()\n _getproperty(1, [], [])\n end",
"title": ""
},
{
"docid": "a68924afc73c244d8a2b6b0accd20c9c",
"score": "0.57253176",
"text": "def get_pending_count\n return @describe_service.services[0].pending_count\n end",
"title": ""
},
{
"docid": "ce9bbff3ecf4a88a45ed5268727b0078",
"score": "0.57245153",
"text": "def count\n count = YoutubeSearch::UseCases::YoutubeData\n .new\n .count\n\n render json: {count: count}, status: 200\n end",
"title": ""
},
{
"docid": "fcc90df93531ea7d4d506e66bc092c55",
"score": "0.57185954",
"text": "def count_stuff\n @members.each do |member|\n if member.active\n @active += 1\n if member.paymentstatus && member.membershipyear.to_i == Time.now.year.to_i\n @paidthisyear += 1\n end\n\n if !member.membergroup.onetimefee || member.membershipyear.to_i == Time.now.year.to_i\n @total += member.membergroup.fee\n end\n\n if @membergroups[member.membergroup.name.to_sym]\n @membergroups[member.membergroup.name.to_sym] = @membergroups[member.membergroup.name.to_sym] + 1\n else\n @membergroups[member.membergroup.name.to_sym] = 1\n end\n\n if @municipalities[member.municipality.to_sym]\n @municipalities[member.municipality.to_sym] = @municipalities[member.municipality.to_sym] + 1\n else\n @municipalities[member.municipality.to_sym] = 1\n end\n\n else\n @deleted += 1\n end\n\n end\n @municipalities = @municipalities.sort_by { |key, value| value }.reverse\n end",
"title": ""
},
{
"docid": "595fc7a188648809fa0c41e3966da6e6",
"score": "0.57159376",
"text": "def count\n @obj['count'].to_i\n end",
"title": ""
},
{
"docid": "a48e989fbc47d8bb2c65ed79662e2036",
"score": "0.57093686",
"text": "def comic_count\r\n \tsorted_articles.length\r\n end",
"title": ""
},
{
"docid": "731adf32a7c426626cfd46e35c40bee3",
"score": "0.57049865",
"text": "def number_of_sales\n sales.count\n end",
"title": ""
},
{
"docid": "731adf32a7c426626cfd46e35c40bee3",
"score": "0.57049865",
"text": "def number_of_sales\n sales.count\n end",
"title": ""
},
{
"docid": "9fc17498b36373c2c3b52860a86b48ad",
"score": "0.5694183",
"text": "def occurences_count\n\t\t\t\t\t\tHash.new(0).tap do |result|\n\t\t\t\t\t\t each { |item| result[item] += 1 }\n\t\t\t\t\t\tend\n\t\t\t\tend",
"title": ""
},
{
"docid": "b3ebf7f26ddd5c1b914abbacd2cc342a",
"score": "0.569278",
"text": "def count_per_period_all\n \tcount = Center.all.inject({}) do |col,center|\n \t\tcol[center.id] = count_sum_per_period(center.id)\n \t\tcol\n \tend\n end",
"title": ""
},
{
"docid": "f303d1e61f3780e3979b5ddcac35c3fc",
"score": "0.56910425",
"text": "def solar_landing_leads_count\n leads.where(call_consented: true).count\n end",
"title": ""
},
{
"docid": "cac3b1212b2541327d870c82e1bed9d0",
"score": "0.568863",
"text": "def member_count\n attach_info\n @member_count\n end",
"title": ""
},
{
"docid": "92af9e45493a0002f953538faeacb8ac",
"score": "0.5686324",
"text": "def projects_count\n ProjectDetail.all.count\n end",
"title": ""
},
{
"docid": "ac06208fa607ddf7d5d3b933be098535",
"score": "0.5685431",
"text": "def num_of_customers\n total_customers = self.customers\n return total_customers.size\n end",
"title": ""
},
{
"docid": "19866dcfe5c1ed41c4d5f353d068346b",
"score": "0.5680055",
"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": "6012d5c6e9adfc78491df8f0b629227a",
"score": "0.56766605",
"text": "def count_of_customers_watching_film()\n sql = \"SELECT COUNT(*) FROM customers INNER JOIN tickets ON customers.id = tickets.cust_id WHERE tickets.film_id = $1\"\n # sql = \"SELECT COUNT(*) FROM tickets where film_id = $1\"\n values = [@id]\n cust_count = SqlRunner.run(sql, values)\n return cust_count[0]['count'].to_i\n end",
"title": ""
},
{
"docid": "80aced453711b4eddcb32e9c44022655",
"score": "0.56743276",
"text": "def get_counts_for_all_entities\n @tracker.counts\n end",
"title": ""
},
{
"docid": "f26195dc93c0ef3a16fdabf3daa7a07e",
"score": "0.56732434",
"text": "def count(category = :all)\n SpiceRub::Native.ktotal(category)\n end",
"title": ""
},
{
"docid": "8e466a54d53b15778d0691dc4865ffb8",
"score": "0.5671539",
"text": "def count()\n if @count == -1\n params = @params.clone\n params['count'] = 1\n\n res = @api.do_request(\"GET\", @path, params)\n @count = res['count'].to_i\n end\n @count\n end",
"title": ""
},
{
"docid": "4c0ec2f8b2424a0ca589216571177648",
"score": "0.56709766",
"text": "def get_desired_count\n return @describe_service.services[0].desired_count\n end",
"title": ""
},
{
"docid": "8da735292918cd54a7e18017c60e8e8d",
"score": "0.56677085",
"text": "def calculate_number_of_commissions\n (@cancellation_factor * @hash[\"number of commissions\"][0].from_german_to_f).to_german_s\n end",
"title": ""
},
{
"docid": "58df6420b8029835083a49a6df6b4006",
"score": "0.5667356",
"text": "def count\n @data['count']\n end",
"title": ""
},
{
"docid": "7e4a35f1efc80ad73232e18c42a4b5c0",
"score": "0.56556076",
"text": "def count; end",
"title": ""
}
] |
da561ab4b72659db3f4faf8df3050178
|
Stop editing a specified table.
|
[
{
"docid": "e87bd86824b0ed56d049e30dc694b61f",
"score": "0.84721625",
"text": "def stop_table_edit(table)\n append_to_script \"stop_table_edit \\\"#{table}\\\"\"\n end",
"title": ""
}
] |
[
{
"docid": "3284d9f1ddad3d161fd66dfbd16a4e2f",
"score": "0.7772735",
"text": "def cancel_table_edit(table)\n append_to_script \"cancel_table_edit \\\"#{table}\\\"\"\n end",
"title": ""
},
{
"docid": "7dc47351dfba2f9fb3d4ab9607cba098",
"score": "0.5646206",
"text": "def drop_table(table)\n current_instructions << Instructions::DropTable.new(table: table)\n end",
"title": ""
},
{
"docid": "a2c35699ad16bd93a4a71b2e1eeb8205",
"score": "0.5609714",
"text": "def destroy(table)\n end",
"title": ""
},
{
"docid": "ba4270febaa56d7522ec991377f1c714",
"score": "0.5410233",
"text": "def delete_table\n TinyDyno::Adapter.delete_table(table_name: self.table_name)\n end",
"title": ""
},
{
"docid": "3998f5ac58812d0687c9c27c83e4872a",
"score": "0.539525",
"text": "def cancel_edit\n\t\t@comparison = Comparison.find(params[:comparison_id])\n\t\t@comparison_measure = ComparisonMeasure.new\n\t\t@entry_container = \"measure_form_div\"\n\t\t@entry_partial = \"comparison_measures/form\"\n\t\t@editing=false\n\t\trender \"shared/saved\"\t\t\n\tend",
"title": ""
},
{
"docid": "eee8c0908710c1d8c00f3ea470596248",
"score": "0.5385151",
"text": "def TableEditClicked\n unless getDBConn\n msgbox(_(\"Warning\"), _(\"Please open a database before trying to edit a table.\"), \"warning\")\n return null\n end\n\n table = getTable\n unless table\n msgbox(_(\"Warning\"), _(\"You have to select a table to edit.\"), \"warning\")\n return null\n end\n\n # require and show the window-class.\n require_once(\"gui/win_table_create.php\")\n win_table_create = WinTableCreate.new(table[0], \"editcolumns\")\n end",
"title": ""
},
{
"docid": "7bfb9588c8ee28b56c6c7a33753a19be",
"score": "0.5357605",
"text": "def delete_table(table_name)\n data.delete(table_name)\n end",
"title": ""
},
{
"docid": "cbaebd4c79c0bd64ec152ba8428af132",
"score": "0.5312491",
"text": "def destroy(table, id)\n self.post(\"/#{table}/destroy/#{id}\")\n end",
"title": ""
},
{
"docid": "ef9254e91077992a9ac8d3956f8679a9",
"score": "0.5276491",
"text": "def delete_table instance_id, table_id\n tables.delete_table name: table_path(instance_id, table_id)\n end",
"title": ""
},
{
"docid": "9802090724ac9c361a08ca71d77e7216",
"score": "0.5229327",
"text": "def stop\n <<~TEXT.strip_heredoc\n Q-Table:\n\n #{([:state] + actions).flatten}\n #{q_table.length.times.map { |i| ([i] + q_table[i]).flatten.to_s }.join(\"\\n\")}\n\n #{super}\n TEXT\n end",
"title": ""
},
{
"docid": "a87e82d0b97ba263af065303b364c70e",
"score": "0.5206035",
"text": "def delete_table(table_id); delete(\"tables/#{table_id}\"); nil; end",
"title": ""
},
{
"docid": "5d197ced54775785d319f087d2ad1d34",
"score": "0.5175709",
"text": "def destroy\n @table = Table.find(params[:id])\n @table.destroy\n\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d197ced54775785d319f087d2ad1d34",
"score": "0.5175709",
"text": "def destroy\n @table = Table.find(params[:id])\n @table.destroy\n\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d197ced54775785d319f087d2ad1d34",
"score": "0.5175709",
"text": "def destroy\n @table = Table.find(params[:id])\n @table.destroy\n\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e79a14c728ba4455a9d59bd2582f3c47",
"score": "0.5167517",
"text": "def remove(table,cond)\n connection.remove(path(table),cond)\n end",
"title": ""
},
{
"docid": "d9abe99d3c1fde55358d171986d4d461",
"score": "0.5162596",
"text": "def cancel_batch\n @batch = nil\n end",
"title": ""
},
{
"docid": "08d7c4156a948eede9da9d894f5c39d1",
"score": "0.5156352",
"text": "def fini(table)\n table.fini = true\n table.save\n end",
"title": ""
},
{
"docid": "abb8feb6900d2476293ef7df6f839bd0",
"score": "0.5153449",
"text": "def leave_table_cmd\n @log.debug(\"Controller: send leave_table_cmd to the server\")\n msg_details = \"#{@ix_current_game}\"\n cmd_to_send = build_cmd(:leave_table, msg_details)\n send_data_to_server(cmd_to_send)\n @model_net_data.event_cupe_raised(:ev_client_leave_table)\n end",
"title": ""
},
{
"docid": "c02b5aa90f510d8985a8641db61d2f16",
"score": "0.5140103",
"text": "def abort_current_edit\n ensure_active_edit!\n\n call_google_api { android_publisher.delete_edit(current_package_name, current_edit.id) }\n\n self.current_edit = nil\n self.current_package_name = nil\n end",
"title": ""
},
{
"docid": "af16666e35b169577b1feda7ff8100b1",
"score": "0.5138095",
"text": "def drop_table(tablename)\r\n raise(ArgumentError, 'Table name must be a symbol!') unless \\\r\n tablename.is_a?(Symbol)\r\n raise \"Table does not exist!\" unless table_exists?(tablename)\r\n @table_hash.delete(tablename)\r\n\r\n return @engine.delete_table(tablename)\r\n end",
"title": ""
},
{
"docid": "a9bf4d26fbc6795853ed9fc7146fe6de",
"score": "0.5130307",
"text": "def unlink_from(table)\n invalidate_cache\n remove_layers_from(table)\n end",
"title": ""
},
{
"docid": "079d6965348d567082879c8df14c9884",
"score": "0.51275104",
"text": "def abort_current_edit\n ensure_active_edit!\n\n result = api_client.execute(\n api_method: android_publisher.edits.delete,\n parameters: {\n 'editId' => current_edit.data.id,\n 'packageName' => current_package_name\n },\n authorization: auth_client\n )\n\n raise result.error_message.red if result.error?\n\n self.current_edit = nil\n self.current_package_name = nil\n end",
"title": ""
},
{
"docid": "1d02b0e7839f906cdeaaee53f1ccf5fc",
"score": "0.51113325",
"text": "def drop_table\n db.drop_table(table_name)\n end",
"title": ""
},
{
"docid": "01d1a144199527815b1a12d8e7dd23d5",
"score": "0.5101686",
"text": "def destroy\n @waitertable = WaiterTable.where(\"table_id = #{@table.id}\")\n @waitertable.delete_all\n @table.destroy\n respond_to do |format|\n format.html { redirect_to tables_url, notice: 'Mesa eliminada correctamente.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e8b8ea5008cad0f033f4e03d4292ed79",
"score": "0.5083949",
"text": "def undo_update\n # <%= class_name %>.where(:type_code => \"very_shiny\").first.delete\n end",
"title": ""
},
{
"docid": "bbeab7940280440744f27958be0e23ac",
"score": "0.50805354",
"text": "def disable_keys(table = quoted_table_name)\n connection.execute(\"ALTER TABLE #{table} DISABLE KEYS\")\n end",
"title": ""
},
{
"docid": "8dec852c54c8d575daf3bf1cb8c623d7",
"score": "0.50603706",
"text": "def stop\n action('stop')\n end",
"title": ""
},
{
"docid": "49129b9820d3adb9015043329b7e0c79",
"score": "0.50585467",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "389878f1f830ab2542e4211195632fcf",
"score": "0.5055829",
"text": "def stop\n @query.exit\n end",
"title": ""
},
{
"docid": "cc457df5e2eb8d7f8fe09ace0bb89b63",
"score": "0.5055291",
"text": "def abort_batch\n @ddl_batch = nil\n end",
"title": ""
},
{
"docid": "1675cb291d8053dc10341b13fe0973c9",
"score": "0.5051129",
"text": "def delete table\n table = table.to_sym\n @lookup = @lookup.reject { |k, v| k == table }\n @schema = @schema.reject { |k, v| k == table }\n nil\n end",
"title": ""
},
{
"docid": "b499ff88125e89c6cedecf36328fa942",
"score": "0.50465375",
"text": "def stop\n @actions << :stop\n end",
"title": ""
},
{
"docid": "abaa5e36bfaa0d5a580f58e46b60cc8f",
"score": "0.50427306",
"text": "def TableTruncate\n begin\n unless getDBConn\n raise _(\"Please open a database before trying to truncate it.\")\n end\n\n tables = treeview_getSelection(@tv_tables)\n raise _(\"You have to select a table to truncate.\") if count(tables) <= 0\n\n # Confirm and truncate.\n tables.each do |table|\n table_ob = @dbconn.getTable(table[0])\n\n if msgbox(_(\"Question\"), sprintf(_(\"Do you want to truncate the table: %s?\"), table[0]), \"yesno\") == \"yes\"\n table_ob.truncate\n end\n end\n rescue => e\n knj_msgbox.error_exc(e)\n end\n\n @dbpage.TablesUpdate()\n end",
"title": ""
},
{
"docid": "56b78f8528f73df23cfdb47bc70726b7",
"score": "0.5039331",
"text": "def cancel(id); end",
"title": ""
},
{
"docid": "5bde9e54a8556b92f13b8709cf938995",
"score": "0.5038358",
"text": "def on_cancel_select\n @tb_item = nil\n $game_temp.tb_item = nil\n move_pos_off\n end",
"title": ""
},
{
"docid": "a2ab605bc7ba9721de999e2671ca126b",
"score": "0.5037657",
"text": "def delete_table instance_id, table_id\n execute do\n tables.delete_table(\n table_path(instance_id, table_id)\n )\n end\n end",
"title": ""
},
{
"docid": "90c48c78fcba91f4e58a4927626c3615",
"score": "0.5031312",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "90c48c78fcba91f4e58a4927626c3615",
"score": "0.5031312",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "90c48c78fcba91f4e58a4927626c3615",
"score": "0.5031312",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "90c48c78fcba91f4e58a4927626c3615",
"score": "0.5031312",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "90c48c78fcba91f4e58a4927626c3615",
"score": "0.5031312",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "90c48c78fcba91f4e58a4927626c3615",
"score": "0.5031312",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "90c48c78fcba91f4e58a4927626c3615",
"score": "0.5031312",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "90c48c78fcba91f4e58a4927626c3615",
"score": "0.5031312",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "90c48c78fcba91f4e58a4927626c3615",
"score": "0.5031312",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "e3fbcfcf8ea090c4d7dfc63a50a1d2b3",
"score": "0.50216365",
"text": "def disparar_en(posicion)\n @tablero.disparar_en posicion\n end",
"title": ""
},
{
"docid": "971e50c99301e34e1e6091de66f53e72",
"score": "0.5017811",
"text": "def delete!(key)\n @table.delete(key.to_sym)\n end",
"title": ""
},
{
"docid": "e289b77b517065f2d2a5b57ff00f566a",
"score": "0.50112003",
"text": "def DeleteTable(table_name)\n @ole._invoke(6, [table_name], [VT_BSTR])\n end",
"title": ""
},
{
"docid": "36a7bb04e5da08a69b0889ca8080541a",
"score": "0.49955404",
"text": "def stop\n update(underway_at: nil)\n end",
"title": ""
},
{
"docid": "33544102440402ee99253e39b561a146",
"score": "0.49945125",
"text": "def reset_status\n\ttable = Table.find_by(username: \"Table#{params[:table]}\")\n\ttable.update(refills: nil, help: false)\n\tredirect_to waiter_path\n end",
"title": ""
},
{
"docid": "ca470db82c022f2e8684b86ada70fefb",
"score": "0.49919122",
"text": "def forget\n @id_table.values.each(&:forget)\n end",
"title": ""
},
{
"docid": "4321af1deeda8ac33a4c0b05de565789",
"score": "0.49751794",
"text": "def delete(key)\n in_transaction_wr\n @table.delete key\n end",
"title": ""
},
{
"docid": "f2d1f39e10743144b4fa089243ceb5a1",
"score": "0.4974889",
"text": "def deactivate\n transaction do\n if update(active: false)\n case_assignments.update_all(active: false)\n supervisor_volunteer&.update(is_active: false)\n end\n end\n self\n end",
"title": ""
},
{
"docid": "e620ab8e1168502d621807a89ae32f0f",
"score": "0.49630722",
"text": "def remove_index(table, target)\n current_instructions << Instructions::RemoveIndex.new(table: table, field: target)\n end",
"title": ""
},
{
"docid": "2d0188247b7d5c866ae46ed9b9efdfb8",
"score": "0.49595034",
"text": "def down\n drop_table TABLE_NAME\n end",
"title": ""
},
{
"docid": "611e6b0d2a77ebfdcfb0bf0b055cacbc",
"score": "0.49510068",
"text": "def exclude_rr_activity(database, table)\n switch_trigger_mode(database, table, true) if triggers[database].add? table\n end",
"title": ""
},
{
"docid": "7a609be4c05f781d858585f034172661",
"score": "0.49477944",
"text": "def clear_with_new_table(table)\n @db_table = table\n init_parameters\n @filename = nil\n end",
"title": ""
},
{
"docid": "59a9d840153e0733617dfb2258a2f15b",
"score": "0.49419963",
"text": "def remove_from_all_tables\n\t\t\t\treturn if !@players || @players.empty?\n\t\t\t\[email protected] do |p|\n\t\t\t\t\tp.quit\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "fb25ac70f98f5ebf288783accf01eb64",
"score": "0.4940782",
"text": "def stop_delete\r\n if self.id && self.id < 11\r\n raise ActiveRecord::Rollback\r\n end\r\n end",
"title": ""
},
{
"docid": "e97bbdb2b4c5a4a047fbb7749877bd8b",
"score": "0.4938985",
"text": "def player_stop\n game_owner_only!\n @game.stop(current_user.id)\n redirect_to @game\n end",
"title": ""
},
{
"docid": "e6325ee48b83dbcef4d38a9223fca55c",
"score": "0.49298507",
"text": "def drop_table\n self.connection.drop_table table_name\n end",
"title": ""
},
{
"docid": "5d7ddcbce42b4a03b0f965b2775c424d",
"score": "0.49288034",
"text": "def destroy\n @liber777_table = Liber777Table.find(params[:id])\n @liber777_table.destroy\n\n respond_to do |format|\n format.html { redirect_to liber777_tables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ffa49c0e2b9e0dcdfb01d856e12c6cf1",
"score": "0.49275783",
"text": "def unlock!\n if update_columns(locked_at: nil, locked_by: nil)\n Page.current_preview = nil\n end\n end",
"title": ""
},
{
"docid": "40359d9a81535eb9074e503c9c50a7b5",
"score": "0.49231434",
"text": "def set_table\n @table = Table.find(params[:id])\n end",
"title": ""
},
{
"docid": "22f03b280282980d1b026df3017a4a51",
"score": "0.49184927",
"text": "def destroy\n @<%= singular_table_name %>.destroy\n respond_to do |format|\n format.html { redirect_to <%= table_name %>_url }\n format.json { head :no_content }\n end",
"title": ""
},
{
"docid": "5a951023f677a62cba84ae7d385d62b2",
"score": "0.49061495",
"text": "def drop_table(table_name, options = {})\n table_name, options = extract_table_options(table_name, options)\n super(table_name, **options)\n end",
"title": ""
},
{
"docid": "c173b532e643e8c7d6b1073997746f5e",
"score": "0.4905654",
"text": "def destroy\n @time_table = TimeTable.find(params[:id])\n @time_table.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_tables_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "918877a398af10aa54bedf5e67b57dc9",
"score": "0.49031568",
"text": "def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "918877a398af10aa54bedf5e67b57dc9",
"score": "0.49031568",
"text": "def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to tables_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f3a771ddfa1c8cabbe0fd5c5a07768eb",
"score": "0.49017248",
"text": "def stop\n @run = false\n end",
"title": ""
},
{
"docid": "edf2420fcbf704cf4daba0897b784ac6",
"score": "0.48977974",
"text": "def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to admin_index_tables_path, notice: 'Table was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b59055bf80dca9350b60e3ee86a78cdb",
"score": "0.48958054",
"text": "def delete_table(db)\n\tputs ('Are you sure you want to wipe the table? (y/n)')\n\tif gets.chomp == 'y'\n\t\tdb.execute(\"DELETE FROM todo\")\n\t\tdb.execute(\"DELETE FROM log\") \n\tend\nend",
"title": ""
},
{
"docid": "d01b0513becb5366209dea95d00019f1",
"score": "0.4879395",
"text": "def deactivate(rule)\n system \"#{CONF[:ebtables]} -D #{rule}\"\nend",
"title": ""
},
{
"docid": "2c21f9a629fc6c45b80c0b329dc50f17",
"score": "0.4878463",
"text": "def cancel\n super\n end",
"title": ""
},
{
"docid": "43bad8f88d7a21f4bc99ce760f883f6b",
"score": "0.48762828",
"text": "def stop_action\n action(:stop)\n end",
"title": ""
},
{
"docid": "218a67266bbdd33a7c8db7a569601669",
"score": "0.48724008",
"text": "def deactivate\n \n end",
"title": ""
},
{
"docid": "a6ad53f53d7408f685c1c4aaf78f6ed4",
"score": "0.4854528",
"text": "def delete_table(database_name, table_name)\n @glue_client.delete_table(database_name: database_name, name: table_name)\n rescue Aws::Glue::Errors::ServiceError => e\n @logger.error(\"Glue could not delete job: \\n#{e.message}\")\n end",
"title": ""
},
{
"docid": "6dee3c394b2868555fa3460ca8394fcd",
"score": "0.48537725",
"text": "def stop(key, name = nil)\n each_var(key, name) {|var| var.active = false}\n end",
"title": ""
},
{
"docid": "5666735ba679884fb63845bc05dc3b79",
"score": "0.48516142",
"text": "def exit_table?\n ((@output_type != :table_row) && (@output_type != :table_header) && (@output_type != :table_separator)) &&\n (current_mode == :table)\n end",
"title": ""
},
{
"docid": "4087d76e894d0ca77cb0df13841ac79d",
"score": "0.4849084",
"text": "def destroy\n @ip_table = IpTable.find(params[:id])\n @ip_table.destroy\n\n respond_to do |format|\n format.html { redirect_to ip_tables_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8799609387e23ac56bf2437c7545acd7",
"score": "0.48474634",
"text": "def stop\n put :stop\n end",
"title": ""
},
{
"docid": "01f0a148e45d699d4505a188105b0f59",
"score": "0.48443004",
"text": "def stop\n @timer.cancel\n end",
"title": ""
},
{
"docid": "01f0a148e45d699d4505a188105b0f59",
"score": "0.48443004",
"text": "def stop\n @timer.cancel\n end",
"title": ""
},
{
"docid": "5f37b79af6e789360c22f313e947ed4f",
"score": "0.48399583",
"text": "def destroy\n @identity_table = IdentityTable.find(params[:id])\n @identity_table.destroy\n if session[:table_id].to_i == params[:id].to_i\n session.delete(:table_id)\n end\n\n respond_to do |format|\n format.html { redirect_to identity_tables_path, alert: '表数据删除成功!' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "38b6d53f3ed514e0eac3f070d7150e13",
"score": "0.48354772",
"text": "def cancel\n end",
"title": ""
},
{
"docid": "38b6d53f3ed514e0eac3f070d7150e13",
"score": "0.48354772",
"text": "def cancel\n end",
"title": ""
},
{
"docid": "ac69dbd42767337ae2bedab48fc3ec4b",
"score": "0.48316875",
"text": "def cancel_current_tuple_entry\n current_tuple_entry.cancel if current_tuple_entry\n end",
"title": ""
},
{
"docid": "098ebccad8a26571afa8ea57a0c557ea",
"score": "0.48315594",
"text": "def stop_race(event)\n score = Scoreboard.where(:race_id => event.race_id, :walker_id => event.walker_id).first\n score.raceState = 2\n score.save\n end",
"title": ""
},
{
"docid": "123028cc47a4cd0f3e1bc7804a90556b",
"score": "0.48275656",
"text": "def destroy\n @table.destroy\n respond_to do |format|\n format.html { redirect_to tables_url, notice: 'Mesa deletada.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "466f36be6b72a1b6081cf962c80b4eda",
"score": "0.48270476",
"text": "def delete\n table = self.class.to_s.pluralize.underscore\n\n DATABASE.execute(\"DELETE FROM #{table} WHERE id = #{@id};\")\n end",
"title": ""
},
{
"docid": "92bc7bc9d70ddd207e730b151cb005a9",
"score": "0.48245463",
"text": "def delete_all(table)\n\t\t\t\ttable.clear\n\t\t\tend",
"title": ""
},
{
"docid": "241455a0e48bc20ba1289c679b8655a9",
"score": "0.48163646",
"text": "def stop\n @running = false\n end",
"title": ""
},
{
"docid": "241455a0e48bc20ba1289c679b8655a9",
"score": "0.48163646",
"text": "def stop\n @running = false\n end",
"title": ""
},
{
"docid": "8b0dfb22285bf75dc1224966bc21e3e8",
"score": "0.48014536",
"text": "def interrupt\n SQLite::API.interrupt( @handle )\n end",
"title": ""
},
{
"docid": "110681a08f52a57f03aa4fb1fd6a4a18",
"score": "0.47922638",
"text": "def cancel\n super\n end",
"title": ""
},
{
"docid": "0dc39ac330c582c99d9b1a13597a25be",
"score": "0.4790356",
"text": "def delete(key)\n @table.delete(key)\n end",
"title": ""
},
{
"docid": "7487e73c4f9e1e8f977e5cada505e420",
"score": "0.47797439",
"text": "def delete_table dataset_id, table_id\n execute { service.delete_table @project, dataset_id, table_id }\n end",
"title": ""
},
{
"docid": "794f106f7560c6be294c50065f6b106e",
"score": "0.4771306",
"text": "def delete_line_item(table)\r\n if table_exists?(table)\r\n print_table(table)\r\n puts \"please choose the id number of the line you'd like to delete.\"\r\n id = get_valid_id(table)\r\n delete = (\"DELETE FROM #{table} WHERE id = #{id}\")\r\n @db.execute(delete)\r\n end\r\n end",
"title": ""
},
{
"docid": "d3499a9433db4349eb902112a1324033",
"score": "0.4771104",
"text": "def timeout_stop(timeout)\n model.timeout_stop(timeout)\n end",
"title": ""
},
{
"docid": "dd5a238e3f7411ab25a8e51c823e8ebc",
"score": "0.4765487",
"text": "def destroy\n @time_table_entry = TimeTableEntry.find(params[:id])\n @time_table_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to(time_table_entries_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
f6bc0e135f5905e573099fe6e706ed4a
|
Dominant Octopus O(n log n) time
|
[
{
"docid": "a4c68d2f039b19b8de6574cb47a6c562",
"score": "0.5481362",
"text": "def dominant(arr, &prc)\n prc = Proc.new { |fish1, fish2| fish2.length <=> fish1.length }\n arr.merge_sort(&prc).first\nend",
"title": ""
}
] |
[
{
"docid": "b08f5deb31c83ce23944ff90b4b3103f",
"score": "0.73875254",
"text": "def dominant_octopus(fish)\n merge_sort(fish)[-1]\nend",
"title": ""
},
{
"docid": "c637c60259879b3abdfb319320d055ed",
"score": "0.7310864",
"text": "def dominant_octopus(arr)\n return arr if arr.size <= 1\n\n mid = arr.size / 2\n left = dominant_octopus(arr.take(mid))\n right = dominant_octopus(arr.drop(mid))\n\n fish_merger(left, right)\nend",
"title": ""
},
{
"docid": "627a6795a1c4eb0428751432b494a0c6",
"score": "0.72873825",
"text": "def dominant_octopus(arr)\n return arr if arr.length <= 1\n\n mid_idx = arr.length / 2\n #debugger\n left = arr[0...mid_idx]\n right = arr[mid_idx..-1]\n\n left_sort = dominant_octopus(left)\n right_sort = dominant_octopus(right)\n\n merge_octopus(left_sort, right_sort)\n\nend",
"title": ""
},
{
"docid": "bdc0600b4b787b98bda95fe4253dce24",
"score": "0.7249327",
"text": "def dominant_octopus(fish)\n return fish if fish.length <= 1\n\n partition = fish.length / 2\n left_side = dominant_octopus(fish.take(partition))\n right_side = dominant_octopus(fish.drop(partition))\n\n merge(left_side,right_side)\nend",
"title": ""
},
{
"docid": "8d5e108e824c17ef42948cbcb4ebcbee",
"score": "0.72205055",
"text": "def dominant_octopus(array)\n return array if array.length <= 1\n\n midpoint = array.length / 2\n sorted_left = dominant_octopus(array.take(midpoint))\n sorted_right = dominant_octopus(array.drop(midpoint))\n\n merge(sorted_left, sorted_right)\n \n end",
"title": ""
},
{
"docid": "bcfb644f6a154b61b5725f4aff505f83",
"score": "0.71926063",
"text": "def dominant_octopus(array)\n return array if array.length <= 1\n middle_index = array.length/ 2\n\n left = array[0...middle_index]\n right = array[middle_index..-1]\n\n sorted_left = dominant_octopus(left)\n sorted_right = dominant_octopus(right)\n\n merge(sorted_left, sorted_right)\nend",
"title": ""
},
{
"docid": "1df30f362530ad7ac2d4cd73789b7da0",
"score": "0.71292704",
"text": "def dominant_octopus(fish)\n return fish if fish.length < 2\n pivot_el = [fish.first]\n left = fish[1..-1].select { |el| el.length <= fish.first.length }\n right = fish[1..-1].select { |el| el.length > fish.first.length }\n dominant_octopus(left) + pivot_el + dominant_octopus(right)\nend",
"title": ""
},
{
"docid": "584f80c88e678837dc71645f67c33f74",
"score": "0.71112573",
"text": "def dominant_octopus(arr)\n return arr if arr.length <= 1\n left = arr.take(arr.length/2)\n right = arr.drop(arr.length/2)\n merge(dominant_octopus(left), dominant_octopus(right))\nend",
"title": ""
},
{
"docid": "8078f4b657b4e47e28a6396cff1dde56",
"score": "0.708863",
"text": "def dominant_octopus(fish_arr)\n merge_sort(fish_arr).last\nend",
"title": ""
},
{
"docid": "d1686588f076262746a7aacb1bd32a42",
"score": "0.6988288",
"text": "def dominant_octopus(array)\n return array if array.length <= 1\n\n pivot = [array.first]\n left = array[1..-1].select {|ele| ele.length < array.first.length}\n right = array[1..-1].select {|ele| ele.length >= array.first.length}\n\n arr = dominant_octopus(left) + pivot + dominant_octopus(right)\n arr[-1]\nend",
"title": ""
},
{
"docid": "cef9f624a7ddf1a8b1f1d67b95e3d15f",
"score": "0.6981584",
"text": "def dominant_octopus(array)\n length_sort = proc { |el1, el2| el1.length <=> el2.length }\n sorted_array = array.merge_sort(&length_sort)\n sorted_array.last\nend",
"title": ""
},
{
"docid": "dada95d6ff6457940a62d883268564bc",
"score": "0.6909507",
"text": "def dominant_octopus(array)\n prc = Proc.new {|x,y| x.length <=> y.length}\n sorted = merge_sort(array, &prc)\n sorted.last\nend",
"title": ""
},
{
"docid": "5d64214ce9cf76911e05077579093a1c",
"score": "0.69007224",
"text": "def dominant_octopus(fishes)\n fishes.merge_sort[-1]\nend",
"title": ""
},
{
"docid": "91eaeb41fd66c836d3f898298784ae7d",
"score": "0.68918145",
"text": "def dominant_octopus(array)\n prc = Proc.new { |x, y| y.length <=> x.length }\n\n array.merge_sort(&prc)[0]\nend",
"title": ""
},
{
"docid": "9dfc840e00eb5715522b411555bc432f",
"score": "0.68684655",
"text": "def dominant_octopus(array, &prc)\n prc ||= Proc.new {|x, y| x <=> y}\n\n return array if array.length <= 1\n mid = array.length / 2\n\n left = dominant_octopus(array[0...mid], &prc)\n right = dominant_octopus(array[mid..-1], &prc)\n\n merge(left, right, &prc)\nend",
"title": ""
},
{
"docid": "26001ba3fc00c1ba88637b95923408bf",
"score": "0.6856929",
"text": "def dominant_octopus(fishes)\n return fishes if fishes.length == 1\n mid = fishes.length / 2\n left = dominant_octopus(fishes[0...mid])\n right = dominant_octopus(fishes[mid..-1])\n consume(left, right)\nend",
"title": ""
},
{
"docid": "ff474a15356833c4b4b9eeaccf9e2acc",
"score": "0.68158954",
"text": "def dominant_octopus(arr)\n sorted = merge_sort(arr)\n arr[-1] \nend",
"title": ""
},
{
"docid": "f8cf98676043ec3656ee1328fa40c4b5",
"score": "0.6720185",
"text": "def dominant_octopus(fish_array)\n results = fish_array.my_quick_sort {|left, right| left.length <=> right.length}\n\n results.last\nend",
"title": ""
},
{
"docid": "38307a67b93e49b934bcd426ae9cf2a1",
"score": "0.6653562",
"text": "def dominant_octopus(fish)\n #sorted = []\n return fish if fish.length < 2\n pivot = fish.first\n left = fish[1..-1].select { |feesh| feesh.length <= pivot.length }\n #p left\n right = fish[1..-1].select { |feesh| feesh.length > pivot.length }\n\n dominant_octopus(left) + [pivot] + dominant_octopus(right)\n \n\n\nend",
"title": ""
},
{
"docid": "a6c05967afbcdf358afee52889d4fa0d",
"score": "0.6610909",
"text": "def dominant_octopus(fishes)\n prc = Proc.new { |x, y| x.length <=> y.length }\n fishes.merge_sort(&prc).last\nend",
"title": ""
},
{
"docid": "6c094dfca85ecfe3c504450e1ee49791",
"score": "0.6602455",
"text": "def dominant_octopus\n FISH_ARR.sort_by(&:length)[-1]\nend",
"title": ""
},
{
"docid": "5b9043245f13a347b947133462dacc3b",
"score": "0.6586389",
"text": "def dominant_octopus(fishes)\n # sort the array longest to shortest\n prc = Proc.new { |x, y| y.length <=> x.length }\n #return the first element\n fishes.merge_sort(&prc)[0]\nend",
"title": ""
},
{
"docid": "e88d8c8c7d7ca410e6ef7910aa20c983",
"score": "0.65468687",
"text": "def dominant_octopus(fishes)\n prc = Proc.new { |a, b| a <=> b }\n\n fishes.merge_sort(prc).first\nend",
"title": ""
},
{
"docid": "322fb409a3ebb821a66a3cdd130a5bc5",
"score": "0.6500573",
"text": "def sluggish_octopus\n # O(n^2), iterate the array twice\n max = 0\n (0...FISHES.length).each do |idx|\n (0...FISHES.length).each do |subidx|\n max = subidx if FISHES[subidx] >= max\n end\n end\n FISHES[max]\n end",
"title": ""
},
{
"docid": "85be308b366875f904308d78f691d3c5",
"score": "0.64845806",
"text": "def dominant_octopus(array)\n fish_food = octopus_army(array)\n fish_food.first\nend",
"title": ""
},
{
"docid": "67b3387cecf9d7b8a80113c63e95a775",
"score": "0.6229715",
"text": "def dominant(arr)\n merge_sort(arr)[-1]\nend",
"title": ""
},
{
"docid": "1dcb0e1c13e1a95e5d3358c84061c008",
"score": "0.6189516",
"text": "def dominant_octopus(arr)\n sorted = quicksort(arr) { |a, b| a.length <=> b.length }\n longest = sorted.last\nend",
"title": ""
},
{
"docid": "c070f9a39f9bf2907b720b3c62a41a32",
"score": "0.6016087",
"text": "def dominant_oct_sort(arr)\n return arr if arr.length <= 1\n mid_idx = arr.length / 2\n mid = arr[mid_idx]\n arr = arr[0...mid_idx] + arr[mid_idx + 1..-1]\n\n left = arr.select { |fish| fish.length <= mid.length }\n right = arr.select { |fish| fish.length > mid.length }\n\n dominant_oct_sort(left) + [mid] + dominant_oct_sort(right)\nend",
"title": ""
},
{
"docid": "9420c49b3f7ea156b2ab4749754988b8",
"score": "0.60061264",
"text": "def dominant_octopus(the_sea)\n\nend",
"title": ""
},
{
"docid": "480bdf79ff8cb56c8cbc52f386a8ae75",
"score": "0.59916717",
"text": "def dominant_longest_first(fish)\n dominant_octopus(fish).first\nend",
"title": ""
},
{
"docid": "dd092f6e54d39da729250cbc2be01ef4",
"score": "0.5984437",
"text": "def dominant(arr)\n\tsorted = Array.merge_sort(arr){|a,b| a.length <=> b.length}\n\tsorted[-1]\nend",
"title": ""
},
{
"docid": "e53a01d92c197fab96f2867a39c7d189",
"score": "0.5955976",
"text": "def dominant_sort(fish)\n return fish if fish.length <= 1\n\n mid = fish.length / 2\n\n left = fish[0...mid]\n right = fish[mid..-1]\n\n left_sorted = dominant_sort(left)\n right_sorted = dominant_sort(right)\n\n sorted = dominant_merge(left_sorted, right_sorted)\nend",
"title": ""
},
{
"docid": "6247bbd6b01fc43df9896eb5d0316f06",
"score": "0.5882448",
"text": "def sluggish_octopus(array)\n longest_fish = array[0]\n (0...array.length).each do |idx1|\n (idx1...array.length).each do |idx2|\n if array[idx1] < array[idx2] \n longest_fish = array[idx2]\n else\n longest_fish = array[idx1]\n end\n end\n end\n longest_fish\nend",
"title": ""
},
{
"docid": "456cd1047026b48d2b73f1ddd514cfe0",
"score": "0.58773905",
"text": "def mobius(n)\r\n\t\treturn 1 if 1 == n\r\n\t\treturn 0 unless n.squarefree?\r\n\t\treturn factorize(n).size.odd? ? -1 : 1\r\n\tend",
"title": ""
},
{
"docid": "5944c445a0d5d1383cd670cc84d3fc3b",
"score": "0.5789683",
"text": "def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend",
"title": ""
},
{
"docid": "3b63260309d5726c3b54ee7f93a6d834",
"score": "0.5775026",
"text": "def biodiversity_index(specimens)\n index_hash = Hash.new(0)\n specimens.each {|ele| index_hash[ele]+= 1}\n sorted_index = index_hash.sort_by {|k,v| v}\n index_hash.length**2 * sorted_index[0][1] / sorted_index[-1][1]\nend",
"title": ""
},
{
"docid": "64deb650404e6491725f813a584addc9",
"score": "0.5773917",
"text": "def min_umbrellas(weather)\n indexs = []\n result = 0\n weather.each_with_index do |weather, ind|\n if weather == \"rainy\" || weather == \"thunderstorms\"\n indexs << ind\n end\n end\n result += 1 unless indexs.empty?\n indexs.each_cons(2) do |first, second|\n result += 1 if (second - first) > 1\n end\n result\nend",
"title": ""
},
{
"docid": "e9506e5c5be49078757652976ec6068d",
"score": "0.566942",
"text": "def solution(a)\n n = a.size\n passing_cars = 0\n\n suffix_sums = Array.new(n + 1, 0)\n\n a.reverse.each_with_index do |elem, i|\n suffix_sums[i + 1] = suffix_sums[i] + elem\n end\n suffix_sums.reverse!\n\n a.each_with_index do |car, i|\n if car == 0\n passing_cars += suffix_sums[i]\n end\n end\n\n passing_cars > 1_000_000_000 ? -1 : passing_cars\nend",
"title": ""
},
{
"docid": "757779a9e63b7a462be9192fe9d7a070",
"score": "0.5661356",
"text": "def migratoryBirds(n, ar)\n birds = [0, 0, 0, 0, 0] \n ar.each do |number|\n birds[number-1] += 1 \n end \n return birds.index(birds.max) + 1\nend",
"title": ""
},
{
"docid": "eaea1052ef68ec6ae87bff86aa288f99",
"score": "0.5655664",
"text": "def dominant(fishes)\n prc = Proc.new { |a, b| b.length <=> a.length }\n fishes.merge(&prc).first\nend",
"title": ""
},
{
"docid": "2481cbf165330db256eee896a32c82e4",
"score": "0.56505305",
"text": "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\n end\t\r\n return 1 if a.inject(:+) ==n*(n+1)/2;\r\nend",
"title": ""
},
{
"docid": "bfdb0ce0837c83c59b0f3bfd3dedd256",
"score": "0.5647523",
"text": "def solution(a)\n # write your code in Ruby 2.2 \n frecuencies = a.each_with_object(Hash.new(0)) { |key, value| value[key] += 1 } \n \n frecuencies.each do |key, value|\n if value.odd? then return key end\n end\nend",
"title": ""
},
{
"docid": "3e2d6bc9f447480853946198a53e9983",
"score": "0.5639801",
"text": "def sockMerchant(n, ar)\n return unless Integer(n) && ar.length == n\n count = 0\n ar.group_by(&:itself).each do |key, value|\n next if value.count <= 1\n value.drop(1) if value.count.odd?\n count += value.count/2\n end\n count\nend",
"title": ""
},
{
"docid": "4ff665846b2b1eae7f92c875b7dbc0c5",
"score": "0.5628347",
"text": "def biodiversity_index(specimens)\n hash = Hash.new(0)\n specimens.uniq.each do |sp|\n hash[sp] = specimens.count(sp) \n end\n num_species = specimens.uniq.length\n smallest_pop = hash.values.min \n largest_pop = hash.values.max\n num_species**2 * smallest_pop / largest_pop\nend",
"title": ""
},
{
"docid": "625167e43ab6a0bf15027f4dcbb0c41e",
"score": "0.5626142",
"text": "def biodiversity_index(specimens)\n all_species = specimens.uniq\n count = {}\n\n all_species.each do |species|\n count[species] = specimens.count(species)\n end\n\n number_of_species = all_species.length\n smallest_population_size = count.values.min \n largest_population_size = count.values.max\n\n number_of_species ** 2 * smallest_population_size / largest_population_size\n \nend",
"title": ""
},
{
"docid": "4eac373408eecc35769e1b0cdae11045",
"score": "0.5617937",
"text": "def bunny(n)\n return 0 if n == 0\n return n + bunny(n / 2.0 )\n # This passes the tests, though technically it never hits 0 (just approaches 0)\n # An alternate solution is to return 1 + bunny(n - 0.5) but that would have a slower time complexity O(n)\nend",
"title": ""
},
{
"docid": "942b1919f4cb16e88236a84e6be81d0e",
"score": "0.5617288",
"text": "def most_specific_subdivision; end",
"title": ""
},
{
"docid": "b08b734aad1998b7807ec224a999040f",
"score": "0.5603605",
"text": "def josephus_survivor(n,k)\n result = 1\n for i in 1...n + 1\n result = (result + k - 1) % i + 1\n end\n \n result\nend",
"title": ""
},
{
"docid": "c8886ff03f683f2875db68f5c7b0938c",
"score": "0.55997473",
"text": "def nth_ugly_number(n, a, b, c)\n# a-b, a-c, b-c, ab-c\n ab_lcm = a.lcm(b) # there are some a present in b\n ac_lcm = a.lcm(c) # there are some a present in c\n bc_lcm = b.lcm(c) # there are some b present in c\n abc_lcm = ab_lcm.lcm(c) # there are some a*b in c (because c is the biggest)\n \n # using set theory for binary search\n # a + b + c - ab_lcm - ac_lcm - bc_lcm + abc_lcm\n (1..2*10**9).bsearch{|x| x/a + x/b + x/c - x/ab_lcm - x/ac_lcm - x/bc_lcm + x/abc_lcm >= n}\nend",
"title": ""
},
{
"docid": "4aeeeb05a0b46165fefd765a3bfd4c0e",
"score": "0.55928326",
"text": "def biodiversity_index(specimens)\n counter = Hash.new(0)\n specimens.each do |x|\n counter[x] += 1\n end\nnums = counter.values\n(nums.length ** 2) * nums.min / nums.max\nend",
"title": ""
},
{
"docid": "bdaf2ab6d529adac05f9bc269ebfcd51",
"score": "0.5582718",
"text": "def sluggish_octopus(the_sea)\n the_sea.each_with_index do |fish1, idx|\n longest = true\n\n the_sea.each_with_index do |fish2, idx2|\n next if idx == idx2\n longest = false if fish1.length > fish2.length\n end\n\n return fish1 if longest\n end\nend",
"title": ""
},
{
"docid": "dd568608735c7a52754bdf632db0ba42",
"score": "0.5577173",
"text": "def dominant_index(nums)\n maximum = nums.max\n nums.each do |n|\n next if n == maximum\n return -1 if n*2 > maximum\n end\n nums.index(maximum)\nend",
"title": ""
},
{
"docid": "8fe4aa1584a036b063f2e2993aa6769d",
"score": "0.5567075",
"text": "def pythagoreans (n)\n triples = []\n a = 1\n b = 1\n c = 1\n\n for c in (1..n)\n for b in (1..c)\n for a in (1..b)\n if a**2 + b**2 == c**2\n triples << [a,b,c]\n end\n end\n end\n end\n\n return triples.sort\nend",
"title": ""
},
{
"docid": "856860944fd3ac5e32cdb4dbadbad559",
"score": "0.5562164",
"text": "def sockMerchant(_n, ar)\n pairs = 0\n unique = ar.uniq\n\n unique.each do |num|\n count = ar.count(num)\n if count.even?\n pairs += (count / 2)\n elsif (count - 1).even?\n pairs += (count - 1) / 2\n end\n end\n pairs\nend",
"title": ""
},
{
"docid": "a2151b0560fe715a215ca5c62110e2fa",
"score": "0.55560976",
"text": "def bunny(n) \n return 0 if n == 0\n return 2 + bunny(n - 1)\nend",
"title": ""
},
{
"docid": "3087f83e85832ced12adee899b517552",
"score": "0.5556078",
"text": "def sluggish_octopus\n # O(N^2)\n longest_fish = \"\"\n Fishes.each do |fish1|\n Fishes.each do |fish2|\n longest_fish = fish2 if fish2.length > fish1.length\n end\n end\n longest_fish\nend",
"title": ""
},
{
"docid": "1e59df18bf0c3515052096a9f0329b8d",
"score": "0.5551505",
"text": "def sluggish_octopus(array)\n array.each_with_index do |el,i|\n max_found = true\n array.each_with_index do |x,j|\n next if i == j\n max_found = false if el.length < x.length\n end\n return el if max_found == true\n end\nend",
"title": ""
},
{
"docid": "91266abbc0608a7b867cb820f7f9667a",
"score": "0.5550006",
"text": "def sturges\n len = array.length\n return 1.0 if len == 0\n\n # return (long)(ceil(Math.log2(n)) + 1);\n return Math.log2(len).ceil + 1\n end",
"title": ""
},
{
"docid": "75969da09d780e5214d6bb8980bbc07e",
"score": "0.55488086",
"text": "def bunny(n)\n\treturn 0 if n == 0\n\n\treturn 2 + bunny(n - 1)\nend",
"title": ""
},
{
"docid": "146bc45d732ecd47bc53841750816fec",
"score": "0.55439794",
"text": "def maximum_likehood_dichotomic(pred,real)\n preda,reala=Statsample.only_valid_clone(pred,real) \n sum=0\n preda.each_index{|i|\n sum+=(reala[i]*Math::log(preda[i])) + ((1-reala[i])*Math::log(1-preda[i]))\n }\n sum\n end",
"title": ""
},
{
"docid": "106f4f80860131e57e2d0769a2b75bc7",
"score": "0.5539756",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 + bunny(n - 1) if n >= 1\nend",
"title": ""
},
{
"docid": "19f84d182d60c0c2a1241d120975e0a0",
"score": "0.5537125",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 + bunny(n - 1)\nend",
"title": ""
},
{
"docid": "a90cfa2faac409568d13733d208e4209",
"score": "0.5525341",
"text": "def bunny(n)\n return 0 if n == 0\n\n return (2 + (2 * (n - 1)))\nend",
"title": ""
},
{
"docid": "37c8121e72d18c22c65d4a2a0b684ee0",
"score": "0.55208564",
"text": "def sluggish_octopus(arr)\n (0...arr.length - 1).each do |i|\n return arr[i] if arr[i+1...arr.length].all? {|fish| arr[i].length > fish.length }\n end\n arr[-1]\nend",
"title": ""
},
{
"docid": "da553f0f68417119b24ac86be307d56b",
"score": "0.55197996",
"text": "def nostalgia; return rand end",
"title": ""
},
{
"docid": "3c50fc5635bea93da01ab88b3268bdcd",
"score": "0.5519407",
"text": "def majority(array)\n \n array.sort!\n puts array[array.length/2]\n \n end",
"title": ""
},
{
"docid": "15ed491064a3d24ceac0ea46f079e9c9",
"score": "0.5516573",
"text": "def similarshelves(n)\n similar(n)\n end",
"title": ""
},
{
"docid": "67c2fe529c0deb63f701c72050968e6a",
"score": "0.55163807",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 + bunny(n - 1)\nend",
"title": ""
},
{
"docid": "1a8355c7134515ce366c5d976939f074",
"score": "0.5514747",
"text": "def get_revised_counts next_ngram: nil, ngram_model: 0, ngram_counts: @ngram_counts, good_turing_bins: @good_turing_bins, separator: \" \"\n local_ngram_model = ngram_model==0 ? next_ngram.split(separator).count : ngram_model\n next_ngram_rawcount = ngram_counts[local_ngram_model][next_ngram].to_i\n if next_ngram_rawcount == 0\n raise \"Revised counts for zero raw counts (#{next_ngram.green}) only make sense for unigrams with precomputed OOV set.\" unless !@oov_counts.nil? and local_ngram_model==1\n raise \"Token #{next_ngram.red} not found in OOV set. Are you sure you used set_oov?\" if !@oov_counts.has_key?(next_ngram)\n leftover_probability_per_oov_token = @leftover_probability/@oov_counts.values.sum\n return @oov_counts[next_ngram].to_f*leftover_probability_per_oov_token \n elsif @k.nil?\n return (next_ngram_rawcount+1)*(good_turing_bins[local_ngram_model][next_ngram_rawcount+1].to_f/good_turing_bins[local_ngram_model][next_ngram_rawcount])\n elsif next_ngram_rawcount <= @k\n ordinary_gt = (next_ngram_rawcount+1)*(good_turing_bins[local_ngram_model][next_ngram_rawcount+1].to_f/good_turing_bins[local_ngram_model][next_ngram_rawcount])\n mle_provision = (next_ngram_rawcount*(@k+1)*good_turing_bins[local_ngram_model][@k+1].to_f)/good_turing_bins[local_ngram_model][1]\n normalization = 1 - ((@k+1)*good_turing_bins[local_ngram_model][@k+1].to_f)/good_turing_bins[local_ngram_model][1]\n warn \"Good-Turing discounting with a parameter is numerically unstable. Negative revised counts were detected for #{next_ngram}.\" if (@verbose and ((ordinary_gt-mle_provision)/normalization)<0)\n return (ordinary_gt-mle_provision)/normalization # This is equation 4.31 from JM\n else\n return (next_ngram_rawcount)\n end\n end",
"title": ""
},
{
"docid": "f7f7c687205e36f2b9d2a44c57d38786",
"score": "0.5510943",
"text": "def change_from_wild_probability\n # TODO: 2+ skips\n has_wild_probability\n end",
"title": ""
},
{
"docid": "ed4265a6e08df32a89865a422108ab08",
"score": "0.55080855",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "ed4265a6e08df32a89865a422108ab08",
"score": "0.55080855",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "ed4265a6e08df32a89865a422108ab08",
"score": "0.55080855",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "2dd9220426d01a9be1c7a730fbfed9a9",
"score": "0.55007136",
"text": "def dominant(fish)\n \nend",
"title": ""
},
{
"docid": "adb8dd35d527e01f7299f670fdef368a",
"score": "0.5500612",
"text": "def wonky_coins(n)\n return 1 if n == 0\n\n coins = []\n coins << n/2 << n/2 << n/4 if n != 0\n\n coin_total = 0\n\n coins.each do |coin|\n \tcoin_total += wonky_coins(coin) if coin > 0\n \tcoin_total += 1 if coin == 0\n end\n\n return coin_total\nend",
"title": ""
},
{
"docid": "54102c01559fd46bd9b825214dd706a3",
"score": "0.5499238",
"text": "def bunny(n)\n return 0 if n <= 0\n return 2 if n == 1\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "0c6b21d4b9379808fbb2372d4ae23c10",
"score": "0.54946864",
"text": "def sluggish_octopus(fish)\n sorted = false\n until sorted\n sorted = true\n fish.each_with_index do |ele, idx|\n next if idx == fish.length - 1\n current = ele\n neighbor = fish[idx + 1]\n if neighbor.length > current.length\n fish[idx] = neighbor \n fish[idx + 1] = current\n sorted = false\n end\n end\n end\n\n fish.first\nend",
"title": ""
},
{
"docid": "bd926a2fa1a090576e1e48ab439a820f",
"score": "0.5492146",
"text": "def sluggish_octopus(fishes)\n fishes.each_with_index do |fish1, idx1|\n longest = true\n\n fishes.each_with_index do |fish2, idx2|\n next if idx1 == idx2\n longest = false if fish2.length > fish1.length\n end\n\n return fish1 if fish1 = longest\n end\n\nend",
"title": ""
},
{
"docid": "15c64d1082becf59c31f5e3ba51b1097",
"score": "0.5487865",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 if n == 1\n return 2 + bunny(n - 1)\nend",
"title": ""
},
{
"docid": "bda91df7083b945769deb869b7f1789c",
"score": "0.54878324",
"text": "def bunny(n)\n return 0 if n == 0\n\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "e76e96e515515b0deeedd1046e84bf7a",
"score": "0.54856807",
"text": "def positive_dominant(arr)\n #Your code here\n arr_uniq = arr.uniq\n pos_arr = []\n neg_arr = []\n arr_uniq.map do |x|\n if x > 0\n pos_arr.push(x)\n else\n neg_arr.push(x)\n end\n end\n\n if pos_arr.length > neg_arr.length\n return true\n else\n return false\n end\n\nend",
"title": ""
},
{
"docid": "2b3504fc617c68df33875a37c4e1ce26",
"score": "0.54813033",
"text": "def bunny(n)\n if n === 0\n return 0\n end\n\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "66d8672334f16650cff13c62434c08ec",
"score": "0.54798466",
"text": "def sluggish_octopus(fish)\n longest_fish = fish[0]\n fish.each.with_index do |fish1, i1|\n fish.each.with_index do |fish2, i2|\n next if fish1.length < fish2.length\n longest_fish = fish1 if fish1.length > longest_fish.length\n end\n end\n longest_fish\nend",
"title": ""
},
{
"docid": "9dca749acd7e114f3ba4d44211295a6f",
"score": "0.5477097",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "9dca749acd7e114f3ba4d44211295a6f",
"score": "0.5477097",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "0bea971d58501e4681f886ee2cec1862",
"score": "0.54751515",
"text": "def find_by_bayer_moore(array)\n candidate = 0\n count = 0\n # Pass 1 - Find the candidate maintaing a count \n for i in 0..array.size-1\n # binding.pry\n candidate = array[i] if count == 0\n if array[i] == candidate\n count += 1\n else\n count -= 1\n end\n end\n counter = 0\n # Pass 2 - To verify that the candidate from pass1 is acutally a majority\n array.each do |i|\n if i == candidate\n counter += 1\n end\n end\n if counter > array.size/2\n puts \"Found majority element is: #{candidate}\"\n else\n puts \"No majority element\"\n end\nend",
"title": ""
},
{
"docid": "b61e01895606831a41d10c7fee6192b1",
"score": "0.5473313",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 + bunny( n - 1 )\nend",
"title": ""
},
{
"docid": "372774737384c92f02e18a2e39567d14",
"score": "0.5473043",
"text": "def sluggish_octopus!(array)\n sorted = false\n until sorted\n sorted = true\n array.each_index do |index|\n index_2 = index + 1\n next if index_2 == array.length\n if array[index].length > array[index_2].length\n array[index],array[index_2] = array[index_2],array[index]\n sorted = false\n end\n end\n end\n array[-1]\nend",
"title": ""
},
{
"docid": "0762028bcd8c84b0f1a3316d736cc689",
"score": "0.54674107",
"text": "def joltageDiff(input)\n # add my input device with rating +3\n input.append(input.max + 3)\n arr = input\n .sort\n .reverse\n \n diffs = arr\n .map.with_index{ |n, i|\n if i < arr.size - 1\n n - arr[i+1]\n end\n }\n diffs.pop # remove last element\n # puts diffs.sort\n counts = [0, 0, 0]\n counts[0] = diffs.select{ |n| n == 1 }.size + 1 # fuck knows why this is here.. #dirtyhack\n counts[1] = diffs.select{ |n| n == 2 }.size\n counts[2] = diffs.select{ |n| n == 3 }.size\n #puts counts\n return counts\nend",
"title": ""
},
{
"docid": "9388ff6b62bb7d56ebecdece45b2f486",
"score": "0.5467092",
"text": "def arrayManipulation(n, queries)\n nums = Array.new(n+1, 0)\n queries.each do |query|\n nums[query[0]-1] += query[2]\n nums[query[1]] -= query[2]\n end\n\n max = nums.first\n (1..nums.length-1).each do |i|\n nums[i] += nums[i - 1]\n max = nums[i] if nums[i] > max && i < (nums.size - 1)\n end\n\n max\nend",
"title": ""
},
{
"docid": "1133588cd93d3db2cbbd2c8dcdba35a8",
"score": "0.5463165",
"text": "def divisors(n)\n (1.upto(n ** 0.5).select { |d| (n % d).zero? }.size * 2) - 1\nend",
"title": ""
},
{
"docid": "d865a417dc5b936c966cb74de5bb2fab",
"score": "0.5461048",
"text": "def migratoryBirds(arr)\n birds = Hash.new(0)\n arr.each do |bir|\n birds.key?(bir) ? birds[bir] += 1 : birds[bir] = 1\n end\n max = birds.max_by { |_key, value| value }.last\n birds.sort_by { |key, _value| key }\n .select { |_key, value| value == max }\n .first\n .first\nend",
"title": ""
},
{
"docid": "4fbe0ea6f16a6d6d2eda81f9bc0aaae2",
"score": "0.54580986",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 if n == 1\n return bunny(n - 1) + bunny(1)\n\nend",
"title": ""
},
{
"docid": "d7e1f37c65c1616035a28abbf2f53bd1",
"score": "0.5457421",
"text": "def bunny(n)\n return 0 if n == 0\n return 2 if n == 1\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "eadc89649c21a2bb37a94c1d76af9c11",
"score": "0.5449614",
"text": "def sluggish_octopus(arr)\n lngest_fish = [arr.first]\n # debugger\n arr.each do |fish|\n # debugger\n lngest_fish = [fish] if fish.length > lngest_fish.first.length\n end\n lngest_fish\nend",
"title": ""
},
{
"docid": "1de515e809e76eb86cea57a76efd6c86",
"score": "0.54444534",
"text": "def top_matches(n=3)\n \n scores = Array.new\n \n @prefs.each_pair do |key,value|\n if key != @person\n scores << [@similarity.compute(key),key]\n end\n end\n \n (scores.sort!.reverse!)[0..n]\n \n end",
"title": ""
},
{
"docid": "7d9a50f215d35bb48be5ad503254346a",
"score": "0.5428463",
"text": "def bunny(n)\n if n < 1\n return 0\n else \n return 2 + bunny(n-1)\n end\nend",
"title": ""
},
{
"docid": "ae96e35c770fcaf27888e4cb0f2c1ee2",
"score": "0.5428087",
"text": "def slugish_octopus(arr) # quadratic\n largest = []\n arr.each_with_index do |e1, i1|\n arr.each_with_index do |e2, i2|\n if e1.length > e2.length\n largest = e1\n else\n largest = e2\n end\n end\n end\n largest.to_s\nend",
"title": ""
},
{
"docid": "e4bdc580c5df5683313e1e56348fd3c1",
"score": "0.54271203",
"text": "def bunny(n)\n return 0 if n < 1\n return 2 if n < 2\n return 2 + bunny(n-1)\nend",
"title": ""
},
{
"docid": "17cd5b1a6b617e99b2e0f208095563b6",
"score": "0.541944",
"text": "def bunny(n)\n if n <= 0\n return 0\n else\n return 2 + bunny(n-1)\n end\nend",
"title": ""
}
] |
66e21a458b23cce0f48c359b9d8b7d7d
|
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
|
[
{
"docid": "9af871686ca12996803b30d65f00cba2",
"score": "0.656113",
"text": "def context\n unless @instance_context\n @instance_context = ConfigurationContext.new(@version )\n end\n @instance_context\n end",
"title": ""
}
] |
[
{
"docid": "1000791e0ba8e96e55a94da3f03ac616",
"score": "0.68387127",
"text": "def context\n unless @instance_context\n @instance_context = ApplicationContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "e6d720e355622256a0fc243dd1d2eb78",
"score": "0.6803425",
"text": "def context\n unless @instance_context\n @instance_context = SimContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "b6e2fffc967782d8f5fbfb7e9fc462a7",
"score": "0.6797454",
"text": "def context\n unless @instance_context\n @instance_context = InteractionContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "b0fb6cb89b44c7fcf6f799ad03ab3b99",
"score": "0.6772821",
"text": "def context\n unless @instance_context\n @instance_context = TriggerContext.new(@version, @params['account_sid'], @params['sid'],)\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c4c69a584ea5c39267e29996ebb5ba36",
"score": "0.67694455",
"text": "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c4c69a584ea5c39267e29996ebb5ba36",
"score": "0.67694455",
"text": "def context\n unless @instance_context\n @instance_context = ServiceContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "7f7af9cb7432da8fa0706c231a084c00",
"score": "0.6732738",
"text": "def context\n unless @instance_context\n @instance_context = CallContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "d616cd70e355bfe6b67576bd03feb06d",
"score": "0.6683487",
"text": "def context\n unless @instance_context\n @instance_context = CpsContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "f5aaab0b7c279f871d33efbd0fc8558b",
"score": "0.66793",
"text": "def context\n unless @instance_context\n @instance_context = CallContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "96c8a7e55e7c21c5be161fc07309de73",
"score": "0.66790885",
"text": "def proxy_context\n @context\n end",
"title": ""
},
{
"docid": "6554237bdd9ad28a0d3652a81a374c5b",
"score": "0.6678002",
"text": "def context\n unless @instance_context\n @instance_context = CallContext.new(@version, @params['account_sid'], @params['sid'],)\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "00c2e08b0bb33203cb2772bc8178ad13",
"score": "0.66416395",
"text": "def context\n unless @instance_context\n @instance_context = CurrentCallContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "ca2db6a949d30cf436d353fb90a75280",
"score": "0.6627958",
"text": "def context\n unless @instance_context\n @instance_context = AnonymizeContext.new(@version , @params['room_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "74c9dca8ae8f963217dd20c0828ba9c3",
"score": "0.66104096",
"text": "def context\n unless @instance_context\n @instance_context = DomainContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "e82a27f78728900f5cb33a4148b891be",
"score": "0.66007036",
"text": "def contextify\n self.class.monadic_context.new self\n end",
"title": ""
},
{
"docid": "67d5288390ba2de5332eb34a123d752f",
"score": "0.65932024",
"text": "def context\n unless @instance_context\n @instance_context = SandboxContext.new(\n @version,\n @params['account_sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c2d9202075dcaa6ecec56be7dafa6f2c",
"score": "0.65719074",
"text": "def context\n unless @instance_context\n @instance_context = TrunkContext.new(@version , @params['sip_trunk_domain'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "8e24d595c9f1589400f46ea71239f6fe",
"score": "0.65685713",
"text": "def context\n unless @instance_context\n @instance_context = CompositionHookContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "22e1c63903304528b4560016656915cd",
"score": "0.6557029",
"text": "def context\n init\n @context\n end",
"title": ""
},
{
"docid": "724331442c64ece0b2fe60888cb1352b",
"score": "0.65504694",
"text": "def context\n unless @instance_context\n @instance_context = InteractionChannelContext.new(\n @version,\n @params['interaction_sid'],\n @params['sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "711a110f592ae8cc88cd1c6abe0538a6",
"score": "0.6547924",
"text": "def context\n unless @instance_context\n @instance_context = UserInfoContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "6e895cecd3fb12226e517ea1cb6ea91f",
"score": "0.6505842",
"text": "def context\n unless @instance_context\n @instance_context = EngagementContextContext.new(@version , @params['flow_sid'], @params['engagement_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "0a2b03ff6aa9fd8822643d921dbe4246",
"score": "0.6496822",
"text": "def context\n unless @instance_context\n @instance_context = CampaignContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "053f393261ed825952688064cda3c53f",
"score": "0.6489991",
"text": "def initialize(*args, &block)\n super(*args)\n instance_exec(_context, &block)\n end",
"title": ""
},
{
"docid": "8808379fa5f8985d2b654916d62b5f0d",
"score": "0.64647996",
"text": "def context\n unless @instance_context\n @instance_context = EsimProfileContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "b3e8a10bd07156e24eb3a203eecbdc54",
"score": "0.6448793",
"text": "def execution_context\n initialize_context!(Object.new)\n end",
"title": ""
},
{
"docid": "ae15fc3ec3b7caf63f5a0344f6e3dcdd",
"score": "0.6410091",
"text": "def context\n unless @instance_context\n @instance_context = BulkEligibilityContext.new(@version , @params['request_id'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "7bb449942620c43db491d6c8785b7915",
"score": "0.64050674",
"text": "def setup_context\n context_methods.each do |m|\n @context.add_method m, self\n end\n\n @context.define_klass\n end",
"title": ""
},
{
"docid": "268ed6f79fb2d5d7d6bb65d3eb017f62",
"score": "0.63679165",
"text": "def context\n unless @instance_context\n @instance_context = RecordingContext.new(@version , @params['trunk_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "3e332c7bd4001adcf157ebc0293c285f",
"score": "0.63514435",
"text": "def context\n Context.instance\n end",
"title": ""
},
{
"docid": "60ffea0b4712a6b2ba4b99633970daa5",
"score": "0.6332286",
"text": "def context\n unless @instance_context\n @instance_context = ReservationContext.new(@version , @params['workspace_sid'], @params['worker_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "6f57cc5f1a233202d7089e9c411dd75c",
"score": "0.6319397",
"text": "def context\n unless @instance_context\n @instance_context = CountryContext.new(@version , @params['iso_code'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "3a69846a8639cba506eea69108c7a20c",
"score": "0.63138926",
"text": "def context\n unless @instance_context\n @instance_context = CompositionContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "5166ea8c063f55445d2fa41ebd3389f2",
"score": "0.6299037",
"text": "def context_methods\n super + [:context]\n end",
"title": ""
},
{
"docid": "019b08d02aed627a8cdfd1371dbff16b",
"score": "0.6277056",
"text": "def context\n unless @instance_context\n @instance_context = TaskContext.new(@version , @params['workspace_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "0f582585828d5dcf7799126ab56877a5",
"score": "0.626909",
"text": "def context\n unless @instance_context\n @instance_context = TranscriptContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "8fffcfa0a3da873c10cf330556843a26",
"score": "0.6260328",
"text": "def context\n unless @instance_context\n @instance_context = AppManifestContext.new(@version , @params['app_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "758e2a955521782622a1a7a1b72951d7",
"score": "0.6259104",
"text": "def context\n unless @instance_context\n @instance_context = ChannelContext.new(@version , @params['service_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "5d292ebd43b1ccb17e576233caa8620d",
"score": "0.62584233",
"text": "def context\n @context ||= Context.new(self)\n end",
"title": ""
},
{
"docid": "1226a5a6d892655adb640a741f185aff",
"score": "0.6236928",
"text": "def context\n unless @instance_context\n @instance_context = TaskContext.new(@version, @params['workspace_sid'], @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "84b13bdc9fc63ce569e24874347ee738",
"score": "0.621686",
"text": "def context\n unless @instance_context\n @instance_context = CallSummaryContext.new(@version , @params['call_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "9b2e4562005e39d5d5ac3e0cd8487500",
"score": "0.6214959",
"text": "def context\n unless @instance_context\n @instance_context = NumberContext.new(@version, @params['destination_number'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "19ad121f850b49132676aacfc24b6bae",
"score": "0.6212979",
"text": "def context\n unless @instance_context\n @instance_context = SummaryContext.new(\n @version,\n @params['call_sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "368682012f6200ba43029b7514c36537",
"score": "0.61968285",
"text": "def context\n unless @instance_context\n @instance_context = RatePlanContext.new(@version, @params['sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "e69479018ba55696425d6b2792851c3b",
"score": "0.61941373",
"text": "def context\n @context ||= new_context_mock(context_options, &finalize_proc)\n end",
"title": ""
},
{
"docid": "c0a83c8402eb737c67a227d508404fa7",
"score": "0.6192687",
"text": "def context\n unless @instance_context\n @instance_context = OauthContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "ba7918d297ea67f1d536c93ce6595c30",
"score": "0.6187435",
"text": "def context\n @context ||= Context.new(self)\n end",
"title": ""
},
{
"docid": "fe9a524292829e3eec77b518c8d12cc2",
"score": "0.6170158",
"text": "def context\n unless @instance_context\n @instance_context = DeactivationsContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "1e75b7a4d519fb6bc88a1033f9a1f2b1",
"score": "0.61668056",
"text": "def context\n unless @instance_context\n @instance_context = SipDomainContext.new(@version , @params['sip_domain'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c22d5c9ef51f1d7d1250a9757e6f1253",
"score": "0.6160464",
"text": "def context\n unless @instance_context\n @instance_context = PhoneNumberContext.new(@version , @params['phone_number'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c22d5c9ef51f1d7d1250a9757e6f1253",
"score": "0.6160375",
"text": "def context\n unless @instance_context\n @instance_context = PhoneNumberContext.new(@version , @params['phone_number'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "dc00d8eb01e9ebb798ec92795895bceb",
"score": "0.6159213",
"text": "def context\n unless @instance_context\n @instance_context = MediaProcessorContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "98716d37cab08a8cd6e09db4a7a71837",
"score": "0.61471516",
"text": "def context\n unless @instance_context\n @instance_context = ChannelContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "c6ebea83ac102bd53363497fcf4dd33c",
"score": "0.613917",
"text": "def context\n unless @instance_context\n @instance_context = IntentStatisticsContext.new(\n @version,\n @params['assistant_sid'],\n @params['intent_sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "dd06a7cd662d55e331164f3d7619e489",
"score": "0.61329484",
"text": "def context\n unless @instance_context\n @instance_context = DomainConfigContext.new(@version, @params['domain_sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "3fe170f6a8cdd5cf1462d2f000673421",
"score": "0.612762",
"text": "def context_methods; end",
"title": ""
},
{
"docid": "855d555dcdcf48c52fb0ed5db48754a0",
"score": "0.6126368",
"text": "def call(*args)\n @ctx.instance_exec(args, &action)\n end",
"title": ""
},
{
"docid": "817f770aab668780d15d0979035e130d",
"score": "0.61230445",
"text": "def context\n unless @instance_context\n @instance_context = ConfigurationContext.new(@version , @params['chat_service_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "099f75582d6eacf877d15be4a57455f0",
"score": "0.61117816",
"text": "def initialize\n self.context = Context.new\n end",
"title": ""
},
{
"docid": "5424cd0e4b9b63284ee3ee856bc57ecb",
"score": "0.60831285",
"text": "def context\n unless @instance_context\n @instance_context = InteractionChannelParticipantContext.new(@version , @params['interaction_sid'], @params['channel_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "d83fbdec576c193afe5ffcfede2b8c1e",
"score": "0.6078565",
"text": "def context\n unless @instance_context\n @instance_context = WorkflowRealTimeStatisticsContext.new(@version , @params['workspace_sid'], @params['workflow_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "34a91940e951bb8e28bc16534a8d3b41",
"score": "0.6055728",
"text": "def context\n unless @instance_context\n @instance_context = LinkshorteningMessagingServiceDomainAssociationContext.new(@version , @params['messaging_service_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "53aace5ba078982816c6cb8b8b7be2b1",
"score": "0.60416424",
"text": "def context(klass, options={}, &blk)\n assoc = options.delete(:as) || self.name.demodulize.underscore\n assoc = assoc.to_sym\n\n nk = options[:name_key] ||= get_name_key\n\n self.hook_instance(\"change_#{nk}\") do |inst, old, new|\n inst.context.indices[assoc].update_membership(inst)\n end\n\n klass.index(assoc, options) do |name, target|\n inst = new(target, name)\n yield(inst, target) if block_given?\n inst\n end\n end",
"title": ""
},
{
"docid": "fd92c1a16766f247922bae372aee80a9",
"score": "0.60396445",
"text": "def context\n unless @instance_context\n @instance_context = ExportAssistantContext.new(@version, @params['assistant_sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "4af01db37e0d8fc1cf49f0b862c3b41e",
"score": "0.60334235",
"text": "def method_missing(method_name, *args, &blk)\n @context.__send__(method_name, *args, &blk)\n end",
"title": ""
},
{
"docid": "72b9747e8618a7682b19c2d936b0cc09",
"score": "0.6017421",
"text": "def context\n unless @instance_context\n @instance_context = DialogueContext.new(@version , @params['assistant_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "6677597053e60b1a096ad719c30a29b6",
"score": "0.60124314",
"text": "def context\n unless @instance_context\n @instance_context = WorkspaceContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "5b8449363be289f1fb5f06df672fa0c1",
"score": "0.6011976",
"text": "def context\n unless @instance_context\n @instance_context = TaskStatisticsContext.new(@version , @params['assistant_sid'], @params['task_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "065971b95707cf0b8503363ffe8b26bd",
"score": "0.6011757",
"text": "def context\n unless @instance_context\n @instance_context = RoomContext.new(@version , @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "ec71f249a863c99a43166cd9c5cd0ad5",
"score": "0.60113055",
"text": "def context\n unless @instance_context\n @instance_context = WorkflowStatisticsContext.new(\n @version,\n @params['workspace_sid'],\n @params['workflow_sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "785a67ffc7253c53ca6599a788293188",
"score": "0.59791136",
"text": "def context\n unless @instance_context\n @instance_context = WorkflowRealTimeStatisticsContext.new(\n @version,\n @params['workspace_sid'],\n @params['workflow_sid'],\n )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "7f009286eec47c07d2200c38fcd8c6e0",
"score": "0.59754676",
"text": "def method_missing(method, *args, &block)\n context.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "7f009286eec47c07d2200c38fcd8c6e0",
"score": "0.59754676",
"text": "def method_missing(method, *args, &block)\n context.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "c61a6201698f966ab1a3db2534500368",
"score": "0.59658414",
"text": "def initialize(context)\n super()\n self.context = context\n end",
"title": ""
},
{
"docid": "ae67cf3d2b6f6e88885d997fbe8449eb",
"score": "0.5953672",
"text": "def context\n unless @instance_context\n @instance_context = DomainCertsContext.new(@version , @params['domain_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "65d4ecabe86e815d42e85009e50fd9ed",
"score": "0.59491056",
"text": "def context\n unless @instance_context\n @instance_context = SettingsContext.new(@version, )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "ab59daa74acd78edece4bb0eaf539c3e",
"score": "0.59407634",
"text": "def context\n unless @instance_context\n @instance_context = DomainCertsContext.new(@version, @params['domain_sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "6c9a605185c80e70a70de06bed539e33",
"score": "0.5931351",
"text": "def context\n @context ||= {}\n end",
"title": ""
},
{
"docid": "6c9a605185c80e70a70de06bed539e33",
"score": "0.5931351",
"text": "def context\n @context ||= {}\n end",
"title": ""
},
{
"docid": "34fa221676e78e8442f7db2ae85334dd",
"score": "0.59014696",
"text": "def context\n unless @instance_context\n @instance_context = SecondaryAuthTokenContext.new(@version )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "3a18bd3828defc477796dc2a1eb817ef",
"score": "0.59012437",
"text": "def context\n return @target if @target.is_a?(Module) && !@options[:class_methods]\n\n @target.singleton_class\n end",
"title": ""
},
{
"docid": "c8818c4d2ad8ca8ab2fae9240c880893",
"score": "0.58897644",
"text": "def _prepare_context; end",
"title": ""
},
{
"docid": "acc70a529a66823a1ab8270ee34de60f",
"score": "0.5882958",
"text": "def context\n unless @instance_context\n @instance_context = InsightsQuestionnairesContext.new(@version , @params['questionnaire_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "723ad1e0eded94e77b072fa620cb8c4a",
"score": "0.5880748",
"text": "def context\n unless @instance_context\n @instance_context = NotificationContext.new(@version, @params['chat_service_sid'], )\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "979f15bdb990fef2cf4c3114eda8879e",
"score": "0.5868429",
"text": "def context\n unless @instance_context\n @instance_context = FeedbackSummaryContext.new(@version , @params['account_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "676344ad72eaced7166ca0bce9405a0e",
"score": "0.5850207",
"text": "def context\n unless @instance_context\n @instance_context = FeedbackSummaryContext.new(@version, @params['account_sid'], @params['sid'],)\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "0ee1645c941887db50a723058bd4564a",
"score": "0.5830738",
"text": "def context\n unless @instance_context\n @instance_context = ParticipantContext.new(@version , @params['account_sid'], @params['conference_sid'], @params['call_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "7510669d21eb4b8fdc5d4ba052473044",
"score": "0.58269054",
"text": "def context\n unless @instance_context\n @instance_context = UserDefinedMessageSubscriptionContext.new(@version , @params['account_sid'], @params['call_sid'], @params['sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "06a7fcf76f405f218c14c74347782b87",
"score": "0.5820322",
"text": "def context\n unless @instance_context\n @instance_context = NotificationContext.new(@version , @params['chat_service_sid'])\n end\n @instance_context\n end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
},
{
"docid": "e3061c29e5b1c24792771045ed903e06",
"score": "0.58167243",
"text": "def context; end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "109116eb91ffac1136aa2bc32a317aa9",
"score": "0.0",
"text": "def set_project\n @project = Project.includes([:elements, clusters: :elements]).find(params[:project_id])\n if current_user.nil? or @project.user_id != current_user.id\n render status: :unprocessable_entity\n end\n end",
"title": ""
}
] |
[
{
"docid": "bd89022716e537628dd314fd23858181",
"score": "0.6163443",
"text": "def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"title": ""
},
{
"docid": "3db61e749c16d53a52f73ba0492108e9",
"score": "0.604317",
"text": "def action_hook; end",
"title": ""
},
{
"docid": "b8b36fc1cfde36f9053fe0ab68d70e5b",
"score": "0.5943409",
"text": "def run_actions; end",
"title": ""
},
{
"docid": "3e521dbc644eda8f6b2574409e10a4f8",
"score": "0.59143174",
"text": "def define_action_hook; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5887026",
"text": "def actions; end",
"title": ""
},
{
"docid": "bfb8386ef5554bfa3a1c00fa4e20652f",
"score": "0.58335453",
"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.57738566",
"text": "def add_actions; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5701527",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5701527",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "6ce8a8e8407572b4509bb78db9bf8450",
"score": "0.56534666",
"text": "def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"title": ""
},
{
"docid": "1964d48e8493eb37800b3353d25c0e57",
"score": "0.5618685",
"text": "def define_action_helpers; end",
"title": ""
},
{
"docid": "5df9f7ffd2cb4f23dd74aada87ad1882",
"score": "0.54237175",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5407991",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5394463",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5376582",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5355932",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "0464870c8688619d6c104d733d355b3b",
"score": "0.53376216",
"text": "def define_action_helpers?; end",
"title": ""
},
{
"docid": "0e7bdc54b0742aba847fd259af1e9f9e",
"score": "0.5337122",
"text": "def set_actions\n actions :all\n end",
"title": ""
},
{
"docid": "5510330550e34a3fd68b7cee18da9524",
"score": "0.5329516",
"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.5311442",
"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.52963835",
"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": "210e0392ceaad5fc0892f1335af7564b",
"score": "0.52955836",
"text": "def setup_handler\n end",
"title": ""
},
{
"docid": "83684438c0a4d20b6ddd4560c7683115",
"score": "0.5295297",
"text": "def before_actions(*logic)\n self.before_actions = logic\n end",
"title": ""
},
{
"docid": "a997ba805d12c5e7f7c4c286441fee18",
"score": "0.5258503",
"text": "def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "1d50ec65c5bee536273da9d756a78d0d",
"score": "0.52442217",
"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.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5235414",
"text": "def action; end",
"title": ""
},
{
"docid": "e34cc2a25e8f735ccb7ed8361091c83e",
"score": "0.5234908",
"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": "635288ac8dd59f85def0b1984cdafba0",
"score": "0.5230927",
"text": "def workflow\n end",
"title": ""
},
{
"docid": "78b21be2632f285b0d40b87a65b9df8c",
"score": "0.52263695",
"text": "def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.5222485",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "923ee705f0e7572feb2c1dd3c154b97c",
"score": "0.5216462",
"text": "def process_action(...)\n send_action(...)\n end",
"title": ""
},
{
"docid": "b89a3908eaa7712bb5706478192b624d",
"score": "0.52128595",
"text": "def before_dispatch(env); end",
"title": ""
},
{
"docid": "d89a3e408ab56bf20bfff96c63a238dc",
"score": "0.52070963",
"text": "def setup\n # override and do something appropriate\n end",
"title": ""
},
{
"docid": "7115b468ae54de462141d62fc06b4190",
"score": "0.520529",
"text": "def after_actions(*logic)\n self.after_actions = logic\n end",
"title": ""
},
{
"docid": "62c402f0ea2e892a10469bb6e077fbf2",
"score": "0.517586",
"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.5174021",
"text": "def setup(_context)\n end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5172379",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "1fd817f354d6cb0ff1886ca0a2b6cce4",
"score": "0.5165636",
"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.5161574",
"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.51556087",
"text": "def determine_valid_action\n\n end",
"title": ""
},
{
"docid": "b38f9d83c26fd04e46fe2c961022ff86",
"score": "0.5153217",
"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.5152898",
"text": "def startcompany(action)\n @done = true\n action.setup\n end",
"title": ""
},
{
"docid": "994d9fe4eb9e2fc503d45c919547a327",
"score": "0.5151238",
"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.5144674",
"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.51387095",
"text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end",
"title": ""
},
{
"docid": "adb8115fce9b2b4cb9efc508a11e5990",
"score": "0.51342636",
"text": "def define_tasks\n define_weave_task\n connect_common_tasks\n end",
"title": ""
},
{
"docid": "e1dd18cf24d77434ec98d1e282420c84",
"score": "0.5113545",
"text": "def setup(&block)\n define_method(:setup, &block)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.51131564",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "3b4fb29fa45f95d436fd3a8987f12de7",
"score": "0.51131564",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "f54964387b0ee805dbd5ad5c9a699016",
"score": "0.5107665",
"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": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5107052",
"text": "def action\n end",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.50908124",
"text": "def config(action, *args); end",
"title": ""
},
{
"docid": "bc3cd61fa2e274f322b0b20e1a73acf8",
"score": "0.5089785",
"text": "def setup\n @setup_proc.call(self) if @setup_proc\n end",
"title": ""
},
{
"docid": "246840a409eb28800dc32d6f24cb1c5e",
"score": "0.50814754",
"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": "5c3cfcbb42097019c3ecd200acaf9e50",
"score": "0.50807786",
"text": "def before_action \n end",
"title": ""
},
{
"docid": "dfbcf4e73466003f1d1275cdf58a926a",
"score": "0.5064482",
"text": "def action\n end",
"title": ""
},
{
"docid": "b6c9787acd00c1b97aeb6e797a363364",
"score": "0.5053022",
"text": "def setup\n # override this if needed\n end",
"title": ""
},
{
"docid": "36eb407a529f3fc2d8a54b5e7e9f3e50",
"score": "0.50526255",
"text": "def matt_custom_action_begin(label); end",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.5050246",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "9fc229b5b48edba9a4842a503057d89a",
"score": "0.5050246",
"text": "def setup\n\t\t\t\t\t\t# Do nothing\n\t\t\t\tend",
"title": ""
},
{
"docid": "fd421350722a26f18a7aae4f5aa1fc59",
"score": "0.50329554",
"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.5023997",
"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.5021236",
"text": "def after(action)\n invoke_callbacks *options_for(action).after\n end",
"title": ""
},
{
"docid": "24506e3666fd6ff7c432e2c2c778d8d1",
"score": "0.5014815",
"text": "def pre_task\n end",
"title": ""
},
{
"docid": "0c16dc5c1875787dacf8dc3c0f871c53",
"score": "0.5014393",
"text": "def setup(server)\n server.on('beforeMethod', method(:before_method), 10)\n end",
"title": ""
},
{
"docid": "c99a12c5761b742ccb9c51c0e99ca58a",
"score": "0.4999298",
"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.49990913",
"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.4997733",
"text": "def setup_signals; end",
"title": ""
},
{
"docid": "6e44984b54e36973a8d7530d51a17b90",
"score": "0.49884573",
"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.49884573",
"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.49840933",
"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.49786162",
"text": "def initialize(*args)\n super\n @action = :set\nend",
"title": ""
},
{
"docid": "67e7767ce756766f7c807b9eaa85b98a",
"score": "0.49784446",
"text": "def after_set_callback; end",
"title": ""
},
{
"docid": "2a2b0a113a73bf29d5eeeda0443796ec",
"score": "0.49782816",
"text": "def setup\n #implement in subclass;\n end",
"title": ""
},
{
"docid": "a5294693c12090c7b374cfa0cabbcf95",
"score": "0.49659815",
"text": "def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"title": ""
},
{
"docid": "63e628f34f3ff34de8679fb7307c171c",
"score": "0.49655175",
"text": "def lookup_action; end",
"title": ""
},
{
"docid": "57dbfad5e2a0e32466bd9eb0836da323",
"score": "0.4956222",
"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": "4aceccac5b1bcf7d22c049693b05f81c",
"score": "0.49543875",
"text": "def around_hooks; end",
"title": ""
},
{
"docid": "5b6d613e86d3d68152f7fa047d38dabb",
"score": "0.49536037",
"text": "def release_actions; end",
"title": ""
},
{
"docid": "64e0f1bb6561b13b482a3cc8c532cc37",
"score": "0.495265",
"text": "def setup(easy)\n super\n easy.customrequest = @verb\n end",
"title": ""
},
{
"docid": "2318410efffb4fe5fcb97970a8700618",
"score": "0.4951427",
"text": "def save_action; end",
"title": ""
},
{
"docid": "b280d59db403306d7c0f575abb19a50f",
"score": "0.49438462",
"text": "def setup\n callback(:setup) do\n notify(:setup)\n migration_check.last_deployed_commit\n end\n end",
"title": ""
},
{
"docid": "fbd0db2e787e754fdc383687a476d7ec",
"score": "0.49436793",
"text": "def action_target()\n \n end",
"title": ""
},
{
"docid": "9f7547d93941fc2fcc7608fdf0911643",
"score": "0.49335384",
"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.49321616",
"text": "def before_setup\n # do nothing by default\n end",
"title": ""
},
{
"docid": "3ba85f3cb794f951b05d5907f91bd8ad",
"score": "0.49264926",
"text": "def setup(&blk)\n @setup_block = blk\n end",
"title": ""
},
{
"docid": "17ffe00a5b6f44f2f2ce5623ac3a28cd",
"score": "0.49247074",
"text": "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"title": ""
},
{
"docid": "21d75f9f5765eb3eb36fcd6dc6dc2ec3",
"score": "0.49246994",
"text": "def default_action; end",
"title": ""
},
{
"docid": "80834fa3e08bdd7312fbc13c80f89d43",
"score": "0.49226475",
"text": "def callback_phase\n super\n end",
"title": ""
},
{
"docid": "f1da8d654daa2cd41cb51abc7ee7898f",
"score": "0.49194494",
"text": "def advice\n end",
"title": ""
},
{
"docid": "0dccebcb0ecbb1c4dcbdddd4fb11bd8a",
"score": "0.49152806",
"text": "def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"title": ""
},
{
"docid": "99a608ac5478592e9163d99652038e13",
"score": "0.49149707",
"text": "def _handle_action_missing(*args); end",
"title": ""
},
{
"docid": "6e0842ade69d031131bf72e9d2a8c389",
"score": "0.49149227",
"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": ""
},
{
"docid": "0fe8b3b5573f8eb57ec1752658a62e4e",
"score": "0.49144953",
"text": "def call\n setup_context\n super\n end",
"title": ""
},
{
"docid": "399ad686f5f38385ff4783b91259dbd7",
"score": "0.49141943",
"text": "def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"title": ""
}
] |
213879f587015be244513915b5591122
|
Question1 Declare one array arr1 and method with array as parameter return sum of elements in arr1 using each loop
|
[
{
"docid": "0aba056f3624e9d4db89a07a1c1de009",
"score": "0.75327975",
"text": "def sum_of_arr(arr)\n arrsum = 0\n arr.each do |ele|\n arrsum += ele\n end\n arrsum\nend",
"title": ""
}
] |
[
{
"docid": "25e120c69f701a3ab3fc22aa139a06ab",
"score": "0.7816587",
"text": "def sum(arr); arr.sum end",
"title": ""
},
{
"docid": "189e35451f7a27748ff5820f0b6bdcd3",
"score": "0.7809265",
"text": "def array_plus_array(arr1, arr2)\n#loop through arr1 return sum\n#loop through arr2 return sum1\n#add the two together\n sum = 0\n arr1.each { | x |\n sum += x }\n \n \n sum1 = 0\n arr2.each { | x |\n sum1 += x }\n \n \n return sum + sum1\n \nend",
"title": ""
},
{
"docid": "1abdfa598050926d7de0facc4b4e3e9d",
"score": "0.77736145",
"text": "def array_sum(array)\nend",
"title": ""
},
{
"docid": "a03ec26c644ed0c838d05e6d8c97e883",
"score": "0.77547526",
"text": "def array_sum(array)\r\nend",
"title": ""
},
{
"docid": "09c139d47480d9f7db73d112206e13c9",
"score": "0.77457887",
"text": "def total(array_1)\n\tsum = 0\n\tarray_1.each do |i|\n\t\tsum = sum + i\n\tend\n\treturn sum\nend",
"title": ""
},
{
"docid": "cd9add8760eb5c964d05bfb496bdddcd",
"score": "0.7724573",
"text": "def sum_array(array)\n\nend",
"title": ""
},
{
"docid": "e9e6400c8ace46e6302f5ac1129847f6",
"score": "0.76827496",
"text": "def total(array_1)\n\tsum = 0\n\tarray_1.each {|i| sum += i}\n\treturn sum\nend",
"title": ""
},
{
"docid": "5e9d631778e82d45f8a67e35b03f219e",
"score": "0.76345384",
"text": "def sum(array)\n\nend",
"title": ""
},
{
"docid": "97d51b6e406073949a31891485df7b21",
"score": "0.7577347",
"text": "def array_calc(array)\n return array.sum\nend",
"title": ""
},
{
"docid": "50081922b04ef617cbb7a63b36e9b7dd",
"score": "0.75661385",
"text": "def sum_of_array_with_each arr\n sum = 0\n arr.each do |num|\n sum += num\n end\n sum\nend",
"title": ""
},
{
"docid": "8128d44d2a2eec7189ce817b742cc508",
"score": "0.7564351",
"text": "def sum_elements(arr1, arr2)\n # Write your code here\nend",
"title": ""
},
{
"docid": "4e5d0dff151b3b19a0f891290bd8cf91",
"score": "0.7560763",
"text": "def total(array1)\narray1.reduce(:+)\nend",
"title": ""
},
{
"docid": "ef60fb72cebe488239c7c6453c216c50",
"score": "0.7533845",
"text": "def sum_array(array)\narray.sum\nend",
"title": ""
},
{
"docid": "ba775105ef091237886d47d6b5c29733",
"score": "0.7530048",
"text": "def sumArray(a1)\n a2 = 0\n a1.each{ |a| a2 += a }\n return a2\nend",
"title": ""
},
{
"docid": "4bb2e92790d1d8c5f85cc7ae3ba87239",
"score": "0.7525819",
"text": "def sum_of_arr(arr)\n # do whatever you want...\nend",
"title": ""
},
{
"docid": "d7285c8f931aab1b02e0fedb8bf9817f",
"score": "0.7525241",
"text": "def sum_arr (arr)\n sum = 0\n arr.each do |v|\n sum += v\n end\n return sum\nend",
"title": ""
},
{
"docid": "55ad986207710defbf14febb784b13f8",
"score": "0.7511529",
"text": "def sum(arr)\r\n #arr.reduce(:+)\r\n sum = 0\r\n arr.each do |element| #loop through each element\r\n sum += element #add values of an aaray\r\n end\r\n sum\r\nend",
"title": ""
},
{
"docid": "7e16d89117cba2013e54a2161627b263",
"score": "0.75111026",
"text": "def sum (array)\n sum = 0\n array.each{ |param| sum+=param }\n return sum\nend",
"title": ""
},
{
"docid": "8cbe0babfe1157b91328976333d55f62",
"score": "0.7484222",
"text": "def sum_upon_sums(array)\nend",
"title": ""
},
{
"docid": "9b13acec3ad56fa1fa91ec5fbebe89e3",
"score": "0.7477871",
"text": "def array_sum(arr)\n sum = 0\n arr.each do |num|\n sum += num\n end\n\n sum\nend",
"title": ""
},
{
"docid": "667e7f0aaeb43642cc74dc3494a1b8e9",
"score": "0.74682426",
"text": "def sum_array(a)\n a.sum\nend",
"title": ""
},
{
"docid": "6085b4e01d9b224257232658fdafdd80",
"score": "0.7463579",
"text": "def array_plus_array(arr1, arr2)\n sum = 0\n arr1.each { |num| sum += num }\n arr2.each { |num| sum += num }\n sum\nend",
"title": ""
},
{
"docid": "43abc557c22858ae8e21a56132cf327e",
"score": "0.74605906",
"text": "def sumarray(arr) \n sum = 0\n arr.each do |i|\n sum += i\n end\n\tsum \nend",
"title": ""
},
{
"docid": "bf303ade54a953d10d8fed46fff43e29",
"score": "0.7459138",
"text": "def sum arr\n total_sum = 0\n for i in arr\n total_sum += i\n end\n return total_sum\nend",
"title": ""
},
{
"docid": "5d19dd7742caba62a3dd9379493cc901",
"score": "0.7448878",
"text": "def addup(arr2)\n sum2 = 0\n arr2.each do |j|\n sum2 += j\n end\n return sum2\nend",
"title": ""
},
{
"docid": "28542da104b92b24b995f48f778d05b8",
"score": "0.7447684",
"text": "def sum_array(array)\n array.sum\nend",
"title": ""
},
{
"docid": "28542da104b92b24b995f48f778d05b8",
"score": "0.7447684",
"text": "def sum_array(array)\n array.sum\nend",
"title": ""
},
{
"docid": "bf3f055d397f6b6f862569b7ce1e3373",
"score": "0.7434165",
"text": "def sum_upon_sums(array)\n\nend",
"title": ""
},
{
"docid": "5f83f85b9838d1cb138660e8a8c587e1",
"score": "0.7432668",
"text": "def sum_arrays(array)\n sum =0\n array.each do |num|\n sum += num\n end\nsum\nend",
"title": ""
},
{
"docid": "9b61e05f8eadc96a7cfe07bead6c3158",
"score": "0.7426599",
"text": "def total(array)\n array.each {|x| sum += x}\nend",
"title": ""
},
{
"docid": "8121d65af8d9628a92b52f1f1c67a10b",
"score": "0.7422879",
"text": "def sum_each_elem(arr, arr2)\n for x in 0...arr.length\n for y in 0...arr2.length\n p (arr[x] + arr2[y]) \n end\n end\nend",
"title": ""
},
{
"docid": "4222084a162912699333850ea67bf186",
"score": "0.7412861",
"text": "def sum_array(array)\n array.sum\nend",
"title": ""
},
{
"docid": "d56693591fedc03f5c20ff9729e5ea32",
"score": "0.7409803",
"text": "def sum arr\n total = 0\n for i in arr\n total += i\n end\n return total\nend",
"title": ""
},
{
"docid": "ba32f45d76c6d830bd7c6898cf9fc031",
"score": "0.7408745",
"text": "def sum(arr)\n sum = 0\n\n arr.each do |el|\n sum += el\n end\n sum\nend",
"title": ""
},
{
"docid": "3c42071b696129a7c7f35fedda73fb02",
"score": "0.74028",
"text": "def sum_array(arr)\n sum = 0\n arr.each do |num|\n sum += num\n end\n sum\nend",
"title": ""
},
{
"docid": "3391ad357514622df7c9bcabe45355b2",
"score": "0.7398248",
"text": "def sum_array(array)\n \n return total_sum\nend",
"title": ""
},
{
"docid": "0c4ccf4568c14af1904f19476f709973",
"score": "0.73918957",
"text": "def sum(arr)\n total = 0\n arr.each do |e|\n total += e\n end\n return total\nend",
"title": ""
},
{
"docid": "073540788adb66193035123feeb2648b",
"score": "0.73878545",
"text": "def total(array)\n sum = 0\n array.each do |i|\n sum = sum + i\n end\n sum\nend",
"title": ""
},
{
"docid": "264f2758d0515e1feb0c6fa23dc7697b",
"score": "0.7377092",
"text": "def array_sum(arr)\n sum = 0\n arr.each {|int| sum += int}\n sum\nend",
"title": ""
},
{
"docid": "8eba0d08bb5765bf51e12d447533f3e3",
"score": "0.73731947",
"text": "def sum(arr)\n total = 0\n arr.each {|i| total += i}\n total\nend",
"title": ""
},
{
"docid": "d8cad77f50b30f71c7438edc767d1149",
"score": "0.7370844",
"text": "def array_plus_array(arr1, arr2)\n (arr1 + arr2).sum\nend",
"title": ""
},
{
"docid": "8a767b1f5c80013109fd3ff9342317b6",
"score": "0.7366603",
"text": "def simpleArraySum(ar)\n #\n # Write your code here.\n #\n sum = 0\n ar.each do |item|\n sum += item\n end\n\n return sum\n\nend",
"title": ""
},
{
"docid": "2c31172acbaea7cf6e3781ee7e619739",
"score": "0.7359033",
"text": "def sum_of_array_iter(arr)\r\n sum = 0\r\n arr.each { |ele| sum += ele }\r\n sum\r\nend",
"title": ""
},
{
"docid": "fc71af06928516429faaec8b1792fbed",
"score": "0.7357905",
"text": "def sum_array(array)\n sum = 0\n array.each do |element|\n sum += element\n end\n sum\nend",
"title": ""
},
{
"docid": "c59178393a469bc58cff6e04c439fa92",
"score": "0.73540753",
"text": "def sum(arr)\n total = 0\n arr.each { |x|\n total += x\n }\n return total\nend",
"title": ""
},
{
"docid": "5c2ea23a136dd41eb58c239b0277dbb2",
"score": "0.7344144",
"text": "def total(array)\n sum = 0\n array.each do |i|\n sum += i\n end\n sum\nend",
"title": ""
},
{
"docid": "7e1262fc71ded20fad1c500449134988",
"score": "0.7340954",
"text": "def num_sum2 array\n array.sum\nend",
"title": ""
},
{
"docid": "0f336980cd58354ed82dcbac526b7987",
"score": "0.7340927",
"text": "def by_sum(arr)\n arr.sum if arr.class == Array\n end",
"title": ""
},
{
"docid": "409b9550adbcd73a67f8bb0d79c35b2e",
"score": "0.7340389",
"text": "def sum_using_each(array)\n sum = 0\n array.each do |element|\n sum += element\n end\n sum\n end",
"title": ""
},
{
"docid": "fabe7d9c61c854646d903684b56dd30a",
"score": "0.7339897",
"text": "def sum(array)\n\n array.sum\nend",
"title": ""
},
{
"docid": "7b45dd0468bf270dd8f79f52e5fb94ff",
"score": "0.7339344",
"text": "def total(array)\n sum = 0\n array.each do |value|\n sum += value\n end\n sum\nend",
"title": ""
},
{
"docid": "769672a2a9e4f924280248a77e34716d",
"score": "0.7328209",
"text": "def sum arr\n total = 0\n arr.each do |x|\n total += x\n end\n total\nend",
"title": ""
},
{
"docid": "200cf3496e51b4caa82c04040bc29a97",
"score": "0.7324273",
"text": "def sum_array(arr)\n sum = 0\n arr.each do |num|\n sum += num\n end\n return sum\nend",
"title": ""
},
{
"docid": "1d6d1131f8cbf68b41642856a60a9077",
"score": "0.73232377",
"text": "def total_of_array(array)\nend",
"title": ""
},
{
"docid": "1631de25cbd0ddfcf538ddfb2cf81a6d",
"score": "0.731954",
"text": "def total(array)\n sum = 0\n array.each do |x|\n sum = sum + x\n end\n sum\nend",
"title": ""
},
{
"docid": "c880eea36211aedc2db30f4d2e708953",
"score": "0.73154205",
"text": "def total(array) #define method with array as a parameter\nsum=0 #set sum to start at 0\narray.each {|x| sum = sum+x} #iterate over each element in the array to add each element indvidually\nreturn sum #return sum of elements iterated over in previous line\nend",
"title": ""
},
{
"docid": "5a8f1d94a479d6696c14b008c8a9b327",
"score": "0.73086995",
"text": "def total(array)\n sum = 0\n array.each do |add|\n sum += add\n end\n sum\nend",
"title": ""
},
{
"docid": "bfd3920416643dcb107a15d1764bc64e",
"score": "0.7308015",
"text": "def sumArray(a1)\n return a1.reduce { |a, b| sum2(a, b) }\nend",
"title": ""
},
{
"docid": "efc6604b07fd058a94730a9983fcc679",
"score": "0.7306463",
"text": "def total(arr_numbers)\n sum = 0\n arr_numbers.each do |x|\n sum = sum + x\n end\n return sum\nend",
"title": ""
},
{
"docid": "83cbad9a4efa46c30aef8d2f794becd1",
"score": "0.730007",
"text": "def sums2(array)\n total = 0\n accumu = 0 \n \n array.each do |num|\n accumu += num\n total += accumu \n end \n \n total \nend",
"title": ""
},
{
"docid": "6a418c7ac138a26b183081d674fb385b",
"score": "0.7299916",
"text": "def total(array)\n sum = 0\n for i in array \n sum += i\n end\n sum\nend",
"title": ""
},
{
"docid": "ccdc4f4810657eab00ac05b5cb7bd465",
"score": "0.7295154",
"text": "def sum_of arr\n sum = 0\n arr.each do |value|\n sum += value\n end\n p sum\nend",
"title": ""
},
{
"docid": "7bfded219fe69c092bb22e6ddd98ce02",
"score": "0.72881",
"text": "def total(array)\n sum = 0\n array.each do |n|\n sum += n\n end\n sum\nend",
"title": ""
},
{
"docid": "5766c22b3d49028b644ade9f5b56d642",
"score": "0.7283277",
"text": "def suma_elem_arr(arreglo)\n suma = 0\n arreglo.each do |value|\n suma += value\n end\n suma\nend",
"title": ""
},
{
"docid": "fe2322cadf84672415ff05e0665afda9",
"score": "0.72715175",
"text": "def total(array)\n sum = 0\n array.each { |val|\n sum += val\n }\n return sum\nend",
"title": ""
},
{
"docid": "e5aa3268875ebfdd8c42c2dd24f5d078",
"score": "0.727106",
"text": "def total(array)\nsum = 0 \narray.each do |num|\n sum += num\nend\nsum\nend",
"title": ""
},
{
"docid": "e5aa3268875ebfdd8c42c2dd24f5d078",
"score": "0.727106",
"text": "def total(array)\nsum = 0 \narray.each do |num|\n sum += num\nend\nsum\nend",
"title": ""
},
{
"docid": "49974c8d7a43aae92e8a87489d175837",
"score": "0.7268946",
"text": "def sum_using_each(array)\n total_sum = 0\n array.each { |value| total_sum += value }\n total_sum\n end",
"title": ""
},
{
"docid": "6b549078f54df84828bf6a0944518dc4",
"score": "0.7254632",
"text": "def total(array)\n sum =0\narray.each {|a| sum += a}\nsum\nend",
"title": ""
},
{
"docid": "6a5174c006da278cf288ac975bec8aad",
"score": "0.72536826",
"text": "def sum(arr)\n totl = 0\n arr.each { |x| totl += x }\n totl\nend",
"title": ""
},
{
"docid": "8ae76d8c4f3102ff91e1418edba4dc81",
"score": "0.72534597",
"text": "def sum(array)\n\tarray.sum\n\nend",
"title": ""
},
{
"docid": "59fbd1e445a3fbacf32c762ff9af6be9",
"score": "0.72478044",
"text": "def sum(arr)\n\t# on_another_computer do\n\t\tarr.inject(:+)\n\t# end\nend",
"title": ""
},
{
"docid": "5241c7fde34eae1ba0a4c5e35a3fcbee",
"score": "0.7244682",
"text": "def sum(array)\n sum = 0\n array.each{ |i| sum += i }\n sum\nend",
"title": ""
},
{
"docid": "bf73538b51d9e2f5c80f0856e91b8c88",
"score": "0.7239594",
"text": "def sum_array(array)\n sum = 0\n array.each do |num|\n sum += num\n end\n sum\nend",
"title": ""
},
{
"docid": "e65b726828a12a7a92123ae95a8d2d96",
"score": "0.7239211",
"text": "def sum_elements(arr1, arr2)\nsum_array = []\n\ni=0\nwhile i < arr1.length\n\nsum_array << arr1[i] + arr2[i]\ni+=1\nend\n\nreturn sum_array\nend",
"title": ""
},
{
"docid": "390eba6d02f7735c1cccd0b80085c796",
"score": "0.7238642",
"text": "def total(arr)\n total = 0\n arr.each do |e|\n total = total + e\n end\n return total\nend",
"title": ""
},
{
"docid": "14eb506e0d5242c20a6b6558541a91c1",
"score": "0.72357994",
"text": "def sum (arr)\n sum = 0\n arr.each do |add|\n \tsum = sum + add\n end\n return sum\nend",
"title": ""
},
{
"docid": "14675248c90b1c120e7977b95b1d8aa6",
"score": "0.7235661",
"text": "def sum_of(array)\n return array.sum\nend",
"title": ""
},
{
"docid": "306e9a61946032c9e7b451ec9178ac11",
"score": "0.72249115",
"text": "def sum (arr)\n sum = 0\n arr.each do |num|\n sum += num\n end\n return sum\nend",
"title": ""
},
{
"docid": "68fb173acc030b99e7a1d3de021a1cf8",
"score": "0.72246855",
"text": "def sum_elements(arr1, arr2)\n newArr = []\ni = 0\nwhile(i < arr1.length)\n newArr[i] = arr1[i]+arr2[i]\n i+=1\nend\nreturn newArr\nend",
"title": ""
},
{
"docid": "c1af6ad83855a41f48df7cee1630d487",
"score": "0.7222351",
"text": "def total(array)\n sum = 0\n array.each do |x|\n sum += x\n end\n return sum\nend",
"title": ""
},
{
"docid": "5fe3e6cbad78309c661d991fb231e062",
"score": "0.72201294",
"text": "def sum arr\n # YOUR CODE HERE\n sum = 0\n arr.each do |item|\n sum += item\n end \n sum\nend",
"title": ""
},
{
"docid": "a1f75b9852e60ef3927b3062114c046b",
"score": "0.7218249",
"text": "def total(array)\n sum = 0\n array.each {|array| sum+=array }\n p sum\nend",
"title": ""
},
{
"docid": "a1f75b9852e60ef3927b3062114c046b",
"score": "0.7218249",
"text": "def total(array)\n sum = 0\n array.each {|array| sum+=array }\n p sum\nend",
"title": ""
},
{
"docid": "7b85e83b5abfa7b49450956256df219b",
"score": "0.72164404",
"text": "def sum_elements(arr1, arr2)\n new_elements = []\n \n i = 0\n while i < arr1.length\n new_ele = arr1[i] + arr2[i]\n new_elements << new_ele\n # el1 = arr1[i]\n # el2 = arr2[i]\n # new_el = el1 + el2\n # new_arr << new_el\n \n i += 1\n end\n \n return new_elements\n end",
"title": ""
},
{
"docid": "9db029ffc5d9488db151797babbca5a6",
"score": "0.72098047",
"text": "def sum(array)\n # set initial vlue of sum\n sum = 0\n # iterate through every value in array and add it to sum\n for x in array do\n sum += x\n end\n # return the sum\n return sum\nend",
"title": ""
},
{
"docid": "4a7e397f9fbabb9ad2ec9be2678ba764",
"score": "0.7207625",
"text": "def sum valArray\n total = 0\n for i in valArray\n total += i \n end\n total\nend",
"title": ""
},
{
"docid": "dec4d3dc727542f1d85223b94e6a1df7",
"score": "0.720252",
"text": "def arr_sum(arr)\n\tsum = 0\n\n\tarr.each do |ele|\n\t\tsum += ele\n\tend\n\treturn sum\nend",
"title": ""
},
{
"docid": "b7c4df6bcf49727b265d4849b9fdde0a",
"score": "0.7198528",
"text": "def array_sum(array)\n sum =0 \n array.each do |elm|\n sum += elm.to_i\n end\n\n return sum\nend",
"title": ""
},
{
"docid": "38182f64eaa9801efc7c4475fff31852",
"score": "0.7196778",
"text": "def total(arr)\n total = 0\n \n arr.each do |num|\n total += num \n end\n \n \n \nend",
"title": ""
},
{
"docid": "3355b632e89f5afbf299c15a1e9449ad",
"score": "0.71912473",
"text": "def total(array)\n sum = 0\n array.each { |i| sum += i }\n return sum\nend",
"title": ""
},
{
"docid": "867a1b8112e932c6f04242a96ef5d410",
"score": "0.7190929",
"text": "def sum array\n sum = 0\n array.each do |x|\n sum += x\n end\n sum\nend",
"title": ""
},
{
"docid": "31a276625d4e6e13a04a6d6f2429f119",
"score": "0.71857613",
"text": "def total(array)\n sum = 0\n\n array.each do |number|\n sum = sum + number\n end\n return sum\nend",
"title": ""
},
{
"docid": "54d201d913ea7218bf2f5d04b8aa5ff6",
"score": "0.71848434",
"text": "def total(array_num)\n sum = 0\n array_num.each{|x| sum=sum+x}\n sum\nend",
"title": ""
},
{
"docid": "4ed49c937cb85f3736ed61a0101d9e34",
"score": "0.7179206",
"text": "def sum arr\n arr.sum\nend",
"title": ""
},
{
"docid": "64e3962b0b83182571cec05f8dfe493d",
"score": "0.717712",
"text": "def sum_elements(arr1, arr2)\n \n sum_array = []\n \n i = 0\n \n while i < arr1.length\n \n sum_array << arr1[i] + arr2[i]\n \n i+=1\n \n end\n \n return sum_array\n \nend",
"title": ""
},
{
"docid": "16294a0f07e6415b2ecf8f878a868c44",
"score": "0.71768826",
"text": "def array_summer(array_to_sum)\n sum = 0\n length = array_to_sum.length\n for i in 0...length\n sum += array_to_sum[i]\n end\n sum\nend",
"title": ""
},
{
"docid": "4c94bec74941925cecd15ab3eb93e84b",
"score": "0.7176416",
"text": "def total(array)\n sum = 0\n array.each do |x|\n sum += x\n end\n return sum\nend",
"title": ""
},
{
"docid": "07f77e656ac390048a298d7e2d2a8a17",
"score": "0.7174179",
"text": "def sum(array)\n\treturn array.sum\nend",
"title": ""
},
{
"docid": "ee2e158a9da0f88602e238f3e7607ad2",
"score": "0.71700084",
"text": "def total(array)\n\tsum = 0\n\tarray.each do |x| \n\t\tsum += x\n end\n sum\nend",
"title": ""
}
] |
495c8c563b6e1764627702fcd8b60bc9
|
Examples: palindromic_number?(34543) == true palindromic_number?(123210) == false palindromic_number?(22) == true palindromic_number?(5) == true Question: Write a method that takes an integer and sees if it's a palindrome, that is if the integers are the same in both directions. Input vs Output: Input: Integer Output: Boolean Explicit vs Implicit Rules Explicit: 1) the argument should be an integer 2) the output should be a boolean Implicit: 1) an integer palindrome is the same as a string palindrome Algorithm: palindromic_number? method 1. first, convert integer into a string using to_s and set it to variable 'string' 2. then see if 'string' == 'string'.reverse
|
[
{
"docid": "a9dfc9a2bce7174dcfa18e4c1c95d498",
"score": "0.8785539",
"text": "def palindromic_number?(integer)\n string = integer.to_s\n string == string.reverse\nend",
"title": ""
}
] |
[
{
"docid": "aa671bfe4c20cad5c1d590441375b249",
"score": "0.8762623",
"text": "def palindromic_number?(number)\n palindrome?(number.to_s)\nend",
"title": ""
},
{
"docid": "f31010315ca7ebb4349ea46c5255ab9e",
"score": "0.8761096",
"text": "def palindromic_number?(int)\n str = int.to_s\n str == str.reverse\nend",
"title": ""
},
{
"docid": "3bd2731be8006c4c766fce45cc7246c6",
"score": "0.87282985",
"text": "def palindromic_number?(integer)\n integer.to_s == integer.to_s.reverse!\nend",
"title": ""
},
{
"docid": "3254df3d88db27b09bbd75f3ec15c077",
"score": "0.87277263",
"text": "def palindromic_number?(integer)\n integer.to_s == integer.to_s.reverse\nend",
"title": ""
},
{
"docid": "f76a2d1ff42df63b9d41e335249ce7b4",
"score": "0.87252617",
"text": "def palindromic_number?(int)\n new_int = int.to_s\n new_int = new_int.reverse\n new_int = new_int.to_i\n int == new_int\nend",
"title": ""
},
{
"docid": "c7ee4dab31d9f8d4508b7c48eca94bc3",
"score": "0.8721764",
"text": "def palindromic_number?(int)\n int.to_s == int.to_s.reverse\nend",
"title": ""
},
{
"docid": "de9840a48adec343b1f2ba3903d67b3b",
"score": "0.87174386",
"text": "def palindromic_number?(int)\r\n int.to_s == int.to_s.reverse\r\nend",
"title": ""
},
{
"docid": "86fab9340dc9e312804c1e2a9dc3aa60",
"score": "0.8700646",
"text": "def palindromic_number?(integer)\n digits = integer.to_s\n digits == digits.reverse\nend",
"title": ""
},
{
"docid": "6c13eb77f8d7cad9ba23be434ba6cc70",
"score": "0.86883694",
"text": "def palindromic_number?(int)\n new_integer = int.to_s.reverse\n new_integer == int.to_s\nend",
"title": ""
},
{
"docid": "be8e6af745d1911c6797f80e7c8edd83",
"score": "0.86875486",
"text": "def palindromic_number?(num)\n num = num.to_s\n num == num.reverse\nend",
"title": ""
},
{
"docid": "b8b3665c0ba92dff5a3c60a4475ea647",
"score": "0.86833113",
"text": "def palindromic_number?(num)\n string = num.to_s\n string == string.reverse\nend",
"title": ""
},
{
"docid": "0e082a93b957e9cc99fb30136a0e39d2",
"score": "0.8677006",
"text": "def palindromic_number?(num)\n palindrome?(num.to_s)\nend",
"title": ""
},
{
"docid": "03604023ac3864132a8ad9644994a1fd",
"score": "0.86261004",
"text": "def palindromic_number?(num)\n num.to_s == num.to_s.reverse\nend",
"title": ""
},
{
"docid": "7d8100da8ab77d8d2a7f22b2343a05b2",
"score": "0.8614843",
"text": "def palindromic_number?(num)\n num.to_s == num.to_s.reverse\nend",
"title": ""
},
{
"docid": "7d8100da8ab77d8d2a7f22b2343a05b2",
"score": "0.8614843",
"text": "def palindromic_number?(num)\n num.to_s == num.to_s.reverse\nend",
"title": ""
},
{
"docid": "9598f562b574d398cafc09f2b2cb3381",
"score": "0.86123824",
"text": "def palindromic_number?(num)\n num == num.to_s.reverse.to_i\nend",
"title": ""
},
{
"docid": "9598f562b574d398cafc09f2b2cb3381",
"score": "0.86123824",
"text": "def palindromic_number?(num)\n num == num.to_s.reverse.to_i\nend",
"title": ""
},
{
"docid": "89d912eed9a2a9fae9ece098948aa2e6",
"score": "0.86002105",
"text": "def palindromic_number?(number)\n number.to_s.reverse.to_i\nend",
"title": ""
},
{
"docid": "c3ed90ea48bfde1574bf4b19d11c460f",
"score": "0.8578719",
"text": "def palindromic_number?(int)\n string_num = int.abs.to_s\n string_num == string_num.reverse\nend",
"title": ""
},
{
"docid": "ccbe1ea3a1d06aa7279fe399d05bcce1",
"score": "0.8560774",
"text": "def palindromic_number?(n)\n n.to_s == n.to_s.reverse\nend",
"title": ""
},
{
"docid": "2b73ce82844dd2ebc43995b60df8bdb3",
"score": "0.8557918",
"text": "def palindromic_number?(int)\n arr = int.to_s\n if arr == arr.reverse\n p true\n else\n p false\n end\n\nend",
"title": ""
},
{
"docid": "d33b9e0b3e7b2d856f57980ca31a0c3d",
"score": "0.8553303",
"text": "def palindromic_number?(integer)\n int_to_string = integer.to_s\n if integer == int_to_string.to_i\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "bd69265c91026843989aac46c818ac59",
"score": "0.85376835",
"text": "def palindromic_number?(num)\n\tstr = num.to_s\n\n\tnum == str.reverse.to_i\nend",
"title": ""
},
{
"docid": "b0b312bacf6f3c2dab83caa7abaa2e16",
"score": "0.8512901",
"text": "def palindromic_number?(num)\n num.to_s.chars.join(\"\").reverse.to_i == num\nend",
"title": ""
},
{
"docid": "260227ee076d33474a51d83ba749f9da",
"score": "0.8504721",
"text": "def palindromic?(number)\n number.to_s == number.to_s.reverse\nend",
"title": ""
},
{
"docid": "bed826f43a937a697723372b68ffc6ab",
"score": "0.850224",
"text": "def palindromic?(number)\n if number.to_s == number.to_s.reverse\n return true\n end\nend",
"title": ""
},
{
"docid": "33e130ef4326f7c5e72fb6bf4211afc9",
"score": "0.84777856",
"text": "def palindrome_integer(num)\n if num > 0 \n str_num = num.to_s\n return true if str_num == str_num.reverse\n end \n false \n \nend",
"title": ""
},
{
"docid": "fd891807d46caefef01921be462bc6f6",
"score": "0.8417691",
"text": "def Palindrome? (number)\r\n nstr = number.to_s()\r\n nstr == nstr.reverse\r\nend",
"title": ""
},
{
"docid": "3a10c7470afbbeea883e8b10e0dfbaba",
"score": "0.839596",
"text": "def is_palindrome?(num)\n num_string = num.to_s\n num_string == num_string.reverse\nend",
"title": ""
},
{
"docid": "132d1f0d56ef8f80e7b00914c1fdb934",
"score": "0.8376402",
"text": "def is_palindrome? number\n num_string = number.to_s\n counter = num_string.length / 2\n\n palindromic = true\n counter.times {|n| palindromic &&= ( num_string[n] == num_string[-n-1])}\n\n palindromic\nend",
"title": ""
},
{
"docid": "42f4ccbca40b62878ae2916f67ae1afe",
"score": "0.83461",
"text": "def is_palindrome(number)\n if (number.to_s == number.to_s.reverse)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "536ffd077ad8936f63459b7535d25b38",
"score": "0.8338724",
"text": "def palindrome?(num)\n num.to_s == num.to_s.reverse\nend",
"title": ""
},
{
"docid": "7b8e231a61087c1d378f1216c5b3be50",
"score": "0.8334704",
"text": "def is_palindrome?(number)\n\tnumber.to_s.reverse == number.to_s\nend",
"title": ""
},
{
"docid": "d05076d22c15f34c0ec78bd0bb8877c6",
"score": "0.83291245",
"text": "def Palindrome? (number)\r\n nstr = number.to_s()\r\n nstr == nstr.reverse\r\n end",
"title": ""
},
{
"docid": "5f263f660a6011162c76f5a6425485e8",
"score": "0.8328002",
"text": "def is_palindrome?(number)\n number.to_s == number.to_s.reverse\nend",
"title": ""
},
{
"docid": "c6313223bb7b992180d028ce1c897f08",
"score": "0.83239305",
"text": "def is_palindrome(number)\n number.to_s.reverse == number.to_s\nend",
"title": ""
},
{
"docid": "0566242200d06c865db229585dd519a0",
"score": "0.83190054",
"text": "def palindrome?( num )\n num.to_s == num.to_s.reverse\nend",
"title": ""
},
{
"docid": "3a64ed6722ce6d10584e87a11c95d3ca",
"score": "0.8295975",
"text": "def is_palindrome?(num)\n binary = num.to_s(2)\n num = num.to_s\n\n num.reverse == num && binary == binary.reverse\nend",
"title": ""
},
{
"docid": "a0fa698976a8892cc4d5d8ddd638c9c8",
"score": "0.82854086",
"text": "def is_palindrome?(num)\n num.to_s == num.to_s.reverse\nend",
"title": ""
},
{
"docid": "3eab61892729599aa3e93e6dc9bbe16a",
"score": "0.8280329",
"text": "def palindromic_number?(num)\n num.to_s \nend",
"title": ""
},
{
"docid": "69d94761e17ab6488b79f16815fe1631",
"score": "0.8243766",
"text": "def is_palindrome?(num)\n characters = num.to_s\n return true if characters == characters.reverse\n false\nend",
"title": ""
},
{
"docid": "79bb37143cbf08f045a74104fdfc836d",
"score": "0.82415456",
"text": "def is_palindrome(number)\n return true if number.to_s == number.to_s.reverse\n return false\nend",
"title": ""
},
{
"docid": "d6ae3599e39fd0fe0d8e21348788ac23",
"score": "0.8221005",
"text": "def is_palindrome(number)\n return false if number == nil\n return true if number == 0\n reverse = 0\n while number > 0\n temp = number # can check if temp = reverse\n digit = number % 10\n reverse = reverse * 10 + digit\n number = number / 10\n # number_even = number * 10 + digit\n p \"temp: #{temp}\"\n p \"digit: #{digit}\"\n p \"reverse: #{reverse}\"\n p \"number: #{number}\"\n\n return true if number == reverse || temp == reverse\n # return true if number == reverse\n end\n return false\nend",
"title": ""
},
{
"docid": "d677658b512bb8bdfde8c092585ba331",
"score": "0.8207755",
"text": "def is_palindrome?(number) # step 2\n digit_array = number.to_s.split('')\n return true if digit_array.reverse == digit_array\nend",
"title": ""
},
{
"docid": "31b5b01bc2d2f3de6d0f274aabd92b0f",
"score": "0.8188687",
"text": "def is_palindrome(number)\n return false if number == nil || number < 0\n\n num = number\n reverse = 0\n\n while num > 0\n last = num % 10\n reverse = (reverse * 10) + last\n num /= 10\n end\n\n reverse == number ? true : false\n\nend",
"title": ""
},
{
"docid": "265ffd2ce94ccd01a33195c5c9dbe86f",
"score": "0.81869835",
"text": "def is_palindrome(n)\n string = n.to_s\n string == string.reverse\nend",
"title": ""
},
{
"docid": "0080df2cef53c66a2f4ca864d44b01b2",
"score": "0.81605756",
"text": "def is_palandrome?(number)\n return number.to_s == number.to_s.reverse\nend",
"title": ""
},
{
"docid": "e2ec9589f9c5e41508e225c54c8ba6f6",
"score": "0.81349444",
"text": "def palindromic_number?(number)\n index = -1\n rev_array = Array.new(\"#{number}\".length)\n \"#{number}\".chars.each do |char|\n rev_array[index] = char.to_i\n index -= 1\n end\n number == rev_array.join.to_i\nend",
"title": ""
},
{
"docid": "2074b782754438c10ae8d6ac7d8d912f",
"score": "0.81308764",
"text": "def is_palindrome(number)\n if number.nil?\n return false\n end\n\n if number < 0\n return false\n end\n\n if number % 10 == 0 && number != 0\n return false\n end\n\n reverted = 0\n while number > reverted\n reverted = reverted * 10 + number % 10\n number /= 10\n end\n\n return number == reverted || number == reverted / 10\nend",
"title": ""
},
{
"docid": "db73500d0c047ac50f4586e37eda27c3",
"score": "0.81306493",
"text": "def is_palindrome(number)\n return false if number.class != Integer || number < 0\n\n # create a varibale to store the result number\n result = 0\n prev_result = 0\n copy_num = number\n\n while copy_num != 0\n current_digit = copy_num % 10\n result = result * 10 + current_digit\n\n # This is to handle overflow\n return false if ((result - current_digit) / 10) != prev_result\n\n prev_result = result\n copy_num = copy_num / 10\n end\n return result == number\nend",
"title": ""
},
{
"docid": "56af32c88fc45eee4fb0f1fcb9f0d937",
"score": "0.80978924",
"text": "def is_palindrome?(n)\n n.to_s == n.to_s.reverse!\nend",
"title": ""
},
{
"docid": "fe9bc759dae5ab96d82add553570b4ff",
"score": "0.8079213",
"text": "def is_palindrome(number)\n return false if number == nil || number < 0\n i = 10\n while (number % (i)) != number\n i *= 10\n end\n i /= 10\n while i > 10\n if (number / i) == (number % 10)\n number = (number % i) / 10\n i /= 100\n else\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "21e1c3d3fe9ab146928b05bd85164a4b",
"score": "0.8069239",
"text": "def palindromic(num) \n if num.to_s.split(\"\") == num.to_s.split(\"\").reverse\n true \n else \n false \n end \nend",
"title": ""
},
{
"docid": "2021194316e5d64ab16fd5b3b22a112c",
"score": "0.8059274",
"text": "def palindrome?(n)\n n.to_s == n.to_s.reverse\nend",
"title": ""
},
{
"docid": "5b1affea88af3891aa4a3b9a3e822718",
"score": "0.8043764",
"text": "def is_palindrome(number)\n return false if number == nil || number < 0\n i = 0\n placeholder = number\n until placeholder == 0\n placeholder /= 10\n i += 1\n end\n until i <= 0\n i -= 1\n\n if number % 10 != number / 10 ** i\n return false\n end\n\n number -= (number / 10 ** i) * 10 ** i\n number /= 10\n\n i -= 1\n end\n return true\nend",
"title": ""
},
{
"docid": "3b921eb0dbc50c88c07a656f6f13bb56",
"score": "0.8024849",
"text": "def palindromic?(x)\n x.to_s == x.to_s.reverse\nend",
"title": ""
},
{
"docid": "f9c1dd33eec0dc11b9aa16ef3ac8ae54",
"score": "0.8020536",
"text": "def palindromic?(input)\n input == input.reverse\nend",
"title": ""
},
{
"docid": "c9272a33c3a2e7656093671520c69429",
"score": "0.8018795",
"text": "def q10_palindromic?(num)\n q9_palindrome?(num.to_s)\nend",
"title": ""
},
{
"docid": "6355790f30630909be135e318f838edf",
"score": "0.8012208",
"text": "def is_palindrome(number)\n # Special cases.\n if number.nil? or number < 0\n return false\n end\n if number == 0\n return true\n end\n # Get number of digits in number.\n num_digits = Math.log10(number).to_i + 1\n if num_digits == 1\n return true\n end\n # Reverse the last half of the number's digits.\n last_half = 0\n (num_digits / 2).to_i.downto(1) do |digit_index|\n digit = number % 10\n last_half += digit * 10**(digit_index - 1)\n number = (number / 10).to_i\n end\n # Ignore middle digit in number with odd num digits.\n if num_digits % 2 == 1\n number = (number / 10).to_i\n end\n return last_half == number\nend",
"title": ""
},
{
"docid": "af5a9a28800dc10c0876b960aea4125d",
"score": "0.80112934",
"text": "def is_palindrome(number)\n if number == nil || number < 0\n return false\n elsif number == 0\n return true\n end\n\n # Count number of digits in number.\n digit_count = 0\n div_result = 0\n int = number\n until div_result == 0 && digit_count > 0\n digit_count += 1\n div_result = int / 10\n int /= 10\n end\n if digit_count == 1\n return true\n end\n\n # Math to check for palindrome.\n count = 1\n (digit_count / 2).times do\n if number % 10 != number / (10 ** (digit_count - count))\n return false\n else\n number = number / 10\n count += 1\n number = number % (10 ** (digit_count - count))\n count += 1\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "e83d7407cddf2e1c80922892817b614e",
"score": "0.7994517",
"text": "def is_palindrome(number)\n if number == nil || number < 0\n return false\n end\n\n converted_string_number = number.to_s\n\n i = 0\n j = converted_string_number.length - 1\n\n while i < j\n last_character = converted_string_number[i]\n converted_string_number[i] = converted_string_number[j]\n converted_string_number[j] = last_character\n i += 1\n j -= 1\n end\n\n converted_string_number = converted_string_number.to_i\n\n return number == converted_string_number\nend",
"title": ""
},
{
"docid": "5653e5a9435f051953dddbf7abb9bf0b",
"score": "0.79843783",
"text": "def palindromic?(number)\n num = number.to_s.split('')\n (1..(num.size/2)).all? do |index|\n num[index-1] == num[index*(-1)]\n end\nend",
"title": ""
},
{
"docid": "ce04a1d651b68e87a06287c0a57e5a96",
"score": "0.7983625",
"text": "def is_palindrome?(n)\n n.to_s == n.to_s.reverse\n end",
"title": ""
},
{
"docid": "516e5a94cbf6982a953ddf5a7defa66d",
"score": "0.79691344",
"text": "def is_palindrome?(x)\n x.to_s == x.to_s.reverse ? true : false\nend",
"title": ""
},
{
"docid": "b413e6aea4b59286d5445b96a6aba434",
"score": "0.79597074",
"text": "def is_palindrome (n) #Checks to see if the number is a palindrome\n if n == n.reverse\n return true\n end\nend",
"title": ""
},
{
"docid": "efb60976f89747e233f16813be57d90b",
"score": "0.79449373",
"text": "def palindrom?(string)\n string == string.reverse\nend",
"title": ""
},
{
"docid": "611fc5aa0af9b3b891d4751f78429b2c",
"score": "0.79381317",
"text": "def is_palindrome(input)\n\tinput_as_string = input.to_s\n\treturn input_as_string == input_as_string.reverse\nend",
"title": ""
},
{
"docid": "dedb6ca3c66db3d53b0ea5bc1d3f619f",
"score": "0.79362804",
"text": "def palindromic_number?(number, zeros=0)\n number = \"#{'0' * zeros}%o\" % number if zeros > 0\n palindrome?(number.to_s)\nend",
"title": ""
},
{
"docid": "4c2c252a555048f19290e6be603afb6c",
"score": "0.7923776",
"text": "def palindromic_number?(num)\n # my_list = num.digits\n # array_palindrome?(my_list)\n my_list = num.to_s\n palindrome?(my_list)\nend",
"title": ""
},
{
"docid": "f40b6cce95b92831f97919fe253391be",
"score": "0.79208547",
"text": "def pallindrome? n\n n.to_s == n.to_s.reverse\nend",
"title": ""
},
{
"docid": "233656eaecf30101026227d164375478",
"score": "0.7914385",
"text": "def is_palindrome(number)\n return false if number == nil || number < 0\n\n k = 0\n clone_number = number\n\n until clone_number == 0\n clone_number /= 10\n k += 1\n end\n\n return true if k == 1\n\n i = 1\n\n until i > k / 2\n a = number % 10 ** (k + 1 - i) / 10 ** (k - i)\n b = (number / 10 ** (i - 1)) % 10\n return false if a != b\n i += 1\n end\n\n return true\nend",
"title": ""
},
{
"docid": "3a135f8e81801a87c58e3912a67b61ff",
"score": "0.790828",
"text": "def isPalindrome?(x)\n s = x.to_s\n if s == s.reverse\n return true\n end\nend",
"title": ""
},
{
"docid": "b168368340306f044b786eb50123b306",
"score": "0.7905001",
"text": "def palindrome?(input)\n input.to_s == input.to_s.reverse\nend",
"title": ""
},
{
"docid": "da41b3dafb82d98227013b02155824c4",
"score": "0.79022",
"text": "def palindromic?(i)\n i.to_s == i.to_s.reverse\nend",
"title": ""
},
{
"docid": "8bb9608ab8b5cbf0c3ea8b6cd40ec816",
"score": "0.79005337",
"text": "def IsPalindromic(value)\r\n @value = value\r\n @n = @value\r\n @rev = 0\r\n \r\n while @value > 0\r\n @digit = @value % 10\r\n \r\n @rev = @rev * 10 + @digit\r\n @value = @value / 10\r\n end\r\n \r\n return (@n == @rev)\r\n end",
"title": ""
},
{
"docid": "7ce7a539fc6af9e22ce939385147c47b",
"score": "0.7883673",
"text": "def isPalindrome(number)\n numberString = number.to_s\n\n if numberString == numberString.reverse\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "c2853e98b3d46be00f915ad42c729e2e",
"score": "0.78639215",
"text": "def palindrome?\n n = self\n\n digit_array = n.to_s.each_char.map(&:to_i)\n digit_array.shift if n < 0\n\n start_index = 0\n end_index = digit_array.length - 1\n\n palindrome = true\n loop do\n break if end_index < start_index\n\n if digit_array[start_index] == digit_array[end_index]\n start_index += 1\n end_index -= 1\n\n break if end_index == start_index\n else\n palindrome = false\n break\n end\n end\n\n return palindrome\n end",
"title": ""
},
{
"docid": "e5eea71f7b54b92df5511b5f1003e374",
"score": "0.7857685",
"text": "def is_palindrome(number)\n return false if number == nil || number < 0\n return true if number < 10\n d = 0\n \n number_copy = number\n while number_copy > 9 \n number_copy /= 10\n d += 1 \n end \n\n while number > 9\n if (number / 10**d)%10 != number%10\n return false\n else\n # remove first and last digit from number\n number = (number % 10**d) / 10\n d -= 2\n end\n end\n\n # i = 0\n # while d > 0\n # if (number / 10**d)%10 != (number/10**i) % 10\n # return false\n # else\n # i += 1\n # d -= 1\n # end\n # end\n return true\nend",
"title": ""
},
{
"docid": "076431fc3f800fd05e54a53899ba7dbe",
"score": "0.78557664",
"text": "def check_palindromic(variable)\n if variable == variable.reverse\n puts \"#{ variable } is a palindrome.\"\n else\n puts \"#{ variable } is not a palindrome.\"\n end\nend",
"title": ""
},
{
"docid": "f8e54fc1a5e78bdd59a13a1147212d16",
"score": "0.78458863",
"text": "def palindrome?(input)\n input == input.reverse\nend",
"title": ""
},
{
"docid": "f8e54fc1a5e78bdd59a13a1147212d16",
"score": "0.78458863",
"text": "def palindrome?(input)\n input == input.reverse\nend",
"title": ""
},
{
"docid": "f8e54fc1a5e78bdd59a13a1147212d16",
"score": "0.78458863",
"text": "def palindrome?(input)\n input == input.reverse\nend",
"title": ""
},
{
"docid": "f8e54fc1a5e78bdd59a13a1147212d16",
"score": "0.78458863",
"text": "def palindrome?(input)\n input == input.reverse\nend",
"title": ""
},
{
"docid": "da51eab232344643980b64983e8a6ead",
"score": "0.78400034",
"text": "def isPalindrome(num)\n\tnum_str = num.to_s\n\tnum_rev = num_str.reverse\n\n\tif num_str == num_rev\n\t\ttrue\n\telse\n\t\tfalse\n\tend\nend",
"title": ""
},
{
"docid": "d7feedb98fac1037e3e263783c1fedd3",
"score": "0.7826444",
"text": "def palindrome_tester(s)\n result = false\n if s == s.reverse\n result = true\n return result\n else\n result = false\n return result\n end\n end",
"title": ""
},
{
"docid": "1f8ba679ccc6bc63198ece7cefc9d35f",
"score": "0.77892673",
"text": "def is_palindrome(number)\n \n if number == nil || number < 0\n return false\n end\n\n length = 0\n counter = number\n\n while counter >= 10\n counter /= 10\n length += 1\n end\n\n index = 0\n first_index = 0\n last_index = length - 1\n\n check = true\n while index < length\n\n # palindrome check\n first_digit = number / (10 ** (length-(index)))\n # removes first digit\n number = number - (first_digit * (10 ** (length-index)))\n last_digit = number % (10)\n # removes last digit\n number = number / 10\n if first_digit != last_digit\n check = false\n end\n index += 2\n end\n return check\n end",
"title": ""
},
{
"docid": "ea727dbe988157f7e13589d131c9ab0b",
"score": "0.77681607",
"text": "def palindrome?(argument)\n argumen.reverse == argument\nend",
"title": ""
},
{
"docid": "395c40fccb15f7d6ad1e2851bee95093",
"score": "0.7763034",
"text": "def is_palindrome(x)\n y = x.to_s.reverse.to_i\n # 將引數轉成字串反轉再轉回數字\n if y === x\n # 如果兩者相等(三個等號判斷連同類別也要一樣)\n true\n else\n # 如果兩者不等於\n false\n end\nend",
"title": ""
},
{
"docid": "a9e5f878c725c66d4d96d858ee7848c6",
"score": "0.77607095",
"text": "def isPalidrome(str)\n str == str.reverse\nend",
"title": ""
},
{
"docid": "8cd92c1b2f265cbad51436c310d0f726",
"score": "0.7759676",
"text": "def is_palindrome(number)\n return false if !number || number < 0\n length = 1\n until number / (10 ** length) == 0\n length += 1\n end\n (length / 2).times do |i|\n return false if (number / (10 ** (length - i - 1))) % 10 != (number % (10 ** (i + 1))) / (10 ** i)\n end\n return true\nend",
"title": ""
},
{
"docid": "396997fa269ec1cc0bb3ec9971dfd090",
"score": "0.7750119",
"text": "def isPalindrome(string)\n return string.reverse == string\nend",
"title": ""
},
{
"docid": "37f174407fe8b8b68bf12d1cebe80486",
"score": "0.7745783",
"text": "def palindrom_check(variable)\n if variable.reverse == variable #Check if string same when reversed\n puts \"#{ variable } is a palindrome.\"\n else # If string is not the same when reversed\n puts \"#{ variable } is not a palindrome.\"\n end\nend",
"title": ""
},
{
"docid": "3c48f5b7bd530aaa9447547de0411f6a",
"score": "0.77381754",
"text": "def palindrome (string)\n\n if string.reverse == string\n return true\n else\n return false\n end\n \nend",
"title": ""
},
{
"docid": "f978662242b65c26a757dba09be90b47",
"score": "0.7736783",
"text": "def is_palindrome?(num)\n\tdigit_array = num.to_s.chars.map(&:to_i)\n\tlength = digit_array.length\n\teach_half = digit_array.each_slice(length/2).map(&:to_a)\n\treturn each_half[0] == each_half[1].reverse\nend",
"title": ""
},
{
"docid": "d7743e71590131cb032e5cd2d03a2172",
"score": "0.7732942",
"text": "def palindrome(str)\n if str.reverse == str\n puts true\n else\n puts 'not palindrome'\n end\nend",
"title": ""
},
{
"docid": "590d128cbf5058bf7d0363fa60e75302",
"score": "0.77324617",
"text": "def palindrome?(string)\n if string == string.reverse\n return true\n else \n return false\n end\nend",
"title": ""
},
{
"docid": "cf61f81391c75a808b14466a0a603e4b",
"score": "0.7715812",
"text": "def is_palindrome(number)\n return true if number == ''\n return false if number.nil? || number.negative?\n\n number_array = []\n while number > 0\n digit = number % 10\n number /= 10\n number_array << digit\n end\n\n i = 0\n j = number_array.length - 1\n while i < j\n if number_array[i] == number_array[j]\n j -= 1\n i += 1\n else\n return false\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "35d0f8755ce772efb243eebd27d1836d",
"score": "0.7694623",
"text": "def palindrome?(arg)\n arg == arg.reverse\nend",
"title": ""
},
{
"docid": "35d0f8755ce772efb243eebd27d1836d",
"score": "0.7694623",
"text": "def palindrome?(arg)\n arg == arg.reverse\nend",
"title": ""
},
{
"docid": "f0c189ec22842debce5343f800ddfb41",
"score": "0.7693678",
"text": "def palindrome?(param)\n param == param.reverse\nend",
"title": ""
}
] |
44a67a11b7e93a2689888e187ef737d8
|
A dynamic widget may open a web socket back to this service. Connect to the respective table and feed back any changes. BUG ALERT: We send the entire content of the data table initially and only start monitoring the table for new stuff when the web socket connects. Any data added in between is not covered.
|
[
{
"docid": "2fb431ec91907cb5a2ea257dbb100d36",
"score": "0.6250242",
"text": "def on_ws_open(ws)\n #puts \">>>> ON_WS_OPEN\"\n @ws = ws\n @data_sources.each do |name, table|\n table.on_row_added(self.object_id) do |row|\n begin\n # may want to queue events to group events into larger messages\n msg = [{:stream => name, :events => [row]}]\n ws.send_data msg.to_json\n rescue Exception => ex\n warn ex\n end\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "3d7c7fb091bfa30477fc8bee9b31e86f",
"score": "0.57948047",
"text": "def push_to_web_sockets\n if created_at_changed?\n ActionCable.server.broadcast(\"posts\", \n data: json_view\n )\n end\n end",
"title": ""
},
{
"docid": "88bde231efaf8f3b98700c40bd0654cf",
"score": "0.57467616",
"text": "def websocket; end",
"title": ""
},
{
"docid": "88bde231efaf8f3b98700c40bd0654cf",
"score": "0.57467616",
"text": "def websocket; end",
"title": ""
},
{
"docid": "2e34c4bf6f8b34c6824b6acc9735996c",
"score": "0.5457798",
"text": "def websocket_update\n UpdatesChannel.broadcast_to(user, {loadModels: [self.to_jsonapi]})\n end",
"title": ""
},
{
"docid": "8ceba49a2f18c91a06d2c3e40c936402",
"score": "0.53743905",
"text": "def on_client_data(client)\n end",
"title": ""
},
{
"docid": "27f60e47b7a0f9f7e4e8cc152170870e",
"score": "0.5228362",
"text": "def run\n AMQP.start(:host => \"localhost\"){\n\n @update_channel = EM::Channel.new\n\n url = \"#{DB_URI}/rooms/_changes?feed=continuous&since=#{@seq}&heartbeat=500\"\n http = EM::HttpRequest.new(url).get\n http.stream{|chunk|\n msg = JSON.parse chunk rescue nil\n update msg if msg\n }\n http.callback{ DaemonKit.logger.debug \"CouchDB connection closed\" }\n\n MQ.queue(WEBSOCKET_QUEUE).subscribe{|json|\n #begin\n msg = JSON.parse(json)\n DaemonKit.logger.debug(\"Websocket:MQ: \" + msg.inspect)\n @deferred_responses[msg[\"id\"]].succeed(msg)\n #rescue\n # DaemonKit.logger.debug \"Got error: #{$!}\" \n #end\n }\n \n EM::WebSocket.start({\n :host => \"0.0.0.0\",\n :port => WEBSOCKET_PORT,\n :secure_proxy => true\n }) do |ws|\n ws.onopen { onopen ws }\n\n ws.onmessage {|json| onmessage ws, json}\n\n ws.onclose {\n DaemonKit.logger.debug(\"Connection on #{ws.signature} closed\")\n }\n end\n }\n end",
"title": ""
},
{
"docid": "d5750d5bb8d46671130128942508d350",
"score": "0.51574206",
"text": "def init_graph(name, data, viz_type = 'network', opts = {})\n # i = 0\n def_viz_opts = {\n #:schema => table.schema \n }\n \n gopts = {\n :data_sources => data,\n :dynamic => {\n :updateInterval => 1\n },\n :viz_type => viz_type,\n :wopts => def_viz_opts.merge(opts)\n \n }\n OMF::Web::Widget::Graph.addGraph(name, gopts) \nend",
"title": ""
},
{
"docid": "839e295a4a688abea8869e5850f3bd27",
"score": "0.5140519",
"text": "def handle_store_client_data(origin_client_id, params)\n key = params[:key].to_sym\n value = params[:value].to_s\n public = params[:public] == 'true' || false\n\n ClientData.create(owner_client_id: origin_client_id.to_sym,\n key: key,\n value: value,\n public: public)\n notify(:type => :info, :code => 4000, :receivers => @qsif[:client_manager].web_socket(:client_id => origin_client_id), :params => {:client_id => origin_client_id})\n end",
"title": ""
},
{
"docid": "347d429e40696c16c2235616a130c569",
"score": "0.5134619",
"text": "def dtnsoc\n TCPSocket.open($IQFEED_HOST, $IQFEED_HISTORICAL_PORT)\n end",
"title": ""
},
{
"docid": "9905d06e68bb8d5e52289dd38dd8b48a",
"score": "0.5107291",
"text": "def refresh_live_display\n\t\t# update the table model rows without affecting user selections\n\t\trow_count = @channel_records_table_model.getRowCount\n\t\tif row_count > 0\n\t\t\t@channel_records_table_model.fireTableRowsUpdated(0, row_count-1)\n\t\tend\n\n\t\t# update the live timestamp\n\t\t@live_update_timestamp_label.text = Java::Date.new.toString\n\tend",
"title": ""
},
{
"docid": "6ad201e143a654df0e0cb4e7ec6c5ea7",
"score": "0.51015043",
"text": "def make_websocket\n require 'em-websocket'\n require 'sanitize'\n\nsoc = []\n\n\n\nEM::WebSocket.start(host: '10.20.4.130' , port: 4000) do |ws|\n\n ws.onopen{soc << ws;puts \"#{soc.length} clients present\";}\n ws.onmessage { |msg| ; soc.each do |s| \n msg = Sanitize.clean(msg.html_safe , :elements => %w(font) , :attributes => {'font' => ['color']})\n\t\t\t\ts.send(\"#{msg}\")\n\t\t\t\tend ; $redis.LPUSH 'msg', \"#{msg}\" }\n ws.onclose {puts \"Someone dissconected \" ; soc.delete(ws)}\n end\n end",
"title": ""
},
{
"docid": "98ad55c16e9746f8c3fc99dc09989b51",
"score": "0.509491",
"text": "def post_init\n req = \"GET #{@conn_obj.base_url}/#{@conn_obj.db_name}/_changes?feed=continuous&heartbeat=5000\\r\\n\\r\\n\"\n send_data req\n end",
"title": ""
},
{
"docid": "6afe5bc87f99f8ffd880919e23181b58",
"score": "0.5069745",
"text": "def set_widget\n if !logged_in?\n userresponse = RestClient::Request.new({\n method: :get,\n url: ENV['API_URL'] + 'widgets/visible?client_id='+ ENV['CLIENT_ID'] + '&client_secret=' + ENV['CLIENT_SECRET'] +'&term=',\n headers: { content_type: 'application/json'}\n }).execute do |userresponse, request, result|\n case userresponse.code\n when 400\n [ :error, JSON.parse(userresponse) ]\n when 200\n [ :success, JSON.parse(userresponse) ]\n json=JSON.parse(userresponse)\n rec = Array.new\n json[\"data\"][\"widgets\"].each do |item|\n widget= Widget.new \n widget.id=item[\"id\"]\n widget.name=item[\"name\"]\n widget.description=item[\"description\"]\n widget.kind=item[\"kind\"]\n widget.userid=item[\"user\"][\"id\"]\n widget.username=item[\"user\"][\"name\"]\n widget.owner=item[\"owner\"]\n rec << widget\n end\n @widgetlist= WidgetList.new\n @widgetlist.widgets = rec\n else\n fail \"Invalid response #{userresponse.to_str} received.\"\n end\n end\n else\n response = RestClient::Request.new({\n method: :get,\n url: ENV['API_URL'] + '/widgets',\n headers: { Authorization: session[:access_token], content_type: 'application/json'}\n }).execute do |response, request, result|\n case response.code\n when 400\n [ :error, JSON.parse(response) ]\n when 200\n [ :success, JSON.parse(response) ]\n json=JSON.parse(response)\n rec = Array.new\n json[\"data\"][\"widgets\"].each do |item|\n widget= Widget.new \n widget.id=item[\"id\"]\n widget.name=item[\"name\"]\n widget.description=item[\"description\"]\n widget.kind=item[\"kind\"]\n widget.userid=item[\"user\"][\"id\"]\n widget.username=item[\"user\"][\"name\"]\n widget.owner=item[\"owner\"]\n rec << widget\n end\n @widgetlist= WidgetList.new\n @widgetlist.widgets = rec\n else\n fail \"Invalid response #{response.to_str} received.\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2cf056dd558dee231a7dda2eacee34d1",
"score": "0.50166106",
"text": "def websocket_update\n json = self.to_jsonapi\n watching_users.each do |user|\n UpdatesChannel.broadcast_to(user, {loadModels: [json]})\n end\n end",
"title": ""
},
{
"docid": "031ce0742a120cf2c13f482c3ed139d8",
"score": "0.49928418",
"text": "def do_create_widgets(instance)\n client = Client.open(instance)\n if client\n client.query(\"drop database if exists widgets\")\n client.query(\"create database widgets\")\n else\n puts \"Could not open connection to MySQL instance #{instance}.\"\n end\n rescue Mysql2::Error => e\n puts e.message\n puts e.backtrace\n ensure\n client.close if client\n end",
"title": ""
},
{
"docid": "32519a0ef5a29974b25a8fc787c1c72c",
"score": "0.49811584",
"text": "def handle_load_client_data(origin_client_id, params)\n client_id = params[:owner].to_sym\n key = params[:key].to_sym\n value = ClientData.where(owner_client_id: client_id).where(key: key).any_of({public: true}, {owner_client_id: origin_client_id}).first.value\n relay(Qeemono::Notificator::SERVER_CLIENT_ID, @qsif[:client_manager].web_socket(:client_id => origin_client_id), {:method => :load_client_data_result, :params => {:value => value}})\n end",
"title": ""
},
{
"docid": "25d60cc08a48580abdf385df23e589df",
"score": "0.49693322",
"text": "def start_connect\n # increment id to use as counter for each connections color\n if controller_store[:id] == 7\n controller_store[:id] = 0\n end \n controller_store[:id] += 1\n connection_store[:id] = controller_store[:id]\n\n # send the connection's color\n send_message :curColor, controller_store[:colors][connection_store[:id]]\n\n # sends array data used to display drawing\n send_message :Draw, [\n controller_store.collect_all(:x),\n controller_store.collect_all(:y),\n controller_store.collect_all(:drag),\n controller_store[:color]\n ]\n end",
"title": ""
},
{
"docid": "994c68cd8a7ed497b7096cf4812cf706",
"score": "0.4966443",
"text": "def initialize_dynamic_table(table, run_control)\n table_model = @main_tab.getControl(table).getModel\n initialize_table_checks(table_model)\n run_control.addActionListener do |_e|\n table_model.uncheckDisplayedRecords\n table_model.setRecords(cluster_records(run_control.getSelectedItem))\n initialize_table_checks(table_model)\n end\n end",
"title": ""
},
{
"docid": "7fd85cc5ebcf3a87273ea431a2e2eb39",
"score": "0.49657378",
"text": "def initialize(url, cookies, logs: false, &handler)\n @super_logger = Logger.new(logs ? 'ws_super_logger.log' : '/dev/null')\n\n @uri = URI.parse(url)\n @url = \"ws#{@uri.scheme.split(\"\")[4]}://#{@uri.host}\"\n\n if @uri.scheme.split(\"\")[4] == 's'\n @socket = TCPSocket.new(@uri.host, 443)\n @super_logger.info \"Opened TCP socket for (port 443) #{@uri} (#{@socket})\"\n @socket = OpenSSL::SSL::SSLSocket.new(@socket)\n @socket.connect\n @super_logger.info \"Upgrade TCP socket to SSL socket socket for #{@uri} (#{@socket})\"\n else\n @socket = TCPSocket.new(@uri.host, 80)\n @super_logger.info \"Opened TCP socket for (port 80) #{@uri} (#{@socket})\"\n end\n\n @handler = handler\n @logger = Logger.new(logs ? \"realtime.log\" : '/dev/null')\n @restart = true\n @super_logger.info \"Set @restart to #{@restart}\"\n\n @driver = WebSocket::Driver.client(self)\n @driver.add_extension PermessageDeflate\n @driver.set_header \"Cookies\", cookies if cookies\n @driver.set_header \"Origin\", \"#{@uri.scheme}://#{@uri.host.split('.')[-2..-1].join('.')}\"\n\n @driver.on :connect, ->(_e) {}\n\n @driver.on :open, ->(_e) do\n send \"155-questions-active\"\n @super_logger.info \"Socket open. Subscribed to 155-questions-active\"\n @logger.info \"WebSocket is open!\"\n end\n\n @driver.on :message do |e|\n @logger.info(\"Read: #{e.data}\")\n data = JSON.parse(e.data)\n if data[\"action\"] == \"hb\"\n send \"hb\"\n else\n @handler.call(data)\n end\n end\n\n @driver.on :close, ->(_e) do\n @logger.info \"Realtime WebSocket is closing.\"\n @super_logger.info \"Socket was closed. @restart == #{@restart}\"\n if @restart\n @logger.info \"Attempting to reopen websocket...\"\n @super_logger.info \"Attempting to reopen socket\"\n @driver.start\n end\n end\n\n @driver.on :error, ->(e) { @logger.error e }\n\n @driver.start\n\n @dead = false\n @thread = Thread.new do\n trap(\"SIGINT\") do\n @restart = false\n @dead = true\n @super_logger.info \"Got SIGINT. Dying.\"\n close\n Thread.exit\n end\n begin\n @driver.parse(@socket.is_a?(TCPSocket) ? @socket.recv(1) : @socket.sysread(1)) until @dead\n rescue IOError, SystemCallError => e\n @super_logger.warn \"Got some kind of interrupt in the thread. Panic.\"\n @logger.warn \"Recieved #{e} closing TCP socket. You shouldn't be worried :)\"\n end\n @super_logger.warn \"Left TCPSocket.recv loop. If you're reading this, panic.\"\n end\n\n at_exit { @thread.join }\n end",
"title": ""
},
{
"docid": "0192b258a30530e15af2c54d59274ece",
"score": "0.49643546",
"text": "def window\n @gtk_socket\n end",
"title": ""
},
{
"docid": "5718c41c789ff9575cdcba69c9327eaf",
"score": "0.4932515",
"text": "def em_connect()\n @mutex.synchronize do\n @wscon = WebSocket::EventMachine::Client.connect(:uri => @wsuri)\n end\n @wscon.comm_inactivity_timeout = 60\n\n @wscon.onopen do\n @status = :open\n end\n\n @wscon.onmessage do |data|\n EM.defer do\n packet = JSON.load(data)\n if @status == :open\n if packet.has_key? \"error\"\n LogService.warn \"packet error: #{packet[\"type\"]}, #{packet[\"error\"]}\"\n end\n \n if @callbacks.has_key? packet[\"type\"]\n @callbacks[packet[\"type\"]].each do |c|\n c.call(packet[\"data\"])\n end\n end\n end\n end\n end\n\n @wscon.onclose do |code, reason|\n if @status == :closing\n @status = :closed\n elsif @status == :open || @status == :opening\n @status = :opening\n EM.add_timer(10) do\n em_connect()\n end\n end\n end\n end",
"title": ""
},
{
"docid": "90f0c94c97cee9209ae65f1b063a48d6",
"score": "0.49229205",
"text": "def on_connected\n end",
"title": ""
},
{
"docid": "fae4de558925393a6af9ec9309ab0e53",
"score": "0.4899834",
"text": "def join_specific_table(data)\n\t\t@player_channel.publish({'table_id' => data['id'], 'command' => 'join_table'}.to_json)\n\tend",
"title": ""
},
{
"docid": "fae4de558925393a6af9ec9309ab0e53",
"score": "0.4899834",
"text": "def join_specific_table(data)\n\t\t@player_channel.publish({'table_id' => data['id'], 'command' => 'join_table'}.to_json)\n\tend",
"title": ""
},
{
"docid": "ed8defb9bf7da685899504986856c936",
"score": "0.4866926",
"text": "def notification\n request.websocket do |ws|\n ws.onopen do\n settings.sockets << ws\n end\n notifications\n ws.onclose do\n settings.sockets.delete(ws)\n end\n end\n end",
"title": ""
},
{
"docid": "bd2bb60b64c4f3ee82d96edf169f19b3",
"score": "0.48509574",
"text": "def on_message\n websocket_client.on(:message) do |event|\n websocket_response = websocket_response_data_class.new(\n data: event.data,\n bot_params_class: bot_params_class\n )\n\n bot.handle_data(websocket_response.bot_params) do |message|\n websocket_request = websocket_request_data_class.new(message: message, data: websocket_response.bot_params)\n websocket_client.send(websocket_request.data_to_send)\n end\n end\n end",
"title": ""
},
{
"docid": "a6b9d5a8ca6af05d44ec944bfd7f0c24",
"score": "0.48359832",
"text": "def socket\n @ws\n end",
"title": ""
},
{
"docid": "70a297b6191b69cad8579840734f404e",
"score": "0.4827762",
"text": "def run\n websocket.run\n end",
"title": ""
},
{
"docid": "0ac31d2de8dabf524969143d28471d86",
"score": "0.4821585",
"text": "def datasource_renderer\n js = []\n #lp = @log_proxy ||= OMF::Web::DataSourceProxy.for_source(:name => @log_table.name)[0]\n lp = @log_proxy ||= @oml_connector.log_adapter.data_source_proxy()\n js << lp.to_javascript()\n lp = @ec_proxy ||= @oml_connector.ec_adapter.data_source_proxy()\n js << lp.to_javascript()\n\n lp = @status_proxy ||= OMF::Web::DataSourceProxy.for_source(:name => @status_table.name)[0]\n js << lp.to_javascript()\n\n # TODO: What is this?????\n #js.gsub '/_update/', 'http://localhost:5000/_update/'\n\n js.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "85258d00094aa18984e8b983081f0530",
"score": "0.4819812",
"text": "def connect\n # Implement in subclass\n end",
"title": ""
},
{
"docid": "2dbf3c7317864923aa9b0a0c5f27d8e1",
"score": "0.48167798",
"text": "def connect\n end",
"title": ""
},
{
"docid": "7c8814f754c4e13f65704e1bbc283679",
"score": "0.48096472",
"text": "def refresh_tweets sender\n NSLog \"refresh_tweets\"\n self.grab_tweets do\n self.table.reloadData\n end\n end",
"title": ""
},
{
"docid": "ac56c802a499b9651d4b4f9f116d2743",
"score": "0.48044652",
"text": "def receive(websocket_message); end",
"title": ""
},
{
"docid": "25eff075345dc4bd58972405f001c211",
"score": "0.48032442",
"text": "def connect; end",
"title": ""
},
{
"docid": "ca1138be70f21243a934b8b6445874f0",
"score": "0.47998306",
"text": "def websocket port = nil\n host = @source[\"resource\"].first\n path = @source[\"resource\"][1..-1].join('/')\n if port.nil?\n connection_uri = \"ws://#{host}:#{@config.port.outbound}/#{path}\"\n else\n connection_uri = \"ws://#{host}:#{port}/#{path}\"\n end\n\n begin \n ws = EM::WebSocketClient.connect connection_uri\n ws.callback do \n ws.send_msg @source.to.json\n @config.logger.debug @source.to_s\n ws.close_connection_after_writing\n end\n rescue RuntimeError => e\n EM.run do\n ws = EM::WebSocketClient.connect connection_uri\n\n ws.callback do \n ws.send_msg @source.to.json\n @config.logger.debug @source.to_s\n ws.close_connection_after_writing\n end\n\n ws.disconnect do \n EM::stop_event_loop\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e41a437f2ddf56419c54d27ac5de5ba1",
"score": "0.4792626",
"text": "def _send_recordset\n puts \"Hello from send_recordset: \" + self.name.to_s\n render :js => update_recordset_js\n end",
"title": ""
},
{
"docid": "f9a47c4e4386c44896cd1c7d29367801",
"score": "0.47918114",
"text": "def update(widget_id, new_content)\n @widgets[widget_id] = new_content\n flush\n end",
"title": ""
},
{
"docid": "2c7e6a878b504812f2a4b9733c4e5b17",
"score": "0.47811484",
"text": "def run\n AMQP.start(:host => \"localhost\") {\n @mq = MQ.new\n @update_channel = EM::Channel.new\n @deferred_responses = {}\n\n @queue_name = \"cmdr:websocket:#{self.object_id}\"\n @queue = @mq.queue(@queue_name)\n \n # watch for responses from devices\n @queue.subscribe{|json|\n msg = JSON.parse(json)\n puts \"Got response: #{msg}\"\n if @deferred_responses[msg[\"id\"]]\n @deferred_responses.delete(msg[\"id\"]).succeed(msg)\n end\n }\n\n topic = @mq.topic(EVENT_TOPIC)\n @mq.queue(\"cmdr:websocket:#{self.object_id}:response\").bind(topic, :key => \"device.*\").subscribe do |json|\n handle_event json\n end\n\n setup\n\n EM::WebSocket.start({\n :host => \"0.0.0.0\",\n :port => 8000,\n :debug => false\n #:secure => true \n }) do |ws|\n\n ws.onopen { onopen ws }\n \n ws.onmessage {|json| onmessage ws, json}\n \n ws.onclose do\n @update_channel.unsubscribe(@sid) if @sid\n DaemonKit.logger.debug \"Connection on #{ws.signature} closed\"\n end\n\n ws.onerror do\n DaemonKit.logger.debug \"Error on #{ws.signature}\"\n end\n end\n }\n end",
"title": ""
},
{
"docid": "7c288adf0edee70275d5237d59ff5ff7",
"score": "0.47805613",
"text": "def db_widget_dd_done\n assert_privileges(\"db_delete\")\n\n set_edit_new_cols\n db_available_widgets_options\n render :update do |page|\n page << javascript_prologue\n changed = (@edit[:new] != @edit[:current])\n if params[:widget]\n page.replace(\"form_div\", :partial => \"db_form\")\n # url to be used in url in miqDropComplete method\n page << \"ManageIQ.widget.dashboardUrl = 'report/db_widget_dd_done'\"\n page << \"miqInitDashboardCols();\"\n end\n page << javascript_for_miq_button_visibility(changed)\n page << \"miqSparkle(false);\"\n end\n end",
"title": ""
},
{
"docid": "1f0c9b281ba6332f2a66ff067f37d886",
"score": "0.4773151",
"text": "def list_data_changed\n if row_count == 0 # added on 2009-02-02 17:13 so cursor not hanging on last row which could be empty\n init_vars\n @current_index = 0\n set_form_row\n end\n @widget_scrolled = true # 2011-10-15 \n @repaint_required = true\n end",
"title": ""
},
{
"docid": "3dbc514ae06713c891aef16434e04db3",
"score": "0.47579658",
"text": "def connect!; end",
"title": ""
},
{
"docid": "3dbc514ae06713c891aef16434e04db3",
"score": "0.47579658",
"text": "def connect!; end",
"title": ""
},
{
"docid": "f4a0c867d33fd4632057513fdcdde858",
"score": "0.4757438",
"text": "def post_init\n self.dispatch_event(:on_connect, [self])\n self.send_data(SyncMessage.new($listen_port, $uuid).to_sendable)\n end",
"title": ""
},
{
"docid": "9886c96ce9621e93068a42414de484be",
"score": "0.47543654",
"text": "def web_socket(conditions = {})\n @web_sockets[conditions[:client_id]]\n end",
"title": ""
},
{
"docid": "34d515e4e9a3647ff6a588d13bf2f908",
"score": "0.4750412",
"text": "def openws(*)\n super\n end",
"title": ""
},
{
"docid": "72229817f5577aaf74bd6c4dae33bc3f",
"score": "0.47355244",
"text": "def init_event_handlers\n #begin the client session by attempting to connect to the server\n self.onopen = lamda {self.connect()}\n\n self.onmessage = lambda do |event|\n\n data = JSON.parse(event.data)\n\n if data.has_key? 'msg'\n\n case(data['msg'])\n\n #successfull connection!\n when 'connected'\n self.connect.call event\n\n #inserts the given data into the client datastore\n when 'addad'\n if data.has_key? 'collection'\n c_name = data['collection']\n c_id = data['id']\n @collections[c_name] ||= {}\n data['params'].each { |k,v| @collections[c_name][c_id][k] = v }\n end\n\n #update the given data in the clients datastore\n when 'changed'\n if data.has_key 'collection'\n c_name = data['collection']\n c_id = data['id']\n c_fields = data['fields']\n to_clear = data['cleared']\n\n #clear out fields specified at 'cleared'\n to_clear.each do |f|\n @collections[c_name][c_id][f].delete f\n end\n #insert/udpdate new data\n c_fields.each do |k,v|\n @collections[c_name][c_id][k] = v\n end\n\n end\n\n #remove the given data from the client's datastore\n when 'removed'\n if data.has_key 'collection'\n c_name = data['collection']\n c_id = data['id']\n @collections[c_name][c_id] = nil\n end\n\n when 'ready'\n #adds the document *before* that whose id is specified in the id\n #field of addedBefore\n when 'addedBefore'\n\n if data.has_key? 'collection'\n c_name = data['collection']\n c_id = data['id']\n before = data['before']\n\n @collections[c_name] ||= {}\n #adds before if non-null\n if before\n data['params'].each { |k,v| @collections[c_name][c_id-1][k] = v }\n else\n data['params'].each { |k,v| @collections[c_name][c_id][k] = v }\n end\n end\n\n when 'movedBefore'\n if data.has_key? 'collection'\n c_name = data['collection']\n c_id = data['id']\n before = data['before']\n\n @collections[c_name] ||= {}\n #adds before if non-null\n if before\n data['params'].each { |k,v| @collections[c_name][c_id-1][k] = v }\n else\n data['params'].each { |k,v| @collections[c_name][c_id][k] = v }\n end\n end\n\n when 'ready'\n puts \"Server acks READY\"\n\n end #case\n end # msg?\n\n #there is no message ???\n\n self.on(:close) = lambda {|e| puts \"Connection Closed\"}\n end #message handler\n end",
"title": ""
},
{
"docid": "7562dd3e38c7ff13440fbbf09374fc33",
"score": "0.47273237",
"text": "def on_client_connect(client)\n end",
"title": ""
},
{
"docid": "3e083337c5cdf7072e143ef512e75f0e",
"score": "0.47247437",
"text": "def widget_data\n widget = WidgetService.widget(params[:widget_id])\n render json: {\n id: widget.id,\n dataset: widget.dataset,\n visualization: widget.widget_config,\n name: widget.name,\n description: widget.description,\n metadata: widget.metadata\n }\n end",
"title": ""
},
{
"docid": "31f27835ea369266077d00e72d177d7f",
"score": "0.47183987",
"text": "def on_open(ws, req)\n grid = Grid.find_by(token: req.env['HTTP_KONTENA_GRID_TOKEN'].to_s)\n if !grid.nil?\n node_id = req.env['HTTP_KONTENA_NODE_ID'].to_s\n\n logger.info \"node #{node_id} opened connection\"\n\n node = grid.host_nodes.find_by(node_id: node_id)\n labels = req.env['HTTP_KONTENA_NODE_LABELS'].to_s.split(',')\n unless node\n node = grid.host_nodes.create!(node_id: node_id, labels: labels)\n end\n\n node_plugger = Agent::NodePlugger.new(grid, node)\n client = {\n ws: ws,\n id: node_id.to_s,\n node_id: node.id,\n grid_id: grid.id,\n created_at: Time.now\n }\n @clients << client\n\n agent_version = req.env['HTTP_KONTENA_VERSION'].to_s\n unless self.valid_agent_version?(agent_version)\n logger.error \"version mismatch: server (#{Server::VERSION}), node (#{agent_version})\"\n node_plugger.send_master_info\n self.handle_invalid_agent_version(ws, node)\n return\n end\n\n EM.defer { node_plugger.plugin! }\n else\n logger.error 'invalid grid token, closing connection'\n ws.close(4001)\n end\n rescue => exc\n logger.error \"#{exc.class.name}: #{exc.message}\"\n end",
"title": ""
},
{
"docid": "dc31e9ae1a6830d4ffd8cb9b48fce1f3",
"score": "0.47165605",
"text": "def run\n connect\n end",
"title": ""
},
{
"docid": "fe9a31eff7d0a247937daac631fa72b8",
"score": "0.46820968",
"text": "def on_table(params = {})\n table = Yummi::Table::new params\n table.data = self\n return table\n end",
"title": ""
},
{
"docid": "778aef3176a096cd8ca6e8d3de05162f",
"score": "0.46708304",
"text": "def on_data_changed; end",
"title": ""
},
{
"docid": "9f2648f7db0c981f465922f23c67b78f",
"score": "0.46579754",
"text": "def widget_data\n widget = Widget.find(params[:widget_id])\n data = widget.get_filtered_dataset false, 10000\n render json: {id: widget.id,\n visualization: widget.visualization,\n name: widget.name,\n description: widget.description,\n data: data['data']}.to_json\n end",
"title": ""
},
{
"docid": "0963cc96cfc165d854f43673206c68fe",
"score": "0.46426818",
"text": "def create\n if widgets\n authorize! :create_impac_widgets, widgets.build(widget_create_params)\n\n if @widget = widgets.create(widget_create_params)\n MnoEnterprise::EventLogger.info('widget_create', current_user.id, 'Widget Creation', widget)\n @nocontent = true # no data fetch from Connec!\n render 'show'\n else\n render_bad_request('create widget', @widget.errors)\n end\n else\n render_not_found('widget')\n end\n end",
"title": ""
},
{
"docid": "452f0718944d1ea1717ced9c48e7aeb1",
"score": "0.46350983",
"text": "def rho_connect\n begin\n if @params['pid']\n @printer = Rho::PrinterZebra.getPrinterByID(@params['pid'])\n @printer.connect(url_for(:action => :printer_callback_connect))\n end\n rescue => ex\n jsmethod = 'Ruby.sendValueToJS(\"' + ex.message + '\")'\n Rho::WebView.executeJavascript(jsmethod)\n end\nend",
"title": ""
},
{
"docid": "66ef36792e0a49f5f6dc428890137819",
"score": "0.463395",
"text": "def nagammai_connection_data\n \n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : Entered in wondersoft_connection_data\"\n begin\n wonder_soft_data=WonderSoft.first\n render json: wonder_soft_data\n unless wonder_soft_data.present?\n Rails.logger.debug_log.debug { \"#{\"sync_setting data not available\"}\"}\n end\n rescue =>e\n Rails.logger.custom_log.error { \"#{e} sync_setting_controller wondersoft_connection_data method\" }\n end\n end",
"title": ""
},
{
"docid": "a32ec4baccf8573df436ab8e1efe8a48",
"score": "0.4630184",
"text": "def viewAllBookings \n @SocketHandle.puts \"Bookings : \" + BookingCatalogue.instance.viewAllBookings \n end",
"title": ""
},
{
"docid": "e313ba1113a758ebbc8cae26b9f7c608",
"score": "0.46296886",
"text": "def socket()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "6b7264d09a613aeccf0081dcf39dfbf8",
"score": "0.46215865",
"text": "def _get_dyn_table(console, address, payload = nil)\n if payload\n response = AJAX.post(console, address, payload)\n else\n response = AJAX.get(console, address)\n end\n response = REXML::Document.new(response)\n\n headers = _dyn_headers(response)\n rows = _dyn_rows(response)\n rows.map { |row| Hash[headers.zip(row)] }\n end",
"title": ""
},
{
"docid": "f807d2ec8a2e4c33eae7c6b65d58bac5",
"score": "0.46131733",
"text": "def windowDidResize n\n self.table.reloadData\n end",
"title": ""
},
{
"docid": "4ae2ed3ae19222ccc6b7dfebe8e13a48",
"score": "0.46095598",
"text": "def stocktable_ajax_handler\n if user_signed_in?\n Stock.connection.clear_query_cache\n @stocks_list = Stock.all\n update_partial_input('dalal_dashboard/partials/stock_partial', :@stocks_list, @stocks_list)\n \n data = {}\n data = load_data_with_partials(data)\n send_message :stocktable_ajax_handler, data\n else\n flash[:error] = \"You have encountered an unexpected error.Please login and Try again.\"\n redirect_to :action => 'index'\n end \n end",
"title": ""
},
{
"docid": "34d8188275425076251316a610cc9c42",
"score": "0.4607531",
"text": "def create\n @communicate = Communicate.new(communicate_params)\n\n respond_to do |format|\n if @communicate.save\n\n Socket.tcp(\"celluloid\", 8085) {|sock|\n sock.print communicate_params[:message]\n sock.close_write\n }\n format.js { render :show}\n format.html { redirect_to @communicate, notice: 'Communicate was successfully created.' }\n format.json { render :show, status: :created, location: @communicate }\n else\n format.html { render :new }\n format.js { render :new}\n format.json { render json: @communicate.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "49378cb659c7620422d554fbd84431c3",
"score": "0.46035665",
"text": "def connect\n super\n end",
"title": ""
},
{
"docid": "49378cb659c7620422d554fbd84431c3",
"score": "0.46035665",
"text": "def connect\n super\n end",
"title": ""
},
{
"docid": "ec0ea99d7243d82241fe8f351b6b49f7",
"score": "0.4583602",
"text": "def connect\n\tend",
"title": ""
},
{
"docid": "33c28b1f438ff0d87c7418e38bc9d404",
"score": "0.458087",
"text": "def send msg\n return unless @state == :state_inited\n @ws.send msg.to_json\n end",
"title": ""
},
{
"docid": "afc818dc5fa2eed4427d12f056e70621",
"score": "0.45795104",
"text": "def send_data(raw_data)\n encoded_message = encode(raw_data)\n Rails.logger.debug { \"#{Time.zone.now.getutc.inspect}: Sending to #{@socket.url}: #{encoded_message.inspect}\" }\n # Send the message to the WebSocket connection _immediately_\n # by scheduling it for the next execution of the EventMachine reactor run.\n # Otherwise, the message might be queued causing delays for users.\n EventMachine.next_tick do\n @socket.send(encoded_message)\n end\n end",
"title": ""
},
{
"docid": "e1f10abe948091af689b5429c5348629",
"score": "0.45776302",
"text": "def send_param(value)\n begin\n self.device.set_to(value)\n rescue Encoding::CompatibilityError => e\n puts \"Error: #{e}\"\n end\n # Update widget status\n @widget = self.class.find_by_id(self.id)\n @widget.status = value.to_i\n # Send the update to all running sessions\n unless ActionCable.server.logger.nil?\n ActionCable.server.broadcast 'widgets', {type: \"slider\", id: self.id, status: @widget.status}\n end\n end",
"title": ""
},
{
"docid": "594da9052ba74a959745963471a3faa8",
"score": "0.45658648",
"text": "def reconnect\n end",
"title": ""
},
{
"docid": "f80d834bc41918c94cba539c42be7f09",
"score": "0.45547754",
"text": "def notify_UI\n if self.state == 'start'\n Rho::WebView.executeJavascript('$(\"body\").trigger(\"onSyncStarted\");')\n end\n\n if self.state == 'in_progress'\n Rho::WebView.executeJavascript(\"$('body').trigger('onSyncSourceInProgress', '#{self.source_name}');\")\n end\n\n if self.state == 'ok'\n Rho::WebView.executeJavascript(\"$('body').trigger('onSyncSourceCompleted', '#{self.source_name}');\")\n end\n\n if self.state == 'complete'\n Rho::WebView.executeJavascript(\"$('body').trigger('onSyncCompleted', '#{formatted_time}');\")\n end\n\n if self.state == 'error'\n Rho::WebView.executeJavascript(\"$('body').trigger('onSyncError');\")\n end\n\n end",
"title": ""
},
{
"docid": "2a1587c486641ef7bfcc7f7256001406",
"score": "0.4546667",
"text": "def created()\n # @@data is set up by app.html.rb\n Server.data = @@data\n end",
"title": ""
},
{
"docid": "2f1272616e893063a1224190694523b2",
"score": "0.45465297",
"text": "def data_channel_open\n puts \"Data channel open!\"\n data_channel = $$.data_channel\n # send_message(\"ALIVE\")\nend",
"title": ""
},
{
"docid": "0518b24e19ae927e12bb85f7ff061e7e",
"score": "0.45373952",
"text": "def on_refresh\n reload_bundles(true)\n stop_refreshing\n update_table_data\n end",
"title": ""
},
{
"docid": "bec05de85c11ed7ec17b5a4ae0ed1956",
"score": "0.4535667",
"text": "def javascript()\n\n\"\nvar ws = new WebSocket('ws://127.0.0.1:55000/');\nws.onopen = function() {\n console.log('CONNECT');\n ws.send('subscribe to topic: udr/controller');\n};\nws.onclose = function() {\n console.log('DISCONNECT');\n};\nws.onmessage = function(event) {\n\n var a = event.data.split(/: +/,2);\n console.log(a[1]);\n\n try {\n r = eval(a[1]);\n }\n catch(err) {\n r = err.message;\n }\n\n ws.send('udr/browser: ' + r);\n\n};\n\"\n\n end",
"title": ""
},
{
"docid": "bec05de85c11ed7ec17b5a4ae0ed1956",
"score": "0.4535667",
"text": "def javascript()\n\n\"\nvar ws = new WebSocket('ws://127.0.0.1:55000/');\nws.onopen = function() {\n console.log('CONNECT');\n ws.send('subscribe to topic: udr/controller');\n};\nws.onclose = function() {\n console.log('DISCONNECT');\n};\nws.onmessage = function(event) {\n\n var a = event.data.split(/: +/,2);\n console.log(a[1]);\n\n try {\n r = eval(a[1]);\n }\n catch(err) {\n r = err.message;\n }\n\n ws.send('udr/browser: ' + r);\n\n};\n\"\n\n end",
"title": ""
},
{
"docid": "ca7d790a83519fb06701daf427ae4c32",
"score": "0.45277667",
"text": "def websocket\n @web_socket ||= WebSocket.new\n end",
"title": ""
},
{
"docid": "6176a3a6ddd3f730caec1c3ab3d115a6",
"score": "0.4526301",
"text": "def run_event_machine\n EventMachine.run do\n # ws = Current Web Socket.\n EventMachine::WebSocket.start(:host => '0.0.0.0', :port => port) do |ws|\n \n ws.onopen do\n prepare(ws)\n onopen\n end\n\n ws.onmessage do |mes|\n prepare(ws)\n onmessage mes\n end\n \n ws.onclose do\n prepare(ws)\n onclose\n end\n end\n end\n \n end",
"title": ""
},
{
"docid": "e8c116ab121e743397bb8d788a16c206",
"score": "0.45169404",
"text": "def send_message(data)\n\n #this is called by js script client side\n\n #The data local variable contains a hash \n #so we can access the message's body quite \n #easily to save it to the database:\n\n \n message_params = data['message'].each_with_object({}) do |el, hash|\n hash[el.values.first] = el.values.last\n end\n \n #creates a message based on passed params, \n #after message is saved to database it broadcasts itself to clients\n #(receive method on conversation js)\n \n Message.create(message_params)\n \n \n #or\n #current_user.messages.create(body: data['message'])\n \n #builds a hash that’s based on a passed data \n # and sends data to the front-end using the ActionCable.server.broadcast \n # method to the specified channel. \n # Data sent from this method is visible in the received method on the front-end.\n #ActionCable.server.broadcast(\n # \"conversations-#{current_user.id}\",\n # message: message_params\n #)\n\n\n\n #or (from medium tut)\n\n #sender = get_sender(data)\n #room_id = data['room_id']\n #message = data['message']\n\n #raise 'No room_id!' if room_id.blank?\n #convo = get_convo(room_id) # A conversation is a room\n #raise 'No conversation found!' if convo.blank?\n #raise 'No message!' if message.blank?\n\n # adds the message sender to the conversation if not already included\n #convo.users << sender unless convo.users.include?(sender)\n # saves the message and its data to the DB\n #Message.create!(\n # conversation: convo,\n # sender: sender,\n # content: message\n #)\n end",
"title": ""
},
{
"docid": "ca675d623f5251a80fed9cbcd6caedff",
"score": "0.45101672",
"text": "def sync\n @ws_thread.join\n end",
"title": ""
},
{
"docid": "ca675d623f5251a80fed9cbcd6caedff",
"score": "0.45101672",
"text": "def sync\n @ws_thread.join\n end",
"title": ""
},
{
"docid": "b949fb6730929a773854eb17dca275c8",
"score": "0.45090488",
"text": "def broadcast(event, data)\n #only keep the last 5000 Events\n if @history.size >= 6000\n @history.slice!(0, @history.size - 1000)\n end\n @lastEventId += 1\n @history << {id: @lastEventId, event: event, data: data}\n info \"Sending Event: #{event} Data: #{data} to #{@connections.count} Clients\"\n @connections.each do |socket|\n async.send_sse(socket, data, event, @lastEventId)\n end\n true\n end",
"title": ""
},
{
"docid": "8b32a34bd84cdb248629cf35bf774752",
"score": "0.45072854",
"text": "def new_websocket_client(client)\n\n msg \"connecting to: %s:%s\" % [@target_host, @target_port]\n tsock = TCPSocket.open(@target_host, @target_port)\n\n if @verbose then puts @@Traffic_legend end\n\n begin\n do_proxy(client, tsock)\n rescue\n tsock.shutdown(Socket::SHUT_RDWR)\n tsock.close\n raise\n end\n end",
"title": ""
},
{
"docid": "8ff602d1cb71120b3c5f38ba386b17a7",
"score": "0.45064363",
"text": "def connection\n ::SmartQue.establish_connection\n end",
"title": ""
},
{
"docid": "eb55794ecc0a78ccdfb8e907016b5f57",
"score": "0.45053378",
"text": "def new_connection; end",
"title": ""
},
{
"docid": "297fbbc9efddcd7416d8c319437f39f8",
"score": "0.45021993",
"text": "def get_data_flow_table\n data_flow_table = browser.table(:id, 'DataFlowTable').when_present(@time_out)\n end",
"title": ""
},
{
"docid": "2ab1cb5e35c5d1220dd664a2a57b10fe",
"score": "0.45006716",
"text": "def load_widget_data\n if @current_template && @account\n # Build query of only the necessary ids, from the widgets \n unless @current_template.required_article_ids.blank? \n @registers[:widget_data] = @current_template.parsed_widget_data( hash_by_id(Article.find_by_ids(@current_template.required_article_ids.reject{ |i| i.blank? }, :account_id => @account.account_resource_id)) )\n end\n end\n end",
"title": ""
},
{
"docid": "b701e5984dd24ded4507c43ce0edaef8",
"score": "0.44975275",
"text": "def feed(data)\n end",
"title": ""
},
{
"docid": "b701e5984dd24ded4507c43ce0edaef8",
"score": "0.44975275",
"text": "def feed(data)\n end",
"title": ""
},
{
"docid": "a548141099eff27190cef963a8b0419c",
"score": "0.44961852",
"text": "def do_data( data )\n update_local_window_size data\n callback :data, self, data\n end",
"title": ""
},
{
"docid": "16971058aad6002ef67f299c68dbc60f",
"score": "0.4491885",
"text": "def send_msg(data, ws)\n @@em.schedule { ws.send(data) }\n end",
"title": ""
},
{
"docid": "46d34f1c09c4cc24bc06419275f658a5",
"score": "0.44918534",
"text": "def on_connecting\n\t\t\t\t@@connected = false\n\t\t\t\tpublish('zk_connecting')\n\t\t\tend",
"title": ""
},
{
"docid": "e2709da7654d1eab01f5015a58c71ff1",
"score": "0.4489196",
"text": "def index\n @el_sockets = ElSocket.all\n end",
"title": ""
},
{
"docid": "e2709da7654d1eab01f5015a58c71ff1",
"score": "0.4489196",
"text": "def index\n @el_sockets = ElSocket.all\n end",
"title": ""
},
{
"docid": "16fc2bb03142aaf513632b14b2d3c9db",
"score": "0.44877413",
"text": "def send(data)\r\n @connected.callback { send_data data }\r\n end",
"title": ""
},
{
"docid": "16fc2bb03142aaf513632b14b2d3c9db",
"score": "0.44877413",
"text": "def send(data)\r\n @connected.callback { send_data data }\r\n end",
"title": ""
},
{
"docid": "38e6b516d4980b5b2f12801185918f19",
"score": "0.44862",
"text": "def connect\n if @connected\n block_given? and yield Exception.new 'mailbox has already connected'\n return\n end\n\n begin\n @ws = WebSocket::EventMachine::Client.connect :uri => 'ws://' + @host + ':' + @port.to_s\n @ws.onopen {\n return if @connected\n @connected = true\n @timer = EM.add_periodic_timer(@interval) { flush } if @buffer_msg\n block_given? and yield\n }\n\n @ws.onmessage { |msg, type|\n process_msg msg, type\n }\n\n @ws.onerror { |err| }\n @ws.onclose { |code, reason|\n emit :close, @id\n }\n rescue => err\n block_given? and yield err\n end\n end",
"title": ""
},
{
"docid": "97e2440e52b076bd9af1c245bc1f8beb",
"score": "0.44794694",
"text": "def knx_update(status)\n # Find widget for actual device\n @widget = self.class.find_by_id(self.id)\n # Update widget status\n @widget.status = case status\n when Float\n \"%8.2f\" % [status]\n else\n status.to_s\n end\n # Send the update to all running sessions\n unless ActionCable.server.logger.nil?\n ActionCable.server.broadcast 'widgets',\n {type: \"textField\", id: self.id, status: @widget.status,\n dpt: @widget.dpt, desc: @widget.desc}\n end\n end",
"title": ""
},
{
"docid": "263699497aaf17e9b02c47cc6fcbe1df",
"score": "0.44742444",
"text": "def requester_run(hb, body)\n @body = body\n rtcsignaloutput = []\n rtcmanagementoutput = []\n\n # Get all RTCSignals for this browser\n BeEF::Core::Models::Rtcsignal.where(:target_hooked_browser_id => hb.id, :has_sent => \"waiting\").each { |h|\n # output << self.requester_parse_db_request(h)\n rtcsignaloutput << h.signal\n h.has_sent = \"sent\"\n h.save\n }\n\n # Get all RTCManagement messages for this browser\n BeEF::Core::Models::Rtcmanage.where(:hooked_browser_id => hb.id, :has_sent => \"waiting\").each {|h|\n rtcmanagementoutput << h.message\n h.has_sent = \"sent\"\n h.save\n }\n\n # Return if we have no new data to add to hook.js\n return if rtcsignaloutput.empty? and rtcmanagementoutput.empty?\n\n config = BeEF::Core::Configuration.instance\n ws = BeEF::Core::Websocket::Websocket.instance\n\n # todo antisnatchor: prevent sending \"content\" multiple times. Better leaving it after the first run, and don't send it again.\n #todo antisnatchor: remove this gsub crap adding some hook packing.\n # The below is how antisnatchor was managing insertion of messages dependent on WebSockets or not\n # Hopefully this still works\n if config.get(\"beef.http.websocket.enable\") && ws.getsocket(hb.session)\n \n rtcsignaloutput.each {|o|\n add_rtcsignal_to_body o\n } unless rtcsignaloutput.empty?\n rtcmanagementoutput.each {|o|\n add_rtcmanagement_to_body o\n } unless rtcmanagementoutput.empty?\n # ws.send(content + @body,hb.session)\n ws.send(@body,hb.session)\n #if we use WebSockets, just reply wih the component contents\n else # if we use XHR-polling, add the component to the main hook file\n rtcsignaloutput.each {|o|\n add_rtcsignal_to_body o\n } unless rtcsignaloutput.empty?\n rtcmanagementoutput.each {|o|\n add_rtcmanagement_to_body o\n } unless rtcmanagementoutput.empty?\n end\n\n end",
"title": ""
},
{
"docid": "7cfd0a9d83dfdcfe0e24166db9377597",
"score": "0.4471597",
"text": "def open(event)\n Firehose.logger.debug \"WebSocket subscribed to `#{@req.path}`. Waiting for message_sequence...\"\n end",
"title": ""
},
{
"docid": "72832ffd058c1e5e4b191b7bc393d809",
"score": "0.44713682",
"text": "def on_message_data_event(ctx); end",
"title": ""
}
] |
17ae095d94d7ce817487cafcc9dbb291
|
TODO: refactor, duplicated in projects_controller
|
[
{
"docid": "d5828c4a7156c2519a53d4abb0eece3c",
"score": "0.0",
"text": "def find_optional_project\n return true unless params[:id]\n @project = Project.find(params[:id])\n authorize\n rescue ActiveRecord::RecordNotFound\n render_404\n end",
"title": ""
}
] |
[
{
"docid": "dfda27747394b2bf6d76ca669d0843f4",
"score": "0.69635",
"text": "def projects ; get_projects ; end",
"title": ""
},
{
"docid": "40c825fb8f5d44b04deeefb589ac9a6a",
"score": "0.6679006",
"text": "def index\n # Get the projects to display according to the role of the user\n if current_user.admin?\n @projects = Project.all\n print 'ADMIn PROJECT '[email protected]_s\n elsif current_user.manager?\n @projects = Project.where('project_manager_id=? OR project_owner_id=?', current_user.id, current_user.id)\n elsif current_user.company_admin?\n @projects = current_user.company.project_owned\n else\n @projects = current_user.project_owned\n end\n # Search and then sort\n if params[:search]\n @projects = @projects.search(params[:search]).order(sort_column + ' ' + sort_direction)\n end\n # Sort the projects\n @projects = @projects.order(sort_column + ' ' + sort_direction)\n end",
"title": ""
},
{
"docid": "5d3bb30b2872f093a064c140b595cb9d",
"score": "0.6676919",
"text": "def index\n # @projects = Project.search(params[:search])\n if params[:search]\n @current_user_projects = Project.where(\"created_by_id = ? \",current_user.id )\n @projects = @current_user_projects.where('name LIKE ?', \"%{params[:search]}%\")\n # @projects = @current_user_projects.where(\"name like ?\", \"%r%\")\n else\n if params[:key] == \"personal\"\n @projects = Project.where(\"created_by_id = ? \",current_user.id )\n elsif params[:key] == \"shared\"\n @user = current_user\n @projects = @user.projects.where(\"created_by_id != ? \",current_user.id )\n # @projects = @user.projects.where(\"created_by_id = ? \", current_user.id).where(\"created_by != ? \" ,\"client\")\n elsif params[:key] == \"client\"\n @user = current_user\n @projects = @user.projects.where(:created_by =>\"client\" )\n else\n @projects = Project.where(\"created_by_id = ? \",current_user.id )\n end\n end \n authorize! :read, @projects\n # @projects = Project.all\n end",
"title": ""
},
{
"docid": "84dd71a51efc1509745030aeefc5e61e",
"score": "0.6666445",
"text": "def index\n @projects = Project.all\n #@projects = current_user.projects\n ###\n #@projects = current_user.projects unless current_user.nil?\n ###\n #if params\n #@project = current_user.projects.create(project_params)\n # if current_user.tasks.empty?\n # respond_to do |format|\n # format.html{ redirect_to new_project_task_path(Project.ids), :danger=>'You are not yet created any projects and tasks...'}\n # end\n # else \n ###\n @task = current_user.tasks.find_by(params[:project_id]) unless current_user.tasks.nil?\n #@credit = current_user.credit_checkers.find_by(param[:project_id]) unless current_user.credit_checkers.nil?\n ###\n # end\n #@task = current_user.tasks.find_by(params[:project_id])\n #================\n end",
"title": ""
},
{
"docid": "c4bd3eb98dd6eeea8fcc2bbf6f750db0",
"score": "0.6648183",
"text": "def find_project\n \n=begin @project = Project.find(params[:id])\n \n Questa linea è stata commentata, poichè adesso in tutte le operazioni che implicano \n reading di un progetto dal database, devo controllare i permessi. In questo caso allora,\n voglio restringere una find() in modo che dal database vengano letti solo i record su\n cui l'utente corrente ha dei permessi.\n \n Questo obiettivo si raggiunge con gli SCOPEs di ActiveRecord. Si deve cioè utilizzare\n ActiveRecord#scope. Questo metodo sostanzialmente fornisce un meccanismo per definire \n un metodo, che possiamo invocare nella nostra classe del MODEL (Project),oppure in una collezione\n relativa ad un'associazione (che comunque si comporta come una classe del MODEL), per ritornare\n un sottoinsieme di records e non tutti quelli possibili. \n \n \n=end\n @project = Project.for(current_user).find(params[:id]) \n rescue ActiveRecord::RecordNotFound\n flash[:alert] = \"The project you were looking for could not be found.\"\n redirect_to projects_path \n end",
"title": ""
},
{
"docid": "7a769fbdab6e60b84eecb27a83ec92f6",
"score": "0.6628329",
"text": "def index\n # if current_user\n # @projects = Project.load_projects(research_group_id: params[:research_group_id], page: params[:page])\n # else\n\n end",
"title": ""
},
{
"docid": "4c0d61d23425db8ec53ac7f7c1387ba1",
"score": "0.66263527",
"text": "def manage\n# logger.debug( \"* Manage Project ID: #{params[:id]}\" )\n @project_id = params[:id]\n project = Project.find_by_id( @project_id )\n redirect_to( projects_path() ) and return unless project\n\n @project_name = project.name\n @default_currency_id = ( project.le_currency_id ? project.le_currency_id : project.get_default_currency_id() )\n @current_team_id = ( project.team_id ? project.team_id : nil )\n @default_human_resource_id = ( project.team ? project.team.get_first_human_resource_id() : nil )\n # Compute the filtering parameters:\n ap = AppParameter.get_parameter_row_for( :projects )\n @max_view_height = ap.get_view_height()\n # Having the parameters, apply the resolution and the radius backwards:\n start_date = DateTime.now.strftime( ap.get_filtering_resolution )\n # Set the (default) parameters for the scope configuration: (actual used value will be stored inside component_session[])\n @filtering_date_start = ( Date.parse( start_date ) - ap.get_filtering_radius ).strftime( AGEX_FILTER_DATE_FORMAT_SQL )\n @filtering_date_end = ( Date.parse( start_date ) + ap.get_filtering_radius ).strftime( AGEX_FILTER_DATE_FORMAT_SQL )\n @context_title = \"#{I18n.t(:manage_project)} '#{@project_name}'\"\n end",
"title": ""
},
{
"docid": "7c52cb88935038cff8da934ab01754fb",
"score": "0.6620006",
"text": "def index\n if current_user.authorize == \"super\" || current_user.authorize == \"admin\"\n @projects = Project.order(\"ID DESC\").paginate(:page => params[:page], :per_page => 10)\n\n @projects = Project.search(params[:search]).order(\"ID DESC\").paginate(:page => params[:page], :per_page => 10)\n else\n current_user_project = current_user.curriculums\n\n if current_user_project != nil\n curriculum_ids = []\n current_user_project.each do |curriculum|\n curriculum_ids.push(curriculum.project)\n end\n @projects = Project.where(:id => curriculum_ids).where.not(:finish => true).order(\"ID DESC\").paginate(:page => params[:page], :per_page => 10)\n \n @projects = Project.where(:id => curriculum_ids).search(params[:search]).where.not(:finish => true).order(\"ID DESC\").paginate(:page => params[:page], :per_page => 10)\n end\n end\n \n @project = Project.new\n end",
"title": ""
},
{
"docid": "4acad17b5d995e56ade6fcc9937b9542",
"score": "0.65881044",
"text": "def project_index\n authorize_user! @project = Project.find(params[:project_id].to_i)\n end",
"title": ""
},
{
"docid": "f6168359fb525573fad87de576ce3a9b",
"score": "0.6587445",
"text": "def select_project_for_collaboration\n # List all project where the curret user has project_membership \n @projects = current_user.get_all_enlisted_project\n \n end",
"title": ""
},
{
"docid": "a23bd93352fd4efaf7f158a637becc3d",
"score": "0.65649104",
"text": "def index\n if current_user.workgroup == 'Administrators'\n @projects = Project.all\n elsif ['Users','Project Managers'].include? current_user.workgroup\n #role = Role.where(user: current_user).ids\n @projects = Project.find Role.where(user: current_user).pluck :project_id\n else\n @projects = Project.where(id: 0)\n end\n end",
"title": ""
},
{
"docid": "ad93b0ac5c7f22a6a927d6c73e709bb1",
"score": "0.65615404",
"text": "def index\n # The get_user_lead_projects and get_user_editor_projects both return nil if no projects exist \n \t@lead_projects = User.get_user_lead_projects(current_user)\n \t@collab_projects = User.get_user_editor_projects(current_user)\n\n # Sort the projects by created_at date as default for presentation\n @lead_projects.sort!{|a, b| a.created_at <=> b.created_at} unless @lead_projects.nil?\n @collab_projects.sort!{|a, b| a.created_at <=> b.created_at} unless @collab_projects.nil?\n \tif User.hasAdminRights(current_user)\n \t\t@all_projects = Project.find(:all)\n @all_projects.sort!{|a,b| a.created_at <=> b.created_at} unless @all_projects.empty?\n \tend\t\n clearSessionProjectInfo()\n end",
"title": ""
},
{
"docid": "f78df68286eb3e47bc87affe7b908d21",
"score": "0.6556224",
"text": "def index\n sort_order = sort_order(Project)\n sourcedb, sourceid, serial, id = get_docspec(params)\n if sourcedb\n @doc = Doc.find_by_sourcedb_and_sourceid_and_serial(sourcedb, sourceid, serial)\n if @doc\n @projects = @doc.projects.accessible(current_user).order(sort_order)\n else\n @projects = nil\n notice = t('controllers.projects.index.does_not_exist', :sourcedb => sourcedb, :sourceid => sourceid)\n end\n else\n if params[:text]\n text = \"%#{ params[:text].downcase }%\" \n @projects = Project.accessible(current_user).includes(:user).where(['LOWER( name ) like ? OR LOWER( description ) like ? OR LOWER( author ) like ? OR LOWER( users.username ) like ?', text, text, text, text]).order(sort_order).page(params[:page])\n flash[:notice] = t('controllers.projects.index.not_found') if @projects.blank?\n else\n @projects = Project.accessible(current_user).order(sort_order).page(params[:page])\n end\n end\n\n @projects_total_number = Project.accessible(current_user).length\n\n respond_to do |format|\n format.html {\n if @doc and @projects.blank?\n redirect_to home_path, :notice => notice\n end\n }\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "39265d8ad0512aac37aad0eb4cd0b4c0",
"score": "0.6553817",
"text": "def projects\n\n\t\t@projects = Project.find_all_by_status(Project.status[:running])\n\t\t@categories = grab_categories( @projects )\n\t\t@locations = grab_locations( @projects )\n\n # this part is for featured projects\n # currently, there are Recently Started, Ending Soon, and Small Projects\n # this section can be extended to grab different features\n # based on different criteria\n\t\tif params[:featured]\n\t\t\t@featured = params[:featured]\n\t\t\tfeatures = get_featured\n\n\t\t\tif params[:featured] == features[:recent]\n\t\t\t\t@projects = Project.order('startdate').find_all_by_status(Project.status[:running]).reverse\n\n\t\t\t\tif @projects.length == 0\n\t\t\t\t\tflash[:error] = \"There are no projects in this feature!\"\n\t\t\t\t\tredirect_to root_url and return\n\t\t\t\tend\n\n\t\t\telsif params[:featured] == features[:ending]\n\t\t\t\t@projects = Project.find_all_by_status(Project.status[:running])\n\t\t\t\[email protected]! { |x,y|\n\t\t\t\t\tx.startdate + x.duration.days <=> y.startdate + y.duration.days\n\t\t\t\t}\n\t\t\telsif params[:featured] == features[:small]\n\t\t\t\t@projects = Project.where(\n\t\t\t\t\t\t\"status = :status AND target_amount < 1000\",\n\t\t\t\t\t\t{:status => Project.status[:running]}\n\t\t\t\t).all\n\t\t\tend\n\n\t\t\tif @projects.length == 0\n\t\t\t\tflash[:error] = \"There are no projects in this feature!\"\n\t\t\t\tredirect_to :action => :projects, :featured => get_featured[:recent] and return\n\t\t\tend\n\n # grabs projects based on a category\n\t\telsif params[:category]\n\t\t\t@projects = Project.find_all_by_category_and_status(params[:category], Project.status[:running])\n\t\t\t@category = params[:category]\n\n\t\t\tif @projects.length == 0\n\t\t\t\tflash[:error] = \"There are no projects in this category!\"\n\t\t\t\tredirect_to :action => :projects, :featured => get_featured[:recent] and return\n\t\t\tend\n\n # grabs all projects based on a location\n\t\telsif params[:location]\n\t\t\tproj = Project.all\n\t\t\t@projects = Array.new\n\t\t\t@location = params[:location]\n\n\t\t\tproj.each do |p|\n\t\t\t\tif p.location[/#{params[:location]}/] != nil && p.status == Project.status[:running]\n\t\t\t\t\[email protected](p)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif @projects.length == 0\n\t\t\t\tflash[:error] = \"There are no projects in this location!\"\n\t\t\t\tredirect_to :action => :projects, :featured => get_featured[:recent] and return\n\t\t\tend\n\t\telse\n\t\t\tflash[:error] = \"There are no projects with this filter\"\n\t\t\tredirect_to :action => :projects, :featured => get_featured[:recent] and return\n\t\tend\n end",
"title": ""
},
{
"docid": "e1448d611743e2bb92ac54191459624b",
"score": "0.65488565",
"text": "def my_projects_all\n end",
"title": ""
},
{
"docid": "51eef33eb9a1e2efb635803bc94526de",
"score": "0.6541129",
"text": "def index\n #@projects = Project.all\n @projects = current_user.projects\n @projects_in = Project.where('id in (?)',\n ProjectMember.where('user_id in (?) and owner is false',\n current_user.id).pluck(:project_id))\n\n end",
"title": ""
},
{
"docid": "f0d526634062bcfaa9cecacbbdd20118",
"score": "0.65348095",
"text": "def index\n @projects = Project.all\n \n\n end",
"title": ""
},
{
"docid": "bc0f5c1e0eb61ea9e23e7b51ac8094ea",
"score": "0.6497669",
"text": "def index\n breadcrumb_for_projects(@project)\n semantic_breadcrumb @project.name, @project\n semantic_breadcrumb \"Entity Types\"\n @entity_types = @project.entity_types\n @projects = @user.projects.select('projects.*, project_users.role as role').where(\"projects.id != ?\", @project.id).order(\"name ASC\")\n end",
"title": ""
},
{
"docid": "ebf82bffd2d16f3c903f7fc792c4a85a",
"score": "0.64967555",
"text": "def new\n project = current_project\n \n @project = Project.new(:program_id => project.program_id, :project_description => project.project_description, :project_url => project.project_url, :show_application_doc => project.show_application_doc, :initiation_date => project.initiation_date, :submission_open_date => project.submission_open_date, :submission_close_date => project.submission_close_date, :review_start_date => project.review_start_date, :review_end_date => project.review_end_date, :project_period_start_date => project.project_period_start_date, :project_period_end_date => project.project_period_end_date, :status => project.status, :min_budget_request => project.min_budget_request, :max_budget_request => project.max_budget_request, :max_assigned_reviewers_per_proposal => project.max_assigned_reviewers_per_proposal, :max_assigned_proposals_per_reviewer => project.max_assigned_proposals_per_reviewer, :applicant_wording => project.applicant_wording, :applicant_abbreviation_wording => project.applicant_abbreviation_wording, :title_wording => project.title_wording, :category_wording => project.category_wording, :submission_category_description => project.submission_category_description, :effort_approver_title => project.effort_approver_title, :department_administrator_title => project.department_administrator_title, :is_new_wording => project.is_new_wording, :other_funding_sources_wording => project.other_funding_sources_wording, :show_project_cost => project.show_project_cost, :direct_project_cost_wording => project.direct_project_cost_wording, :show_submission_category => project.show_submission_category, :show_core_manager => project.show_core_manager, :show_cost_sharing_amount => project.show_cost_sharing_amount, :show_cost_sharing_organization => project.show_cost_sharing_organization, :show_received_previous_support => project.show_received_previous_support, :show_previous_support_description => project.show_previous_support_description, :show_committee_review_approval => project.show_committee_review_approval, :show_human_subjects_research => project.show_human_subjects_research, :show_irb_approved => project.show_irb_approved, :show_irb_study_num => project.show_irb_study_num, :show_use_nucats_cru => project.show_use_nucats_cru, :show_nucats_cru_contact_name => project.show_nucats_cru_contact_name, :show_use_stem_cells => project.show_use_stem_cells, :show_use_embryonic_stem_cells => project.show_use_embryonic_stem_cells, :show_use_vertebrate_animals => project.show_use_vertebrate_animals, :show_iacuc_approved => project.show_iacuc_approved, :show_iacuc_study_num => project.show_iacuc_study_num, :show_is_new => project.show_is_new, :show_not_new_explanation => project.show_not_new_explanation, :show_use_nmh => project.show_use_nmh, :show_use_nmff => project.show_use_nmff, :show_use_va => project.show_use_va, :show_use_ric => project.show_use_ric, :show_use_cmh => project.show_use_cmh, :show_other_funding_sources => project.show_other_funding_sources, :show_is_conflict => project.show_is_conflict, :show_conflict_explanation => project.show_conflict_explanation, :show_effort_approver => project.show_effort_approver, :show_department_administrator => project.show_department_administrator, :show_budget_form => project.show_budget_form, :show_manage_coinvestigators => project.show_manage_coinvestigators, :show_manage_biosketches => project.show_manage_biosketches, :require_era_commons_name => project.require_era_commons_name, :review_guidance_url => project.review_guidance_url, :overall_impact_title => project.overall_impact_title, :overall_impact_description => project.overall_impact_description, :overall_impact_direction => project.overall_impact_direction, :show_impact_score => project.show_impact_score, :show_team_score => project.show_team_score, :show_innovation_score => project.show_innovation_score, :show_scope_score => project.show_scope_score, :show_environment_score => project.show_environment_score, :show_budget_score => project.show_budget_score, :show_completion_score => project.show_completion_score, :show_other_score => project.show_other_score, :impact_title => project.impact_title, :impact_wording => project.impact_wording, :team_title => project.team_title, :team_wording => project.team_wording, :innovation_title => project.innovation_title, :innovation_wording => project.innovation_wording, :scope_title => project.scope_title, :scope_wording => project.scope_wording, :environment_title => project.environment_title, :environment_wording => project.environment_wording, :other_title => project.other_title, :other_wording => project.other_wording, :budget_title => project.budget_title, :budget_wording => project.budget_wording, :completion_title => project.completion_title, :completion_wording => project.completion_wording, :submission_modification_date => project.submission_modification_date, :show_abstract_field => project.show_abstract_field, :abstract_text => project.abstract_text, :show_manage_other_support => project.show_manage_other_support, :manage_other_support_text => project.manage_other_support_text, :show_document1 => project.show_document1, :document1_name => project.document1_name, :document1_description => project.document1_description, :show_document2 => project.show_document2, :document2_name => project.document2_name, :document2_description => project.document2_description, :show_document3 => project.show_document3, :document3_name => project.document3_name, :document3_description => project.document3_description, :show_document4 => project.show_document4, :document4_name => project.document4_name, :document4_description => project.document4_description, :show_composite_scores_to_applicants => project.show_composite_scores_to_applicants, :show_composite_scores_to_reviewers => project.show_composite_scores_to_reviewers, :show_review_summaries_to_applicants => project.show_review_summaries_to_applicants, :show_review_summaries_to_reviewers => project.show_review_summaries_to_reviewers )\n\n respond_to do |format|\n if is_admin? \n format.html # new.html.erb\n format.xml { render :xml => @project }\n else\n format.html { redirect_to(projects_path) }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d14e4dc1b77c6af7d3f286feda930ae0",
"score": "0.648032",
"text": "def index\n active_id = ProjectType.find_by_description(\"Active\").id\n delivered_id = ProjectType.find_by_description(\"Delivered\").id\n if @current_user.is_admin?\n @active_projects = Project.where(:projectTypeId => active_id)\n @delivered_projects = Project.where(:projectTypeId => delivered_id)\n elsif @current_user.is_affiliate?\n @active_projects = Project.where(:projectTypeId => active_id, :affiliateId => @current_user.id)\n @delivered_projects = Project.where(:projectTypeId => delivered_id, :affiliateId => @current_user.id)\n else\n @active_projects = Project.where(:projectTypeId => active_id, :customerId => @current_user.id)\n @delivered_projects = Project.where(:projectTypeId => delivered_id, :customerId => @current_user.id)\n end\n end",
"title": ""
},
{
"docid": "13e7603679ee83b0e4999209fc86df11",
"score": "0.6479773",
"text": "def involved_with_project\n ids = Array.new([])\n @projects = Project.all\n @project = Project.find(params[:id])\n @boards = Board.all\n @categories = Category.all\n @tasks = Task.all\n\n @projects.each do |pro| \n if pro.assigned_users.include?(current_user) || pro.user == current_user || current_user.is_admin == true\n ids << pro.id \n end\n end \n\n @boards.each do |board|\n project = board.project.id\n if board.assigned_users.include?(current_user) || board.user == current_user || current_user.is_admin == true\n ids << project \n end\n end\n \n @categories.each do |cat|\n project = cat.board.project.id\n if cat.assigned_users.include?(current_user) || cat.user == current_user || current_user.is_admin == true\n ids << project \n end\n end\n\n @tasks.each do |task|\n project = task.category.board.project.id\n if task.assigned_users.include?(current_user) || task.user == current_user || current_user.is_admin == true\n ids << project \n end\n end\n \n #Removes any repetetive projects from project id list\n ids_uniq = ids.uniq\n #redirects the user if they are not involved at all with that project or its contents\n if ids_uniq.include?(@project.id) == false \n redirect_to projects_path, flash: { error: \"You do not have permission to do that.\" }\n end\n end",
"title": ""
},
{
"docid": "8ea48b1f60cabc273ce00cc9f7b6d00c",
"score": "0.64778674",
"text": "def project_id; end",
"title": ""
},
{
"docid": "6663e731c31b8bbaa2e94caf22719514",
"score": "0.64704996",
"text": "def index\n @clients = Client.where('disable IS NULL').order(:name => :asc)\n @projects = Project.where(nil)\n @projects = @projects.passed(params[:archived]).paginate(page: params[:page]) if params[:archived].present?\n @projects = @projects.number(params[:number]).paginate(page: params[:page]) if params[:number].present?\n if params[:user_id].present?\n if (params[:user_id] == 'all')\n @projects = Project.where(nil).paginate(page: params[:page])\n else\n @projects = @projects.user(params[:user_id]).paginate(page: params[:page])\n end\n end\n @projects = @projects.search_name(params[:name]).paginate(page: params[:page]) if params[:name].present?\n @projects = @projects.client(params[:client_id]).paginate(page: params[:page]) if params[:client_id].present?\n @projects = @projects.create_date(params[:create_date], params[:create_date].to_date + 1.day).paginate(page: params[:page]) if params[:create_date].present?\n @projects = @projects.project_type(params[:project_type]).paginate(page: params[:page]) if params[:project_type].present?\n @projects = @projects.progress(params[:progress]).paginate(page: params[:page]) if params[:progress].present?\n @projects = @projects.status(params[:state]).paginate(page: params[:page]) if params[:state].present?\n @projects = @projects.prio(params[:priority]).paginate(page: params[:page]) if params[:priority].present?\n\n if ((!params[:archived].present? && !params[:number].present? && !params[:user_id].present? && !params[:name].present? && !params[:client_id].present? &&\n !params[:create_date].present? && !params[:project_type].present? && !params[:progress].present? && !params[:pstate] && !params[:priority]))\n sort = sort_column\n if current_user.manager?\n if sort === 'worker'\n @projects = Project.by_owner(current_user.id).joins(:worker).order('login' + \" \" + sort_direction).paginate(page: params[:page])\n else\n @projects = Project.by_owner(current_user.id).order( sort_column + \" \" + sort_direction).order(\"number ASC\").paginate(page: params[:page])\n end\n elsif current_user.crea?\n if sort === 'worker'\n @projects = Project.for_crea(current_user.id).joins(:worker).order('login' + \" \" + sort_direction).paginate(page: params[:page])\n else\n @projects = Project.for_crea(current_user.id).order(sort_column + \" \" + sort_direction).order(\"number ASC\").paginate(page: params[:page])\n end\n else\n if sort === 'worker'\n @projects = Project.fort_print().joins(:worker).order('login' + \" \" + sort_direction).paginate(page: params[:page])\n else\n @projects = Project.for_print().order(sort_column + \" \" + sort_direction).order(\"number ASC\").paginate(page: params[:page])\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a436074ae28e488129eb550eb10b781e",
"score": "0.646916",
"text": "def create\n \n #if params[:project][:code].blank?\n\n #else\n @project = Project.new(params[:project])\n @project.company_id = current_user.company_id\n @projects = Project.where(:company_id => current_user.company_id).order(\"code\")\n respond_to do |format|\n if @project.save\n set_current_revision = Revision.create(:project_id => @project.id, :user_id => current_user.id, :date => Date.today)\n #format.html { redirect_to(:controller => \"projects\", :action => \"manage_subsections\", :id => @project.id) }\n format.html { redirect_to(@project) }\n #format.xml { render :xml => @project, :status => :created, :location => @project }\n else\n @current_project = Project.where(\"company_id =?\", current_user.company_id).order(\"code\").first\n format.html { render :action => \"new\" }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n #end\n end",
"title": ""
},
{
"docid": "4f5bd1246c1311c7f7273e07283665ec",
"score": "0.64681053",
"text": "def index\n if current_user.role.eql?(\"Admin\") && current_user.client_company.company_name.eql?(\"Ambquad\")\n @projects = Project.all\n else\n @projects = current_user.client_company.projects rescue []\n end\n end",
"title": ""
},
{
"docid": "c1240ea6633a4776c1035b3cf0c92d5d",
"score": "0.6461554",
"text": "def index\n # @employee_projects = @project.employee_projects\n end",
"title": ""
},
{
"docid": "a499c9946ca162a86362c827680ba39d",
"score": "0.6454874",
"text": "def projects\n @status = params[:status] || 1\n\n scope = Project.status(@status).sorted\n scope = scope.like(params[:name]) if params[:name].present?\n\n ##########################################################\n # Smile specific #156114 Projects admin, show issues count\n scope = scope.having_parent(params[:parent]) if params[:parent].present?\n\n @project_count = scope.count\n ###########################################\n # Smile specific : paginator full namespace\n @project_pages = Redmine::Pagination::Paginator.new @project_count, per_page_option, params['page']\n @projects = scope.limit(@project_pages.per_page).offset(@project_pages.offset).to_a\n\n render :action => \"projects\", :layout => false if request.xhr?\n end",
"title": ""
},
{
"docid": "3bca49bc8857a739a57764fd56ef2297",
"score": "0.6451373",
"text": "def index\n @projects = Project.all\n @resources = Resource.all\n \n \n end",
"title": ""
},
{
"docid": "88b2ac3e6702a7c23b7869bb4f587b0b",
"score": "0.6446904",
"text": "def index\n #MTODO: Move this to a helper\n if !current_user.company.nil? && params[:active]\n @projects = current_user.company.projects.where(is_complete: true).where(is_template: nil).uniq\n elsif !current_user.company.nil?\n project_template_ids = Project.where(is_template: true).or(Project.where(is_default_template: true)).map{|e| e.id}\n @projects = current_user.company.projects.where.not(id: project_template_ids)\n elsif params[:active]\n @projects = current_user.projects.where(is_complete: true)\n else\n @projects = current_user.projects.uniq\n end\n if @projects.count == 0\n respond_to do |format|\n format.html { redirect_to new_project_path, notice: \"Create Your First Project ... Let's Get Started\" }\n end\n end\n end",
"title": ""
},
{
"docid": "99b5900298924a551c81bbe0aafcd048",
"score": "0.6438304",
"text": "def index\n @projecttasks = Projecttask.all\n #binding.pry\n @project = Project.find(params[:project_id])\n \n @users = User.all\n \n @pj_num = params[:project_id]#\n @member_list = Membership.where(project_id: @pj_num)\n #binding.pry\n \n\n end",
"title": ""
},
{
"docid": "d08a4d5203918468bf7368734e5dacb4",
"score": "0.64360374",
"text": "def project_for_client\n #if params[:client] is blank string then\n if params[:client] != \"\"\n #find the project based on the client id\n @projects = Project.where(client_id: \"#{params[:client]}\").collect{ |u| [u.name, u.id] }\n #else \n else\n #find all projects \n @projects = Project.getproject.collect{ |u| [u.name, u.id] } \n end \n end",
"title": ""
},
{
"docid": "f15089c0a5cd37a8ce3eca97bf8b786a",
"score": "0.6431851",
"text": "def index\n @current_projects = CurrentProject.all\n end",
"title": ""
},
{
"docid": "30cfea89128521e1c83597fca9edf4bf",
"score": "0.64315665",
"text": "def index\n #@projects = Project.select('name, description').where('user_id' = current_user.id)\n @projects = Project.where(user_id: current_user.id).to_a\n #puts @projects.inspect\n end",
"title": ""
},
{
"docid": "dc5569751b2773bfa8349cc53dfaefe9",
"score": "0.64272726",
"text": "def index\n # @projects = Project.all\n end",
"title": ""
},
{
"docid": "35d59055bd7bcd5d4c3a71a8f87cf7ae",
"score": "0.64211214",
"text": "def index \n @projects = current_user.projects.all\n @project = current_user.projects.new\n end",
"title": ""
},
{
"docid": "f84301d827e4984ded27d3351b312deb",
"score": "0.64197546",
"text": "def index\n @projects = Project.inspiring_projects_for current_user.id\n end",
"title": ""
},
{
"docid": "5802cf5eb457909731b68f71ad0cf23d",
"score": "0.6417978",
"text": "def index\n #if current_user.project.blank?\n # return redirect_to new_project_url\n #else\n return redirect_to current_user.project\n #end\n end",
"title": ""
},
{
"docid": "aa8fa17df9e6326d2eebb78d2dc52ad5",
"score": "0.6403634",
"text": "def projects\n raise NotImplementedError # subclass responsibility\n end",
"title": ""
},
{
"docid": "fa28fd2b7e7f9f3177ed6ad4265cf548",
"score": "0.64033645",
"text": "def index\n if params[:project_id].nil?\n @project_actions = ProjectAction.all\n else\n @project=Project.find(params[:project_id])\n @[email protected]_actions\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @project_actions }\n end\n end",
"title": ""
},
{
"docid": "7d1c8f605b9b6f158dc48cb9f72d9c70",
"score": "0.64030474",
"text": "def index_developer\n @projects = Project.all\n end",
"title": ""
},
{
"docid": "4996fafa9cbbf3cab2a8a06c1fd6c0ff",
"score": "0.6398671",
"text": "def projects\n @projects\n end",
"title": ""
},
{
"docid": "540d9605977dccd98c3bf9e8a21882e0",
"score": "0.63880056",
"text": "def new\n @project = Project.new\n @projects = Project.where(:company_id => current_user.company_id).order(\"code\")\n @[email protected]\n @project_templates = Project.where(:company_id => [1, current_user.company_id]).order(\"company_id, code\") \n\n end",
"title": ""
},
{
"docid": "593f2664f870a0a9f0a8c5e9b089ab5a",
"score": "0.6387175",
"text": "def update\n @project = current_user.projects.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(allowed_params)\n format.html { redirect_to(@project, :notice => t('projects.project was successfully updated')) }\n format.xml { head :ok }\n else\n format.html { ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n \"#{@project.name} - \" if @project \n t('fulcrum') \n csrf_meta_tag \n stylesheet_link_tag :application \n javascript_include_tag :application \n javascript_tag do \n I18n.default_locale \n I18n.locale \n end \n link_to t('fulcrum'), root_path \n if current_user \n ' class=\"secondary\"'.html_safe if current_user.projects.present? \n link_to Project.model_name.human(:count => 2), root_path \n if current_user.projects.present? \n current_user.projects.each do |project| \n link_to project, project \n end \n end \n link_to current_user.email, edit_user_registration_path \n link_to t('log out'), destroy_user_session_path,\n :method => :delete \n else \n link_to t('log in'), new_user_session_path \n unless Fulcrum::Application.config.fulcrum.disable_registration \n link_to t('sign up'), new_user_registration_path \n end \n end \n project.name \n if defined? show_column_toggles \n end \n link_to_unless_current Story.model_name.human(:count => 2), project_path(project) \n link_to_unless_current User.model_name.human(:count => 2), project_users_path(project) \n link_to_unless_current t('edit'), edit_project_path(project) \n link_to_unless_current t('import'), import_project_stories_path(project) \n link_to t('export'), project_stories_path(project, :format => :csv) \n show_messages \n \n t('projects.edit project') \n form_for(@project) do |f| \n t('errors.template.header', :count => object.errors.count, :model => object.class.name.humanize) \n object.errors.full_messages.each do |msg| \n msg \n end \n \n end \n \n\nend\n }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1901639c15f31a8d20d28068cb5e44c7",
"score": "0.63852584",
"text": "def set_project\n\nend",
"title": ""
},
{
"docid": "5b22f8e757202d5d22ff351b49158a17",
"score": "0.6384556",
"text": "def index\n # @projects= Project.all.order('created_at DESC').paginate(:page => params[:page])\n if params[:project_name]\n @projects= Project.where(:projectname => params[:project_name]).paginate(:page => params[:page])\n else\n @projects = Project.where( :is_active => true).order('created_at DESC').paginate(:page => params[:page])\n end\n #render json: @projects\n\n #@projects = Project.where( :is_active => true).order('created_at DESC').paginate(:page => params[:page])\n\n\n\n\n end",
"title": ""
},
{
"docid": "063dbc61fee5c7b3c4e482381d9dc109",
"score": "0.6380613",
"text": "def projects\n # @community = Community.find(params[:id])\n # @communities_user = CommunitiesUser.find(:first, :conditions => {:user_id => current_user.id, :community_id => params[:id]} ) \n # \n # respond_to do |format|\n # format.html\n # end \n end",
"title": ""
},
{
"docid": "3927471a4f80bdc94fccb2b79c0015f8",
"score": "0.6377567",
"text": "def create\n\n if create_single_project?\n @project = Project.create(project_params)\n @project.update_project\n @project.update_issues\n redirect_to collection_path(@project.collection_id)\n\n elsif create_all_orgs_projects?\n\n @projects = GithubOrganization.new(project_params[:url]).projects\n @projects.map do |gh_project|\n gh_project_params = {\n name: gh_project.name,\n description: gh_project.description,\n url: gh_project.html_url,\n collection_id: project_params[:collection_id]\n }\n project = Project.create(gh_project_params)\n project.update_issues\n end\n redirect_to collection_path(project_params[:collection_id])\n end\n\n end",
"title": ""
},
{
"docid": "532b6105624881fd38118a1f3a37cba7",
"score": "0.6373357",
"text": "def index\n if current_user.isAdmin?\n @incomplete_projects = Project.where(project_status_id: 1)\n @complete_projects = Project.where(project_status_id: 2)\n @accepted_projects = Project.where(project_status_id: 3, semester_id: session[:current_semester].id)\n @rejected_projects = Project.where(project_status_id: 4)\n\n respond_to do |format|\n format.html { render 'index_admin' }\n format.json { render json: @projects }\n end\n\n elsif current_user.isStudent?\n #TODO also limit by current semester\n @all_projects = Project.where(project_status_id: 3, semester_id: session[:current_semester].id)\n if current_user.is_owner?\n @available_projects = current_user.my_group.available_project_choices(session[:current_semester].id)\n else\n @available_projects = []\n end\n\n respond_to do |format|\n format.html { render 'index_student' }\n format.json { render json: @projects }\n end\n\n elsif current_user.isFaculty?\n @accepted_projects = current_user.approved_projects(session[:current_semester].id)\n @all_projects = Project.where(project_status_id: 3, semester_id: session[:current_semester].id)\n\n respond_to do |format|\n format.html { render 'index_faculty' }\n format.json { render json: @projects }\n end\n\n else\n @projects = Project.all\n respond_to do |format|\n format.html \n format.json { render json: @projects }\n end\n\n end\n end",
"title": ""
},
{
"docid": "0dfd250ae6c0afea9872ca7dd7aa6081",
"score": "0.63708687",
"text": "def create\n @project = current_user.projects.build(allowed_params)\n @project.users << current_user\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to(@project, :notice => t('projects.project was successfully created')) }\n format.xml { render :xml => @project, :status => :created, :location => @project }\n else\n format.html { ruby_code_from_view.ruby_code_from_view do |rb_from_view|\n \"#{@project.name} - \" if @project \n t('fulcrum') \n csrf_meta_tag \n stylesheet_link_tag :application \n javascript_include_tag :application \n javascript_tag do \n I18n.default_locale \n I18n.locale \n end \n link_to t('fulcrum'), root_path \n if current_user \n ' class=\"secondary\"'.html_safe if current_user.projects.present? \n link_to Project.model_name.human(:count => 2), root_path \n if current_user.projects.present? \n current_user.projects.each do |project| \n link_to project, project \n end \n end \n link_to current_user.email, edit_user_registration_path \n link_to t('log out'), destroy_user_session_path,\n :method => :delete \n else \n link_to t('log in'), new_user_session_path \n unless Fulcrum::Application.config.fulcrum.disable_registration \n link_to t('sign up'), new_user_registration_path \n end \n end \n t('projects.new project') \n show_messages \n \n form_for(@project) do |f| \n t('errors.template.header', :count => object.errors.count, :model => object.class.name.humanize) \n object.errors.full_messages.each do |msg| \n msg \n end \n \n end \n \n link_to 'Back', projects_path \n\nend\n }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dc2ea738e46dd38563a43092e1bd9366",
"score": "0.6364367",
"text": "def set_project\n \t @project = current_developer.projects.find(params[:id])\n \tend",
"title": ""
},
{
"docid": "2f1a276cb216658dae99fcd07e249996",
"score": "0.63567215",
"text": "def index \n @projects = current_user.projects\n end",
"title": ""
},
{
"docid": "f7bdeda46862f2f56a83ab0c829c428c",
"score": "0.63553864",
"text": "def index\n # @projects = Project.all\n @projects = @plan.projects\n # @plans = current_user.plans\n # @projects = current_user.projects\n # @tasks = current_user.tasks\n end",
"title": ""
},
{
"docid": "d4517083783b4222a952bcde2cbbb4a2",
"score": "0.63531244",
"text": "def index\n if !current_user.nil?\n @user=User.find(current_user.id)\n @[email protected](\"created_at desc\")\n @flag=check_project(@user.id)\n elsif !current_member.nil?\n @user=Member.find(current_member.id)\n @projects=Project.find(:all, :conditions=>[\"user_id=? or member_id=?\", @user.user_id, @user.id])\n @flag=check_project(@user.user_id)\n else\n redirect_to sign_in_url\n end\n\n\n end",
"title": ""
},
{
"docid": "5713462ebb8ef52e98ff67bd008520ba",
"score": "0.634816",
"text": "def create\n #@project = Project.new(params[:project])\n\n if(params[:project_id])\n @tmp_proj = Project.find(params[:project_id])\n @project = Project.new({user_id: @cur_user.id, title:\"#{@tmp_proj.title} (clone)\", content: @tmp_proj.content, filter: @tmp_proj.filter, cloned_from:@tmp_proj.id})\n success = @project.save\n @tmp_proj.fields.load.each do |f|\n Field.create({project_id:@project.id, field_type: f.field_type, name: f.name, unit: f.unit})\n end\n else\n if(!params.try(:[], :project_name))\n if @cur_user.lastname[0].downcase == 's'\n title = \"#{@cur_user.firstname} #{@cur_user.lastname[0]}' Project\"\n else\n title = \"#{@cur_user.firstname} #{@cur_user.lastname[0]}'s Project\"\n end\n @project = Project.new({user_id: @cur_user.id, title: title})\n else\n @project = Project.new({user_id: @cur_user.id, title: params[:project_name]})\n end\n success = @project.save\n end\n\n respond_to do |format|\n if success\n format.html { redirect_to @project, notice: 'Project was successfully created.'}\n format.json { render json: @project.to_hash(false), status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43dc818dec153ac6adbaca7f6b4e0d96",
"score": "0.6347552",
"text": "def index\n @user=current_user\n @projects [email protected]\n end",
"title": ""
},
{
"docid": "c1c7c57b2d00fddb53f81620d45922a0",
"score": "0.63457686",
"text": "def index\n @projects = Project.all \n end",
"title": ""
},
{
"docid": "ef245ac290f3e04923827e9a1e939a75",
"score": "0.6342338",
"text": "def index()\n @designer= Designer.find_by_email(current_designer.email) #Getting the logged in designer\n @projects = Project.find(:all, :conditions => {:designer_id => @designer.id}) #Getting all the projects done by the logged in designer\n end",
"title": ""
},
{
"docid": "17de0ac14922c051df736f4454ae17f6",
"score": "0.63413036",
"text": "def prepEditProject\n if params[:view]\n @projectUsers = ProjectUser.where(\"projectid= :projectid and userid = :userid and (edi =:edi or wri = :wri)\",\n {projectid:params[:view], userid:session[:authid], wri:true, edi:true})\n @project = Project.where(\"status = :status and userid = :userid and projectid = :projectid \",{projectid: params[:view], status: \"0\", userid: session[:authid]})\n if (@projectUsers.count >= 1 or @project.count >= 1)\n @project = Project.find_by(projectid: params[:view], status: \"0\")\n @users = User.find(session[:authid])\n @allMyPost = Project.where(\"status = :status and userid = :userid\", { status: \"0\", userid: session[:authid] }).limit(5).order(id: :desc) \n render 'editProject'\n else\n redirect_to userdashboardPage_path\n end\n else\n redirect_to userdashboardPage_path\n end\n end",
"title": ""
},
{
"docid": "908889e694eddd0d9f40ed7c9782f405",
"score": "0.6339848",
"text": "def index\n if current_user.super_admin?\n @projects= Project.all\n else\n @projects = Project.where(id: session[:projects]).order(:identifier)\n end\n end",
"title": ""
},
{
"docid": "00f9dc3ed0a2de513ed9a6b6cf69bd4c",
"score": "0.6334435",
"text": "def index\n\t\t# if Category.find_by(name: \"Development\")\n\t\t# \t@category_id = Category.find_by(name: \"Development\").id\n\t\t# \t@projects = Project.where(category: @category_id).order(\"created_at ASC\")\n\t\t# else\n\t\t\t@projects = Project.all\n\tend",
"title": ""
},
{
"docid": "999970c10862b5dafe88fffd7ffa0e64",
"score": "0.6327083",
"text": "def index\n if current_user.admin\n @projects = Project.all\n @user = current_user\n else\n @user = current_user\n # pr = Project.all.select{|i| i.user_ids.include?(@user.id.as_json.values[0])}\n @projects = Project.all.select{|i| i.user_ids.include?(@user.id.as_json.values[0])}\n end\n end",
"title": ""
},
{
"docid": "c981c4a10ac38e15e83d62ce54b5404b",
"score": "0.63270694",
"text": "def index\n project = Project.find(params[:project_id])\n redirect_to project_path(project)\n end",
"title": ""
},
{
"docid": "63eb5245dd74a561d303af248872d2a6",
"score": "0.6321196",
"text": "def index\n @backlink = root_path\n @projects = session_obj.projects\n @include_cool_font = @projects.map{|p|p.title.titleize}.join\n if @projects.empty?\n redirect_to new_project_path and return\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end",
"title": ""
},
{
"docid": "d6995943ebd6b645e736147204e81e82",
"score": "0.6314048",
"text": "def index\n get_projects()\n @h_statuses = {}\n Status.all.map{|s| @h_statuses[s.id] = s}\n @h_archive_statuses = {}\n ArchiveStatus.all.map{|s| @h_archive_statuses[s.id] = s}\n @h_organisms = {}\n Organism.all.map{|o| @h_organisms[o.id]=o}\n \n respond_to do |format|\n format.html { \n if params[:nolayout]\n render :partial => 'index'\n else\n if current_user\n render :layout => 'welcome'\n else\n @sandbox_project = Project.where(:key => session[:sandbox]).first\n render \"welcome\", :layout => 'welcome'\n end\n end\n }\n format.json { render json: @projects }\n end\n \n end",
"title": ""
},
{
"docid": "0b7b141f5db7ca2624427991e28bee92",
"score": "0.6312187",
"text": "def user_projects\n @projectLink = Project.where(:user_id => current_user.id)\n\tend",
"title": ""
},
{
"docid": "cc8ee13c07d4046d25987dfcac75c321",
"score": "0.6311146",
"text": "def project\n @students_project.project\n end",
"title": ""
},
{
"docid": "bf6d6c2216179b3d159b716ee4c9137e",
"score": "0.6310871",
"text": "def index\n # @projects = Project.all\n @projects = Project.includes(:author).where('author_id = ?',\n current_user.id).joins(:groups_projects).most_recent\n end",
"title": ""
},
{
"docid": "4ac78b7f4e2229b723c0a17bff2452d3",
"score": "0.6305816",
"text": "def find_project\n\t\t@project = Project.find(params[:project_id])\n\tend",
"title": ""
},
{
"docid": "4ac78b7f4e2229b723c0a17bff2452d3",
"score": "0.6305816",
"text": "def find_project\n\t\t@project = Project.find(params[:project_id])\n\tend",
"title": ""
},
{
"docid": "4ac78b7f4e2229b723c0a17bff2452d3",
"score": "0.6305816",
"text": "def find_project\n\t\t@project = Project.find(params[:project_id])\n\tend",
"title": ""
},
{
"docid": "4ac78b7f4e2229b723c0a17bff2452d3",
"score": "0.6305816",
"text": "def find_project\n\t\t@project = Project.find(params[:project_id])\n\tend",
"title": ""
},
{
"docid": "b2cfae543f432de45bb4f6c8c9831d79",
"score": "0.6302669",
"text": "def index\n if params[:construction_id]\n @construction = Construction.find(params[:construction_id])\n @projects = Project.where(construction: params[:construction_id]).order(id: :DESC)\n else\n @projects = Project.all.order(id: :DESC)\n end\n\n respond_to do |format|\n format.html \n format.json { render json: @projects.map { |c| c.as_json.merge({file_key: (c.file.key rescue nil ) }) }, status: 200 }\n end\n end",
"title": ""
},
{
"docid": "57541bbeeb5a5762518553bde12627f5",
"score": "0.62952954",
"text": "def index\n @projects = Project.all\n\n #make example to call the method on its model method\n #@projects = Project.almost_completed\n #@projects = Project.still_needs_some_work\n\n end",
"title": ""
},
{
"docid": "c0e6cd0173c948de9d64bb7f92e62d83",
"score": "0.6294606",
"text": "def index\n @projects = Project.published.order(created_at: :desc)\n @page_title = Project.model_name.human&.pluralize\n\n end",
"title": ""
},
{
"docid": "1d9f6c580bbe7eea70cf6c57071f2f94",
"score": "0.62937486",
"text": "def index\n respond_with(projects)\n end",
"title": ""
},
{
"docid": "0ad64d46634804b85ca33ad6752c14d5",
"score": "0.62917864",
"text": "def index\n @projects = Project.all.order('id DESC')\n @project = current_user.projects.build if current_user\n @user = current_user\n end",
"title": ""
},
{
"docid": "e42e0c58e09aa289632a8c5d864dba23",
"score": "0.6291387",
"text": "def index\n @owned_projects = Project.where('organization_id = ?', current_org_admin.organization.id)\n @contributing_scopes = Scope.where('contributor_id = ?', current_org_admin.organization.id)\n @contributing_projects = Project.find(@contributing_scopes.map(&:project_id).uniq)\n\n end",
"title": ""
},
{
"docid": "bbed4929cd91a429dc6eb13ecb2f58dd",
"score": "0.6289106",
"text": "def project_manip\n # Authenticate user first\n authenticate_user\n if (@current_user == nil) || (@current_user.acctype != \"coordinator\")\n flash[:notice] = \"You have an Industry Partner Account, NOT a Coordinator account.\"\n redirect_to :unauthorized\n end\n\n if params[:id] != nil\n @project = Project.find(params[:id])\n @show_action = params[:show_action]\n params[:state] = @project.status\n else\n redirect_to action: 'view'\n end\n end",
"title": ""
},
{
"docid": "7396d580999f17a896a123c8a86ee6bd",
"score": "0.62882215",
"text": "def index\n if logged_in? and admin?\n @projects = Project.all\n elsif logged_in?\n @user = current_user\n if @user.project_id\n @projects = Project.find([@user.project_id, @user.project_id])\n end\n else\n @projects = []\n end\n end",
"title": ""
},
{
"docid": "717a7d81a694c7ec8353e00bff00af13",
"score": "0.628807",
"text": "def show\n proj_users = ProjectUser.where(user_id: current_user.id)\n @ongoing_projects = []\n proj_users.each do |p_u|\n @ongoing_projects.push(Project.find(p_u.project_id))\n end\n\n #if proj.users_id.include?(@user.id)\n # @user_projects.push(proj)\n # end\n #end\n @user_ex_projects = []\n finished_prjects = Project.where(status: true)\n finished_prjects.each do |proj|\n if proj.users.include?(@user)\n @user_ex_projects.push(proj)\n end\n end\n\n end",
"title": ""
},
{
"docid": "aac7804d67a709683b251e066a1df364",
"score": "0.62879455",
"text": "def projects\n [project]\n end",
"title": ""
},
{
"docid": "aac7804d67a709683b251e066a1df364",
"score": "0.62879455",
"text": "def projects\n [project]\n end",
"title": ""
},
{
"docid": "552d7ac2c877b1870df070f4be1a8b27",
"score": "0.6280874",
"text": "def action_to_project\n\n\t\t# Only \"Submit New\" and \"Date Filter\" can proceed without a project selected\n\t\tif ( params[:commit]=='Submit New' )\n\t\t\tredirect_to new_submission_path\n\t\t\treturn\n\t\tend\n\n\t\tif ( params[\"Filter.x\"])\n\t\t\tshowList\n\t\t\trender :showList\n\t\t\treturn\n\t\tend\n\n\t\t# If user has not selected any project, back to main board with a message\n\t\tif params[:id] == nil\n\t\t\tshowList\n\t\t\tflash[:notice] = 'Select a project before applying your action!'\n\t\t\trender :my_projects\n\t\t\treturn\n\t\tend\n\n\t\t@project = Project.find(params[:project_id])\n\n\t\tif ( params[:commit]=='Edit' )\n\t\t\trender :edit\n\t\t\treturn\n\t\tend\n\n\t\tif ( params[:commit]=='Delete' )\n\t\t\tredirect_to delete_industry_project_path(:project_id => @project.id)\n\t\t\treturn\n\t\tend\n\n\t\tif ( params[:commit]=='Project Description')\n\t\t @des = true\n\t\t\t@log = false\n\t\t\tredirect_to industry_dashboard_path\n\t\t\treturn\n\t\tend\n\n\t\tif ( params[:commit]=='Message Log')\n\t\t\tshowList\n\t\t\t@des = false\n\t\t\t@log = true\n\t\t\t@message_log = @project.messages\n\t\t\trender :showList\n\t\t\treturn\n\t\tend\n\n\t\tif ( params[:commit] == 'Send')\n\t\t\tsend_message\n\t\tend\n\n\t\tshowList\n\t\trender :showList\n\tend",
"title": ""
},
{
"docid": "e5f9bd2a5c6e3f7a231b0ac3bdf7b0ca",
"score": "0.62797266",
"text": "def index\n @projects = Project.all\n\n end",
"title": ""
},
{
"docid": "9e26bad9c7f0f1e5d465c773073068b6",
"score": "0.62782073",
"text": "def projectoverview\n @npos = Npo.all\n @donations = Donation.all\n @subs = Subscriber.all\n @users = User.all\n @features = Feature.all\n @guests = Guest.all\n @projects = Project.all(:order => 'created_at DESC')\n end",
"title": ""
},
{
"docid": "6f9d7ff3207ef815ff0b1904272d46ce",
"score": "0.62777966",
"text": "def find_project\r\n\t\t@project = Project.find(params[:id])\t\t\r\n\tend",
"title": ""
},
{
"docid": "3477ab89300b3ac2d52bf7ac4eec6852",
"score": "0.6276872",
"text": "def index\n if params[:pid].blank?\n redirect_to projects_path\n else\n @project = Project.where(:id => params[:pid]).where(:user_id => current_user.id).first\n if @project.blank?\n redirect_to projects_path\n else\n @references = @project.references\n enter_project @project\n end\n end\n end",
"title": ""
},
{
"docid": "b922d6f812a47b6f2c3d07365aac0b9c",
"score": "0.6274342",
"text": "def show\n # @project = @user.projects.find(params[:id])\n # @project = set_project\n\n\n\n # @project_list = Issue.find_by project_id: @project\n # Issue.find_each do |issue|\n # pp issue[:item]\n # end\n\n # pp @project_list[:item]\n end",
"title": ""
},
{
"docid": "4ae644bd9cd21ba881a9e5cffefcc580",
"score": "0.627369",
"text": "def projects\n []\n end",
"title": ""
},
{
"docid": "24a30b227b748ff68cd0cc2b82abf3bd",
"score": "0.62727535",
"text": "def create_project\n \n @projecttype = Projecttype.projects\n @languages = Language.all\n @currency = Currency.all\n @getallcategories = Category.getallcategories()\n @allcountriesAndNationalty = Country.all \n \n \n end",
"title": ""
},
{
"docid": "b56cdf18e7da93e179a657f135f9bace",
"score": "0.62718725",
"text": "def index\n @projects = Project.where(\"owner = ? OR assigned_to = ?\", current_user.id, current_user.id);\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @projects }\n format.json { render :json => @projects }\n end\n end",
"title": ""
},
{
"docid": "18fd22fc314161b5577baed026f1e673",
"score": "0.62657917",
"text": "def project\n \t@project = Project.find(params[:project_id])\n\t@issue_custom_fields = IssueCustomField.find(:all, :order => \"#{CustomField.table_name}.position\")\n end",
"title": ""
},
{
"docid": "d3924bfae567da71947a27c27c78e9a2",
"score": "0.6262752",
"text": "def index\n if administrator(current_user.id)\n @projects = Project.where(:user_id => current_user.id)\n else\n @projects = Project.where(:id => Task.where(:user_id => current_user.id).select(:project_id))\n end \n end",
"title": ""
},
{
"docid": "574d31ada9b5c89888424eca00e645c6",
"score": "0.62605727",
"text": "def index\n @user = current_user\n @projects = Project.public_projects\n end",
"title": ""
},
{
"docid": "2a3ef3a66f6498a4e67b9fa4431b9300",
"score": "0.6259788",
"text": "def index\n @projects = Project.all.joins(:entrepreneur).order(\"full_name\")\n authorize Project\n end",
"title": ""
},
{
"docid": "be2a4bb2f58f8974c2ab7bee878135c8",
"score": "0.62577",
"text": "def index\n # if current_student.admin == true\n # @projects = Project.all\n # else\n\n @student = Student.find(current_student.id)\n # end\n @project = Project.new\n end",
"title": ""
},
{
"docid": "eb09cad192b0485ad05fe9283afbc148",
"score": "0.6255147",
"text": "def show_project\n \n #puts 'token for project css'\n #puts params\n #puts 1111111\n \n @token = params[:token]\n @portfolio = Portfolio.find_by_token(@token)\n \n #puts 'details for portfolio'\n #puts @portfolio.inspect\n #puts 1111111\n \n params[:portfolio_id]= @portfolio.id\n params[:group_id] = params[:format]\n \n @csses = []\n tempCsses = ProjCss.where(:portfolio_id => params[:portfolio_id])\n tempCsses.each do |tempCss|\n if tempCss.proj.group.id == params[:group_id].to_i()\n @csses << tempCss \n end\n end\n \n @visible_css = ProjCss.get_visible_group_proj_csses(params[:portfolio_id], params[:group_id])\n @visible_css_static, @visible_css_not_static = ProjCss.get_static_nonstatic_proj_csses(params[:portfolio_id], params[:group_id])\n @portfolio = Portfolio.find(params[:portfolio_id])\n if @portfolio.template != \"\"\n @css = ProjCss.setTemplate(@csses)\n @visible_css_static = []\n @css.each do |x|\n if x.visible\n @visible_css_static << x\n end\n end\n @visible_css_not_static = []\n if @portfolio.template == \"Colorful\"\n @visible_css_static.each do |x|\n x.defaultStyle = Portfolio.all_colors.sample[0]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d950193ecdc6af243850dd4a47c92cf1",
"score": "0.6253947",
"text": "def index\n authorize! :read, Project\n @projects = Project.includes(:status)\n end",
"title": ""
},
{
"docid": "b166e8e115d06fca09c3785a1fc33ea6",
"score": "0.6247431",
"text": "def set_project\n # @project = @user.projects.find(params[:user_id]) if @project\n @project = @user.projects.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "bdb970c968aa6b9674d01483c3062eb6",
"score": "0.6246402",
"text": "def projects\n \t[]\n end",
"title": ""
},
{
"docid": "9ee006e49da30d4d891f3ba0655523fe",
"score": "0.6246202",
"text": "def index\n logger.debug(\"project-index- PROJECT ID IS #{params.inspect}\")\n @projectsss = Project.where(user_id: current_user.id, inactive: [false, nil]).order(created_at: :asc)\n @projects = Project.where(user_id: current_user.id)\n #@projects = Project.where(\"customer_id = ? AND user_id = ?\",params[:customeer_id],current_user.id)\n @weeks = Week.where(\"user_id = ?\", current_user.id).order(start_date: :desc).limit(5)\n @adhoc_pm_projects = Project.where(adhoc_pm_id: current_user.id)\n @adhoc_pm_project = @adhoc_pm_projects.first\n @adhoc = params[\"adhoc\"]\n @default_project = current_user.default_project\n @project_tasks = Task.where(project_id: @default_project)\n @terms_modal_show = current_user.terms_and_condition\n\n @shift_change_requests = ShiftChangeRequest.where(\"status = ?\", \"Requested\")\n\n if @projectsss.present?\n params[:project_id] = @project_id = @projectsss.first.id\n logger.debug(\"project-index- @project_id #{@project_id}\")\n \n @users_assignied_to_project = User.joins(\"LEFT OUTER JOIN projects_users ON users.id = projects_users.user_id AND projects_users.project_id = 1\").select(\"users.email,first_name,email,users.id id,user_id, projects_users.project_id, projects_users.active,project_id\")\n @tasks_on_project = Task.where(project_id: @project_id)\n # @applicable_week = Week.joins(:time_entries).where(\"(weeks.status_id = ? or weeks.status_id = ?) and time_entries.project_id= ? and time_entries.status_id=?\", \"2\", \"4\",\"1\",\"2\").select(:id, :user_id, :start_date, :end_date , :comments).distinct\n @user_projects = Project.where(user_id: current_user.id)\n @customers = Customer.all\n @project = Project.includes(:tasks).find(@project_id)\n #@applicable_week = Week.joins(:time_entries).where(\"(weeks.status_id = ? or weeks.status_id = ?) and time_entries.project_id IN (#{@projects.collect(&:id).join(\",\")}) and time_entries.status_id=?\", \"2\", \"4\",\"2\").select(:id, :user_id, :start_date, :end_date , :comments).distinct\n @users_on_project = User.joins(\"LEFT OUTER JOIN projects_users ON users.id = projects_users.user_id AND projects_users.project_id = #{@project.id}\").select(\"users.email,first_name,email,users.id id,user_id, projects_users.project_id, projects_users.active,project_id\")\n available_users = User.where(\"parent_user_id IS ? && customer_id = ? && is_active =?\", nil , @project.customer.id, true) \n shared_users = SharedEmployee.where(customer_id: @project.customer.id).collect{|u| u.user_id}\n shared_user_array = Array.new\n shared_users.each do |su|\n u = User.find(su)\n shared_user_array.push(u)\n end\n logger.debug(\"AVAIALABLE SHARED USERS #{shared_users.inspect}, The USER IS #{shared_user_array.inspect}\")\n @available_users = available_users + shared_user_array\n @users = User.where(\"parent_user_id IS null\").all\n @invited_users = User.where(\"invited_by_id = ?\", current_user.id)\n @proxies = User.where(\"customer_id =? and proxy = ?\", @project.customer.id, true)\n @customer = Customer.find(@project.customer_id)\n customer_holiday_ids = CustomersHoliday.where(customer_id: @project.customer.id).pluck(:holiday_id)\n @holidays = Holiday.where(global:true).or(Holiday.where(id: customer_holiday_ids))\n @holiday_exception = HolidayException.new\n @holiday_exceptions = @project.holiday_exceptions\n @adhoc_pm = User.where(id: @project.adhoc_pm_id).first\n @announcement = Announcement.where(\"active = true\").last\n @current_systems = ExternalConfiguration.where(user_id: current_user.id)\n elsif @adhoc_pm_project.present?\n @project = @adhoc_pm_project\n @applicable_week = Week.joins(:time_entries).where(\"(weeks.status_id = ? or weeks.status_id = ?) and time_entries.project_id= ? and time_entries.status_id=?\", \"2\", \"4\",@adhoc_pm_project.id,\"2\").select(:id, :user_id, :start_date, :end_date , :comments).distinct\n end\n\n respond_to do |format| \n format.html{}\n end\nend",
"title": ""
}
] |
61bcb811c1b63bddea10233cd9c32573
|
Renders a form for a new presentation attachment type.
|
[
{
"docid": "be9c857b068df0795f0b0830132cca65",
"score": "0.71642476",
"text": "def new\n @presentation_attachment_type = PresentationAttachmentType.new\n add_breadcrumb t('.new')\n end",
"title": ""
}
] |
[
{
"docid": "da98c7035a9cc2be270cc08130997ad2",
"score": "0.7222342",
"text": "def create # rubocop:disable Metrics/MethodLength\n @presentation_attachment_type = PresentationAttachmentType.new presentation_attachment_type_params\n\n if @presentation_attachment_type.save\n redirect_to admin_conferences_presentation_attachment_types_path, success: t('.saved')\n else\n respond_to do |format|\n format.html do\n add_breadcrumb t('.new')\n render :new\n end\n format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }\n end\n end\n end",
"title": ""
},
{
"docid": "9fc6f4e3688f957b15a913cecd9ffadc",
"score": "0.6706565",
"text": "def new\n @attachable = params[\"attachable_type\"].classify.constantize.find(params[\"attachable_id\"])\n render :layout => false\n end",
"title": ""
},
{
"docid": "c9250d8d90d8f13d8e73ebcad9eea70f",
"score": "0.63875717",
"text": "def new\n sc = SystemControl.by_system_control(params[:system_id], params[:control_id], @cycle)\n desc = DocumentDescriptor.find(params[:descriptor_id][:account_id])\n @document = Document.new\n render(:partial => \"attach_form\", :locals => {:sc => sc, :desc => desc})\n end",
"title": ""
},
{
"docid": "9f6be8ba1ccd47250808fdd546ea0d60",
"score": "0.6287229",
"text": "def new\n @process_type = ProcessType.new\n @process_type.build_attachment\n end",
"title": ""
},
{
"docid": "d1e0a870bb6059eaab1e9efc50800388",
"score": "0.6253649",
"text": "def form\n raise SecuityException unless [\n \"HeadlineContentItem\",\n \"StoryTextContentItem\",\n \"PhotoContentItem\",\n \"VideoContentItem\",\n \"HorizontalRuleContentItem\"\n ].include?(params[:type])\n @content_item = params[:type].camelize.constantize.new\n render layout: false\n end",
"title": ""
},
{
"docid": "aabf7cf6c29b7a2e4361ec535ab79a80",
"score": "0.62196946",
"text": "def new\n @presentation_type = PresentationType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @presentation_type }\n end\n end",
"title": ""
},
{
"docid": "61c7d46489f0991230e522907c262eae",
"score": "0.6217124",
"text": "def create # rubocop:disable Metrics/MethodLength\n @presentation_type = PresentationType.new presentation_type_params\n\n if @presentation_type.save\n redirect_to admin_conferences_presentation_types_path, success: t('.saved')\n else\n respond_to do |format|\n format.html do\n add_breadcrumb t('.new')\n render :new\n end\n format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_type.errors } }\n end\n end\n end",
"title": ""
},
{
"docid": "a1b4dcf54dfad0316659b72f02e449af",
"score": "0.6164094",
"text": "def new\n @attachable = params[:attachable_type].constantize.find(params[:attachable_id])\n @attachment = @attachable.attachments.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attachment }\n end\n end",
"title": ""
},
{
"docid": "729a9daeb452b5956f9e4a40a81490fd",
"score": "0.61385393",
"text": "def new\n attachment_name = params[:attachment_type].underscore\n attachable_class = params[:attachable_type].constantize\n if params[:attachable_parent_type]# this condition is no longer used, but is here for future reference.\n attachable_parent_name = params[:attachable_parent_type].underscore\n attachable_parent_key = (attachable_parent_name + '_id').to_sym\n attachable_parent_ids = params[:attachable_parent_id].split(',')\n attachables = []\n for attachable_parent_id in attachable_parent_ids\n attachables << attachable_class.new(attachable_parent_key => attachable_parent_id)\n end\n locals = {:attachable_parent_name => attachable_parent_name, :attachment_type => attachment_name}\n else\n attachable = attachable_class.new\n attachable.id = params[:attachable_id].to_i\n locals = {:attachable_parent_name => nil, :attachment_type => attachment_name}\n end\n respond_to do |format|\n format.html { render :partial => 'new_li', :object => attachable, :locals => locals}\n format.xml { render :xml => @attachment }\n end\n end",
"title": ""
},
{
"docid": "bf164e28942f449463beb54f74de5ace",
"score": "0.611926",
"text": "def new\n @p_attachment = PAttachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @p_attachment }\n end\n end",
"title": ""
},
{
"docid": "92e0eed6acdb2119e4f576165f047870",
"score": "0.6024054",
"text": "def new\n @presentation_type = PresentationType.new\n add_breadcrumb t('.new')\n end",
"title": ""
},
{
"docid": "ddfc9c8446713f38934f0d5c52660b4d",
"score": "0.601972",
"text": "def form\n provides :html\n render :layout => :uploader\n end",
"title": ""
},
{
"docid": "8a4f2fde615167f4312efe7dc3d4c40b",
"score": "0.60057545",
"text": "def new\n @fmea_type = FmeaType.new\n @fmea_type.build_attachment\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fmea_type }\n end\n end",
"title": ""
},
{
"docid": "1ac63ca00a99b50504d941e30a0723a1",
"score": "0.59874386",
"text": "def new\n @attachment = Attachment.new\n @select = Select.find(params[:select_id])\n @attachment.select_id = @select.id\n @attachment.file_type = params[:file_type].to_s\n @attachment.save\n\n respond_to do |format|\n format.js # new.html.erb\n format.json { render json: @attachment }\n end\n end",
"title": ""
},
{
"docid": "c6f4a14725968a8bf0b6cff107f31af5",
"score": "0.5959925",
"text": "def form\n render :layout => :uploader\n end",
"title": ""
},
{
"docid": "4178bfe001605277bf27547c42badd8e",
"score": "0.5942603",
"text": "def update # rubocop:disable Metrics/MethodLength\n if @presentation_attachment_type.update(presentation_attachment_type_params)\n redirect_to admin_conferences_presentation_attachment_types_path, success: t('.saved')\n else\n respond_to do |format|\n format.html do\n add_breadcrumb @presentation_attachment_type.name\n render :edit\n end\n format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }\n end\n end\n end",
"title": ""
},
{
"docid": "fffc8a98425e73c30707ccc9efd4b157",
"score": "0.5942328",
"text": "def create\n @presentation_type = PresentationType.new(presentation_type_params)\n\n respond_to do |format|\n if @presentation_type.save\n format.html { redirect_to @presentation_type, notice: 'Presentation type was successfully created.' }\n format.json { render action: 'show', status: :created, location: @presentation_type }\n else\n format.html { render action: 'new' }\n format.json { render json: @presentation_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ea928534e7bee41455253eb75adecc4",
"score": "0.5941988",
"text": "def new\n @attachment = Attachment.new\n end",
"title": ""
},
{
"docid": "35b66f81b716e4257b05716781301669",
"score": "0.5937167",
"text": "def create\n @presentation_type = PresentationType.new(params[:presentation_type])\n\n respond_to do |format|\n if @presentation_type.save\n flash[:notice] = 'PresentationType was successfully created.'\n format.html { redirect_to [:admin, @presentation_type] }\n format.xml { render :xml => @presentation_type, :status => :created, :location => @presentation_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @presentation_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80a27348d53daffeb3dc1b8c2a76a070",
"score": "0.5935952",
"text": "def show\n if @form.formtype == 'nonprofit'\n nonprofit\n elsif @form.formtype == 'food'\n food\n send_data(@form.kc_file_contents,\n type: @form.kc_content_type,\n filename: @form.kc_filename)\n elsif @form.formtype == 'commercial'\n commercial\n elsif @form.formtype == 'retail'\n retail\n end\n end",
"title": ""
},
{
"docid": "844b5689fc605fdf73c09f1acb4ec0c8",
"score": "0.5920137",
"text": "def new\n @entry_type = EntryType.find(params[:entry_type_id])\n @entry = Entry.new\n @entry.entry_type = @entry_type\n @entry.data = build_model_from_code(@entry_type)\n\n respond_to do |format|\n format.html { render :inline => build_form_template(@entry_type),\n :type => 'haml', :layout => true }# new.html.erb\n format.json { render json: @entry }\n end\n end",
"title": ""
},
{
"docid": "fadcdf282a5779d30b20f6fd9151b316",
"score": "0.59136236",
"text": "def new\n @attachment = Attachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.fbml # new.fbml.erb\n format.xml { render :xml => @attachment }\n end\n end",
"title": ""
},
{
"docid": "b02660f0fcc840d7b6c4b1fae4f6fbbf",
"score": "0.5904961",
"text": "def edit\n add_breadcrumb @presentation_attachment_type.name\n end",
"title": ""
},
{
"docid": "fae147e88a538bd95c350227d72e7f67",
"score": "0.58543295",
"text": "def new\n #raise params.to_yaml\n @attachment = Attachment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attachment }\n end\n end",
"title": ""
},
{
"docid": "9d0b3aafb4185b8a93109f62bfb177ec",
"score": "0.5833945",
"text": "def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @software_attachment }\n end\n end",
"title": ""
},
{
"docid": "61caea032d9758890e92eb054fa662e4",
"score": "0.58300716",
"text": "def new\n @type_is = params[:type_is]\n @post = Post.new\n @post.attachments.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end",
"title": ""
},
{
"docid": "c51d1435d1356dfda9a70f7cd02ae4bd",
"score": "0.5824627",
"text": "def new\n @attachment = @parent.attachments.build\n respond_with(@parent, @attachment)\n end",
"title": ""
},
{
"docid": "b372f163ba46e8cb6f39b0440c369d6a",
"score": "0.5792979",
"text": "def new\n @section_attachment = SectionAttachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @section_attachment }\n end\n end",
"title": ""
},
{
"docid": "027cbc65976dd1e963bdee0caf6a324e",
"score": "0.57905245",
"text": "def new\n @attachment = Attachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attachment }\n end\n end",
"title": ""
},
{
"docid": "d0587a2d4c83bce6807f62a591b1b733",
"score": "0.5776821",
"text": "def new\n @form_type = FormType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @form_type }\n end\n end",
"title": ""
},
{
"docid": "0804d1e535770f822841c4c298379bcc",
"score": "0.5772797",
"text": "def attachment_field(method, options = {})\n render(partial:\"admin/shared/forms/attachment_field\", locals: {\n f: self,\n method: method,\n options: options,\n })\n end",
"title": ""
},
{
"docid": "2b1031ddbafcd75b69f6ca345b3233e0",
"score": "0.57456756",
"text": "def lead_form\n @lead ||= Lead.new\n render_to_string partial: \"leads/form\"\n end",
"title": ""
},
{
"docid": "2b1031ddbafcd75b69f6ca345b3233e0",
"score": "0.57456756",
"text": "def lead_form\n @lead ||= Lead.new\n render_to_string partial: \"leads/form\"\n end",
"title": ""
},
{
"docid": "731306014b5ab2a05e6696420566434a",
"score": "0.5728839",
"text": "def new\n @print = Print.new\n @print.build_attachment\n end",
"title": ""
},
{
"docid": "b12fd5056bf604df6cddda03642575f4",
"score": "0.57221323",
"text": "def upload_form\r\n\r\n render :layout => 'minimal'\r\n end",
"title": ""
},
{
"docid": "e953ba2f05870d58e294a2319b3aded1",
"score": "0.57178205",
"text": "def show\n @attachment = @process_type.attachment\n end",
"title": ""
},
{
"docid": "ac5ae9a8aacad98c50673ac119b85ed9",
"score": "0.5716451",
"text": "def form_for_options(type, options)\n form = Jabber::Dataforms::XData.new(:submit)\n pubsub_config = Jabber::Dataforms::XDataField.new('FORM_TYPE', :hidden)\n pubsub_config.values = [type]\n form.add(pubsub_config)\n options.each_pair do |key, value|\n f = Jabber::Dataforms::XDataField.new(key)\n f.values = [value]\n form.add(f)\n end\n\n form\n end",
"title": ""
},
{
"docid": "f652e109ca604b8a49755170c23586c1",
"score": "0.57042724",
"text": "def create\n @form_type = FormType.new(form_type_params)\n\n respond_to do |format|\n if @form_type.save\n format.html { redirect_to @form_type, notice: 'Form type was successfully created.' }\n format.json { render :show, status: :created, location: @form_type }\n else\n format.html { render :new }\n format.json { render json: @form_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "164bbf6611b83e8a84aff3067137e6f4",
"score": "0.5694248",
"text": "def create\n @page = parent_object\n # Before adding a new attachment to the collection, build attachments to match the latest version\n @page.build_attachments_from_version(@page.latest_version)\n @object = @attachment = @page.attachments.build(object_params)\n\n # If uploading new file\n if params[:attachable]\n @klass = @attachment.attachable_type.constantize\n @attachable = @klass.create(params[:attachable])\n @attachment.attachable = @attachable\n end\n \n @page.version_comment = \"Added new attachment (#{@attachment.attachable.class})\"\n\n if object.valid? && @page.save # save the page, not the attachment so versioning works correctly\n @page.preview_latest_version\n respond_to do |wants|\n wants.html { redirect_to edit_admin_page_path(@page, :anchor => \"Attachments\") }\n wants.js { render :action => \"create\" }\n end\n else\n after :create_fails\n set_flash :create_fails\n response_for :create_fails\n end\n end",
"title": ""
},
{
"docid": "98f10ec9d94e477b96afe8dc162799c2",
"score": "0.56903785",
"text": "def create\n @process_type = ProcessType.new(process_type_params)\n\n @process_type.attachment.created_by = current_user\n if @process_type.save\n ProcessType.process_item_associations(@process_type, params)\n CommonActions.notification_process('ProcessType', @process_type)\n respond_with :process_types\n else\n respond_with @process_type\n end\n end",
"title": ""
},
{
"docid": "4dfbd73a959bb4382ebe91493a6c32dc",
"score": "0.5681617",
"text": "def form_type\n ''\n end",
"title": ""
},
{
"docid": "3c62ef5d8ab6b707241015cf79519e7e",
"score": "0.5671155",
"text": "def edit_form\n parsed = Namae::Name.parse(current_user.name)\n generic_file = ::GenericFile.new(creator: [parsed.sort_order], title: @batch.generic_files.map(&:label))\n edit_form_class.new(generic_file)\n end",
"title": ""
},
{
"docid": "3a3be40f9e5549a054a3bbedc8ae5f6a",
"score": "0.5668184",
"text": "def create\n @attachment = Attachment.new(attachment_params)\n\n if @attachment.save\n redirect_to attachments_path, notice: \"Successfully created attachment.\"\n else\n render action: 'new'\n end\n end",
"title": ""
},
{
"docid": "6681c09b2ae98c5efb9de433204c6d76",
"score": "0.56616503",
"text": "def class_new\n # Build the form\n prepare_form\n respond_with(@all_types_object)\n end",
"title": ""
},
{
"docid": "bba268ced3f83df4052388e011cbd17c",
"score": "0.56545204",
"text": "def new\n @presentation=Presentation.new\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"title": ""
},
{
"docid": "e58b1467f3688d2dc2bac7945aec0f13",
"score": "0.5653964",
"text": "def new\n @file_type = FileType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @file_type }\n end\n end",
"title": ""
},
{
"docid": "f6ceab3906b0d2d24624afe3e9ff4894",
"score": "0.56530523",
"text": "def destroy # rubocop:disable Metrics/MethodLength\n if @presentation_attachment_type.destroy\n redirect_to admin_conferences_presentation_attachment_types_path, success: t('.destroyed')\n else\n respond_to do |format|\n format.html do\n add_breadcrumb @presentation_attachment_type.name\n render :edit\n end\n format.turbo_stream { render partial: 'errors', locals: { errors: @presentation_attachment_type.errors } }\n end\n end\n end",
"title": ""
},
{
"docid": "e364602dd77135ab02fca50b8796b3ac",
"score": "0.56448185",
"text": "def create\n @attachment = Attachment.create( params[:attachment] )\n @select = Select.where(:select_id => @attachment.select_id).last\n respond_to do |format|\n if @attachment.save\n else\n format.html { render action: \"new\" }\n format.json { render json: @aquestion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9122e70ffe04e37ad4456608ed65eef2",
"score": "0.56412756",
"text": "def create\n @form_type = FormType.new(params[:form_type])\n\n respond_to do |format|\n if @form_type.save\n format.html { redirect_to @form_type, notice: 'Form type was successfully created.' }\n format.json { render json: @form_type, status: :created, location: @form_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @form_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c11ae8c5cb0caa978b5f9a86d00ef21d",
"score": "0.5640846",
"text": "def new\n content_type = params[:type]\n content_class = content_type.constantize\n @content_element = content_class.new(:container_id => params[:container_id],:container_type => params[:container_type])\n case content_type\n when 'ContentText'\n render :partial => 'new_text', :object => @content_element\n when 'ContentImage'\n render :partial => 'new_image', :object => @content_element\n when 'ContentVideo'\n render :partial => 'new_video', :object => @content_element\n end\n end",
"title": ""
},
{
"docid": "08215c5ef7f6d64c7a5bf1afa79f6728",
"score": "0.5629",
"text": "def create\n @form = Form.create!(form_params)\n\n \n form_replace\n \n #flash[:notice] = \"#{@form.type} was successfully created.\"\n #redirect_to forms_path\n end",
"title": ""
},
{
"docid": "3544fefe3e78f99d3e549f3125e675da",
"score": "0.56277645",
"text": "def new\n @attaching = Attaching.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attaching }\n end\n end",
"title": ""
},
{
"docid": "cc2a50ee62ff9bea88ad5c5cab8e9d1c",
"score": "0.56271774",
"text": "def new\n @upload = Upload.new\n @upload.tmp_content_type = params[:content_type]\n\n upload_type = [\"image\",\"document\"].delete(params[:type])\n \n\n respond_to do |format|\n format.html { \n layout = true\n layout = \"ajax\" if request.xhr?\n layout = params[:layout].to_s.strip==\"false\" ? false : params[:layout] if [\"false\",\"ajax\",\"dialog\"].include?(params[:layout].to_s.strip)\n if upload_type\n render :action => \"new_\"+upload_type,:layout=>layout \n else\n render :layout => layout\n end\n } # new.html.erb\n format.xml { render :xml => @upload }\n end\n end",
"title": ""
},
{
"docid": "b6f25debfe721b0b5a4ff1ba441df996",
"score": "0.562224",
"text": "def new\n\n # Create a new Policy object.\n @policy = Policy.new\n\n\n # If a template has been choosen, then grab the template and\n # set the body of the Policy object to the text of the template.\n if params[:custom]\n @policy_template = PolicyTemplate.find_by :id => params[:custom]\n @policy.body = @policy_template.body\n end\n # Render the form\n end",
"title": ""
},
{
"docid": "905828bf115f3c233e07edeed3076a69",
"score": "0.56158006",
"text": "def new\n @panel_attachment = PanelAttachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @panel_attachment }\n end\n end",
"title": ""
},
{
"docid": "d79417a773bba63e01a353c83fa08397",
"score": "0.56059015",
"text": "def new\n @attach = Attach.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attach }\n end\n end",
"title": ""
},
{
"docid": "4749928a41335f66bf0843e25b1b2053",
"score": "0.56016856",
"text": "def attach_form c\n c.form = @form\n c.override_graphic @graphic\n c.parent_component = self\n end",
"title": ""
},
{
"docid": "92c92940aae3b4958547378ad842d5d6",
"score": "0.55973715",
"text": "def create\n @screen = session.active_screen\n @form_content_reuse = params[:form_content_reuse]\n\n file = params[:report_template][:file].to_s\n\n if file =~ /^ReportTemplates/\n params[:report_template]['file'] = 'none'\n params[:report_template]['type'] = file\n else\n params[:report_template]['type'] = 'ReportTemplate'\n end\n\n @report_template = ReportTemplate.new(params[:report_template])\n @report_template.type = params[:report_template]['type']\n @report_template.save\n end",
"title": ""
},
{
"docid": "3717523fca15c9b491ed6acb8b2d94fb",
"score": "0.55821836",
"text": "def new\n @upload = Upload.new\n @upload.upload_type= :normal\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @upload }\n format.json { render :json => @upload }\n end\n end",
"title": ""
},
{
"docid": "dbe0d2fe0965d623d838fc4e028c8b51",
"score": "0.55819416",
"text": "def create\n @attachment = Attachment.new(attachment_params)\n\n if @attachment.save\n redirect_to @attachment, notice: 'Attachment was successfully created.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "7db5e0633d5bd35763c20a0571706049",
"score": "0.5581298",
"text": "def standard_import_form\n render('standard_import/form')\n end",
"title": ""
},
{
"docid": "93f5625fe8a630fe813227253aa942cf",
"score": "0.55800414",
"text": "def render_form(model,object,method)\n object = model.new unless object\n render(model.name.downcase + 'form', binding)\n end",
"title": ""
},
{
"docid": "da8bdb49e174c032643262a36785574c",
"score": "0.55788034",
"text": "def new\n @attachment_file = AttachmentFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @attachment_file }\n end\n end",
"title": ""
},
{
"docid": "6e0f3eb20751856da79eadd92689529a",
"score": "0.55781746",
"text": "def _forme_form_class\n TemplateForm\n end",
"title": ""
},
{
"docid": "40ef6f572908406d776e75c54f7971d9",
"score": "0.5578097",
"text": "def new_ajax_sf_form\n @object_type = params[:salesforce_object][:object_type]\n\n @sf_object = salesforce_object_create(@object_type)\n @editable = true\n object_description = @binding.describeSObject(:sObjectType => @object_type)\n @meta_attributes = object_description.describeSObjectResponse.result\n \n render :file => \"salesforce_objects/new_ajax_sf_form.dryml\"\n end",
"title": ""
},
{
"docid": "e605fe6c5481e84c097a6cf74d0d5dbc",
"score": "0.55774075",
"text": "def uhook_asset_form form\n ''\n end",
"title": ""
},
{
"docid": "547633e1e28671478ad720ef08cc7293",
"score": "0.5573136",
"text": "def new\n render component: \"NewThingForm\"\n end",
"title": ""
},
{
"docid": "16b462260f70f6072f1d0f676325037b",
"score": "0.5568583",
"text": "def create\n params[:attachment].delete(:filename) if params[:attachment][:filename].blank? # find out from the uploaded file\n @attachment = Attachment.new(params[:attachment])\n @attachment.parent = @parent_node\n\n respond_to do |format|\n if @attachment.save(:user => current_user)\n\n format.html # create.html.erb\n format.xml { render :xml => @attachment, :status => :created, :location => @attachment }\n format.js do\n responds_to_parent do |page|\n page << \"if(Ext.get('no_attachments_row')) Ext.get('no_attachments_row').remove();\"\n page.insert_html(:bottom, \"uploaded_attachments\", \"<tr id=\\\"uploaded_attachment_#{@attachment.id}\\\"><td>#{h(@attachment.title)}</td><td>#{h(@attachment.filename)}</td><td>#{(@attachment.size||0)/1024} KB</td></tr>\")\n page.call(\"treePanel.refreshNodesOf\", @parent_node.id)\n @attachment = Attachment.new # To reset fields\n page.replace_html('right_panel_form', :partial => 'form')\n end\n end\n else\n format.html { render :action => :new, :status => :unprocessable_entity }\n format.xml { render :xml => @attachment.errors, :status => :unprocessable_entity }\n format.js do\n responds_to_parent do |page|\n # rerender form with error messages:\n page.replace_html('right_panel_form', :partial => 'form')\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ce4b3b546370603762b2c475ac49dd8b",
"score": "0.5568353",
"text": "def create\n @attachment = @fileable.attachments.new(attachment_params)\n if @attachment.save\n redirect_to @fileable, notice: \"attachment created.\"\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "b00f631fc280d93765e2ef659bd620f2",
"score": "0.5567058",
"text": "def new\n @form_template = FormTemplate.new\n @owner_type = set_owner_type\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @form_template }\n format.js do\n render :update do |page|\n page.replace_html :form_template_columns, :partial => 'form_template_columns', :locals => { :form_template_columns => build_form_template_columns_for(@owner_type) }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "938f99c1126deadff013d5738b10a6b2",
"score": "0.5564895",
"text": "def form_type\n ''\n end",
"title": ""
},
{
"docid": "938f99c1126deadff013d5738b10a6b2",
"score": "0.5564895",
"text": "def form_type\n ''\n end",
"title": ""
},
{
"docid": "938f99c1126deadff013d5738b10a6b2",
"score": "0.5564895",
"text": "def form_type\n ''\n end",
"title": ""
},
{
"docid": "747a5ebc765b1635c6560e50d27e6268",
"score": "0.55618453",
"text": "def new\n @item_attachment = ItemAttachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_attachment }\n end\n end",
"title": ""
},
{
"docid": "52efd24845f5743b1de4bd18ccd0db33",
"score": "0.5558572",
"text": "def new\n @article = Article.new\n\n if( params[:attachment] )\n @article.attachment = Attachment.subclass( params[:attachment] ).new\n end\n end",
"title": ""
},
{
"docid": "3272385cb7d9845f21c457126d1fcf4d",
"score": "0.55540603",
"text": "def foundation_form_for(record, options = {}, &block)\n options[:builder] = FoundationFormBuilder\n form_for record, options, &block\n end",
"title": ""
},
{
"docid": "823f6e12af6c720105fc1f6b7191cc97",
"score": "0.5552864",
"text": "def new\n @im_type = ImType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @im_type }\n end\n end",
"title": ""
},
{
"docid": "6446e8b854fd73944fa31356ce96f1a6",
"score": "0.5548162",
"text": "def new\n @image_type = ImageType.new\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @image_type }\n end\n end",
"title": ""
},
{
"docid": "597efd811a9904364ba63218cf92f4da",
"score": "0.554009",
"text": "def relation_new\n # Build the form\n prepare_form\n respond_with(@all_types_object)\n end",
"title": ""
},
{
"docid": "b12ae2f442b930b28a7c72361f64e698",
"score": "0.5539827",
"text": "def new\n if template = find_content_type\n @content = new_content(:questionnaire => @questionnaire, :template => template)\n @content.assets.build if template == 'image'\n @successful = true\n end\n end",
"title": ""
},
{
"docid": "362a35a047355517428e1a3f199f169f",
"score": "0.5539664",
"text": "def new\n @fieldnote = Fieldnote.new\n @fieldnote.fieldnote_attachments.build\n\n end",
"title": ""
},
{
"docid": "3b2dd7e0df99eb8c24f26c8874016b13",
"score": "0.5531562",
"text": "def new\n @associated_document_type = AssociatedDocumentType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @associated_document_type }\n end\n end",
"title": ""
},
{
"docid": "cdb486c117ca57cefbbc2cc6fe275395",
"score": "0.5530599",
"text": "def new\n @publication = Publication.new\n\trespond_to do |format|\n format.js{\n \t render :update do |page|\n \t \tpage.replace_html 'secondary_publication_entry', :partial => 'publications/form'\n \t end\n \t }\n\t\tformat.html # new.html.erb\n\t\tformat.xml { render :xml => @publication }\n end\n end",
"title": ""
},
{
"docid": "6a4071ff73d38b8ceae86107e71547ca",
"score": "0.55245227",
"text": "def new\n @document_fedora = load_document_from_id(params[:asset_id])\n @next_subject_index = @document_fedora\n @content_type = params[:content_type]\n respond_to do |format|\n format.html { render :file=>\"subjects/new.html\" , :layout=>true}\n format.inline { render :partial=>\"subjects/new.html\", :layout=>false }\n end\n end",
"title": ""
},
{
"docid": "73c25f55ade97fc3cd8187841a8c7e76",
"score": "0.5523274",
"text": "def create_from_form(type = :qdc)\n if type == :documentation\n @object = DRI::Documentation.new\n @documented = retrieve_object(params[:documentation_for])\n @object.documentation_for = @documented if @documented\n else\n @object = DRI::DigitalObject.with_standard(type)\n end\n\n @object.depositor = current_user.to_s\n @object.assign_attributes create_params\n end",
"title": ""
},
{
"docid": "b84e3ec89af25e8b149f15f50778349f",
"score": "0.5522646",
"text": "def new\n @presentation = Presentation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @presentation }\n end\n end",
"title": ""
},
{
"docid": "c86e1e3617a6f3778a74c327f4784d0b",
"score": "0.5521787",
"text": "def new\n if params[:document_type]\n @document = @documentable.documents.new(:document_type => params[:document_type], :title => params[:document_type].humanize)\n else\n @document = @documentable.documents.new\n end\n\n respond_to do |format|\n format.html { render layout: 'form' }# new.html.erb\n format.json { render json: @document }\n end\n end",
"title": ""
},
{
"docid": "de3346dbd3a0b7cdae236f73aa473f40",
"score": "0.5515628",
"text": "def new\n @presentation = current_event.presentations.build(params[:presentation])\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @presentation }\n end\n end",
"title": ""
},
{
"docid": "f7f5868a738dc22c3a29fcdc647fd5b1",
"score": "0.55130154",
"text": "def new\n @field_type = get_field_type\n @data_types = FieldType.data_types_list.map {|k, v| [v, k]}\n @field_type.data_type = params[:data_type] unless params[:data_type].nil?\n respond_with @event, @field_type do |format|\n format.html {render :template => \"#{get_view_path}/select_data_type\"} if params[:data_type].nil?\n end\n end",
"title": ""
},
{
"docid": "fd95e1a32314b3188e8d4de200e8a7b4",
"score": "0.550543",
"text": "def new\n @docattachment = Docattachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @docattachment }\n end\n end",
"title": ""
},
{
"docid": "c084089261375893eabc52e82c48942c",
"score": "0.55018735",
"text": "def show_add_item_form\n # get entity which we are coming from\n @entity = convert_id_to_model(params[:id])\n \n initialise_item\n \n logger.debug @item.to_yaml\n render :partial => \"items/new_item_form\", :locals => { :entity => @entity, :item => @item }\n end",
"title": ""
},
{
"docid": "61a68c85c1f4a5c117b14c3531b25f21",
"score": "0.55018556",
"text": "def create_file\n @record = params[:attached_file][:filable_type].constantize.find(\n params[:attached_file][:filable_id],\n )\n authorize @record\n authorize AttachedFile\n result = FileUploader.upload(\n params[:attached_file][:attachment],\n params[:attached_file][:filable_type],\n params[:attached_file][:filable_id]\n )\n\n AttachedFile.create(\n name: params[:attached_file][:attachment].original_filename,\n new_name: result[:new_name],\n filable_type: params[:attached_file][:filable_type],\n filable_id: params[:attached_file][:filable_id]\n )\n\n render 'attached_files'\n end",
"title": ""
},
{
"docid": "ab312d013109803aa2e5958c9183522a",
"score": "0.5500761",
"text": "def new\n @kf_diary_attachment = Kf::DiaryAttachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kf_diary_attachment }\n end\n end",
"title": ""
},
{
"docid": "ce9cad5e29d1ed4cf481ddab7ed2143f",
"score": "0.54994756",
"text": "def new\n @attachment = Attachment.new\n\n breadcrumbs.add I18n.t(\"helpers.titles.#{current_action}\", :model => Model_class.model_name.human), new_attachment_path\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attachment }\n end\n end",
"title": ""
},
{
"docid": "0f72746e2f23b59eed7176170fdada6e",
"score": "0.5497522",
"text": "def new\n @graduate_applicant = GraduateApplicant.find(params[:graduate_applicant_id])\n @attachment = Attachments.new\n @attachment.graduate_applicant_id = @graduate_applicant.id\n @attachment.created_by = current_user.login\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attachments }\n end\n end",
"title": ""
},
{
"docid": "1b91a96c19b2785bcda99a8e5d41d38d",
"score": "0.54955095",
"text": "def fp_format\n form_class\n end",
"title": ""
},
{
"docid": "21ba5127c1d2353ea1be4618f06844d9",
"score": "0.5493043",
"text": "def create\n @publication_attachment = PublicationAttachment.new(publication_attachment_params)\n\n respond_to do |format|\n if @publication_attachment.save\n format.html { redirect_to @publication_attachment, notice: 'Publication attachment was successfully created.' }\n format.json { render :show, status: :created, location: @publication_attachment }\n else\n format.html { render :new }\n format.json { render json: @publication_attachment.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8186c842ee052f478e89d0e28728313d",
"score": "0.549181",
"text": "def create\n @im_type = ImType.new(params[:im_type])\n\n respond_to do |format|\n if @im_type.save\n format.html { redirect_to(admin_im_type_path(@im_type), :notice => 'ImType was successfully created.') }\n format.xml { render :xml => @im_type, :status => :created, :location => @im_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @im_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f0c894eb1e724af78f0a2b93ff222cdf",
"score": "0.5491438",
"text": "def new\n @part = Part.new\n prepFormVariables\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part }\n end\n end",
"title": ""
},
{
"docid": "5bb49e00854852a064a0c8ad47f717e1",
"score": "0.54818213",
"text": "def new\n upload = Upload.new\n render \"uploads/new\", locals: {upload: upload}\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "522e60a78342b97b41c288228cf9d39f",
"score": "0.0",
"text": "def compra_params\n filtered_params = params.require(:compra).permit(:nombre, :descripcion, :tipo,\n :fecha_inicio_compras => [:year, :month, :day, :hour, :minute],\n :fecha_fin_compras => [:year, :month, :day, :hour, :minute],\n :fecha_fin_pagos => [:year, :month, :day, :hour, :minute],\n :fecha_entrega_compras => [:year, :month, :day, :hour, :minute],\n circulo_ids:[], warehouse_ids:[])\n { nombre: filtered_params[:nombre],\n descripcion: filtered_params[:descripcion],\n\t\t\t\ttipo: filtered_params[:tipo],\n circulo_ids: filtered_params[\"circulo_ids\"],\n warehouse_ids: filtered_params[\"warehouse_ids\"],\n fecha_inicio_compras: Time.zone.local(\n filtered_params[:fecha_inicio_compras][:year],\n filtered_params[:fecha_inicio_compras][:month],\n filtered_params[:fecha_inicio_compras][:day],\n filtered_params[:fecha_inicio_compras][:hour],\n filtered_params[:fecha_inicio_compras][:minute]),\n fecha_fin_compras: Time.zone.local(\n filtered_params[:fecha_fin_compras][:year],\n filtered_params[:fecha_fin_compras][:month],\n filtered_params[:fecha_fin_compras][:day],\n filtered_params[:fecha_fin_compras][:hour],\n filtered_params[:fecha_fin_compras][:minute]),\n fecha_fin_pagos: Time.zone.local(\n filtered_params[:fecha_fin_pagos][:year],\n filtered_params[:fecha_fin_pagos][:month],\n filtered_params[:fecha_fin_pagos][:day],\n filtered_params[:fecha_fin_pagos][:hour],\n filtered_params[:fecha_fin_pagos][:minute]),\n fecha_entrega_compras: Time.zone.local(\n filtered_params[:fecha_entrega_compras][:year],\n filtered_params[:fecha_entrega_compras][:month],\n filtered_params[:fecha_entrega_compras][:day],\n filtered_params[:fecha_entrega_compras][:hour],\n filtered_params[:fecha_entrega_compras][:minute])}\n end",
"title": ""
}
] |
[
{
"docid": "3663f9efd3f3bbf73f4830949ab0522b",
"score": "0.7493595",
"text": "def whitelisted_params\n super\n end",
"title": ""
},
{
"docid": "13a61145b00345517e33319a34f7d385",
"score": "0.6954758",
"text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c72da3a0192ce226285be9c2a583d24a",
"score": "0.69205236",
"text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "3d346c1d1b79565bee6df41a22a6f28d",
"score": "0.6891565",
"text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "aa06a193f057b6be7c0713a5bd30d5fb",
"score": "0.6783412",
"text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "f6060519cb0c56a439976f0c978690db",
"score": "0.6741766",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "fad8fcf4e70bf3589fbcbd40db4df5e2",
"score": "0.66818774",
"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.6634386",
"text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "2c8e2be272a55477bfc4c0dfc6baa7a7",
"score": "0.6627996",
"text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "1685d76d665d2c26af736aa987ac8b51",
"score": "0.6624317",
"text": "def permitted_params\n params.permit!\n end",
"title": ""
},
{
"docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f",
"score": "0.6561549",
"text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"title": ""
},
{
"docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18",
"score": "0.648986",
"text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.64755446",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "2d2af8e22689ac0c0408bf4cb340d8c8",
"score": "0.6452771",
"text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end",
"title": ""
},
{
"docid": "236e1766ee20eef4883ed724b83e4176",
"score": "0.639812",
"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.6379535",
"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.63622755",
"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.63365924",
"text": "def require_params\n return nil\n end",
"title": ""
},
{
"docid": "b4c9587164188c64f14b71403f80ca7c",
"score": "0.63347775",
"text": "def sanitize_params!\n request.sanitize_params!\n end",
"title": ""
},
{
"docid": "b63e6e97815a8745ab85cd8f7dd5b4fb",
"score": "0.63249147",
"text": "def excluded_from_filter_parameters; end",
"title": ""
},
{
"docid": "38bec0546a7e4cbf4c337edbee67d769",
"score": "0.63191724",
"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.6313892",
"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.6312876",
"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.63040864",
"text": "def permitir_parametros\n params.permit!\n end",
"title": ""
},
{
"docid": "e012d7306b402a37012f98bfd4ffdb10",
"score": "0.62999487",
"text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "157e773497f78353899720ad034a906a",
"score": "0.629886",
"text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end",
"title": ""
},
{
"docid": "8c384af787342792f0efc7911c3b2469",
"score": "0.6294405",
"text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c",
"score": "0.6292178",
"text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end",
"title": ""
},
{
"docid": "9b76b3149ac8b2743f041d1af6b768b5",
"score": "0.62785035",
"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.62718505",
"text": "def param_whitelist\n [:role]\n end",
"title": ""
},
{
"docid": "f6399952b4623e5a23ce75ef1bf2af5a",
"score": "0.6265872",
"text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend",
"title": ""
},
{
"docid": "37c5d0a9ebc5049d7333af81696608a0",
"score": "0.62543756",
"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.62532973",
"text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end",
"title": ""
},
{
"docid": "6c4620f5d8fd3fe3641e0474aa7014b2",
"score": "0.6250798",
"text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end",
"title": ""
},
{
"docid": "d14bb69d2a7d0f302032a22bb9373a16",
"score": "0.6233973",
"text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend",
"title": ""
},
{
"docid": "5629f00db37bf403d0c58b524d4c3c37",
"score": "0.62272465",
"text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "d370098b1b3289dbd04bf1c073f2645b",
"score": "0.6227004",
"text": "def allow_params\n params.permit(:id, :email, :password)\n end",
"title": ""
},
{
"docid": "78cbf68c3936c666f1edf5f65e422b6f",
"score": "0.6225902",
"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": "fde8b208c08c509fe9f617229dfa1a68",
"score": "0.62246615",
"text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5",
"score": "0.6199634",
"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.6190174",
"text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end",
"title": ""
},
{
"docid": "d18a36785daed9387fd6d0042fafcd03",
"score": "0.6181904",
"text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end",
"title": ""
},
{
"docid": "36956168ba2889cff7bf17d9f1db41b8",
"score": "0.61772704",
"text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end",
"title": ""
},
{
"docid": "07bc0e43e1cec1a821fb2598d6489bde",
"score": "0.6162726",
"text": "def accept_no_params\n accept_params {}\n end",
"title": ""
},
{
"docid": "fc4b1364974ea591f32a99898cb0078d",
"score": "0.6160626",
"text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end",
"title": ""
},
{
"docid": "13e3cfbfe510f765b5944667d772f453",
"score": "0.6154942",
"text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end",
"title": ""
},
{
"docid": "84bd386d5b2a0d586dca327046a81a63",
"score": "0.61526656",
"text": "def good_params\n permit_params\n end",
"title": ""
},
{
"docid": "b9432eac2fc04860bb585f9af0d932bc",
"score": "0.61359465",
"text": "def wall_params\n params.permit(:public_view, :guest)\n end",
"title": ""
},
{
"docid": "f2342adbf71ecbb79f87f58ff29c51ba",
"score": "0.61319274",
"text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end",
"title": ""
},
{
"docid": "8fa507ebc4288c14857ace21acf54c26",
"score": "0.61170536",
"text": "def strong_params\n # to dooo\n end",
"title": ""
},
{
"docid": "9292c51af27231dfd9f6478a027d419e",
"score": "0.6114007",
"text": "def domain_params\n params[:domain].permit!\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6112975",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "a3aee889e493e2b235619affa62f39c3",
"score": "0.6109575",
"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.61028",
"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.61028",
"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.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "b63ab280629a127ecab767e2f35b8ef0",
"score": "0.6095016",
"text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end",
"title": ""
},
{
"docid": "677293afd31e8916c0aee52a787b75d8",
"score": "0.6085453",
"text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end",
"title": ""
},
{
"docid": "e50ea3adc222a8db489f0ed3d1dce35b",
"score": "0.60841954",
"text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end",
"title": ""
},
{
"docid": "b7ab5b72771a4a2eaa77904bb0356a48",
"score": "0.6083834",
"text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end",
"title": ""
},
{
"docid": "b2841e384487f587427c4b35498c133f",
"score": "0.6076738",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "3f5347ed890eed5ea86b70281803d375",
"score": "0.60734737",
"text": "def user_params\n params.permit!\n end",
"title": ""
},
{
"docid": "0c8779b5d7fc10083824e36bfab170de",
"score": "0.6066163",
"text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end",
"title": ""
},
{
"docid": "fa0608a79e8d27c2a070862e616c8c58",
"score": "0.6065011",
"text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end",
"title": ""
},
{
"docid": "7646659415933bf751273d76b1d11b40",
"score": "0.60641026",
"text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end",
"title": ""
},
{
"docid": "a3dc8b6db1e6584a8305a96ebb06ad21",
"score": "0.6063542",
"text": "def need_params\n end",
"title": ""
},
{
"docid": "4f8205e45790aaf4521cdc5f872c2752",
"score": "0.60627866",
"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.60613674",
"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.60602236",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "d6886c65f0ba5ebad9a2fe5976b70049",
"score": "0.60562223",
"text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end",
"title": ""
},
{
"docid": "96ddf2d48ead6ef7a904c961c284d036",
"score": "0.6047439",
"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.6047015",
"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.6047015",
"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.60457283",
"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.60412854",
"text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff",
"score": "0.6032506",
"text": "def parameters\n params.permit(permitted_params)\n end",
"title": ""
},
{
"docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8",
"score": "0.6029243",
"text": "def filter_params\n end",
"title": ""
},
{
"docid": "cf73c42e01765dd1c09630007357379c",
"score": "0.60251915",
"text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end",
"title": ""
},
{
"docid": "793abf19d555fb6aa75265abdbac23a3",
"score": "0.6020472",
"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.60178447",
"text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend",
"title": ""
},
{
"docid": "2a11104d8397f6fb79f9a57f6d6151c7",
"score": "0.6016368",
"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.60133153",
"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.6007004",
"text": "def user_params\n params[:user].permit!\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.60052776",
"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.60052776",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "9c8cd7c9e353c522f2b88f2cf815ef4e",
"score": "0.60052764",
"text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end",
"title": ""
},
{
"docid": "9736586d5c470252911ec58107dff461",
"score": "0.60026777",
"text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end",
"title": ""
},
{
"docid": "e7cad604922ed7fad31f22b52ecdbd13",
"score": "0.60007924",
"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": "f70301232281d001a4e52bd9ba4d20f5",
"score": "0.6000297",
"text": "def room_allowed_params\n end",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "58ad32a310bf4e3c64929a860569b3db",
"score": "0.6000006",
"text": "def user_params\n\t\tparams.require(:user).permit!\n\tend",
"title": ""
},
{
"docid": "2e6de53893e405d0fe83b9d18b696bd5",
"score": "0.59981924",
"text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end",
"title": ""
},
{
"docid": "19bd0484ed1e2d35b30d23b301d20f7c",
"score": "0.5995787",
"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.5995787",
"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.59932935",
"text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end",
"title": ""
},
{
"docid": "0f53610616212c35950b45fbcf9f5ad4",
"score": "0.59924304",
"text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end",
"title": ""
},
{
"docid": "b545ec7bfd51dc43b982b451a715a538",
"score": "0.59919494",
"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.59897816",
"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.5988952",
"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": ""
}
] |
97cb72e474ffaca1aaf8f75551817c8c
|
[[foobar:dudcwcrnzgodqmaupfzgbzmyzuqkvndg]]the deal[[foobar:dudcwcrnzgodqmaupfzgbzmyzuqkvndg]] becomes the deal ^foobar
|
[
{
"docid": "ae15d110845bd31ef333b8ab48b3918c",
"score": "0.0",
"text": "def transform_named_block(input)\n already_processed = {}\n result = input.gsub(section_regex(remove_space: false)) do\n name = Regexp.last_match(1)\n if ! already_processed.key?(name)\n already_processed[name] = true\n \"\"\n else\n # Only keep the second one (at the end)\n \" ^#{name}\"\n end\n end\n result\n end",
"title": ""
}
] |
[
{
"docid": "bd0e8b3885aebfb4cbe786d1792f453d",
"score": "0.5700813",
"text": "def kesha_maker(array)\n new_array = []\n array.each do |string|\n string[2] = \"$\"\n new_array << string\n end\n new_array\nend",
"title": ""
},
{
"docid": "2822ee2d30e109760913dc29083bcfaa",
"score": "0.5655194",
"text": "def kesha_maker(string_array)\n helper_array = string_array\n helper_array.each do |string|\n string[2] = \"$\"\n end\n return helper_array\nend",
"title": ""
},
{
"docid": "93ed37bef5c9dcaeeba0bfb0fa4617f3",
"score": "0.564432",
"text": "def kesha_maker(array)\n result = []\n array.each do |string|\n new_string = string\n new_string[2] = \"$\"\n result << new_string\n end\n result\nend",
"title": ""
},
{
"docid": "6eb48928c4587c666e8291913b6abf29",
"score": "0.55206156",
"text": "def decode(enc_password)\n enc_password.gsub!(\"ashley\", \" \")\n enc_password.gsub!(\"blake\", \"e\")\n enc_password_array = enc_password.split\n puts enc_password_array\n password_array = []\n password_array[1] = enc_password_array[1]\n puts \"after first insertion #{password_array}\"\n password_array[0] = enc_password_array.last\n puts \"after second insertion #{password_array}\"\n password_array[3] = enc_password_array.first\n puts \"after third insertion #{password_array}\"\n password_array.compact.join(\"_\").to_sym\nend",
"title": ""
},
{
"docid": "101fc34b354bf541ea236a02016dad71",
"score": "0.5501167",
"text": "def kesha_maker(array)\n array.each{|thing| thing[2] = \"$\"}\nend",
"title": ""
},
{
"docid": "d988e6adcbe3dc80b4fb89dddae973bf",
"score": "0.5464697",
"text": "def kesha_maker(array_of_strings)\n array_of_strings.each { |item| item[2] = \"$\" }\nend",
"title": ""
},
{
"docid": "79f2f30dc28d3d8685dec4979b9915e9",
"score": "0.54643816",
"text": "def kesha_maker(string_array)\n kesha_array = [ ]\n kesha_array = string_array.each do |string| string[2] = \"$\"\n end\n kesha_array\nend",
"title": ""
},
{
"docid": "a31ffb73b43221d7a3618225f25d18f7",
"score": "0.5455914",
"text": "def kesha_maker(array)\n array.each { |name| name[2] = \"$\" }\nend",
"title": ""
},
{
"docid": "1bb746326985920afa8cf6ff98b32dc7",
"score": "0.5453969",
"text": "def kesha_maker(array)\n array.each do |str|\n str[2] = \"$\"\n end\n array\nend",
"title": ""
},
{
"docid": "b2c05ab77d46ffaf6ed18b8438a7eb3a",
"score": "0.53776",
"text": "def kesha_maker(array)\n array.each do |string|\n string[2] = \"$\"\n end\nend",
"title": ""
},
{
"docid": "c589f5f92aaa6f952d867f10c3cafd88",
"score": "0.5370245",
"text": "def kesha_maker(array)\n array.each do |string|\n string[2] = \"$\"\n end\nend",
"title": ""
},
{
"docid": "7e39db10a15a3eada859a55285677911",
"score": "0.536463",
"text": "def kesha_maker(array)\n array.each { |word| word.gsub!(word[2], \"$\") }\nend",
"title": ""
},
{
"docid": "4322c5cb987bc09f5a0646510213ce07",
"score": "0.5311514",
"text": "def kesha_maker(array)\n array.each { |element| element.sub!(element[2],\"$\") }\nend",
"title": ""
},
{
"docid": "952f3ab7213589461130349ee9ae87c2",
"score": "0.5308485",
"text": "def kesha_maker(array)\n array.each {|word| word[2] = \"$\"}\n # I actually tried with gsub, but Ruby makes assigning variable to a certain position in an array easy\nend",
"title": ""
},
{
"docid": "9f060f11190bdc5329fea5641333744d",
"score": "0.5302637",
"text": "def kesha_maker(array)\n new = []\n #array.each do |item|\n #new << item.gsub(item[2], '$')\n #end\n #new\n (0..array.size - 1).step { |n| \n new << array[n].gsub(array[n][2], '$') \n }\n new\nend",
"title": ""
},
{
"docid": "6e3084d0b9562b30dc9715dcfc278e65",
"score": "0.5262986",
"text": "def kesha_maker(arr)\n\tarr.collect do |x| \n\t\tx[2] = \"$\"\n\t\tx\n\tend\nend",
"title": ""
},
{
"docid": "718835c572be92b641268d65001c1a14",
"score": "0.52613616",
"text": "def kesha_maker(array)\n array.each do |item|\n item[2] = \"$\"\n end\nend",
"title": ""
},
{
"docid": "17da6a15fa674a419db6a1a490c790b9",
"score": "0.5258303",
"text": "def kesha_maker(array)\n array.each do |item|\n item[2] = \"$\"\n end \nend",
"title": ""
},
{
"docid": "26ec0cbfd9fb887577885c1a53a39898",
"score": "0.52513057",
"text": "def decoded\n value.gsub(/([\"\\]}])([,:])([\"\\[{])/, '\\\\1\\\\2 \\\\3')\n end",
"title": ""
},
{
"docid": "3fde4388c6a8a26dd40e06e3aaaf8567",
"score": "0.5234305",
"text": "def element_replace(arr, hash)\n\n new = []\n arr.each do |word|\n if hash.has_key?(word)\n new << hash[word]\n else \n new << word\n end \n end \n\n return new\n\nend",
"title": ""
},
{
"docid": "fc52b108bc6c291cdce995031b1d1c44",
"score": "0.5231332",
"text": "def kesha_maker(array)\n array.collect {|element| element[2] = \"$\"}\n array\nend",
"title": ""
},
{
"docid": "649cf4804ea38f11368e8a28337988a7",
"score": "0.52198476",
"text": "def kesha_maker(strings)\n kesha_strings = []\n\n strings.each do |string|\n string[2] = \"$\"\n kesha_strings << string\n end\n\n kesha_strings\nend",
"title": ""
},
{
"docid": "f5a01c53ad966c18ce1cbcca8ada0c46",
"score": "0.5214687",
"text": "def clean16(input)\n input.map do |sue|\n sue.split(\" \").map{ |item| item.gsub(\":\", \"\").gsub(\",\", \"\")}\n end\nend",
"title": ""
},
{
"docid": "8596953a6ce3e659b9e7aa6a3f78d7ef",
"score": "0.5214171",
"text": "def depurate_wordlist(wordlist)\n buffer = []\n wordlist.each {|word|\n buffer << word.strip\n }\n buffer\nend",
"title": ""
},
{
"docid": "a11b2caa2765c877281623e5ccb0eec0",
"score": "0.520992",
"text": "def kesha_maker(array)\n # array.each do |e|\n # e[2] = \"$\"\n # end\n # return array\n array.each{|e| e[2] = \"$\"}\nend",
"title": ""
},
{
"docid": "74812a696587e8ee4d98eb1716be2fb6",
"score": "0.52088493",
"text": "def kesha_maker(array)\n array.each do |word|\n word[2] = '$'\n end\nend",
"title": ""
},
{
"docid": "51ad74497f1ca2f82957c4155887c638",
"score": "0.51968026",
"text": "def kesha_maker(array)\n #find the 3rd character in each array.\n array.each do |item|\n item[2] = \"$\"\n end\nend",
"title": ""
},
{
"docid": "21a593e29a5e289b9891a9e4aa8ed288",
"score": "0.5190601",
"text": "def invert_modals(rbtagged)\n rs = [] # result\n rbtagged.each do |tagged|\n rs << tagged.first if !tagged.last.match(/\\)/) # weird \")\" that rbtagger generates. strip it elswhere\n end\n rs[0], rs[1] = rs[1], rs[0]\n # Change to second person\n if %w(I me we us).include?(rs[0])\n rs[0] = 'you'\n end\n rs\nend",
"title": ""
},
{
"docid": "837f8b3da8cd6814fa1a3c71ec5b1655",
"score": "0.51901203",
"text": "def kesha_maker(array)\n array.each {|word| word[2] = \"$\"}\nend",
"title": ""
},
{
"docid": "0faf2cf9ea9759c4cac7133e60bb0f92",
"score": "0.5172913",
"text": "def kesha_maker(array)\n array.collect {|names| names[2]= \"$\"}\n array\nend",
"title": ""
},
{
"docid": "e8fda159d142d831619fc8195da43520",
"score": "0.5169711",
"text": "def kesha_maker(array)\n return array.each { |element| element[2] = \"$\" };\nend",
"title": ""
},
{
"docid": "9807022589557653649872748556a1a8",
"score": "0.51682544",
"text": "def reference(reference_elements)\n if reference_elements.count == 1\n # case 'foo', return 'foo'\n ref = reference_elements.pop\n else\n # case 'foo, bar, foo bar', return 'foo, bar'\n # case 'foo, - , foo bar', retur 'foo'\n reference_elements.pop\n last_element = reference_elements.pop.strip\n if last_element == '-'\n ref = reference_elements.pop\n else\n reference_elements.push last_element\n ref = \"'#{reference_elements.join(', ').strip}'\"\n end\n end\n return ref.gsub(\"'\", '') #Fixme: this is sloppy!\n end",
"title": ""
},
{
"docid": "83b3742443cf5619cdd2d6e211bab7d0",
"score": "0.51628566",
"text": "def xtoy(s)\n objs = \"['\" + s + \"']\"\n while (objs[\"_\"])\n objs[\"_\"] = \"']['\"\n end\n return objs\n end",
"title": ""
},
{
"docid": "0b08f6f56d10f58940120857e86d359d",
"score": "0.51614994",
"text": "def decode_modified( list )\n list.inject( [] ) do | ary, (n, item) |\n if item\n ary + [ item ] * n\n else\n ary << n\n end\n end\nend",
"title": ""
},
{
"docid": "288103e988639ad7d4a98a2c447fa800",
"score": "0.51238036",
"text": "def repl_slashes chan\n chan.each_with_index do |item, index|\n chan[index].gsub(/\\//, \"_\")\n end\nend",
"title": ""
},
{
"docid": "c646f3ef832754889096b2ca720e7320",
"score": "0.5120323",
"text": "def kesha_maker(array)\n new_array = []\n new_char = \"$\"\n position = 2\n array.each do | dollar |\n new_array << dollar[0..position-1] + new_char + dollar[position+1..-1]\n end\n new_array\nend",
"title": ""
},
{
"docid": "ae5d4528090787236d3ad8354aee0252",
"score": "0.5113376",
"text": "def decode(msg,contents)\n [].tap do |decoded|\n 25.times do\n decoded.push(msg) if msg.include?(contents)\n msg = msg.tr('a-z', 'b-za')\n end\n end\nend",
"title": ""
},
{
"docid": "57c1db433dbd0f121e1fab0d4ef77df8",
"score": "0.51126176",
"text": "def kesha_maker(array)\n array.each { |element|\n element[2] = \"$\"\n }\nend",
"title": ""
},
{
"docid": "04b6607a545a4f93e5a706a79528fcea",
"score": "0.51120824",
"text": "def kesha_maker(array)\n array.each { |string|\n string[2] = \"$\"\n }\n end",
"title": ""
},
{
"docid": "be731ad2f2e86e6f51f2e8479d9c6900",
"score": "0.51105154",
"text": "def field_replace(input, hash)\n arr = [input].flatten\n\n hash.each do |key, val|\n arr.collect! {|item| item.gsub(\"@@#{key}@@\", val)}\n end\n\n return arr\n end",
"title": ""
},
{
"docid": "2b65db65925ac9ffa0b2c4414c20c06d",
"score": "0.5092508",
"text": "def kesha_maker(array)\n array.collect {|x| x.sub(x[2], \"$\")}\nend",
"title": ""
},
{
"docid": "4b42f8bae7e297e303c9516137ca1546",
"score": "0.5078334",
"text": "def parse_key(key)\n new_key = key.split(/\\]\\[|\\[|\\]|\\=/).reject { |str| str.empty? }\n # unless new_key == key\n # new_key.map { |el| parse_key(el) }\n # end\n\n # new_key\n end",
"title": ""
},
{
"docid": "28e7aae0097b90bb346957ed2c30a7b7",
"score": "0.5069126",
"text": "def kesha_maker(array)\n array.each do |element|\n element[2] = \"$\"\n end\nend",
"title": ""
},
{
"docid": "bcc07c2613b5ab07686f2e25327e4d47",
"score": "0.50680923",
"text": "def word_substituter(tweet)\n tweet_array = tweet.split(\" \")\n tweet_array.collect! do |word|\n dictionary(word)\n end\n tweet_array.join(\" \")\nend",
"title": ""
},
{
"docid": "6ffb52d435e47d597419876c2e263c65",
"score": "0.5066147",
"text": "def kesha_maker(array)\n kesha = []\n array.each do |word|\n word_array = word.split(\"\")\n word_array[2] = \"$\"\n kesha << word_array.join\n end\n kesha\nend",
"title": ""
},
{
"docid": "79548c3b34287c9aa2670239a08ce6e0",
"score": "0.5061903",
"text": "def kesha_maker(array)\n replacement = \"$\"\n array.select{ |i| i[2] = replacement }\nend",
"title": ""
},
{
"docid": "84d85409460c90f028752c036be4b343",
"score": "0.5059942",
"text": "def substitute(ary, from, to); end",
"title": ""
},
{
"docid": "2dcd9e7c6afb18365860d6e361191076",
"score": "0.5055899",
"text": "def kesha_maker(array)\n kesha = []\n array.each do |word|\n word_array = word.split \"\"\n word_array[2] = \"$\"\n kesha << word_array.join\n end\n kesha\nend",
"title": ""
},
{
"docid": "c42768b9c8256bc3207d9e80b428362c",
"score": "0.505176",
"text": "def element_replace(arr, hash)\n newArr = []\n\n arr.each { |word| hash.include?(word) ? newArr << hash[word] : newArr << word }\n\n return newArr\nend",
"title": ""
},
{
"docid": "1520372432bfd4f91d72ee8af04795ab",
"score": "0.50336236",
"text": "def decoder(encoded, marker)\n sections = encoded.split(marker)\n\n result = sections.each_with_object({even: [], odd: []}).with_index do |(chunk, hash), index|\n index.even? ? hash[:even] << chunk : hash[:odd].unshift(chunk.reverse)\n end\n result.values.join\nend",
"title": ""
},
{
"docid": "3d9ccbf7241f6fccdf376a5b3772c574",
"score": "0.50152034",
"text": "def kesha_maker(array)\n array.each do |character|\n character [2] = '$'\n end\n array\nend",
"title": ""
},
{
"docid": "e7120ef930ae7eb54816284988cc2d91",
"score": "0.49961486",
"text": "def bound_variable_array_string(s)\n \"\\\"#{s.gsub(/(\"|\\\\)/, '\\\\\\\\\\1')}\\\"\"\n end",
"title": ""
},
{
"docid": "e4264f3f4067515e2e69260a17940a52",
"score": "0.4996065",
"text": "def _sanitize(thing)\n if thing.kind_of? V8::Array or thing.respond_to? :to_ary\n thing.map do |item|\n _sanitize item\n end\n elsif thing.respond_to? :keys\n Hash[\n thing.keys.map do |key|\n [key, _sanitize(thing[key])]\n end]\n else\n thing\n end\n end",
"title": ""
},
{
"docid": "94f0a9fb893fffb7e9bf0949d22367fb",
"score": "0.4992484",
"text": "def kesha_maker(array)\n cash_money = []\n array.each { |string| cash_money << string.gsub(string[2], \"$\") }\n cash_money\nend",
"title": ""
},
{
"docid": "514beefcec91817fe276827314cb1be1",
"score": "0.4988258",
"text": "def solution(string)\n if string.length % 2 == 0\n array = string.chars\n array = array.each_slice(2).to_a\n array = array.map{|e|e.join}\n\n else\n array = string.chars\n array.push(\"_\")\n array = array.each_slice(2).to_a\n array = array.map{|e|e.join}\n end\nend",
"title": ""
},
{
"docid": "0f7060433624e3d4e98f328f90e2ac10",
"score": "0.49862298",
"text": "def replace(other_array); end",
"title": ""
},
{
"docid": "0f7060433624e3d4e98f328f90e2ac10",
"score": "0.49862298",
"text": "def replace(other_array); end",
"title": ""
},
{
"docid": "a98394f00d7c5226473829fd2bcbfe9c",
"score": "0.49861288",
"text": "def word_substituter(tweet)\n new_array = []\n long_words = dictionary.keys\n \n tweet_words = tweet.split\n \n tweet_words.each do |word|\n curWord = word.downcase\n if dictionary.has_key?(curWord)\n new_array << dictionary.fetch(curWord)\n else\n new_array << word\n end\n end\n new_array.join(\" \")\nend",
"title": ""
},
{
"docid": "6481cb58def28df57968bb22a2ff951b",
"score": "0.49804395",
"text": "def hipsterfy(word)\n input_array_reversed = word.split(\"\").reverse \n output_array = []\n for i in 0..input_array_reversed.length-1\n if input_array_reversed[i].match(/a|e|i|o|u/)\n input_array_reversed.delete(input_array_reversed[i])\n break\n end \n end \n return input_array_reversed.reverse.join\nend",
"title": ""
},
{
"docid": "977bf8d198964b92c24e1b2afb05b6b8",
"score": "0.49795228",
"text": "def replace(array); end",
"title": ""
},
{
"docid": "f9df3185674fd11c4c7471574c4d6286",
"score": "0.49613726",
"text": "def kesha_maker(strings)\n strings.each {|string| string[2] = \"$\"}\nend",
"title": ""
},
{
"docid": "3198d88353ef288d2a4808cc2ca9c1a5",
"score": "0.49543333",
"text": "def obfuscate_array(phrase = '', words)\n words.split(' ') if !words.is_a?(Array)\n phrase = phrase.split(' ')\n words.each do |word|\n phrase.collect {|item| item.replace('*' * item.length) if item.downcase == word.downcase}\n end\n phrase.join(\" \")\nend",
"title": ""
},
{
"docid": "639da04d539b3c780538bcb82fdc4282",
"score": "0.49501947",
"text": "def re_hash(ret, hash)\n if ret!=nil\n ret = \"$\" + ret\n key_point = ret.index(\"!\")\n if key_point\n mykey = ret[1, key_point-1]\n unwanted_key = ret[0, key_point+1]\n ret = ret.gsub!(unwanted_key, \"\")\n ret = \"$\" + ret\n value_point = ret.index(\"!\")\n if value_point\n myvalue = ret[1, value_point-1]\n unwanted_value = ret[0, value_point+1]\n hash.store(mykey, myvalue)\n ret = ret.gsub!(unwanted_value, \"\")\n else\n myvalue = ret.gsub!(\"$\", \"\")\n hash.store(mykey, myvalue)\n ret = nil\n end\n re_hash(ret, hash)\n end\n end\n end",
"title": ""
},
{
"docid": "30e7e3055bbf26bb5e414aaafee7eacf",
"score": "0.49351105",
"text": "def swap_names(real_name)\r\n# \tsplit string by words\r\n\tswapped_name = real_name.split(\" \")\r\n# \treverse order of array\r\n\tswapped_name.reverse!\r\n#\trejoin reversed string\r\n\tswapped_name.join(\" \")\r\nend",
"title": ""
},
{
"docid": "06b90e4de843b01854f43f004df53f70",
"score": "0.49148005",
"text": "def name_swap_array(name)\n\tname_array = name.downcase.split\n\tname_swap = name_array[1] + \" \" + name_array[0]\n\tname_swap.chars\nend",
"title": ""
},
{
"docid": "7c72933c75d155a065342f0092f72a0a",
"score": "0.49121538",
"text": "def kesha_maker( array )\n i = 2\n while i <= array.length\n array[0][i] = \"$\"\n array[1][i] = \"$\"\n array[2][i] = \"$\"\n i += 3\n end\n array\nend",
"title": ""
},
{
"docid": "27508a1d9f7cf3fd6be76f7c46ead0ae",
"score": "0.48951387",
"text": "def parse_key(key)\n key.split(/\\]\\[|\\[|\\]/)\nend",
"title": ""
},
{
"docid": "27508a1d9f7cf3fd6be76f7c46ead0ae",
"score": "0.48951387",
"text": "def parse_key(key)\n key.split(/\\]\\[|\\[|\\]/)\nend",
"title": ""
},
{
"docid": "27508a1d9f7cf3fd6be76f7c46ead0ae",
"score": "0.48951387",
"text": "def parse_key(key)\n key.split(/\\]\\[|\\[|\\]/)\nend",
"title": ""
},
{
"docid": "faa032eb5c5f1f8efc6731dfeb0d769c",
"score": "0.489325",
"text": "def parse_key(key)\n key.split(\"[\").map { |each_key| each_key.gsub(\"]\",\"\") }\n end",
"title": ""
},
{
"docid": "08db4cba172159e7d28013b7de50bbcb",
"score": "0.48924387",
"text": "def word_substituter(tweet)\n tweet_parts = tweet.split(\" \")\n parts = []\n tweet_parts.collect do |word|\n parts.push(dictonary_replace(word))\n end\n\n parts.join(\" \")\nend",
"title": ""
},
{
"docid": "402555e2a8e9813e09b57aab2befc04f",
"score": "0.488663",
"text": "def parsed_message_against_key\n @message = @message.join(\" \").downcase.chars\n @message = @message.each_slice(rotation_key.length).to_a\n # x = @message.map { |chunk| chunk.zip(rotation_key).to_h }\n end",
"title": ""
},
{
"docid": "b05ef95f583e466e4d020547f760d349",
"score": "0.4884209",
"text": "def normalize_array(thing_array)\n an_array = thing_array.dup\n\n an_array.map! do|e| \n if e.is_a?(Array)\n if 1 == e.size\n e.first.to_s\n else\n e.flatten.map!{|r| r.to_s}\n end\n else\n e.to_s\n end\n end\n\n if an_array.first.is_a?(Array) || \n 'start' != an_array.first.downcase\n an_array = an_array.prepend('Start')\n end\n\n if an_array.last.is_a?(Array) ||\n 'done' != an_array.last.downcase\n an_array << \"Done\"\n end\n\n ap an_array\n\n return an_array \nend",
"title": ""
},
{
"docid": "680794c6052b50fef15c9da58627413d",
"score": "0.48824242",
"text": "def kesha_maker(array)\n letter_change = []\n array.each do |char|\n letter_change << char.gsub(char[2], \"$\")\n end\n letter_change\nend",
"title": ""
},
{
"docid": "37563a13f63b1ac087e20e9d82a35f05",
"score": "0.4882401",
"text": "def aliasmaker(name, nextswap)\n name_array = name.split('')\n\n name_array.map! do |letter|\n nextswap_count = 0\n while nextswap_count < nextswap.length\n if letter == nextswap[nextswap_count]\n next_nextswap = nextswap_count + 1\n letter = nextswap[next_nextswap]\n break\n else\n nextswap_count += 1\n end\n end\n letter\n end\n \n name_array.join('')\nend",
"title": ""
},
{
"docid": "6845bd6756dc8e7c2ac389de3b1afb05",
"score": "0.48821694",
"text": "def no_yelling (string)\n array1 = string.split(//).reverse!\n array2 = array1\n symbols = \"a\"\n array1.each_with_index do |x, i|\n if x == \"!\" || x == \"?\"\n if !symbols.include?(x)\n symbols = x\n end\n elsif symbols.include?(x)\n array2.delete_at(1)\n end\n end\n p array2.reverse!.join\nend",
"title": ""
},
{
"docid": "ce9412d5fd9926c679c169550e02d605",
"score": "0.48786166",
"text": "def parse_key(key)\n first_end = key.index(\"[\")\n first = [key[0...first_end]]\n rest_of_pieces = key[first_end+1...-1].split(\"][\")\n first.concat(rest_of_pieces)\n end",
"title": ""
},
{
"docid": "ca0c2b16eed5a30b209a19298502b076",
"score": "0.48782516",
"text": "def reverse_string (ary)\n ary.reverse!\nend",
"title": ""
},
{
"docid": "3888e3cca9ff9085fe2270cb091bba58",
"score": "0.487384",
"text": "def parse_key(key)\n match_data = /(?<head>.*)\\[(?<rest>.*)\\]/.match(key)\n\n if match_data\n parse_key(match_data[\"rest\"]).unshift(match_data[\"head\"])\n else\n [key]\n end\n #e.g. cat[owner][house]\n # match_data[\"head\"] -> \"cat[owner]\"\n # match_data[\"rest\"] -> \"house\"\n # parse_key(\"house\") -> [\"house\"]\n # [\"house\"].unshift(\"cat[owner]\") -> [\"cat[owner]\", \"house\"]\n end",
"title": ""
},
{
"docid": "0567b26cf6b33beac4c0443a9a4b37f9",
"score": "0.48726094",
"text": "def element_reorde(array)\n if array.size <4\n return array\n end\n \n \n char_elm_start_index = array.size / 2\n next_index_to_swap = char_elm_start_index - 1\n (0..(array.size-4)).step(2) do |index|\n tmp_current_char_index = char_elm_start_index\n while next_index_to_swap > index\n #bubble up the first elm of the char sequence next to the current index\n #swaping two elements\n array[next_index_to_swap], array[tmp_current_char_index] =\n array[tmp_current_char_index], array[next_index_to_swap]\n next_index_to_swap -= 1\n tmp_current_char_index -= 1\n \n end\n char_elm_start_index += 1\n next_index_to_swap = char_elm_start_index - 1\n end\n\n return array\nend",
"title": ""
},
{
"docid": "c6d4751d10aa20638ce8b8a4f1472df0",
"score": "0.48681498",
"text": "def test_dump_self_referential_hash\n if YAML_DUPS_STRINGS_KLUDGE\n array = ARRAY.dup ; hsh = HASH.dup\n array.delete(STR) ; hsh.delete(STR)\n dump_test(hsh.merge(:hash => hsh, :array => (array + [ array ])))\n else\n array = ARRAY + [ARRAY]\n dump_test(HASH.merge(:hash => HASH, :array => array))\n end\n end",
"title": ""
},
{
"docid": "8e4afcf1b9b3ac54032a89ffc596e797",
"score": "0.48660606",
"text": "def reify; end",
"title": ""
},
{
"docid": "8e4afcf1b9b3ac54032a89ffc596e797",
"score": "0.48660606",
"text": "def reify; end",
"title": ""
},
{
"docid": "8e4afcf1b9b3ac54032a89ffc596e797",
"score": "0.48660606",
"text": "def reify; end",
"title": ""
},
{
"docid": "0daab03264bca447ea70857e63679ec4",
"score": "0.4865161",
"text": "def blend (smoothie_ingredients)\n#first thing I need to do is be able to print out all ingredients (ONLY). \ningredients = smoothie_ingredients.keys\n#ingredient should print out keys only\nall_in_blender = ingredients.join\n#all_in_blender should convert the array into a string\nblended1 = all_in_blender.split(\"\")\n#blended1 should take each character of the string and then putting it into a \n#an array\nblended2 = blended1.shuffle.join\n#blended2 shuffles the array and then makes it into one string\nfinished_blend = blended2.gsub(' ','')\n#finished_blend should take the white spaces out and put them all together like a\n#blended smoothie\nend",
"title": ""
},
{
"docid": "de87c26da5b63c905bdb07a816b1e5bf",
"score": "0.4863357",
"text": "def kesha_maker(array)\n kesha = []\n array.each do |word|\n word_array = word.split \"\"\n word_array[2] = \"$\"\n kesha << word_array.join\n end\n kesha\n end",
"title": ""
},
{
"docid": "d1df9eff21c76d43bad75df07b5c8079",
"score": "0.48601684",
"text": "def getUntaggedStr\n @untaggedTerms.join(' ')\n end",
"title": ""
},
{
"docid": "9aabf5757a9191563e6efd088aeb5f20",
"score": "0.48582786",
"text": "def solution(string)\n sliced = string.chars.each_slice(2).to_a\n \n if string.chars.length.odd?\n sliced.last.push(\"_\")\n end\n \n sliced.map {|sub_arr| sub_arr.join}\n \nend",
"title": ""
},
{
"docid": "ac9c2ac5a6c65840c3e431ee2939576f",
"score": "0.48580712",
"text": "def encode(plaintext)\n arr = []\n\n plaintext.split.each do |word|\n word.reverse!\n target_letter = word.slice!(0)\n arr << word + target_letter\n end\n\n arr.join(\" \")\nend",
"title": ""
},
{
"docid": "50baba7f55d66f0e714c5fef76c22d7f",
"score": "0.48507145",
"text": "def swap_elements(string)\n new_array = []\n new_array << string[0]\n new_array << string[2]\n new_array << string[1]\n new_array\nend",
"title": ""
},
{
"docid": "288c9e6fb77327c2470320745df01dce",
"score": "0.48493755",
"text": "def rmDBrakets (str) \n return str[(str.index('[[')) + 2..(str.index(']]') - 1)]\n end",
"title": ""
},
{
"docid": "dc629049152638bcf4f1e0c34170cf90",
"score": "0.4846877",
"text": "def decode(moved)\n\t\tif moved[21] != nil\n\t\t\tmoved.drop[21]\n\t\tend\n\toriginal_left = [\"a\"..\"e\"]\n\toriginal = original_left + moved\n\toriginal\n\tend",
"title": ""
},
{
"docid": "4f6296cf0047134e9e556030e4f3aee4",
"score": "0.48401",
"text": "def tricky_method_two(a_string_param, an_array_param)\n a_string_param.gsub!('pumpkins', 'rutabaga') # mutates the string and replace pumpkins with rutabaga\n an_array_param = ['pumpkins', 'rutabaga'] # sets array equal to ['pumpkins', 'rutabaga'] but can't change the actual initical variable\nend",
"title": ""
},
{
"docid": "fd6e4daa5faaca7a8a9325e86a985017",
"score": "0.48394403",
"text": "def word_substituter(string)\n shortened = []\n string.split.each { |word| shortened << dictionary(word) }\n shortened.join(\" \")\nend",
"title": ""
},
{
"docid": "1dca08785ff2d72f0f41b2399d42639a",
"score": "0.48387635",
"text": "def getMulDimArrFromFlavorJson\n str = ENV['RELEASE_PRODUCT_FLAVORS_WITH_JSON']\n arr = str.tr(\"\\n\",\"\").strip.split(/[,|:]/m)\n bigArr = []\n arr.each_with_index { | x, index| arr[index] = x.strip }\n\n UI.user_error!(\"ENV['RELEASE_PRODUCT_FLAVORS_WITH_JSON'] isn't valid. Use a double point as separator between a flavor and json pair.\") if arr.count.odd?\n \n single = 0\n pair = 0\n while single < (arr.count)\n if single.even?\n bigArr += [[]]\n bigArr[pair][0] = arr[single]\n else\n bigArr[pair][1] = arr[single]\n pair += 1\n end\n single += 1\n end \n return bigArr\nend",
"title": ""
},
{
"docid": "188c5a78dfd62ebce68a4abf112966e4",
"score": "0.48284274",
"text": "def word_substituter(tweet)\n shortened = []\n\n tweet_words = tweet.split\n\n tweet_words.each do |word|\n short_form = dictionary(word.downcase)\n if short_form\n shortened << short_form\n else\n shortened << word\n end\n end\n\n shortened.join(' ')\nend",
"title": ""
},
{
"docid": "54d12a99336737f8029db975044348ec",
"score": "0.48276183",
"text": "def change_word(word)\n word[0], word[-1] = word[-1], word[0]\n word\nend",
"title": ""
},
{
"docid": "4fc2e5276a0bdab33121d76bdd4c9057",
"score": "0.48257503",
"text": "def awesomesauced(strings)\n final_array = []\n strings.each do |string|\n final_array << string\n final_array << \"awesomesauce\"\n end\n final_array.pop\n return final_array\nend",
"title": ""
},
{
"docid": "07fe3e38287da8670e69ff94f1e1da33",
"score": "0.4824324",
"text": "def parse_key(key)\n keys = key.split(\"[\")\n if keys.length > 1\n all_keys_except_first = keys[1..-1].map{|v| v[0...-1]}\n keys = [keys[0]] + (all_keys_except_first)\n end\n keys\n end",
"title": ""
},
{
"docid": "7d17608cb1d859ee3003a6f9136fded3",
"score": "0.48216617",
"text": "def make_array(name)\n name = swap(name)\n name = name.split(\"\")\nend",
"title": ""
},
{
"docid": "fd25306960a49ccf053aa54eb81fed7c",
"score": "0.48195398",
"text": "def repeater_2(str)\n\n\toriginal = str.chars\n\n\tduplicate = original.dup\n\n\toriginal.zip(duplicate).join\n\nend",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "74b6452517b4f9fd1991c51deb355584",
"score": "0.0",
"text": "def set_welcome_page\n @welcome_page = WelcomePage.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": ""
}
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.