twdeps 1.0.2 → 1.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 +4 -4
- data/.travis.yml +1 -1
- data/Gemfile.lock +9 -4
- data/README.md +7 -3
- data/lib/twdeps/graph.rb +5 -4
- data/lib/twdeps/version.rb +1 -1
- data/test/fixtures/dead-dependency.json +14 -0
- data/test/test_helper.rb +1 -0
- data/test/unit/test_broken_dependencies.rb +28 -0
- data/test/unit/test_graph.rb +0 -1
- data/twdeps.gemspec +1 -0
- metadata +20 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 21e937aa5bc22ba04dce7989b7f230eee6e32d0beeebad1d5342b6b4a8fea74a
         | 
| 4 | 
            +
              data.tar.gz: 4e5424264d551351b0b64ef549ca4381293fd6622bad709e42e1856a507edc67
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: af9dc05e434ec0ef6c56134b1ebbd08b8292f02f636ab4279eca6c949d5c733e62c97e34da902e51188e00860cdbee22dd53edf7d708de9670a5ea2ba342ecd9
         | 
| 7 | 
            +
              data.tar.gz: 2e42fb492cf2c8219b3ce0b7fb52bbb76740f72d057ae7ba14a4b4beb85ff31faf3a15dfd75a98614c5e666bbcbadea35a549a12bae8916f0d7841c2e5cd3cc3
         | 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                twdeps (1.0 | 
| 4 | 
            +
                twdeps (1.1.0)
         | 
| 5 5 | 
             
                  optimist
         | 
| 6 6 | 
             
                  ruby-graphviz
         | 
| 7 7 | 
             
                  taskwarrior (~> 1.0.0)
         | 
| @@ -9,13 +9,14 @@ PATH | |
| 9 9 | 
             
            GEM
         | 
| 10 10 | 
             
              remote: https://rubygems.org/
         | 
| 11 11 | 
             
              specs:
         | 
| 12 | 
            -
                activemodel (5.2.1)
         | 
| 13 | 
            -
                  activesupport (= 5.2.1)
         | 
| 14 | 
            -
                activesupport (5.2.1)
         | 
| 12 | 
            +
                activemodel (5.2.1.1)
         | 
| 13 | 
            +
                  activesupport (= 5.2.1.1)
         | 
| 14 | 
            +
                activesupport (5.2.1.1)
         | 
| 15 15 | 
             
                  concurrent-ruby (~> 1.0, >= 1.0.2)
         | 
| 16 16 | 
             
                  i18n (>= 0.7, < 2)
         | 
| 17 17 | 
             
                  minitest (~> 5.1)
         | 
| 18 18 | 
             
                  tzinfo (~> 1.1)
         | 
| 19 | 
            +
                byebug (10.0.2)
         | 
| 19 20 | 
             
                coderay (1.1.2)
         | 
| 20 21 | 
             
                concurrent-ruby (1.1.3)
         | 
| 21 22 | 
             
                ffi (1.9.25)
         | 
| @@ -54,6 +55,9 @@ GEM | |
| 54 55 | 
             
                pry (0.12.2)
         | 
| 55 56 | 
             
                  coderay (~> 1.1.0)
         | 
| 56 57 | 
             
                  method_source (~> 0.9.0)
         | 
| 58 | 
            +
                pry-byebug (3.6.0)
         | 
| 59 | 
            +
                  byebug (~> 10.0)
         | 
| 60 | 
            +
                  pry (~> 0.10)
         | 
| 57 61 | 
             
                rake (12.3.1)
         | 
| 58 62 | 
             
                rb-fsevent (0.10.3)
         | 
| 59 63 | 
             
                rb-inotify (0.9.10)
         | 
| @@ -77,6 +81,7 @@ DEPENDENCIES | |
| 77 81 | 
             
              guard-bundler
         | 
| 78 82 | 
             
              guard-minitest
         | 
| 79 83 | 
             
              minitest
         | 
| 84 | 
            +
              pry-byebug
         | 
| 80 85 | 
             
              rake
         | 
| 81 86 | 
             
              twdeps!
         | 
| 82 87 | 
             
              twtest
         | 
    
        data/README.md
    CHANGED
    
    | @@ -17,13 +17,17 @@ Result: | |
| 17 17 |  | 
| 18 18 | 
             
            
         | 
| 19 19 |  | 
| 20 | 
            -
            For the impatient: The JSON export is also available as [party.json](https://raw.github.com/nerab/twdeps/master/test/fixtures/party.json).  | 
| 20 | 
            +
            For the impatient: The JSON export is also available as [party.json](https://raw.github.com/nerab/twdeps/master/test/fixtures/party.json). Once you installed `twdeps`, the command
         | 
| 21 21 |  | 
| 22 22 | 
             
            ```bash
         | 
| 23 | 
            -
            $ twdeps -f png  | 
| 23 | 
            +
            $ curl https://raw.githubusercontent.com/nerab/twdeps/master/test/fixtures/party.json | twdeps -f png > party.png
         | 
| 24 24 | 
             
            ```
         | 
| 25 25 |  | 
| 26 | 
            -
            will generate `party.png` in the current directory.
         | 
| 26 | 
            +
            will generate `party.png` in the current directory. If you don't want to download the JSON file, try the local oen that comes with `twdeps`:
         | 
| 27 | 
            +
             | 
| 28 | 
            +
            ```bash
         | 
| 29 | 
            +
            $ twdeps $(dirname $(gem which twdeps))/../test/fixtures/party.json -f png > party.png
         | 
| 30 | 
            +
            ```
         | 
| 27 31 |  | 
| 28 32 | 
             
            ## Installation
         | 
| 29 33 |  | 
    
        data/lib/twdeps/graph.rb
    CHANGED
    
    | @@ -39,10 +39,11 @@ module TaskWarrior | |
| 39 39 |  | 
| 40 40 | 
             
                      # resolve all dependencies we don't know yet
         | 
| 41 41 | 
             
                      task.dependencies.each do |dependency|
         | 
| 42 | 
            -
                         | 
| 43 | 
            -
             | 
| 44 | 
            -
             | 
| 45 | 
            -
                         | 
| 42 | 
            +
                        next if @dependencies.include?(dependency)
         | 
| 43 | 
            +
                        next if dependency.nil?
         | 
| 44 | 
            +
             | 
| 45 | 
            +
                        @dependencies << dependency
         | 
| 46 | 
            +
                        self << dependency
         | 
| 46 47 | 
             
                      end
         | 
| 47 48 | 
             
                    else
         | 
| 48 49 | 
             
                      # it's a project
         | 
    
        data/lib/twdeps/version.rb
    CHANGED
    
    
| @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            [{
         | 
| 2 | 
            +
              "id": 42,
         | 
| 3 | 
            +
              "depends": "9c16b278-6c79-407e-be1b-3eb65e4b11be",
         | 
| 4 | 
            +
              "description": "Handle dead depends",
         | 
| 5 | 
            +
              "entry": "20101121T205311Z",
         | 
| 6 | 
            +
              "project": "FixAllTheBugs",
         | 
| 7 | 
            +
              "status": "pending",
         | 
| 8 | 
            +
              "uuid": "2170fecc-0646-4320-99e0-75ed3c365f1c",
         | 
| 9 | 
            +
              "annotations": [{
         | 
| 10 | 
            +
                "entry": "20130210T173348Z",
         | 
| 11 | 
            +
                "description": "This is a comment"
         | 
| 12 | 
            +
              }],
         | 
| 13 | 
            +
              "urgency": -1.2
         | 
| 14 | 
            +
            }]
         | 
    
        data/test/test_helper.rb
    CHANGED
    
    
| @@ -0,0 +1,28 @@ | |
| 1 | 
            +
            require 'test_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module TaskWarrior
         | 
| 4 | 
            +
              module Test
         | 
| 5 | 
            +
                class TestBrokenDependencies < MiniTest::Test
         | 
| 6 | 
            +
                  include TaskWarrior::Test::Fixtures
         | 
| 7 | 
            +
             | 
| 8 | 
            +
                  def setup
         | 
| 9 | 
            +
                    graph = TaskWarrior::Dependencies::Graph.new(self.class.name)
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                    TaskWarrior::Repository.new(File.read(fixture('dead-dependency.json'))).tasks.each do |task|
         | 
| 12 | 
            +
                      graph << task
         | 
| 13 | 
            +
                    end
         | 
| 14 | 
            +
             | 
| 15 | 
            +
                    @parsed_graph = TaskWarrior::Test::PlainGraphParser.new(graph.render(:plain))
         | 
| 16 | 
            +
                  end
         | 
| 17 | 
            +
             | 
| 18 | 
            +
             | 
| 19 | 
            +
                  def test_node_size
         | 
| 20 | 
            +
                    assert_equal(2, @parsed_graph.nodes.size)
         | 
| 21 | 
            +
                  end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
                  def test_node_text
         | 
| 24 | 
            +
                    refute_nil(@parsed_graph.node('2170fecc-0646-4320-99e0-75ed3c365f1c'))
         | 
| 25 | 
            +
                  end
         | 
| 26 | 
            +
                end
         | 
| 27 | 
            +
              end
         | 
| 28 | 
            +
            end
         | 
    
        data/test/unit/test_graph.rb
    CHANGED
    
    
    
        data/twdeps.gemspec
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: twdeps
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0 | 
| 4 | 
            +
              version: 1.1.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Nicholas E. Rabenau
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018- | 
| 11 | 
            +
            date: 2018-12-03 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: ruby-graphviz
         | 
| @@ -122,6 +122,20 @@ dependencies: | |
| 122 122 | 
             
                - - ">="
         | 
| 123 123 | 
             
                  - !ruby/object:Gem::Version
         | 
| 124 124 | 
             
                    version: '0'
         | 
| 125 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 126 | 
            +
              name: pry-byebug
         | 
| 127 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 128 | 
            +
                requirements:
         | 
| 129 | 
            +
                - - ">="
         | 
| 130 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 131 | 
            +
                    version: '0'
         | 
| 132 | 
            +
              type: :development
         | 
| 133 | 
            +
              prerelease: false
         | 
| 134 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 135 | 
            +
                requirements:
         | 
| 136 | 
            +
                - - ">="
         | 
| 137 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 138 | 
            +
                    version: '0'
         | 
| 125 139 | 
             
            description: Takes a TaskWarrior export and emits a graph that visualizes the dependencies
         | 
| 126 140 | 
             
              between tasks.
         | 
| 127 141 | 
             
            email:
         | 
| @@ -150,6 +164,7 @@ files: | |
| 150 164 | 
             
            - lib/twdeps/project_presenter.rb
         | 
| 151 165 | 
             
            - lib/twdeps/task_presenter.rb
         | 
| 152 166 | 
             
            - lib/twdeps/version.rb
         | 
| 167 | 
            +
            - test/fixtures/dead-dependency.json
         | 
| 153 168 | 
             
            - test/fixtures/no_deps.json
         | 
| 154 169 | 
             
            - test/fixtures/party.json
         | 
| 155 170 | 
             
            - test/fixtures/party2.json
         | 
| @@ -157,6 +172,7 @@ files: | |
| 157 172 | 
             
            - test/helpers/plain_graph_parser.rb
         | 
| 158 173 | 
             
            - test/integration/test_dependencies.rb
         | 
| 159 174 | 
             
            - test/test_helper.rb
         | 
| 175 | 
            +
            - test/unit/test_broken_dependencies.rb
         | 
| 160 176 | 
             
            - test/unit/test_graph.rb
         | 
| 161 177 | 
             
            - test/unit/test_presenters.rb
         | 
| 162 178 | 
             
            - twdeps.gemspec
         | 
| @@ -184,6 +200,7 @@ signing_key: | |
| 184 200 | 
             
            specification_version: 4
         | 
| 185 201 | 
             
            summary: Visualizes dependencies between TaskWarrior tasks.
         | 
| 186 202 | 
             
            test_files:
         | 
| 203 | 
            +
            - test/fixtures/dead-dependency.json
         | 
| 187 204 | 
             
            - test/fixtures/no_deps.json
         | 
| 188 205 | 
             
            - test/fixtures/party.json
         | 
| 189 206 | 
             
            - test/fixtures/party2.json
         | 
| @@ -191,5 +208,6 @@ test_files: | |
| 191 208 | 
             
            - test/helpers/plain_graph_parser.rb
         | 
| 192 209 | 
             
            - test/integration/test_dependencies.rb
         | 
| 193 210 | 
             
            - test/test_helper.rb
         | 
| 211 | 
            +
            - test/unit/test_broken_dependencies.rb
         | 
| 194 212 | 
             
            - test/unit/test_graph.rb
         | 
| 195 213 | 
             
            - test/unit/test_presenters.rb
         |