gitsu 0.0.1
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/.gitignore +21 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +676 -0
- data/README.md +38 -0
- data/Rakefile +3 -0
- data/TODO +10 -0
- data/bin/git-su +13 -0
- data/bin/git-whoami +13 -0
- data/features/add_user.feature +26 -0
- data/features/change_user_in_different_scopes.feature +24 -0
- data/features/clear_user.feature +28 -0
- data/features/configure_default_scope.feature +9 -0
- data/features/edit_config.feature +8 -0
- data/features/list_users.feature +16 -0
- data/features/print_current_user.feature +60 -0
- data/features/print_options.feature +8 -0
- data/features/step_definitions/gitsu_steps.rb +193 -0
- data/features/support/env.rb +2 -0
- data/features/switch_to_fully_qualified_user.feature +10 -0
- data/features/switch_to_stored_user.feature +49 -0
- data/gitsu.gemspec +19 -0
- data/lib/gitsu.rb +9 -0
- data/lib/gitsu/factory.rb +23 -0
- data/lib/gitsu/git.rb +136 -0
- data/lib/gitsu/gitsu.rb +94 -0
- data/lib/gitsu/runner.rb +18 -0
- data/lib/gitsu/shell.rb +16 -0
- data/lib/gitsu/switcher.rb +94 -0
- data/lib/gitsu/user.rb +55 -0
- data/lib/gitsu/user_file.rb +32 -0
- data/lib/gitsu/user_list.rb +47 -0
- data/lib/gitsu/version.rb +3 -0
- data/man/git-su.1.ronn +120 -0
- data/spec/gitsu/git_spec.rb +189 -0
- data/spec/gitsu/gitsu_spec.rb +177 -0
- data/spec/gitsu/runner_spec.rb +27 -0
- data/spec/gitsu/switcher_spec.rb +196 -0
- data/spec/gitsu/user_list_spec.rb +82 -0
- data/spec/gitsu/user_spec.rb +33 -0
- data/spec/spec_helper.rb +1 -0
- metadata +106 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
module GitSu
|
2
|
+
describe User do
|
3
|
+
describe "#parse" do
|
4
|
+
context "when passed a valid mail string (e.g. 'John Galt <jgalt@example.com>')" do
|
5
|
+
it "parses a user from the supplied string " do
|
6
|
+
user = User.parse('John Galt <jgalt@example.com>')
|
7
|
+
user.name.should == 'John Galt'
|
8
|
+
user.email.should == 'jgalt@example.com'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
context "when passed an invalid string" do
|
13
|
+
it "raises error" do
|
14
|
+
expect {User.parse('xxx')}.to raise_error User::ParseError
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "#to_s" do
|
20
|
+
it "returns a string representation of the user" do
|
21
|
+
user = User.new("John Galt", "jg@example.com")
|
22
|
+
user.to_s.should == "John Galt <jg@example.com>"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
describe "#to_ansi_s" do
|
27
|
+
it "returns a colored string representation of the user" do
|
28
|
+
user = User.new("John Galt", "jg@example.com")
|
29
|
+
user.to_ansi_s("\e[34m", "\e[35m", "\e[0m").should == "\e[34mJohn Galt\e[0m \e[35m<jg@example.com>\e[0m"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'gitsu'
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gitsu
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- drrb
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-17 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Manage your Git users
|
15
|
+
email:
|
16
|
+
- drrb@github.com
|
17
|
+
executables:
|
18
|
+
- git-su
|
19
|
+
- git-whoami
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- .gitignore
|
24
|
+
- Gemfile
|
25
|
+
- LICENSE.txt
|
26
|
+
- README.md
|
27
|
+
- Rakefile
|
28
|
+
- TODO
|
29
|
+
- bin/git-su
|
30
|
+
- bin/git-whoami
|
31
|
+
- features/add_user.feature
|
32
|
+
- features/change_user_in_different_scopes.feature
|
33
|
+
- features/clear_user.feature
|
34
|
+
- features/configure_default_scope.feature
|
35
|
+
- features/edit_config.feature
|
36
|
+
- features/list_users.feature
|
37
|
+
- features/print_current_user.feature
|
38
|
+
- features/print_options.feature
|
39
|
+
- features/step_definitions/gitsu_steps.rb
|
40
|
+
- features/support/env.rb
|
41
|
+
- features/switch_to_fully_qualified_user.feature
|
42
|
+
- features/switch_to_stored_user.feature
|
43
|
+
- gitsu.gemspec
|
44
|
+
- lib/gitsu.rb
|
45
|
+
- lib/gitsu/factory.rb
|
46
|
+
- lib/gitsu/git.rb
|
47
|
+
- lib/gitsu/gitsu.rb
|
48
|
+
- lib/gitsu/runner.rb
|
49
|
+
- lib/gitsu/shell.rb
|
50
|
+
- lib/gitsu/switcher.rb
|
51
|
+
- lib/gitsu/user.rb
|
52
|
+
- lib/gitsu/user_file.rb
|
53
|
+
- lib/gitsu/user_list.rb
|
54
|
+
- lib/gitsu/version.rb
|
55
|
+
- man/git-su.1.ronn
|
56
|
+
- spec/gitsu/git_spec.rb
|
57
|
+
- spec/gitsu/gitsu_spec.rb
|
58
|
+
- spec/gitsu/runner_spec.rb
|
59
|
+
- spec/gitsu/switcher_spec.rb
|
60
|
+
- spec/gitsu/user_list_spec.rb
|
61
|
+
- spec/gitsu/user_spec.rb
|
62
|
+
- spec/spec_helper.rb
|
63
|
+
homepage: http://drrb.github.com/gitsu
|
64
|
+
licenses: []
|
65
|
+
post_install_message:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
68
|
+
- lib
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
requirements: []
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 1.8.23
|
84
|
+
signing_key:
|
85
|
+
specification_version: 3
|
86
|
+
summary: Gitsu allows you to quickly configure and switch between Git users
|
87
|
+
test_files:
|
88
|
+
- features/add_user.feature
|
89
|
+
- features/change_user_in_different_scopes.feature
|
90
|
+
- features/clear_user.feature
|
91
|
+
- features/configure_default_scope.feature
|
92
|
+
- features/edit_config.feature
|
93
|
+
- features/list_users.feature
|
94
|
+
- features/print_current_user.feature
|
95
|
+
- features/print_options.feature
|
96
|
+
- features/step_definitions/gitsu_steps.rb
|
97
|
+
- features/support/env.rb
|
98
|
+
- features/switch_to_fully_qualified_user.feature
|
99
|
+
- features/switch_to_stored_user.feature
|
100
|
+
- spec/gitsu/git_spec.rb
|
101
|
+
- spec/gitsu/gitsu_spec.rb
|
102
|
+
- spec/gitsu/runner_spec.rb
|
103
|
+
- spec/gitsu/switcher_spec.rb
|
104
|
+
- spec/gitsu/user_list_spec.rb
|
105
|
+
- spec/gitsu/user_spec.rb
|
106
|
+
- spec/spec_helper.rb
|