twdeps 1.0.2 → 1.1.0

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
  SHA256:
3
- metadata.gz: 02ba155ab3b383b038d5e2c4df847450dd105467d32a6d85210c077a1d9e409b
4
- data.tar.gz: 03360def6b47864ac9f31983597d35de084ae11be770a227a49261a2ce57703e
3
+ metadata.gz: 21e937aa5bc22ba04dce7989b7f230eee6e32d0beeebad1d5342b6b4a8fea74a
4
+ data.tar.gz: 4e5424264d551351b0b64ef549ca4381293fd6622bad709e42e1856a507edc67
5
5
  SHA512:
6
- metadata.gz: bede1f117238591b1c9f54935cbd8cbecddc250f731533635e074b21d479ec967cfdcdc4dbc752e7edb1d31426fe68040a14d1dd7e240fabda300933a54eec6f
7
- data.tar.gz: 833e77bc779e3fb92440691c7c8d513660b24948e2d5077d15f2f931ce8eee65406ac04a05455562e5e31a59ed91b33a0aeb9ff96a7a5d58d1f04bceb29e8bfb
6
+ metadata.gz: af9dc05e434ec0ef6c56134b1ebbd08b8292f02f636ab4279eca6c949d5c733e62c97e34da902e51188e00860cdbee22dd53edf7d708de9670a5ea2ba342ecd9
7
+ data.tar.gz: 2e42fb492cf2c8219b3ce0b7fb52bbb76740f72d057ae7ba14a4b4beb85ff31faf3a15dfd75a98614c5e666bbcbadea35a549a12bae8916f0d7841c2e5cd3cc3
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.5.1
4
+ - 2.5.3
5
5
 
6
6
  before_script:
7
7
  - mkdir ~/.task
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- twdeps (1.0.2)
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
  ![party](https://raw.github.com/nerab/twdeps/master/examples/party.png)
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). If you download it, the command
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 party.json > party.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
 
@@ -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
- unless @dependencies.include?(dependency)
43
- @dependencies << dependency
44
- self << dependency
45
- end
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
@@ -1,5 +1,5 @@
1
1
  module TaskWarrior
2
2
  module Dependencies
3
- VERSION = '1.0.2'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
@@ -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
+ }]
@@ -1,4 +1,5 @@
1
1
  require 'minitest/autorun'
2
+ require 'pry-byebug'
2
3
  require 'twtest'
3
4
  require 'twdeps'
4
5
  require 'helpers/plain_graph_parser.rb'
@@ -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
@@ -7,7 +7,6 @@ module TaskWarrior
7
7
 
8
8
  def setup
9
9
  repo = TaskWarrior::Repository.new(File.read(fixture('party_taxes.json')))
10
-
11
10
  plain = TaskWarrior::Dependencies::Graph.new(self.class.name)
12
11
 
13
12
  repo.tasks.each do |task|
@@ -22,4 +22,5 @@ Gem::Specification.new do |gem|
22
22
  gem.add_development_dependency 'guard-minitest'
23
23
  gem.add_development_dependency 'guard-bundler'
24
24
  gem.add_development_dependency 'rake'
25
+ gem.add_development_dependency 'pry-byebug'
25
26
  end
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.2
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-26 00:00:00.000000000 Z
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