dev_flow 0.0.4

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.
data/spec/task_spec.rb ADDED
@@ -0,0 +1,182 @@
1
+ # encoding: utf-8
2
+ require 'spec_helper'
3
+
4
+ describe DevFlow::Task do
5
+ context "with full date" do
6
+ subject (:task) do
7
+ DevFlow::Task.new(2, '-', '').parse('ui_unit: 用树状图描述UI单元结构 2013/03/04-2013/03/06 @xuyc;huangw:2013/03/06',
8
+ {"members" => {"xuyc" => ["Xu Yichen"], "huangw" => ["Huang Wei"]}})
9
+ end
10
+
11
+ its :branch_name do
12
+ should eq("ui_unit")
13
+ end
14
+
15
+ its :display_name do
16
+ should eq("用树状图描述UI单元结构")
17
+ end
18
+
19
+ its :start_date do
20
+ should eq(DateTime.new(2013, 03, 04))
21
+ end
22
+
23
+ its :end_date do
24
+ should eq(DateTime.new(2013, 03, 06))
25
+ end
26
+
27
+ its :is_completed? do
28
+ should be_true
29
+ end
30
+
31
+ its :is_pending? do
32
+ should be_false
33
+ end
34
+
35
+ its :is_deleted? do
36
+ should be_false
37
+ end
38
+
39
+ its :is_milestone? do
40
+ should be_false
41
+ end
42
+
43
+ its :is_parent? do
44
+ should be_false
45
+ end
46
+
47
+ its :level do
48
+ should eq(2)
49
+ end
50
+
51
+ it "has two resource registed" do
52
+ task.resources[0].should eq('xuyc')
53
+ task.resources[1].should eq('huangw')
54
+ end
55
+
56
+ it "has two right resource names" do
57
+ task.resource_names[0].should eq("Xu Yichen")
58
+ task.resource_names[1].should eq("Huang Wei")
59
+ end
60
+ end
61
+
62
+ context "short date without end date" do
63
+ subject (:task) do
64
+ DevFlow::Task.new(4, '-', '').parse('action_second_m: action和comment相关的模型 03/11 @huangw:80',
65
+ {"members" => {"xuyc" => ["Xu Yichen"], "huangw" => ["Huang Wei"]}, "year" => 2013})
66
+ end
67
+
68
+ its :branch_name do
69
+ should eq("action_second_m")
70
+ end
71
+
72
+ its :display_name do
73
+ should eq("action和comment相关的模型")
74
+ end
75
+
76
+ its :start_date do
77
+ should eq(DateTime.new(2013, 03, 11))
78
+ end
79
+
80
+ its :end_date do
81
+ should eq(DateTime.new(2013, 03, 11))
82
+ end
83
+
84
+ its :is_completed? do
85
+ should be_false
86
+ end
87
+
88
+ its :progress do
89
+ should eq(80)
90
+ end
91
+
92
+ its :is_pending? do
93
+ should be_false
94
+ end
95
+
96
+ its :is_deleted? do
97
+ should be_false
98
+ end
99
+
100
+ its :is_parent? do
101
+ should be_false
102
+ end
103
+
104
+ its :is_milestone? do
105
+ should be_false
106
+ end
107
+
108
+ its :level do
109
+ should eq(4)
110
+ end
111
+
112
+ it "has two resource registed" do
113
+ task.resources[0].should eq('huangw')
114
+ end
115
+
116
+ it "has two right resource names" do
117
+ task.resource_names[0].should eq("Huang Wei")
118
+ end
119
+ end
120
+
121
+ context "with dependency" do
122
+ subject (:task) do
123
+ DevFlow::Task.new(1, '-', '').parse('release_v2: 发送新版本 2013/04/04 @xuyc;huangw -> dep1;dep2',
124
+ {"members" => {"xuyc" => ["Xu Yichen"], "huangw" => ["Huang Wei"]}})
125
+ end
126
+
127
+ its :branch_name do
128
+ should eq("release_v2")
129
+ end
130
+
131
+ its :display_name do
132
+ should eq("发送新版本")
133
+ end
134
+
135
+ its :start_date do
136
+ should eq(DateTime.new(2013, 04, 04))
137
+ end
138
+
139
+ its :end_date do
140
+ should eq(DateTime.new(2013, 04, 04))
141
+ end
142
+
143
+ its :is_completed? do
144
+ should be_false
145
+ end
146
+
147
+ its :is_pending? do
148
+ should be_false
149
+ end
150
+
151
+ its :is_deleted? do
152
+ should be_false
153
+ end
154
+
155
+ its :is_milestone? do
156
+ should be_true
157
+ end
158
+
159
+ its :is_parent? do
160
+ should be_false
161
+ end
162
+
163
+ its :level do
164
+ should eq(1)
165
+ end
166
+
167
+ it "has two resource registed" do
168
+ task.resources[0].should eq('xuyc')
169
+ task.resources[1].should eq('huangw')
170
+ end
171
+
172
+ it "has two right resource names" do
173
+ task.resource_names[0].should eq("Xu Yichen")
174
+ task.resource_names[1].should eq("Huang Wei")
175
+ end
176
+
177
+ it "has two dependencie_names" do
178
+ task.dependencie_names[0].should eq("dep1")
179
+ task.dependencie_names[1].should eq("dep2")
180
+ end
181
+ end
182
+ end
@@ -0,0 +1,50 @@
1
+ require 'spec_helper'
2
+
3
+ def new_version branch_name, git_tags
4
+ if branch_name =~ /^release\_v/
5
+ return branch_name.gsub('release_v', 'version-')
6
+ elsif branch_name =~ /^hotfix\_/
7
+ last_v = ''
8
+ git_tags.each do |t|
9
+ if /^version\-\d+\.\d+\.(?<nm_>\d+)$/ =~ t # with fix number
10
+ last_v = t.gsub(/\d+$/, (nm_.to_i + 1).to_s)
11
+ elsif /^version\-\d+\.\d+$/ =~ t # without fix number
12
+ last_v = t + '.1'
13
+ end
14
+ end
15
+ return last_v
16
+ else
17
+ return ''
18
+ end
19
+ end
20
+
21
+ describe "new_version" do
22
+ context "release versions" do
23
+ it "should return the version tag the first time" do
24
+ new_version('release_v1.0', []).should eq('version-1.0')
25
+ end
26
+
27
+ it "should return the version tag the second time" do
28
+ new_version('release_v1.0.2', ['version-1.0']).should eq('version-1.0.2')
29
+ end
30
+ end
31
+
32
+ context "hotfix versions" do
33
+ it "should return noting if no previous version" do
34
+ new_version('hotfix_somebug', []).should eq('')
35
+ end
36
+
37
+ it "should return new version after a major version tag" do
38
+ new_version('hotfix_somebug2', ['version-1.2']).should eq('version-1.2.1')
39
+ end
40
+
41
+ it "should return new version after a minor version tag" do
42
+ new_version('hotfix_somebug3', ['version-1.2', 'version-1.3.2']).should eq('version-1.3.3')
43
+ end
44
+
45
+ it "will not broken by a prepare tag" do
46
+ new_version('hotfix_somebug3', ['version-1.2', 'version-1.3.2', 'version-2.0a']).should eq('version-1.3.3')
47
+ end
48
+
49
+ end
50
+ end
data/tags ADDED
@@ -0,0 +1,105 @@
1
+ !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/
2
+ !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/
3
+ !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/
4
+ !_TAG_PROGRAM_NAME Exuberant Ctags //
5
+ !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
6
+ !_TAG_PROGRAM_VERSION 5.8 //
7
+ App lib/dev_flow/app.rb /^ class App$/;" c class:DevFlow
8
+ Cleanup lib/dev_flow/commands/cleanup.rb /^ class Cleanup < App$/;" c class:DevFlow
9
+ Complete lib/dev_flow/commands/complete.rb /^ class Complete < App$/;" c class:DevFlow
10
+ DevFlow lib/dev_flow.rb /^module DevFlow$/;" m
11
+ DevFlow lib/dev_flow/app.rb /^module DevFlow$/;" m
12
+ DevFlow lib/dev_flow/commands/cleanup.rb /^module DevFlow$/;" m
13
+ DevFlow lib/dev_flow/commands/complete.rb /^module DevFlow$/;" m
14
+ DevFlow lib/dev_flow/commands/info.rb /^module DevFlow$/;" m
15
+ DevFlow lib/dev_flow/commands/init.rb /^module DevFlow$/;" m
16
+ DevFlow lib/dev_flow/commands/progress.rb /^module DevFlow$/;" m
17
+ DevFlow lib/dev_flow/commands/ur.rb /^module DevFlow$/;" m
18
+ DevFlow lib/dev_flow/girc.rb /^module DevFlow$/;" m
19
+ DevFlow lib/dev_flow/member.rb /^module DevFlow$/;" m
20
+ DevFlow lib/dev_flow/roadmap.rb /^module DevFlow$/;" m
21
+ DevFlow lib/dev_flow/task.rb /^module DevFlow$/;" m
22
+ DevFlow lib/dev_flow/task_console.rb /^module DevFlow$/;" m
23
+ DevFlow lib/dev_flow/version.rb /^module DevFlow$/;" m
24
+ Girc lib/dev_flow/girc.rb /^ class Girc$/;" c class:DevFlow
25
+ Info lib/dev_flow/commands/info.rb /^ class Info < App$/;" c class:DevFlow
26
+ Init lib/dev_flow/commands/init.rb /^ class Init < App$/;" c class:DevFlow
27
+ Member lib/dev_flow/member.rb /^ class Member$/;" c class:DevFlow
28
+ Progress lib/dev_flow/commands/progress.rb /^ class Progress < App$/;" c class:DevFlow
29
+ RoadMap lib/dev_flow/roadmap.rb /^ class RoadMap$/;" c class:DevFlow
30
+ String bin/dw /^class String; include Term::ANSIColor end$/;" c
31
+ Task lib/dev_flow/task.rb /^ class Task$/;" c class:DevFlow
32
+ Task lib/dev_flow/task_console.rb /^ class Task$/;" c class:DevFlow
33
+ UpdateRoadmap lib/dev_flow/commands/ur.rb /^ class UpdateRoadmap < App$/;" c class:DevFlow
34
+ add_to_gitignore lib/dev_flow/commands/init.rb /^ def add_to_gitignore$/;" f class:DevFlow.Init
35
+ all_member_names lib/dev_flow/app.rb /^ def all_member_names$/;" f class:DevFlow
36
+ as_title lib/dev_flow/task_console.rb /^ def as_title header$/;" f class:DevFlow.Task
37
+ ask_rebase lib/dev_flow/app.rb /^ def ask_rebase force = false$/;" f class:DevFlow.hr.hrb
38
+ branches lib/dev_flow/girc.rb /^ def branches$/;" f
39
+ config lib/dev_flow/girc.rb /^ def config$/;" f class:DevFlow
40
+ current_branch lib/dev_flow/girc.rb /^ def current_branch$/;" f
41
+ del_branch! lib/dev_flow/girc.rb /^ def del_branch! branch, remote=nil$/;" f
42
+ display_close_waiting lib/dev_flow/app.rb /^ def display_close_waiting$/;" f class:DevFlow.hr.hrb
43
+ display_tasks lib/dev_flow/app.rb /^ def display_tasks$/;" f class:DevFlow.hr.hrb
44
+ error lib/dev_flow/app.rb /^ def error msg$/;" f class:DevFlow
45
+ find_parent lib/dev_flow/roadmap.rb /^ def find_parent level$/;" f class:DevFlow.RoadMap
46
+ hello lib/dev_flow/app.rb /^ def hello$/;" f class:DevFlow.hr.hrb
47
+ hr lib/dev_flow/app.rb /^ def hr; "-"*76 end$/;" f class:DevFlow
48
+ hrb lib/dev_flow/app.rb /^ def hrb; "="*76 end$/;" f class:DevFlow.hr
49
+ hrbh lib/dev_flow/app.rb /^ def hrbh; hrb.bold end$/;" f class:DevFlow.hr.hrb
50
+ hrh lib/dev_flow/app.rb /^ def hrh; hr.bold end$/;" f class:DevFlow.hr
51
+ i_am_leader? lib/dev_flow/app.rb /^ def i_am_leader?$/;" f class:DevFlow
52
+ i_am_moderator? lib/dev_flow/app.rb /^ def i_am_moderator?$/;" f class:DevFlow
53
+ i_am_supervisor? lib/dev_flow/app.rb /^ def i_am_supervisor?$/;" f class:DevFlow
54
+ i_have_power? lib/dev_flow/app.rb /^ def i_have_power?$/;" f class:DevFlow
55
+ in_git_dir? lib/dev_flow/girc.rb /^ def in_git_dir?$/;" f
56
+ in_release? lib/dev_flow/app.rb /^ def in_release?$/;" f class:DevFlow
57
+ in_trunk? lib/dev_flow/app.rb /^ def in_trunk?$/;" f class:DevFlow
58
+ info lib/dev_flow/app.rb /^ def info msg$/;" f class:DevFlow
59
+ info lib/dev_flow/girc.rb /^ def info msg$/;" f class:DevFlow.Girc
60
+ initialize lib/dev_flow/app.rb /^ def initialize config, command$/;" f class:DevFlow.App
61
+ initialize lib/dev_flow/girc.rb /^ def initialize cmd = 'git', v = true$/;" f class:DevFlow.Girc
62
+ initialize lib/dev_flow/member.rb /^ def initialize name, display_name, email$/;" f class:DevFlow.Member
63
+ initialize lib/dev_flow/roadmap.rb /^ def initialize file, config$/;" f class:DevFlow.RoadMap
64
+ initialize lib/dev_flow/task.rb /^ def initialize level,file="-",ln=0$/;" f class:DevFlow.Task
65
+ invoke lib/dev_flow.rb /^ def self.invoke! config, command$/;" F class:DevFlow
66
+ is_completable? lib/dev_flow/task_console.rb /^ def is_completable?$/;" f class:DevFlow.Task
67
+ is_completed? lib/dev_flow/task.rb /^ def is_completed?$/;" f class:DevFlow.Task
68
+ is_delayed? lib/dev_flow/task.rb /^ def is_delayed? # usually red$/;" f class:DevFlow.Task
69
+ is_deleted? lib/dev_flow/task.rb /^ def is_deleted?$/;" f class:DevFlow.Task
70
+ is_milestone? lib/dev_flow/task.rb /^ def is_milestone?$/;" f class:DevFlow.Task
71
+ is_parent? lib/dev_flow/task.rb /^ def is_parent?$/;" f class:DevFlow.Task
72
+ is_pending? lib/dev_flow/task.rb /^ def is_pending?$/;" f class:DevFlow.Task
73
+ is_release? lib/dev_flow/task.rb /^ def is_release?$/;" f class:DevFlow.Task
74
+ is_urgent? lib/dev_flow/task.rb /^ def is_urgent? # usually orange$/;" f class:DevFlow.Task
75
+ is_workable? lib/dev_flow/task_console.rb /^ def is_workable?$/;" f class:DevFlow.Task
76
+ last_task lib/dev_flow/roadmap.rb /^ def last_task$/;" f class:DevFlow.RoadMap
77
+ leader_name lib/dev_flow/app.rb /^ def leader_name$/;" f class:DevFlow
78
+ me lib/dev_flow/girc.rb /^ def me$/;" f
79
+ modified_files lib/dev_flow/girc.rb /^ def modified_files$/;" f class:DevFlow.Girc
80
+ new_branch! lib/dev_flow/girc.rb /^ def new_branch! branch, remote=nil$/;" f
81
+ parse lib/dev_flow/roadmap.rb /^ def parse file = nil$/;" f class:DevFlow.RoadMap
82
+ parse lib/dev_flow/task.rb /^ def parse line, headers = {}$/;" f class:DevFlow.Task
83
+ process lib/dev_flow/commands/info.rb /^ def process$/;" f class:DevFlow.Info
84
+ process! lib/dev_flow/commands/cleanup.rb /^ def process!$/;" f class:DevFlow.Cleanup
85
+ process! lib/dev_flow/commands/complete.rb /^ def process!$/;" f class:DevFlow.Complete
86
+ process! lib/dev_flow/commands/info.rb /^ def process!$/;" f class:DevFlow.Info
87
+ process! lib/dev_flow/commands/init.rb /^ def process!$/;" f class:DevFlow.Init
88
+ process! lib/dev_flow/commands/progress.rb /^ def process!$/;" f class:DevFlow.Progress
89
+ process! lib/dev_flow/commands/ur.rb /^ def process!$/;" f class:DevFlow.UpdateRoadmap
90
+ pull! lib/dev_flow/girc.rb /^ def pull! remote = 'origin'$/;" f
91
+ rebase! lib/dev_flow/girc.rb /^ def rebase! remote = 'origin', branch = 'develop'$/;" f
92
+ remote_list lib/dev_flow/girc.rb /^ def remote_list$/;" f
93
+ rewrite lib/dev_flow/roadmap.rb /^ def rewrite task_hash$/;" f class:DevFlow.RoadMap
94
+ stash! lib/dev_flow/girc.rb /^ def stash!$/;" f
95
+ stash_pop! lib/dev_flow/girc.rb /^ def stash_pop!$/;" f
96
+ switch_to! lib/dev_flow/app.rb /^ def switch_to! branch$/;" f class:DevFlow.hr.hrb
97
+ task lib/dev_flow/app.rb /^ def task$/;" f class:DevFlow
98
+ tasks_for_close lib/dev_flow/app.rb /^ def tasks_for_close $/;" f class:DevFlow
99
+ title lib/dev_flow/roadmap.rb /^ def title$/;" f class:DevFlow.RoadMap
100
+ upload_progress! lib/dev_flow/app.rb /^ def upload_progress! task, progress, is_complete$/;" f class:DevFlow.hr.hrb
101
+ user_name lib/dev_flow/app.rb /^ def user_name$/;" f class:DevFlow
102
+ validate! lib/dev_flow/task.rb /^ def validate!$/;" f class:DevFlow.Task
103
+ warn lib/dev_flow/app.rb /^ def warn msg$/;" f class:DevFlow
104
+ wd_clean? lib/dev_flow/girc.rb /^ def wd_clean?$/;" f
105
+ write_local_config lib/dev_flow/commands/init.rb /^ def write_local_config hash$/;" f class:DevFlow.Init
metadata ADDED
@@ -0,0 +1,119 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dev_flow
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Huang Wei
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-03-25 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: term-ansicolor
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rspec
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: '2.5'
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '2.5'
46
+ description: dev_flow is a bundle of tools for ROADMAP/git based development flow
47
+ control.
48
+ email: huangw@pe-po.com
49
+ executables:
50
+ - dw
51
+ extensions: []
52
+ extra_rdoc_files: []
53
+ files:
54
+ - README.md
55
+ - ROADMAP
56
+ - Rakefile
57
+ - bin/dw
58
+ - dev_flow.gemspec
59
+ - examples/ROADMAP
60
+ - examples/ROADMAP_SPEC
61
+ - examples/members.yml
62
+ - lib/dev_flow.rb
63
+ - lib/dev_flow/app.rb
64
+ - lib/dev_flow/commands/cleanup.rb
65
+ - lib/dev_flow/commands/close.rb
66
+ - lib/dev_flow/commands/complete.rb
67
+ - lib/dev_flow/commands/info.rb
68
+ - lib/dev_flow/commands/init.rb
69
+ - lib/dev_flow/commands/progress.rb
70
+ - lib/dev_flow/commands/ur.rb
71
+ - lib/dev_flow/girc.rb
72
+ - lib/dev_flow/member.rb
73
+ - lib/dev_flow/roadmap.rb
74
+ - lib/dev_flow/task.rb
75
+ - lib/dev_flow/task_console.rb
76
+ - lib/dev_flow/version.rb
77
+ - spec/app_spec.rb
78
+ - spec/roadmap_spec.rb
79
+ - spec/spec_helper.rb
80
+ - spec/task_spec.rb
81
+ - spec/version_spec.rb
82
+ - tags
83
+ homepage: https://github.com/huangw/dev_flow-gem
84
+ licenses: []
85
+ post_install_message:
86
+ rdoc_options:
87
+ - --line-numbers
88
+ - --inline-source
89
+ - --title
90
+ - DevFlow
91
+ - --main
92
+ - README.rdoc
93
+ - --encoding=UTF-8
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
102
+ required_rubygems_version: !ruby/object:Gem::Requirement
103
+ none: false
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project:
110
+ rubygems_version: 1.8.25
111
+ signing_key:
112
+ specification_version: 3
113
+ summary: a bundle of tools for ROADMAP/git based development flow control.
114
+ test_files:
115
+ - spec/app_spec.rb
116
+ - spec/roadmap_spec.rb
117
+ - spec/spec_helper.rb
118
+ - spec/task_spec.rb
119
+ - spec/version_spec.rb