wkcheck 0.0.3 → 0.0.4
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 +4 -4
 - data/README.md +1 -1
 - data/lib/wkcheck.rb +9 -12
 - data/wkcheck.gemspec +2 -2
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 2d5af8c4a8ee17ccf4b5764f76ae8d0a3eb6f52f
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 74f48bcb6a70ffa7f299eae4c6bec0a6ab066152
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 199f27b95dcb1243f83eb656645284bb84cf9240146961d8bc451121c85b191cd4df5c504bf9b931297040ab20ed3863276c4d7038bf144df5fe90635c35ca00
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 59e50229a3743e8d303b600ed58a4076f846de338abeb09ffd94bbe8dc71e5b2ddc0adb33c54d1da6f18562667d19db8288cbf7cc414b5588bb0ef3e3622580e
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -1,4 +1,4 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
            [](https://travis-ci.org/dennmart/wkcheck)
         
     | 
| 
      
 1 
     | 
    
         
            +
            [](https://travis-ci.org/dennmart/wkcheck) [](https://codeclimate.com/github/dennmart/wkcheck)
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
       3 
3 
     | 
    
         
             
            **wkcheck** is a command-line tool to access information from your [WaniKani](http://www.wanikani.com/) account.
         
     | 
| 
       4 
4 
     | 
    
         | 
    
        data/lib/wkcheck.rb
    CHANGED
    
    | 
         @@ -2,7 +2,7 @@ require 'wanikani' 
     | 
|
| 
       2 
2 
     | 
    
         
             
            require 'rainbow'
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
4 
     | 
    
         
             
            module WKCheck
         
     | 
| 
       5 
     | 
    
         
            -
              VERSION = "0.0. 
     | 
| 
      
 5 
     | 
    
         
            +
              VERSION = "0.0.4"
         
     | 
| 
       6 
6 
     | 
    
         
             
              CONFIG_FILE = "#{Dir.home}/.wkcheck.yml"
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
       8 
8 
     | 
    
         
             
              class Stats
         
     | 
| 
         @@ -10,13 +10,15 @@ module WKCheck 
     | 
|
| 
       10 
10 
     | 
    
         
             
                  queue = Wanikani::StudyQueue.queue
         
     | 
| 
       11 
11 
     | 
    
         
             
                  lessons = queue["lessons_available"]
         
     | 
| 
       12 
12 
     | 
    
         
             
                  reviews = queue["reviews_available"]
         
     | 
| 
       13 
     | 
    
         
            -
                  next_review_date = Time.at(queue["next_review_date"]). 
     | 
| 
      
 13 
     | 
    
         
            +
                  next_review_date = Time.at(queue["next_review_date"]).strftime("%A, %B %-d at %-l:%M %p")
         
     | 
| 
       14 
14 
     | 
    
         
             
                  queue_message(lessons, reviews, next_review_date)
         
     | 
| 
       15 
15 
     | 
    
         
             
                end
         
     | 
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                def level_progression
         
     | 
| 
       18 
18 
     | 
    
         
             
                  progress = Wanikani::Level.progression
         
     | 
| 
       19 
     | 
    
         
            -
                   
     | 
| 
      
 19 
     | 
    
         
            +
                  message = "Your progress for level #{progress["current_level"]}:\n".color(:green)
         
     | 
| 
      
 20 
     | 
    
         
            +
                  message += progression_message(progress, "radicals")
         
     | 
| 
      
 21 
     | 
    
         
            +
                  message += progression_message(progress, "kanji")
         
     | 
| 
       20 
22 
     | 
    
         
             
                end
         
     | 
| 
       21 
23 
     | 
    
         | 
| 
       22 
24 
     | 
    
         
             
                private
         
     | 
| 
         @@ -29,18 +31,13 @@ module WKCheck 
     | 
|
| 
       29 
31 
     | 
    
         
             
                    reviews_msg = reviews.zero? ? "no".color(:green) : reviews.to_s.color(:red)
         
     | 
| 
       30 
32 
     | 
    
         
             
                    message = "You have #{lessons_msg} lessons pending"
         
     | 
| 
       31 
33 
     | 
    
         
             
                    message += "\nYou have #{reviews_msg} reviews pending"
         
     | 
| 
      
 34 
     | 
    
         
            +
                    message += "\nYou have more reviews coming your way on #{next_review_date.bright.color(:green)}."
         
     | 
| 
       32 
35 
     | 
    
         
             
                  end
         
     | 
| 
       33 
36 
     | 
    
         
             
                end
         
     | 
| 
       34 
37 
     | 
    
         | 
| 
       35 
     | 
    
         
            -
                def progression_message(progress)
         
     | 
| 
       36 
     | 
    
         
            -
                   
     | 
| 
       37 
     | 
    
         
            -
                   
     | 
| 
       38 
     | 
    
         
            -
             
     | 
| 
       39 
     | 
    
         
            -
                  message = "Your progress for level #{progress["current_level"]}:\n".color(:green)
         
     | 
| 
       40 
     | 
    
         
            -
                  message += "#{progress["radicals_progress"]} out of #{progress["radicals_total"]} radicals".color(:cyan)
         
     | 
| 
       41 
     | 
    
         
            -
                  message += " (#{radicals_percent.round(1)}%)\n"
         
     | 
| 
       42 
     | 
    
         
            -
                  message += "#{progress["kanji_progress"]} out of #{progress["kanji_total"]} Kanji".color(:cyan)
         
     | 
| 
       43 
     | 
    
         
            -
                  message += " (#{kanji_percent.round(1)}%)\n"
         
     | 
| 
      
 38 
     | 
    
         
            +
                def progression_message(progress, group)
         
     | 
| 
      
 39 
     | 
    
         
            +
                  percent = ((progress["#{group}_progress"].to_f / progress["#{group}_total"].to_f) * 100).round(1).to_s
         
     | 
| 
      
 40 
     | 
    
         
            +
                  message = "#{progress["#{group}_progress"]} out of #{progress["#{group}_total"]} #{group.capitalize} (#{percent.bright}%)\n".color(:cyan)
         
     | 
| 
       44 
41 
     | 
    
         
             
                end
         
     | 
| 
       45 
42 
     | 
    
         
             
              end
         
     | 
| 
       46 
43 
     | 
    
         
             
            end
         
     | 
    
        data/wkcheck.gemspec
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            Gem::Specification.new do |s|
         
     | 
| 
       2 
2 
     | 
    
         
             
              s.name          = "wkcheck"
         
     | 
| 
       3 
     | 
    
         
            -
              s.version       = "0.0. 
     | 
| 
       4 
     | 
    
         
            -
              s.date          = "2013-05- 
     | 
| 
      
 3 
     | 
    
         
            +
              s.version       = "0.0.4"
         
     | 
| 
      
 4 
     | 
    
         
            +
              s.date          = "2013-05-25"
         
     | 
| 
       5 
5 
     | 
    
         
             
              s.summary       = "Check your WaniKani stats from the command line"
         
     | 
| 
       6 
6 
     | 
    
         
             
              s.description   = "Check your pending lessons and reviews of your WaniKani account (http://www.wanikani.com/) from the command line"
         
     | 
| 
       7 
7 
     | 
    
         
             
              s.authors       = ["Dennis Martinez"]
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: wkcheck
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.4
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Dennis Martinez
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2013-05- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2013-05-25 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: wanikani
         
     |