tudu 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.rubocop.yml +4 -0
- data/Gemfile +1 -1
- data/README.md +44 -2
- data/bin/tudu +80 -79
- data/doc_image/colored_tasks.png +0 -0
- data/lib/tasks.rb +319 -304
- data/lib/tudu/version.rb +3 -1
- data/lib/tudu_core.rb +126 -97
- data/lib/tudu_dsl.rb +41 -41
- data/spec/spec_helper.rb +2 -1
- data/spec/tasks_spec.rb +856 -861
- data/spec/tudu_core_spec.rb +606 -587
- data/spec/tudu_dsl_spec.rb +120 -120
- metadata +14 -12
data/spec/tudu_dsl_spec.rb
CHANGED
@@ -1,120 +1,120 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require
|
3
|
-
require
|
4
|
-
|
5
|
-
describe Tudu::Dsl do
|
6
|
-
context :target_type do
|
7
|
-
cases = [
|
8
|
-
{
|
9
|
-
case_no: 1,
|
10
|
-
case_title:
|
11
|
-
input_type:
|
12
|
-
expected: :mail
|
13
|
-
},
|
14
|
-
{
|
15
|
-
case_no: 2,
|
16
|
-
case_title:
|
17
|
-
input_type: :mail,
|
18
|
-
expected: :mail
|
19
|
-
},
|
20
|
-
{
|
21
|
-
case_no: 3,
|
22
|
-
case_title:
|
23
|
-
input_type: nil,
|
24
|
-
expected: :none
|
25
|
-
},
|
26
|
-
{
|
27
|
-
case_no: 4,
|
28
|
-
case_title:
|
29
|
-
input_type: 123,
|
30
|
-
expected: :none
|
31
|
-
},
|
32
|
-
{
|
33
|
-
case_no: 5,
|
34
|
-
case_title:
|
35
|
-
input_type: :invalid,
|
36
|
-
expected: :none
|
37
|
-
},
|
38
|
-
]
|
39
|
-
|
40
|
-
cases.each do |c|
|
41
|
-
it "|case_no=#{c[:case_no]}|case_title=#{c[:case_title]}" do
|
42
|
-
begin
|
43
|
-
case_before c
|
44
|
-
|
45
|
-
# -- given --
|
46
|
-
tudu_dsl = Tudu::Dsl.new
|
47
|
-
|
48
|
-
# -- when --
|
49
|
-
tudu_dsl.target_type c[:input_type]
|
50
|
-
|
51
|
-
# -- then --
|
52
|
-
actual = tudu_dsl._target_type
|
53
|
-
expect(actual).to eq(c[:expected])
|
54
|
-
ensure
|
55
|
-
case_after c
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
def case_before(c)
|
60
|
-
# implement each case before
|
61
|
-
end
|
62
|
-
|
63
|
-
def case_after(c)
|
64
|
-
# implement each case after
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
context :targets do
|
70
|
-
cases = [
|
71
|
-
{
|
72
|
-
case_no: 1,
|
73
|
-
case_title:
|
74
|
-
input_type: [
|
75
|
-
expected: [
|
76
|
-
},
|
77
|
-
{
|
78
|
-
case_no: 2,
|
79
|
-
case_title:
|
80
|
-
input_type:
|
81
|
-
expected: []
|
82
|
-
},
|
83
|
-
{
|
84
|
-
case_no: 3,
|
85
|
-
case_title:
|
86
|
-
input_type: nil,
|
87
|
-
expected: []
|
88
|
-
},
|
89
|
-
]
|
90
|
-
|
91
|
-
cases.each do |c|
|
92
|
-
it "|case_no=#{c[:case_no]}|case_title=#{c[:case_title]}" do
|
93
|
-
begin
|
94
|
-
case_before c
|
95
|
-
|
96
|
-
# -- given --
|
97
|
-
tudu_dsl = Tudu::Dsl.new
|
98
|
-
|
99
|
-
# -- when --
|
100
|
-
tudu_dsl.targets c[:input_type]
|
101
|
-
|
102
|
-
# -- then --
|
103
|
-
actual = tudu_dsl._targets
|
104
|
-
expect(actual).to eq(c[:expected])
|
105
|
-
ensure
|
106
|
-
case_after c
|
107
|
-
end
|
108
|
-
end
|
109
|
-
|
110
|
-
def case_before(c)
|
111
|
-
# implement each case before
|
112
|
-
end
|
113
|
-
|
114
|
-
def case_after(c)
|
115
|
-
# implement each case after
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
|
120
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'tudu_dsl'
|
4
|
+
|
5
|
+
describe Tudu::Dsl do
|
6
|
+
context :target_type do
|
7
|
+
cases = [
|
8
|
+
{
|
9
|
+
case_no: 1,
|
10
|
+
case_title: 'valid type String',
|
11
|
+
input_type: 'mail',
|
12
|
+
expected: :mail
|
13
|
+
},
|
14
|
+
{
|
15
|
+
case_no: 2,
|
16
|
+
case_title: 'valid type Symbol',
|
17
|
+
input_type: :mail,
|
18
|
+
expected: :mail
|
19
|
+
},
|
20
|
+
{
|
21
|
+
case_no: 3,
|
22
|
+
case_title: 'invalid type nil',
|
23
|
+
input_type: nil,
|
24
|
+
expected: :none
|
25
|
+
},
|
26
|
+
{
|
27
|
+
case_no: 4,
|
28
|
+
case_title: 'invalid type not Symbol or String',
|
29
|
+
input_type: 123,
|
30
|
+
expected: :none
|
31
|
+
},
|
32
|
+
{
|
33
|
+
case_no: 5,
|
34
|
+
case_title: 'invalid type',
|
35
|
+
input_type: :invalid,
|
36
|
+
expected: :none
|
37
|
+
},
|
38
|
+
]
|
39
|
+
|
40
|
+
cases.each do |c|
|
41
|
+
it "|case_no=#{c[:case_no]}|case_title=#{c[:case_title]}" do
|
42
|
+
begin
|
43
|
+
case_before c
|
44
|
+
|
45
|
+
# -- given --
|
46
|
+
tudu_dsl = Tudu::Dsl.new
|
47
|
+
|
48
|
+
# -- when --
|
49
|
+
tudu_dsl.target_type c[:input_type]
|
50
|
+
|
51
|
+
# -- then --
|
52
|
+
actual = tudu_dsl._target_type
|
53
|
+
expect(actual).to eq(c[:expected])
|
54
|
+
ensure
|
55
|
+
case_after c
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
def case_before(c)
|
60
|
+
# implement each case before
|
61
|
+
end
|
62
|
+
|
63
|
+
def case_after(c)
|
64
|
+
# implement each case after
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
context :targets do
|
70
|
+
cases = [
|
71
|
+
{
|
72
|
+
case_no: 1,
|
73
|
+
case_title: 'valid type Array',
|
74
|
+
input_type: ['tbpgr@tbpgr.jp', 'tbpgr@tbpgr.jp'],
|
75
|
+
expected: ['tbpgr@tbpgr.jp', 'tbpgr@tbpgr.jp']
|
76
|
+
},
|
77
|
+
{
|
78
|
+
case_no: 2,
|
79
|
+
case_title: 'invalid type',
|
80
|
+
input_type: 'tbpgr@tbpgr.jp',
|
81
|
+
expected: []
|
82
|
+
},
|
83
|
+
{
|
84
|
+
case_no: 3,
|
85
|
+
case_title: 'invalid type nil',
|
86
|
+
input_type: nil,
|
87
|
+
expected: []
|
88
|
+
},
|
89
|
+
]
|
90
|
+
|
91
|
+
cases.each do |c|
|
92
|
+
it "|case_no=#{c[:case_no]}|case_title=#{c[:case_title]}" do
|
93
|
+
begin
|
94
|
+
case_before c
|
95
|
+
|
96
|
+
# -- given --
|
97
|
+
tudu_dsl = Tudu::Dsl.new
|
98
|
+
|
99
|
+
# -- when --
|
100
|
+
tudu_dsl.targets c[:input_type]
|
101
|
+
|
102
|
+
# -- then --
|
103
|
+
actual = tudu_dsl._targets
|
104
|
+
expect(actual).to eq(c[:expected])
|
105
|
+
ensure
|
106
|
+
case_after c
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def case_before(c)
|
111
|
+
# implement each case before
|
112
|
+
end
|
113
|
+
|
114
|
+
def case_after(c)
|
115
|
+
# implement each case after
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tudu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-01-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &23010912 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.18.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *23010912
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &23010588 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.14.1
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *23010588
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: simplecov
|
38
|
-
requirement: &
|
38
|
+
requirement: &23010300 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.8.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *23010300
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: bundler
|
49
|
-
requirement: &
|
49
|
+
requirement: &23010024 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '1.3'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *23010024
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &23009784 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *23009784
|
69
69
|
description: Single person's minimum unit of task manager
|
70
70
|
email:
|
71
71
|
- tbpgr@tbpgr.jp
|
@@ -76,11 +76,13 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- .gitignore
|
78
78
|
- .rspec
|
79
|
+
- .rubocop.yml
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE.txt
|
81
82
|
- README.md
|
82
83
|
- Rakefile
|
83
84
|
- bin/tudu
|
85
|
+
- doc_image/colored_tasks.png
|
84
86
|
- lib/tasks.rb
|
85
87
|
- lib/tudu/version.rb
|
86
88
|
- lib/tudu_core.rb
|