tudu 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,11 @@
1
1
  # encoding: utf-8
2
2
  require 'spec_helper'
3
3
  require 'tudu_core'
4
+ require 'tudu_paths'
5
+ require 'tudu_templates'
6
+ require 'tasks'
4
7
 
8
+ # rubocop:disable LineLength, UnusedMethodArgument
5
9
  describe Tudu::Core do
6
10
  context :init do
7
11
  cases = [
@@ -9,18 +13,18 @@ describe Tudu::Core do
9
13
  case_no: 1,
10
14
  case_title: 'valid case',
11
15
  expected_files: [
12
- Tudu::Tasks::TUDU_FILE,
13
- Tudu::Tasks::TUDU_TODOS_FILE,
14
- Tudu::Tasks::TUDU_DOINGS_FILE,
15
- Tudu::Tasks::TUDU_DONES_FILE
16
+ Tudu::TuduPaths::TUDU_FILE,
17
+ Tudu::TuduPaths::TUDU_TODOS_FILE,
18
+ Tudu::TuduPaths::TUDU_DOINGS_FILE,
19
+ Tudu::TuduPaths::TUDU_DONES_FILE
16
20
  ],
17
21
  expected_contents: [
18
- Tudu::Tasks::TUDU_FILE_TEMPLATE,
19
- Tudu::Tasks::TUDU_TODOS_FILE_TEMPLATE,
20
- Tudu::Tasks::TUDU_DOINGS_FILE_TEMPLATE,
21
- Tudu::Tasks::TUDU_DONES_FILE_TEMPLATE
22
- ],
23
- },
22
+ Tudu::Templates::TUDU_FILE_TEMPLATE,
23
+ Tudu::Templates::TUDU_TODOS_FILE_TEMPLATE,
24
+ Tudu::Templates::TUDU_DOINGS_FILE_TEMPLATE,
25
+ Tudu::Templates::TUDU_DONES_FILE_TEMPLATE
26
+ ]
27
+ }
24
28
  ]
25
29
 
26
30
  cases.each do |c|
@@ -49,7 +53,7 @@ describe Tudu::Core do
49
53
  end
50
54
 
51
55
  def case_after(c)
52
- return unless File.exists? './tudu'
56
+ return unless File.exist? './tudu'
53
57
  FileUtils.rm_rf('./tudu')
54
58
  end
55
59
  end
@@ -79,7 +83,7 @@ describe Tudu::Core do
79
83
  task_names1: 'task_name1',
80
84
  task_names2: 'task_name2',
81
85
  task_names3: 'task_name3',
82
- expected: %w{task_name1 task_name2 task_name3}
86
+ expected: %w(task_name1 task_name2 task_name3)
83
87
  },
84
88
  {
85
89
  case_no: 4,
@@ -88,7 +92,7 @@ describe Tudu::Core do
88
92
  task_names2: 'task_name1',
89
93
  task_names3: nil,
90
94
  expected: ['task_name1']
91
- },
95
+ }
92
96
  ]
93
97
 
94
98
  cases.each do |c|
@@ -116,7 +120,7 @@ describe Tudu::Core do
116
120
  end
117
121
 
118
122
  def case_after(c)
119
- return unless File.exists? './tudu'
123
+ return unless File.exist? './tudu'
120
124
  FileUtils.rm_rf('./tudu')
121
125
  end
122
126
  end
@@ -129,22 +133,22 @@ describe Tudu::Core do
129
133
  case_title: 'single remove',
130
134
  task_names1: 'task_name',
131
135
  task_names2: nil,
132
- task_names3: nil,
136
+ task_names3: nil
133
137
  },
134
138
  {
135
139
  case_no: 2,
136
140
  case_title: 'multi remove',
137
141
  task_names1: 'task_name1',
138
142
  task_names2: 'task_name2',
139
- task_names3: 'task_name3',
143
+ task_names3: 'task_name3'
140
144
  },
141
145
  {
142
146
  case_no: 3,
143
147
  case_title: 'not remove',
144
148
  task_names1: 'invalid name',
145
149
  task_names2: nil,
146
- task_names3: nil,
147
- },
150
+ task_names3: nil
151
+ }
148
152
  ]
149
153
 
150
154
  cases.each do |c|
@@ -163,7 +167,7 @@ describe Tudu::Core do
163
167
  # -- then --
164
168
  [c[:task_names1], c[:task_names2], c[:task_names3]].each do |e|
165
169
  actual = false
166
- %w{./tudu/todos ./tudu/doings ./tudu/dones}.each do |f|
170
+ %w(./tudu/todos ./tudu/doings ./tudu/dones).each do |f|
167
171
  actual = true if File.read(f).split("\n").include?(e)
168
172
  end
169
173
  expect(actual).to be_false
@@ -178,7 +182,7 @@ describe Tudu::Core do
178
182
  end
179
183
 
180
184
  def case_after(c)
181
- return unless File.exists? './tudu'
185
+ return unless File.exist? './tudu'
182
186
  FileUtils.rm_rf('./tudu')
183
187
  end
184
188
  end
@@ -193,7 +197,7 @@ describe Tudu::Core do
193
197
  task_names2: 'task_name2',
194
198
  task_names3: 'task_name3',
195
199
  search_word: nil,
196
- expected: %w{task_name1 task_name2 task_name3}
200
+ expected: %w(task_name1 task_name2 task_name3)
197
201
  },
198
202
  {
199
203
  case_no: 2,
@@ -212,7 +216,7 @@ describe Tudu::Core do
212
216
  task_names3: 'task_name2_2',
213
217
  task_names4: 'task_name3_1',
214
218
  search_word: 'task_name2_',
215
- expected: %w{task_name2_1 task_name2_2}
219
+ expected: %w(task_name2_1 task_name2_2)
216
220
  },
217
221
  {
218
222
  case_no: 4,
@@ -228,7 +232,7 @@ describe Tudu::Core do
228
232
  'task_name2',
229
233
  'task_name3',
230
234
  '========DOINGS========',
231
- '========DONES========',
235
+ '========DONES========'
232
236
  ]
233
237
  },
234
238
  {
@@ -247,9 +251,9 @@ describe Tudu::Core do
247
251
  '========DOINGS========',
248
252
  "\e[33mtask_name2\e[0m",
249
253
  '========DONES========',
250
- "\e[36mtask_name1\e[0m",
254
+ "\e[36mtask_name1\e[0m"
251
255
  ]
252
- },
256
+ }
253
257
  ]
254
258
 
255
259
  cases.each do |c|
@@ -279,7 +283,7 @@ describe Tudu::Core do
279
283
  end
280
284
 
281
285
  def case_after(c)
282
- return unless File.exists? './tudu'
286
+ return unless File.exist? './tudu'
283
287
  FileUtils.rm_rf('./tudu')
284
288
  end
285
289
  end
@@ -296,7 +300,7 @@ describe Tudu::Core do
296
300
  choose: true,
297
301
  choose_name: 'task_name1',
298
302
  search_word: nil,
299
- expected: %w{task_name2 task_name3}
303
+ expected: %w(task_name2 task_name3)
300
304
  },
301
305
  {
302
306
  case_no: 2,
@@ -319,8 +323,8 @@ describe Tudu::Core do
319
323
  choose: true,
320
324
  choose_name: 'task_name1_1',
321
325
  search_word: 'task_name2_',
322
- expected: %w{task_name2_1 task_name2_2}
323
- },
326
+ expected: %w(task_name2_1 task_name2_2)
327
+ }
324
328
  ]
325
329
 
326
330
  cases.each do |c|
@@ -350,7 +354,7 @@ describe Tudu::Core do
350
354
 
351
355
  def case_after(c)
352
356
  # implement each case after
353
- return unless File.exists? './tudu'
357
+ return unless File.exist? './tudu'
354
358
  FileUtils.rm_rf('./tudu')
355
359
  end
356
360
  end
@@ -391,7 +395,7 @@ describe Tudu::Core do
391
395
  choose_name: 'task_name1_1',
392
396
  search_word: 'task_name1_',
393
397
  expected: ['task_name1_1']
394
- },
398
+ }
395
399
  ]
396
400
 
397
401
  cases.each do |c|
@@ -421,7 +425,7 @@ describe Tudu::Core do
421
425
 
422
426
  def case_after(c)
423
427
  # implement each case after
424
- return unless File.exists? './tudu'
428
+ return unless File.exist? './tudu'
425
429
  FileUtils.rm_rf('./tudu')
426
430
  end
427
431
  end
@@ -435,7 +439,7 @@ describe Tudu::Core do
435
439
  task_names1: 'task_name1',
436
440
  task_names2: 'task_name2',
437
441
  task_names3: 'task_name3',
438
- choose_names: %w{task_name1 task_name2},
442
+ choose_names: %w(task_name1 task_name2),
439
443
  done_names: ['task_name1'],
440
444
  search_word: nil,
441
445
  expected: ['task_name1']
@@ -446,11 +450,11 @@ describe Tudu::Core do
446
450
  task_names1: 'task_name1_1',
447
451
  task_names2: 'task_name1_2',
448
452
  task_names3: 'task_name2_1',
449
- choose_names: %w{task_name1_1 task_name1_2 task_name2_1},
450
- done_names: %w{task_name1_1 task_name1_2 task_name2_1},
453
+ choose_names: %w(task_name1_1 task_name1_2 task_name2_1),
454
+ done_names: %w(task_name1_1 task_name1_2 task_name2_1),
451
455
  search_word: 'task_name1_',
452
- expected: %w{task_name1_1 task_name1_2}
453
- },
456
+ expected: %w(task_name1_1 task_name1_2)
457
+ }
454
458
  ]
455
459
 
456
460
  cases.each do |c|
@@ -483,7 +487,7 @@ describe Tudu::Core do
483
487
 
484
488
  def case_after(c)
485
489
  # implement each case after
486
- return unless File.exists? './tudu'
490
+ return unless File.exist? './tudu'
487
491
  FileUtils.rm_rf('./tudu')
488
492
  end
489
493
  end
@@ -500,7 +504,7 @@ describe Tudu::Core do
500
504
  choose: 'task_name1',
501
505
  expected_todos: "task_name2\ntask_name3\n",
502
506
  expected_doings: "task_name1\n"
503
- },
507
+ }
504
508
  ]
505
509
 
506
510
  cases.each do |c|
@@ -517,9 +521,9 @@ describe Tudu::Core do
517
521
  tudu_core.choose c[:choose]
518
522
 
519
523
  # -- then --
520
- actual_doings = File.read("./tudu/#{Tudu::Tasks::TUDU_DOINGS_FILE}")
524
+ actual_doings = File.read("./tudu/#{Tudu::TuduPaths::TUDU_DOINGS_FILE}")
521
525
  expect(actual_doings).to eq(c[:expected_doings])
522
- actual_todos = File.read("./tudu/#{Tudu::Tasks::TUDU_TODOS_FILE}")
526
+ actual_todos = File.read("./tudu/#{Tudu::TuduPaths::TUDU_TODOS_FILE}")
523
527
  expect(actual_todos).to eq(c[:expected_todos])
524
528
  ensure
525
529
  case_after c
@@ -532,7 +536,7 @@ describe Tudu::Core do
532
536
 
533
537
  def case_after(c)
534
538
  # implement each case after
535
- return unless File.exists? './tudu'
539
+ return unless File.exist? './tudu'
536
540
  FileUtils.rm_rf('./tudu')
537
541
  end
538
542
  end
@@ -565,7 +569,7 @@ describe Tudu::Core do
565
569
  choose: '',
566
570
  expected_doings: '',
567
571
  expected_done: ''
568
- },
572
+ }
569
573
  ]
570
574
 
571
575
  cases.each do |c|
@@ -583,9 +587,9 @@ describe Tudu::Core do
583
587
  tudu_core.done
584
588
 
585
589
  # -- then --
586
- actual_doings = File.read(Tudu::Tasks::TUDU_DOINGS_FILE_PATH)
590
+ actual_doings = File.read(Tudu::TuduPaths::TUDU_DOINGS_FILE_PATH)
587
591
  expect(actual_doings).to eq(c[:expected_doings])
588
- actual_dones = File.read(Tudu::Tasks::TUDU_DONES_FILE_PATH)
592
+ actual_dones = File.read(Tudu::TuduPaths::TUDU_DONES_FILE_PATH)
589
593
  expect(actual_dones).to eq(c[:expected_done])
590
594
  ensure
591
595
  case_after c
@@ -598,9 +602,10 @@ describe Tudu::Core do
598
602
 
599
603
  def case_after(c)
600
604
  # implement each case after
601
- return unless File.exists? './tudu'
605
+ return unless File.exist? './tudu'
602
606
  FileUtils.rm_rf('./tudu')
603
607
  end
604
608
  end
605
609
  end
606
610
  end
611
+ # rubocop:enable LineLength, UnusedMethodArgument
@@ -2,6 +2,7 @@
2
2
  require 'spec_helper'
3
3
  require 'tudu_dsl'
4
4
 
5
+ # rubocop:disable UnusedMethodArgument
5
6
  describe Tudu::Dsl do
6
7
  context :target_type do
7
8
  cases = [
@@ -34,7 +35,7 @@ describe Tudu::Dsl do
34
35
  case_title: 'invalid type',
35
36
  input_type: :invalid,
36
37
  expected: :none
37
- },
38
+ }
38
39
  ]
39
40
 
40
41
  cases.each do |c|
@@ -85,7 +86,7 @@ describe Tudu::Dsl do
85
86
  case_title: 'invalid type nil',
86
87
  input_type: nil,
87
88
  expected: []
88
- },
89
+ }
89
90
  ]
90
91
 
91
92
  cases.each do |c|
@@ -116,5 +117,5 @@ describe Tudu::Dsl do
116
117
  end
117
118
  end
118
119
  end
119
-
120
120
  end
121
+ # rubocop:enable UnusedMethodArgument
data/tudu.gemspec CHANGED
@@ -1,27 +1,28 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'tudu/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "tudu"
8
- spec.version = Tudu::VERSION
9
- spec.authors = ["tbpgr"]
10
- spec.email = ["tbpgr@tbpgr.jp"]
11
- spec.description = %q{Single person's minimum unit of task manager}
12
- spec.summary = %q{Single person's minimum unit of task manager}
13
- spec.homepage = "https://github.com/tbpgr/tudu"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files`.split($/)
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_runtime_dependency "thor", "~> 0.18.1"
22
-
23
- spec.add_development_dependency "rspec", "~> 2.14.1"
24
- spec.add_development_dependency "simplecov", "~> 0.8.2"
25
- spec.add_development_dependency "bundler", "~> 1.3"
26
- spec.add_development_dependency "rake"
27
- end
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'tudu/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'tudu'
8
+ spec.version = Tudu::VERSION
9
+ spec.authors = ['tbpgr']
10
+ spec.email = ['tbpgr@tbpgr.jp']
11
+ spec.description = %q(Single person's minimum unit of task manager)
12
+ spec.summary = %q(Single person's minimum unit of task manager)
13
+ spec.homepage = 'https://github.com/tbpgr/tudu'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
+ spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(/^(test|spec|features)\//)
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_runtime_dependency 'thor', '~> 0.18.1'
22
+ spec.add_runtime_dependency 'highline', "~> 1.6.20"
23
+
24
+ spec.add_development_dependency 'rspec', '~> 2.14.1'
25
+ spec.add_development_dependency 'simplecov', '~> 0.8.2'
26
+ spec.add_development_dependency 'bundler', '~> 1.3'
27
+ spec.add_development_dependency 'rake'
28
+ end
metadata CHANGED
@@ -1,71 +1,99 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tudu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
5
- prerelease:
4
+ version: 0.0.6
6
5
  platform: ruby
7
6
  authors:
8
7
  - tbpgr
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2014-01-28 00:00:00.000000000 Z
11
+ date: 2016-06-23 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: thor
16
- requirement: &23010912 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
19
  version: 0.18.1
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *23010912
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 0.18.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: highline
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.6.20
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 1.6.20
25
41
  - !ruby/object:Gem::Dependency
26
42
  name: rspec
27
- requirement: &23010588 !ruby/object:Gem::Requirement
28
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
29
44
  requirements:
30
45
  - - ~>
31
46
  - !ruby/object:Gem::Version
32
47
  version: 2.14.1
33
48
  type: :development
34
49
  prerelease: false
35
- version_requirements: *23010588
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 2.14.1
36
55
  - !ruby/object:Gem::Dependency
37
56
  name: simplecov
38
- requirement: &23010300 !ruby/object:Gem::Requirement
39
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
40
58
  requirements:
41
59
  - - ~>
42
60
  - !ruby/object:Gem::Version
43
61
  version: 0.8.2
44
62
  type: :development
45
63
  prerelease: false
46
- version_requirements: *23010300
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 0.8.2
47
69
  - !ruby/object:Gem::Dependency
48
70
  name: bundler
49
- requirement: &23010024 !ruby/object:Gem::Requirement
50
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
51
72
  requirements:
52
73
  - - ~>
53
74
  - !ruby/object:Gem::Version
54
75
  version: '1.3'
55
76
  type: :development
56
77
  prerelease: false
57
- version_requirements: *23010024
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: '1.3'
58
83
  - !ruby/object:Gem::Dependency
59
84
  name: rake
60
- requirement: &23009784 !ruby/object:Gem::Requirement
61
- none: false
85
+ requirement: !ruby/object:Gem::Requirement
62
86
  requirements:
63
- - - ! '>='
87
+ - - '>='
64
88
  - !ruby/object:Gem::Version
65
89
  version: '0'
66
90
  type: :development
67
91
  prerelease: false
68
- version_requirements: *23009784
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
69
97
  description: Single person's minimum unit of task manager
70
98
  email:
71
99
  - tbpgr@tbpgr.jp
@@ -83,10 +111,14 @@ files:
83
111
  - Rakefile
84
112
  - bin/tudu
85
113
  - doc_image/colored_tasks.png
114
+ - lib/task.rb
86
115
  - lib/tasks.rb
87
116
  - lib/tudu/version.rb
88
117
  - lib/tudu_core.rb
89
118
  - lib/tudu_dsl.rb
119
+ - lib/tudu_file_keys.rb
120
+ - lib/tudu_paths.rb
121
+ - lib/tudu_templates.rb
90
122
  - spec/spec_helper.rb
91
123
  - spec/tasks_spec.rb
92
124
  - spec/tudu_core_spec.rb
@@ -95,27 +127,26 @@ files:
95
127
  homepage: https://github.com/tbpgr/tudu
96
128
  licenses:
97
129
  - MIT
130
+ metadata: {}
98
131
  post_install_message:
99
132
  rdoc_options: []
100
133
  require_paths:
101
134
  - lib
102
135
  required_ruby_version: !ruby/object:Gem::Requirement
103
- none: false
104
136
  requirements:
105
- - - ! '>='
137
+ - - '>='
106
138
  - !ruby/object:Gem::Version
107
139
  version: '0'
108
140
  required_rubygems_version: !ruby/object:Gem::Requirement
109
- none: false
110
141
  requirements:
111
- - - ! '>='
142
+ - - '>='
112
143
  - !ruby/object:Gem::Version
113
144
  version: '0'
114
145
  requirements: []
115
146
  rubyforge_project:
116
- rubygems_version: 1.8.11
147
+ rubygems_version: 2.3.0
117
148
  signing_key:
118
- specification_version: 3
149
+ specification_version: 4
119
150
  summary: Single person's minimum unit of task manager
120
151
  test_files:
121
152
  - spec/spec_helper.rb