Module: Cnvrg::Helpers
Instance Method Summary collapse
- #checkmark ⇒ Object
- #cnvrgignore_content ⇒ Object
-
#cpu_time ⇒ Object
cpu.
-
#get_mem(pid) ⇒ Object
memory.
- #linux? ⇒ Boolean
- #look_for_in_path(path, name) ⇒ Object
- #mac? ⇒ Boolean
- #netrc_domain ⇒ Object
- #readme_content ⇒ Object
- #remote_url ⇒ Object
- #wall_time ⇒ Object
- #windows? ⇒ Boolean
Instance Method Details
#checkmark ⇒ Object
5 6 7 8 |
# File 'lib/cnvrg/helpers.rb', line 5 def checkmark checkmark = "\u2713" return checkmark.encode('utf-8') end |
#cnvrgignore_content ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/cnvrg/helpers.rb', line 26 def cnvrgignore_content %{ # cnvrg ignore: Ignore the following directories and files # for example: # some_dir/ # some_file.txt }.strip end |
#cpu_time ⇒ Object
cpu
76 77 78 |
# File 'lib/cnvrg/helpers.rb', line 76 def cpu_time Process.clock_gettime(Process::CLOCK_PROCESS_CPUTIME_ID, :microsecond) end |
#get_mem(pid) ⇒ Object
memory
86 87 |
# File 'lib/cnvrg/helpers.rb', line 86 def get_mem(pid) end |
#linux? ⇒ Boolean
22 23 24 |
# File 'lib/cnvrg/helpers.rb', line 22 def linux? not mac? and not windows? end |
#look_for_in_path(path, name) ⇒ Object
64 65 66 67 68 69 70 71 72 |
# File 'lib/cnvrg/helpers.rb', line 64 def look_for_in_path(path, name) url_split = path.split("/") url_split.each_with_index do |u, i| if u == name return i end end return -1 end |
#mac? ⇒ Boolean
18 19 20 |
# File 'lib/cnvrg/helpers.rb', line 18 def mac? !!(RUBY_PLATFORM =~ /-darwin\d/) end |
#netrc_domain ⇒ Object
60 61 62 |
# File 'lib/cnvrg/helpers.rb', line 60 def netrc_domain "cnvrg.io" end |
#readme_content ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cnvrg/helpers.rb', line 35 def readme_content %{ # README This README would normally contain some context and description about the project. Things you may want to cover: * Data description * Benchmark and measurement guidelines * Used algorithms * Scores * Configurations * Requirements * How to run the experiments * ...}.strip end |
#remote_url ⇒ Object
10 11 12 |
# File 'lib/cnvrg/helpers.rb', line 10 def remote_url "https://cnvrg.io" end |
#wall_time ⇒ Object
80 81 82 |
# File 'lib/cnvrg/helpers.rb', line 80 def wall_time Process.clock_gettime(Process::CLOCK_MONOTONIC, :microsecond) end |
#windows? ⇒ Boolean
14 15 16 |
# File 'lib/cnvrg/helpers.rb', line 14 def windows? !!(RUBY_PLATFORM =~ /mswin32|mingw32/) end |