Sha256: 9557eb99a66551f96f9b6c6d0a76a7559b560a39bb0de0e89f2c29e5a2064a1c

Contents?: true

Size: 1.93 KB

Versions: 7

Compression:

Stored size: 1.93 KB

Contents

module Idonethis::Adapters
  module Views
    module Cli
      module List
        class << self
          def apply(dones=[])
            dones.select{|it| it["is_goal"] == false}.each_with_index do |d,i|
              #{
              # "id"=>22609300, "created"=>"2015-09-09T06:26:07.120", "updated"=>"2015-09-19T13:00:03.570", "markedup_text"=>"fix api smoke", "done_date"=>"2015-09-20", "owner"=>"ben.biddington",
              # "team_short_name"=>"benbiddington-personal", "tags"=>[], "likes"=>[], "comments"=>[], "meta_data"=>{}, "is_goal"=>true, "goal_completed"=>false,
              # "url"=>"https://idonethis.com/api/v0.1/dones/22609300/", "team"=>"https://idonethis.com/api/v0.1/teams/benbiddington-personal/", "raw_text"=>"[ ] fix api smoke", "permalink"=>"https://idonethis.com/done/22609300/"}
              # puts d.inspect
              printf("%-5s", i+1); print(%Q{#{d["created"]} #{d["team_short_name"]} }); printf("%-20s", d["owner"]); print(%Q{ -- #{d["raw_text"].slice(0,150)}}); print("\n")
            end
          end
        end
      end
      
      module Teams
        class << self
          def apply(teams=[])
            teams.select.each_with_index do |d,i|
              #{ 
              # "updated"=>"2015-05-20T23:53:58.831", "created"=>"2015-05-20T23:53:48.357", 
              # "done_count"=>138, 
              # "url"=>"https://idonethis.com/api/v0.1/teams/benbiddington-personal/", 
              # "name"=>"ben.biddington personal", "short_name"=>"benbiddington-personal", 
              # "dones"=>"https://idonethis.com/api/v0.1/dones/?team=benbiddington-personal", "is_personal"=>true, "permalink"=>"https://idonethis.com/cal/benbiddington-personal/"}
              printf("%-5s", i+1); print(%Q{#{d["updated"]}}); print(" "); printf("%-30s", d["name"]); printf("%-5s", %Q{(#{d["done_count"]})}); print(" "); print(%Q{#{d["permalink"]}}); print("\n")
            end
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
idonethis-cli-0.14.2 lib/adapters/views/cli.rb
idonethis-cli-0.14.1 lib/adapters/views/cli.rb
idonethis-cli-0.14.0 lib/adapters/views/cli.rb
idonethis-cli-0.13.3 lib/adapters/views/cli.rb
idonethis-cli-0.13.2 lib/adapters/views/cli.rb
idonethis-cli-0.13.1 lib/adapters/views/cli.rb
idonethis-cli-0.13.0 lib/adapters/views/cli.rb