Skip to content

Commit

Permalink
record TERM, SHELL and uname -a, created_at -> recorded_at
Browse files Browse the repository at this point in the history
  • Loading branch information
Antono Vasiljev committed Apr 9, 2012
1 parent d0b8a58 commit b646918
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/shelr/recorder.rb
Expand Up @@ -32,11 +32,14 @@ def record!
end

def request_metadata
STDOUT.print "Provide HUMAN NAME for Your record: "
STDOUT.print "Provide some title for your record: "
@meta["title"] = STDIN.gets.strip
@meta["created_at"] = record_id
@meta["recorded_at"] = record_id
@meta["columns"] = @user_columns
@meta["rows"] = @user_rows
@meta["uname"] = `uname -a`
@meta["shell"] = ENV['SHELL']
@meta["term"] = ENV['TERM']
STDOUT.puts record_file('meta')
File.open(record_file('meta'), 'w+') do |meta|
meta.puts @meta.to_json
Expand Down
4 changes: 2 additions & 2 deletions spec/shelr/recorder_spec.rb
Expand Up @@ -42,10 +42,10 @@
subject.meta["columns"].should == 20
end

it "adds record_id to @meta as created_at" do
it "adds record_id to @meta as recorded_at" do
subject.stub(:record_id => 'ololo')
subject.request_metadata
subject.meta["created_at"].should == 'ololo'
subject.meta["recorded_at"].should == 'ololo'
end

it "reads title from stdin" do
Expand Down

0 comments on commit b646918

Please sign in to comment.