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.
@@ -17,7 +17,7 @@ members:
17
17
  supervisor: huangw
18
18
  leader: xuyc
19
19
  moderator: cuibg
20
- team: [huangw, xuyc, liudx, cuibg, wangqh]
20
+ team: [huangw, liudx, cuibg, wangqh]
21
21
  year: 2013
22
22
  % ----
23
23
 
@@ -9,24 +9,24 @@ module DevFlow
9
9
 
10
10
  # find the current user
11
11
  sugguest = @config["whoami"] if @config["whoami"]
12
- unless all_member_names.include? sugguest
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 all_member_names.include? sugguest
17
+ info "found #{suggest}" if @roadmap.team_member_names.include? sugguest
18
18
  end
19
19
 
20
- unless all_member_names.include? sugguest
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 all_member_names.include? sugguest
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 = all_member_names.join(", ")
29
- if all_member_names.include? sugguest
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
@@ -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")
@@ -1,3 +1,3 @@
1
1
  module DevFlow
2
- VERSION = '0.0.13'
2
+ VERSION = '0.1.0'
3
3
  end
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.13
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-03-28 00:00:00.000000000 Z
12
+ date: 2013-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: term-ansicolor