Class: Ayadn::Debug
- Inherits:
-
Object
- Object
- Ayadn::Debug
- Defined in:
- lib/ayadn/debug.rb
Class Method Summary collapse
- .db(dbs) ⇒ Object
- .err(error) ⇒ Object
- .how_many_ranks(niceranks, get_these) ⇒ Object
- .http(response, url) ⇒ Object
- .niceranks_error(resp) ⇒ Object
- .ranks_pool(niceranks) ⇒ Object
- .stream(stream, options, target) ⇒ Object
- .total_ranks(niceranks) ⇒ Object
Class Method Details
.db(dbs) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ayadn/debug.rb', line 15 def self.db dbs if Settings.[:timeline][:show_debug] == true puts "/////\nSETTINGS\n" jj JSON.parse((Settings.config).to_json) jj JSON.parse((Settings.).to_json) puts "/////\n\n" puts ">>>>>\nDATABASES\n" dbs.each do |db| puts "Path:\t#{db.file}\nLength:\t#{db.size}\nSize:\t#{db.bytesize / 1024}KB" end puts ">>>>>\n\n" puts "^^^^^\nTOKEN\n" puts Settings.user_token puts "^^^^^\n\n" end end |
.err(error) ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/ayadn/debug.rb', line 34 def self.err error if Settings.[:timeline][:show_debug] == true puts "--*--\nTRACE:\n" raise error puts "\n--*--\n\n" end end |
.how_many_ranks(niceranks, get_these) ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/ayadn/debug.rb', line 42 def self.how_many_ranks niceranks, get_these if Settings.[:timeline][:show_debug] == true deb = "=====\n" deb << "NR from DB:\t#{niceranks}\n\n" deb << "NR to get:\t#{get_these}\n" deb << "=====\n" puts deb.color(Settings.[:colors][:debug]) end end |
.http(response, url) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/ayadn/debug.rb', line 5 def self.http response, url if Settings.[:timeline][:show_debug] == true deb = ":::::\n" deb << "Url:\t\t#{url}\n\n" deb << "Headers:\t#{response.headers}\n" deb << ":::::\n" puts deb.color(Settings.[:colors][:debug]) end end |
.niceranks_error(resp) ⇒ Object
61 62 63 64 65 66 67 68 |
# File 'lib/ayadn/debug.rb', line 61 def self.niceranks_error resp if Settings.[:timeline][:show_debug] == true deb = "=====\n" deb << "NR Error:\t#{resp}\n" deb << "=====\n" puts deb.color(Settings.[:colors][:debug]) end end |
.ranks_pool(niceranks) ⇒ Object
52 53 54 55 56 57 58 59 |
# File 'lib/ayadn/debug.rb', line 52 def self.ranks_pool niceranks if Settings.[:timeline][:show_debug] == true deb = "=====\n" deb << "NR in pool:\t#{niceranks}\n" deb << "=====\n" puts deb.color(Settings.[:colors][:debug]) end end |
.stream(stream, options, target) ⇒ Object
80 81 82 83 84 85 86 87 88 |
# File 'lib/ayadn/debug.rb', line 80 def self.stream stream, , target if Settings.[:timeline][:show_debug] == true deb = "+++++\nStream meta:\t#{stream['meta']}\n\n" deb << "Options:\t#{options.inspect}\n\n" deb << "Target:\t\t#{target.inspect}\n\n" deb << "Posts:\t\t#{stream['data'].length}\n+++++\n" puts deb.color(Settings.[:colors][:debug]) end end |
.total_ranks(niceranks) ⇒ Object
70 71 72 73 74 75 76 77 78 |
# File 'lib/ayadn/debug.rb', line 70 def self.total_ranks niceranks if Settings.[:timeline][:show_debug] == true deb = "=====\n" deb << "NiceRanks:\t#{niceranks}\n\n" deb << "DB size:\t#{Databases.nicerank.size}\n" deb << "=====\n" puts deb.color(Settings.[:colors][:debug]) end end |