three-usage 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,7 @@
1
+ = 0.0.2 2009-03-27
2
+
3
+ * 1 minor enhancement:
4
+ * -f option actually shows a pretty table now instead of pretty printing some objects
1
5
  == 0.0.1 2009-02-17
2
6
 
3
7
  * 1 major enhancement:
data/Rakefile CHANGED
@@ -8,9 +8,9 @@ $hoe = Hoe.new('three-usage', ThreeUsage::VERSION) do |p|
8
8
  p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
9
9
  p.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
10
10
  p.rubyforge_name = p.name # TODO this is default value
11
- # p.extra_deps = [
12
- # ['activesupport','>= 2.0.2'],
13
- # ]
11
+ p.extra_deps = [
12
+ ['mechanize','>= 0.9.0'],
13
+ ]
14
14
  p.extra_dev_deps = [
15
15
  ['newgem', ">= #{::Newgem::VERSION}"]
16
16
  ]
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module ThreeUsage
5
- VERSION = '0.0.1'
5
+ VERSION = '0.0.2'
6
6
  end
@@ -65,9 +65,7 @@ module ThreeUsage
65
65
  parser = Parser.new(fetcher.page)
66
66
 
67
67
  if options[:full_details]
68
- parser.usage_blocks.each do |usage_block|
69
- pp usage_block
70
- end
68
+ parser.print_table
71
69
  else
72
70
  puts 'Remaining Usage: ' + parser.remaining_three_quota.to_s + ' MB'
73
71
  end
@@ -22,5 +22,27 @@ module ThreeUsage
22
22
  def remaining_three_quota
23
23
  three_usage_blocks.inject(0){|sum,item| sum + item.remaining}
24
24
  end
25
+
26
+ def print_table
27
+ printf "+-"
28
+ printf "-" * 40
29
+ printf "-+-"
30
+ printf "-" * 20
31
+ printf "-+-"
32
+ printf "-" * 20
33
+ printf "-+\n"
34
+
35
+ @usage_blocks.each do |usage_block|
36
+ printf("| %40s | %20s | %20s |\n", usage_block.description, usage_block.remaining, usage_block.expires_at)
37
+ end
38
+
39
+ printf "+-"
40
+ printf "-" * 40
41
+ printf "-+-"
42
+ printf "-" * 20
43
+ printf "-+-"
44
+ printf "-" * 20
45
+ printf "-+\n"
46
+ end
25
47
  end
26
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: three-usage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Harper
@@ -9,9 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-28 00:00:00 +10:00
12
+ date: 2009-03-27 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: mechanize
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.9.0
24
+ version:
15
25
  - !ruby/object:Gem::Dependency
16
26
  name: newgem
17
27
  type: :development
@@ -20,7 +30,7 @@ dependencies:
20
30
  requirements:
21
31
  - - ">="
22
32
  - !ruby/object:Gem::Version
23
- version: 1.2.3
33
+ version: 1.3.0
24
34
  version:
25
35
  - !ruby/object:Gem::Dependency
26
36
  name: hoe