aces / cbrain

CBRAIN is a flexible Ruby on Rails framework for accessing and processing of large data on high-performance computing infrastructures.
GNU General Public License v3.0
71 stars 42 forks source link

Create and document old and new console tools #138

Open prioux opened 9 years ago

prioux commented 9 years ago

We've got a bunch of utilities deployed, and utilities planned, that are worthwhile additions to the rails console environment. We need to document them in the wiki, and within the console. Some need rewriting.

Create new Bourreau status and control utility:

Will replace ALL of this within a curse-based interactive tool:

Interface will present:

# scratch version
def hl
  s = Time.now
  r =yield
  f = Time.now
  puts r.inspect
  puts "Time taken: #{f-s}"
end
# Todo: accept ActiveRecord::Relation in argument too
# Todo: show table in nice format like mysql shell does
def shl(sql)
  hl do 
    x=ActiveRecord::Base.connection.execute(sql)
    ([x.fields] + x.to_a).each do |r|
      puts r.inspect
    end
  end
end
prioux commented 8 years ago

80% done.

prioux commented 8 years ago

Document in Wiki.