dev_flow 0.0.13 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/examples/ROADMAP_SPEC +1 -1
- data/lib/dev_flow/commands/init.rb +7 -6
- data/lib/dev_flow/roadmap.rb +10 -0
- data/lib/dev_flow/version.rb +1 -1
- data/spec/roadmap_spec.rb +7 -0
- metadata +2 -2
data/examples/ROADMAP_SPEC
CHANGED
@@ -9,24 +9,24 @@ module DevFlow
|
|
9
9
|
|
10
10
|
# find the current user
|
11
11
|
sugguest = @config["whoami"] if @config["whoami"]
|
12
|
-
unless
|
12
|
+
unless @roadmap.team_member_names.include? sugguest
|
13
13
|
info "use system 'whoami' command to find user name"
|
14
14
|
begin
|
15
15
|
suggest = `whoami`
|
16
16
|
end
|
17
|
-
info "found #{suggest}" if
|
17
|
+
info "found #{suggest}" if @roadmap.team_member_names.include? sugguest
|
18
18
|
end
|
19
19
|
|
20
|
-
unless
|
20
|
+
unless @roadmap.team_member_names.include? sugguest
|
21
21
|
info "use git config to find user name"
|
22
22
|
sugguest = @git.config["user.email"].gsub(/\@.+$/, '') if @git.config["user.email"]
|
23
|
-
info "found #{suggest}" if
|
23
|
+
info "found #{suggest}" if @roadmap.team_member_names.include? sugguest
|
24
24
|
end
|
25
25
|
|
26
26
|
# ask the user for the user name
|
27
27
|
puts "Tell us who you are: ".bold.yellow
|
28
|
-
msg =
|
29
|
-
if
|
28
|
+
msg = @roadmap.team_member_names.join(", ")
|
29
|
+
if @roadmap.team_member_names.include? sugguest
|
30
30
|
msg += " [#{sugguest}]"
|
31
31
|
end
|
32
32
|
|
@@ -34,6 +34,7 @@ module DevFlow
|
|
34
34
|
ans = STDIN.gets.chomp!
|
35
35
|
ans = sugguest unless ans.size > 0
|
36
36
|
error "Unknown member! Can not continue." unless all_member_names.include? ans
|
37
|
+
error "You are not in the team, you should not edit the files under this project" unless @roadmap.team_member_names.include? ans
|
37
38
|
|
38
39
|
# find the default git remote server
|
39
40
|
@config["whoami"] = ans
|
data/lib/dev_flow/roadmap.rb
CHANGED
@@ -22,6 +22,16 @@ module DevFlow
|
|
22
22
|
@config[:title]
|
23
23
|
end
|
24
24
|
|
25
|
+
def team_member_names
|
26
|
+
mary = @config["team"] || Array.new
|
27
|
+
%w[leader moderator supervisor].each do |role|
|
28
|
+
if @config[role]
|
29
|
+
mary << @config[role] unless mary.include? @config[role]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
mary
|
33
|
+
end
|
34
|
+
|
25
35
|
def parse file = nil
|
26
36
|
self.file = file if file
|
27
37
|
fh = File.open(self.file, "r:utf-8")
|
data/lib/dev_flow/version.rb
CHANGED
data/spec/roadmap_spec.rb
CHANGED
@@ -23,6 +23,13 @@ describe DevFlow::RoadMap do
|
|
23
23
|
roadmap.ln_tasks[70].dependencies[0].branch_name.should eq("release_api_design_0.1")
|
24
24
|
roadmap.ln_tasks[70].dependencies[1].branch_name.should eq("model_spec")
|
25
25
|
end
|
26
|
+
|
27
|
+
it "return a list of team members" do
|
28
|
+
%w[huangw xuyc liudx cuibg wangqh].each do |m|
|
29
|
+
roadmap.team_member_names.include?(m).should be_true
|
30
|
+
end
|
31
|
+
roadmap.team_member_names.include?('sunyr').should be_false
|
32
|
+
end
|
26
33
|
end
|
27
34
|
end
|
28
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dev_flow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-04-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: term-ansicolor
|