pocket-console 0.0.3 → 0.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc0b8dd701c6651154f56d9fad5535a6c6fcf29a
4
- data.tar.gz: a6f4d44afb4d88473b4a7c33dee4d38b8fa3a996
3
+ metadata.gz: f78cc241f93913fa1ffcacec1c73229ccc675589
4
+ data.tar.gz: 184eb1eafd3d474290c71edf54db200dd9a11fdf
5
5
  SHA512:
6
- metadata.gz: b23dff1be17a077ba7e1aff983809f22c7500485d63d22b6a160d1ce60bc0e9859ad7de19b4afa8d7222e7a81f10ca04ed4272b94e2a510c764066b27a1639e6
7
- data.tar.gz: f40dae27bcdab9da72e57cd0387e29f6d4325f35088486f843d9e6bdda86ac7a690643fe00dfd29c7b4a3d3b7dcb547b8b6718822cafe68ca86418056988d2d9
6
+ metadata.gz: dc8059d2beb1216fc6388f8876408338d380de6ea69266e3b9854dfe0942e6181af45b6237dd9e13a2a23a4493362cae01113e3fd743f81b97c22faa3c70ff36
7
+ data.tar.gz: 325fc6aebddb725c2d02ce3f91ac732484165c673524a78246930dd2ca8e53666a12aea32eaa439d2033f64dd6cba48ea2c40708d292dc021b9947326e40a1d2
data/CHANGELOG.md CHANGED
@@ -1,17 +1,19 @@
1
- # Changelog
1
+ # 0.1.0
2
2
 
3
- 0.0.3
4
- -----
5
- * [Added CHANGELOG and CHANGELOG.md.](https://github.com/HartasCuerdas/pocket-console/commit/master)
3
+ * Added read percentage for General Stats
4
+
5
+ # 0.0.3
6
+
7
+ * Added CHANGELOG.md.
8
+
9
+ # 0.0.2
6
10
 
7
- 0.0.2
8
- -----
9
11
  * [Fixed formatting for stats. Added post-install message.](https://github.com/HartasCuerdas/pocket-console/commit/d69ad28c2def909c2d47e3e47395e07cf78e9e26)
10
12
 
11
- 0.0.1
12
- -----
13
+ # 0.0.1
14
+
13
15
  * [Added dependencies to gemspec.](https://github.com/HartasCuerdas/pocket-console/commit/e2cbdd069c9665d0e35c95599d54511195e41f8d)
14
16
 
15
- 0.0.0
16
- -----
17
+ # 0.0.0
18
+
17
19
  * [The initial pocket-console gem is released.](https://github.com/HartasCuerdas/pocket-console/commit/d146239bdf73111dbf643d45d39f06f3da9e5e46)
data/lib/itemStats.rb CHANGED
@@ -2,9 +2,11 @@ require 'item'
2
2
 
3
3
  class ItemStats
4
4
 
5
- def initialize(taggedItems, untaggedItems)
5
+ def initialize(taggedItems, untaggedItems, readTaggedItems, readUntaggedItems)
6
6
  @taggedItems = taggedItems
7
7
  @untaggedItems = untaggedItems
8
+ @readTaggedItems = readTaggedItems
9
+ @readUntaggedItems = readUntaggedItems
8
10
  end
9
11
 
10
12
  def print
@@ -14,12 +16,14 @@ class ItemStats
14
16
  def printGeneralStats
15
17
  tagged = @taggedItems.length
16
18
  untagged = @untaggedItems.length
17
- puts '===================='
18
- puts ' General Stats '
19
- puts '--------------------'
20
- puts sprintf "%-15s %2d", 'Tagged items:', tagged
21
- puts sprintf "%-15s %2d", 'Untagged items:', untagged
22
- puts '--------------------'
19
+ pctReadTagged = (@readTaggedItems.to_f/tagged)*100
20
+ pctReadUntagged = (@readUntaggedItems.to_f/untagged)*100
21
+ puts '=============================='
22
+ puts ' General Stats '
23
+ puts '------------------------------'
24
+ puts sprintf "%-15s %2d (%2d%% read)", 'Tagged items:', tagged, pctReadTagged
25
+ puts sprintf "%-15s %2d (%2d%% read)", 'Untagged items:', untagged, pctReadUntagged
26
+ puts '------------------------------'
23
27
  end
24
28
 
25
29
  end
data/lib/pocketConsole.rb CHANGED
@@ -1,8 +1,10 @@
1
1
  class PocketConsole
2
2
 
3
- def initialize(taggedItems, untaggedItems)
3
+ def initialize(taggedItems, untaggedItems, readTaggedItems, readUntaggedItems)
4
4
  @taggedItems = taggedItems
5
5
  @untaggedItems = untaggedItems
6
+ @readTaggedItems = readTaggedItems
7
+ @readUntaggedItems = readUntaggedItems
6
8
  @tagCollection = TagCollection.new(taggedItems)
7
9
  end
8
10
 
@@ -15,7 +17,10 @@ class PocketConsole
15
17
  end
16
18
 
17
19
  def printGeneralStats
18
- itemStats = ItemStats.new(@taggedItems, @untaggedItems)
20
+ itemStats = ItemStats.new(
21
+ @taggedItems, @untaggedItems,
22
+ @readTaggedItems, @readUntaggedItems
23
+ )
19
24
  itemStats.print
20
25
  end
21
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pocket-console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Cedillo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-25 00:00:00.000000000 Z
11
+ date: 2014-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pocket-classes