watcard 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db3eab6c54d46f00699e1609a490e8bd91be61c5
4
- data.tar.gz: dd23c5e11ed1919b58905d2cccb9a9f88f570d6a
3
+ metadata.gz: d2bbcede77261b23a5ce0fa61a6b559afb7aaac7
4
+ data.tar.gz: e24ce3df5490d72ecec90ba9ebc7e2fbe61a8d53
5
5
  SHA512:
6
- metadata.gz: b2f2b029ea8f200283845408e96dd423d32c5c15619ecb3c62f88194be8426853c15e760ca5d3c1dbceb296d3c056dc31303fdf7199a31083b06df09a549b5ed
7
- data.tar.gz: b4ad1d09d230aa841ba932f7790bb249a5acbce658ba7ff30c2aac995bdfc37c118ab4832505785dfd315e3f2d28a853ac0b35d4322ddcd5b76c420c54bde9dc
6
+ metadata.gz: 416101087dcef732329cea8e8ec87385c21234aea4eaa6ed14e13847a4e488ad1918272064f0c8a898c0c9f2c91806384e46370ee2428790f88c6761462a7c1c
7
+ data.tar.gz: 459b8fd2d3ee391f8e3cd48875e7d618c23055f9c2fae0a5d8c72a8834e1979a12bd2cdd7b9a37b163e0b8368c5d83be6527bd54fc696886e2383a2d26bf9d74
@@ -3,6 +3,19 @@
3
3
  require "watcard"
4
4
  require "yaml"
5
5
 
6
+ MSG = <<END
7
+ Watcard CLI v#{Watcard::VERSION}
8
+ By Tristan Hume (http://thume.ca/)
9
+
10
+ # Commands:
11
+ hist [days ago]: Output meals for day
12
+ ledger [days ago]: Output ledger for day and optionally send to file.
13
+ ledgerall [days ago]: Like ledger but for all days since last add.
14
+ rawhist [days ago]: Output YAML transaction data for day, no bundling
15
+ lastadd: Output date history was added to ledger
16
+
17
+ END
18
+
6
19
  FILE = File.expand_path("~/.watcard.yml")
7
20
 
8
21
  begin
@@ -30,8 +43,5 @@ when "lastadd"
30
43
  date = hist.last_ledger_add
31
44
  puts "#{(Date.today-date).to_i} days ago on #{date}"
32
45
  else
33
- puts "Watcard CLI v#{Watcard::VERSION}"
34
- puts "By Tristan Hume"
35
- puts ""
36
- puts "Unknown command"
46
+ puts MSG
37
47
  end
@@ -37,8 +37,10 @@ module Watcard
37
37
  return "V1 Cafeteria" if loc =~ /WAT-FS-V1/
38
38
  return "Liquid Assets" if loc =~ /WAT-FS-LA/
39
39
  return "V1 Laundry" if loc =~ /V1 LAUNDRY/
40
+ return "V1 Front Desk" if loc =~ /V1DESK/
40
41
  return "Media.Doc" if loc =~ /MEDIA.DOC/
41
- loc
42
+ return "Student Health Pharmacy" if loc =~ /STUDENT HEALTH/
43
+ loc.strip
42
44
  end
43
45
 
44
46
  def history(date)
@@ -64,8 +66,10 @@ module Watcard
64
66
  h = a[:time].hour
65
67
  type = if a[:loc] =~ /laundry/i
66
68
  "Laundry"
67
- elsif a[:loc] =~ /media/i
69
+ elsif a[:loc] =~ /media|desk/i
68
70
  "Printing"
71
+ elsif a[:loc] =~ /pharmacy/i
72
+ "Health Supplies"
69
73
  elsif h < 11
70
74
  "Breakfast"
71
75
  elsif h < 17
@@ -1,3 +1,3 @@
1
1
  module Watcard
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: watcard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tristan Hume
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-16 00:00:00.000000000 Z
11
+ date: 2014-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri