tudu 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +196 -0
- data/Rakefile +1 -0
- data/bin/tudu +71 -0
- data/lib/task.rb +281 -0
- data/lib/tasks.rb +281 -0
- data/lib/tudu/version.rb +3 -0
- data/lib/tudu_core.rb +74 -0
- data/lib/tudu_dsl.rb +41 -0
- data/spec/spec_helper.rb +7 -0
- data/spec/task_spec.rb +762 -0
- data/spec/tudu_core_spec.rb +574 -0
- data/spec/tudu_dsl_spec.rb +120 -0
- data/tudu.gemspec +27 -0
- metadata +124 -0
@@ -0,0 +1,120 @@
|
|
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
|
data/tudu.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
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
|
metadata
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tudu
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- tbpgr
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-12-12 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: thor
|
16
|
+
requirement: &26198988 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.18.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *26198988
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rspec
|
27
|
+
requirement: &26198220 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.14.1
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *26198220
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: simplecov
|
38
|
+
requirement: &26197740 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 0.8.2
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *26197740
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: bundler
|
49
|
+
requirement: &26196720 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.3'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *26196720
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rake
|
60
|
+
requirement: &26196108 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *26196108
|
69
|
+
description: Single person's minimum unit of task manager
|
70
|
+
email:
|
71
|
+
- tbpgr@tbpgr.jp
|
72
|
+
executables:
|
73
|
+
- tudu
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- .gitignore
|
78
|
+
- .rspec
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/tudu
|
84
|
+
- lib/task.rb
|
85
|
+
- lib/tasks.rb
|
86
|
+
- lib/tudu/version.rb
|
87
|
+
- lib/tudu_core.rb
|
88
|
+
- lib/tudu_dsl.rb
|
89
|
+
- spec/spec_helper.rb
|
90
|
+
- spec/task_spec.rb
|
91
|
+
- spec/tudu_core_spec.rb
|
92
|
+
- spec/tudu_dsl_spec.rb
|
93
|
+
- tudu.gemspec
|
94
|
+
homepage: https://github.com/tbpgr/tudu
|
95
|
+
licenses:
|
96
|
+
- MIT
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ! '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
|
+
none: false
|
109
|
+
requirements:
|
110
|
+
- - ! '>='
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
requirements: []
|
114
|
+
rubyforge_project:
|
115
|
+
rubygems_version: 1.8.11
|
116
|
+
signing_key:
|
117
|
+
specification_version: 3
|
118
|
+
summary: Single person's minimum unit of task manager
|
119
|
+
test_files:
|
120
|
+
- spec/spec_helper.rb
|
121
|
+
- spec/task_spec.rb
|
122
|
+
- spec/tudu_core_spec.rb
|
123
|
+
- spec/tudu_dsl_spec.rb
|
124
|
+
has_rdoc:
|